eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TRooTrackerVtxModuleBase.hxx
Go to the documentation of this file.
1 #ifndef TRooTrackerVtxModuleBase_hxx_seen
2 #define TRooTrackerVtxModuleBase_hxx_seen
3 #include <map>
4 #include <string>
5 #include <utility>
6 #include <vector>
7 
8 #include "TClonesArray.h"
9 #include "TFile.h"
10 #include "TLorentzVector.h"
11 #include "TNamed.h"
12 #include "TTree.h"
13 
14 #include "TND280Event.hxx"
15 
16 #include "EeventAnalysis.hxx"
18 #include "TG4PrimaryParticle.hxx"
19 #include "TG4PrimaryVertex.hxx"
20 #include "TJNuBeamFlux.hxx"
21 
22 namespace ND {
23 class TRooTrackerVtxModuleBase;
24 OA_EXCEPTION(ERooTrackerVerticesModule, EeventAnalysis);
25 OA_EXCEPTION(EPassThroughMismatch, ERooTrackerVerticesModule);
26 OA_EXCEPTION(EIncorrectInputGenerator, ERooTrackerVerticesModule);
27 OA_EXCEPTION(ENoKinematicsPassThroughTrees, ERooTrackerVerticesModule);
28 };
29 ///
30 /// Abstract base class for converting the neutrino MC pass-through information
31 /// into eventAnalysis defined objects which hold the truth information about
32 /// the interaction vertices in the event. This is so that inherited classes do
33 /// not have to replicate the funtionality of picking up the pass-through
34 /// information.
35 ///
37  public:
39  virtual ~TRooTrackerVtxModuleBase();
40  virtual Bool_t IsEnabledByDefault() const { return kTRUE; }
41 
42  // Derived classes share this functionality
43  void InitializeBranches();
44  void FillConfigTree(TTree* configTree);
45  bool FillTree(ND::TND280Event&);
46  Bool_t ProcessFirstEvent(ND::TND280Event& event);
48  // Derived classes have to implement this functionality
49  virtual void SetGeneratorTreeAddresses() = 0;
50  virtual Bool_t IsKnownGenerator(const char*) = 0;
51  virtual Bool_t CheckMismatch(ND::TG4PrimaryVertex vtx) = 0;
52  virtual Bool_t IsGeantinoVtx(ND::TG4PrimaryVertex vtx) = 0;
53  virtual void FillVtx(int entry) = 0;
54 
55  void SetBeginFile(TFile* input) { fLastBeginFile = input; }
56 
57  public:
58  Int_t fNVtx; ///< The number of vertices
59  TClonesArray* fVtx; ///< TClonesArray of vertex objects
60 
61  protected:
62  // File from last time BeginFile was called
64 
65  TFile* fCurrInputFile; ///< Current loaded pass-through file.
66 
67  TTree* fRooTrackerTree; ///< Current loaded rootracker file.
68 
69  TTree* fInputFileTree; ///< Pass-through book keeping trees.
70 
72  int fOrigTreeEntryNumber; ///< Entry in original rootracker tree.
73 
74  int fInputTreeEntryNumber; ///< The entry number in the current rootracker file.
75 
76  int fOrigInputTreeEntries; ///< The number of entries in the original input tree. Important for working out POTs.
78  std::string fOrigInputFileName; ///< The original rootracker tree POT.
79 
80  std::string fGeneratorName; ///< The generator name. Currently genie or neut.
81 
82  std::string fInputTreeName; ///< The input rootracker tree name. Currently gRooTracker or nRooTracker.
83 
84  double fTimeInSpill; ///< The time within the spill for vertex.
85 
86  int fTruthVertexID; ///< The ID of the truth vertex created from this generator vertex.
87 
88 
89  private:
90  bool LoadPassThroughInput(const ND::TG4PrimaryVertex& vtx);
91  bool UpdateBookKeepingInfo(const ND::TG4PrimaryVertex& vtx);
92  bool AreTreesLoaded(const ND::TG4PrimaryVertex& vtx);
93  bool GetTreesFromFile(const ND::TG4PrimaryVertex& vtx);
94  bool GetTreesFromDirectory(const ND::TG4PrimaryVertex& vtx);
95 
96  void ClearInputTrees();
97  std::string GetFileName(const ND::TG4PrimaryVertex& vtx);
98  std::string GetTreeName(const ND::TG4PrimaryVertex& vtx);
99  int GetEntryNum(const ND::TG4PrimaryVertex& vtx);
100  std::string GetFileFromPath(const char* path);
101  bool ComparePaths(const char* path1, const char* path2);
102  void ResetFileInfo();
103  void ResetVtxInfo();
104 
106 };
107 #endif
void SetFluxTreeAddresses(ND::JNuBeamFlux *flux)
int fOrigInputTreeEntries
The number of entries in the original input tree. Important for working out POTs. ...
bool FillTree(ND::TND280Event &)
Fill all the stuff that goes in the output tree.
TTree * fInputFileTree
Pass-through book keeping trees.
int fInputTreeEntryNumber
The entry number in the current rootracker file.
TTree * fRooTrackerTree
Current loaded rootracker file.
OA_EXCEPTION(EeventAnalysis, EoaCore)
Generate a base exception for the Analysis library.
Abstract base class for converting the neutrino MC pass-through information into eventAnalysis define...
Bool_t ProcessFirstEvent(ND::TND280Event &event)
Is called after the first event is loaded in.
int fTruthVertexID
The ID of the truth vertex created from this generator vertex.
std::string fGeneratorName
The generator name. Currently genie or neut.
int GetEntryNum(const ND::TG4PrimaryVertex &vtx)
TClonesArray * fVtx
TClonesArray of vertex objects.
Int_t fNVtx
The number of vertices.
bool UpdateBookKeepingInfo(const ND::TG4PrimaryVertex &vtx)
bool GetTreesFromFile(const ND::TG4PrimaryVertex &vtx)
void FillConfigTree(TTree *configTree)
virtual void FillVtx(int entry)=0
std::string GetFileFromPath(const char *path)
bool GetTreesFromDirectory(const ND::TG4PrimaryVertex &vtx)
double fTimeInSpill
The time within the spill for vertex.
bool ComparePaths(const char *path1, const char *path2)
bool AreTreesLoaded(const ND::TG4PrimaryVertex &vtx)
std::string fInputTreeName
The input rootracker tree name. Currently gRooTracker or nRooTracker.
TFile * fCurrInputFile
Current loaded pass-through file.
int fOrigTreeEntryNumber
Entry in original rootracker tree.
void InitializeBranches()
Initialize Branches. Don&#39;t do anything else in this function.
std::string GetFileName(const ND::TG4PrimaryVertex &vtx)
A base class for analysis output modules which contain event truth information.
virtual Bool_t IsEnabledByDefault() const
Is the module is enabled by default.
virtual void SetGeneratorTreeAddresses()=0
virtual Bool_t CheckMismatch(ND::TG4PrimaryVertex vtx)=0
virtual Bool_t IsGeantinoVtx(ND::TG4PrimaryVertex vtx)=0
virtual Bool_t IsKnownGenerator(const char *)=0
std::string GetTreeName(const ND::TG4PrimaryVertex &vtx)
bool LoadPassThroughInput(const ND::TG4PrimaryVertex &vtx)
std::string fOrigInputFileName
The original rootracker tree POT.

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