FEDRA emulsion software from the OPERA Collaboration
EdbShowAlg.h
Go to the documentation of this file.
1#ifndef ROOT_EdbShowAlg
2#define ROOT_EdbShowAlg
3
4#include "TROOT.h"
5#include "TFile.h"
6#include "TVector3.h"
7#include "TIndexCell.h"
8#include "TArrayF.h"
9#include "TBenchmark.h"
10#include "EdbVertex.h"
11#include "EdbPVRec.h"
12#include "EdbPhys.h"
13#include "EdbMath.h"
15#include "EdbLog.h"
16#include "EdbPattern.h"
17#include "EdbShowerP.h"
18using namespace std;
19
20//______________________________________________________________________________
21//___
22//___ Declaration of EdbShowAlg Class:
23//___ Following structure is foreseen: The (inherited) class instances of
24//___ EdbShowAlg DO the reconstruction. They DONT manage the data.
25//___ Following the principle "separate algorithms and data" (like ATHENA,
26//___ the ATLAS framework). Therefore the EdbPVRec Object, the Initiator
27//___ Base Tracks and the shower arrays are only handed over either as
28//___ reference or as pointers. Saving/manipulating/preparing of these
29//___ objects will only be done in the EdbShowRec class instances!
30//___
31//______________________________________________________________________________
32
33
34
35
36
37
38//______________________________________________________________________________
39
40class EdbShowAlg : public TObject {
41
42private:
43// nothing...
44
45protected:
46
47// A algorithm here should not have more than 10 different parameters, otherwise we
48// will have to use TObjArray implementations.
49 TString eAlgName;
50 Int_t eAlgValue;
51 Int_t eParaN;
52 Float_t eParaValue[10];
53 TString eParaString[10];
54 Int_t eActualAlgParametersetNr; // Used when more sets of same algorithm
55
56
57// Pointer copies from class EdbShowRec to be used for reconstruction of showers
58// EdbPVRec object:
60 Int_t eAliNpat;
61// TObjArray storing Initiator Basetracks:
62 TObjArray* eInBTArray;
64// Variables describing plate number cuts.
69// TObjArray storing Reconstructed Showers:
70 TObjArray* eRecoShowerArray;
72
73// Transformed (smaller) EdbPVRec object:
76// Flag wheter to use the small EdbPvrec Object or not. Using small object, this will not be deleted ue to
77// pointer problems. See in implementation of Transform() for details.
79
80
81// In constructor this is created on heap...
83
84// Reset All Default Variables:
85 void Set0();
86
87
88public:
89
91 EdbShowAlg(TString AlgName, Int_t AlgValue);
92// EdbShowAlg(TString AlgName, Int_t AlgValue, Float_t* ParaValue[10], TString ParaString[10]);
93// EdbShowAlg(EdbPVRec* gAli, TObjArray* InBTArray);
94
95
96 virtual ~EdbShowAlg(); // virtual constructor due to inherited class
97
98
99// Hand over eAli eInBTArray from EdbShowerRec
100 inline void SetEdbPVRec( EdbPVRec* Ali ) {
101 eAli = Ali;
103 }
104 inline void SetInBTArray( TObjArray* InBTArray ) {
105 eInBTArray = InBTArray;
106 eInBTArrayN=eInBTArray->GetEntries();
107 }
108 inline void SetEdbPVRecPIDNumbers(Int_t FirstPlate_eAliPID, Int_t LastPlate_eAliPID, Int_t MiddlePlate_eAliPID, Int_t NumberPlate_eAliPID) {
109 eFirstPlate_eAliPID=FirstPlate_eAliPID;
110 eLastPlate_eAliPID=LastPlate_eAliPID;
111 eMiddlePlate_eAliPID=MiddlePlate_eAliPID;
112 eNumberPlate_eAliPID=NumberPlate_eAliPID;
113 }
114 inline void SetRecoShowerArray(TObjArray* RecoShowerArray) {
116 }
117 inline void SetRecoShowerArrayN(Int_t RecoShowerArrayN) {
118 eRecoShowerArrayN=RecoShowerArrayN;
119 }
120 inline void AddRecoShowerArray(EdbShowerP* shower) {
121 eRecoShowerArray->Add(shower);
123 }
124
125
126 inline void SetActualAlgParameterset(Int_t ActualAlgParametersetNr) {
127 eActualAlgParametersetNr=ActualAlgParametersetNr;
128 }
129
130 inline Int_t GetAlgValue() const {
131 return eAlgValue;
132 }
133 inline TString GetAlgName() const {
134 return eAlgName;
135 }
136 inline Int_t GetRecoShowerArrayN() const {
137 return eRecoShowerArrayN;
138 }
139 inline TObjArray* GetRecoShowerArray() const {
140 return eRecoShowerArray;
141 }
142 inline EdbShowerP* GetShower(Int_t i) const {
143 EdbShowerP* shower = (EdbShowerP*)eRecoShowerArray->At(i);
144 return shower;
145 }
146
147 inline void SetUseAliSub(Bool_t UseAliSub) {
148 eUseAliSub=UseAliSub;
149 }
150
151
152 Double_t DeltaR_WithPropagation(EdbSegP* s,EdbSegP* stest);
153 Double_t DeltaR_WithoutPropagation(EdbSegP* s,EdbSegP* stest);
154 Double_t DeltaR_NoPropagation(EdbSegP* s,EdbSegP* stest);
155
156 Double_t DeltaTheta(EdbSegP* s1,EdbSegP* s2);
159 Double_t GetSpatialDist(EdbSegP* s1,EdbSegP* s2);
160 Double_t GetMinimumDist(EdbSegP* seg1,EdbSegP* seg2);
161
162
163 void SetParameters(Float_t* par);
164 void SetParameter(Int_t parNr, Float_t par);
165//void Transform_eAli(EdbSegP* InitiatorBT);
166 void Transform_eAli( EdbSegP* InitiatorBT, Float_t ExtractSize);
167 Bool_t IsInConeTube(EdbSegP* sTest, EdbSegP* sStart, Double_t CylinderRadius, Double_t ConeAngle);
168
169 void UpdateShowerIDs();
171
172 void Print();
173 void PrintParameters();
175 void PrintMore();
176 void PrintAll();
177
178 void Help();
179
180
181// Main functions for using this ShowerAlgorithm Object.
182// Structure is made similar to OpRelease, where
183// Initialize, Execute, Finalize
184// give the three columns of the whole thing.
185// Since these functions depend on the algorithm type they are made virtual
186// and implemented in the inherited classes.
187 virtual void Initialize();
188 virtual void Execute();
189 virtual void Finalize();
190
191 ClassDef(EdbShowAlg,1); // Root Class Definition for my Objects
192};
193
194
195//______________________________________________________________________________
196
197class EdbShowAlg_SA : public EdbShowAlg {
198
199// S_imple A_lg, just collecting every BT which belongs to same MC Event as InBT
200
201public:
202
204 virtual ~EdbShowAlg_SA(); // virtual constructor due to inherited class
205
206 void Init();
207
208// Main functions for using this ShowerAlgorithm Object.
209// Structure is made similar to OpRelease, where
210// Initialize, Execute, Finalize
211// give the three columns of the whole thing.
212 void Initialize();
213 void Execute();
214 void Finalize();
215
216 ClassDef(EdbShowAlg_SA,1); // Root Class Definition for my Objects
217};
218
219
220
221//______________________________________________________________________________
222
223class EdbShowAlg_CA : public EdbShowAlg {
224
225// C_one A_dvanced Alg
226
227private:
228 Bool_t GetConeTubeDistanceToInBT(EdbSegP* sa, EdbSegP* s, Double_t CylinderRadius, Double_t ConeAngle);
229 Bool_t FindPrecedingBTs(EdbSegP* s, EdbSegP* InBT, EdbPVRec *gAli, EdbShowerP* shower);
230
231public:
232
234 virtual ~EdbShowAlg_CA(); // virtual constructor due to inherited class
235
236// Main functions for using this ShowerAlgorithm Object.
237// Structure is made similar to OpRelease, where
238// Initialize, Execute, Finalize
239// give the three columns of the whole thing.
240 void Initialize();
241 void Execute();
242 void Finalize();
243
244 ClassDef(EdbShowAlg_CA,1); // Root Class Definition for my Objects
245};
246
247
248
249
250//______________________________________________________________________________
251
252class EdbShowAlg_OI : public EdbShowAlg {
253
254// O_fficial I_mplementation Alg. Try of the "libShower recdown" algorithm to keep backward compability.
255
256private:
257 Bool_t FindPrecedingBTs(EdbSegP* s, EdbSegP* InBT, EdbPVRec *gAli, EdbShowerP* shower);
258
259public:
260
262 virtual ~EdbShowAlg_OI(); // virtual constructor due to inherited class
263
264// Main functions for using this ShowerAlgorithm Object.
265// Structure is made similar to OpRelease, where
266// Initialize, Execute, Finalize
267// give the three columns of the whole thing.
268 void Initialize();
269 void Execute();
270 void Finalize();
271
272 ClassDef(EdbShowAlg_OI,1); // Root Class Definition for my Objects
273};
274
275
276//______________________________________________________________________________
277
278class EdbShowAlg_RC : public EdbShowAlg {
279
280// R_ecursive C_one algorithm.
281
282private:
283 Bool_t FindPrecedingBTs(EdbSegP* s, EdbSegP* InBT, EdbPVRec *gAli, EdbShowerP* shower);
284
285public:
287 virtual ~EdbShowAlg_RC(); // virtual constructor due to inherited class
288
289 Bool_t GetConeOrTubeDistanceToBTOfShowerArray(EdbSegP* sa, EdbSegP* InBT, EdbShowerP* shower, Double_t CylinderRadius, Double_t ConeAngle);
290
291 void Initialize();
292 void Execute();
293 void Finalize();
294
295 ClassDef(EdbShowAlg_RC,1); // Root Class Definition for my Objects
296};
297
298
299//______________________________________________________________________________
300
301class EdbShowAlg_BW : public EdbShowAlg {
302
303 // B_ack_W_ard algorithm.
304
305private:
306 Bool_t DummyBWFunction();
307
308public:
310 virtual ~EdbShowAlg_BW(); // virtual constructor due to inherited class
311
312 void Initialize();
313 void Execute();
314 void Finalize();
315
316 ClassDef(EdbShowAlg_BW,1); // Root Class Definition for my Objects
317};
318
319//______________________________________________________________________________
320// class EdbShowAlg_NN : public EdbShowAlg
321// ->Declared in File "EdbShowAlg_NN.h"
322// ->Implemented in File "EdbShowAlg_NN.cxx"
323//______________________________________________________________________________
324// class EdbShowAlg_N3 : public EdbShowAlg
325// ->Declared in File "EdbShowAlg_NN.h"
326// ->Implemented in File "EdbShowAlg_NN.cxx"
327//______________________________________________________________________________
328
329/*
330TO BE IMPLEMENTED ALGORITHMS IF TIME (and needed, if not available from "showrec" standalone program):
3310 CT (ConeTube)
3321 CL (CLuster)
3332 CA (ConetubeAdvanced)
3343 NN (NeuralNet)
3354 OI (OfficialImplementation)
3365 SA (?? SA ??)
3376 TC (TrackCone)
3387 RC (RecursiveCone)
3398 BW (BackWard)
3409 AG (AdvancedGamma)
34110 GS (GammaSearch)
34211 N3 (NewNeuralNet)
343*/
344//______________________________________________________________________________
345
346
347#endif /* ROOT_EdbShowAlg */
TObjArray * RecoShowerArray
Definition: Shower_E_FromShowerRoot.C:12
Definition: EdbPVRec.h:148
Int_t Npatterns() const
Definition: EdbPattern.h:366
Definition: EdbSegP.h:21
Definition: EdbShowAlg.h:301
Bool_t DummyBWFunction()
Definition: EdbShowAlg.cxx:1921
void Finalize()
Definition: EdbShowAlg.cxx:1915
void Initialize()
Definition: EdbShowAlg.cxx:1903
void Execute()
Definition: EdbShowAlg.cxx:1909
ClassDef(EdbShowAlg_BW, 1)
EdbShowAlg_BW()
Definition: EdbShowAlg.cxx:1875
virtual ~EdbShowAlg_BW()
Definition: EdbShowAlg.cxx:1897
Definition: EdbShowAlg.h:223
void Finalize()
Definition: EdbShowAlg.cxx:1021
Bool_t FindPrecedingBTs(EdbSegP *s, EdbSegP *InBT, EdbPVRec *gAli, EdbShowerP *shower)
Definition: EdbShowAlg.cxx:1088
void Execute()
Definition: EdbShowAlg.cxx:834
virtual ~EdbShowAlg_CA()
Definition: EdbShowAlg.cxx:819
ClassDef(EdbShowAlg_CA, 1)
void Initialize()
Definition: EdbShowAlg.cxx:828
EdbShowAlg_CA()
Definition: EdbShowAlg.cxx:793
Bool_t GetConeTubeDistanceToInBT(EdbSegP *sa, EdbSegP *s, Double_t CylinderRadius, Double_t ConeAngle)
Definition: EdbShowAlg.cxx:1027
Definition: EdbShowAlg.h:252
ClassDef(EdbShowAlg_OI, 1)
void Execute()
Definition: EdbShowAlg.cxx:1216
Bool_t FindPrecedingBTs(EdbSegP *s, EdbSegP *InBT, EdbPVRec *gAli, EdbShowerP *shower)
Definition: EdbShowAlg.cxx:1479
void Initialize()
Definition: EdbShowAlg.cxx:1210
void Finalize()
Definition: EdbShowAlg.cxx:1463
EdbShowAlg_OI()
Definition: EdbShowAlg.cxx:1174
virtual ~EdbShowAlg_OI()
Definition: EdbShowAlg.cxx:1201
Definition: EdbShowAlg.h:278
void Finalize()
Definition: EdbShowAlg.cxx:1756
Bool_t FindPrecedingBTs(EdbSegP *s, EdbSegP *InBT, EdbPVRec *gAli, EdbShowerP *shower)
Definition: EdbShowAlg.cxx:1772
EdbShowAlg_RC()
Definition: EdbShowAlg.cxx:1554
virtual ~EdbShowAlg_RC()
Definition: EdbShowAlg.cxx:1578
ClassDef(EdbShowAlg_RC, 1)
Bool_t GetConeOrTubeDistanceToBTOfShowerArray(EdbSegP *sa, EdbSegP *InBT, EdbShowerP *shower, Double_t CylinderRadius, Double_t ConeAngle)
Definition: EdbShowAlg.cxx:1829
void Execute()
Definition: EdbShowAlg.cxx:1593
void Initialize()
Definition: EdbShowAlg.cxx:1587
Definition: EdbShowAlg.h:197
virtual ~EdbShowAlg_SA()
Definition: EdbShowAlg.cxx:586
void Init()
Definition: EdbShowAlg.cxx:595
ClassDef(EdbShowAlg_SA, 1)
void Finalize()
Definition: EdbShowAlg.cxx:773
EdbShowAlg_SA()
Definition: EdbShowAlg.cxx:568
void Initialize()
Definition: EdbShowAlg.cxx:615
void Execute()
Definition: EdbShowAlg.cxx:622
Definition: EdbShowAlg.h:40
Int_t GetAlgValue() const
Definition: EdbShowAlg.h:130
Int_t GetRecoShowerArrayN() const
Definition: EdbShowAlg.h:136
virtual void Finalize()
Definition: EdbShowAlg.cxx:331
Double_t DeltaR_WithoutPropagation(EdbSegP *s, EdbSegP *stest)
Definition: EdbShowAlg.cxx:404
Int_t eAliNpat
Definition: EdbShowAlg.h:60
void SetUseAliSub(Bool_t UseAliSub)
Definition: EdbShowAlg.h:147
void UpdateShowerIDs()
Definition: EdbShowAlg.cxx:479
void Print()
Definition: EdbShowAlg.cxx:338
void Transform_eAli(EdbSegP *InitiatorBT, Float_t ExtractSize)
Definition: EdbShowAlg.cxx:107
void SetEdbPVRecPIDNumbers(Int_t FirstPlate_eAliPID, Int_t LastPlate_eAliPID, Int_t MiddlePlate_eAliPID, Int_t NumberPlate_eAliPID)
Definition: EdbShowAlg.h:108
Float_t eParaValue[10]
Definition: EdbShowAlg.h:52
void AddRecoShowerArray(EdbShowerP *shower)
Definition: EdbShowAlg.h:120
Double_t GetSpatialDist(EdbSegP *s1, EdbSegP *s2)
Definition: EdbShowAlg.cxx:463
void SetRecoShowerArray(TObjArray *RecoShowerArray)
Definition: EdbShowAlg.h:114
void SetRecoShowerArrayN(Int_t RecoShowerArrayN)
Definition: EdbShowAlg.h:117
Double_t DeltaThetaComponentwise(EdbSegP *s1, EdbSegP *s2)
Definition: EdbShowAlg.cxx:441
Bool_t IsInConeTube(EdbSegP *sTest, EdbSegP *sStart, Double_t CylinderRadius, Double_t ConeAngle)
Definition: EdbShowAlg.cxx:248
virtual ~EdbShowAlg()
Definition: EdbShowAlg.cxx:44
virtual void Initialize()
Definition: EdbShowAlg.cxx:317
ClassDef(EdbShowAlg, 1)
TString eParaString[10]
Definition: EdbShowAlg.h:53
TString eAlgName
Definition: EdbShowAlg.h:49
void Set0()
Definition: EdbShowAlg.cxx:53
void SetParameter(Int_t parNr, Float_t par)
Definition: EdbShowAlg.cxx:90
EdbShowerP * GetShower(Int_t i) const
Definition: EdbShowAlg.h:142
Double_t DeltaThetaSingleAngles(EdbSegP *s1, EdbSegP *s2)
Definition: EdbShowAlg.cxx:455
void SetInBTArray(TObjArray *InBTArray)
Definition: EdbShowAlg.h:104
TObjArray * eRecoShowerArray
Definition: EdbShowAlg.h:70
Double_t GetMinimumDist(EdbSegP *seg1, EdbSegP *seg2)
Definition: EdbShowAlg.cxx:1943
Double_t DeltaR_NoPropagation(EdbSegP *s, EdbSegP *stest)
Definition: EdbShowAlg.cxx:396
Int_t eAli_SubNpat
Definition: EdbShowAlg.h:75
Int_t eAlgValue
Definition: EdbShowAlg.h:50
Int_t eFirstPlate_eAliPID
Definition: EdbShowAlg.h:65
void PrintMore()
Definition: EdbShowAlg.cxx:376
void Help()
Definition: EdbShowAlg.cxx:513
void SetEdbPVRec(EdbPVRec *Ali)
Definition: EdbShowAlg.h:100
Int_t eLastPlate_eAliPID
Definition: EdbShowAlg.h:66
Int_t eInBTArrayN
Definition: EdbShowAlg.h:63
void PrintAll()
Definition: EdbShowAlg.cxx:387
Int_t eMiddlePlate_eAliPID
Definition: EdbShowAlg.h:67
Int_t eParaN
Definition: EdbShowAlg.h:51
void PrintParameters()
Definition: EdbShowAlg.cxx:358
Double_t DeltaR_WithPropagation(EdbSegP *s, EdbSegP *stest)
Definition: EdbShowAlg.cxx:411
TObjArray * eInBTArray
Definition: EdbShowAlg.h:62
EdbPVRec * eAli
Definition: EdbShowAlg.h:59
Int_t eNumberPlate_eAliPID
Definition: EdbShowAlg.h:68
void SetParameters(Float_t *par)
Definition: EdbShowAlg.cxx:79
EdbShowerP * eRecoShower
Definition: EdbShowAlg.h:82
Int_t eUseAliSub
Definition: EdbShowAlg.h:78
void SetActualAlgParameterset(Int_t ActualAlgParametersetNr)
Definition: EdbShowAlg.h:126
Int_t eRecoShowerArrayN
Definition: EdbShowAlg.h:71
EdbPVRec * eAli_Sub
Definition: EdbShowAlg.h:74
void UpdateShowerMetaData()
Definition: EdbShowAlg.cxx:492
TString GetAlgName() const
Definition: EdbShowAlg.h:133
Double_t DeltaTheta(EdbSegP *s1, EdbSegP *s2)
Definition: EdbShowAlg.cxx:425
TObjArray * GetRecoShowerArray() const
Definition: EdbShowAlg.h:139
void PrintParametersShort()
Definition: EdbShowAlg.cxx:366
virtual void Execute()
Definition: EdbShowAlg.cxx:323
Int_t eActualAlgParametersetNr
Definition: EdbShowAlg.h:54
Definition: EdbShowerP.h:28
s
Definition: check_shower.C:55
EdbPVRec * gAli
Definition: check_vertex.C:14
EdbSegP * s1
Definition: tlg2couples.C:29
EdbSegP * s2
Definition: tlg2couples.C:30
Definition: AlignmentCint.cxx:51