30{
34 JLimit_t& numberOfEvents = inputFile.getLimit();
38
39 try {
40
41 JParser<> zap(
"Example program to resize coordinate system of Monte Carlo events.");
42
48
49 zap(argc, argv);
50 }
51 catch(const exception &error) {
52 FATAL(error.what() << endl);
53 }
54
55
58 bool genhen = false;
59 bool mupage = false;
60
61 {
63
67
69
71
73
74 buffer.livetime.mul(
scale);
75
76 } else {
77
78 FATAL(
"Invalid generator." << endl);
79 }
80
82 }
83
84
86
88
90
92
94
95 if (genhen) {
96
98
102 }
103 }
104
105 if (mupage) {
106
107 double E = 0.0;
109
110 for (vector<Trk>::const_iterator track = event->mc_trks.begin(); track != event->mc_trks.end(); ++track) {
111 E += track->E;
112 pos += track->pos * track->E;
113 }
114
115 pos /= E;
118
120 track->pos += pos;
121 }
122 }
123
125 }
127
129}
void scale(vector< double > &v, double c)
scale vector content
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
JAANET::livetime livetime
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
bool is_genhen(const JHead &header)
Check for generator.
Vec getOrigin(const JHead &header)
Get origin.
void copy(const Head &from, JHead &to)
Copy header from from to to.
bool is_mupage(const JHead &header)
Check for generator.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.
The Vec class is a straightforward 3-d vector, which also works in pyroot.