gNeutronOscEvGen.cxx
Go to the documentation of this file.
1 //________________________________________________________________________________________
2 /*!
3 
4 \program gevgen_nosc
5 
6 \brief A GENIE-based neutron oscillation event generation application.
7 
8  *** Synopsis :
9 
10  gevgen_nosc [-h]
11  [-r run#]
12  -n n_of_events
13  [-m decay_mode]
14  -g geometry
15  [-L geometry_length_units]
16  [-D geometry_density_units]
17  [-t geometry_top_volume_name]
18  [-o output_event_file_prefix]
19  [--seed random_number_seed]
20  [--message-thresholds xml_file]
21  [--event-record-print-level level]
22  [--mc-job-status-refresh-rate rate]
23 
24  *** Options :
25 
26  [] Denotes an optional argument
27 
28  -h
29  Prints out the gevgen_nosc syntax and exits.
30  -r
31  Specifies the MC run number [default: 1000].
32  -n
33  Specifies how many events to generate.
34  -m
35  Nucleon decay mode ID:
36  ---------------------------------------------------------
37  ID | Decay Mode
38  |
39  ---------------------------------------------------------
40  0 | Random decay mode
41  1 | p + nbar --> \pi^{+} + \pi^{0}
42  2 | p + nbar --> \pi^{+} + 2\pi^{0}
43  3 | p + nbar --> \pi^{+} + 3\pi^{0}
44  4 | p + nbar --> 2\pi^{+} + \pi^{-} + \pi^{0}
45  5 | p + nbar --> 2\pi^{+} + \pi^{-} + 2\pi^{0}
46  6 | p + nbar --> 2\pi^{+} + \pi^{-} + 2\omega^{0}
47  7 | p + nbar --> 3\pi^{+} + 2\pi^{-} + \pi^{0}
48  8 | n + nbar --> \pi^{+} + \pi^{-}
49  9 | n + nbar --> 2\pi^{0}
50  10 | n + nbar --> \pi^{+} + \pi^{-} + \pi^{0}
51  11 | n + nbar --> \pi^{+} + \pi^{-} + 2\pi^{0}
52  12 | n + nbar --> \pi^{+} + \pi^{-} + 3\pi^{0}
53  13 | n + nbar --> 2\pi^{+} + 2\pi^{-}
54  14 | n + nbar --> 2\pi^{+} + 2\pi^{-} + \pi^{0}
55  15 | n + nbar --> \pi^{+} + \pi^{-} + \omega^{0}
56  16 | n + nbar --> 2\pi^{+} + 2\pi^{-} + 2\pi^{0}
57  ---------------------------------------------------------
58 
59  -g
60  Input 'geometry'.
61  This option can be used to specify any of:
62  1 > A ROOT file containing a ROOT/GEANT geometry description
63  [Examples]
64  - To use the master volume from the ROOT geometry stored
65  in the laguna-lbno.root file, type:
66  '-g /some/path/laguna-lbno.root'
67  2 > A mix of target materials, each with its corresponding weight,
68  typed as a comma-separated list of nuclear PDG codes (in the
69  std PDG2006 convention: 10LZZZAAAI) with the weight fractions
70  in brackets, eg code1[fraction1],code2[fraction2],...
71  If that option is used (no detailed input geometry description)
72  then the interaction vertices are distributed in the detector
73  by the detector MC.
74  [Examples]
75  - To use a target mix of 88.9% O16 and 11.1% Hydrogen type:
76  '-g 1000080160[0.889],1000010010[0.111]'
77  -L
78  Input geometry length units, eg 'm', 'cm', 'mm', ...
79  [default: 'mm']
80  -D
81  Input geometry density units, eg 'g_cm3', 'clhep_def_density_unit',...
82  [default: 'g_cm3']
83  -t
84  Input 'top volume' for event generation.
85  The option be used to force event generation in given sub-detector.
86  [default: the 'master volume' of the input geometry]
87  You can also use the -t option to switch generation on/off at
88  multiple volumes as, for example, in:
89  `-t +Vol1-Vol2+Vol3-Vol4',
90  `-t "+Vol1 -Vol2 +Vol3 -Vol4"',
91  `-t -Vol2-Vol4+Vol1+Vol3',
92  `-t "-Vol2 -Vol4 +Vol1 +Vol3"'m
93  where:
94  "+Vol1" and "+Vol3" tells GENIE to `switch on' Vol1 and Vol3, while
95  "-Vol2" and "-Vol4" tells GENIE to `switch off' Vol2 and Vol4.
96  If the very first character is a '+', GENIE will neglect all volumes
97  except the ones explicitly turned on. Vice versa, if the very first
98  character is a `-', GENIE will keep all volumes except the ones
99  explicitly turned off (feature contributed by J.Holeczek).
100  -o
101  Sets the prefix of the output event file.
102  The output filename is built as:
103  [prefix].[run_number].[event_tree_format].[file_format]
104  The default output filename is:
105  gntp.[run_number].ghep.root
106  This cmd line arguments lets you override 'gntp'
107  --seed
108  Random number seed.
109 
110 \author Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
111  University of Liverpool & STFC Rutherford Appleton Lab
112 
113 \created November 03, 2011
114 
115 \cpright Copyright (c) 2003-2017, GENIE Neutrino MC Generator Collaboration
116  For the full text of the license visit http://copyright.genie-mc.org
117  or see $GENIE/LICENSE
118 
119 */
120 //_________________________________________________________________________________________
121 
122 #include <cassert>
123 #include <cstdlib>
124 #include <string>
125 #include <vector>
126 #include <sstream>
127 
128 #include <TSystem.h>
129 
130 #include "Algorithm/AlgFactory.h"
131 #include "EVGCore/EventRecord.h"
132 #include "EVGCore/EventGeneratorI.h"
134 #include "EVGDrivers/GMCJMonitor.h"
135 #include "Messenger/Messenger.h"
136 #include "Ntuple/NtpWriter.h"
139 #include "Numerical/RandomGen.h"
140 #include "PDG/PDGCodes.h"
141 #include "PDG/PDGUtils.h"
142 #include "PDG/PDGLibrary.h"
143 #include "Utils/StringUtils.h"
144 #include "Utils/UnitUtils.h"
145 #include "Utils/PrintUtils.h"
146 #include "Utils/AppInit.h"
147 #include "Utils/RunOpt.h"
148 #include "Utils/CmdLnArgParser.h"
149 
150 using std::string;
151 using std::vector;
152 using std::ostringstream;
153 
154 using namespace genie;
155 
156 // function prototypes
157 void GetCommandLineArgs (int argc, char ** argv);
158 void PrintSyntax (void);
159 int SelectAnnihilationMode (int pdg_code);
160 int SelectInitState (void);
162 
163 //
164 string kDefOptGeomLUnits = "mm"; // default geometry length units
165 string kDefOptGeomDUnits = "g_cm3"; // default geometry density units
166 NtpMCFormat_t kDefOptNtpFormat = kNFGHEP; // default event tree format
167 string kDefOptEvFilePrefix = "gntp";
168 
169 //
170 Long_t gOptRunNu = 1000; // run number
171 int gOptNev = 10; // number of events to generate
172 NeutronOscMode_t gOptDecayMode = kNONull; // neutron oscillation mode
173 string gOptEvFilePrefix = kDefOptEvFilePrefix; // event file prefix
174 bool gOptUsingRootGeom = false; // using root geom or target mix?
175 map<int,double> gOptTgtMix; // target mix (tgt pdg -> wght frac) / if not using detailed root geom
176 string gOptRootGeom; // input ROOT file with realistic detector geometry
177 string gOptRootGeomTopVol = ""; // input geometry top event generation volume
178 double gOptGeomLUnits = 0; // input geometry length units
179 double gOptGeomDUnits = 0; // input geometry density units
180 long int gOptRanSeed = -1; // random number seed
181 
182 //_________________________________________________________________________________________
183 int main(int argc, char ** argv)
184 {
185  // Parse command line arguments
186  GetCommandLineArgs(argc,argv);
187 
188  // Init messenger and random number seed
189  utils::app_init::MesgThresholds(RunOpt::Instance()->MesgThresholdFiles());
191 
192  // Initialize an Ntuple Writer to save GHEP records into a TTree
195  ntpw.Initialize();
196 
197  // Create a MC job monitor for a periodically updated status file
198  GMCJMonitor mcjmonitor(gOptRunNu);
199  mcjmonitor.SetRefreshRate(RunOpt::Instance()->MCJobStatusRefreshRate());
200 
201  // Set GHEP print level
202  GHepRecord::SetPrintLevel(RunOpt::Instance()->EventRecordPrintLevel());
203 
204  // Get the nucleon decay generator
205  const EventRecordVisitorI * mcgen = NeutronOscGenerator();
206 
207  // Event loop
208  int ievent = 0;
209  while (1)
210  {
211  if(ievent == gOptNev) break;
212 
213  LOG("gevgen_nosc", pNOTICE)
214  << " *** Generating event............ " << ievent;
215 
216  EventRecord * event = new EventRecord;
217  int target = SelectInitState();
218  int decay = SelectAnnihilationMode(target);
219  Interaction * interaction = Interaction::NOsc(target,decay);
220  event->AttachSummary(interaction);
221 
222  // Simulate decay
223  mcgen->ProcessEventRecord(event);
224 
225  LOG("gevgen_nosc", pINFO)
226  << "Generated event: " << *event;
227 
228  // Add event at the output ntuple, refresh the mc job monitor & clean-up
229  ntpw.AddEventRecord(ievent, event);
230  mcjmonitor.Update(ievent,event);
231  delete event;
232 
233  ievent++;
234  } // event loop
235 
236  // Save the generated event tree & close the output file
237  ntpw.Save();
238 
239  LOG("gevgen_nosc", pNOTICE) << "Done!";
240 
241  return 0;
242 }
243 //_________________________________________________________________________________________
244 int SelectAnnihilationMode(int pdg_code)
245 {
246  // if the mode is set to 'random' (the default), pick one at random!
247  if (gOptDecayMode == kNORandom) {
248  int mode;
249 
250  std::string pdg_string = std::to_string(static_cast<long long>(pdg_code));
251  if (pdg_string.size() != 10) {
252  LOG("neutron_osc", pERROR)
253  << "Expecting PDG code to be a 10-digit integer; instead, it's the following: " << pdg_string;
254  gAbortingInErr = true;
255  exit(1);
256  }
257 
258  // count number of protons & neutrons
259  int n_nucleons = std::stoi(pdg_string.substr(6,3)) - 1;
260  int n_protons = std::stoi(pdg_string.substr(3,3));
261 
262  // factor proton / neutron ratio into branching ratios
263  double proton_frac = ((double)n_protons) / ((double)n_nucleons);
264  double neutron_frac = 1 - proton_frac;
265 
266  // set branching ratios, taken from bubble chamber data
267  const int n_modes = 16;
268  double br [n_modes] = { 0.010, 0.080, 0.100, 0.220,
269  0.360, 0.160, 0.070, 0.020,
270  0.015, 0.065, 0.110, 0.280,
271  0.070, 0.240, 0.100, 0.100 };
272 
273  for (int i = 0; i < n_modes; i++) {
274  if (i < 7)
275  br[i] *= proton_frac;
276  else
277  br[i] *= neutron_frac;
278  }
279 
280  // randomly generate a number between 1 and 0
281  RandomGen * rnd = RandomGen::Instance();
282  rnd->SetSeed(0);
283  double p = rnd->RndNum().Rndm();
284 
285  // loop through all modes, figure out which one our random number corresponds to
286  double threshold = 0;
287  for (int i = 0; i < n_modes; i++) {
288  threshold += br[i];
289  if (p < threshold) {
290  // once we've found our mode, return it!
291  mode = i + 1;
292  return mode;
293  }
294  }
295 
296  // error message, in case the random number selection fails
297  LOG("gevgen_nosc", pFATAL) << "Random selection of final state failed!";
298  gAbortingInErr = true;
299  exit(1);
300  }
301 
302  // if specific annihilation mode specified, just use that
303  else {
304  int mode = (int) gOptDecayMode;
305  return mode;
306  }
307 }
308 //_________________________________________________________________________________________
310 {
311  if (gOptTgtMix.size() > 1) {
312  LOG("gevgen_nosc", pERROR)
313  << "Target mix not currently supported. You must specify a single target nucleus!";
314  gAbortingInErr = true;
315  exit(1);
316  }
317 
318  int pdg_code = gOptTgtMix.begin()->first;
319 
320  return pdg_code;
321 }
322 //_________________________________________________________________________________________
324 {
325  string sname = "genie::EventGenerator";
326  string sconfig = "NeutronOsc";
327  AlgFactory * algf = AlgFactory::Instance();
328  const EventRecordVisitorI * mcgen =
329  dynamic_cast<const EventRecordVisitorI *> (algf->GetAlgorithm(sname,sconfig));
330  if(!mcgen) {
331  LOG("gevgen_nosc", pFATAL) << "Couldn't instantiate the neutron oscillation generator";
332  gAbortingInErr = true;
333  exit(1);
334  }
335  return mcgen;
336 }
337 //_________________________________________________________________________________________
338 void GetCommandLineArgs(int argc, char ** argv)
339 {
340  LOG("gevgen_nosc", pINFO) << "Parsing command line arguments";
341 
342  // Common run options.
344 
345  // Parse run options for this app
346 
347  CmdLnArgParser parser(argc,argv);
348 
349  // help?
350  bool help = parser.OptionExists('h');
351  if(help) {
352  PrintSyntax();
353  exit(0);
354  }
355 
356  // run number
357  if( parser.OptionExists('r') ) {
358  LOG("gevgen_nosc", pDEBUG) << "Reading MC run number";
359  gOptRunNu = parser.ArgAsLong('r');
360  } else {
361  LOG("gevgen_nosc", pDEBUG) << "Unspecified run number - Using default";
362  gOptRunNu = 1000;
363  } //-r
364 
365 
366  // number of events
367  if( parser.OptionExists('n') ) {
368  LOG("gevgen_nosc", pDEBUG)
369  << "Reading number of events to generate";
370  gOptNev = parser.ArgAsInt('n');
371  } else {
372  LOG("gevgen_nosc", pFATAL)
373  << "You need to specify the number of events";
374  PrintSyntax();
375  exit(0);
376  } //-n
377 
378  // decay mode
379  int mode = 0;
380  if( parser.OptionExists('m') ) {
381  LOG("gevgen_nosc", pDEBUG)
382  << "Reading annihilation mode";
383  mode = parser.ArgAsInt('m');
384  }
387  if(!valid_mode) {
388  LOG("gevgen_nosc", pFATAL)
389  << "You need to specify a valid annihilation mode";
390  PrintSyntax();
391  exit(0);
392  } //-m
393 
394  //
395  // geometry
396  //
397 
398  string geom = "";
399  string lunits, dunits;
400  if( parser.OptionExists('g') ) {
401  LOG("gevgen_nosc", pDEBUG) << "Getting input geometry";
402  geom = parser.ArgAsString('g');
403 
404  // is it a ROOT file that contains a ROOT geometry?
405  bool accessible_geom_file =
406  ! (gSystem->AccessPathName(geom.c_str()));
407  if (accessible_geom_file) {
408  gOptRootGeom = geom;
409  gOptUsingRootGeom = true;
410  }
411  } else {
412  LOG("gevgen_nosc", pFATAL)
413  << "No geometry option specified - Exiting";
414  PrintSyntax();
415  exit(1);
416  } //-g
417 
418  if(gOptUsingRootGeom) {
419  // using a ROOT geometry - get requested geometry units
420 
421  // legth units:
422  if( parser.OptionExists('L') ) {
423  LOG("gevgen_nosc", pDEBUG)
424  << "Checking for input geometry length units";
425  lunits = parser.ArgAsString('L');
426  } else {
427  LOG("gevgen_nosc", pDEBUG) << "Using default geometry length units";
428  lunits = kDefOptGeomLUnits;
429  } // -L
430  // density units:
431  if( parser.OptionExists('D') ) {
432  LOG("gevgen_nosc", pDEBUG)
433  << "Checking for input geometry density units";
434  dunits = parser.ArgAsString('D');
435  } else {
436  LOG("gevgen_nosc", pDEBUG) << "Using default geometry density units";
437  dunits = kDefOptGeomDUnits;
438  } // -D
441 
442  // check whether an event generation volume name has been
443  // specified -- default is the 'top volume'
444  if( parser.OptionExists('t') ) {
445  LOG("gevgen_nosc", pDEBUG) << "Checking for input volume name";
446  gOptRootGeomTopVol = parser.ArgAsString('t');
447  } else {
448  LOG("gevgen_nosc", pDEBUG) << "Using the <master volume>";
449  } // -t
450 
451  } // using root geom?
452 
453  else {
454  // User has specified a target mix.
455  // Decode the list of target pdf codes & their corresponding weight fraction
456  // (specified as 'pdg_code_1[fraction_1],pdg_code_2[fraction_2],...')
457  // See documentation on top section of this file.
458  //
459  gOptTgtMix.clear();
460  vector<string> tgtmix = utils::str::Split(geom,",");
461  if(tgtmix.size()==1) {
462  int pdg = atoi(tgtmix[0].c_str());
463  double wgt = 1.0;
464  gOptTgtMix.insert(map<int, double>::value_type(pdg, wgt));
465  } else {
466  vector<string>::const_iterator tgtmix_iter = tgtmix.begin();
467  for( ; tgtmix_iter != tgtmix.end(); ++tgtmix_iter) {
468  string tgt_with_wgt = *tgtmix_iter;
469  string::size_type open_bracket = tgt_with_wgt.find("[");
470  string::size_type close_bracket = tgt_with_wgt.find("]");
471  if (open_bracket ==string::npos ||
472  close_bracket==string::npos)
473  {
474  LOG("gevgen_nosc", pFATAL)
475  << "You made an error in specifying the target mix";
476  PrintSyntax();
477  exit(1);
478  }
479  string::size_type ibeg = 0;
480  string::size_type iend = open_bracket;
481  string::size_type jbeg = open_bracket+1;
482  string::size_type jend = close_bracket;
483  int pdg = atoi(tgt_with_wgt.substr(ibeg,iend-ibeg).c_str());
484  double wgt = atof(tgt_with_wgt.substr(jbeg,jend-jbeg).c_str());
485  LOG("gevgen_nosc", pDEBUG)
486  << "Adding to target mix: pdg = " << pdg << ", wgt = " << wgt;
487  gOptTgtMix.insert(map<int, double>::value_type(pdg, wgt));
488 
489  }// tgtmix_iter
490  } // >1 materials in mix
491  } // using tgt mix?
492 
493  // event file prefix
494  if( parser.OptionExists('o') ) {
495  LOG("gevgen_nosc", pDEBUG) << "Reading the event filename prefix";
496  gOptEvFilePrefix = parser.ArgAsString('o');
497  } else {
498  LOG("gevgen_nosc", pDEBUG)
499  << "Will set the default event filename prefix";
501  } //-o
502 
503 
504  // random number seed
505  if( parser.OptionExists("seed") ) {
506  LOG("gevgen_nosc", pINFO) << "Reading random number seed";
507  gOptRanSeed = parser.ArgAsLong("seed");
508  } else {
509  LOG("gevgen_nosc", pINFO) << "Unspecified random number seed - Using default";
510  gOptRanSeed = -1;
511  }
512 
513  //
514  // >>> print the command line options
515  //
516 
517  PDGLibrary * pdglib = PDGLibrary::Instance();
518 
519  ostringstream gminfo;
520  if (gOptUsingRootGeom) {
521  gminfo << "Using ROOT geometry - file: " << gOptRootGeom
522  << ", top volume: "
523  << ((gOptRootGeomTopVol.size()==0) ? "<master volume>" : gOptRootGeomTopVol)
524  << ", length units: " << lunits
525  << ", density units: " << dunits;
526  } else {
527  gminfo << "Using target mix - ";
529  for(iter = gOptTgtMix.begin(); iter != gOptTgtMix.end(); ++iter) {
530  int pdg_code = iter->first;
531  double wgt = iter->second;
532  TParticlePDG * p = pdglib->Find(pdg_code);
533  if(p) {
534  string name = p->GetName();
535  gminfo << "(" << name << ") -> " << 100*wgt << "% / ";
536  }//p?
537  }
538  }
539 
540  LOG("gevgen_nosc", pNOTICE)
541  << "\n\n"
542  << utils::print::PrintFramedMesg("gevgen_nosc job configuration");
543 
544  LOG("gevgen_nosc", pNOTICE)
545  << "\n @@ Run number: " << gOptRunNu
546  << "\n @@ Random number seed: " << gOptRanSeed
547  << "\n @@ Decay channel $ " << utils::neutron_osc::AsString(gOptDecayMode)
548  << "\n @@ Geometry $ " << gminfo.str()
549  << "\n @@ Statistics $ " << gOptNev << " events";
550 
551  //
552  // Temporary warnings...
553  //
554  if(gOptUsingRootGeom) {
555  LOG("gevgen_nosc", pWARN)
556  << "\n ** ROOT geometries not supported yet in neutron oscillation mode"
557  << "\n ** (they will be in the very near future)"
558  << "\n ** Please specify a `target mix' instead.";
559  gAbortingInErr = true;
560  exit(1);
561  }
562 }
563 //_________________________________________________________________________________________
564 void PrintSyntax(void)
565 {
566  LOG("gevgen_nosc", pFATAL)
567  << "\n **Syntax**"
568  << "\n gevgen_nosc [-h] "
569  << "\n [-r run#]"
570  << "\n -m decay_mode"
571  << "\n -g geometry"
572  << "\n [-t top_volume_name_at_geom]"
573  << "\n [-L length_units_at_geom]"
574  << "\n [-D density_units_at_geom]"
575  << "\n -n n_of_events "
576  << "\n [-o output_event_file_prefix]"
577  << "\n [--seed random_number_seed]"
578  << "\n [--message-thresholds xml_file]"
579  << "\n [--event-record-print-level level]"
580  << "\n [--mc-job-status-refresh-rate rate]"
581  << "\n"
582  << " Please also read the detailed documentation at http://www.genie-mc.org"
583  << " or look at the source code: $GENIE/src/support/ndcy/EvGen/gNeutronOscEvGen.cxx"
584  << "\n";
585 }
586 //_________________________________________________________________________________________
587 
void RandGen(long int seed)
Definition: AppInit.cxx:37
static void SetPrintLevel(int print_level)
Definition: GHepRecord.cxx:983
bool gOptUsingRootGeom
long ArgAsLong(char opt)
int main(int argc, char **argv)
string ArgAsString(char opt)
#include "Numerical/GSFunc.h"
Definition: AlgCmp.h:26
const EventRecordVisitorI * NeutronOscGenerator(void)
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
#define pERROR
Definition: Messenger.h:50
int SelectAnnihilationMode(int pdg_code)
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
std::string string
Definition: nybbler.cc:12
string gOptEvFilePrefix
void ReadFromCommandLine(int argc, char **argv)
Definition: RunOpt.cxx:81
#define pFATAL
Definition: Messenger.h:47
long int gOptRanSeed
void Update(int iev, const EventRecord *event)
Definition: GMCJMonitor.cxx:58
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
void SetRefreshRate(int rate)
Definition: GMCJMonitor.cxx:53
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Summary information for an interaction.
Definition: Interaction.h:53
Simple class to create & update MC job status files and env. vars. This is used to be able to keep tr...
Definition: GMCJMonitor.h:30
NeutronOscMode_t gOptDecayMode
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
intermediate_table::const_iterator const_iterator
Long_t gOptRunNu
bool IsValidMode(NeutronOscMode_t ndm)
void GetCommandLineArgs(int argc, char **argv)
string kDefOptEvFilePrefix
double UnitFromString(string u)
const Algorithm * GetAlgorithm(const AlgId &algid)
Definition: AlgFactory.cxx:86
NtpMCFormat_t kDefOptNtpFormat
void Save(void)
get the even tree
Definition: NtpWriter.cxx:214
#define pINFO
Definition: Messenger.h:53
void AddEventRecord(int ievent, const EventRecord *ev_rec)
save the event tree
Definition: NtpWriter.cxx:69
#define pWARN
Definition: Messenger.h:51
string gOptRootGeomTopVol
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Definition: EventRecord.h:38
TRandom3 & RndNum(void) const
rnd number generator used by MC integrators & other numerical methods
Definition: RandomGen.h:78
string AsString(NeutronOscMode_t ndm)
p
Definition: test.py:228
void PrintSyntax(void)
void CustomizeFilenamePrefix(string prefix)
Definition: NtpWriter.cxx:123
void Initialize(void)
add event
Definition: NtpWriter.cxx:95
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:45
static RunOpt * Instance(void)
Definition: RunOpt.cxx:55
vector< string > Split(string input, string delim)
Definition: StringUtils.cxx:42
static AlgFactory * Instance()
Definition: AlgFactory.cxx:75
A utility class to facilitate creating the GENIE MC Ntuple from the output GENIE GHEP event records...
Definition: NtpWriter.h:40
Singleton class to load & serve a TDatabasePDG.
Definition: PDGLibrary.h:27
string kDefOptGeomDUnits
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:63
int SelectInitState(void)
map< int, double > gOptTgtMix
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
Definition: PrintUtils.cxx:171
string gOptRootGeom
double gOptGeomLUnits
void MesgThresholds(string inpfile)
Command line argument parser.
enum genie::ENtpMCFormat NtpMCFormat_t
#define pNOTICE
Definition: Messenger.h:52
The GENIE Algorithm Factory.
Definition: AlgFactory.h:40
enum genie::ENeutronOscMode NeutronOscMode_t
bool gAbortingInErr
Definition: Messenger.cxx:56
int gOptNev
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
double gOptGeomDUnits
string kDefOptGeomLUnits
bool OptionExists(char opt)
was option set?
Event finding and building.
static Interaction * NOsc(int tgt, int annihilation_mode=-1)
#define pDEBUG
Definition: Messenger.h:54
void SetSeed(long int seed)
Definition: RandomGen.cxx:90