eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TRooTrackerVtxModuleBase.cxx
Go to the documentation of this file.
1 #include <TSystem.h>
2 
3 #include "TGeomInfo.hxx"
4 #include "TND280Log.hxx"
5 #include "TOADatabase.hxx"
6 #include "TP0DGeom.hxx"
8 
9 using std::string;
10 
12  fRooTrackerTree = NULL;
13  fInputFileTree = NULL;
14  fInputKinemTree = NULL;
15  this->ResetFileInfo();
16 }
17 
19  if (fInputKinemTree != NULL) {
20  delete fInputKinemTree;
21  fInputKinemTree = NULL;
22  }
23  if (fInputFileTree != NULL) {
24  delete fInputFileTree;
25  fInputFileTree = NULL;
26  }
27 }
28 
30  if (fFilledConfigTree) {
31  ND280NamedWarn(
32  "TRooTrackerVtxModuleBase",
33  "Module: " << this->GetName()
34  << " has already written the config tree this run.");
35  }
36 
37  configTree->Branch("PassThroughPresent", &fPassThroughPresent,
38  "PassThroughPresent/O");
39 
41 }
42 
43 bool ND::TRooTrackerVtxModuleBase::FillTree(ND::TND280Event& event) {
44  fNVtx = 0;
45  fVtx->Clear();
46 
47  /// Make sure not Dereferencing a NULL THandle to stop the module being
48  /// disabled.
49  if (!event.Has<ND::TG4PrimaryVertexContainer>("truth/G4PrimVertex00")) {
50  ND280NamedVerbose("TRooTrackerVtxModuleBase",
51  "Skipping event (filling with TClonesArray of size 0)"
52  << " as can not find any primary vertices!");
53  return true;
54  }
55 
56  ND::THandle<ND::TG4PrimaryVertexContainer> g4PrimVertex00 =
57  event.Get<ND::TG4PrimaryVertexContainer>("truth/G4PrimVertex00");
58 
59  /// Loop over the vertices and fill genie or neut roo tracker event objects.
60  int i_vertex = -1;
61  for (std::vector<ND::TG4PrimaryVertex>::const_iterator v_iter =
62  g4PrimVertex00->begin();
63  v_iter != g4PrimVertex00->end(); ++v_iter) {
64  i_vertex++;
65 
66  ND280NamedVerbose(
67  "TRooTrackerVtxModuleBase",
68  "\nGot G4Vertex - filename: "
69  << this->GetFileName((*v_iter))
70  << "\n - treename: " << this->GetTreeName((*v_iter))
71  << "\n - origentry: " << this->GetEntryNum((*v_iter))
72  << "\n - currentry: " << v_iter->GetInteractionNumber()
73  << "\n - genname: " << v_iter->GetGeneratorName()
74  << " - ND280Time: " << v_iter->GetPosition().T());
75 
76  /// Load the trees if necessary.
77  if (this->LoadPassThroughInput((*v_iter)) == false) {
78  throw ND::ENoKinematicsPassThroughTrees();
79  return false;
80  }
81 
82  /// Set the bookkeeping info from the current vertex and pass-through info.
83  /// This done here as is common to all generators.
84  if (this->UpdateBookKeepingInfo((*v_iter)) == false) {
85  throw ND::ENoKinematicsPassThroughTrees();
86  return false;
87  }
88 
89  // Check if the G4PrimaryVertex is a geantino vertex and, if so, don't save
90  // it
91  if (this->IsGeantinoVtx((*v_iter))) {
92  return true;
93  }
94 
95  /// Fill the vertex.
96  this->FillVtx(fInputTreeEntryNumber);
97 
98  /// Check basic pass-through quantities match those of G4PrimaryVertex.
99  if (this->CheckMismatch((*v_iter)) == false) {
100  throw ND::EPassThroughMismatch();
101  return false;
102  }
103  }
104  return true;
105 }
106 
108  const ND::TG4PrimaryVertex& vtx) {
109  /// First check if we need to do anything since the last time.
110  if (this->AreTreesLoaded(vtx)) {
111  ND280Debug("No need to load the pass-through trees again");
112  return true;
113  }
114  ND280Debug("Pass-through trees are not loaded for this vertex. Trying to load"
115  << " them now.");
116  /// Reset bookkeeping info as need to load the pass-through info again.
117  this->ResetVtxInfo();
118 
119  /// Try to get the pass-through info from the ND280GEANT4SIM pass-through first.
120  if (this->GetTreesFromFile(vtx)) {
121  ND280Debug("Loaded pass-through input trees from ND280GEANT4SIM pass-through"
122  << " directory");
123  }
124  /// Else try to recover pass-through from the current working directory or a
125  /// user specified input directory.
126  else if (this->GetTreesFromDirectory(vtx)) {
127  ND280Debug("Loaded input trees from user defined or current working "
128  << "directory");
129  } else {
130  /// Else cannot find input files so disabling modlule.
131  ND280NamedVerbose(
132  "TRooTrackerVtxModuleBase",
133  "Unable to load pass-through input trees. The module will be "
134  << "disabled and there will be no pass-through information in the"
135  << " analysis output file!");
136  return false;
137  }
138 
139  /// Now set the input tree addresses as implemented in the derived classes.
140  this->SetGeneratorTreeAddresses();
141  return true;
142 }
143 
145  const ND::TG4PrimaryVertex& vtx) {
146  /// First get what we can directly from the G4Primary vertex.
147  fOrigTreeEntryNumber = this->GetEntryNum(vtx);
148  fInputTreeEntryNumber = fOrigTreeEntryNumber;
149  fInputTreeName = this->GetTreeName(vtx);
150  fOrigInputFileName = this->GetFileName(vtx);
151  fGeneratorName = string(vtx.GetGeneratorName());
152  fTimeInSpill = vtx.GetPosition().T();
153  fTruthVertexID = vtx.GetInteractionNumber();
154 
155  /// Now only need to get the input file POT and the entry number of the input
156  /// rootracker tree we have. This is done differently depending on whether we
157  /// have the pass-through info or if we are recovering it from a folder.
158 
159  /// If have pass-through info use book-keeping trees.
160  if (fPassThroughPresent == true) {
161  int input_file_number = -1;
162  fInputKinemTree->SetBranchAddress("inputEntryNum", &fOrigTreeEntryNumber);
163  fInputKinemTree->SetBranchAddress("inputFileNum", &input_file_number);
164  fInputFileTree->SetBranchAddress("filePOT", &fOrigInputTreePOT);
165  fInputFileTree->SetBranchAddress("fileEntries", &fOrigInputTreeEntries);
166  fInputTreeEntryNumber = vtx.GetInteractionNumber();
167  fInputKinemTree->GetEntry(fInputTreeEntryNumber);
168  fInputFileTree->GetEntry(input_file_number);
169  }
170  /// otherwise get the information from the original input files.
171  else {
172  fOrigInputTreePOT = fRooTrackerTree->GetWeight();
173  fOrigInputTreeEntries = fRooTrackerTree->GetEntries();
174  }
175  return true;
176 }
177 
179  const ND::TG4PrimaryVertex& vtx) {
180  // First check if any trees.
181  bool inputfile = (fCurrInputFile != NULL);
182  bool rootracker_tree = (fRooTrackerTree != NULL);
183  if (!inputfile || !rootracker_tree) {
184  ND280Debug("Trees are not loaded yet!");
185  return false;
186  }
187 
188  bool same_name = false;
189  // If have pass-through see if have different nd280 input file.
190  if (fPassThroughPresent && fCurrInputFile) {
191  TFile* curr_inputfile =
192  fLastBeginFile; // TOADatabase::Get().CurrentInputFile();
193  same_name = this->ComparePaths(fCurrInputFile->GetName(),
194  curr_inputfile->GetName());
195  }
196  // Else if recovering info from directory see if the current input file is
197  // still the correct one.
198  else if (fCurrInputFile) {
199  string filename_vtx = this->GetFileName(vtx);
200  same_name =
201  this->ComparePaths(fCurrInputFile->GetName(), filename_vtx.c_str());
202  }
203 
204  if (!same_name) {
205  this->ResetVtxInfo();
206  }
207  return same_name;
208 }
209 
211  const ND::TG4PrimaryVertex& vtx) {
212  this->ResetFileInfo();
213  fPassThroughPresent = false;
214 
215  TFile* curr_infile =
216  fLastBeginFile; // TOADatabase::Get().CurrentInputFile();
217  if (curr_infile != NULL) {
218  if (!curr_infile->IsZombie()) {
219  /// Make copies of the trees rather than just getting them from the file
220  /// as otherwise get problems when both neut and genie modules later try
221  /// to access and delete the same objects. This is because using the
222  /// TFile::Get method we get two pointers to same object in memory.
223  TTree* tmpKinemTree = (TTree*)curr_infile->Get("ND280GEANT4SIM/InputKinem");
224  TTree* tmpFileTree = (TTree*)curr_infile->Get("ND280GEANT4SIM/InputFiles");
225  if (!tmpKinemTree || !tmpFileTree) {
226  return false;
227  }
228 
229  fInputKinemTree = (TTree*)tmpKinemTree->CloneTree();
230  fInputFileTree = (TTree*)tmpFileTree->CloneTree();
231  delete tmpKinemTree;
232  tmpKinemTree = NULL;
233  delete tmpFileTree;
234  tmpFileTree = NULL;
235  if (fInputKinemTree == NULL || fInputFileTree == NULL) {
236  return false;
237  }
238 
239  fCurrInputFile = curr_infile;
240  fPassThroughPresent = true;
241 
242  string generator_name = vtx.GetGeneratorName();
243  string tree_name = this->GetTreeName(vtx);
244  /// Check if we recognise the generator. This can be by name or treename
245  /// and
246  /// is implemented differently in the derived classes. The GENIE module
247  /// knows
248  /// about gRooTracker and the NEUT module knows about nRooTracker.
249  if (!this->IsKnownGenerator(generator_name.c_str()) &&
250  !this->IsKnownGenerator(tree_name.c_str())) {
251  throw ND::EIncorrectInputGenerator();
252  return false;
253  }
254 
255  /// And most importantly get the rootracker tree.
256  std::string tree_path = string("ND280GEANT4SIM/") + tree_name;
257  fRooTrackerTree = (TTree*)fCurrInputFile->Get(tree_path.c_str());
258  ND280Debug("Looking for pass-through info in file:"
259  << fCurrInputFile->GetName());
260  if (fRooTrackerTree == NULL) {
261  this->ClearInputTrees();
262  ND280Debug("Could not get pass-through tree "
263  << tree_path.c_str()
264  << " from file:" << fCurrInputFile->GetName());
265  throw ND::ENoKinematicsPassThroughTrees();
266  return false;
267  }
268  ND280Debug("Successfully found pass-through tree from "
269  << tree_path.c_str()
270  << "in nd280 output file: " << fCurrInputFile->GetName());
271  return true;
272  }
273  }
274  return false;
275 }
276 
278  const ND::TG4PrimaryVertex& vtx) {
279  this->ResetFileInfo();
280  /// Get the input file name from the pass-through tree and see if it exists
281  /// in the directory to search. If no directory specified check in the
282  /// current working directory.
283  std::string directorytosearch(gSystem->WorkingDirectory());
284  if (fInputDirectory.size() != 0) {
285  directorytosearch = std::string(fInputDirectory.c_str());
286  }
287 
288  /// First look for the file.
289  TString filename(this->GetFileName(vtx));
290  ND280Debug("Looking for input rootracker file: "
291  << filename.Data() << "\nIn path: \n"
292  << directorytosearch.c_str());
293  const char* filepath = gSystem->FindFile(directorytosearch.c_str(), filename);
294  if (filepath == 0) {
295  ND280Debug("Could not find pass-through file in directory!");
296  return false;
297  }
298 
299  ND280Debug("Found filepath: " << filepath);
300  /// Now open it and make clones of the relevant files.
301  TFile* infile = new TFile(filepath, "OPEN");
302  if (infile == 0) {
303  ND280Debug("Could not open pass-through file!");
304  return false;
305  }
306  /// Now set this to the file reference and flag that we are using a
307  /// directory to recover the pass-through info.
308  fCurrInputFile = infile;
309  fPassThroughPresent = false;
310 
311  string generator_name = vtx.GetGeneratorName();
312  string tree_name = this->GetTreeName(vtx);
313  /// Check if we recognise the generator. This can be by name or treename and
314  /// is implemented differently in the derived classes. The GENIE module knows
315  /// about gRooTracker and the NEUT module knows about nRooTracker.
316  if (!this->IsKnownGenerator(generator_name.c_str()) &&
317  !this->IsKnownGenerator(tree_name.c_str())) {
318  throw ND::EIncorrectInputGenerator();
319  return false;
320  }
321 
322  /// And most importantly get the rootracker tree.
323  std::string tree_path = tree_name;
324  fRooTrackerTree = (TTree*)fCurrInputFile->Get(tree_path.c_str());
325  ND280Debug(
326  "Looking for pass-through info in file:" << fCurrInputFile->GetName());
327  if (fRooTrackerTree == NULL) {
328  this->ClearInputTrees();
329  ND280Debug("Could not get pass-through tree "
330  << tree_path.c_str()
331  << " from file:" << fCurrInputFile->GetName());
332  throw ND::ENoKinematicsPassThroughTrees();
333  return false;
334  }
335  ND280Debug("Successfully found input tree from external directory in file: "
336  << fCurrInputFile->GetName());
337  return true;
338 }
339 
341  if (fInputKinemTree != NULL) {
342  delete fInputKinemTree;
343  fInputKinemTree = NULL;
344  }
345  if (fInputFileTree != NULL) {
346  delete fInputFileTree;
347  fInputFileTree = NULL;
348  }
349  if (fRooTrackerTree != NULL) {
350  delete fRooTrackerTree;
351  fRooTrackerTree = NULL;
352  }
353 }
354 
356  fOutputTree->Branch("NVtx", &fNVtx, "NVtx/I", fBufferSize);
357  fOutputTree->Branch("Vtx", "TClonesArray", &fVtx, fBufferSize, 1);
358 }
359 
361  const ND::TG4PrimaryVertex& prim_vtx) {
362  std::string name(prim_vtx.GetFilename());
363  std::string::size_type start_pos = name.rfind("/");
364  std::string::size_type finish_pos = name.find(":");
365  if (start_pos == std::string::npos)
366  start_pos = 0;
367  else
368  ++start_pos;
369  std::string filename(name, start_pos, finish_pos - start_pos);
370  ND280NamedVerbose("TRooTrackerVtxModuleBase",
371  "Got filename " << filename.c_str()
372  << " from filestring: " << name.c_str());
373  return filename;
374 }
375 
377  const ND::TG4PrimaryVertex& prim_vtx) {
378  std::string name(prim_vtx.GetFilename());
379  std::string::size_type start_pos = name.find(":");
380  std::string::size_type finish_pos = name.rfind(":");
381  if (start_pos == std::string::npos)
382  start_pos = 0;
383  else
384  ++start_pos;
385  std::string treename(name, start_pos, finish_pos - start_pos);
386  ND280NamedVerbose("TRooTrackerVtxModuleBase",
387  "Got treename " << treename.c_str()
388  << " from filestring: " << name.c_str());
389  return treename;
390 }
391 
393  const ND::TG4PrimaryVertex& prim_vtx) {
394  int entrynum = -1;
395  std::string name(prim_vtx.GetFilename());
396  std::string::size_type start_pos = name.rfind(":");
397  if (start_pos == std::string::npos)
398  start_pos = 0;
399  else
400  ++start_pos;
401  std::string filename(name, start_pos);
402  entrynum = std::atoi(filename.c_str());
403  ND280NamedVerbose("TRooTrackerVtxModuleBase",
404  "Got entry " << entrynum
405  << " from filestring: " << name.c_str());
406  return entrynum;
407 }
408 
410  string pathstr(path);
411  std::string::size_type start_pos = pathstr.rfind("/");
412  if (start_pos == std::string::npos)
413  start_pos = 0;
414  else
415  ++start_pos;
416  string substring(pathstr, start_pos);
417  return substring;
418 }
419 
421  const char* path2) {
422  string file1name = this->GetFileFromPath(path1);
423  string file2name = this->GetFileFromPath(path2);
424  return (file1name.find(file2name) != file1name.npos);
425 }
426 
428  fCurrInputFile = NULL; /// Potential small mem leak but ok as may reuse
429  fPassThroughPresent = false;
430  this->ResetVtxInfo();
431 }
432 
434  fOrigInputFileName = string("");
435  fOrigTreeEntryNumber = -1;
436  fOrigInputTreeEntries = -1;
437  fOrigInputTreePOT = -1.0;
438  fInputTreeName = string("");
439  fGeneratorName = string("");
440  fInputTreeEntryNumber = -1;
441  fTimeInSpill = -1.0;
442  fTruthVertexID = -1;
443 }
444 
445 Bool_t ND::TRooTrackerVtxModuleBase::ProcessFirstEvent(ND::TND280Event& event) {
446  bool IsDataFile = event.GetContext().IsDetector();
447  if (IsDataFile) {
448  throw ND::EDataFile();
449  }
450  return true;
451 }
452 
454  // Set flux branch addresses common to both generators.
455  // This method should be called from the derived class's definition of
456  // SetGeneratorTreeAddresses() and should be passed a ptr to an object
457  // inheriting from ND::JNuBeamFlux
458  if (!fRooTrackerTree) {
459  ND280Warn("Cannot set flux tree addresses as no rootracker tree loaded!");
460  return;
461  }
462  // Need to decide whether need to put warning messages if cannot find a branch
463  TBranch* fBr = 0;
464  if ((fBr = fRooTrackerTree->GetBranch("NuFluxEntry"))) {
465  fBr->SetAddress(&flux->NuFluxEntry);
466  }
467  if ((fBr = fRooTrackerTree->GetBranch("NuFileName"))) {
468  fBr->SetAddress(&flux->NuFileName);
469  }
470  if ((fBr = fRooTrackerTree->GetBranch("NuParentPdg"))) {
471  fBr->SetAddress(&flux->NuParentPdg);
472  }
473  if ((fBr = fRooTrackerTree->GetBranch("NuParentDecMode"))) {
474  fBr->SetAddress(&flux->NuParentDecMode);
475  }
476  if ((fBr = fRooTrackerTree->GetBranch("NuParentDecX4"))) {
477  fBr->SetAddress(flux->NuParentDecX4);
478  }
479  if ((fBr = fRooTrackerTree->GetBranch("NuParentDecP4"))) {
480  fBr->SetAddress(flux->NuParentDecP4);
481  }
482  if ((fBr = fRooTrackerTree->GetBranch("NuCospibm"))) {
483  fBr->SetAddress(&flux->NuCospibm);
484  }
485  if ((fBr = fRooTrackerTree->GetBranch("NuNorm"))) {
486  fBr->SetAddress(&flux->NuNorm);
487  }
488  if ((fBr = fRooTrackerTree->GetBranch("NuParentProP4"))) {
489  fBr->SetAddress(flux->NuParentProP4);
490  }
491  if ((fBr = fRooTrackerTree->GetBranch("NuParentProX4"))) {
492  fBr->SetAddress(flux->NuParentProX4);
493  }
494  if ((fBr = fRooTrackerTree->GetBranch("NuCospi0bm"))) {
495  fBr->SetAddress(&flux->NuCospi0bm);
496  }
497  if ((fBr = fRooTrackerTree->GetBranch("NuRnu"))) {
498  fBr->SetAddress(&flux->NuRnu);
499  }
500  if ((fBr = fRooTrackerTree->GetBranch("NuXnu"))) {
501  fBr->SetAddress(flux->NuXnu);
502  }
503  if ((fBr = fRooTrackerTree->GetBranch("NuIdfd"))) {
504  fBr->SetAddress(&flux->NuIdfd);
505  }
506  if ((fBr = fRooTrackerTree->GetBranch("NuGipart"))) {
507  fBr->SetAddress(&flux->NuGipart);
508  }
509  if ((fBr = fRooTrackerTree->GetBranch("NuGpos0"))) {
510  fBr->SetAddress(flux->NuGpos0);
511  }
512  if ((fBr = fRooTrackerTree->GetBranch("NuGvec0"))) {
513  fBr->SetAddress(flux->NuGvec0);
514  }
515  if ((fBr = fRooTrackerTree->GetBranch("NuGamom0"))) {
516  fBr->SetAddress(&flux->NuGamom0);
517  }
518  if ((fBr = fRooTrackerTree->GetBranch("NuNg"))) {
519  fBr->SetAddress(&flux->NuNg);
520  }
521  if ((fBr = fRooTrackerTree->GetBranch("NuGp"))) {
522  fBr->SetAddress(flux->NuGp);
523  }
524  if ((fBr = fRooTrackerTree->GetBranch("NuGcosbm"))) {
525  fBr->SetAddress(flux->NuGcosbm);
526  }
527  if ((fBr = fRooTrackerTree->GetBranch("NuGv"))) {
528  fBr->SetAddress(flux->NuGv);
529  }
530  if ((fBr = fRooTrackerTree->GetBranch("NuGpid"))) {
531  fBr->SetAddress(flux->NuGpid);
532  }
533  if ((fBr = fRooTrackerTree->GetBranch("NuGmec"))) {
534  fBr->SetAddress(flux->NuGmec);
535  }
536  if ((fBr = fRooTrackerTree->GetBranch("NuEnusk"))) {
537  fBr->SetAddress(&flux->NuEnusk);
538  }
539  if ((fBr = fRooTrackerTree->GetBranch("NuNormsk"))) {
540  fBr->SetAddress(&flux->NuNormsk);
541  }
542  if ((fBr = fRooTrackerTree->GetBranch("NuAnorm"))) {
543  fBr->SetAddress(&flux->NuAnorm);
544  }
545  if ((fBr = fRooTrackerTree->GetBranch("NuGmat"))) {
546  fBr->SetAddress(flux->NuGmat);
547  }
548  if ((fBr = fRooTrackerTree->GetBranch("NuGdistc"))) {
549  fBr->SetAddress(flux->NuGdistc);
550  }
551  if ((fBr = fRooTrackerTree->GetBranch("NuGdistal"))) {
552  fBr->SetAddress(flux->NuGdistal);
553  }
554  if ((fBr = fRooTrackerTree->GetBranch("NuGdistti"))) {
555  fBr->SetAddress(flux->NuGdistti);
556  }
557  if ((fBr = fRooTrackerTree->GetBranch("NuGdistfe"))) {
558  fBr->SetAddress(flux->NuGdistfe);
559  }
560  if ((fBr = fRooTrackerTree->GetBranch("NuVersion"))) {
561  fBr->SetAddress(&flux->NuVersion);
562  }
563  if ((fBr = fRooTrackerTree->GetBranch("NuTuneid"))) {
564  fBr->SetAddress(&flux->NuTuneid);
565  }
566  if ((fBr = fRooTrackerTree->GetBranch("NuNtrig"))) {
567  fBr->SetAddress(&flux->NuNtrig);
568  }
569  if ((fBr = fRooTrackerTree->GetBranch("NuPint"))) {
570  fBr->SetAddress(&flux->NuPint);
571  }
572  if ((fBr = fRooTrackerTree->GetBranch("NuBpos"))) {
573  fBr->SetAddress(flux->NuBpos);
574  }
575  if ((fBr = fRooTrackerTree->GetBranch("NuBtilt"))) {
576  fBr->SetAddress(flux->NuBtilt);
577  }
578  if ((fBr = fRooTrackerTree->GetBranch("NuBrms"))) {
579  fBr->SetAddress(flux->NuBrms);
580  }
581  if ((fBr = fRooTrackerTree->GetBranch("NuEmit"))) {
582  fBr->SetAddress(flux->NuEmit);
583  }
584  if ((fBr = fRooTrackerTree->GetBranch("NuAlpha"))) {
585  fBr->SetAddress(flux->NuAlpha);
586  }
587  if ((fBr = fRooTrackerTree->GetBranch("NuHcur"))) {
588  fBr->SetAddress(flux->NuHcur);
589  }
590  if ((fBr = fRooTrackerTree->GetBranch("NuRand"))) {
591  fBr->SetAddress(&flux->NuRand);
592  }
593  fBr = 0;
594 }
void SetFluxTreeAddresses(ND::JNuBeamFlux *flux)
bool FillTree(ND::TND280Event &)
Fill all the stuff that goes in the output tree.
float NuGdistti[kNgmax]
distance traveled through titanium
float NuGpos0[3]
primary particle starting point
float NuBtilt[2]
Beam angle.
double NuParentProP4[4]
parent hadron 4-momentum at production
TTree * fInputFileTree
Pass-through book keeping trees.
TTree * fRooTrackerTree
Current loaded rootracker file.
float NuGdistc[kNgmax]
distance traveled through carbon
float NuAnorm
ND Acceptance Weight Out-of-target Secondary Interactions.
Bool_t ProcessFirstEvent(ND::TND280Event &event)
Is called after the first event is loaded in.
int GetEntryNum(const ND::TG4PrimaryVertex &vtx)
float NuRnu
neutrino r position at ND5/6 plane
float NuGp[kNgmax][3]
Momentum of ancestor particle.
float NuBpos[2]
Beam center position.
int NuParentPdg
parent hadron pdg code
float NuEmit[2]
Beam Emittance.
bool UpdateBookKeepingInfo(const ND::TG4PrimaryVertex &vtx)
bool GetTreesFromFile(const ND::TG4PrimaryVertex &vtx)
void FillConfigTree(TTree *configTree)
int NuNg
Number of interaction steps.
float NuCospibm
parent hadron cos(theta) relative to beam at decay
long NuFluxEntry
corresponding entry in orig flux file
int NuIdfd
Detector ID primary particle information.
float NuGvec0[3]
primary particle direction at starting point
std::string GetFileFromPath(const char *path)
bool GetTreesFromDirectory(const ND::TG4PrimaryVertex &vtx)
int NuGipart
primary particle ID
float NuHcur[3]
Horn currents.
bool ComparePaths(const char *path1, const char *path2)
bool AreTreesLoaded(const ND::TG4PrimaryVertex &vtx)
int NuTuneid
beam tune ID #
float NuXnu[2]
neutrino (x,y) position at ND5/6 plane
double NuParentDecX4[4]
parent hadron 4-position at decay
double NuParentProX4[4]
parent hadron 4-position at production
int NuParentDecMode
parent hadron decay mode
void InitializeBranches()
Initialize Branches. Don&#39;t do anything else in this function.
float NuGamom0
momentum of the primary particle at the starting point Interation History Information ...
float NuEnusk
Neutrino Energy at SK.
float NuVersion
jnubeam flux version
float NuNorm
Normalization weight.
int NuGpid[kNgmax]
PDG ancestor particle ID.
float NuAlpha[2]
Beam Alpha.
std::string GetFileName(const ND::TG4PrimaryVertex &vtx)
float NuGdistfe[kNgmax]
distance traveled through iron Beam parameter information
float NuGv[kNgmax][3]
Position of ancestor particle.
float NuGcosbm[kNgmax]
Ancestor particle cos(theta) relative to beam.
int NuGmec[kNgmax]
particle production mechanism of ancestor particle Normalization and Transfer Matrix Information ...
int NuNtrig
Number of triggers.
float NuCospi0bm
parent hadron cos(theta) relative to beam at production
float NuBrms[2]
Beam RMS width.
float NuNormsk
Normalization weight at SK.
TObjString * NuFileName
orig flux file name neutrino parent info
int NuRand
Random seed.
std::string GetTreeName(const ND::TG4PrimaryVertex &vtx)
double NuParentDecP4[4]
parent hadron 4-momentum at decay
float NuGdistal[kNgmax]
distance traveled through aluminum
bool LoadPassThroughInput(const ND::TG4PrimaryVertex &vtx)
int NuGmat[kNgmax]
material in which the particle originates
int NuPint
Interaction model ID.
virtual void FillConfigTree(TTree *)

Package Summary
Package Name: eventAnalysis
Package Version: 7.0-49-g0ac7482
Package Manager:

Generated on Mon Mar 25 2024 14:43:59 for eventAnalysis by doxygen 1.8.5