gNNBarOscEvGen.cxx
Go to the documentation of this file.
1 //________________________________________________________________________________________
2 /*!
3 
4 \program gevgen_nosc
5 
6 \brief A GENIE-based n-nbar 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-2019, The GENIE 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 
146 #include "Framework/Utils/AppInit.h"
147 #include "Framework/Utils/RunOpt.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 NNBarOscMode_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
206 
207  // Event loop
208  int ievent = 0;
209  while (1)
210  {
211  if(ievent == gOptNev) break;
212 
213  LOG("gevgen_nnbar_osc", 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_nnbar_osc", 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_nnbar_osc", 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("gevgen_nnbar_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
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_nnbar_osc", 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_nnbar_osc", 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 = "NNBarOsc";
327  AlgFactory * algf = AlgFactory::Instance();
328  const EventRecordVisitorI * mcgen =
329  dynamic_cast<const EventRecordVisitorI *> (algf->GetAlgorithm(sname,sconfig));
330  if(!mcgen) {
331  LOG("gevgen_nnbar_osc", pFATAL)
332  << "Couldn't instantiate the neutron oscillation generator";
333  gAbortingInErr = true;
334  exit(1);
335  }
336  return mcgen;
337 }
338 //_________________________________________________________________________________________
339 void GetCommandLineArgs(int argc, char ** argv)
340 {
341  LOG("gevgen_nnbar_osc", pINFO) << "Parsing command line arguments";
342 
343  // Common run options.
345 
346  // Parse run options for this app
347 
348  CmdLnArgParser parser(argc,argv);
349 
350  // help?
351  bool help = parser.OptionExists('h');
352  if(help) {
353  PrintSyntax();
354  exit(0);
355  }
356 
357  // run number
358  if( parser.OptionExists('r') ) {
359  LOG("gevgen_nnbar_osc", pDEBUG) << "Reading MC run number";
360  gOptRunNu = parser.ArgAsLong('r');
361  } else {
362  LOG("gevgen_nnbar_osc", pDEBUG) << "Unspecified run number - Using default";
363  gOptRunNu = 1000;
364  } //-r
365 
366 
367  // number of events
368  if( parser.OptionExists('n') ) {
369  LOG("gevgen_nnbar_osc", pDEBUG)
370  << "Reading number of events to generate";
371  gOptNev = parser.ArgAsInt('n');
372  } else {
373  LOG("gevgen_nnbar_osc", pFATAL)
374  << "You need to specify the number of events";
375  PrintSyntax();
376  exit(0);
377  } //-n
378 
379  // decay mode
380  int mode = 0;
381  if( parser.OptionExists('m') ) {
382  LOG("gevgen_nnbar_osc", pDEBUG)
383  << "Reading annihilation mode";
384  mode = parser.ArgAsInt('m');
385  }
386  gOptDecayMode = (NNBarOscMode_t) mode;
387  bool valid_mode = utils::nnbar_osc::IsValidMode(gOptDecayMode);
388  if(!valid_mode) {
389  LOG("gevgen_nnbar_osc", pFATAL)
390  << "You need to specify a valid annihilation mode";
391  PrintSyntax();
392  exit(0);
393  } //-m
394 
395  //
396  // geometry
397  //
398 
399  string geom = "";
400  string lunits, dunits;
401  if( parser.OptionExists('g') ) {
402  LOG("gevgen_nnbar_osc", pDEBUG) << "Getting input geometry";
403  geom = parser.ArgAsString('g');
404 
405  // is it a ROOT file that contains a ROOT geometry?
406  bool accessible_geom_file =
407  ! (gSystem->AccessPathName(geom.c_str()));
408  if (accessible_geom_file) {
409  gOptRootGeom = geom;
410  gOptUsingRootGeom = true;
411  }
412  } else {
413  LOG("gevgen_nnbar_osc", pFATAL)
414  << "No geometry option specified - Exiting";
415  PrintSyntax();
416  exit(1);
417  } //-g
418 
419  if(gOptUsingRootGeom) {
420  // using a ROOT geometry - get requested geometry units
421 
422  // legth units:
423  if( parser.OptionExists('L') ) {
424  LOG("gevgen_nnbar_osc", pDEBUG)
425  << "Checking for input geometry length units";
426  lunits = parser.ArgAsString('L');
427  } else {
428  LOG("gevgen_nnbar_osc", pDEBUG) << "Using default geometry length units";
429  lunits = kDefOptGeomLUnits;
430  } // -L
431  // density units:
432  if( parser.OptionExists('D') ) {
433  LOG("gevgen_nnbar_osc", pDEBUG)
434  << "Checking for input geometry density units";
435  dunits = parser.ArgAsString('D');
436  } else {
437  LOG("gevgen_nnbar_osc", pDEBUG) << "Using default geometry density units";
438  dunits = kDefOptGeomDUnits;
439  } // -D
442 
443  // check whether an event generation volume name has been
444  // specified -- default is the 'top volume'
445  if( parser.OptionExists('t') ) {
446  LOG("gevgen_nnbar_osc", pDEBUG) << "Checking for input volume name";
447  gOptRootGeomTopVol = parser.ArgAsString('t');
448  } else {
449  LOG("gevgen_nnbar_osc", pDEBUG) << "Using the <master volume>";
450  } // -t
451 
452  } // using root geom?
453 
454  else {
455  // User has specified a target mix.
456  // Decode the list of target pdf codes & their corresponding weight fraction
457  // (specified as 'pdg_code_1[fraction_1],pdg_code_2[fraction_2],...')
458  // See documentation on top section of this file.
459  //
460  gOptTgtMix.clear();
461  vector<string> tgtmix = utils::str::Split(geom,",");
462  if(tgtmix.size()==1) {
463  int pdg = atoi(tgtmix[0].c_str());
464  double wgt = 1.0;
465  gOptTgtMix.insert(map<int, double>::value_type(pdg, wgt));
466  } else {
467  vector<string>::const_iterator tgtmix_iter = tgtmix.begin();
468  for( ; tgtmix_iter != tgtmix.end(); ++tgtmix_iter) {
469  string tgt_with_wgt = *tgtmix_iter;
470  string::size_type open_bracket = tgt_with_wgt.find("[");
471  string::size_type close_bracket = tgt_with_wgt.find("]");
472  if (open_bracket ==string::npos ||
473  close_bracket==string::npos)
474  {
475  LOG("gevgen_nnbar_osc", pFATAL)
476  << "You made an error in specifying the target mix";
477  PrintSyntax();
478  exit(1);
479  }
480  string::size_type ibeg = 0;
481  string::size_type iend = open_bracket;
482  string::size_type jbeg = open_bracket+1;
483  string::size_type jend = close_bracket;
484  int pdg = atoi(tgt_with_wgt.substr(ibeg,iend-ibeg).c_str());
485  double wgt = atof(tgt_with_wgt.substr(jbeg,jend-jbeg).c_str());
486  LOG("gevgen_nnbar_osc", pDEBUG)
487  << "Adding to target mix: pdg = " << pdg << ", wgt = " << wgt;
488  gOptTgtMix.insert(map<int, double>::value_type(pdg, wgt));
489 
490  }// tgtmix_iter
491  } // >1 materials in mix
492  } // using tgt mix?
493 
494  // event file prefix
495  if( parser.OptionExists('o') ) {
496  LOG("gevgen_nnbar_osc", pDEBUG) << "Reading the event filename prefix";
497  gOptEvFilePrefix = parser.ArgAsString('o');
498  } else {
499  LOG("gevgen_nnbar_osc", pDEBUG)
500  << "Will set the default event filename prefix";
502  } //-o
503 
504 
505  // random number seed
506  if( parser.OptionExists("seed") ) {
507  LOG("gevgen_nnbar_osc", pINFO) << "Reading random number seed";
508  gOptRanSeed = parser.ArgAsLong("seed");
509  } else {
510  LOG("gevgen_nnbar_osc", pINFO) << "Unspecified random number seed - Using default";
511  gOptRanSeed = -1;
512  }
513 
514  //
515  // >>> print the command line options
516  //
517 
518  PDGLibrary * pdglib = PDGLibrary::Instance();
519 
520  ostringstream gminfo;
521  if (gOptUsingRootGeom) {
522  gminfo << "Using ROOT geometry - file: " << gOptRootGeom
523  << ", top volume: "
524  << ((gOptRootGeomTopVol.size()==0) ? "<master volume>" : gOptRootGeomTopVol)
525  << ", length units: " << lunits
526  << ", density units: " << dunits;
527  } else {
528  gminfo << "Using target mix - ";
529  map<int,double>::const_iterator iter;
530  for(iter = gOptTgtMix.begin(); iter != gOptTgtMix.end(); ++iter) {
531  int pdg_code = iter->first;
532  double wgt = iter->second;
533  TParticlePDG * p = pdglib->Find(pdg_code);
534  if(p) {
535  string name = p->GetName();
536  gminfo << "(" << name << ") -> " << 100*wgt << "% / ";
537  }//p?
538  }
539  }
540 
541  LOG("gevgen_nnbar_osc", pNOTICE)
542  << "\n\n"
543  << utils::print::PrintFramedMesg("gevgen_nosc job configuration");
544 
545  LOG("gevgen_nnbar_osc", pNOTICE)
546  << "\n @@ Run number: " << gOptRunNu
547  << "\n @@ Random number seed: " << gOptRanSeed
548  << "\n @@ Decay channel $ " << utils::nnbar_osc::AsString(gOptDecayMode)
549  << "\n @@ Geometry $ " << gminfo.str()
550  << "\n @@ Statistics $ " << gOptNev << " events";
551 
552  //
553  // Temporary warnings...
554  //
555  if(gOptUsingRootGeom) {
556  LOG("gevgen_nnbar_osc", pWARN)
557  << "\n ** ROOT geometries not supported yet in neutron oscillation mode"
558  << "\n ** (they will be in the very near future)"
559  << "\n ** Please specify a `target mix' instead.";
560  gAbortingInErr = true;
561  exit(1);
562  }
563 }
564 //_________________________________________________________________________________________
565 void PrintSyntax(void)
566 {
567  LOG("gevgen_nnbar_osc", pFATAL)
568  << "\n **Syntax**"
569  << "\n gevgen_nnbarosc [-h] "
570  << "\n [-r run#]"
571  << "\n -m decay_mode"
572  << "\n -g geometry"
573  << "\n [-t top_volume_name_at_geom]"
574  << "\n [-L length_units_at_geom]"
575  << "\n [-D density_units_at_geom]"
576  << "\n -n n_of_events "
577  << "\n [-o output_event_file_prefix]"
578  << "\n [--seed random_number_seed]"
579  << "\n [--message-thresholds xml_file]"
580  << "\n [--event-record-print-level level]"
581  << "\n [--mc-job-status-refresh-rate rate]"
582  << "\n"
583  << " Please also read the detailed documentation at http://www.genie-mc.org"
584  << " or look at the source code: $GENIE/src/Apps/gNNBarOscEvGen.cxx"
585  << "\n";
586 }
587 //_________________________________________________________________________________________
588 
void RandGen(long int seed)
Definition: AppInit.cxx:31
static void SetPrintLevel(int print_level)
Definition: GHepRecord.cxx:992
void GetCommandLineArgs(int argc, char **argv)
const XML_Char * name
Definition: expat.h:151
long ArgAsLong(char opt)
const EventRecordVisitorI * NeutronOscGenerator(void)
const XML_Char * target
Definition: expat.h:268
string ArgAsString(char opt)
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
#define pERROR
Definition: Messenger.h:60
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
void ReadFromCommandLine(int argc, char **argv)
Definition: RunOpt.cxx:107
int SelectAnnihilationMode(int pdg_code)
const char * p
Definition: xmltok.h:285
#define pFATAL
Definition: Messenger.h:57
void Update(int iev, const EventRecord *event)
Definition: GMCJMonitor.cxx:58
string gOptEvFilePrefix
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
double gOptGeomLUnits
void SetRefreshRate(int rate)
Definition: GMCJMonitor.cxx:53
Summary information for an interaction.
Definition: Interaction.h:56
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
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Definition: typedefs.hpp:11
int gOptNev
string gOptRootGeom
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
enum genie::ENNBarOscMode NNBarOscMode_t
double UnitFromString(string u)
Definition: UnitUtils.cxx:26
const Algorithm * GetAlgorithm(const AlgId &algid)
Definition: AlgFactory.cxx:86
string AsString(NNBarOscMode_t ndm)
void Save(void)
get the even tree
Definition: NtpWriter.cxx:214
#define pINFO
Definition: Messenger.h:63
int main(int argc, char **argv)
string kDefOptGeomDUnits
void AddEventRecord(int ievent, const EventRecord *ev_rec)
save the event tree
Definition: NtpWriter.cxx:69
NNBarOscMode_t gOptDecayMode
const ana::Var wgt
#define pWARN
Definition: Messenger.h:61
Long_t gOptRunNu
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
void CustomizeFilenamePrefix(string prefix)
Definition: NtpWriter.cxx:123
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
void Initialize(void)
add event
Definition: NtpWriter.cxx:95
NtpMCFormat_t kDefOptNtpFormat
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
double gOptGeomDUnits
string kDefOptEvFilePrefix
map< int, double > gOptTgtMix
Definition: decay.py:1
string kDefOptGeomLUnits
static RunOpt * Instance(void)
Definition: RunOpt.cxx:62
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:30
long int gOptRanSeed
bool gOptUsingRootGeom
void geom(int which=0)
Definition: geom.C:163
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
exit(0)
bool IsValidMode(NNBarOscMode_t ndm)
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
Definition: PrintUtils.cxx:171
void PrintSyntax(void)
void MesgThresholds(string inpfile)
Definition: AppInit.cxx:100
int SelectInitState(void)
Command line argument parser.
enum genie::ENtpMCFormat NtpMCFormat_t
#define pNOTICE
Definition: Messenger.h:62
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
The GENIE Algorithm Factory.
Definition: AlgFactory.h:40
string gOptRootGeomTopVol
bool gAbortingInErr
Definition: Messenger.cxx:56
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
bool OptionExists(char opt)
was option set?
static Interaction * NOsc(int tgt, int annihilation_mode=-1)
#define pDEBUG
Definition: Messenger.h:64
void SetSeed(long int seed)
Definition: RandomGen.cxx:90