FEDRA emulsion software from the OPERA Collaboration
ShowRec_Alg_GS.cpp File Reference
This graph shows which files directly or indirectly include this file:

Functions

void ReconstructShowers_GS ()
 

Function Documentation

◆ ReconstructShowers_GS()

void ReconstructShowers_GS ( )

============================================================================================

======================== CODE FROM EdbShowAlg_GS FROM libShowRec =========================

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;

if (IsPossibleFakeDoublet(Segment,Segment2) ) continue;

============================================================================================

============================================================================================


ONLY FOR THE ANN TRAINING FOR GS ALGO: DO THIS ONLY IF YOU HAVE PAIRS !!!


3 {
4  Log(2, "ShowRec.cpp", "--- void ReconstructShowers_GS() ---");
5  //-----------------------------------------------------------------
6  // Main function for reconstruction of "Gamma Search" Algorithm
7  //-----------------------------------------------------------------
8 
9  //-----------------------------------
10  // For each InitiatorBT this is
11  // divided in several small parts:
12  //
13  // 1) Make local_gAli with cut parameters, Make GetPID of InBT and corresponding of plates
14  // 3) Loop over (whole) local_gAli, search and check BT pairs for suts
15  // 4) Calculate pur/eff/NBT numbers
16  // 5) Fill Trees
17  //-----------------------------------
18 
19  // Define Helper Variables:
20  EdbPVRec* local_gAli;
21  EdbSegP* InBT;
22  EdbSegP* seg;
23  Float_t local_gAli_pat_interim_halfsize=0;
24 
27 
28  Bool_t IsFirstLoopCount=kTRUE;
29  Int_t LastGlobalMCEventNr=1;
30 
31  EdbVertex* vtx=new EdbVertex();
32 
33  //-----------------------------------------------------------------
34  // Since GLOBAL_InBTArray is filled in ascending ordering by zpositon
35  // We use the descending loop to begin with BT with lowest z first.
36  for (Int_t i=GLOBAL_InBTArrayEntries-1; i>=0; --i) {
37 
38  //-----------------------------------
39  // CounterOutPut
40  if (gEDBDEBUGLEVEL==2) if ((i%1)==0) cout << GLOBAL_InBTArrayEntries <<" InBT in total, still to do:"<<Form("%4d",i)<< "\r\r\r\r"<<flush;
41  //-----------------------------------
42 
43  //-----------------------------------
44  // Get InitiatorBT from GLOBAL_InBTArray
45  InBT=(EdbSegP*)GLOBAL_InBTArray->At(i);
46  //--------
47  GLOBAL_InBT_E=InBT->P();
48  GLOBAL_InBT_TanTheta=TMath::Sqrt(InBT->TX()*InBT->TX()+InBT->TY()*InBT->TY());
49  GLOBAL_InBT_Flag=InBT->Flag();
50  GLOBAL_InBT_MC=InBT->MCEvt();
51  //--------
52  Int_t local_NBT=0;
53  Int_t local_NBTMC=0;
54  Int_t local_NBTallMC=0;
55  Int_t local_NBTeMC=0;
56  float_t local_pure=-1;
57  float_t local_purall=-1;
58  Int_t npat_int=0;
59  Int_t npat_total=0;
60  Int_t npatN=0;
61  Int_t npat_Neff=0;
62  Int_t NBT_Neff=0;
63  Int_t NBTMC_Neff=0;
64  Int_t NBTMCe_Neff=0;
65  //--------
66 
67  if (gEDBDEBUGLEVEL>2) {
68  cout << endl << endl << "--- Starting Shower for Number " << i << " now: "<<endl;
69  InBT->PrintNice();
70  }
71  //-----------------------------------
72 
73 
74 
75  //-----------------------------------
76  // 0) Set vtx according to MC event,
77  // or to a half plate backward propagated segment.
78  // Do this only if the value -GBMC is NOT set,
79  // (in the case -GBMC is set, we should know the vertex anyway).
80  //-----------------------------------
81  //
82  if (GLOBAL_InBT_MC>LastGlobalMCEventNr) LastGlobalMCEventNr=GLOBAL_InBT_MC;
83  //
84  //
85  if (GLOBAL_InBT_MC<0&& cmd_GBMC<0) {
86  // This is an "equalization" effect. If we dont put this in, we will have BG base
87  // tracks always extrapolated to themselves, but SIM basetracks extrapolated to
88  // the vertex. This leads to a wrong deltaZ distribution which spoils the
89  // ANN Training.
90  if( IsFirstLoopCount==kTRUE) cout << "Option: GLOBAL_InBT_MC<0&& cmd_GBMC<0"<<endl;
91  vtx->SetXYZ(GLOBAL_VtxArrayX[LastGlobalMCEventNr],GLOBAL_VtxArrayY[LastGlobalMCEventNr],GLOBAL_VtxArrayZ[LastGlobalMCEventNr]);
92  }
93  //
94  else if (GLOBAL_InBT_MC<0 && cmd_GBMC==0) {
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);
97  }
98  else if (GLOBAL_InBT_MC<0 && cmd_GBMC>0) {
99  if( IsFirstLoopCount==kTRUE) cout << "Option: GLOBAL_InBT_MC<0 && cmd_GBMC>0"<<endl;
101  }
102  else if (GLOBAL_InBT_MC>0 && GLOBAL_IsBrickTreePGunInfo==kFALSE) {
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);
105  }
106  else {
107  if( IsFirstLoopCount==kTRUE) cout << "Option: else"<<endl;
109  }
110  vtx->SetMC(GLOBAL_InBT_MC);
111 
112  if (gEDBDEBUGLEVEL>2) {
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;
115  }
116  //-----------------------------------
117 
118 
119 
120  //-----------------------------------
121  // 1) Make local_gAli with cut parameters:
122  //-----------------------------------
123  local_gAli = TransformEdbPVRec(GLOBAL_gAli, InBT);
124 
125  // IN THIS ALGORITHM WE DO NOT YET AUTOMATICALLY ADD THE FIRST BT
126  // SINCE WE NEED AN ADDIITONAL VERTEX CUT OF THIS FIRST BT TO CHECK!
127  // // Add InBT to GLOBAL_ShowerSegArray
128  // GLOBAL_ShowerSegArray -> Add(InBT);
129  //-----------------------------------
130 
131 
132  //-----------------------------------
133  // 2) Loop over (whole) local_gAli, check InitiatorBT
134  // 2) compatible with a segment forming a e+e- pair:
135  // 2) (Loop over all plates of local_gAli, since this is already
136  // 2) extracted with the right numbers of plates...)
137  //-----------------------------------
138  Int_t local_gAli_npat=local_gAli->Npatterns();
139  Int_t btloop_cnt_N=0;
140 
144 
145 
146 
147  Int_t npat=local_gAli->Npatterns();
148  Int_t pat_one_bt_cnt_max,pat_two_bt_cnt_max=0;
149  EdbPattern* pat_one=0;
150  EdbPattern* pat_two=0;
151  EdbSegP* Segment=0;
152  EdbSegP* Segment2=0;
153  Float_t distZ,IP_Pair_To_InBT,IP_Pair_To_InBT_SegSum;
154  Float_t IP_Pair_To_InBT_Seg2;
155 
156 
157  Segment = InBT;
158  IP_Pair_To_InBT=CalcIP(Segment, vtx);
161 
162 
163 
164 
165 
166 
167 
168  // Loop over pattern for the first BT of the pairs:
169  // Start first with the pattern with the lowest Z position.
170  pat_one=local_gAli->GetPatternZLowestHighest(1);
171  Float_t pat_one_Z=pat_one->Z();
172  pat_one_bt_cnt_max=pat_one->GetN();
173 
174  for (Int_t pat_one_cnt=0; pat_one_cnt<npat; ++pat_one_cnt) {
175 
176  if (pat_one_cnt>0) {
177  pat_one=(EdbPattern*)local_gAli->NextPattern(pat_one_Z,1);
178  pat_one_Z=pat_one->Z();
179  pat_one_bt_cnt_max=pat_one->GetN();
180  }
181 
182  // Check if pattern Z() equals the InBZ->Z(), since we wanna have the
183  // pattern one the pattern to contain the InBT:
184  distZ=pat_one->Z()-InBT->Z();
185  if (TMath::Abs(distZ)>10) continue;
186  //cout << "distZ (pat_one->Z()-InBT->Z())= " << distZ << endl;
187 
188  // Check if InBT fulfills criteria for IP to vertex:
189  if (IP_Pair_To_InBT>CUT_PARAMETER[0]) continue;
190  // Check if InBT fulfills criteria for z-diff to vertex:
191  if ((InBT->Z()-vtx->Z())>CUT_PARAMETER[3]) continue;
192 
193  // Now here we can add InBT since it passed also the vertex cut.
194  // Therefore, the Reconstructed Shower has always InBT as first BT stored.
195  if (GLOBAL_ShowerSegArray->GetEntries()==0) {
196  GLOBAL_ShowerSegArray->Add(InBT);
197  if (gEDBDEBUGLEVEL>2) {
198  cout << "I have added the first InBT " << InBT << " to GLOBAL_ShowerSegArray." << endl;
199  InBT->PrintNice();
200  }
201  }
202 
203  // Check if pattern dist Z to Vtx is ok:
204  distZ=pat_one->Z()-vtx->Z();
205  // Z distance has to be greater zero, cause the InBT
206  // and other pair BTs shall come downstream the vertex:
207  if (distZ<0) continue;
208  //cout << "distZ (pat_one->Z()-vtx->Z();) = " << distZ << endl;
209 
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;
211 
212 
213  // Loop over pattern for the second BT of the pairs:
214  //
215  //cout << "// Loop over pattern for the second BT of the pairs: "<< endl;
216 
217  pat_two=local_gAli->GetPatternZLowestHighest(1);
218  Float_t pat_two_Z=pat_two->Z();
219  pat_two_bt_cnt_max=pat_two->GetN();
220 
221  for (Int_t pat_two_cnt=0; pat_two_cnt<npat; ++pat_two_cnt) {
222 
223  if (pat_two_cnt>0) {
224  pat_two=(EdbPattern*)local_gAli->NextPattern(pat_two_Z,1);
225  pat_two_Z=pat_two->Z();
226  pat_two_bt_cnt_max=pat_two->GetN();
227  }
228 
229  // PID diff of two plates may be maximum [0..PidDIFFN]
230  if (TMath::Abs(pat_one_cnt-pat_two_cnt)>CUT_PARAMETER[5]) continue;
231 
232  // pattern two should come downstream pattern one:
233  if (pat_two->Z()<pat_one->Z()) continue;
234 
235 
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;
237 
238 
239  for (Int_t pat_one_bt_cnt=0; pat_one_bt_cnt<pat_one_bt_cnt_max; ++pat_one_bt_cnt) {
244 
245  for (Int_t pat_two_bt_cnt=0; pat_two_bt_cnt<pat_two_bt_cnt_max; ++pat_two_bt_cnt) {
246  Segment2 = (EdbSegP*)pat_two->GetSegment(pat_two_bt_cnt);
247 
248  // Ceck if segments are not (by chance) the same:
249  if (Segment2==Segment) continue;
250  if (Segment2->ID()==Segment->ID()&&Segment2->PID()==Segment->PID()) continue;
251  if (IsSameSegment(Segment2,Segment)) continue;
252 
253 
254 
257 
258  // Now apply cut conditions: GS GAMMA SEARCH Alg --------------------
259 
260  // Check if IP of both to vtx (BT) is ok:
261  IP_Pair_To_InBT_Seg2 =CalcIP(Segment2, vtx);
262  if (IP_Pair_To_InBT_Seg2>CUT_PARAMETER[0]) continue;
263 
264  // if InBT is flagged as MC InBT, take care that only BG or same MC basetracks are taken:
265  if (InBT->MCEvt()>0) if (Segment->MCEvt()>0&&Segment2->MCEvt()>0) if (Segment->MCEvt()!=Segment2->MCEvt()) continue;
266  if (InBT->MCEvt()>0) if (Segment->MCEvt()>0&&Segment2->MCEvt()>0) if (Segment->MCEvt()!=InBT->MCEvt()) continue;
267  if (InBT->MCEvt()>0) if (Segment->MCEvt()>0&&Segment2->MCEvt()>0) if (Segment2->MCEvt()!=InBT->MCEvt()) continue;
268 
269  // In case of two MC events, check for e+ e- pairs
270  // Do this ONLY IF parameter eParaValue[6] is set to choose different Flag() pairs:
271  if (InBT->MCEvt()>0 && CUT_PARAMETER[6]==1) {
272  if (Segment->MCEvt()>0&&Segment2->MCEvt()>0) {
273  if ((Segment2->Flag()+Segment->Flag())!=0) continue;
274  }
275  }
276 
277  // a) Check dR between tracks:
278  if (GetdeltaRWithPropagation(Segment,Segment2)>CUT_PARAMETER[2]) continue;
279  // b) Check dT between tracks:
280  if (GetdeltaThetaSingleAngles(Segment,Segment2)>CUT_PARAMETER[4]) continue;
281  // c) Check dMinDist between tracks:
282  if (GetMinimumDist(Segment,Segment2)>CUT_PARAMETER[1]) continue;
283 
284  // f) Check if this is not a possible fake doublet which is
285  // sometimes caused by view overlap in the scanning:
286  // in the EdbPVRQuality class this will be done at start for the whole
287  // PVR object so this will be later on obsolete.
289  //
290  // end of cut conditions: GS GAMMA SEARCH Alg --------------------
291  //
292 
293 
294  if (gEDBDEBUGLEVEL>3) {
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;
300  }
301 
302  if (gEDBDEBUGLEVEL>3) cout <<"------------"<< endl;
303 
304  // And Add Segment2 to to shower array:
305 // cout << "// Add Segment2 to to shower array (AddBTToArrayWithCeck):" << endl;
306  Bool_t isContained = AddBTToArrayWithCeck(Segment2, GLOBAL_ShowerSegArray);
307  //PrintShowerObjectArray(GLOBAL_ShowerSegArray);
308 // cout << " isContained == " << isContained << endl;
309  if (isContained==kTRUE) continue;
310 
311  } //for (Int_t pat_two_bt_cnt=0; ...
312 
313  } //for (Int_t pat_one_bt_cnt=0; ...
314 
315  } // for (Int_t pat_two_cnt=0; ...
316 
317 
318  // Now here do the usual rest for BG density calculation:
319  //...
320  // Calc BT density around shower:
321  EdbPattern* pat_interim=local_gAli->GetPattern(pat_one_cnt);
322  CalcTrackDensity(pat_interim,local_gAli_pat_interim_halfsize,npat_int,npat_total,npatN);
323 
324  // Calc TrackNumbers for plate for efficency numbers:
325  CalcEfficencyNumbers(pat_interim, InBT->MCEvt(), NBT_Neff, NBTMC_Neff,NBTMCe_Neff);
326 
327  } //for (Int_t pat_one_cnt=0; ...
328 
329 
333 
334  if (gEDBDEBUGLEVEL>2) cout << " GLOBAL_ShowerSegArray->GetEntries() " << GLOBAL_ShowerSegArray->GetEntries() << endl;
335 
339 
340  if (GLOBAL_ShowerSegArray->GetEntries()>1) {
341 
342  Segment=(EdbSegP*)GLOBAL_ShowerSegArray->At(0);
343  Segment2=(EdbSegP*)GLOBAL_ShowerSegArray->At(1);
344 
345 
346 
347  if (gEDBDEBUGLEVEL>2) {
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;
351  for (int l=0; l<GLOBAL_ShowerSegArray->GetEntries(); ++l) {
353  s->PrintNice();
354  }
355 // Segment->PrintNice();
356 // Segment2->PrintNice();
357  cout << "Print again the InBT for crosscheck: InBT= " << endl;
358  InBT->PrintNice();
359  cout << "Address of Segment = " << Segment << endl;
360  cout << "Address of Segment2 = " << Segment2 << endl;
361  }
362 
363 
364 
365  // Implicitly, we assume that InBT= Seg->At(0), which I checked is
366  // correct. Also in the code it is done this way that InBT is added
367  // as first BT.
368  //Segment->PrintNice();
369  //Segment2->PrintNice();
370  //InBT->PrintNice();
371 
372  IP_Pair_To_InBT_Seg2=CalcIP(Segment2,vtx);
373  IP_Pair_To_InBT=CalcIP(Segment,vtx);
374 
375  // Check if both basetracks have a vertex which is upstream
376  // of both tracks (only then the two BT are really pointing).
377  TObjArray *segments = new TObjArray(2);
378  segments->Clear();
379  segments->Add(Segment);
380  segments->Add(Segment2);
381  EdbVertex* vetex = new EdbVertex();
382  vetex = CalcVertex(segments);
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;
392  }
393  else {
394 
395  Float_t IP_Seg1ToVtxSeg1Seg2=0;
396  Float_t IP_Seg2ToVtxSeg1Seg2=0;
397  IP_Seg1ToVtxSeg1Seg2 = CalcIP(Segment,vetex);
398  IP_Seg2ToVtxSeg1Seg2 = CalcIP(Segment2,vetex);
399 
400  Int_t eRecoMode=2;
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;
406  if (eRecoMode==2) {
407  eValueGSNN_var00=TMath::Min(IP_Seg1ToVtxSeg1Seg2,IP_Seg2ToVtxSeg1Seg2);
408  }
409 
410  h_GSNN_var00->Fill(eValueGSNN_var00);
411  h_GSNN_var01->Fill(GetMinimumDist(Segment,Segment2));
412  h_GSNN_var02->Fill(GetdeltaRWithPropagation(Segment,Segment2));
413  h_GSNN_var03->Fill(InBT->Z()-vtx->Z());
414  h_GSNN_var04->Fill(GetdeltaThetaSingleAngles(Segment,Segment2));
415  h_GSNN_var05->Fill(TMath::Abs(Segment->PID()-Segment2->PID()));
416  h_GSNN_var06->Fill(Segment2->Flag()+Segment->Flag());
417 
418  // Purity 1: Input = 1.0;
419  // Purity 0.5: Input = 0.5;
420  // Purity else: Input = 0.0;
421  if (Segment2->Flag()+Segment->Flag()==0&&TMath::Abs(Segment2->Flag())==11&&Segment->MCEvt()>0) {
423  }
424  else if (Segment2->Flag()+Segment->Flag()!=0&&TMath::Abs(Segment2->Flag())==11&&Segment->MCEvt()>0) {
426  }
427  else {
429  }
430  value_GSNN_var00=eValueGSNN_var00;
431  value_GSNN_var01=GetMinimumDist(Segment,Segment2);
432  value_GSNN_var02=GetdeltaRWithPropagation(Segment,Segment2);
433  value_GSNN_var03=InBT->Z()-vtx->Z();
435  value_GSNN_var05=TMath::Abs(Segment->PID()-Segment2->PID());
436  value_GSNN_var06=Segment2->Flag()+Segment->Flag();
437 
438  t_GSNN->Fill();
439 
440  cout << "I have filled the GSNN Tree now. End of this bracket." << endl;
441  }
442  }
444 
446 
447  Int_t s_NBT=0;
448  Int_t s_NBTMC=0;
449  Int_t s_NBTallMC=0;
450  Int_t s_NBTeMC=0;
451  Double_t s_eff=0;
452  Double_t s_purall=0;
453  Double_t s_pure=0;
454  CalcEffPurOfShower(GLOBAL_ShowerSegArray, s_NBT, s_NBTMC, s_NBTallMC, s_NBTeMC, s_purall, s_pure);
455 
456  //-----------------------------------
457  // 4) Calculate pur/eff/NBT numbers,
458  // not needed when only reconstruction
459  // done:
460  //-----------------------------------
461  if (cmd_OUTPUTLEVEL>=2 || cmd_OUTPUTLEVEL==0 ) {
462  Int_t NBT=0;
463  Int_t NBTMC=0;
464  Int_t NBTallMC=0;
465  Int_t NBTeMC=0;
466  Double_t eff, purall, pure;
467  CalcEffPurOfShower2(GLOBAL_ShowerSegArray, NBT, NBTMC, NBTallMC, NBTeMC, purall, pure, NBT_Neff, NBTMC_Neff,NBTMCe_Neff);
468 
469 
470  // Fill only for MC Event:
471  if (GLOBAL_InBT_MC>0) {
476  }
478  }
479 // cout << "// 4) Calculate pur/eff/NBT numbers...done." << endl;
480 
481 
482 // XXXDEBUG
483 
484  //-----------------------------------
485  // 5) Fill Tree:
486  //-----------------------------------
487  if (gEDBDEBUGLEVEL>2) cout << "// 5) Fill Tree:" << endl;
488  TREE_ShowRecEff->Fill();
489  if (gEDBDEBUGLEVEL>3) TREE_ShowRecEff->Show(TREE_ShowRecEff->GetEntries()-1);
490 
491 
492  //-----------------------------------
493  // 6a) Transfer ShowerArray to treebranchTreeEntry:
494  //-----------------------------------
495  if (cmd_OUTPUTLEVEL>0) {
496  //cout << "// 6a) Transfer ShowerArray to treebranchTreeEntry:" << endl;
498  }
499 
500 
501  //------------------------------------
502  // Reset and delete important things:
503  // also to avoid memory problems ...
504  //-----------------------------------
505  GLOBAL_ShowerSegArray->Clear();
506  if (gEDBDEBUGLEVEL>2) cout << "--- --- after clear: GLOBAL_ShowerSegArray->GetEntries(): "<< GLOBAL_ShowerSegArray->GetEntries() << endl;
507  delete local_gAli;
508  local_gAli=0;
510  //------------------------------------
511 
512 
513 
514  IsFirstLoopCount=kFALSE;
515  }
516  // end of loop over GLOBAL_InBTArrayEntries
517  //-----------------------------------------------------------------
518 
519  if (gEDBDEBUGLEVEL==2) cout << endl<<flush;
520  if (gEDBDEBUGLEVEL>3) cout << "---TREE_ShowRecEff->GetEntries() ... " << TREE_ShowRecEff->GetEntries() << endl;
521  if (gEDBDEBUGLEVEL>3) cout << "---GLOBAL_INBTSHOWERNR ... " << GLOBAL_INBTSHOWERNR<< endl;
522 
523 
524 
525  Log(2, "ShowRec.cpp", "--- void ReconstructShowers_GS() done.");
526  return;
527 }
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
Definition: EdbSegP.h:18
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
struct @8 Z
gEDBDEBUGLEVEL
Definition: energy.C:7
EdbSegP * s
Definition: tlg2pattern.C:32