4 Log(2,
"ShowRec.cpp",
"--- void ReconstructShowers_BW() ---");
44 Float_t local_gAli_pat_interim_halfsize=0;
45 Double_t dR,dT,dminDist;
71 Int_t local_NBTallMC=0;
73 float_t local_pure=-1;
74 float_t local_purall=-1;
86 cout << endl << endl <<
"--- Starting Shower for Number " << i <<
" (MCEvt=" << InBT->
MCEvt() <<
") now: "<<endl;
88 cout <<
"InBT->P() " << InBT->
P() << endl;
105 Int_t local_gAli_npat=local_gAli->
Npatterns();
106 Int_t btloop_cnt_N=0;
108 cout <<
"--- Starting BACKWARD Reco... ---" << endl;
109 if (
gEDBDEBUGLEVEL>2) cout <<
"--- local_gAli_npat= " << local_gAli_npat << endl;
111 Int_t patterloop_cnt_InBT=-1;
112 Float_t patterloop_cnt_InBT_Z=0;
113 for (Int_t patterloop_cnt=0; patterloop_cnt<local_gAli_npat; patterloop_cnt++) {
114 if (
gEDBDEBUGLEVEL>3) cout <<
"--- --- Doing patterloop_cnt= " << patterloop_cnt << endl;
116 if (local_gAli->
GetPattern(patterloop_cnt)->
Z()<InBT->
Z())
continue;
117 patterloop_cnt_InBT=patterloop_cnt;
118 patterloop_cnt_InBT_Z=local_gAli->
GetPattern(patterloop_cnt)->
Z();
120 if (
gEDBDEBUGLEVEL>2) cout <<
"--- patterloop_cnt_InBT= " << patterloop_cnt_InBT << endl;
121 if (
gEDBDEBUGLEVEL>2) cout <<
"--- patterloop_cnt_InBT_Z= " << patterloop_cnt_InBT_Z << endl;
128 if (
gEDBDEBUGLEVEL>2) cout <<
"local_gAli->GetPattern(local_gAli_npat-1)->Z() " << local_gAli->
GetPattern(local_gAli_npat-1)->
Z() << endl;
135 if (
gEDBDEBUGLEVEL>2) cout <<
"--- StepNr for going backwards (decreasing Z) to next plate= " << StepNr << endl;
138 Bool_t FP_reached=kFALSE;
139 Int_t patterloop_cnt=patterloop_cnt_InBT;
140 if (StepNr==1) patterloop_cnt=patterloop_cnt_InBT;
141 if (StepNr==-1) cout <<
"DONT KNOW HERE WHICH patterloop_cnt=local_gAli_npat-1; to calculate!!! " << endl;
145 while (!FP_reached) {
146 if (
gEDBDEBUGLEVEL>2) cout <<
" FP NOT YET REACHED .... << doing patterloop_cnt = " << patterloop_cnt << endl;
148 if (
gEDBDEBUGLEVEL>2) cout <<
" FP NOT YET REACHED .... << with btloop_cnt_N = " << btloop_cnt_N << endl;
153 for (Int_t btloop_cnt=0; btloop_cnt<btloop_cnt_N; ++btloop_cnt) {
157 Bool_t add_seg=kFALSE;
158 if (
gEDBDEBUGLEVEL>3) cout <<
"btloop_cnt (ot of ) " << btloop_cnt <<
" ( " << btloop_cnt_N <<
" ) " << endl;
163 if (
gEDBDEBUGLEVEL>3) cout <<
"actualEntries of GLOBAL_ShowerSegArray: " << actualEntries << endl;
164 for (
int i=0; i<actualEntries; ++i) {
166 Float_t dZ=TMath::Abs(segShower->
Z()-seg->
Z());
168 dR=
GetdR(seg,segShower);
170 if (
gEDBDEBUGLEVEL>3) cout <<
"btloop_cnt i dT dR dminDist dZ: " << btloop_cnt <<
" " << i <<
" " << dT <<
" " << dR <<
" " << dminDist <<
" " << dZ << endl;
175 if (
gEDBDEBUGLEVEL>3) cout <<
"try to add this BT (if not already in there...) "<< endl;
183 show_NP=TMath::Max(show_NP,TMath::Abs(BT_1->
PID()-BT_2->
PID())+1);
189 patterloop_cnt=patterloop_cnt+StepNr;
190 if (patterloop_cnt<0) FP_reached=kTRUE;
191 if (patterloop_cnt>=local_gAli_npat) FP_reached=kTRUE;
193 if (show_NP>=
cmd_NP) FP_reached=kTRUE;
203 Double_t purall, pure;
212 if (
gEDBDEBUGLEVEL>2) cout <<
" Check if its sorted: GLOBAL_ShowerSegArray->At(0)->Z() should be the lowest one...continue;" << endl;
219 Float_t mindTTT=999999;
224 if (segShower->
Z()!=ShowerAxis->
Z())
continue;
233 if (
gEDBDEBUGLEVEL>2) cout <<
"--- Starting FORWARD Reco... ---" << endl;
242 for (Int_t patterloop_cnt=0; patterloop_cnt<local_gAli_npat; patterloop_cnt++) {
243 if (
gEDBDEBUGLEVEL>3) cout <<
"--- --- Doing patterloop_cnt= " << patterloop_cnt << endl;
245 if (local_gAli->
GetPattern(patterloop_cnt)->
Z()<ShowerAxis->
Z())
continue;
246 patterloop_cnt_InBT=patterloop_cnt;
247 patterloop_cnt_InBT_Z=local_gAli->
GetPattern(patterloop_cnt)->
Z();
249 if (
gEDBDEBUGLEVEL>2) cout <<
"--- patterloop_cnt_InBT= " << patterloop_cnt_InBT << endl;
250 if (
gEDBDEBUGLEVEL>2) cout <<
"--- patterloop_cnt_InBT_Z= " << patterloop_cnt_InBT_Z << endl;
253 Int_t StepNrForward=StepNr*-1;
254 StepNr=StepNrForward;
257 Bool_t LP_reached=kFALSE;
258 patterloop_cnt=patterloop_cnt_InBT;
260 while (!LP_reached) {
261 if (
gEDBDEBUGLEVEL>2) cout <<
" LP NOT YET REACHED .... << doing patterloop_cnt = " << patterloop_cnt << endl;
263 if (
gEDBDEBUGLEVEL>2) cout <<
" LP NOT YET REACHED .... << with btloop_cnt_N = " << btloop_cnt_N << endl;
268 for (Int_t btloop_cnt=0; btloop_cnt<btloop_cnt_N; ++btloop_cnt) {
271 Bool_t add_seg=kFALSE;
272 if (
gEDBDEBUGLEVEL>3) cout <<
"btloop_cnt (ot of ) " << btloop_cnt <<
" ( " << btloop_cnt_N <<
" ) " << endl;
277 if (
gEDBDEBUGLEVEL>3) cout <<
"actualEntries of GLOBAL_ShowerSegArray: " << actualEntries << endl;
278 for (
int i=0; i<actualEntries; ++i) {
280 Float_t dZ=TMath::Abs(segShower->
Z()-seg->
Z());
282 dR=
GetdR(seg,segShower);
284 if (
gEDBDEBUGLEVEL>3) cout <<
"btloop_cnt i dT dR dminDist dZ: " << btloop_cnt <<
" " << i <<
" " << dT <<
" " << dR <<
" " << dminDist <<
" " << dZ << endl;
289 if (
gEDBDEBUGLEVEL>3) cout <<
"try to add this BT (if not already in there...) "<< endl;
297 show_NP=TMath::Max(show_NP,TMath::Abs(BT_1->
PID()-BT_2->
PID())+1);
305 CalcTrackDensity(pat_interim,local_gAli_pat_interim_halfsize,npat_int,npat_total,npatN);
311 patterloop_cnt=patterloop_cnt+StepNr;
312 if (patterloop_cnt<0) LP_reached=kTRUE;
313 if (patterloop_cnt>=local_gAli_npat) LP_reached=kTRUE;
315 if (show_NP>=
cmd_NP) LP_reached=kTRUE;
330 Double_t eff, purall, pure;
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
Double_t GetdeltaThetaSingleAngles(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.cpp:7258
void CalcEffPurOfShower(TObjArray *arr, Int_t &NBT, Int_t &NBTMC, Int_t &NBTallMC, Int_t &NBTeMC, Double_t &purall, Double_t &pure)
Definition: ShowRec.cpp:7597
EdbPVRec * TransformEdbPVRec_BackWard(EdbPVRec *gAli, EdbSegP *InitiatorBT)
Definition: ShowRec.cpp:6413
Bool_t IsShowerSortedZ(TObjArray *showerarray)
Definition: ShowRec.cpp:8801
Bool_t AddBTToArrayWithCeck(EdbSegP *tryAttachedSegment, TObjArray *GLOBAL_ShowerSegArray)
Definition: ShowRec.cpp:5939
void CalcTrackDensity(EdbPattern *pat_interim, Float_t pat_interim_halfsize, Int_t &npat_int, Int_t &npat_total, Int_t &npatN)
Definition: ShowRec.cpp:8749
void SortShowerZ(TObjArray *showerarray)
Definition: ShowRec.cpp:8816
void TransferShowerObjectArrayIntoEntryOfTreebranchShowerTree(TTree *treebranchtree, TObjArray *segarray)
Definition: ShowRec.cpp:7940
void CalcEffPurOfShower2(TObjArray *arr, Int_t &NBT, Int_t &NBTMC, Int_t &NBTallMC, Int_t &NBTeMC, Double_t &purall, Double_t &pure, Int_t NBT_Neff, Int_t NBTMC_Neff, Int_t NBTMCe_Neff)
Definition: ShowRec.cpp:7631
Double_t GetdeltaTheta(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.cpp:7239
EdbSegP * BuildShowerAxis(TObjArray *ShowerSegArray)
Definition: ShowRec.cpp:8629
void PrintShowerObjectArray(TObjArray *segarray)
Definition: ShowRec.cpp:6967
Double_t GetMinimumDist(EdbSegP *seg1, EdbSegP *seg2)
Definition: ShowRec.cpp:8581
void CalcEfficencyNumbers(EdbPattern *pat_interim, Int_t MCCheck, Int_t &NBT_Neff, Int_t &NBTMC_Neff, Int_t &NBTMCe_Neff)
Definition: ShowRec.cpp:8771
Int_t GLOBAL_INBTSHOWERNR
Definition: ShowRec.h:80
Double_t GLOBAL_trckdens
Definition: ShowRec.h:39
EdbPVRec * GLOBAL_gAli
Definition: ShowRec.h:73
Int_t cmd_OUTPUTLEVEL
Definition: ShowRec.h:33
Int_t GLOBAL_EvtBT_FlagArray[99999]
Definition: ShowRec.h:51
TObjArray * GLOBAL_ShowerSegArray
Definition: ShowRec.h:76
Int_t GLOBAL_InBT_MC
Definition: ShowRec.h:43
Double_t GLOBAL_EvtBT_EArray[99999]
Definition: ShowRec.h:52
Int_t GLOBAL_EvtBT_MCArray[99999]
Definition: ShowRec.h:51
TTree * TREE_ShowRecEff
Definition: ShowRec.h:62
Float_t shower_trackdensb
Definition: ShowRec.h:395
Int_t GLOBAL_InBT_Flag
Definition: ShowRec.h:43
Double_t GLOBAL_EvtBT_E
Definition: ShowRec.h:50
Double_t GLOBAL_InBT_TanTheta
Definition: ShowRec.h:44
Double_t GetdR(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.h:167
Double_t GLOBAL_InBT_E
Definition: ShowRec.h:44
Double_t CUT_PARAMETER[10]
Definition: ShowRec.h:78
Int_t GLOBAL_EvtBT_MC
Definition: ShowRec.h:49
Int_t GLOBAL_InBTArrayEntries
Definition: ShowRec.h:75
Int_t cmd_NP
Definition: ShowRec.h:18
Double_t GLOBAL_EvtBT_TanThetaArray[99999]
Definition: ShowRec.h:52
Double_t GLOBAL_EvtBT_TanTheta
Definition: ShowRec.h:50
TTree * TREE_ShowShower
Definition: ShowRec.h:68
Int_t GLOBAL_EvtBT_Flag
Definition: ShowRec.h:49
TObjArray * GLOBAL_InBTArray
Definition: ShowRec.h:74
Definition: EdbPVRec.h:148
Definition: EdbPattern.h:280
Int_t Npatterns() const
Definition: EdbPattern.h:380
EdbPattern * GetPattern(int id) const
Definition: EdbPattern.cxx:1887
Float_t TX() const
Definition: EdbSegP.h:172
Float_t Z() const
Definition: EdbSegP.h:150
Float_t P() const
Definition: EdbSegP.h:149
void PrintNice() const
Definition: EdbSegP.cxx:418
Int_t PID() const
Definition: EdbSegP.h:145
Float_t TY() const
Definition: EdbSegP.h:173
Int_t MCEvt() const
Definition: EdbSegP.h:142
Int_t Flag() const
Definition: EdbSegP.h:146
Float_t Z() const
Definition: EdbPattern.h:87
Int_t GetN() const
Definition: EdbPattern.h:65
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66
Definition: EdbVertex.h:68
gEDBDEBUGLEVEL
Definition: energy.C:7