4 Log(2,
"ShowRec.cpp",
"--- void ReconstructShowers_TC() ---");
27 Float_t local_gAli_pat_interim_halfsize=0;
35 cout <<
"--- --- --- Printing GLOBAL_InBTArray MaximumZ Position " << gAliZMax <<
" --- --- ---"<<endl;
43 TFile * fil =
new TFile(
"linked_tracks.root");
44 TTree*
tr= (TTree*)fil->Get(
"tracks");
45 TClonesArray *segClonesArray=
new TClonesArray(
"EdbSegP",60);
46 int nentr = int(
tr->GetEntries());
48 cout <<
"Of linked_tracks we have " << nentr <<
" entries Total"<<endl;
49 tr->SetBranchAddress(
"t.", &
t );
50 tr->SetBranchAddress(
"s", &segClonesArray );
51 tr->SetBranchAddress(
"nseg", &nseg );
52 tr->SetBranchAddress(
"n0", &n0 );
53 tr->SetBranchAddress(
"npl", &npl );
56 cout <<
"Try Creating Arrays"<< endl;
57 TObjArray* LOCAL_TrackBTArray=
new TObjArray(nentr);
58 TObjArray* LOCAL_NewAddedBTArray=
new TObjArray(nentr);
59 cout <<
"Creating Arrays done."<< endl;
61 for (
int i=0; i<nentr; i++ ) {
65 if (
gEDBDEBUGLEVEL>3) cout << i <<
" t.eX Y Z " <<
t->X() <<
" "<<
t->Y() <<
" "<<
t->Z() << endl;
74 if (
s2->
Z()>gAliZMax) {
75 cout <<
" TrackEND is outside of gALi Volume! Dont take track." << endl;
86 for (
int hh=0; hh<takeN; hh++) {
96 LOCAL_TrackBTArray->Add(segment);
104 if (
gEDBDEBUGLEVEL>1) cout <<
"--- Filled " << LOCAL_TrackBTArray->GetEntries() <<
" Segments into LOCAL_TrackBTArray."<<endl;
129 Int_t local_NBTallMC=0;
130 Int_t local_NBTeMC=0;
131 float_t local_pure=-1;
132 float_t local_purall=-1;
143 cout << endl << endl <<
"--- Starting Shower for Number " << i <<
" now: "<<endl;
145 cout <<
" InBT->MCEvt() "<< InBT->
MCEvt() <<
" InBT->P() " << InBT->
P() << endl;
163 Int_t local_gAli_npat=local_gAli->
Npatterns();
164 if (
gEDBDEBUGLEVEL>2) cout <<
"--- local_gAli_npat= " << local_gAli_npat << endl;
168 for (Int_t patterloop_cnt=local_gAli_npat-1; patterloop_cnt>=0; --patterloop_cnt) {
169 if (
gEDBDEBUGLEVEL>3) cout <<
"--- --- Doing patterloop_cnt= " << patterloop_cnt << endl;
171 for (Int_t btloop_cnt=0; btloop_cnt<local_gAli->
GetPattern(patterloop_cnt)->GetN(); ++btloop_cnt) {
193 Float_t NBT_before=0;
195 Float_t NBTMC_before=0;
196 Float_t NBTMC_after=0;
197 Float_t pur_before=0;
205 if (interim->
MCEvt()>0) NBTMC_before++;
207 pur_before=(Float_t)NBTMC_before/(Float_t)NBT_before;
224 LOCAL_NewAddedBTArray->Clear();
226 int nentr_LOCAL_TrackBTArray=LOCAL_TrackBTArray->GetEntries();
229 int nentr2=nentr_LOCAL_TrackBTArray;
232 EdbSegP* alreadyTakenSegment=0;
234 for (Int_t icount=0; icount<nentr2; icount++ ) {
237 tryAttachedSegment=(
EdbSegP*)LOCAL_TrackBTArray->At(icount);
240 if (tryAttachedSegment->
MCEvt()>0 && tryAttachedSegment->
MCEvt()!=InBT->
MCEvt())
continue;
250 Float_t dMinDist=
GetMinimumDist(tryAttachedSegment,alreadyTakenSegment);
268 LOCAL_NewAddedBTArray->Add(tryAttachedSegment);
294 for (Int_t icount=0; icount<LOCAL_NewAddedBTArray->GetEntries(); icount++) {
296 tryAttachedSegment=(
EdbSegP*)LOCAL_NewAddedBTArray->At(icount);
297 if (tryAttachedSegment->
MCEvt()>0 && tryAttachedSegment->
MCEvt()!=InBT->
MCEvt())
continue;
308 for (Int_t patterloop_cnt=local_gAli_npat-1; patterloop_cnt>=0; --patterloop_cnt) {
310 float_t local_gAliZ=local_gAli->
GetPattern(patterloop_cnt)->
Z();
324 for (Int_t btloop_cnt=0; btloop_cnt<local_gAli->
GetPattern(patterloop_cnt)->
GetN(); ++btloop_cnt) {
341 Bool_t isBTadded=kFALSE;
345 if (isBTadded) cout <<
"...Yes this was a new one, and is added to shower array! ..."<< endl;
348 if (isBTadded) matches_found++;
356 if (icount==LOCAL_NewAddedBTArray->GetEntries()-1) {
359 CalcTrackDensity(pat_interim,local_gAli_pat_interim_halfsize,npat_int,npat_total,npatN);
367 LOCAL_NewAddedBTArray->Clear();
378 if (interim->
MCEvt()>0) NBTMC_after++;
380 pur_after=(Float_t)NBTMC_after/(Float_t)NBT_after;
384 cout <<
" Difference between before and after: " << endl;
385 cout <<
" NBT = " << NBT_after <<
" Before: "<< NBT_before << endl;
386 cout <<
" NBTMC = " << NBTMC_after <<
" Before: "<< NBTMC_before << endl;
387 cout <<
" pur = " << pur_after <<
" Before: "<< pur_before << endl;
400 Double_t eff, purall, pure;
445 delete LOCAL_TrackBTArray;
446 delete LOCAL_NewAddedBTArray;
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
TTree * tr
Definition: Shower_E_FromShowerRoot.C:5
Double_t GetdeltaThetaSingleAngles(EdbSegP *s1, EdbSegP *s2)
Definition: ShowRec.cpp:7258
Bool_t FindPrecedingBTsSingleThetaAngleTCDEBUG(EdbSegP *s, EdbSegP *InBT, EdbPVRec *gAli, TObjArray *showersegarray)
Definition: ShowRec.cpp:6903
Double_t GetdeltaRWithPropagation(EdbSegP *s, EdbSegP *stest)
Definition: ShowRec.cpp:7211
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
Bool_t FindPrecedingBTsSingleThetaAngle(EdbSegP *s, EdbSegP *InBT, EdbPVRec *gAli, TObjArray *showersegarray)
Definition: ShowRec.cpp:6825
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
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 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
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
TTree * t
Definition: check_shower.C:4
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
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: EdbPattern.h:118
gEDBDEBUGLEVEL
Definition: energy.C:7
EdbSegP * s2
Definition: tlg2pattern.C:31