HighLAND
p0dExampleAnalysis.hxx
1 #ifndef p0dExampleAnalysis_h
2 #define p0dExampleAnalysis_h
3 
4 #include "baseP0DAnalysis.hxx"
5 #include "P0DDataClasses.hxx"
6 #include "ND280AnalysisUtils.hxx"
7 #include "p0dExampleSelection.hxx"
8 
10 public:
12  virtual ~p0dExampleAnalysis(){}
13 
14  // Mandatory functions
15 
16  bool Initialize();
17 
18  void DefineSelections();
19  void DefineCorrections();
20  void DefineSystematics();
21  void DefineConfigurations();
22  void DefineMicroTrees(bool addBase=true);
23  void DefineTruthTree();
24 
25  void FillMicroTrees(bool addBase=true);
26  void FillToyVarsInMicroTrees(bool addBase=true);
27 
28  bool CheckFillTruthTree(const AnaTrueVertex& vtx);
29 
30  using baseAnalysis::FillTruthTree;
31  void FillTruthTree(const AnaTrueVertex& vtx);
32 
33  // ---------
34 
35  /// Create the appropriate event type from an Spill and a Bunch in that spill
36  virtual AnaEventC* MakeEvent(){
37  if( _isUsingReconDirP0D){
38  // Create special event AnaLocalReconEvent
39  return new AnaLocalReconEvent(GetSpill(),*static_cast<const AnaLocalReconBunch*>(&input().GetBunch()));
40  }
41  else if(_isUsingReconDirP0DNew){
42  // Create special AnaP0DEvent
43  return new AnaP0DEvent(GetSpill(),GetBunch());
44  }
45  else{
46  // Create an standard event
48  }
49 
50  }
51 
52  /// Returns the ToyBoxP0D
53  virtual const ToyBoxP0D& box(Int_t isel=-1) const {return *static_cast<const ToyBoxP0D*>(&boxB(isel));}
54 
55  /// The ToyBoxP0D does not have a Vertex method
56  virtual AnaVertexB* GetVertex() const{return NULL;}
57 
58  /// returns the true vertex from the ToyBoxP0D
59  virtual AnaTrueVertexB* GetTrueVertex() const {return box().TrueVertex;}
60 
61  void FillMicroTreesNative();
62  void FillMicroTreesLocal();
63  void FillCategories();
64 
65 public:
66 
67  enum enumStandardMicroTrees_p0dExampleAnalysis{
68  vertexFiducial = enumStandardMicroTreesLast_baseP0DAnalysis+1,
69  vertexCycle,
70  vertexPosition,
71  vertexValidDim,
72  ClusterInVertexTruePDG,
73  ClusterInVertexPosition,
74 
75  HitInVertexPosition,
76 
77  nP0DTracksInGlobal,
78  nP0DOnlyTracksInGlobal,
79  P0DTracksInGlobalID,
80  P0DOnlyTracksInGlobalID,
81 
82  nMichel,
83 
84  nShowers,
85  Shower1EDeposit,
86  Shower2EDeposit,
87  Shower1Direction,
88  Shower2Direction,
89 
90  truevertex_pos,
91 
92  nVertices,
93  nParticles,
94  nClusters,
95 
96  nParticlesInVertex,
97  nClustersInVertex,
98  nHitsInVertex,
99 
100  nTracksInParticle,
101  nShowersInParticle,
102  nHitsInParticle,
103  nNodesInParticle,
104  ParticlePosition,
105 
106  nClustersInParticleInVertex,
107  nTracksInParticleInVertex,
108  nShowersInParticleInVertex,
109  nHitsInParticleInVertex,
110  nNodesInParticleInVertex,
111  nClustersInParticleInVertex2,
112 
113  ParticleInVertexPosition,
114  ParticleInVertexMomentum,
115  ParticleInVertexEDeposit,
116  ParticleInVertexLength,
117  ParticleInVertexID,
118  ParticleInVertexLink,
119  ParticleInVertexGlobal,
120  ParticleInVertexTrueMomentum,
121  ParticleInVertexTruePDG,
122 
123  ClusterInParticleInVertexTruePDG,
124  ClusterInParticleInVertexPosition,
125 
126  HitInParticleInVertexPosition,
127  HitInParticleInVertexCharge,
128  HitInParticleInVertexType,
129 
130  ClusterPosition,
131  ClusterTruePDG,
132  nHitsInCluster,
133 
134  enumStandardMicroTreesLast_p0dExampleAnalysis
135  };
136 
137 protected:
138 
139  bool _isUsingReconDirP0D;
140  bool _isUsingReconDirP0DNew;
141  bool _debug;
142 };
143 
144 #endif
bool Initialize()
[AnalysisAlgorithm_mandatory]
virtual AnaVertexB * GetVertex() const
The ToyBoxP0D does not have a Vertex method.
virtual AnaEventC * MakeEvent()
Create the appropriate event type from an Spill and a Bunch in that spill.
Representation of a true Monte Carlo vertex.
AnaP0DBunch & GetBunch()
Get a casted AnaBunchBB to AnaBunch from the InputManager.
AnaTrueVertexB * TrueVertex
For storing the true vertex, for analyses with no reconstructed primary vertex.
Definition: ToyBoxND280.hxx:22
virtual const ToyBoxP0D & box(Int_t isel=-1) const
Returns the ToyBoxP0D.
Representation of a true Monte Carlo vertex.
Definition: DataClasses.hxx:50
virtual AnaEventC * MakeEvent()
Create the appropriate event time from an Spill and a Bunch in that spill.
Representation of a global vertex.
virtual AnaTrueVertexB * GetTrueVertex() const
returns the true vertex from the ToyBoxP0D
AnaSpill & GetSpill()
Get a casted AnaSpillC to AnaSpill from the InputManager.