gEvPick.cxx
Go to the documentation of this file.
1 //_____________________________________________________________________________________________
2 /*!
3 
4 \program gevpick
5 
6 \brief Reads a list of GENIE event files (GHEP format), `cherry-picks' events with a given
7  final state topology (or true interaction mode) and writes them out in a separate file.
8 
9  The output event tree contains 2 additional branches to aid book-keeping by maintaining
10  a link to the source location of each cherry-picked event. For each such event we store
11  a) the name of the original file, and
12  b) its original event number.
13 
14  This is the _only_recommended_ way to obtain event files that contain specific final
15  states (by cherry-picking events from files generated running GENIE in a comprehensive
16  mode). We don't recommend you attempt switching off generator-level reaction modes.
17  No detector measures generator-level reaction modes like CCQE or NCRES.
18  Detectors measure final states / topologies like {1mu-,0pi}, {1mu-,1pi+},
19  {0mu-, 1pi0}, {1 track, 1 shower}, {1 mu-like ring} etc depending on granularity,
20  thresholds and PID capabilities.
21  No final state / topology is a proxy for any particular reaction mode (and vice versa).
22  Intranuclear re-scattering in particular causes significant migration between states
23  (see Table 8.1 in the Physics and User manual).
24  Examples:
25  - {1mu-,0pi} is mostly numuCCQE but this particular final state can also come about
26  by numu resonance production followed by pion absorption.
27  - numuCCQE yields mostly {1mu-,0pi} final states but occasionaly can yield {1mu-,1pi}
28  if the recoil nucleon re-interacts.
29  - NC1pi0 final states can be caused by all
30  a) NC elastic followed by nucleon rescattering,
31  b) NC resonance neutrino-production,
32  c) NC non-resonance background,
33  d) low-W NC DIS
34  e) NC coherent scattering.
35  Each such NC1pi0 source contributes differently to the pion momentum distribution.
36 
37  Synopsis:
38  gevpick -i list_of_input_files
39  -t type
40  [-o output_file]
41  [--message-thresholds xmfile]
42  [--event-record-print-level level]
43 
44  Options:
45 
46  [] denotes an optional argument
47 
48  -i
49  Specify input file(s).
50  Wildcards accepted, eg `-i "/data/genie/t2k/gntp.*.ghep.root"'
51 
52  -t
53  Specify the type of events to cherry-pick.
54  The following options are suported currently:
55 
56  - all
57  all (basically merges all files into one)
58 
59  .................................................................................
60  Event types based on final-state topology.
61  Include all reaction modes contributing to the selected topology.
62  .................................................................................
63 
64  - numu_cc_1pip
65  numu CC with 1 \pi^{+} (and no other pion) in final state
66  - numu_cc_1pi0
67  numu CC with 1 \pi^{0} (and no other pion) in final state
68  - numu_cc_1pim
69  numu CC with 1 \pi^{-} (and no other pion) in final state
70  - numu_nc_1pip
71  numu NC with 1 \pi^{+} (and no other pion) in final state
72  - numu_nc_1pi0
73  numu NC with 1 \pi^{0} (and no other pion) in final state
74  - numu_nc_1pim
75  numu NC with 1 \pi^{-} (and no other pion) in final state
76  - numu_cc_hyperon
77  numu CC with at least one hyperon
78  (\Sigma^{+,0,-}, \Lambda^{0}, \Xi^{0,-}, \Omega^{-}) in final state
79  - numubar_cc_hyperon
80  \bar{numu} CC with at least one hyperon
81  (\Sigma^{+,0,-}, \Lambda^{0}, \Xi^{0,-}, \Omega^{-}) in final state
82  - cc_hyperon
83  any (anti)neutrino CC with at least one hyperon
84  (\Sigma^{+,0,-}, \Lambda^{0}, \Xi^{0,-}, \Omega^{-}) in final state
85 
86  .................................................................................
87  Event types based on true reaction mode.
88  Includes all events with the specified mode, regardless of the resulting f/s.
89  .................................................................................
90 
91  - cc_qe
92  - numu_cc_qe
93  Genuine CCQE
94  - cc_mec
95  - numu_cc_mec
96  Genuine CCMEC
97  - cc_qe_mec
98  - numu_cc_qe_mec
99  Genuine CCQE or genuine CCMEC
100  - not_cc_qe_mec
101  - not_numu_cc_qe_mec
102  Anything other than genuine CCQE or genuine CCMEC
103  - cc_not_qe_mec
104  CC but not genuine CCQE or genuine CCMEC
105  - numu_not_cc_qe_mec
106  numu but not genuine CCQE or genuine CCMEC
107 
108  .................................................................................
109 
110  <can add more / please send request to constantinos.andreopoulos \at cern.ch>
111 
112  -o
113  Specify output filename.
114  (optional, default: gntp.<topology>.ghep.root)
115  --message-thresholds
116  Allows users to customize the message stream thresholds.
117  The thresholds are specified using an XML file.
118  See $GENIE/config/Messenger.xml for the XML schema.
119  --event-record-print-level
120  Allows users to set the level of information shown when the event
121  record is printed in the screen. See GHepRecord::Print().
122 
123  Examples:
124 
125  (1) % gevpick -i "*.ghep.root" -t numu_nc_1pi0
126 
127  Will read all events in all *.ghep.root files and will cherry-pick
128  numu NC 1pi0 events. All cherry-picked events will be saved in the
129  output file gntp.numu_nc_1pi0.ghep.root (default name).
130 
131 \author Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
132  University of Liverpool & STFC Rutherford Appleton Laboratory
133 
134 \created August 09, 2010
135 
136 \cpright Copyright (c) 2003-2020, The GENIE Collaboration
137  For the full text of the license visit http://copyright.genie-mc.org
138 
139 */
140 //_____________________________________________________________________________________________
141 
142 #include <cassert>
143 #include <string>
144 #include <sstream>
145 
146 #include <TSystem.h>
147 #include <TFile.h>
148 #include <TTree.h>
149 #include <TChain.h>
150 #include <TChainElement.h>
151 
152 #include "Framework/Conventions/GBuild.h"
165 #include "Framework/Utils/AppInit.h"
168 #include "Framework/Utils/RunOpt.h"
169 
170 using std::string;
171 using std::ostringstream;
172 
173 using namespace genie;
174 
175 // func prototypes
176 void GetCommandLineArgs (int argc, char ** argv);
177 void RunCherryPicker (void);
178 bool AcceptEvent (const EventRecord & event);
179 void PrintSyntax (void);
180 string DefaultOutputFile (void);
181 
182 // cherry-picked event types
183 typedef enum EGPickType {
186  //
187  // Types based on final state topology, regardless of reaction mode
188  //
198  //
199  // Types based on true reaction mode, regardless of final state topology
200  //
211 
212 } GPickType_t;
213 
214 // input options (from command line arguments):
215 string gOptInpFileNames; ///< input file name
216 string gOptOutFileName; ///< output file name
217 string gPickedTypeStr; ///< output file name
218 GPickType_t gPickedType; ///< output file format id
219 
220 //____________________________________________________________________________________
221 int main(int argc, char ** argv)
222 {
223  GetCommandLineArgs(argc, argv);
224 
225  utils::app_init::MesgThresholds(RunOpt::Instance()->MesgThresholdFiles());
226  GHepRecord::SetPrintLevel(RunOpt::Instance()->EventRecordPrintLevel());
227 
228  RunCherryPicker();
229 
230  return 0;
231 }
232 //____________________________________________________________________________________
233 void RunCherryPicker(void)
234 {
235  // Create an NtpWriter for writing out a tree with the cherry-picked events
236  // Add 2 additional branches to the output event tree to save the original filename
237  // and the event number in the original file (so that all info can be traced back
238  // to its source).
239 
240  NtpWriter ntpw(kNFGHEP, 0);
242  ntpw.Initialize();
243  TObjString* brOrigFilename = new TObjString;
244  Long64_t brOrigEvtNum;
245  ntpw.EventTree()->Branch("orig_filename", "TObjString", &brOrigFilename, 5000,0);
246  ntpw.EventTree()->Branch("orig_evtnum", &brOrigEvtNum, "brOrigEvtNum/L");
247  Long64_t iev_glob = 0;
248 
249  // Load input trees. More than one trees can be loaded here if a wildcard was
250  // specified with -f (eg -f /data/myfiles/genie/*.ghep.root)
251 
252  TChain gchain;
253  gchain.Add(gOptInpFileNames.c_str());
254 
255  TObjArray * file_array = gchain.GetListOfFiles();
256  int nfiles = file_array->GetEntries();
257  LOG("gevpick", pNOTICE)
258  << "Processing " << nfiles
259  << (nfiles==1 ? " file " : " files ");
260 
261  //
262  // Loop over input event files
263  //
264 
265  TIter next_file(file_array);
266  TChainElement *chEl=0;
267 
268  unsigned int total_events = 0;
269  unsigned int picked_events = 0;
270 
271  while (( chEl=(TChainElement*)next_file() )) {
272 
273  TFile fin(chEl->GetTitle(),"read");
274  TTree * ghep_tree =
275  dynamic_cast <TTree *> ( fin.Get("gtree") );
276 
277  if(!ghep_tree) {
278  LOG("gevpick", pWARN)
279  << "No GHEP tree found in " << chEl->GetTitle();
280  LOG("gevpick", pWARN)
281  << "Skipping to next file...";
282  continue;
283  }
284 
285  NtpMCEventRecord * mcrec = 0;
286  ghep_tree->SetBranchAddress("gmcrec", &mcrec);
287  if (!mcrec) {
288  LOG("gevpick", pERROR) << "Null MC record";
289  return;
290  }
291  Long64_t nmax = ghep_tree->GetEntries();
292  LOG("gevpick", pNOTICE)
293  << "* Analyzing: " << nmax
294  << " events from GHEP tree in file: " << chEl->GetTitle();
295 
296  NtpMCTreeHeader * thdr =
297  dynamic_cast <NtpMCTreeHeader *> ( fin.Get("header") );
298  LOG("gevpick", pNOTICE)
299  << "Input tree header: " << *thdr;
300 
301  //
302  // Loop over events in current file
303  //
304 
305  for(Long64_t iev = 0; iev < nmax; iev++) {
306  total_events++;
307  ghep_tree->GetEntry(iev);
308  NtpMCRecHeader rec_header = mcrec->hdr;
309  EventRecord & event = *(mcrec->event);
310  LOG("gevpick", pDEBUG) << rec_header;
311  LOG("gevpick", pDEBUG) << event;
312  if(AcceptEvent(event)) {
313  picked_events++;
314  brOrigFilename->SetString(chEl->GetTitle());
315  brOrigEvtNum = iev;
316  ntpw.AddEventRecord( iev_glob, &event );
317  iev_glob++;
318  }
319  mcrec->Clear();
320 
321  } // event loop (current file)
322  }// file loop
323 
324  // save the cherry-picked MC events
325  ntpw.Save();
326 
327  LOG("gevpick", pNOTICE) << "Picked " << picked_events << " / " << total_events << " events of type " << gPickedTypeStr;
328  LOG("gevpick", pNOTICE) << "Done!";
329 }
330 //____________________________________________________________________________________
332 {
333  if ( gPickedType == kPtAll ) return true;
334  if ( gPickedType == kPtUndefined ) return false;
335 
336  const Interaction * interaction = event.Summary();
337 
338  int nupdg = event.Probe()->Pdg();
339  bool isnumu = (nupdg == kPdgNuMu);
340  bool isnumubar = (nupdg == kPdgAntiNuMu);
341  bool iscc = interaction->ProcInfo().IsWeakCC();
342  bool isnc = interaction->ProcInfo().IsWeakNC();
343  bool isqe = interaction->ProcInfo().IsQuasiElastic();
344  bool ismec = interaction->ProcInfo().IsMEC();
345  bool isstr = interaction->ExclTag().IsStrangeEvent();
346  bool ischm = interaction->ExclTag().IsCharmEvent();
347 
348  int NfP = 0; // number of protons in final state
349  int NfPbar = 0; // number of anti-protons in final state
350  int NfN = 0; // number of neutrons in final state
351  int NfNbar = 0; // number of anti-neutrons in final state
352  int NfPip = 0; // number of \pi^+'s in final state
353  int NfPim = 0; // number of \pi^-'s in final state
354  int NfPi0 = 0; // number of \pi^0's in final state
355  int NfKp = 0; // number of \K^+'s in final state
356  int NfKm = 0; // number of \K^-'s in final state
357  int NfK0 = 0; // number of \K^0's in final state
358  int NfK0bar = 0; // number of \bar{\K^0}'s in final state
359  int NfSigmap = 0; // number of \Sigma^+'s in final state
360  int NfSigma0 = 0; // number of \Sigma^0's in final state
361  int NfSigmam = 0; // number of \Sigma^-'s in final state
362  int NfLambda0 = 0; // number of \Lambda^0's in final state
363  int NfXi0 = 0; // number of \Xi^0's in final state
364  int NfXim = 0; // number of \Xi^-'s in final state
365  int NfOmegam = 0; // number of \Omega^-'s in final state
366  int NfOther = 0; // number of other particles in final state
367 
368  TObjArrayIter piter(&event);
369  GHepParticle * p = 0;
370  int ip=-1;
371  while( (p = (GHepParticle *) piter.Next())) {
372  ip++;
373  int pdgc = p->Pdg();
374  int ist = p->Status();
375  // only final state particles
376  if(ist!=kIStStableFinalState) continue;
377  // don't count final state lepton as part of the hadronic system
378  if(event.Particle(ip)->FirstMother()==0) continue;
379  // skip pseudo-particles
380  if(pdg::IsPseudoParticle(pdgc)) continue;
381  // count ...
382  if (pdgc == kPdgProton ) NfP++;
383  else if (pdgc == kPdgAntiProton ) NfPbar++;
384  else if (pdgc == kPdgNeutron ) NfN++;
385  else if (pdgc == kPdgAntiNeutron) NfNbar++;
386  else if (pdgc == kPdgPiP ) NfPip++;
387  else if (pdgc == kPdgPiM ) NfPim++;
388  else if (pdgc == kPdgPi0 ) NfPi0++;
389  else if (pdgc == kPdgKP ) NfKp++;
390  else if (pdgc == kPdgKM ) NfKm++;
391  else if (pdgc == kPdgK0 ) NfK0++;
392  else if (pdgc == kPdgAntiK0 ) NfK0bar++;
393  else if (pdgc == kPdgSigmaP ) NfSigmap++;
394  else if (pdgc == kPdgSigma0 ) NfSigma0++;
395  else if (pdgc == kPdgSigmaM ) NfSigmam++;
396  else if (pdgc == kPdgLambda ) NfLambda0++;
397  else if (pdgc == kPdgXi0 ) NfXi0++;
398  else if (pdgc == kPdgXiM ) NfXim++;
399  else if (pdgc == kPdgOmegaM ) NfOmegam++;
400  else NfOther++;
401  }
402 
403  bool is1pipX = (NfPip==1 && NfPi0==0 && NfPim==0);
404  bool is1pi0X = (NfPip==0 && NfPi0==1 && NfPim==0);
405  bool is1pimX = (NfPip==0 && NfPi0==0 && NfPim==1);
406  bool has_hype = (NfSigmap+NfSigma0+NfSigmam+NfLambda0+NfXi0+NfXim+NfOmegam > 0);
407 
408  if ( gPickedType == kPtTopoNumuCC1pip ) {
409  if(isnumu && iscc && is1pipX) return true;
410  }
411  else
412  if ( gPickedType == kPtTopoNumuCC1pi0 ) {
413  if(isnumu && iscc && is1pi0X) return true;
414  }
415  else
416  if ( gPickedType == kPtTopoNumuCC1pim ) {
417  if(isnumu && iscc && is1pimX) return true;
418  }
419  else
420  if ( gPickedType == kPtTopoNumuNC1pip ) {
421  if(isnumu && isnc && is1pipX) return true;
422  }
423  else
424  if ( gPickedType == kPtTopoNumuNC1pi0 ) {
425  if(isnumu && isnc && is1pi0X) return true;
426  }
427  else
428  if ( gPickedType == kPtTopoNumuNC1pim ) {
429  if(isnumu && isnc && is1pimX) return true;
430  }
431  else
433  if(isnumu && iscc && has_hype) return true;
434  }
435  else
437  if(isnumubar && iscc && has_hype) return true;
438  }
439  else
440  if ( gPickedType == kPtTopoCChyperon ) {
441  if(iscc && has_hype) return true;
442  }
443  else
444  if ( gPickedType == kPtReacModeCCQE ) {
445  if(isstr || ischm) return false;
446  if(iscc && isqe) return true;
447  }
448  else
449  if ( gPickedType == kPtReacModeNumuCCQE ) {
450  if(isstr || ischm) return false;
451  if(isnumu && iscc && isqe) return true;
452  }
453  else
454  if ( gPickedType == kPtReacModeCCMEC ) {
455  if(isstr || ischm) return false;
456  if(iscc && ismec) return true;
457  }
458  else
460  if(isstr || ischm) return false;
461  if(isnumu && iscc && ismec) return true;
462  }
463  else
464  if ( gPickedType == kPtReacModeCCQEMEC ) {
465  if(isstr || ischm) return false;
466  if(iscc && (isqe || ismec)) return true;
467  }
468  else
470  if(isstr || ischm) return false;
471  if(isnumu && iscc && (isqe || ismec)) return true;
472  }
473  else
475  if(isstr || ischm) return false;
476  if(!(iscc && (isqe || ismec))) return true;
477  }
478  else
480  if(isstr || ischm) return false;
481  if(!(isnumu && iscc && (isqe || ismec))) return true;
482  }
483  else
485  if(isstr || ischm) return false;
486  if(iscc && !(isqe || ismec)) return true;
487  }
488  else
490  if(isstr || ischm) return false;
491  if(isnumu && !(iscc && (isqe || ismec))) return true;
492  }
493 
494  return false;
495 }
496 //____________________________________________________________________________________
497 void GetCommandLineArgs(int argc, char ** argv)
498 {
499  // Common run options. Set defaults and read.
501 
502  // Parse run options for this app
503 
504  CmdLnArgParser parser(argc,argv);
505 
506  // get input ROOT file (containing a GENIE GHEP event tree)
507  if( parser.OptionExists('i') ) {
508  gOptInpFileNames = parser.ArgAsString('i');
509  } else {
510  LOG("gevpick", pFATAL)
511  << "Unspecified input filename - Exiting";
512  PrintSyntax();
513  gAbortingInErr = true;
514  exit(1);
515  }
516 
517  // requested event type
518  string evtype = "";
519  if( parser.OptionExists('t') ) {
520  evtype = parser.ArgAsString('t');
521  if ( evtype == "all" ) { gPickedType = kPtAll; }
522 
523  else if ( evtype == "numu_cc_1pip" ) { gPickedType = kPtTopoNumuCC1pip; }
524  else if ( evtype == "numu_cc_1pi0" ) { gPickedType = kPtTopoNumuCC1pi0; }
525  else if ( evtype == "numu_cc_1pim" ) { gPickedType = kPtTopoNumuCC1pim; }
526  else if ( evtype == "numu_nc_1pip" ) { gPickedType = kPtTopoNumuNC1pip; }
527  else if ( evtype == "numu_nc_1pi0" ) { gPickedType = kPtTopoNumuNC1pi0; }
528  else if ( evtype == "numu_nc_1pim" ) { gPickedType = kPtTopoNumuNC1pim; }
529  else if ( evtype == "numu_cc_hyperon" ) { gPickedType = kPtTopoNumuCChyperon; }
530  else if ( evtype == "numubar_cc_hyperon" ) { gPickedType = kPtTopoNumubarCChyperon; }
531  else if ( evtype == "cc_hyperon" ) { gPickedType = kPtTopoCChyperon; }
532 
533  else if ( evtype == "cc_qe" ) { gPickedType = kPtReacModeCCQE; }
534  else if ( evtype == "numu_cc_qe" ) { gPickedType = kPtReacModeNumuCCQE; }
535  else if ( evtype == "cc_mec" ) { gPickedType = kPtReacModeCCMEC; }
536  else if ( evtype == "numu_cc_mec" ) { gPickedType = kPtReacModeNumuCCMEC; }
537  else if ( evtype == "cc_qe_mec" ) { gPickedType = kPtReacModeCCQEMEC; }
538  else if ( evtype == "numu_cc_qe_mec" ) { gPickedType = kPtReacModeNumuCCQEMEC; }
539  else if ( evtype == "not_cc_qe_mec" ) { gPickedType = kPtReacModeNotCCQEMEC; }
540  else if ( evtype == "cc_not_qe_mec" ) { gPickedType = kPtReacModeCCNotQEMEC; }
541  else if ( evtype == "not_numu_cc_qe_mec" ) { gPickedType = kPtReacModeNotNumuCCQEMEC; }
542  else if ( evtype == "numu_not_cc_qe_mec" ) { gPickedType = kPtReacModeNumuNotCCQEMEC; }
543 
544  else { gPickedType = kPtUndefined; }
545 
546  if(gPickedType == kPtUndefined) {
547  LOG("gevpick", pFATAL) << "Unknown event type (" << evtype << ")";
548  gAbortingInErr = true;
549  exit(1);
550  }
551  gPickedTypeStr = evtype;
552 
553  } else {
554  LOG("gevpick", pFATAL) << "Unspecified event type";
555  gAbortingInErr = true;
556  exit(1);
557  }
558 
559  // get output file name
560  if( parser.OptionExists('o') ) {
561  gOptOutFileName = parser.ArgAsString('o');
562  } else {
563  LOG("gevpick", pINFO)
564  << "Unspecified output filename - Using default";
566  }
567 
568  // Summarize
569  LOG("gevpick", pNOTICE)
570  << "\n\n gevpick job info: "
571  << "\n - input file(s) : " << gOptInpFileNames
572  << "\n - output file : " << gOptOutFileName
573  << "\n - cherry-picked topology : " << evtype
574  << "\n";
575 }
576 //____________________________________________________________________________________
577 string DefaultOutputFile(void)
578 {
579  string tp = "";
580 
581  if (gPickedType == kPtAll ) { tp = "all"; }
582 
583  else if (gPickedType == kPtTopoNumuCC1pip ) { tp = "numu_cc_1pip"; }
584  else if (gPickedType == kPtTopoNumuCC1pi0 ) { tp = "numu_cc_1pi0"; }
585  else if (gPickedType == kPtTopoNumuCC1pim ) { tp = "numu_cc_1pim"; }
586  else if (gPickedType == kPtTopoNumuNC1pip ) { tp = "numu_nc_1pip"; }
587  else if (gPickedType == kPtTopoNumuNC1pi0 ) { tp = "numu_nc_1pi0"; }
588  else if (gPickedType == kPtTopoNumuNC1pim ) { tp = "numu_nc_1pim"; }
589  else if (gPickedType == kPtTopoNumuCChyperon ) { tp = "numu_cc_hyperon"; }
590  else if (gPickedType == kPtTopoNumubarCChyperon ) { tp = "numubar_cc_hyperon"; }
591  else if (gPickedType == kPtTopoCChyperon ) { tp = "cc_hyperon"; }
592 
593  else if (gPickedType == kPtReacModeCCQE ) { tp = "cc_qe"; }
594  else if (gPickedType == kPtReacModeNumuCCQE ) { tp = "numu_cc_qe"; }
595  else if (gPickedType == kPtReacModeCCMEC ) { tp = "cc_mec"; }
596  else if (gPickedType == kPtReacModeNumuCCMEC ) { tp = "numu_cc_mec"; }
597  else if (gPickedType == kPtReacModeCCQEMEC ) { tp = "cc_qe_mec"; }
598  else if (gPickedType == kPtReacModeNumuCCQEMEC ) { tp = "numu_cc_qe_mec"; }
599  else if (gPickedType == kPtReacModeNotCCQEMEC ) { tp = "not_cc_qe_mec"; }
600  else if (gPickedType == kPtReacModeCCNotQEMEC ) { tp = "cc_not_qe_mec"; }
601  else if (gPickedType == kPtReacModeNotNumuCCQEMEC ) { tp = "not_numu_cc_qe_mec"; }
602  else if (gPickedType == kPtReacModeNumuNotCCQEMEC ) { tp = "numu_not_cc_qe_mec"; }
603 
604  ostringstream fnm;
605  fnm << "gntp." << tp << ".ghep.root";
606 
607  return fnm.str();
608 }
609 //____________________________________________________________________________________
610 void PrintSyntax(void)
611 {
612  string basedir = string( gSystem->Getenv("GENIE") );
613  string thisfile = basedir + string("/src/Apps/gEvPick.cxx");
614  string cmd = "less " + thisfile;
615 
616  gSystem->Exec(cmd.c_str());
617 }
618 //____________________________________________________________________________________
GPickType_t gPickedType
output file format id
Definition: gEvPick.cxx:218
static void SetPrintLevel(int print_level)
Definition: GHepRecord.cxx:948
string gPickedTypeStr
output file name
Definition: gEvPick.cxx:217
virtual GHepParticle * Particle(int position) const
Definition: GHepRecord.cxx:104
void GetCommandLineArgs(int argc, char **argv)
Definition: gEvPick.cxx:497
const int kPdgXi0
Definition: PDGCodes.h:93
bool IsWeakCC(void) const
NtpMCRecHeader hdr
record header
Definition: NtpMCRecordI.h:38
string ArgAsString(char opt)
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
#define pERROR
Definition: Messenger.h:59
const int kPdgLambda
Definition: PDGCodes.h:85
void CustomizeFilename(string filename)
Definition: NtpWriter.cxx:128
std::string string
Definition: nybbler.cc:12
MINOS-style ntuple record. Each such ntuple record holds a generated EventRecord object. Ntuples of this type are intended for feeding GENIE events into other applications (for example the GEANT4 based MC generation framework of an experiment) if no direct interface exists.
void ReadFromCommandLine(int argc, char **argv)
Definition: RunOpt.cxx:99
bool IsQuasiElastic(void) const
Definition: ProcessInfo.cxx:69
#define pFATAL
Definition: Messenger.h:56
bool IsStrangeEvent(void) const
Definition: XclsTag.h:53
const int kPdgNuMu
Definition: PDGCodes.h:30
const int kPdgSigma0
Definition: PDGCodes.h:88
GHepStatus_t Status(void) const
Definition: GHepParticle.h:64
const int kPdgK0
Definition: PDGCodes.h:174
bool IsCharmEvent(void) const
Definition: XclsTag.h:50
int Pdg(void) const
Definition: GHepParticle.h:63
int FirstMother(void) const
Definition: GHepParticle.h:66
Summary information for an interaction.
Definition: Interaction.h:56
bool IsWeakNC(void) const
TTree * EventTree(void)
Definition: NtpWriter.h:55
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
string gOptOutFileName
output file name
Definition: gEvPick.cxx:216
enum EGPickType GPickType_t
const int kPdgKM
Definition: PDGCodes.h:173
const int kPdgKP
Definition: PDGCodes.h:172
MINOS-style Ntuple Class to hold an output MC Tree Header.
p
Definition: test.py:223
const int kPdgPiP
Definition: PDGCodes.h:158
const int kPdgPi0
Definition: PDGCodes.h:160
void Save(void)
get the even tree
Definition: NtpWriter.cxx:225
#define pINFO
Definition: Messenger.h:62
int main(int argc, char **argv)
Definition: gEvPick.cxx:221
const int kPdgAntiK0
Definition: PDGCodes.h:175
const int kPdgOmegaM
Definition: PDGCodes.h:97
void AddEventRecord(int ievent, const EventRecord *ev_rec)
save the event tree
Definition: NtpWriter.cxx:57
const int kPdgAntiNuMu
Definition: PDGCodes.h:31
#define pWARN
Definition: Messenger.h:60
void PrintSyntax(void)
Definition: gEvPick.cxx:610
bool IsMEC(void) const
const int kPdgSigmaM
Definition: PDGCodes.h:89
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Definition: EventRecord.h:37
bool AcceptEvent(const EventRecord &event)
Definition: gEvPick.cxx:331
void Initialize(void)
add event
Definition: NtpWriter.cxx:83
static RunOpt * Instance(void)
Definition: RunOpt.cxx:54
const int kPdgXiM
Definition: PDGCodes.h:94
A utility class to facilitate creating the GENIE MC Ntuple from the output GENIE GHEP event records...
Definition: NtpWriter.h:39
void RunCherryPicker(void)
Definition: gEvPick.cxx:233
const int kPdgAntiNeutron
Definition: PDGCodes.h:84
bool IsPseudoParticle(int pdgc)
Definition: PDGUtils.cxx:24
const XclsTag & ExclTag(void) const
Definition: Interaction.h:72
const int kPdgAntiProton
Definition: PDGCodes.h:82
const int kPdgPiM
Definition: PDGCodes.h:159
string gOptInpFileNames
input file name
Definition: gEvPick.cxx:215
EGPickType
Definition: gEvPick.cxx:183
const int kPdgSigmaP
Definition: PDGCodes.h:87
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
void MesgThresholds(string inpfile)
Definition: AppInit.cxx:99
const int kPdgProton
Definition: PDGCodes.h:81
MINOS-style Ntuple Class to hold an MC Event Record Header.
Command line argument parser.
#define pNOTICE
Definition: Messenger.h:61
list cmd
Definition: getreco.py:22
void Clear(Option_t *opt="")
string DefaultOutputFile(void)
Definition: gEvPick.cxx:577
bool gAbortingInErr
Definition: Messenger.cxx:34
const int kPdgNeutron
Definition: PDGCodes.h:83
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
bool OptionExists(char opt)
was option set?
EventRecord * event
event
Event finding and building.
#define pDEBUG
Definition: Messenger.h:63