==== Now loop over the Grouped plates and search for spectrum peaks in each groupedPlate...
Set the bin arrays for the Spectrum...
Fit each grouped Plate with Spectrum...
Fill interimSpectrum For Drawing... without the THRESHOLD_SMOOTHED_DEST Cut to find Maximum
Fill interimSpectrum For Drawing...only when Entry is > THRESHOLD_SMOOTHED_DEST * Maximum THRESHOLD_SMOOTHED_DEST is in % Units of Maxium...
4 Log(2,
"ShowRec.cpp",
"--- void ReconstructShowers_CL() ---");
24 Float_t ClusterBoxSizeX=BOXSIZE;
25 Float_t ClusterBoxSizeY=ClusterBoxSizeX;
26 Float_t ClusterBoxSize[]= {ClusterBoxSizeX,ClusterBoxSizeY};
36 cout <<
" ......."<<endl;
38 Float_t VIEWSIZE=1000;
39 Float_t gAliSub_Length_X=VIEWSIZE;
40 Float_t gAliSub_Length_Y=VIEWSIZE;
43 Int_t NbinsX=Int_t((RightX-LeftX)/ClusterBoxSizeX);
44 Int_t NbinsY=Int_t((RightY-LeftY)/ClusterBoxSizeY);
47 cout <<
" ......."<<endl;
53 Int_t NbinsX_gAliSub=Int_t((gAliSub_Length_X)/ClusterBoxSizeX);
54 Int_t NbinsY_gAliSub=Int_t((gAliSub_Length_Y)/ClusterBoxSizeY);
58 Double_t ** source =
new double *[NbinsX];
59 for (Int_t cnti=0; cnti<NbinsX; cnti++) {
61 source[cnti]=
new double[NbinsY];
64 Double_t ** dest =
new double *[NbinsX];
65 for (Int_t cnti=0; cnti<NbinsX; cnti++) {
67 dest[cnti]=
new double[NbinsY];
85 Bool_t FillTANData=kTRUE;
86 cout <<
" ......."<<endl;
89 Int_t PLATESPERGROUP=1;
93 Int_t NGroupedPLATES=ceil( (Double_t)NPLATES/(Double_t)PLATESPERGROUP);
101 Float_t StartPosX,StartPosY,StartPosTX,StartPosTY;
104 Float_t ZPosGroupedPlates[50];
110 for (Int_t i=0; i<NGroupedPLATES; i++) {
113 cout <<
"i PLATESPERGROUP NGroupedPLATES ZPosGroupedPlates[i] " << i <<
" " << PLATESPERGROUP <<
" " << NGroupedPLATES <<
" " << ZPosGroupedPlates[i] <<
" " << endl;
118 cout <<
"NbinsX = " << NbinsX << endl;
119 cout <<
"NbinsY = " << NbinsY << endl;
120 cout <<
"NbinsZ = " << NbinsZ << endl;
121 cout <<
"NbinsX_gAliSub = " << NbinsX_gAliSub << endl;
122 cout <<
"NbinsY_gAliSub = " << NbinsY_gAliSub << endl;
123 cout <<
"FIRSTPLATE= "<<FIRSTPLATE<<endl;
124 cout <<
"LASTPLATE= "<<LASTPLATE<<endl;
125 cout <<
"MAXPLATE= "<<
MAXPLATE<<endl;
126 cout <<
"NPLATES= "<<NPLATES<<endl;
127 cout <<
"NGroupedPLATES= "<<NGroupedPLATES<<endl;
128 cout <<
"PLATESPERGROUP= "<<PLATESPERGROUP<<endl;
153 Float_t local_gAli_pat_interim_halfsize=0;
176 if ((i%modulo)==0) cout << i <<
" : 5% more done"<<endl;
191 Int_t local_NBTallMC=0;
192 Int_t local_NBTeMC=0;
193 float_t local_pure=-1;
194 float_t local_purall=-1;
205 cout << endl << endl <<
"--- Starting Shower for Number " << i <<
" now: "<<endl;
223 StartPosTX=InBT->
TX();
224 StartPosTY=InBT->
TY();
231 cout <<
"Reset now some other histos"<<endl;
232 for (Int_t h=0; h<50; h++) {
238 cout <<
"Reset now some other SetNameTitle "<<endl;
242 Hist2DimOnlyBGAllPlates->SetBins( NbinsX_gAliSub, StartPosX-gAliSub_Length_X/2.0, StartPosX +gAliSub_Length_X/2.0, NbinsY_gAliSub, StartPosY-gAliSub_Length_Y/2.0, StartPosY +gAliSub_Length_Y/2.0);
243 Hist2DimOnlySimOneEventAllPlates->SetBins( NbinsX_gAliSub, StartPosX-gAliSub_Length_X/2.0, StartPosX +gAliSub_Length_X/2.0, NbinsY_gAliSub, StartPosY-gAliSub_Length_Y/2.0, StartPosY +gAliSub_Length_Y/2.0);
244 Hist2DimBGAndSimOneEventAllPlates->SetBins( NbinsX_gAliSub, StartPosX-gAliSub_Length_X/2.0, StartPosX +gAliSub_Length_X/2.0, NbinsY_gAliSub, StartPosY-gAliSub_Length_Y/2.0, StartPosY +gAliSub_Length_Y/2.0);
246 cout <<
"Reset now some other SetNameTitle "<<endl;
248 Hist3DimOnlyBG->SetBins( NbinsX_gAliSub, StartPosX -gAliSub_Length_X/2.0, StartPosX +gAliSub_Length_X/2.0, NbinsY_gAliSub, StartPosY -gAliSub_Length_Y/2.0, StartPosY +gAliSub_Length_Y/2.0, NGroupedPLATES, (FIRSTPLATE-1)*1300, NbinsZ*1300);
250 Hist3DimRecoEvent_gAli->SetBins( NbinsX, LeftX, RightX, NbinsY, LeftY, RightY, NGroupedPLATES, (FIRSTPLATE-1)*1300, (LASTPLATE)*1300);
252 cout <<
"Reset now some other SetNameTitle "<<endl;
263 Float_t InBT_X=InBT->
X();
264 Float_t InBT_TX=InBT->
TX();
265 Float_t InBT_X_Extrapolated;
266 Float_t InBT_Y=InBT->
Y();
267 Float_t InBT_TY=InBT->
TY();
268 Float_t InBT_Y_Extrapolated;
269 Float_t InBT_Z=InBT->
Z();
270 for (Int_t h=0; h<NGroupedPLATES; h++) {
272 Float_t zdiff=ZPosGroupedPlates[h]-InBT_Z;
273 InBT_X_Extrapolated=InBT_X+InBT_TX*zdiff;
274 InBT_Y_Extrapolated=InBT_Y+InBT_TY*zdiff;
275 cout <<
"h InBT_X InBT_TX InBT_Z ZPosGroupedPlates[h] zdiff InBT_X_Extrapolated " << h <<
" " << InBT_X <<
" " << InBT_TX <<
" " << InBT_Z <<
" " << ZPosGroupedPlates[h] <<
" " << zdiff <<
" " <<InBT_X_Extrapolated << endl;
276 cout <<
"h InBT_Y InBT_TY InBT_Z ZPosGroupedPlates[h] zdiff InBT_Y_Extrapolated " << h <<
" " << InBT_Y <<
" " << InBT_TY <<
" " << InBT_Z <<
" " << ZPosGroupedPlates[h] <<
" " << zdiff <<
" " <<InBT_Y_Extrapolated << endl;
277 Hist2DimOnlyBGOneGroupedPlate[h]->SetBins(NbinsX_gAliSub, InBT_X_Extrapolated-gAliSub_Length_X/2.0,InBT_X_Extrapolated+gAliSub_Length_X/2.0, NbinsY_gAliSub,InBT_Y_Extrapolated-gAliSub_Length_Y/2.0,InBT_Y_Extrapolated+gAliSub_Length_Y/2.0);
278 Hist2DimOnlySimOneEventOneGroupedPlate[h]->SetBins(NbinsX_gAliSub, InBT_X_Extrapolated-gAliSub_Length_X/2.0,InBT_X_Extrapolated+gAliSub_Length_X/2.0, NbinsY_gAliSub,InBT_Y_Extrapolated-gAliSub_Length_Y/2.0,InBT_Y_Extrapolated+gAliSub_Length_Y/2.0);
279 Hist2DimBGAndSimOneEventOneGroupedPlate[h]->SetBins(NbinsX_gAliSub, InBT_X_Extrapolated-gAliSub_Length_X/2.0,InBT_X_Extrapolated+gAliSub_Length_X/2.0, NbinsY_gAliSub,InBT_Y_Extrapolated-gAliSub_Length_Y/2.0,InBT_Y_Extrapolated+gAliSub_Length_Y/2.0);
289 Int_t local_gAli_npat=local_gAli->
Npatterns();
290 if (
gEDBDEBUGLEVEL>2) cout <<
"--- local_gAli_npat= " << local_gAli_npat << endl;
294 for (Int_t patterloop_cnt=local_gAli_npat-1; patterloop_cnt>=0; --patterloop_cnt) {
295 if (
gEDBDEBUGLEVEL>3) cout <<
"--- --- Doing patterloop_cnt= " << patterloop_cnt << endl;
300 cout <<
"===DEBUG patterloop_cnt= " << patterloop_cnt <<
" Z pos (k) " << local_gAli->
GetPattern(patterloop_cnt)->
Z() << endl;
301 cout <<
"===DEBUG (patterloop_cnt) EdbSegments in the Pattern (total): " << as->GetEntries() << endl;
303 for (Int_t h=0; h<as->GetEntries(); h++) {
307 cout <<
"entry, val "<<h <<
" " << val<<endl;
312 cout <<
"(TAN) entry, val_tan "<<h <<
" " << val_tan<<endl;
313 if (val_tan>=NGroupedPLATES) {
316 cout <<
"(TAN) val_tan changed to "<<h <<
" " << val_tan<<endl;
321 if (sa->
MCEvt()<0)
continue;
323 cout <<
"=== ==DEBUG Filling i with MCEvt "<< i <<
"("<<
GLOBAL_InBT_MC <<
") X,Y,Z: "<<sa->
X()<<
" "<<sa->
Y()<<
" "<<sa->
Z()<<
" "<<sa->
MCEvt()<<
" to val= " <<val <<endl;
334 cout <<
"Loop over the Grouped plates and search for spectrum peaks in each groupedPlate."<<endl;
337 for (Int_t h=0; h<NGroupedPLATES; h++) {
340 for (Int_t cnti = 0; cnti < NbinsX_gAliSub; cnti++) {
341 for (Int_t cntj = 0; cntj < NbinsY_gAliSub; cntj++) {
342 source[cnti][cntj] = 0;
343 dest[cnti][cntj] = 0;
350 cout <<
" Do now peak search..."<<endl;
351 nfound =
spectrum2dim->SearchHighRes(source, dest, NbinsX_gAliSub, NbinsY_gAliSub, 2, 20, kTRUE, 10, kFALSE, 5);
352 cout <<
" Peak search finished. Go on."<<endl;
361 Double_t xax_bin_value;
362 Double_t yax_bin_value;
363 Double_t zax_bin_value;
367 for (Int_t ii = 0; ii < NbinsX_gAliSub; ii++) {
368 for (Int_t jj = 0; jj < NbinsY_gAliSub; jj++) {
373 Float_t THRESHOLD_SMOOTHED_DEST=0.5;
374 cout <<
"THRESHOLD_SMOOTHED_DEST spectrum_interim->GetMaximum() : " << THRESHOLD_SMOOTHED_DEST <<
" " <<
spectrum_interim->GetMaximum()<< endl;
375 cout <<
"----------_"<<endl;
381 for (Int_t ii = 0; ii < NbinsX_gAliSub; ii++) {
382 for (Int_t jj = 0; jj < NbinsY_gAliSub; jj++) {
384 if (dest[ii][jj]<THRESHOLD_SMOOTHED_DEST*spec_int_maximum)
continue;
389 zax_bin_value=ZPosGroupedPlates[h];
394 cout <<
"THRESHOLD_SMOOTHED_DEST spectrum_interim->GetMaximum() : " << THRESHOLD_SMOOTHED_DEST <<
" " <<
spectrum_interim->GetMaximum()<< endl;
395 cout <<
"----------_"<<endl;
413 if (
gEDBDEBUGLEVEL>2) cout <<
"--- local_gAli_npat= " << local_gAli_npat << endl;
417 for (Int_t patterloop_cnt=local_gAli_npat-1; patterloop_cnt>=0; --patterloop_cnt) {
418 if (
gEDBDEBUGLEVEL>3) cout <<
"--- --- Doing patterloop_cnt= " << patterloop_cnt << endl;
420 for (Int_t btloop_cnt=0; btloop_cnt<local_gAli->
GetPattern(patterloop_cnt)->
GetN(); ++btloop_cnt) {
432 if (seg->
X()==InBT->
X()&&seg->
Y()==InBT->
Y()) {
441 CalcTrackDensity(pat_interim,local_gAli_pat_interim_halfsize,npat_int,npat_total,npatN);
459 Double_t eff, purall, pure;
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
void Reco_CL_BuildGlobalHistogramsOnHeap()
Definition: ShowRec_Alg_CL.cpp:527
Int_t Reco_CL_AssignZValueToGroup(Double_t z, Double_t z0, Int_t NGroupedPLATES, Int_t PLATESPerGroup)
Definition: ShowRec_Alg_CL.cpp:515
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
EdbPVRec * TransformEdbPVRec(EdbPVRec *gAli, EdbSegP *InitiatorBT)
DEBUG OPENMP TEST!!!!!!!
Definition: ShowRec.cpp:6299
Bool_t GetConeOrTubeDistanceToInBT(EdbSegP *sa, EdbSegP *InBT, Double_t CylinderRadius, Double_t ConeAngle)
Definition: ShowRec.cpp:6990
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
Bool_t FindPrecedingBTs(EdbSegP *s, EdbSegP *InBT, EdbPVRec *gAli, TObjArray *showersegarray)
Definition: ShowRec.cpp:6764
void CalcEfficencyNumbers(EdbPattern *pat_interim, Int_t MCCheck, Int_t &NBT_Neff, Int_t &NBTMC_Neff, Int_t &NBTMCe_Neff)
Definition: ShowRec.cpp:8771
TH2F * spectrum_interim
Definition: ShowRec.h:358
Int_t GLOBAL_INBTSHOWERNR
Definition: ShowRec.h:80
Double_t GLOBAL_trckdens
Definition: ShowRec.h:39
EdbPVRec * GLOBAL_gAli
Definition: ShowRec.h:73
TH3F * Hist3DimRecoEvent_gAli
Definition: ShowRec.h:354
Int_t cmd_OUTPUTLEVEL
Definition: ShowRec.h:33
TH3F * Hist3DimOnlyBG
Definition: ShowRec.h:353
TH2F * Hist2DimBGAndSimOneEventAllPlates
Definition: ShowRec.h:349
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
TH2F * Hist2DimOnlyBGAllPlates
Definition: ShowRec.h:347
Double_t GLOBAL_EvtBT_EArray[99999]
Definition: ShowRec.h:52
TH2F * Hist2DimOnlySimOneEventAllPlates
Definition: ShowRec.h:348
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 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
TSpectrum2 * spectrum2dim
Definition: ShowRec.h:357
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 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
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
TClonesArray * GetSegments() const
Definition: EdbPattern.h:69
gEDBDEBUGLEVEL
Definition: energy.C:7
int MAXPLATE
Definition: shower_btr.C:19