33 const char*
const volume_t =
"volume";
34 const char*
const surface_t =
"surface";
43int main(
int argc,
char **argv)
65 zap[
'C'] =
make_field(cylinder,
"generation volume");
66 zap[
'P'] =
make_field(type,
"PDG particle code");
67 zap[
'E'] =
make_field(E_GeV,
"energy range [log10(E)]");
68 zap[
'O'] =
make_field(option) = surface_t, volume_t;
74 catch(
const exception& error) {
75 FATAL(error.what() << endl);
93 for (
int i = 0; i !=
sizeof(A)/
sizeof(A[0]); ++i) {
97 for (
counter_type counter = 0; counter != numberOfEvents; ++counter) {
99 STATUS(
"event: " << setw(10) << counter <<
'\r');
DEBUG(endl);
106 if (option == volume_t) {
110 }
else if (option == surface_t) {
112 const double phi = gRandom->Uniform(-PI, +PI);
113 const double u = gRandom->Uniform(0.0, W);
123 }
else if (u <= A[1]) {
128 }
else if (u <= A[2]) {
139 cylinder.
getY() + R*sin(phi),
144 FATAL(
"Invalid option " << option << endl);
155 const double E =
pow(10.0, x);
179 JHead buffer(header);
189 copy(buffer, header);
Recording of objects on file according a format that follows from the file name extension.
int main(int argc, char **argv)
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class to define a range between two values.
ROOT TTree parameter settings of various packages.
void push(T JHead::*pd)
Push given data member to Head.
JAANET::fixedcan fixedcan
double getRadius() const
Get radius.
double getY() const
Get y position.
double getX() const
Get x position.
double getZmin() const
Get minimal z position.
intersection_type getIntersection(const JAxis3D &axis) const
Get intersection points of axis with cylinder.
double getZmax() const
Get maximal z position.
Data structure for direction in three dimensions.
Data structure for vector in three dimensions.
Utility class to parse command line options.
JDirection3D getDirection(const Vec &dir)
Get direction.
void copy(const Head &from, JHead &to)
Copy header from from to to.
JPosition3D getPosition(const Vec &pos)
Get position.
JVector3D getRandomPosition(const JSphere3D &sphere)
Get random position.
T pow(const T &x, const double y)
Power .
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Long64_t counter_type
Type definition for counter.
void randomize(JDAQChronometer *p)
Randomize chronometer.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
double mc_t
MC: time where the mc-event was put in the timeslice, since start of run (offset+frameidx*timeslice_d...
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Type definition of range.
double ycenter
y-center [m]
double xcenter
x-center [m]
Auxiliary data structure to configure random number generator.
bool set(TRandom *&pr) const
Configure random number generator.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
int type
MC: particle type in PDG encoding.
double E
Energy [GeV] (either MC truth or reconstructed)
double t
track time [ns] (when the particle is at pos )
Vec pos
postion [m] of the track at time t
static const int TRK_ST_FINALSTATE
for MC: the particle must be processed by detector simulation ('track_in' tag in evt files)....