============================================================================================
Change with respect to libShowRec: here we assume that Segment will always be the Initiator BaseTrack and Segment2 is the other segment to check.
Segment = (EdbSegP*)pat_one->GetSegment(pat_one_bt_cnt); Segment = InBT; Change with respect to libShowRec: here we assume that Segment will always be the Initiator BaseTrack.
At first: Check for already duplicated pairings: if (CheckPairDuplications(Segment->PID(),Segment->ID(),Segment2->PID(),Segment2->ID(), SegmentPIDArray,SegmentIDArray,Segment2PIDArray,Segment2IDArray, RecoShowerArrayN)) continue;
============================================================================================
4 Log(2,
"ShowRec.cpp",
"--- void ReconstructShowers_GS() ---");
23 Float_t local_gAli_pat_interim_halfsize=0;
28 Bool_t IsFirstLoopCount=kTRUE;
29 Int_t LastGlobalMCEventNr=1;
54 Int_t local_NBTallMC=0;
56 float_t local_pure=-1;
57 float_t local_purall=-1;
68 cout << endl << endl <<
"--- Starting Shower for Number " << i <<
" now: "<<endl;
90 if( IsFirstLoopCount==kTRUE) cout <<
"Option: GLOBAL_InBT_MC<0&& cmd_GBMC<0"<<endl;
95 if( IsFirstLoopCount==kTRUE) cout <<
"Option: GLOBAL_InBT_MC<0 && cmd_GBMC==0"<<endl;
96 vtx->
SetXYZ(InBT->
X()-650*InBT->
TX(),InBT->
Y()-650*InBT->
TY(),InBT->
Z()-650);
98 else if (GLOBAL_InBT_MC<0 && cmd_GBMC>0) {
99 if( IsFirstLoopCount==kTRUE) cout <<
"Option: GLOBAL_InBT_MC<0 && cmd_GBMC>0"<<endl;
103 if( IsFirstLoopCount==kTRUE) cout <<
"Option: GLOBAL_InBT_MC>0 && GLOBAL_IsBrickTreePGunInfo==kFALSE"<<endl;
104 vtx->
SetXYZ(InBT->
X()-650*InBT->
TX(),InBT->
Y()-650*InBT->
TY(),InBT->
Z()-650);
107 if( IsFirstLoopCount==kTRUE) cout <<
"Option: else"<<endl;
113 cout <<
"The vtx info for this MC event: X:Y:Z:MC: " << vtx->
X() <<
" " << vtx->
Y() <<
" " << vtx->
Z() <<
" " <<
GLOBAL_InBT_MC << endl;
114 cout <<
"The vtx info for this MC event: IP(INBT,vtx): " <<
CalcIP(InBT,vtx)<< endl;
138 Int_t local_gAli_npat=local_gAli->
Npatterns();
139 Int_t btloop_cnt_N=0;
148 Int_t pat_one_bt_cnt_max,pat_two_bt_cnt_max=0;
153 Float_t distZ,IP_Pair_To_InBT,IP_Pair_To_InBT_SegSum;
154 Float_t IP_Pair_To_InBT_Seg2;
158 IP_Pair_To_InBT=
CalcIP(Segment, vtx);
171 Float_t pat_one_Z=pat_one->
Z();
172 pat_one_bt_cnt_max=pat_one->
GetN();
174 for (Int_t pat_one_cnt=0; pat_one_cnt<
npat; ++pat_one_cnt) {
178 pat_one_Z=pat_one->
Z();
179 pat_one_bt_cnt_max=pat_one->
GetN();
184 distZ=pat_one->
Z()-InBT->
Z();
185 if (TMath::Abs(distZ)>10)
continue;
198 cout <<
"I have added the first InBT " << InBT <<
" to GLOBAL_ShowerSegArray." << endl;
204 distZ=pat_one->
Z()-vtx->
Z();
207 if (distZ<0)
continue;
210 if (
gEDBDEBUGLEVEL>2) cout <<
"Searching patterns: pat_one_cnt=" << pat_one_cnt <<
" pat_one->Z() = " << pat_one->
Z() <<
" pat_one_bt_cnt_max= "<< pat_one_bt_cnt_max <<endl;
218 Float_t pat_two_Z=pat_two->
Z();
219 pat_two_bt_cnt_max=pat_two->
GetN();
221 for (Int_t pat_two_cnt=0; pat_two_cnt<
npat; ++pat_two_cnt) {
225 pat_two_Z=pat_two->
Z();
226 pat_two_bt_cnt_max=pat_two->
GetN();
230 if (TMath::Abs(pat_one_cnt-pat_two_cnt)>
CUT_PARAMETER[5])
continue;
233 if (pat_two->
Z()<pat_one->
Z())
continue;
236 if (
gEDBDEBUGLEVEL>2) cout <<
" Searching patterns: pat_two_cnt=" << pat_two_cnt <<
" pat_two->Z() = " << pat_two->
Z() <<
" pat_two_bt_cnt_max= "<< pat_two_bt_cnt_max <<endl;
239 for (Int_t pat_one_bt_cnt=0; pat_one_bt_cnt<pat_one_bt_cnt_max; ++pat_one_bt_cnt) {
245 for (Int_t pat_two_bt_cnt=0; pat_two_bt_cnt<pat_two_bt_cnt_max; ++pat_two_bt_cnt) {
249 if (Segment2==Segment)
continue;
250 if (Segment2->
ID()==Segment->
ID()&&Segment2->
PID()==Segment->
PID())
continue;
261 IP_Pair_To_InBT_Seg2 =
CalcIP(Segment2, vtx);
272 if (Segment->
MCEvt()>0&&Segment2->
MCEvt()>0) {
273 if ((Segment2->
Flag()+Segment->
Flag())!=0)
continue;
295 cout <<
"EdbShowAlg_GS::FindPairs Pair (PID:" << Segment->
PID() <<
",ID:" << Segment->
ID()<<
";"<< Segment2->
PID() <<
"," << Segment2->
ID() <<
") has passed all cuts w.r.t to InBT:" << endl;
296 cout <<
"EdbShowAlg_GS::FindPairs GetdeltaRWithPropagation(Segment,Segment2) = " <<
GetdeltaRWithPropagation(Segment,Segment2) << endl;
297 cout <<
"EdbShowAlg_GS::FindPairs GetdeltaThetaSingleAngles(Segment,Segment2) = " <<
GetdeltaThetaSingleAngles(Segment,Segment2) << endl;
298 cout <<
"EdbShowAlg_GS::FindPairs GetMinimumDist(Segment,Segment2) = " <<
GetMinimumDist(Segment,Segment2) << endl;
299 cout <<
"EdbShowAlg_GS::FindPairs CalcIP(BetterSegment,InBT) = " << IP_Pair_To_InBT << endl;
309 if (isContained==kTRUE)
continue;
322 CalcTrackDensity(pat_interim,local_gAli_pat_interim_halfsize,npat_int,npat_total,npatN);
348 cout <<
"ONLY FOR THE ANN TRAINING FOR GS ALGO: " << endl;
349 cout <<
"DO THIS ONLY IF YOU HAVE PAIRS !!!: " << endl;
350 cout <<
"YES WE HAVE A PAIR Print all segs in the array: " << endl;
357 cout <<
"Print again the InBT for crosscheck: InBT= " << endl;
359 cout <<
"Address of Segment = " << Segment << endl;
360 cout <<
"Address of Segment2 = " << Segment2 << endl;
372 IP_Pair_To_InBT_Seg2=
CalcIP(Segment2,vtx);
373 IP_Pair_To_InBT=
CalcIP(Segment,vtx);
377 TObjArray *segments =
new TObjArray(2);
379 segments->Add(Segment);
380 segments->Add(Segment2);
383 cout <<
"Calculated helper _vetex_ out of the first two segments. " << endl;
384 cout <<
"vetex ->X,Y,Z: " << vetex ->
X() <<
" " << vetex ->
Y() <<
" " << vetex ->
Z()<< endl;
385 if (vetex ->
Z()> TMath::Min(Segment->
Z(),Segment2->
Z()) ) cout <<
"The interims vertex to which the two segments points lies downstream, or in between the to segmnets, i.e. the do NOT point to an originating vertex. continue now...." << endl;
386 cout <<
"Check: TMath::Min(Segment->Z(),Segment2->Z()) " << TMath::Min(Segment->
Z(),Segment2->
Z()) << endl;
387 cout <<
"Segment->Z(): " << Segment->
Z() <<
" Segment2->Z() " << Segment2->
Z() << endl;
388 cout <<
"Address of Segment = " << Segment << endl;
389 cout <<
"Address of Segment2 = " << Segment2 << endl;
390 if (vetex ->
Z()> TMath::Min(Segment->
Z(),Segment2->
Z()) ) {
391 cout <<
" Hmm, do nothing..." << endl;
395 Float_t IP_Seg1ToVtxSeg1Seg2=0;
396 Float_t IP_Seg2ToVtxSeg1Seg2=0;
397 IP_Seg1ToVtxSeg1Seg2 =
CalcIP(Segment,vetex);
398 IP_Seg2ToVtxSeg1Seg2 =
CalcIP(Segment2,vetex);
401 cout <<
"WARNING eRecoMode konstant set to =2 TODO .... change on prompt!!" << endl;
402 Float_t eValueGSNN_var00;
403 Float_t IP_InBT_To_Vtx=IP_Pair_To_InBT;
404 if (eRecoMode==0) eValueGSNN_var00=IP_InBT_To_Vtx;
405 if (eRecoMode==1) eValueGSNN_var00=IP_InBT_To_Vtx;
407 eValueGSNN_var00=TMath::Min(IP_Seg1ToVtxSeg1Seg2,IP_Seg2ToVtxSeg1Seg2);
421 if (Segment2->
Flag()+Segment->
Flag()==0&&TMath::Abs(Segment2->
Flag())==11&&Segment->
MCEvt()>0) {
424 else if (Segment2->
Flag()+Segment->
Flag()!=0&&TMath::Abs(Segment2->
Flag())==11&&Segment->
MCEvt()>0) {
440 cout <<
"I have filled the GSNN Tree now. End of this bracket." << endl;
466 Double_t eff, purall, pure;
514 IsFirstLoopCount=kFALSE;
525 Log(2,
"ShowRec.cpp",
"--- void ReconstructShowers_GS() done.");
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
Int_t npat
Definition: Xi2HatStartScript.C:33
Double_t GetdeltaThetaSingleAngles(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.cpp:7258
Double_t GetdeltaRWithPropagation(EdbSegP *s, EdbSegP *stest)
Definition: ShowRec.cpp:7211
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
Bool_t IsSameSegment(EdbSegP *seg1, EdbSegP *seg2)
Definition: ShowRec.cpp:8857
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 TransferShowerObjectArrayIntoEntryOfTreebranchShowerTree(TTree *treebranchtree, TObjArray *segarray)
Definition: ShowRec.cpp:7940
Double_t CalcIP(EdbSegP *s, EdbVertex *v)
Definition: ShowRec.cpp:8872
EdbPVRec * TransformEdbPVRec(EdbPVRec *gAli, EdbSegP *InitiatorBT)
DEBUG OPENMP TEST!!!!!!!
Definition: ShowRec.cpp:6299
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
void PrintShowerObjectArray(TObjArray *segarray)
Definition: ShowRec.cpp:6967
EdbVertex * CalcVertex(TObjArray *segments)
Definition: ShowRec.cpp:9043
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
TH1F * h_GSNN_var04
Definition: ShowRec.h:415
Float_t GLOBAL_VtxArrayY[99999]
Definition: ShowRec.h:56
Int_t GLOBAL_INBTSHOWERNR
Definition: ShowRec.h:80
TH1F * h_GSNN_var03
Definition: ShowRec.h:414
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
Float_t value_GSNN_var01
Definition: ShowRec.h:419
TObjArray * GLOBAL_ShowerSegArray
Definition: ShowRec.h:76
Float_t GLOBAL_VtxArrayX[99999]
Definition: ShowRec.h:55
Float_t value_GSNN_var02
Definition: ShowRec.h:420
Float_t value_GSNN_varInput
Definition: ShowRec.h:425
Int_t GLOBAL_InBT_MC
Definition: ShowRec.h:43
Double_t GLOBAL_EvtBT_EArray[99999]
Definition: ShowRec.h:52
TH1F * h_GSNN_var05
Definition: ShowRec.h:416
TH1F * h_GSNN_var02
Definition: ShowRec.h:413
Float_t value_GSNN_var06
Definition: ShowRec.h:424
Int_t GLOBAL_EvtBT_MCArray[99999]
Definition: ShowRec.h:51
TTree * TREE_ShowRecEff
Definition: ShowRec.h:62
Float_t GLOBAL_VtxArrayZ[99999]
Definition: ShowRec.h:57
Float_t shower_trackdensb
Definition: ShowRec.h:395
TH1F * h_GSNN_var06
Definition: ShowRec.h:417
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
Float_t value_GSNN_var03
Definition: ShowRec.h:421
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
Float_t value_GSNN_var00
Definition: ShowRec.h:418
TH1F * h_GSNN_var01
Definition: ShowRec.h:412
TH1F * h_GSNN_var00
Definition: ShowRec.h:411
Float_t value_GSNN_var05
Definition: ShowRec.h:423
TTree * t_GSNN
Definition: ShowRec.h:426
Double_t GLOBAL_EvtBT_TanThetaArray[99999]
Definition: ShowRec.h:52
Bool_t GLOBAL_IsBrickTreePGunInfo
Definition: ShowRec.h:82
Double_t GLOBAL_EvtBT_TanTheta
Definition: ShowRec.h:50
Float_t value_GSNN_var04
Definition: ShowRec.h:422
TTree * TREE_ShowShower
Definition: ShowRec.h:68
Int_t GLOBAL_EvtBT_Flag
Definition: ShowRec.h:49
Int_t cmd_GBMC
Definition: ShowRec.h:28
TObjArray * GLOBAL_InBTArray
Definition: ShowRec.h:74
Definition: EdbPVRec.h:148
Definition: EdbPattern.h:280
EdbPattern * GetPatternZLowestHighest(Bool_t lowestZ=kTRUE) const
Definition: EdbPattern.cxx:1982
Int_t Npatterns() const
Definition: EdbPattern.h:380
EdbPattern * NextPattern(float z, int dir) const
Definition: EdbPattern.cxx:2086
EdbPattern * GetPattern(int id) const
Definition: EdbPattern.cxx:1887
Float_t TX() const
Definition: EdbSegP.h:172
Int_t ID() const
Definition: EdbSegP.h:144
Float_t X() const
Definition: EdbSegP.h:170
Float_t Z() const
Definition: EdbSegP.h:150
Float_t P() const
Definition: EdbSegP.h:149
Float_t Y() const
Definition: EdbSegP.h:171
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
void SetMC(int mEvt=0)
Definition: EdbVertex.h:159
Float_t X() const
Definition: EdbVertex.h:130
void SetXYZ(float x, float y, float z)
Definition: EdbVertex.h:157
Float_t Z() const
Definition: EdbVertex.h:132
Float_t Y() const
Definition: EdbVertex.h:131
gEDBDEBUGLEVEL
Definition: energy.C:7
EdbSegP * s
Definition: tlg2pattern.C:32