FEDRA emulsion software from the OPERA Collaboration
EdbShowerRec Class Reference

#include <EdbShowerRec.h>

Inheritance diagram for EdbShowerRec:
Collaboration diagram for EdbShowerRec:

Public Member Functions

int AddInitiatorBT (EdbSegP *seg)
 
void CalcTrackDensity (EdbPattern *pat_interim, Int_t pat_interim_halfsize, Int_t &npat_int, Int_t &npat_total, Int_t &npatN)
 
void CalculateEnergyValues ()
 
void CheckEdbPVRecSetUseAliSub ()
 
void ClearInBTArray ()
 
void ClearRecoShowerArray ()
 
Double_t DeltaR_WithoutPropagation (EdbSegP *s, EdbSegP *stest)
 
Double_t DeltaR_WithPropagation (EdbSegP *s, EdbSegP *stest)
 
Double_t DeltaThetaComponentwise (EdbSegP *s1, EdbSegP *s2)
 
 EdbShowerRec ()
 
 EdbShowerRec (EdbPVRec *pvr)
 
 EdbShowerRec (EdbPVRec *pvr, Int_t OptionType)
 
 EdbShowerRec (TObjArray *InBTArray, int num, int MAXPLATE, int DATA, int piece2, int piece2par, int DOWN, EdbPVRec *pvr)
 
Float_t Energy_CalcSigma (Float_t Energy, Int_t NPlatesNr)
 
Float_t Energy_CorrectEnergy (Float_t MeasuredEnergy, Int_t NPlatesNr)
 
void Energy_CreateANNTree ()
 
void Energy_CreateEnergyResolutionFitFunction ()
 
void Energy_ExtractShowerParametrisationProfile ()
 
void Execute ()
 
void Fill_eInBTArray_ByLinkTracks_eFilename_LinkedTracks ()
 
Bool_t FindPrecedingBTs (EdbSegP *s, EdbSegP *InBT, EdbPVRec *gAli, EdbTrackP *shower)
 
Double_t GetAlgoParameter (Int_t paranr)
 
Bool_t GetAliLoaded () const
 
Float_t GetChi20 () const
 
Float_t GetChi2b (int i) const
 
Float_t GetDeltarb (int i) const
 
Float_t GetDeltathetab (int i) const
 
Float_t GetDz () const
 
EdbPVRecGetEdbPVRec () const
 
Int_t GetEdbPVRecNpat () const
 
Int_t GetEdbPVRecNplateNumber () const
 
Float_t GetEdbPVRecNSeg (EdbPVRec *ali, Int_t mode)
 
EdbPVRecGetEdbPVRecSub () const
 
Float_t GetEnergy () const
 
Float_t GetEnergySigma () const
 
Float_t GetEnergyUn () const
 
Float_t GetEnergyUnSigma () const
 
Float_t * GetEnergyValues (Int_t TreeEntry)
 
Int_t GetFlag0 () const
 
Int_t GetFlagb (int i) const
 
TH1D * GetHistdeltaR_mean ()
 
TH1D * GetHistdeltaR_rms ()
 
TH1D * GetHistdeltaT_mean ()
 
TH1D * GetHistdeltaT_rms ()
 
TH1F * GetHistEnergyCorrectedb ()
 
TH1F * GetHistEnergyNominal ()
 
TH1F * GetHistEnergySigmaCorrectedb ()
 
TH1F * GetHistEnergySigmaUnCorrectedb ()
 
TH1F * GetHistEnergyUnCorrectedb ()
 
TH1D * GetHistLongProfile ()
 
TH1D * GetHistNBaseTracks ()
 
Int_t GetID () const
 
Int_t GetIDb (int i) const
 
EdbSegPGetInBT (Int_t i) const
 
TObjArray * GetInBTArray () const
 
Int_t GetInBTArrayN () const
 
Int_t GetL () const
 
Float_t GetmcDigitIndexBottom (int i) const
 
Float_t GetmcDigitIndexTop (int i) const
 
Int_t GetN () const
 
Int_t GetNFilmb (int i) const
 
Float_t GetOutput () const
 
Float_t GetOutput15 () const
 
Float_t GetOutput20 () const
 
Float_t GetOutput30 () const
 
Float_t GetP0 () const
 
Float_t GetPb (int i) const
 
Int_t GetPlateb (int i) const
 
TObjArray * GetRecoShowerArray () const
 
Int_t GetRecoShowerArrayN () const
 
Float_t * GetShowerValues (Int_t TreeEntry)
 
Int_t GetSize () const
 
Int_t GetSize15 () const
 
Int_t GetSize20 () const
 
Int_t GetSize30 () const
 
Int_t GetTagPrimaryb (int i) const
 
Int_t GetTreeBranchEntryNr (EdbSegP *seg)
 
Int_t GetTrID () const
 
Float_t GetTx () const
 
Float_t GetTXb (int i) const
 
Float_t GetTy () const
 
Float_t GetTYb (int i) const
 
Bool_t GetUseAliSub ()
 
Int_t GetW0 () const
 
Int_t GetWb (int i) const
 
Float_t GetX0 () const
 
Float_t GetXb (int i) const
 
Float_t GetY0 () const
 
Float_t GetYb (int i) const
 
Float_t GetZ0 () const
 
Float_t GetZb (int i) const
 
void Help ()
 
void Init ()
 
void InitPiece (EdbDataPiece &piece, const char *cpfile, const char *parfile)
 
void initproc (const char *def, int iopt, const char *rcut)
 
Double_t InvariantMass (EdbSegP *s1, EdbSegP *s2, Double_t Momentum1=-1, Double_t Momentum2=-1, Double_t ID1=22, Double_t ID2=22)
 
Bool_t IsInConeTube (EdbSegP *TestingSegment, EdbSegP *StartingSegment, Double_t CylinderRadius, Double_t ConeAngle)
 
void LoadEdbPVRec ()
 
void LoadShowerFile (TString ShowerFileName)
 
void NeuralNet ()
 
void Print ()
 
void PrintEdbPVRec () const
 
void PrintInitiatorBTs ()
 
void PrintParameters ()
 
void PrintRecoShowerArray ()
 
void ReadAffAndZ (char *fname, Float_t *pZoffs, Float_t *a11, Float_t *a12, Float_t *a21, Float_t *a22, Float_t *b1, Float_t *b2)
 
int ReadPiece (EdbDataPiece &piece, EdbPattern &pat)
 
void rec (int num, int MAXPLATE, int DATA, int Ncand, double *x0, double *y0, double *z0, double *tx0, double *ty0, double *chi20, int *W0, double *P0, int *Flag0, int *plate0, int *id0, int *TRid, double *Esim, int piece2, int piece2par, int DOWN, EdbPVRec *pvr)
 
void rec (int num, int MAXPLATE, int DATA, int Ncand, double *x0, double *y0, double *z0, double *tx0, double *ty0, int *plate0, int *id0, int *TRid, double *Esim, int *mcDigitIndexTop, int *mcDigitIndexBottom, int piece2, int piece2par, int DOWN, EdbPVRec *pvr)
 OLD — not used anymore.... More...
 
void rec (TObjArray *sarr, EdbPVRec *pvr)
 
void recdown (int num, int MAXPLATE, int DATA, int Ncand, double *x0, double *y0, double *z0, double *tx0, double *ty0, double *chi20, int *W0, double *P0, int *Flag0, int *plate0, int *id0, int *TRid, double *Esim, int *mcDigitIndexTop0, int *mcDigitIndexBottom0, int piece2, int piece2par, EdbPVRec *pvr)
 
void recup (int num, int MAXPLATE, int DATA, int Ncand, double *x0, double *y0, double *z0, double *tx0, double *ty0, double *chi20, int *W0, double *P0, int *Flag0, int *plate0, int *id0, int *TRid, double *Esim, int *mcDigitIndexTop0, int *mcDigitIndexBottom0, int piece2, int piece2par, EdbPVRec *pvr)
 
void remove (char *shfname, char *def, int MAXPLATE, int piece2par)
 
void ResetAlgoParameters ()
 
void ResetInBTArray ()
 
void ResetRecoShowerArray ()
 
int SaveLNK ()
 
void SaveResults ()
 
void Set0 ()
 
void SetAlgoParameter (Double_t paravalue, Int_t paranr)
 
void SetChi20 (float chi2)
 
void SetChi2b (float chi2b, int i)
 
void SetDeltarb (float deltarb, int i)
 
void SetDelthetab (float deltathetab, int i)
 
void SetDoEnergyCalculation (Bool_t DoEnergyCalculation)
 
void SetDz (float dz)
 
void SetEdbPVRec (EdbPVRec *Ali)
 
void SetFlag0 (int flag)
 
void SetFlagb (int flag, int i)
 
void SetID (int id)
 
void SetIDb (int idb2, int i)
 
void SetInBTArray (EdbPVRec *Ali, Int_t mode=0)
 
void SetInBTArray (EdbSegP *InBT)
 
void SetInBTArray (TObjArray *InBTArray)
 
void SetInBTArrayN (Int_t InBTArrayN)
 
void SetL (int L)
 
void SetmcDigitIndexBottom (int mcDb, int i)
 
void SetmcDigitIndexBottom0 (int mcDb)
 
void SetmcDigitIndexTop (int mcDt, int i)
 
void SetmcDigitIndexTop0 (int mcDt)
 
void SetNFilmb (int nfilmb, int i)
 
void SetOutput (float output)
 
void SetOutput15 (float output)
 
void SetOutput20 (float output)
 
void SetOutput30 (float output)
 
void SetP0 (float p)
 
void SetPb (float p, int i)
 
void SetPlateb (int plate2, int i)
 
void SetPrimary (int tagprimary, int i)
 
void SetQualityCutValues (Double_t p0, Double_t p1)
 
void SetRecoShowerArray (TObjArray *RecoShowerArray)
 
void SetRecoShowerArrayN (Int_t RecoShowerArrayN)
 
void SetSize (int size)
 
void SetSize15 (int size)
 
void SetSize20 (int size)
 
void SetSize30 (int size)
 
void SetTrID (int id)
 
void SetTx (float tx)
 
void SetTXb (float txb, int i)
 
void SetTy (float ty)
 
void SetTYb (float tyb, int i)
 
void SetUseAliSub (Bool_t UseAliSub)
 
void SetW0 (int w)
 
void SetWb (int w, int i)
 
void SetX0 (float x)
 
void SetXb (float xb, int i)
 
void SetY0 (float y)
 
void SetYb (float yb, int i)
 
void SetZ0 (float z)
 
void SetZb (float zb, int i)
 
TObjArray * ShowerToEdbSegPArray ()
 
void TransferShowerObjectArrayIntoEntryOfTreebranchShowerTree (TObjArray *segarray)
 
void TransferTreebranchShowerTreeIntoShowerObjectArray (TTree *treebranch)
 
void Transform_eAli (EdbSegP *InitiatorBT, Float_t ExtractSize)
 
void vert (const char *name2, const char *def, int MAXPLATE, int piece2par)
 
virtual ~EdbShowerRec ()
 

Public Attributes

EdbDataProca
 
Double_t bin1
 
Double_t bin10
 
Double_t bin11
 
Double_t bin12
 
Double_t bin13
 
Double_t bin14
 
Double_t bin15
 
Double_t bin16
 
Double_t bin17
 
Double_t bin18
 
Double_t bin19
 
Double_t bin2
 
Double_t bin20
 
Double_t bin21
 
Double_t bin22
 
Double_t bin23
 
Double_t bin24
 
Double_t bin25
 
Double_t bin26
 
Double_t bin27
 
Double_t bin28
 
Double_t bin29
 
Double_t bin3
 
Double_t bin30
 
Double_t bin31
 
Double_t bin32
 
Double_t bin33
 
Double_t bin34
 
Double_t bin35
 
Double_t bin4
 
Double_t bin41
 
Double_t bin42
 
Double_t bin43
 
Double_t bin44
 
Double_t bin45
 
Double_t bin46
 
Double_t bin47
 
Double_t bin48
 
Double_t bin49
 
Double_t bin5
 
Double_t bin50
 
Double_t bin51
 
Double_t bin52
 
Double_t bin53
 
Double_t bin54
 
Double_t bin55
 
Double_t bin56
 
Double_t bin57
 
Double_t bin58
 
Double_t bin59
 
Double_t bin6
 
Double_t bin60
 
Double_t bin7
 
Double_t bin8
 
Double_t bin9
 
Float_t chi2btkb [10000]
 
char cmd [500]
 
Float_t deltarb [10000]
 
Float_t deltathetab [10000]
 
Float_t deltaxb [10000]
 
Float_t deltayb [10000]
 
EdbDataProcdproc
 
Float_t E_MC
 
Float_t EnergyCorrectedb
 
Float_t EnergySigmaCorrectedb
 
Float_t EnergySigmaUnCorrectedb
 
Float_t EnergyUnCorrectedb
 
Int_t eProb1
 
Int_t eProb90
 
TFile * file
 
TFile * fileout
 
TFile * fileout2
 
TFile * fileout3
 
TFile * FileReconstructedShowerTree
 
TFile * FileShowerParametrisationTree
 
EdbPVRecgAli
 
TH1D * histo_deltaR_mean
 
TH1D * histo_deltaR_rms
 
TH1D * histo_deltaT_mean
 
TH1D * histo_deltaT_rms
 
TH1D * histo_longprofile_av
 
TH1D * histo_nbtk_av
 
Int_t idb [10000]
 
Int_t isizeb
 
Int_t mcDigitIndexBottom [1000]
 
Int_t mcDigitIndexTop [1000]
 
TMultiLayerPerceptron * mlp1
 
TMultiLayerPerceptron * mlp2
 
TMultiLayerPerceptron * mlp3
 
TMultiLayerPerceptron * mlp4
 
Int_t nfilmb [10000]
 
Int_t ngrainb [10000]
 
Int_t ntrace1simub [10000]
 
Int_t ntrace2simub [10000]
 
Float_t ntrace3simub [10000]
 
Int_t ntrace4simub [10000]
 
Int_t number_eventb
 
Float_t output15
 
Float_t output20
 
Float_t output30
 
Float_t output50
 
Int_t plateb [10000]
 
Float_t purityb
 
Int_t showerID
 
TTree * ShowerParametrisationTree
 
Int_t sizeb
 
Int_t sizeb15
 
Int_t sizeb20
 
Int_t sizeb30
 
Float_t tagprimary [10000]
 
Float_t trackdensb
 
TTree * treesaveb
 
TTree * treesaveb2
 
TTree * treesaveb3
 
Float_t txb [10000]
 
Float_t tyb [10000]
 
Int_t type
 
TTree * varia
 
Float_t xb [10000]
 
Float_t yb [10000]
 
Float_t zb [10000]
 

Private Member Functions

TMultiLayerPerceptron * eEANN ()
 

Private Attributes

TTree * ANNInterimTreeInputvariables
 
Double_t eAlgoParameterConeAngle
 
Double_t eAlgoParameterConeRadius
 
Double_t eAlgoParameterConnectionDR
 
Double_t eAlgoParameterConnectionDT
 
Int_t eAlgoParameterNPropagation
 
EdbPVReceAli
 
EdbPVReceAli_Sub
 
Float_t eAli_Sub_halfsize
 
Int_t eAli_SubNpat
 
Bool_t eAliLoaded
 
Int_t eAliNpat
 
Int_t eAliNpatM1
 
Float_t eChi20
 
Float_t eChi2b [10000]
 
Float_t eDeltarb [10000]
 
Float_t eDeltathetab [10000]
 
Bool_t eDoEnergyCalculation
 
Float_t eDz
 
TObjArray * eEnergyANN
 
Float_t eEnergyCorrectedb
 
Bool_t eEnergyIsDone
 
TF1 * eEnergyResolutionFitFunction_All
 
Float_t eEnergySigmaCorrectedb
 
Float_t eEnergySigmaUnCorrectedb
 
Float_t eEnergyUnCorrectedb
 
TString * eEnergyWeightFileString [9]
 
TString eFilename_LinkedTracks
 
Int_t eFlag0
 
Int_t eFlagb [10000]
 
TH1F * eHistEnergyCorrectedb
 
TH1F * eHistEnergyNominal
 
TH1F * eHistEnergySigmaCorrectedb
 
TH1F * eHistEnergySigmaUnCorrectedb
 
TH1F * eHistEnergyUnCorrectedb
 
Int_t eID
 
Int_t eIDb [10000]
 
TObjArray * eInBTArray
 
Bool_t eInBTArrayIsFilled
 
Bool_t eInBTArrayLoaded
 
Int_t eInBTArrayMaxSize
 
Int_t eInBTArrayN
 
Bool_t eInitiatorBTIsCreated
 
Int_t eL
 
Int_t emcDigitIndexBottom [1000]
 
Int_t emcDigitIndexBottom0
 
Int_t emcDigitIndexTop [1000]
 
Int_t emcDigitIndexTop0
 
Float_t energy_shot_particle
 
Int_t eNFilmb [10000]
 
Int_t eNumberPlate_eAliPID
 
Float_t eOutput
 
Float_t eOutput15
 
Float_t eOutput20
 
Float_t eOutput30
 
Float_t eP0
 
Float_t ePb [10000]
 
Int_t ePlateb [10000]
 
Double_t eQualityPar [2]
 
TObjArray * eRecoShowerArray
 
Int_t eRecoShowerArrayN
 
Int_t eShowersN
 
Bool_t eShowerTreeIsDone
 
Int_t eSize
 
Int_t eSize15
 
Int_t eSize20
 
Int_t eSize30
 
Int_t eTagPrimary [10000]
 
Int_t eTrID
 
Float_t eTx
 
Float_t eTXb [10000]
 
Float_t eTy
 
Float_t eTYb [10000]
 
Bool_t eUseAliSub
 
Bool_t eUseQualityPar
 
Int_t eW0
 
Int_t eWb [10000]
 
Float_t eX0
 
Float_t eXb [10000]
 
Float_t eY0
 
Float_t eYb [10000]
 
Float_t eZ0
 
Float_t eZb [10000]
 
Double_t inANN [70]
 

Constructor & Destructor Documentation

◆ EdbShowerRec() [1/4]

EdbShowerRec::EdbShowerRec ( )

◆ EdbShowerRec() [2/4]

EdbShowerRec::EdbShowerRec ( TObjArray *  InBTArray,
int  num,
int  MAXPLATE,
int  DATA,
int  piece2,
int  piece2par,
int  DOWN,
EdbPVRec pvr 
)
43 {
44  // Constructor giving a TObjArray of EdbSegments as Initiator Basetracks.
45  // Old style constructor: Fill the array variables (arrays with 10000 indices..)
46  // from the TObjArray of EdbSegP.
47  // Though this is the "original" reconstruction function, it should not be used anymore
48  // since it just does everything mixed together and the different steps are not to
49  // clear for the user.
50 
51  Init();
52  Set0();
53 
54  // Interim arrays, code structure is copied from shower_btr.C :
55  double x0[10000];
56  double y0[10000];
57  double z0[10000];
58  double tx0[10000];
59  double ty0[10000];
60  double chi20[10000];
61  double P0[10000];
62  int W0[10000];
63  int Flag0[10000];
64  int TRid[10000];
65  double Esim[10000];
66  int id[10000];
67  int Pid[10000];
68  int Ncand=0;
69  float Zoff;
70 
71  int nentries = InBTArray->GetEntries();
72  EdbSegP *s = 0;
73  for (int i=0; i<nentries; i++) {
74  s=(EdbSegP*)InBTArray->At(i);
75  x0[Ncand] = s->X();
76  y0[Ncand] = s->Y();
77  Zoff = s->Z();
78  z0[Ncand] = Zoff;
79  tx0[Ncand] = s->TX();
80  ty0[Ncand] = s->TY();
81  chi20[Ncand] = s->Chi2();
82  W0[Ncand] = s->W();
83  P0[Ncand] = s->P();
84  Flag0[Ncand] = s->Flag();
85  TRid[Ncand] = s->MCEvt(); //this has to be a positive number
86  Esim[Ncand] = s->P();
87  id[Ncand] = s->ID();
88  Pid[Ncand] = Zoff/1273+1;
89  if (gEDBDEBUGLEVEL>2) cout << s->X() << " " << s->Y() << " " << s->Z() << " " << s->TX() << " " << s->TY() << " " << Pid[Ncand] << " " << Esim[Ncand] << " " << TRid[Ncand] << endl;
90  cout << chi20[Ncand] << " " << W0[Ncand] << " " << P0[Ncand] << " " << Flag0[Ncand] << endl;
91  Ncand++;
92  }
93 
94  // Start the actual reconstruction function:
95  rec(num,MAXPLATE,DATA,Ncand,x0,y0,z0,tx0,ty0,chi20,W0,P0,Flag0,Pid,id,TRid,Esim,piece2,piece2par,UPDOWN,pvr);
96 
97 }
brick z0
Definition: RecDispMC.C:106
int nentries
Definition: check_shower.C:40
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 Chi2() const
Definition: EdbSegP.h:154
Float_t Z() const
Definition: EdbSegP.h:150
Float_t P() const
Definition: EdbSegP.h:149
Float_t Y() const
Definition: EdbSegP.h:171
Float_t W() const
Definition: EdbSegP.h:148
Float_t TY() const
Definition: EdbSegP.h:173
Int_t MCEvt() const
Definition: EdbSegP.h:142
Int_t Flag() const
Definition: EdbSegP.h:146
void Set0()
Definition: EdbShowerRec.cxx:228
void Init()
Definition: EdbShowerRec.cxx:207
void rec(int num, int MAXPLATE, int DATA, int Ncand, double *x0, double *y0, double *z0, double *tx0, double *ty0, int *plate0, int *id0, int *TRid, double *Esim, int *mcDigitIndexTop, int *mcDigitIndexBottom, int piece2, int piece2par, int DOWN, EdbPVRec *pvr)
OLD — not used anymore....
Definition: EdbShowerRec.cxx:315
gEDBDEBUGLEVEL
Definition: energy.C:7
int piece2par
Definition: shower_btr.C:22
int piece2
Definition: shower_btr.C:21
int DATA
Definition: shower_btr.C:24
int MAXPLATE
Definition: shower_btr.C:19
EdbSegP * s
Definition: tlg2pattern.C:32

◆ EdbShowerRec() [3/4]

EdbShowerRec::EdbShowerRec ( EdbPVRec pvr)
102 {
103  // Constructor giving a EdbPVRec object directly.
104  // We try to do the reconstruction in the following way:
105  // a) if EdbPVRec has tracking already done then take eTracks for
106  // Inititator Basetracks
107  // b) if EdbPVRec has vertexing already done then take eVertex for
108  // additional cut of the Initiator Basetracks which are in
109  // an IP of less than 250 microns.
110  // c) Start BGEstimation, Reconstruction, Energy, ID directly
111  // from this EdbPVRec object
112  //
113  // After these steps showers are stored as an TObjarray of EdbTrackP
114  // in this class and can be accessed.
115  // Showers can also be written in the linked_tracks.root file, or
116  // in the Shower.root file. But this file stores the showers just as
117  // a tree with leafs and the object structure is lost.
118 
119  cout << "----------------------------------------------------------" << endl;
120  cout << "EdbShowerRec::EdbShowerRec(EdbPVRec *pvr) " << endl;
121  cout << " Constructor giving a EdbPVRec object directly. We try to do the reconstruction in the following way: " << endl;
122  cout << " a) if EdbPVRec has tracking already done then take eTracks for Inititator Basetracks."<< endl;
123  cout << " b) if EdbPVRec has vertexing already done then take eVertex for additional cut of the Initiator Basetracks which are in an IP of less than 250 microns." << endl;
124  cout << " c) Start BGEstimation, Reconstruction, Energy, ID directly from this EdbPVRec object" << endl;
125  cout <<"---------- (some of step c are still: ) T O D O -----------------------" << endl;
126  cout << endl;
127  cout << "After these steps showers are stored as an TObjarray of EdbTrackP "<< endl;
128  cout << "in this class and can be accessed. " << endl;
129  cout << "Showers can also be written in the linked_tracks.root file, or " << endl;
130  cout << "in the Shower.root file. But this file stores the showers just as " << endl;
131  cout << "a tree with leafs and the object structure is lost. " << endl;
132  cout << endl;
133  cout << "WARNING:: EdbShowerRec::EdbShowerRec(EdbPVRec* pvr) DO NOTHING YET !!!" << endl;
134  cout << "PLEASE DO THESE STEPS MANUALLY UNTIL SHOWER LIBRARY IS FULLY FUNCTIONAL" << endl;
135  cout << "By stopping here, we avoid misunderstandings when all in one is done but not yet fully tested." << endl;
136  cout << endl;
137  cout << "----------------------------------------------------------" << endl;
138 
139  Init();
140  Set0();
141  SetEdbPVRec(pvr);
142 
143 }
void SetEdbPVRec(EdbPVRec *Ali)
Definition: EdbShowerRec.h:629

◆ EdbShowerRec() [4/4]

EdbShowerRec::EdbShowerRec ( EdbPVRec pvr,
Int_t  OptionType 
)
148 {
149  // Constructor giving a EdbPVRec object directly and an option number:
150  cout << "----------------------------------------------------------" << endl;
151  cout << "EdbShowerRec::EdbShowerRec(EdbPVRec *pvr, Int_t OptionType) " << endl;
152  cout << " Constructor giving a EdbPVRec object directly and an option number:" << endl;
153  cout << " OptionType = " << OptionType << endl;
154  cout << "----------------------------------------------------------" << endl;
155  cout << " 0: Set Initial Values, do nothing more." << endl;
156  cout << " 1: Check EdbPVRec object (presence, bg dens), do nothing more." << endl;
157  cout << " 2: Check other Input objects (linked_tracks.root, feedback file), do nothing more." << endl;
158  cout << " 3: Do normal (electron) reconstruction using Cone Tube algorithm (OI implementation)" << endl;
159  cout << " 4: Do pair search (gamma) reconstruction using GS algorithm." << endl;
160  cout << " 5: Do both Reco and ID+Energy estimations." << endl;
161  cout << " -1: Do everything possible!" << endl;
162  cout << "----------------------------------------------------------" << endl;
163 
164 
165  Init();
166  Set0();
167 
168  if (OptionType==1) {
169  EdbPVRQuality* qual = new EdbPVRQuality(pvr);
170  EdbPVRec *pvr_new=qual->GetEdbPVRec();
171  SetEdbPVRec(pvr_new);
172  }
173  if (OptionType==2) {
174  // check here if original pvr has tracks and/or vertices
175  // check here if linked_tracks.root exists, if feedback file exits
176  cout << "if (OptionType==2) .." << endl;
177  }
178  if (OptionType==3) {
179  // start reco for OI algo here...
180  cout << "if (OptionType==3) .." << endl;
181  }
182  if (OptionType==4) {
183  // start reco for OI algo here...
184  cout << "if (OptionType==4) .." << endl;
185  }
186  if (OptionType==5) {
187  // Invoke ID and Energy estimation here...
188  cout << "if (OptionType==5) .." << endl;
189  }
190 
191 
192 
193 }
Definition: EdbPVRQuality.h:38
EdbPVRec * GetEdbPVRec()
Definition: EdbPVRQuality.h:229
Definition: EdbPVRec.h:148

◆ ~EdbShowerRec()

EdbShowerRec::~EdbShowerRec ( )
virtual
197 {
198  // Default Destructor.
199  delete eInBTArray;
200  delete eRecoShowerArray;
201 }
TObjArray * eInBTArray
Definition: EdbShowerRec.h:115
TObjArray * eRecoShowerArray
Definition: EdbShowerRec.h:121

Member Function Documentation

◆ AddInitiatorBT()

int EdbShowerRec::AddInitiatorBT ( EdbSegP seg)
2401 {
2402  // Check if eInBTArray array exits, otherwise create.
2403  if (!eInitiatorBTIsCreated) {
2404  eInBTArray=new TObjArray(9999);
2405  eInitiatorBTIsCreated=kTRUE;
2406  }
2407  // Add the segment to the eInBTArray array
2408  eInBTArray->Add(seg);
2409 
2410  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::AddInitiatorBT(seg) added. Now entries in eInBTArray: ";
2411  if (gEDBDEBUGLEVEL>2) cout << eInBTArray->GetEntries() << endl;
2412 
2413  eInBTArrayIsFilled=kTRUE;
2414  return 1;
2415 }
Bool_t eInBTArrayIsFilled
Definition: EdbShowerRec.h:91
Bool_t eInitiatorBTIsCreated
Definition: EdbShowerRec.h:90

◆ CalcTrackDensity()

void EdbShowerRec::CalcTrackDensity ( EdbPattern pat_interim,
Int_t  pat_interim_halfsize,
Int_t &  npat_int,
Int_t &  npat_total,
Int_t &  npatN 
)
4857 {
4858  if (gEDBDEBUGLEVEL>3) cout << "-------------void EdbShowerRec::CalcTrackDensity(&pat_interim,pat_interim_halfsize,&npat_int,&npat_total)"<<endl;
4859  npat_int=pat_interim->GetN();
4860  if (npat_int<=0) return;
4861  npat_total+=npat_int;
4862  ++npatN;
4863  if (npatN>0) trackdensb=(Float_t)npat_total/(Float_t)npatN/pat_interim_halfsize/pat_interim_halfsize/4.0*1000.0*1000.0; // BT/mm2
4864  if (gEDBDEBUGLEVEL>3) {
4865  cout << "npat_int = " << npat_int << endl;
4866  cout << "npat_total = " << npat_total << endl;
4867  cout << "npatN = " << npatN << endl;
4868  cout << "shower_trackdensb = " << trackdensb << endl;
4869  }
4870  return;
4871 }
Int_t GetN() const
Definition: EdbPattern.h:65
Float_t trackdensb
Definition: EdbShowerRec.h:213

◆ CalculateEnergyValues()

void EdbShowerRec::CalculateEnergyValues ( )

—CreateANNTree:



—CreateEnergyResolutionFitFunction:



—Extract the desired profile


2449 {
2450  //=C= -----------------will be deprecated soon-------------
2451 
2452  if (gEDBDEBUGLEVEL>2) cout << "------------------------------------------------------"<<endl;
2453  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::CalculateEnergyValues()"<<endl;
2454  if (gEDBDEBUGLEVEL>2) cout << "------------------------------------------------------"<<endl;
2455 
2456 // if (!gROOT->GetClass("TMultiLayerPerceptron")) {
2457 // cout << "Need to load libMLP seperately"<<endl;
2458 // gSystem->Load("libMLP");
2459 // }
2460 
2461  //gEDBDEBUGLEVEL=3;
2462 
2463 
2469 
2475 
2481 
2482  return;
2483 }
void Energy_CreateANNTree()
Definition: EdbShowerRec.cxx:3025
void Energy_ExtractShowerParametrisationProfile()
Definition: EdbShowerRec.cxx:2508
void Energy_CreateEnergyResolutionFitFunction()
Definition: EdbShowerRec.cxx:2985

◆ CheckEdbPVRecSetUseAliSub()

void EdbShowerRec::CheckEdbPVRecSetUseAliSub ( )
3901 {
3902  // Small function that test the ratio of MC/Data basetracks in the volume.
3903  // If ratio is high (>20%), and number of InitiatorBTN is mediate (<1000),
3904  // then we will use the SetUseAliSub(1) option, which means:
3905  // -faster reconstruction, but higher memory consumption.
3906  // If not we switch to the standard reco method SetUseAliSub(0):
3907  // -lower reconstruction, but stable memory consumption.
3908 
3909  cout << "void EdbShowerRec::CheckEdbPVRecSetUseAliSub()" << endl;
3910  cout << "void EdbShowerRec::CheckEdbPVRecSetUseAliSub() GetUseAliSub() = " << GetUseAliSub() << endl;
3911 
3912  if (gEDBDEBUGLEVEL>2) {
3913  cout << "void EdbShowerRec::CheckEdbPVRecSetUseAliSub() " << eAli << endl;
3914  cout << "void EdbShowerRec::CheckEdbPVRecSetUseAliSub() " << GetEdbPVRecNSeg(eAli,3) << endl;
3915  cout << "void EdbShowerRec::CheckEdbPVRecSetUseAliSub() " << eInBTArrayN << endl;
3916  }
3917 
3918  if (NULL==eAli) return;
3919  if (GetEdbPVRecNSeg(eAli,3)<0.20) return;
3920  if (eInBTArrayN>1000) return;
3921 
3922  // If we arrived here, it might be time to switch to the fast reconstruction!
3923  SetUseAliSub(1);
3924 
3925  cout << "EdbShowerRec::CheckEdbPVRecSetUseAliSub() We arrived here, so it might be time to switch to the fast reconstruction!" << endl;
3926  cout << "EdbShowerRec::CheckEdbPVRecSetUseAliSub() GetUseAliSub() = " << GetUseAliSub() << endl;
3927 
3928  return;
3929 }
Float_t GetEdbPVRecNSeg(EdbPVRec *ali, Int_t mode)
Definition: EdbShowerRec.cxx:3860
Bool_t GetUseAliSub()
Definition: EdbShowerRec.h:678
void SetUseAliSub(Bool_t UseAliSub)
Definition: EdbShowerRec.h:625
Int_t eInBTArrayN
Definition: EdbShowerRec.h:116
EdbPVRec * eAli
Definition: EdbShowerRec.h:100
#define NULL
Definition: nidaqmx.h:84

◆ ClearInBTArray()

void EdbShowerRec::ClearInBTArray ( )
4268  {
4269  if (eInBTArrayN>0) eInBTArray->Clear();
4270  eInBTArrayN=0;
4271  return;
4272 }

◆ ClearRecoShowerArray()

void EdbShowerRec::ClearRecoShowerArray ( )
4273  {
4274  if (eRecoShowerArrayN>0) eRecoShowerArray->Clear();
4276  return;
4277 }
Int_t eRecoShowerArrayN
Definition: EdbShowerRec.h:122

◆ DeltaR_WithoutPropagation()

Double_t EdbShowerRec::DeltaR_WithoutPropagation ( EdbSegP s,
EdbSegP stest 
)
3527 {
3528  // Calculate Delta R of two segments using no z propagation.
3529  return TMath::Sqrt((s->X()-stest->X())*(s->X()-stest->X())+(s->Y()-stest->Y())*(s->Y()-stest->Y()));
3530 }

◆ DeltaR_WithPropagation()

Double_t EdbShowerRec::DeltaR_WithPropagation ( EdbSegP s,
EdbSegP stest 
)
3510 {
3511  // Calculate Delta R of two segments.
3512  // If they have different Z positions, then first segment in the argument of the bracket
3513  // is propagated to the position of the second segment.
3514  if (s->Z()==stest->Z()) return TMath::Sqrt((s->X()-stest->X())*(s->X()-stest->X())+(s->Y()-stest->Y())*(s->Y()-stest->Y()));
3515  Double_t zorig;
3516  Double_t dR;
3517  zorig=s->Z();
3518  s->PropagateTo(stest->Z());
3519  dR=TMath::Sqrt( (s->X()-stest->X())*(s->X()-stest->X())+(s->Y()-stest->Y())*(s->Y()-stest->Y()) );
3520  s->PropagateTo(zorig);
3521  return dR;
3522 }
void PropagateTo(float z)
Definition: EdbSegP.cxx:292

◆ DeltaThetaComponentwise()

Double_t EdbShowerRec::DeltaThetaComponentwise ( EdbSegP s1,
EdbSegP s2 
)
3493 {
3494  // Calculate Delta Theta of two segments.
3495  // Be aware that this DeltaTheta function returns the difference between the
3496  // component values of dTheta!!!
3497  // Acutally this function should be the normal way to calculate dTheta correctly...
3498  Double_t tx1,tx2,ty1,ty2;
3499  tx1=s1->TX();
3500  tx2=s2->TX();
3501  ty1=s1->TY();
3502  ty2=s2->TY();
3503  Double_t dt= TMath::Sqrt( (tx1-tx2)*(tx1-tx2) + (ty1-ty2)*(ty1-ty2) );
3504  return dt;
3505 }
EdbSegP * s1
Definition: tlg2pattern.C:30
EdbSegP * s2
Definition: tlg2pattern.C:31

◆ eEANN()

TMultiLayerPerceptron* EdbShowerRec::eEANN ( )
private

◆ Energy_CalcSigma()

Float_t EdbShowerRec::Energy_CalcSigma ( Float_t  Energy,
Int_t  NPlatesNr 
)
3006 {
3007  //=C= -----------------will be deprecated soon-------------
3008  // To understand where these values come from, please look in
3009  // the note of energy measurement by FWM. to be found on the opera doc server.
3010  //=C= -----------------------------------------------------
3011  Float_t SigmaParametrizationArray[8][3]= { { 1.27,0.0,0.28}, {0.79,0.0,0.26}, {0.48,0.0,0.23}, {0.50,0.0,0.15} ,{0.49,0.0,0.10} ,{0.50,0.17,0.04}, {0.49,0.24,0.00},{0.45,0.37,0.03} };
3012 
3013  eEnergyResolutionFitFunction_All->SetParameter(0,SigmaParametrizationArray[type][0]);
3014  eEnergyResolutionFitFunction_All->SetParameter(1,SigmaParametrizationArray[type][1]);
3015  eEnergyResolutionFitFunction_All->SetParameter(2,SigmaParametrizationArray[type][2]);
3016 
3017  Float_t CalcSigma = eEnergyResolutionFitFunction_All->Eval(Energy);
3018  return CalcSigma;
3019 }
TF1 * eEnergyResolutionFitFunction_All
Definition: EdbShowerRec.h:156
Int_t type
Definition: EdbShowerRec.h:244

◆ Energy_CorrectEnergy()

Float_t EdbShowerRec::Energy_CorrectEnergy ( Float_t  MeasuredEnergy,
Int_t  NPlatesNr 
)
2947 {
2948  //=C= -----------------will be deprecated soon-------------
2949  //=C= Correct the given ANN Energy linear according
2950  //=C= to the formula
2951  //=C= E_corr = 1/p1 * ( E_meas -p0 )
2952  //=C= p1,p0 are different for the plate numbers.
2953  //=C= -----------------------------------------------------
2954  Float_t p0[8];
2955  Float_t p1[8];
2956  Float_t CorrEnergy;
2957  // New Values
2958  p0[0]=1.01;
2959  p1[0]=2.83; // 11 Plates
2960  p0[1]=1.07;
2961  p1[1]=1.48; // 16 Plates
2962  p0[2]=0.97;
2963  p1[2]=1.03; // 21 Plates
2964  p0[3]=0.98;
2965  p1[3]=0.89; // 26 Plates
2966  p0[4]=0.92;
2967  p1[4]=1.05; // 31 Plates
2968  p0[5]=0.90;
2969  p1[5]=1.03; // 36 Plates
2970  p0[6]=0.88;
2971  p1[6]=1.07; // 41 Plates
2972  p0[7]=0.87;
2973  p1[7]=1.10; // 46 Plates
2974  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_CorrectEnergy() === NPlatesNr p0[NPlatesNr] " << NPlatesNr << " " << p0[NPlatesNr] << endl;
2975  CorrEnergy= 1.0/p1[NPlatesNr] * ( MeasuredEnergy-p0[NPlatesNr] );
2976 
2977  return CorrEnergy;
2978 }

◆ Energy_CreateANNTree()

void EdbShowerRec::Energy_CreateANNTree ( )

DEBUG // inANN = new Double_t[70];

3026 {
3027  //=C= -----------------will be deprecated soon-------------
3028 
3029  if (gEDBDEBUGLEVEL>2) cout << "------------------------------------------"<<endl;
3030  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_CreateANNTree()"<<endl;
3031  if (gEDBDEBUGLEVEL>2) cout << "------------------------------------------"<<endl;
3032 
3033  //=C= Load MLP Root Class:
3034 // if (!gROOT->GetClass("TMultiLayerPerceptron")) {
3035 // gSystem->Load("libMLP");
3036 // }
3037  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Energy_CreateANNTree() === Load(libMLP) done." << endl;
3038 
3039  //=C= -----------------------------------------------------
3040  //=C=
3041  //=C= -----------------------------------------------------
3042  //=C= Explanation: ReconstructedPlatesArray[ReconstructedPlatesNr]:
3043  //=C= for BTs per each EmulsionNr (11,16,21..56)
3044  //=C= Explanation: 4: dR, dT: mean and rms.
3045  //=C= Explanation: 1: number of Basetracks
3046  //=C= Explanation: [0]: type=energy of the Shower
3047  //=C= For the FJ Profile we have 1+4+(11,16,21=NumberOfPlates)... InputNeurons:
3048  //=C= -----------------------------------------------------
3049  //=C= We Create different instances of ANNs for different shower lengths:
3050  //=C= -----------------------------------------------------
3052  ANNInterimTreeInputvariables = new TTree("ANNInterimTreeInputvariables","ANNInterimTreeInputvariables");
3053  ANNInterimTreeInputvariables -> Branch("inANN", inANN, "inANN[70]/D");
3054  //=C= -----------------------------------------------------
3055 
3056  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Energy_CreateANNTree() === CreateANNTree() is done."<<endl;
3057  //gEDBDEBUGLEVEL=3;
3058 
3059  Int_t ReconstructedPlatesArray[] = {11,16,21,26,31,36,41,46};
3060  Int_t NrOfANNInputNeurons[] = {11,16,21,26,31,36,41,46};
3061  eEnergyANN = new TObjArray(9);
3062 
3063  //=C= -----------------------------------------------------
3064  //=C= This ANN Layout has the following form:
3065  //=C= inputNeurons : hiddenLayer1 : hiddenLayer2 : type
3066  //=C= inANN[1],...,inANN[x] : NrOfANNInputNeurons+1 : NrOfANNInputNeurons : inANN[0]
3067  //=C= -----------------------------------------------------
3068 
3069  for (Int_t i=0; i<8; ++i) {
3070  NrOfANNInputNeurons[i]=NrOfANNInputNeurons[i]+1+4;
3071  TString layout="";
3072  //=C= -----------------------------------------------------
3073  for (Int_t j=1; j<NrOfANNInputNeurons[i]; ++j) layout += "@inANN["+TString(Form("%d",j))+"],";
3074  layout += "@inANN["+TString(Form("%d",NrOfANNInputNeurons[i]))+"]:"+TString(Form("%d",NrOfANNInputNeurons[i]+1))+":"+TString(Form("%d",NrOfANNInputNeurons[i]));
3075  layout+=":inANN[0]/1000"; //if (Geant4) ([E]=MeV) //else layout+=":inANN[0]"; (Geant3) ([E]=GeV)
3076  //=C= -----------------------------------------------------
3077 // eEnergyANN[i]
3078  TMultiLayerPerceptron* eEANN = new TMultiLayerPerceptron(layout,ANNInterimTreeInputvariables,"","(Entry$)%2");
3079 
3080  //=C= -----------------------------------------------------
3081  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Energy_CreateANNTree() === ANN_MLP->GetStructure() : " << eEANN->GetStructure().Data() << endl ;
3082  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Energy_CreateANNTree() === LoadANNWeightFile():"<<endl;
3083 
3084  TString weightfilestring=TString(gSystem->ExpandPathName("$FEDRA_ROOT"))+TString("/src/libShower/")+TString(Form("EnergyMeasurement_WeightFile_%d_Plates.txt",ReconstructedPlatesArray[i]));
3085 
3086  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Energy_CreateANNTree() === weightfilestring= " << weightfilestring.Data() << endl;
3087 
3088 
3089  eEANN->LoadWeights(weightfilestring);
3090  eEnergyANN->Add(eEANN);
3091  }
3092  //=C= -----------------------------------------------------
3093 
3094  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Energy_CreateANNTree() === is done."<<endl;
3095  return;
3096 }
ParaSet Branch("CUT_BACK_DMIN",&cut_back_dmin,"CUT_BACK_DMIN/D")
Double_t inANN[70]
Definition: EdbShowerRec.h:155
TTree * ANNInterimTreeInputvariables
Definition: EdbShowerRec.h:154
TMultiLayerPerceptron * eEANN()
TObjArray * eEnergyANN
Definition: EdbShowerRec.h:148

◆ Energy_CreateEnergyResolutionFitFunction()

void EdbShowerRec::Energy_CreateEnergyResolutionFitFunction ( )
2986 {
2987  //=C= -----------------will be deprecated soon-------------
2988  eEnergyResolutionFitFunction_All = new TF1("EnergyResolutionFitFunction_All","TMath::Sqrt([0]*[0]/sqrt(x)/sqrt(x)+[2]*[2]+[1]*[1]/x/x)",0.9,48.0);
2989  eEnergyResolutionFitFunction_All->SetParameter(0,0.5); //Initialize with A=50%
2990  eEnergyResolutionFitFunction_All->SetParameter(1,0.2); //Initialize with B=20%
2991  eEnergyResolutionFitFunction_All->SetParameter(2,0.1); //Initialize with C=10%
2992  eEnergyResolutionFitFunction_All->SetParName(0,"ResolutionFactor A");
2993  eEnergyResolutionFitFunction_All->SetParName(1,"ResolutionFactor B");
2994  eEnergyResolutionFitFunction_All->SetParName(2,"ResolutionFactor C");
2995  eEnergyResolutionFitFunction_All->SetLineColor(2);
2996  eEnergyResolutionFitFunction_All->SetParLimits(0,0,2);
2997  eEnergyResolutionFitFunction_All->SetParLimits(1,0,2);
2998  eEnergyResolutionFitFunction_All->SetParLimits(2,0,2);
2999 
3000  return;
3001 }

◆ Energy_ExtractShowerParametrisationProfile()

void EdbShowerRec::Energy_ExtractShowerParametrisationProfile ( )

DEBUG --------------------------------—

DEBUG --------------------------------—

DEBUG OPTION

DEBUG OPTION

DEBUG OPTION

DEBUG OPTION

DEBUG OPTION

2509 {
2510  if (gEDBDEBUGLEVEL>2) cout << "------------------------------------------------------"<<endl;
2511  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile()"<<endl;
2512  if (gEDBDEBUGLEVEL>2) cout << "------------------------------------------------------"<<endl;
2513  //ouput file
2514  fileout3 = new TFile("Shower.root","RECREATE");
2515  treesaveb3 = new TTree("treebranch","tree of branchtrack");
2516  treesaveb3->Branch("number_eventb",&number_eventb,"number_eventb/I");
2517  treesaveb3->Branch("sizeb",&sizeb,"sizeb/I");
2518  treesaveb3->Branch("sizeb15",&sizeb15,"sizeb15/I");
2519  treesaveb3->Branch("sizeb20",&sizeb20,"sizeb20/I");
2520  treesaveb3->Branch("sizeb30",&sizeb30,"sizeb30/I");
2521  treesaveb3->Branch("output15",&output15,"output15/F");
2522  treesaveb3->Branch("output20",&output20,"output20/F");
2523  treesaveb3->Branch("output30",&output30,"output30/F");
2524  treesaveb3->Branch("output50",&output50,"output50/F");
2525  treesaveb3->Branch("eProb90",&eProb90,"eProb90/I");
2526  treesaveb3->Branch("eProb1",&eProb1,"eProb1/I");
2527  treesaveb3->Branch("E_MC",&E_MC,"E_MC/F");
2528  treesaveb3->Branch("idb",idb,"idb[sizeb]/I");
2529  treesaveb3->Branch("plateb",plateb,"plateb[sizeb]/I");
2530  treesaveb3->Branch("showerID",&showerID,"showerID/I");
2531  treesaveb3->Branch("isizeb",&isizeb,"isizeb/I");
2532  treesaveb3->Branch("xb",xb,"xb[sizeb]/F");
2533  treesaveb3->Branch("yb",yb,"yb[sizeb]/F");
2534  treesaveb3->Branch("zb",zb,"zb[sizeb]/F");
2535  treesaveb3->Branch("txb",txb,"txb[sizeb]/F");
2536  treesaveb3->Branch("tyb",tyb,"tyb[sizeb]/F");
2537  treesaveb3->Branch("nfilmb",nfilmb,"nfilmb[sizeb]/I");
2538  treesaveb3->Branch("ntrace1simub",ntrace1simub,"ntrace1simu[sizeb]/I");
2539  treesaveb3->Branch("ntrace2simub",ntrace2simub,"ntrace2simu[sizeb]/I");
2540  treesaveb3->Branch("ntrace3simub",ntrace3simub,"ntrace3simu[sizeb]/F");
2541  treesaveb3->Branch("ntrace4simub",ntrace4simub,"ntrace4simu[sizeb]/I");
2542  treesaveb3->Branch("chi2btkb",chi2btkb,"chi2btkb[sizeb]/F");
2543  treesaveb3->Branch("deltarb",deltarb,"deltarb[sizeb]/F");
2544  treesaveb3->Branch("deltathetab",deltathetab,"deltathetab[sizeb]/F");
2545  treesaveb3->Branch("deltaxb",deltaxb,"deltaxb[sizeb]/F");
2546  treesaveb3->Branch("deltayb",deltayb,"deltayb[sizeb]/F");
2547  treesaveb3->Branch("purityb",&purityb,"purityb/F");
2548  treesaveb3->Branch("trackdensb",&trackdensb,"trackdensb/F");
2549  treesaveb3->Branch("tagprimary",tagprimary,"tagprimary[sizeb]/F");
2550 
2551  treesaveb3->Branch("mcDigitIndexTop",mcDigitIndexTop,"mcDigitIndexTop[sizeb]/I");
2552  treesaveb3->Branch("mcDigitIndexBottom",mcDigitIndexBottom,"mcDigitIndexBottom[sizeb]/I");
2553 
2554  treesaveb3->Branch("Energy",&EnergyCorrectedb,"EnergyCorrectedb/F");
2555  treesaveb3->Branch("EnergyUnCorrected",&EnergyUnCorrectedb,"EnergyUnCorrectedb/F");
2556  treesaveb3->Branch("EnergySigma",&EnergySigmaCorrectedb,"EnergySigmaCorrectedb/F");
2557  treesaveb3->Branch("EnergySigmaUnCorrected",&EnergySigmaUnCorrectedb,"EnergySigmaUnCorrectedb/F");
2558 
2559  // -------------------------------------------------------------
2560  // If no showerTree was created we have to load the ShowerTree
2561  // most probably from an already reconstructed file.
2562  // Float_t energy_shot_particle;
2564  // Get Treebranch:
2565  // Either from shower file (then it has to be casted) or from the
2566  // reconstruction, then its automatically there.
2567  if (!eShowerTreeIsDone) {
2568  treesaveb = (TTree*)(FileReconstructedShowerTree->Get("treebranch"));
2569  treesaveb->SetBranchAddress("nfilmb", nfilmb);
2570  treesaveb->SetBranchAddress("sizeb", &sizeb);
2571  treesaveb->SetBranchAddress("sizeb15", &sizeb15);
2572  treesaveb->SetBranchAddress("sizeb20", &sizeb20);
2573  treesaveb->SetBranchAddress("sizeb30", &sizeb30);
2574  treesaveb->SetBranchAddress("output15", &output15);
2575  treesaveb->SetBranchAddress("output20", &output20);
2576  treesaveb->SetBranchAddress("output30", &output30);
2577  treesaveb->SetBranchAddress("output50", &output50);
2578  treesaveb->SetBranchAddress("eProb1", &eProb1);
2579  treesaveb->SetBranchAddress("eProb90", &eProb90);
2580  treesaveb->SetBranchAddress("isizeb", &isizeb);
2581  treesaveb->SetBranchAddress("chi2btkb", &chi2btkb);
2582  treesaveb->SetBranchAddress("tagprimary", tagprimary);
2583  treesaveb->SetBranchAddress("txb", txb);
2584  treesaveb->SetBranchAddress("tyb", tyb);
2585  treesaveb->SetBranchAddress("xb", xb);
2586  treesaveb->SetBranchAddress("yb", yb);
2587  treesaveb->SetBranchAddress("zb", zb);
2588  treesaveb->SetBranchAddress("showerID", &showerID);
2589  treesaveb->SetBranchAddress("plateb", plateb);
2590  treesaveb->SetBranchAddress("idb", idb);
2591  treesaveb->SetBranchAddress("deltarb", deltarb);
2592  treesaveb->SetBranchAddress("deltathetab", deltathetab);
2593  treesaveb->SetBranchAddress("number_eventb", &number_eventb);
2594  treesaveb->SetBranchAddress("ntrace1simub", &ntrace1simub);
2595  treesaveb->SetBranchAddress("ntrace2simub", &ntrace2simub);
2596  treesaveb->SetBranchAddress("ntrace3simub", &ntrace3simub);
2597  treesaveb->SetBranchAddress("ntrace4simub", &ntrace4simub);
2598  treesaveb->SetBranchAddress("purityb", &purityb);
2599  treesaveb->SetBranchAddress("trackdensb", &trackdensb);
2600  treesaveb->SetBranchAddress("E_MC", &E_MC);
2601  treesaveb->SetBranchAddress("Energy", &EnergyCorrectedb);
2602  treesaveb->SetBranchAddress("EnergyUnCorrected", &EnergyUnCorrectedb);
2603  treesaveb->SetBranchAddress("EnergySigma", &EnergySigmaCorrectedb);
2604  treesaveb->SetBranchAddress("EnergySigmaUnCorrected", &EnergySigmaUnCorrectedb);
2605  }
2606  else {
2607  ; /* treesaveb already declared and filled. */
2608  }
2609  // -------------------------------------------------------------
2610 
2611 
2612  // Just local variables which are neeeded once for the shower parametrisation...
2613  Float_t Dr[57];
2614  Float_t X0[57];
2615  Float_t Y0[57];
2616  Float_t TX0=0. ,TY0=0.;
2617  Float_t theta[57];
2618  Float_t dist;
2619  Int_t nentries_e;
2620  Int_t nentries_withisizeb=0;
2621  Int_t NumberOfPlates;
2622  Int_t sizeb_for_plates;
2623  Float_t BT_deltaR_mean;
2624  Float_t BT_deltaR_rms;
2625  Float_t BT_deltaT_mean;
2626  Float_t BT_deltaT_rms;
2627  Int_t longprofile[57]; // Depens on how much sheets;
2628  Int_t numberofilms;
2629  Float_t EnergyMC;
2630  TString histname;
2631  TH1D *histo_nbtk;
2632  TH1D *histo_longprofile;
2633  TH1D* histo_deltaR;
2634  TH1D* histo_deltaT;
2635  // Just local variables which are neeeded once for the shower parametrisation...END
2636 
2637  //gEDBDEBUGLEVEL=3;
2638 
2639  // Create ShowerProfileTree ...
2640 
2641  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile(): Create ShowerProfileTree ..."<<endl;
2642  fileout3->cd();
2643  ShowerParametrisationTree = new TTree("ShowerProfileTree","ShowerProfileTree");
2644 
2645  ShowerParametrisationTree->Branch("sizeb_for_plates",&sizeb_for_plates,"sizeb_for_plates/I");
2646  ShowerParametrisationTree->Branch("BT_deltaR_mean",&BT_deltaR_mean,"BT_deltaR_mean/F");
2647  ShowerParametrisationTree->Branch("BT_deltaR_rms",&BT_deltaR_rms,"BT_deltaR_rms/F");
2648  ShowerParametrisationTree->Branch("BT_deltaT_mean",&BT_deltaT_mean,"BT_deltaT_mean/F");
2649  ShowerParametrisationTree->Branch("BT_deltaT_rms",&BT_deltaT_rms,"BT_deltaT_rms/F");
2650  ShowerParametrisationTree->Branch("longprofile",longprofile,"longprofile[58]/I");
2651  ShowerParametrisationTree->Branch("numberofilms",&numberofilms,"numberofilms/I");
2652  ShowerParametrisationTree->Branch("EnergyMC",&E_MC,"EnergyMC/F");
2653 
2654  ShowerParametrisationTree->Branch("Energy",&EnergyCorrectedb,"EnergyCorrectedb/F");
2655  ShowerParametrisationTree->Branch("EnergyUnCorrected",&EnergyUnCorrectedb,"EnergyUnCorrectedb/F");
2656  ShowerParametrisationTree->Branch("EnergySigma",&EnergySigmaCorrectedb,"EnergySigmaCorrectedb/F");
2657  ShowerParametrisationTree->Branch("EnergySigmaUnCorrected",&EnergySigmaUnCorrectedb,"EnergySigmaUnCorrectedb/F");
2658 
2659  //=C= -----------------------------------------------------
2660  histname="histo_nbtk_av";
2661  histo_nbtk_av = new TH1D(histname,"Avergage basetrack numbers",21,0.0,210.0);
2662  histname="histo_longprofile_av";
2663  histo_longprofile_av = new TH1D(histname,"Basetracks per emulsion number",56,0.0,56.0);
2664  histname="histo_deltaR_mean";
2665  histo_deltaR_mean = new TH1D(histname,"Mean #deltar of all BTs in one shower",61,0.0,61.0);
2666  histname="histo_deltaT_mean";
2667  histo_deltaT_mean = new TH1D(histname,"Mean #delta#theta of all BTs in one shower",50,0.0,0.05);
2668  histname="histo_deltaR_rms";
2669  histo_deltaR_rms = new TH1D(histname,"RMS #deltar of all BTs in one shower",61,0.0,61.0);
2670  histname="histo_deltaT_rms";
2671  histo_deltaT_rms = new TH1D(histname,"RMS #delta#theta of all BTs in one shower",50,0.0,0.025);
2672  //=C= These Histos are for each Shower Entrie filled new
2673  histname="histo_nbtk";
2674  histo_nbtk = new TH1D(histname,"Basetracks in the shower",250,0.0,250.0);
2675  histname="histo_longprofile";
2676  histo_longprofile = new TH1D(histname,"Basetracks per emulsion number",56,0.0,56.0);
2677  histname="histo_deltaR";
2678  histo_deltaR = new TH1D(histname,"Mean #deltar of all BTs in Shower",100,0.0,100.0);
2679  histname="histo_deltaT";
2680  histo_deltaT = new TH1D(histname,"Mean #delta#theta of all BTs in Shower",100,0.0,0.05);
2681  //=C= -----------------------------------------------------
2682  eHistEnergyNominal = new TH1F("eHistEnergyNominal","eHistEnergyNominal",100,0,20);
2683  eHistEnergyCorrectedb = new TH1F("eHistEnergyCorrectedb","eHistEnergyCorrectedb",100,0,20);
2684  eHistEnergyUnCorrectedb = new TH1F("eHistEnergyUnCorrectedb","eHistEnergyUnCorrectedb",100,0,20);
2685  //=C= -----------------------------------------------------
2686  histo_nbtk_av->Reset();
2687  histo_nbtk->Reset();
2688  histo_longprofile_av->Reset();
2689  histo_deltaR_mean->Reset();
2690  histo_deltaT_mean->Reset();
2691  histo_deltaR_rms->Reset();
2692  histo_deltaT_rms->Reset();
2693  //=C= -----------------------------------------------------
2694 
2695  //=C= Again Define some Variables used for calculating:
2696  nentries_e = (Int_t) treesaveb -> GetEntries();
2697  for (Int_t j = 0; j<57; ++j) {
2698  Dr[j] = 0.03*j*1273. +20.0;
2699  }
2700  Float_t zmax=0;
2701  Float_t zmin=0;
2702 
2703  //=C= -----------------------------------------------------
2704  Double_t params[70];
2705  Double_t val;
2706  Double_t val_corr;
2707  Double_t sigma_val_corr;
2708  Double_t sigma_val;
2709 
2710  Int_t NrOfANNInputNeurons[]= {11,16,21,26,31,36,41,46};
2711  for (Int_t i=0; i<8; ++i) NrOfANNInputNeurons[i]=NrOfANNInputNeurons[i]+1+4;
2712  //=C= -----------------------------------------------------
2713 
2714  cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile(): Loop over reconstructed showers (=" << nentries_e << " total)."<< endl;
2715  //=C= -----------------------------------------------------
2716  //=C= Loop over reconstructed Showers (Entries):
2717  for (Int_t ige = 0; ige < nentries_e; ++ige) {
2718 
2720  // if (ige>5&&ige<nentries_e-5) continue;
2721  // if (ige>900) continue;
2722  // if (ige<nentries_e-900) continue;
2724 
2725  if (ige%50==0) cout<<"=== Doing Entry "<< ige << endl;
2726  treesaveb->GetEntry(ige);
2727  if (gEDBDEBUGLEVEL>3) treesaveb->Show(ige);
2728 
2729  // GetEnergyMC:
2730  EnergyMC=E_MC;
2731  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === EnergyMC= "<< EnergyMC << endl;
2732 
2733  // Search for local zmax and zmin in the whole shower event to
2734  // guess from that the number of plates...
2735  zmax=0;
2736  zmin=0; // Reinit zmax, min;
2737  for (Int_t j=0; j<sizeb; ++j) {
2738  if (zb[j]>zmax) zmax=zb[j];
2739  if (zb[j]<zmin) zmin=zb[j];
2740  }
2741  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === zmax= "<< zmax << endl;
2742  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === zmin= "<< zmin << endl;
2743 
2744  // Calculate the plates.
2745  Int_t pl=int(zmax-zmin)/1273+1;
2746  NumberOfPlates=pl;
2747  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === pl= "<< pl << endl;
2748 
2749  // Make sure that its at least 1 or more...
2750  NumberOfPlates=max(NumberOfPlates,1);
2751  NumberOfPlates=min(NumberOfPlates,57);
2752  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === NumberOfPlates= "<< NumberOfPlates << endl;
2753 
2754 
2755  histo_longprofile ->Reset();
2756  histo_deltaR ->Reset();
2757  histo_deltaT ->Reset();
2758  for (int id=0; id<57; id++) {
2759  theta[id]= 0;
2760  X0[id] = id*1273.*txb[0] + xb[0];
2761  Y0[id] = id*1273.*tyb[0] + yb[0];
2762  longprofile[id]=-1;
2763  }
2764  if (tagprimary[0]==1) {
2765  TX0 = txb[0];
2766  TY0 = tyb[0];
2767  }
2768  ++nentries_withisizeb;
2769 
2770  sizeb_for_plates=0;
2771  numberofilms=NumberOfPlates;
2772  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === numberofilms= " << numberofilms <<endl;
2773 
2774  //=C= -----------------------------------------------------
2775  //=C= loop over the basetracks in the shower (boucle sur les btk)
2776  for (Int_t ibtke = 0; ibtke < sizeb; ibtke++) {
2777  dist = sqrt((xb[ibtke]- X0[nfilmb[ibtke]-1])*(xb[ibtke]- X0[nfilmb[ibtke]-1])+(yb[ibtke]- Y0[nfilmb[ibtke]-1])*(yb[ibtke]- Y0[nfilmb[ibtke]-1]));
2778  // inside the cone
2779  if (dist<Dr[nfilmb[ibtke]-1]&&nfilmb[ibtke]<=numberofilms) {
2780 
2781  histo_longprofile ->Fill(nfilmb[ibtke]);
2782  histo_longprofile_av ->Fill(nfilmb[ibtke]);
2783  theta[nfilmb[ibtke]]+= (TX0-txb[ibtke])*(TX0-txb[ibtke])+(TY0-tyb[ibtke])*(TY0-tyb[ibtke]);
2784 
2785  if (nfilmb[ibtke]<=numberofilms) {
2786  ++sizeb_for_plates;
2787  }
2788  if (ibtke>0&&nfilmb[ibtke]<=numberofilms) {
2789  histo_deltaR ->Fill(deltarb[ibtke]);
2790  histo_deltaT ->Fill(deltathetab[ibtke]);
2791  }
2792  }
2793  }//=C= END OF loop over the basetracks in the shower
2794  //=C= -----------------------------------------------------
2795 
2796  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === ige sizeb_for_plates sizeb" << ige << " " << sizeb_for_plates <<" " << sizeb << endl;
2797  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === histo_deltaR->GetMean() histo_deltaT->GetMean()" << histo_deltaR->GetMean() << " " << histo_deltaT->GetMean() <<" " << endl;
2798  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === histo_deltaR->GetRMS() histo_deltaT->GetRMS()" << histo_deltaR->GetRMS() << " " << histo_deltaT->GetRMS() <<" " << endl;
2799 
2800  //=C= Fill NumberBT Hist----Just temporary....for all showers:
2801  histo_nbtk ->Fill(sizeb_for_plates);
2802  histo_nbtk_av ->Fill(sizeb_for_plates);
2803  //=C= Fill dR,dT Mean and RMS Histos for all showers:
2804  histo_deltaR_mean ->Fill(histo_deltaR->GetMean());
2805  histo_deltaT_mean ->Fill(histo_deltaT->GetMean());
2806  histo_deltaR_rms ->Fill(histo_deltaR->GetRMS());
2807  histo_deltaT_rms ->Fill(histo_deltaT->GetRMS());
2808 
2809  //=C= -----------------------------------------------------
2810  // "Variable" 0 describes the (MonteCarlo) energy of the particle
2811  // energy_shot_particle; (if there)
2812  // Variable 1 corresponds to number of Basetracks in the Shower.
2813  // sizeb;
2814  // Variable 2,3,4,5 corresponds to dR, mean,rms; dT, mean,rms;
2815  BT_deltaR_mean=histo_deltaR->GetMean();
2816  BT_deltaR_rms=histo_deltaR->GetRMS();
2817  BT_deltaT_mean=histo_deltaT->GetMean();
2818  BT_deltaT_rms=histo_deltaT->GetRMS();
2819  // Variables longprofile[...] corresponds to BinEntries Of the longitudialProfile (averaged):
2820  // Take Care!! BinContent(0) is the UnderflowBin! so it has to go from 0 (plate1) to nbfilm+1 (f.e.plate11->nbfilm+1=12) !
2821  for (Int_t i=1; i<=numberofilms+1; ++i) {
2822  longprofile[i-1] = int(histo_longprofile->GetBinContent(i));
2823  }
2824  //=C= -----------------------------------------------------
2825 
2826 
2827  //=C= -----------------------------------------------------
2828  //=C= --- Here we differentiate which Platetype we have.
2829  //=C= --- Can be for each Shower different!
2830  Int_t type=0;
2831  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === NumberOfPlates " << NumberOfPlates << endl;
2832  if (NumberOfPlates<16) {
2833  type=0;
2834  }
2835  if (NumberOfPlates>=16 && NumberOfPlates<21) {
2836  type=1;
2837  }
2838  if (NumberOfPlates>=21 && NumberOfPlates<26) {
2839  type=2;
2840  }
2841  if (NumberOfPlates>=26 && NumberOfPlates<31) {
2842  type=3;
2843  }
2844  if (NumberOfPlates>=31 && NumberOfPlates<36) {
2845  type=4;
2846  }
2847  if (NumberOfPlates>=36 && NumberOfPlates<41) {
2848  type=5;
2849  }
2850  if (NumberOfPlates>=41 && NumberOfPlates<46) {
2851  type=6;
2852  }
2853  if (NumberOfPlates>=46) {
2854  type=7;
2855  }
2856  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === Type " << type << endl;
2857  //=C= -----------------------------------------------------
2858 
2859 
2860  //=C= -----------------------------------------------------
2861  //=C= Fill the ANN Inputvariables
2862  //=C= For the specific Sample
2863  //=C= -----------------------------------------------------
2864  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === " << ige;
2865  if (gEDBDEBUGLEVEL>2) cout << " type= " << type << endl;
2866  // Reset All inANN Values to Zero:
2867  for (Int_t j=0; j<70; j++) {
2868  inANN[j]=0;
2869  }
2870 
2871  // Variable 0 corresponds to the "type" i.e. to the Energy of the Shower.
2872  inANN[0]= EnergyMC;
2873  // Variable 1 corresponds to number of Basetracks in the Shower.
2874  inANN[1]= sizeb_for_plates;
2875  // Variable 2,3,4,5 corresponds to dR, mean,rms; dT, mean,rms;
2876  inANN[2]= BT_deltaR_mean;
2877  inANN[3]= BT_deltaR_rms;
2878  inANN[4]= BT_deltaT_mean;
2879  inANN[5]= BT_deltaT_rms;
2880  // Variable 6... (end) to the longitudinale profile...
2881  for (Int_t j=0; j<numberofilms; j++) inANN[6+j]=longprofile[j+1];
2882  //=C= -----------------------------------------------------
2883 
2884 
2885  //---------------Parameters as param array suited for ANN to evaluate: ---------------
2886  // Reset All Values to Zero:
2887  for (Int_t j=0; j<70; j++) {
2888  params[j]=0;
2889  }
2890  //=C= NeuralNetworkLayout: check to which layout this specific shower belongs:
2891  for (Int_t j=1; j<=NrOfANNInputNeurons[type]; ++j) {
2892  params[j-1]=inANN[j];
2893  if (gEDBDEBUGLEVEL>3) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === j params[j-1]=inANN[j] " << j<< " " << params[j-1] << " " << inANN[j] << endl;
2894  }
2895 
2896 
2897  //--- Main Core Part: Evaluate function of Neural Network, specific to the
2898  //--- ANN which is usefull for the shower length!
2899  //------------------------------------------
2900  TMultiLayerPerceptron* mlp= (TMultiLayerPerceptron*)eEnergyANN->At(type);
2901  val=mlp->Evaluate(0,params);
2902  val_corr=Energy_CorrectEnergy(val, type);
2903  //------------------------------------------
2904  sigma_val=Energy_CalcSigma(val, type);
2905  sigma_val_corr=Energy_CalcSigma(val_corr, type);
2906  //------------------------------------------
2907 
2908  //------------------------------------------
2909  EnergyCorrectedb=val_corr;
2910  EnergyUnCorrectedb=val;
2911  EnergySigmaCorrectedb=sigma_val_corr;
2912  EnergySigmaUnCorrectedb=sigma_val;
2913  EnergyMC=E_MC;
2914  //------------------------------------------
2915 
2916  if (gEDBDEBUGLEVEL>3) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === " << mlp->GetStructure().Data() <<endl;
2917  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === EnergyUnCorrectedb, EnergyCorrectedb,EnergyMC: " << EnergyUnCorrectedb << " == " << EnergyCorrectedb << " " << EnergyMC << endl;
2918  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::Energy_ExtractShowerParametrisationProfile() === EnergySigmaCorrectedb, EnergySigmaUnCorrectedb: " << EnergySigmaUnCorrectedb << " == " << EnergySigmaCorrectedb << " " << endl;
2919 
2920  eHistEnergyUnCorrectedb->Fill(val);
2921  eHistEnergyCorrectedb->Fill(val_corr);
2922  eHistEnergyNominal->Fill( inANN[0]/1000. );
2923 
2924  ShowerParametrisationTree->Fill();
2925  treesaveb3->Fill();
2926  //--------------------------------------------------------------------
2927  } //=C= END of Loop over reconstructed Showers (Entries):
2928  cout << "Loop over reconstructed Showers finished."<< endl;
2929 
2930  // Scale histo_longprofile_av to number of entries:
2931  histo_longprofile_av->Scale(1.0/nentries_withisizeb);
2932 
2933  // Write to File:
2934  fileout3->cd();
2935  treesaveb3->Write();
2936  fileout3->Close();
2937 
2938  eEnergyIsDone=kTRUE;
2939  return;
2940 }
cout<< tr-> GetEntries()<< endl
float min(TClonesArray *t)
Definition: bitview.cxx:275
int max
Definition: check_shower.C:41
Int_t ntrace2simub[10000]
Definition: EdbShowerRec.h:195
Float_t tagprimary[10000]
Definition: EdbShowerRec.h:203
Float_t ntrace3simub[10000]
Definition: EdbShowerRec.h:196
Int_t sizeb30
Definition: EdbShowerRec.h:174
Int_t ntrace4simub[10000]
Definition: EdbShowerRec.h:197
Float_t yb[10000]
Definition: EdbShowerRec.h:188
Float_t output30
Definition: EdbShowerRec.h:177
Int_t sizeb15
Definition: EdbShowerRec.h:172
Float_t Energy_CalcSigma(Float_t Energy, Int_t NPlatesNr)
Definition: EdbShowerRec.cxx:3005
TH1D * histo_nbtk_av
Definition: EdbShowerRec.h:583
Int_t showerID
Definition: EdbShowerRec.h:184
Float_t xb[10000]
Definition: EdbShowerRec.h:187
TH1D * histo_deltaT_rms
Definition: EdbShowerRec.h:588
Float_t output50
Definition: EdbShowerRec.h:178
Int_t eProb1
Definition: EdbShowerRec.h:216
Float_t chi2btkb[10000]
Definition: EdbShowerRec.h:198
Bool_t eShowerTreeIsDone
Definition: EdbShowerRec.h:143
Int_t eProb90
Definition: EdbShowerRec.h:215
Int_t mcDigitIndexBottom[1000]
Definition: EdbShowerRec.h:205
Int_t number_eventb
Definition: EdbShowerRec.h:171
Float_t purityb
Definition: EdbShowerRec.h:212
void LoadShowerFile(TString ShowerFileName)
Definition: EdbShowerRec.cxx:2489
TFile * fileout3
Definition: EdbShowerRec.h:225
Int_t sizeb20
Definition: EdbShowerRec.h:173
TH1F * eHistEnergyCorrectedb
Definition: EdbShowerRec.h:138
Float_t output15
Definition: EdbShowerRec.h:175
Int_t isizeb
Definition: EdbShowerRec.h:183
TH1D * histo_longprofile_av
Definition: EdbShowerRec.h:584
Float_t Energy_CorrectEnergy(Float_t MeasuredEnergy, Int_t NPlatesNr)
Definition: EdbShowerRec.cxx:2946
Int_t mcDigitIndexTop[1000]
Definition: EdbShowerRec.h:204
Float_t output20
Definition: EdbShowerRec.h:176
Float_t deltathetab[10000]
Definition: EdbShowerRec.h:200
Bool_t eEnergyIsDone
Definition: EdbShowerRec.h:145
TTree * treesaveb3
Definition: EdbShowerRec.h:226
Float_t EnergyUnCorrectedb
Definition: EdbShowerRec.h:208
Float_t deltarb[10000]
Definition: EdbShowerRec.h:199
Int_t ntrace1simub[10000]
Definition: EdbShowerRec.h:194
Int_t idb[10000]
Definition: EdbShowerRec.h:185
TH1F * eHistEnergyNominal
Definition: EdbShowerRec.h:137
Int_t nfilmb[10000]
Definition: EdbShowerRec.h:192
Float_t EnergySigmaCorrectedb
Definition: EdbShowerRec.h:209
Int_t sizeb
Definition: EdbShowerRec.h:182
Float_t txb[10000]
Definition: EdbShowerRec.h:190
Float_t deltayb[10000]
Definition: EdbShowerRec.h:202
Float_t zb[10000]
Definition: EdbShowerRec.h:189
Float_t EnergySigmaUnCorrectedb
Definition: EdbShowerRec.h:210
TH1D * histo_deltaR_mean
Definition: EdbShowerRec.h:585
Float_t E_MC
Definition: EdbShowerRec.h:179
TFile * FileReconstructedShowerTree
Definition: EdbShowerRec.h:229
TH1D * histo_deltaT_mean
Definition: EdbShowerRec.h:586
Float_t EnergyCorrectedb
Definition: EdbShowerRec.h:207
TTree * ShowerParametrisationTree
Definition: EdbShowerRec.h:231
TTree * treesaveb
Definition: EdbShowerRec.h:219
TH1D * histo_deltaR_rms
Definition: EdbShowerRec.h:587
Float_t tyb[10000]
Definition: EdbShowerRec.h:191
Float_t deltaxb[10000]
Definition: EdbShowerRec.h:201
TH1F * eHistEnergyUnCorrectedb
Definition: EdbShowerRec.h:139
Int_t plateb[10000]
Definition: EdbShowerRec.h:186
float X0
Definition: emthickness.cpp:69
float Y0
Definition: emthickness.cpp:70
UInt_t id
Definition: tlg2pattern.C:118
TMultiLayerPerceptron * mlp
Definition: testBGReduction_By_ANN.C:61
Double_t params[3]
Definition: testBGReduction_By_ANN.C:84

◆ Execute()

void EdbShowerRec::Execute ( )

CALCULATE NEWACTUALPID NUMBER BY GETPATTERNSUCCEDING:

======================== WRITE TO FILE..... ====================================================== ======================== TEMPORARY SOLUTION TO ACCES FUNCTION NEURALNET AND ENERGY .....========== ======================== Transfer ..... ======================================================

3936 {
3937  cout << "EdbShowerRec::Execute()" << endl;
3938  cout << "EdbShowerRec::Execute DOING MAIN SHOWER RECONSTRUCTION HERE" << endl;
3939  cout << "EdbShowerRec::Execute USE Standard CONETUBE ALGO with Standard Parameters." << endl;
3940 
3941  // Check if the eRecoShowerArray exists, if not create it;
3942  if (!eRecoShowerArray) eRecoShowerArray=new TObjArray();
3943  //cout << "eRecoShowerArray->GetEntries() " << eRecoShowerArray->GetEntries() << endl;
3944 
3945  // Check the use of eAliSub or not:
3947 
3948 
3949  EdbSegP* InBT;
3950  EdbSegP* Segment;
3951  EdbTrackP* RecoShower;
3952 
3953  Bool_t StillToLoop=kTRUE;
3954  Int_t ActualPID;
3955  Int_t newActualPID;
3956  Int_t STEP=-1;
3957  Int_t NLoopedPattern=0;
3958 
3959  Int_t eLastPlate_eAliPID=0;
3960  Int_t eFirstPlate_eAliPID=0;
3961  Float_t eLastPlate_eAliPIDZ=0;
3962  Float_t eFirstPlate_eAliPIDZ=0;
3963 
3964  // Already defined as private variable:
3965  eAliNpatM1=eAliNpat-1;
3967  if (gEDBDEBUGLEVEL>2) {
3968  cout << " eAliNpat = " << eAliNpat << endl;
3969  }
3970 
3971 
3972  // "First Plate" means always the one most upstream, i.e. the lowest Z position
3973  // "Last Plate" means always the one most downstream, i.e. the highest Z position
3974  if (eAli->GetPattern(0)->Z() > eAli->GetPattern(eAliNpatM1)->Z()) {
3975  eLastPlate_eAliPID=eAli->GetPattern(0)->PID();
3976  eFirstPlate_eAliPID=eAli->GetPattern(eAliNpatM1)->PID();
3977  eLastPlate_eAliPIDZ=eAli->GetPattern(0)->Z();
3978  eFirstPlate_eAliPIDZ=eAli->GetPattern(eAliNpatM1)->Z();
3979  }
3980  else {
3981  eLastPlate_eAliPID=eAli->GetPattern(eAliNpatM1)->PID();
3982  eFirstPlate_eAliPID=eAli->GetPattern(0)->PID();
3983  eLastPlate_eAliPIDZ=eAli->GetPattern(eAliNpatM1)->Z();
3984  eFirstPlate_eAliPIDZ=eAli->GetPattern(0)->Z();
3985  }
3986 
3987  if (gEDBDEBUGLEVEL>1) {
3988  cout << "EdbShowerRec::Execute() eAli->GetPattern(0)->Z() > eAli->GetPattern(eAliNpatM1)->Z() " << eAli->GetPattern(0)->Z()<< " " << eAli->GetPattern(eAliNpatM1)->Z() << endl;
3989  cout << "EdbShowerRec::Execute() eLastPlate_eAliPID = " << eLastPlate_eAliPID << endl;
3990  cout << "EdbShowerRec::Execute() eFirstPlate_eAliPID = " << eFirstPlate_eAliPID << endl;
3991  cout << "EdbShowerRec::Execute() eLastPlate_eAliPIDZ = " << eLastPlate_eAliPIDZ << endl;
3992  cout << "EdbShowerRec::Execute() eFirstPlate_eAliPIDZ = " << eFirstPlate_eAliPIDZ << endl;
3993  cout << endl;
3994  }
3995 // DEBUG!!!!
3996 
3997  if (eFirstPlate_eAliPID<eLastPlate_eAliPID) STEP=-1;
3998  if (eFirstPlate_eAliPID>eLastPlate_eAliPID) STEP=1;
3999  if (gEDBDEBUGLEVEL>1) cout << "EdbShowerRec::Execute STEP for patternloop direction = " << STEP << endl;
4000 
4001  //--- Loop over InBTs:
4002  if (gEDBDEBUGLEVEL>1) {
4003  cout << "EdbShowerRec::Execute Loop over InBTs:" << endl;
4004  cout << "EdbShowerRec::Execute ("<< eInBTArrayN << "):" << endl;
4005  }
4006 
4007 
4008 
4009  // Since eInBTArray is usually filled in ascending ordering by zpositon
4010  // We use the descending loop to begin with BT with lowest z first.
4011  for (Int_t i=eInBTArrayN-1; i>=0; --i) {
4012 // for (Int_t i=eInBTArrayN-1; i==eInBTArrayN-1; --i) {
4013 
4014  // CounterOutPut
4015  if (gEDBDEBUGLEVEL==2) if ((i%1)==0) cout << eInBTArrayN <<" InBT in total, still to do:"<<Form("%4d",i)<< "\r\r\r\r"<<flush;
4016  if (gEDBDEBUGLEVEL==3) cout << eInBTArrayN <<" InBT in total, still to do:"<< i << endl;
4017 
4018  //-----------------------------------
4019  // 1) Make local_gAli with cut parameters:
4020  //-----------------------------------
4021 
4022  // Create new Shower Object for storage;
4023  // For the moment this is treated as an "EdbTrackP" object...
4024  RecoShower = new EdbTrackP(*(EdbSegP*)eInBTArray->At(i));
4025 
4026  // Get InitiatorBT from eInBTArray
4027  InBT=(EdbSegP*)eInBTArray->At(i);
4028  if (gEDBDEBUGLEVEL>2) {
4029  cout << " " << endl;
4030  cout << "EdbShowerRec::Execute() Start reconstruction for Initiator BaseTrack:" << endl;
4031  InBT->PrintNice();
4032  }
4033 
4034  // Add InBT to RecoShower:
4035  // This has to be done, since by definition the first BT in the RecoShower is the InBT.
4036  // Otherwise, also the definition of shower axis and transversal profiles is wrong!
4037  RecoShower -> AddSegment(InBT);
4038  // Attention: If you have a EdbTrackP object and you add a segment, then
4039  // you have to manually set Counters for N(), NPl(). It is not done auto.
4040  RecoShower -> SetCounters();
4041  //cout << "Segment (InBT) " << Segment << " was added to RecoShower." << endl;
4042 
4043  // Transform (make size smaller, extract only events having same MC) the eAli object:
4044  Transform_eAli(InBT);
4045  if (gEDBDEBUGLEVEL>3) eAli_Sub->Print();
4046  Int_t npat_int=0;
4047  Int_t npat_total=0;
4048  Int_t npatN=0;
4049  // Get greatest Z Value:
4050  Double_t greatestZValueofeAliSub=TMath::Max(eAli_Sub->GetPattern(0)->Z(),eAli_Sub->GetPattern(eAli_Sub->Npatterns()-1)->Z());
4051  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Execute--- --- greatest Z value of eAliSub= " << greatestZValueofeAliSub << endl;
4052 
4053 
4054  //-----------------------------------
4055  // 2) Loop over (whole) eAli, check BT for Cuts
4056  // eAli_Sub
4057  // We have to sort the Initiator PID and pattern PID,
4058  // since the sample of Bari has shown that these two PIDs maybe
4059  // not necessaryly be the same!!!
4060  //-----------------------------------
4061 
4062 
4063  EdbPattern* patternActualPID = eAli_Sub->GetPatternByZ(InBT->Z());
4064  ActualPID = patternActualPID->PID();
4065  newActualPID = ActualPID ;
4066  //InBT->PrintNice();
4067  //cout << endl;
4068 
4069  while (StillToLoop) {
4070  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Execute--- --- Doing patterloop for PID: " << ActualPID << ", for patterns Z position: " << eAli_Sub->GetPatternByPID(ActualPID)->Z() << endl;
4071 
4072  patternActualPID = eAli_Sub->GetPatternByPID(ActualPID);
4073 
4074  // This reco Alg we take only BTs that come downstream the InBT:
4075  // (should now never hapen anymore).
4076  if (patternActualPID->Z() < InBT->Z() ) {
4077  cout << "WARNING : patternActualPID->Z() < InBT->Z() " << endl;
4078  continue;
4079  }
4080 
4081  for (Int_t btloop_cnt=0; btloop_cnt<patternActualPID->GetN(); ++btloop_cnt) {
4082 
4083  Segment = (EdbSegP*)patternActualPID->GetSegment(btloop_cnt);
4084 
4085  if (gEDBDEBUGLEVEL>4) {
4086  cout << "Checking Segment " << btloop_cnt << endl;
4087  Segment->PrintNice();
4088  }
4089 
4090 
4091  // Now apply cut conditions: Cut for Quality: --------------------
4092  if ( (eUseQualityPar==kTRUE) && (Segment->Chi2()>Segment->W()*eQualityPar[0]-eQualityPar[1]) ) {
4093  continue;
4094  }
4095 
4096 
4097  // Now apply cut conditions: OI OfficialImplementation Alg --------------------
4098  if ( !IsInConeTube(Segment, InBT, eAlgoParameterConeRadius , eAlgoParameterConeAngle) ) continue;
4099  //cout << "Segment " << Segment << " passed IsInConeTube"<<endl;
4100  if ( !FindPrecedingBTs(Segment, InBT, eAli_Sub, RecoShower)) continue;
4101  if (gEDBDEBUGLEVEL>4) cout << "Segment " << Segment << " passed FindPrecedingBTs"<<endl;
4102  // end of cut conditions: OI OfficialImplementation Alg --------------------
4103 
4104  // If we arrive here, Basetrack Segment has passed criteria
4105  // and is then added to the RecoShower:
4106  // Check if its not the InBT which is already added:
4107  if (Segment->X()==InBT->X()&&Segment->Y()==InBT->Y()) {
4108  ; // is InBT, do nothing;
4109  }
4110  else {
4111  RecoShower -> AddSegment(Segment);
4112  // Attention: If you have a EdbTrackP object and you add a segment, then
4113  // you have to manually set Counters for N(), NPl(). It is not done auto.
4114  RecoShower -> SetCounters();
4115  }
4116  if (gEDBDEBUGLEVEL>4) cout << "Segment " << Segment << " was added at &Segment : " << &Segment << endl;
4117 
4118  } // of btloop_cnt
4119 
4120 
4121  if (gEDBDEBUGLEVEL>2) {
4122  cout << "EdbShowerRec::Execute--- --- ActualPID= " << ActualPID << " done. Reconstructed shower has up to now: " << RecoShower->N() << " Segments." << endl;
4123  cout << "EdbShowerRec::Execute--- --- NLoopedPattern = " << NLoopedPattern << " until now. " << endl;
4124  }
4125 
4126 
4127  // Calc BT density around shower:
4128  EdbPattern* pat_interim = patternActualPID;
4129  CalcTrackDensity(pat_interim,eAli_Sub_halfsize,npat_int,npat_total,npatN);
4130 
4131  //------------
4133  EdbPattern* pat_ActualSucceeding;
4134  pat_ActualSucceeding = eAli_Sub->GetPatternSucceding( patternActualPID ) ;
4135 
4136 
4137  if (pat_ActualSucceeding!=NULL) {
4138 
4139  // Set New Values:
4140  newActualPID = pat_ActualSucceeding->PID();
4141  ++NLoopedPattern;
4142 
4143  //cout <<"patternActualPID : at,PID,Z " << patternActualPID << " " << patternActualPID->PID() << " " << patternActualPID->Z() << endl;
4144  //cout <<"pat_ActualSucceeding: at,PID,Z " << pat_ActualSucceeding << " " << pat_ActualSucceeding->PID() << " " << pat_ActualSucceeding->Z() << endl;
4145  }
4146 
4147 
4148  // DAU user solution for stopping the loop:
4149  if (pat_ActualSucceeding==NULL) {
4150  StillToLoop=kFALSE;
4151  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Execute--- ---Stopp Loop since: pat_ActualSucceeding==NULL"<<endl;
4152  }
4153 
4154  if (gEDBDEBUGLEVEL>3) {
4155  cout << "EdbShowerRec::Execute--- --- StillToLoop= " << StillToLoop << endl;
4156  cout << "EdbShowerRec::Execute--- ---ActualPID= " << ActualPID <<" Finished. Take newActualPID = " << newActualPID << " now. (this is end of while (StillToLoop) ) " << endl;
4157  }
4158 
4159  ActualPID=newActualPID;
4160  //cout << endl << endl;
4161  } // of // while (StillToLoop)
4162 
4163 
4164  if (gEDBDEBUGLEVEL>2) cout << "Finshed __while (StillToLoop)__ . Now Adding reconstructed shower to the array (only in case it has two or more Basetracks) of reconstructed showers ..." << endl;
4165  if (gEDBDEBUGLEVEL>2) cout << "Shower Has ..." << RecoShower->N() << " basetracks in it." << endl;
4166 
4167  // Add Shower Object to Shower Reco Array.
4168  // Not, if its empty or containing only one BT:
4169  if (RecoShower->N()>1) eRecoShowerArray->Add(RecoShower);
4170  // cout << "DEBUG_TEST eRecoShowerArray->Add(RecoShower);" << endl;
4171  // cout << "is eRecoShowerArray existing anyway??? " << eRecoShowerArray << endl;
4172 
4173  // Set back loop values:
4174  StillToLoop=kTRUE;
4175  NLoopedPattern=0;
4176 
4177  } // of // for (Int_t i=eInBTArrayN-1; i>=0; --i) {
4178 
4179 
4180  // Set new value for eRecoShowerArrayN (may now be < eInBTArrayN).
4181  SetRecoShowerArrayN(eRecoShowerArray->GetEntries());
4182 
4183  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::eRecoShowerArray() Entries: " << eRecoShowerArray->GetEntries() << endl;
4184  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Execute()...done." << endl;
4185 
4187 
4188 
4193  NeuralNet();
4195 
4196 
4197 
4198  cout << "======================== " << eQualityPar[0] << endl;
4199  cout << "======================== " << eQualityPar[1] << endl;
4200  return;
4201 }
EdbPattern * GetPatternByPID(int pid)
Definition: EdbPVRec.cxx:2898
Definition: EdbPattern.h:280
int PID() const
Definition: EdbPattern.h:329
Int_t Npatterns() const
Definition: EdbPattern.h:380
EdbPattern * GetPatternByZ(float z, float tolerance=5) const
Definition: EdbPattern.cxx:2065
void Print() const
Definition: EdbPattern.cxx:1853
EdbPattern * GetPattern(int id) const
Definition: EdbPattern.cxx:1887
EdbPattern * GetPatternSucceding(EdbPattern *pat) const
Definition: EdbPattern.cxx:2011
void PrintNice() const
Definition: EdbSegP.cxx:418
Float_t Z() const
Definition: EdbPattern.h:87
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66
Double_t eQualityPar[2]
Definition: EdbShowerRec.h:38
void CalculateEnergyValues()
Definition: EdbShowerRec.cxx:2448
Double_t eAlgoParameterConeRadius
Definition: EdbShowerRec.h:29
void Transform_eAli(EdbSegP *InitiatorBT, Float_t ExtractSize)
Definition: EdbShowerRec.cxx:3722
Float_t eAli_Sub_halfsize
Definition: EdbShowerRec.h:102
void CalcTrackDensity(EdbPattern *pat_interim, Int_t pat_interim_halfsize, Int_t &npat_int, Int_t &npat_total, Int_t &npatN)
Definition: EdbShowerRec.cxx:4856
EdbPVRec * eAli_Sub
Definition: EdbShowerRec.h:101
Bool_t IsInConeTube(EdbSegP *TestingSegment, EdbSegP *StartingSegment, Double_t CylinderRadius, Double_t ConeAngle)
Definition: EdbShowerRec.cxx:3534
void PrintRecoShowerArray()
Definition: EdbShowerRec.cxx:3475
Double_t eAlgoParameterConeAngle
Definition: EdbShowerRec.h:30
Bool_t eUseQualityPar
Definition: EdbShowerRec.h:39
void SetRecoShowerArrayN(Int_t RecoShowerArrayN)
Definition: EdbShowerRec.h:661
void NeuralNet()
Definition: EdbShowerRec.cxx:1918
void CheckEdbPVRecSetUseAliSub()
Definition: EdbShowerRec.cxx:3900
Int_t eAliNpat
Definition: EdbShowerRec.h:103
Bool_t FindPrecedingBTs(EdbSegP *s, EdbSegP *InBT, EdbPVRec *gAli, EdbTrackP *shower)
Definition: EdbShowerRec.cxx:4210
void TransferShowerObjectArrayIntoEntryOfTreebranchShowerTree(TObjArray *segarray)
Definition: EdbShowerRec.cxx:4283
Int_t eNumberPlate_eAliPID
Definition: EdbShowerRec.h:106
Int_t eAliNpatM1
Definition: EdbShowerRec.h:105
Definition: EdbPattern.h:118
Int_t N() const
Definition: EdbPattern.h:182

◆ Fill_eInBTArray_ByLinkTracks_eFilename_LinkedTracks()

void EdbShowerRec::Fill_eInBTArray_ByLinkTracks_eFilename_LinkedTracks ( )

3602 {
3603  // Fill the Initiator Basetrack Array by the linked_tracks file,
3604  // that is given in the eFilename_LinkedTracks String.
3605  // We check, if the file exists, and if there are tracks inside.
3606  // If so, we fill Initiator Basetrack Array with (a copy of ) these
3607  // tracks.
3608 
3609  Log(2,"EdbShowerRec::Fill_eInBTArray_ByLinkTracks_eFilename_LinkedTracks","EdbShowerRec::Fill_eInBTArray_ByLinkTracks_eFilename_LinkedTracks.");
3610 
3611  // -----------------
3612  // Check if file eFilename_LinkedTracks exits and if it has tracks inside....
3613  // ----------------- tODO
3614  cout << "EdbShowerRec::Fill_eInBTArray_ByLinkTracks_eFilename_LinkedTracks() TODO::CHECK IF " << eFilename_LinkedTracks <<" exists and if it has tracks inside!!!!" << endl;
3616 
3617  EdbSegP* segment=0;
3618  EdbSegP* s2=0;
3619  EdbTrackP* t=0;
3620 
3621  TFile * fil = new TFile(eFilename_LinkedTracks);
3622  fil->ls();
3623  TTree* tr= (TTree*)fil->Get("tracks");
3624  int nentr = 0;
3625  nentr =int(tr->GetEntries());
3626 
3627  // check if tracks has entries: if so then ok, otherwise return directly:
3628  if (nentr>0) {
3629  ;
3630  }
3631  else {
3632  cout << "EdbShowerRec::Fill_eInBTArray_ByLinkTracks_eFilename_LinkedTracks() tracks file has NO entries...Return." << endl;
3633  return;
3634  }
3635 
3636  TClonesArray *seg= new TClonesArray("EdbSegP",60);
3637 
3638  // check if eInBTArray was created, if not do it now.:
3639  if (!eInBTArray) eInBTArray=new TObjArray(nentr);
3640 
3641  int nseg,n0,npl;
3642  cout << nentr << " entries Total"<<endl;
3643  tr->SetBranchAddress("t." , &t );
3644  tr->SetBranchAddress("s" , &seg );
3645  tr->SetBranchAddress("nseg" , &nseg );
3646  tr->SetBranchAddress("n0" , &n0 );
3647  tr->SetBranchAddress("npl" , &npl );
3648 
3649  for (int i=0; i<nentr; i++ ) {
3650  tr->GetEntry(i);
3651 
3652  // Take first BT of the tracks:
3653  s2=(EdbSegP*) seg->At(0);
3654  // Clone it (otherwise it will be overtaken by the next one...)
3655  segment=(EdbSegP*)s2->Clone();
3656  // Add it to array
3657  eInBTArray->Add(segment);
3658  }
3659  delete tr;
3660  delete fil;
3661 
3662  // Update Entry numbers.
3663  SetInBTArrayN(eInBTArray->GetEntries());
3664 
3665  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Fill_eInBTArray_ByLinkTracks_eFilename_LinkedTracks Printing InBTs" << endl;
3666  EdbSegP* testseg=0;
3667  for (int i=0; i<eInBTArrayN; i++ ) {
3668  if (gEDBDEBUGLEVEL>2) {
3669  testseg=(EdbSegP*)eInBTArray->At(i);
3670  testseg->PrintNice();
3671  }
3672  }
3673 
3674  eInBTArrayIsFilled=kTRUE;
3675 
3676  Log(2,"EdbShowerRec::Fill_eInBTArray_ByBaseTracksOf_eAli","EdbShowerRec::Fill_eInBTArray_ByBaseTracksOf_eAli. After TCut: InBT N=%d", eInBTArrayN );
3677  Log(2,"EdbShowerRec::Fill_eInBTArray_ByLinkTracks_eFilename_LinkedTracks","EdbShowerRec::Fill_eInBTArray_ByLinkTracks_eFilename_LinkedTracks...done.");
3678  return;
3679 }
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
TTree * tr
Definition: Shower_E_FromShowerRoot.C:5
TTree * t
Definition: check_shower.C:4
void SetInBTArrayN(Int_t InBTArrayN)
Definition: EdbShowerRec.h:644
TString eFilename_LinkedTracks
Definition: EdbShowerRec.h:96

◆ FindPrecedingBTs()

Bool_t EdbShowerRec::FindPrecedingBTs ( EdbSegP s,
EdbSegP InBT,
EdbPVRec gAli,
EdbTrackP shower 
)
4211 {
4212  //cout << "EdbShowerRec::FindPrecedingBTs Find BTs to be connected with the Test BT:" << endl;
4213 
4214  EdbSegP* s_TestBT;
4215  Int_t nentries=shower->N();
4216  Double_t dZ;
4217 
4218  // In case the shower is empty we do not have to search for a preceeding BT:
4219  if (nentries==0) return kTRUE;
4220 
4221  // We do not test BaseTracks which are before the initiator BaseTrack!
4222  if (s->Z()<InBT->Z()) {
4223  cout << "--- --- EdbShowerRec::FindPrecedingBTs(): s->Z()<InBT->Z()..: We do not test BaseTracks which are before the initiator BaseTrack! return kFALSE;" << endl;
4224  return kFALSE;
4225  }
4226 
4227  // For the very first Z position we do not test
4228  // if testBT has Preceeders, only if it it has a BT around (case for e+e- coming from gammma):
4229  // Take 50microns and 80mrad in (dR/dT) around.
4230  // This does not affect the normal results, but helps for
4231  // events which may have a second BT close to InBT (like in e+e-)
4232  if (TMath::Abs(s->Z()-InBT->Z())<2.0) {
4233  //cout << "--- --- EdbShowerRec::FindPrecedingBTs(): s->Z()~InBT->Z()..: DeltaThetaComponentwise(s, InBT)= " << DeltaThetaComponentwise(s, InBT) << " << DeltaR_WithoutPropagation(s, InBT) = " << DeltaR_WithoutPropagation(s, InBT) << endl;
4234  if (DeltaThetaComponentwise(s, InBT) < 0.08 && DeltaR_WithoutPropagation(s, InBT) < 50.0 ) return kTRUE;
4235  }
4236 
4237  if (gEDBDEBUGLEVEL>3) cout << "--- --- EdbShowerRec::FindPrecedingBTs(): Testing " << nentries << " entries of the shower." << endl;
4238 
4239  for (Int_t i=nentries-1; i>=0; --i) {
4240  s_TestBT = (EdbSegP*)( shower->GetSegment(i) );
4241 
4242  if (gEDBDEBUGLEVEL>3) cout << "--- --- EdbShowerRec::FindPrecedingBTs(): Do s_TestBT->ID() s->ID() s_TestBT->MCEvt() s_TestBT->Z() s->Z() "<< s_TestBT->ID() << " " << s->ID() << " " << s_TestBT->MCEvt() <<" " << s_TestBT->Z() << " " << s->Z() <<endl;
4243  if (gEDBDEBUGLEVEL>3) s_TestBT->PrintNice();
4244  if (gEDBDEBUGLEVEL>3) s->PrintNice();
4245 
4246 
4247  dZ=TMath::Abs(s_TestBT->Z()-s->Z());
4248  if (dZ<30) continue; // Exclude the case of same Zpositions...
4249  if (dZ>(eAlgoParameterNPropagation*1273.0)+650.0) continue; // Exclude the case of more than eAlgoParameterNPropagation plates before...
4250 
4251  if (gEDBDEBUGLEVEL>3) cout << "--- --- EdbShowerRec::FindPrecedingBTs(): Checking dT,dR and dZ for i: " << i << " " << DeltaThetaComponentwise(s, s_TestBT) << " " << DeltaR_WithPropagation(s, s_TestBT) << " "<<dZ << endl;
4252 
4253  if (DeltaThetaComponentwise(s, s_TestBT) > eAlgoParameterConnectionDT ) continue;
4254  if (DeltaR_WithPropagation(s, s_TestBT) > eAlgoParameterConnectionDR ) continue;
4255 
4256  if (gEDBDEBUGLEVEL>3) cout << "--- --- EdbShowerRec::FindPrecedingBTs(): Checking dT,dR and dZ for i: " << i << " " << DeltaThetaComponentwise(s, s_TestBT) << " " << DeltaR_WithPropagation(s, s_TestBT) << " "<<dZ << " ok!"<<endl;
4257  return kTRUE;
4258  }
4259  //---------------------------------------------
4260  return kFALSE;
4261 }
Double_t DeltaR_WithPropagation(EdbSegP *s, EdbSegP *stest)
Definition: EdbShowerRec.cxx:3509
Int_t eAlgoParameterNPropagation
Definition: EdbShowerRec.h:35
Double_t eAlgoParameterConnectionDR
Definition: EdbShowerRec.h:32
Double_t eAlgoParameterConnectionDT
Definition: EdbShowerRec.h:33
Double_t DeltaR_WithoutPropagation(EdbSegP *s, EdbSegP *stest)
Definition: EdbShowerRec.cxx:3526
Double_t DeltaThetaComponentwise(EdbSegP *s1, EdbSegP *s2)
Definition: EdbShowerRec.cxx:3492
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:200

◆ GetAlgoParameter()

Double_t EdbShowerRec::GetAlgoParameter ( Int_t  paranr)
4831 {
4832  if (paranr==0) return eAlgoParameterConeRadius;
4833  else if (paranr==1) return eAlgoParameterConeAngle;
4834  else if (paranr==2) return eAlgoParameterConnectionDR;
4835  else if (paranr==3) return eAlgoParameterConnectionDT;
4836  else if (paranr==4) return eAlgoParameterNPropagation;
4837  else {
4838  return 0;
4839  }
4840 }

◆ GetAliLoaded()

Bool_t EdbShowerRec::GetAliLoaded ( ) const
inline
690  {
691  return eAliLoaded;
692  }
Bool_t eAliLoaded
Definition: EdbShowerRec.h:108

◆ GetChi20()

Float_t EdbShowerRec::GetChi20 ( ) const
inline
269  {
270  return eChi20;
271  }
Float_t eChi20
Definition: EdbShowerRec.h:50

◆ GetChi2b()

Float_t EdbShowerRec::GetChi2b ( int  i) const
inline
331  {
332  return eChi2b[i];
333  }
Float_t eChi2b[10000]
Definition: EdbShowerRec.h:67

◆ GetDeltarb()

Float_t EdbShowerRec::GetDeltarb ( int  i) const
inline
346  {
347  return eDeltarb[i];
348  }
Float_t eDeltarb[10000]
Definition: EdbShowerRec.h:72

◆ GetDeltathetab()

Float_t EdbShowerRec::GetDeltathetab ( int  i) const
inline
349  {
350  return eDeltathetab[i];
351  }
Float_t eDeltathetab[10000]
Definition: EdbShowerRec.h:73

◆ GetDz()

Float_t EdbShowerRec::GetDz ( ) const
inline
287  {
288  return eDz;
289  }
Float_t eDz
Definition: EdbShowerRec.h:57

◆ GetEdbPVRec()

EdbPVRec* EdbShowerRec::GetEdbPVRec ( ) const
inline
681  {
682  return eAli;
683  }

◆ GetEdbPVRecNpat()

Int_t EdbShowerRec::GetEdbPVRecNpat ( ) const
inline
684  {
685  return eAliNpat;
686  }

◆ GetEdbPVRecNplateNumber()

Int_t EdbShowerRec::GetEdbPVRecNplateNumber ( ) const
inline
687  {
688  return eNumberPlate_eAliPID;
689  }

◆ GetEdbPVRecNSeg()

Float_t EdbShowerRec::GetEdbPVRecNSeg ( EdbPVRec ali,
Int_t  mode 
)
3861 {
3862  // Return Number of Segments (=BTs) in the EdbPVRec volume.
3863  // The mode number is used as following:
3864  // mode = 0 : return ALL BTs.
3865  // mode = 1 : return BTs with s->MCEvt() > 0 (MC)
3866  // mode = 2 : return BTs with s->MCEvt() < 0 (DATA)
3867  // mode = 3 : return fraction nTotalMC/(nTotal);
3868 
3869  if (NULL==ali) return 0;
3870  Int_t nTotal=0;
3871  Int_t nTotalMC=0;
3872  Int_t nTotalDATA=0;
3873  Int_t npat=ali->Npatterns();
3874  for (Int_t ii=0; ii<npat; ++ii) {
3875  Int_t nseg=ali->GetPattern(ii)->N();
3876  nTotal+=nseg;
3877  for (Int_t jj=0; jj<nseg; ++jj) {
3878  EdbSegP* seg=ali->GetPattern(ii)->GetSegment(jj);
3879  if (seg->MCEvt()>0) ++nTotalMC;
3880  if (seg->MCEvt()<0) ++nTotalDATA;
3881  }
3882  }
3883  Float_t ratio=(Float_t)(nTotalMC)/(Float_t)(nTotal);
3884 // cout << "nTotalDATA basetracks in volume: " << nTotalDATA << endl;
3885 // cout << "nTotalMC basetracks in volume: " << nTotalMC << endl;
3886 // cout << "nTotal basetracks in volume: " << nTotal << endl;
3887 // cout << "ratio basetracks in volume: " << ratio << endl;
3888 
3889  if (mode == 1) return (Float_t)nTotalMC;
3890  if (mode == 2) return (Float_t)nTotalDATA;
3891  if (mode == 3) return ratio;
3892  return (Float_t)nTotal;
3893 
3894 }
Int_t npat
Definition: Xi2HatStartScript.C:33
EdbPVRec * ali
Definition: align.C:1
Int_t N() const
Definition: EdbPattern.h:89

◆ GetEdbPVRecSub()

EdbPVRec* EdbShowerRec::GetEdbPVRecSub ( ) const
inline
693  {
694  return eAli_Sub;
695  }

◆ GetEnergy()

Float_t EdbShowerRec::GetEnergy ( ) const
inline
370  {
371  return eEnergyCorrectedb;
372  }
Float_t eEnergyCorrectedb
Definition: EdbShowerRec.h:131

◆ GetEnergySigma()

Float_t EdbShowerRec::GetEnergySigma ( ) const
inline
376  {
377  return eEnergySigmaCorrectedb;
378  }
Float_t eEnergySigmaCorrectedb
Definition: EdbShowerRec.h:133

◆ GetEnergyUn()

Float_t EdbShowerRec::GetEnergyUn ( ) const
inline
373  {
374  return eEnergyUnCorrectedb;
375  }
Float_t eEnergyUnCorrectedb
Definition: EdbShowerRec.h:132

◆ GetEnergyUnSigma()

Float_t EdbShowerRec::GetEnergyUnSigma ( ) const
inline
379  {
381  }
Float_t eEnergySigmaUnCorrectedb
Definition: EdbShowerRec.h:134

◆ GetEnergyValues()

Float_t * EdbShowerRec::GetEnergyValues ( Int_t  TreeEntry)
3359 {
3360  Float_t* dummy = new Float_t[5];
3361  dummy[0]=-999.;
3362  dummy[1]=-999.;
3363  dummy[2]=-999.;
3364  dummy[3]=-999.;
3365  dummy[4]=-999.;
3366 
3367  cout << "eShowerTreeIsDone = " << eShowerTreeIsDone << endl;
3368 
3369  if (!eShowerTreeIsDone) {
3370  cout << "EdbShowerRec::GetEnergyValues !eShowerTreeIsDone" << endl;
3371  LoadShowerFile("Shower.root");
3372  }
3373  // Get Treebranch:
3374  // Either from shower file (then it has to be casted) or from the
3375  // reconstruction, then its automatically there.
3376  if (!eShowerTreeIsDone) {
3377  LoadShowerFile("Shower.root");
3378  treesaveb = (TTree*)(FileReconstructedShowerTree->Get("treebranch"));
3379  treesaveb->SetBranchAddress("sizeb", &sizeb);
3380  treesaveb->SetBranchAddress("E_MC", &E_MC);
3381  treesaveb->SetBranchAddress("Energy", &EnergyCorrectedb);
3382  treesaveb->SetBranchAddress("EnergyUnCorrected", &EnergyUnCorrectedb);
3383  treesaveb->SetBranchAddress("EnergySigma", &EnergySigmaCorrectedb);
3384  treesaveb->SetBranchAddress("EnergySigmaUnCorrected", &EnergySigmaUnCorrectedb);
3385  }
3386  else {
3387  cout << "EdbShowerRec::GetEnergyValues treesaveb already declared and filled"<<endl;
3388  /* treesaveb already declared and filled. */
3389  }
3390  cout << "EdbShowerRec::GetEnergyValues LoadShowerFile SetBranchAddress done" << endl;
3391 
3392  treesaveb->GetEntry(TreeEntry);
3393  if (gEDBDEBUGLEVEL>2) treesaveb->Show(TreeEntry);
3394 
3395  dummy[0]=E_MC;
3400 
3401  cout << "E_MC EnergyCorrectedb EnergyUnCorrectedb EnergySigmaCorrectedb EnergySigmaUnCorrectedb:" << endl;
3402  cout << " " << dummy[0] << " " << dummy[1] << " " << dummy[2] << " " << dummy[3] << " " << dummy[4] << " " << endl;
3403 
3404  return dummy;
3405 }
Int_t dummy
Definition: merge_Energy_SytematicSources_Electron.C:7

◆ GetFlag0()

Int_t EdbShowerRec::GetFlag0 ( ) const
inline
278  {
279  return eFlag0;
280  }
Int_t eFlag0
Definition: EdbShowerRec.h:53

◆ GetFlagb()

Int_t EdbShowerRec::GetFlagb ( int  i) const
inline
340  {
341  return eFlagb[i];
342  }
Int_t eFlagb[10000]
Definition: EdbShowerRec.h:70

◆ GetHistdeltaR_mean()

TH1D* EdbShowerRec::GetHistdeltaR_mean ( )
inline
597  {
598  return histo_deltaR_mean;
599  }

◆ GetHistdeltaR_rms()

TH1D* EdbShowerRec::GetHistdeltaR_rms ( )
inline
603  {
604  return histo_deltaR_rms;
605  }

◆ GetHistdeltaT_mean()

TH1D* EdbShowerRec::GetHistdeltaT_mean ( )
inline
600  {
601  return histo_deltaT_mean;
602  }

◆ GetHistdeltaT_rms()

TH1D* EdbShowerRec::GetHistdeltaT_rms ( )
inline
606  {
607  return histo_deltaT_rms;
608  }

◆ GetHistEnergyCorrectedb()

TH1F* EdbShowerRec::GetHistEnergyCorrectedb ( )
inline
569  {
570  return eHistEnergyCorrectedb;
571  }

◆ GetHistEnergyNominal()

TH1F* EdbShowerRec::GetHistEnergyNominal ( )
inline
566  {
567  return eHistEnergyNominal;
568  }

◆ GetHistEnergySigmaCorrectedb()

TH1F* EdbShowerRec::GetHistEnergySigmaCorrectedb ( )
inline
575  {
577  }
TH1F * eHistEnergySigmaCorrectedb
Definition: EdbShowerRec.h:140

◆ GetHistEnergySigmaUnCorrectedb()

TH1F* EdbShowerRec::GetHistEnergySigmaUnCorrectedb ( )
inline
578  {
580  }
TH1F * eHistEnergySigmaUnCorrectedb
Definition: EdbShowerRec.h:141

◆ GetHistEnergyUnCorrectedb()

TH1F* EdbShowerRec::GetHistEnergyUnCorrectedb ( )
inline
572  {
574  }

◆ GetHistLongProfile()

TH1D* EdbShowerRec::GetHistLongProfile ( )
inline
591  {
592  return histo_longprofile_av;
593  }

◆ GetHistNBaseTracks()

TH1D* EdbShowerRec::GetHistNBaseTracks ( )
inline
594  {
595  return histo_nbtk_av;
596  }

◆ GetID()

Int_t EdbShowerRec::GetID ( ) const
inline
257  {
258  return eID;
259  }
Int_t eID
Definition: EdbShowerRec.h:43

◆ GetIDb()

Int_t EdbShowerRec::GetIDb ( int  i) const
inline
312  {
313  return eIDb[i];
314  }
Int_t eIDb[10000]
Definition: EdbShowerRec.h:60

◆ GetInBT()

EdbSegP* EdbShowerRec::GetInBT ( Int_t  i) const
inline
701  {
702  return (EdbSegP*)eInBTArray->At(i);
703  }

◆ GetInBTArray()

TObjArray* EdbShowerRec::GetInBTArray ( ) const
inline
698  {
699  return eInBTArray;
700  }

◆ GetInBTArrayN()

Int_t EdbShowerRec::GetInBTArrayN ( ) const
inline
708  {
709  return eInBTArrayN;
710  }

◆ GetL()

Int_t EdbShowerRec::GetL ( ) const
inline
290  {
291  return eL;
292  }
Int_t eL
Definition: EdbShowerRec.h:58

◆ GetmcDigitIndexBottom()

Float_t EdbShowerRec::GetmcDigitIndexBottom ( int  i) const
inline
385  {
386  return emcDigitIndexBottom[i];
387  }
Int_t emcDigitIndexBottom[1000]
Definition: EdbShowerRec.h:76

◆ GetmcDigitIndexTop()

Float_t EdbShowerRec::GetmcDigitIndexTop ( int  i) const
inline
382  {
383  return emcDigitIndexTop[i];
384  }
Int_t emcDigitIndexTop[1000]
Definition: EdbShowerRec.h:75

◆ GetN()

Int_t EdbShowerRec::GetN ( ) const
inline
253  {
254  return eShowersN;
255  }
Int_t eShowersN
Definition: EdbShowerRec.h:158

◆ GetNFilmb()

Int_t EdbShowerRec::GetNFilmb ( int  i) const
inline
343  {
344  return eNFilmb[i];
345  }
Int_t eNFilmb[10000]
Definition: EdbShowerRec.h:71

◆ GetOutput()

Float_t EdbShowerRec::GetOutput ( ) const
inline
357  {
358  return eOutput;
359  }
Float_t eOutput
Definition: EdbShowerRec.h:83

◆ GetOutput15()

Float_t EdbShowerRec::GetOutput15 ( ) const
inline
360  {
361  return eOutput15;
362  }
Float_t eOutput15
Definition: EdbShowerRec.h:84

◆ GetOutput20()

Float_t EdbShowerRec::GetOutput20 ( ) const
inline
363  {
364  return eOutput20;
365  }
Float_t eOutput20
Definition: EdbShowerRec.h:85

◆ GetOutput30()

Float_t EdbShowerRec::GetOutput30 ( ) const
inline
366  {
367  return eOutput30;
368  }
Float_t eOutput30
Definition: EdbShowerRec.h:86

◆ GetP0()

Float_t EdbShowerRec::GetP0 ( ) const
inline
275  {
276  return eP0;
277  }
Float_t eP0
Definition: EdbShowerRec.h:52

◆ GetPb()

Float_t EdbShowerRec::GetPb ( int  i) const
inline
337  {
338  return ePb[i];
339  }
Float_t ePb[10000]
Definition: EdbShowerRec.h:68

◆ GetPlateb()

Int_t EdbShowerRec::GetPlateb ( int  i) const
inline
309  {
310  return ePlateb[i];
311  }
Int_t ePlateb[10000]
Definition: EdbShowerRec.h:61

◆ GetRecoShowerArray()

TObjArray* EdbShowerRec::GetRecoShowerArray ( ) const
inline
704  {
705  return eRecoShowerArray;
706  }

◆ GetRecoShowerArrayN()

Int_t EdbShowerRec::GetRecoShowerArrayN ( ) const
inline
711  {
712  return eRecoShowerArrayN;
713  }

◆ GetShowerValues()

Float_t * EdbShowerRec::GetShowerValues ( Int_t  TreeEntry)
3414 {
3415  Float_t* dummy = new Float_t[10];
3416  dummy[0]=-999.;
3417  dummy[1]=-999.;
3418  dummy[2]=-999.;
3419  dummy[3]=-999.;
3420  dummy[4]=-999.;
3421  dummy[5]=-999.;
3422  dummy[6]=-999.;
3423  dummy[7]=-999.;
3424 
3425  if (!eShowerTreeIsDone) {
3426  cout << "EdbShowerRec::GetEnergyValues !eShowerTreeIsDone" << endl;
3427  LoadShowerFile("Shower.root");
3428  }
3429  // Get Treebranch:
3430  // Either from shower file (then it has to be casted) or from the
3431  // reconstruction, then its automatically there.
3432  if (!eShowerTreeIsDone) {
3433  LoadShowerFile("Shower.root");
3434  treesaveb = (TTree*)(FileReconstructedShowerTree->Get("treebranch"));
3435  treesaveb->SetBranchAddress("sizeb", &sizeb);
3436  treesaveb->SetBranchAddress("txb", txb);
3437  treesaveb->SetBranchAddress("tyb", tyb);
3438  treesaveb->SetBranchAddress("xb", xb);
3439  treesaveb->SetBranchAddress("yb", yb);
3440  treesaveb->SetBranchAddress("zb", zb);
3441  treesaveb->SetBranchAddress("eProb90", &eProb90);
3442  treesaveb->SetBranchAddress("eProb1", &eProb1);
3443  treesaveb->SetBranchAddress("nfilmb", nfilmb);
3444 
3445  }
3446  else {
3447  ; /* treesaveb already declared and filled. */
3448  }
3449  cout << "EdbShowerRec::GetEnergyValues LoadShowerFile SetBranchAddress done" << endl;
3450 
3451  treesaveb->GetEntry(TreeEntry);
3452  if (gEDBDEBUGLEVEL>2) treesaveb->Show(TreeEntry);
3453 
3454  dummy[0]=sizeb;
3455  dummy[1]=xb[0];
3456  dummy[2]=yb[0];
3457  dummy[3]=zb[0];
3458  dummy[4]=txb[0];
3459  dummy[5]=tyb[0];
3460  dummy[6]=nfilmb[sizeb-1]-nfilmb[0]+1; // number of passed plates [Firstplate..Lastplate]
3461  dummy[7]=eProb90;
3462  dummy[8]=eProb1;
3463  /*
3464  cout << "sizeb xb[0] yb[0] zb[0] txb[0] tyb[0] nplates eProb90 eProb1:" << endl;
3465  cout << " " << dummy[0] << " " << dummy[1] << " " << dummy[2] << " " << dummy[3] << " " << dummy[4] << " ";
3466  cout << " " << dummy[5] << " " << dummy[6] << " " << dummy[7] << " " << dummy[8] << " " << dummy[9] << " "<<endl;
3467  */
3468  return dummy;
3469 }

◆ GetSize()

Int_t EdbShowerRec::GetSize ( ) const
inline
297  {
298  return eSize;
299  }
Int_t eSize
Definition: EdbShowerRec.h:78

◆ GetSize15()

Int_t EdbShowerRec::GetSize15 ( ) const
inline
300  {
301  return eSize15;
302  }
Int_t eSize15
Definition: EdbShowerRec.h:79

◆ GetSize20()

Int_t EdbShowerRec::GetSize20 ( ) const
inline
303  {
304  return eSize20;
305  }
Int_t eSize20
Definition: EdbShowerRec.h:80

◆ GetSize30()

Int_t EdbShowerRec::GetSize30 ( ) const
inline
306  {
307  return eSize30;
308  }
Int_t eSize30
Definition: EdbShowerRec.h:81

◆ GetTagPrimaryb()

Int_t EdbShowerRec::GetTagPrimaryb ( int  i) const
inline
352  {
353  return eTagPrimary[i];
354  }
Int_t eTagPrimary[10000]
Definition: EdbShowerRec.h:74

◆ GetTreeBranchEntryNr()

Int_t EdbShowerRec::GetTreeBranchEntryNr ( EdbSegP seg)
3317 {
3318  // Returns the number of the treebranch entry for which the segment is starting point of a shower!
3319  // if the segment is not starting point at all, return -1;
3320 
3321  cout << "EdbShowerRec::GetTreeBranchEntryNr()"<< endl;
3322 
3323  if (!eShowerTreeIsDone) {
3324  LoadShowerFile("Shower.root");
3325  treesaveb = (TTree*)(FileReconstructedShowerTree->Get("treebranch"));
3326  treesaveb->SetBranchAddress("txb", txb);
3327  treesaveb->SetBranchAddress("tyb", tyb);
3328  treesaveb->SetBranchAddress("xb", xb);
3329  treesaveb->SetBranchAddress("yb", yb);
3330  treesaveb->SetBranchAddress("zb", zb);
3331  }
3332  else {
3333  cout << "EdbShowerRec::GetTreeBranchEntryNr treesaveb already declared and filled"<<endl;
3334  /* treesaveb already declared and filled. */
3335  }
3336 
3337  cout << "EdbShowerRec::GetTreeBranchEntryNr Looping over treesaveb now..."<<endl;
3338 
3339  for (int i=0; i<treesaveb->GetEntries(); i++) {
3340  treesaveb->GetEntry(i);
3341  if (TMath::Abs(seg->X()-xb[0])>1.0) continue;
3342  if (TMath::Abs(seg->Y()-yb[0])>1.0) continue;
3343  if (TMath::Abs(seg->Z()-zb[0])>1.0) continue;
3344  if (TMath::Abs(seg->TX()-txb[0])>0.01) continue;
3345  if (TMath::Abs(seg->TY()-tyb[0])>0.01) continue;
3346  treesaveb->Show(i);
3347  return i;
3348  }
3349  return -1;
3350 }

◆ GetTrID()

Int_t EdbShowerRec::GetTrID ( ) const
inline
293  {
294  return eTrID;
295  }
Int_t eTrID
Definition: EdbShowerRec.h:49

◆ GetTx()

Float_t EdbShowerRec::GetTx ( ) const
inline
281  {
282  return eTx;
283  }
Float_t eTx
Definition: EdbShowerRec.h:47

◆ GetTXb()

Float_t EdbShowerRec::GetTXb ( int  i) const
inline
325  {
326  return eTXb[i];
327  }
Float_t eTXb[10000]
Definition: EdbShowerRec.h:65

◆ GetTy()

Float_t EdbShowerRec::GetTy ( ) const
inline
284  {
285  return eTy;
286  }
Float_t eTy
Definition: EdbShowerRec.h:48

◆ GetTYb()

Float_t EdbShowerRec::GetTYb ( int  i) const
inline
328  {
329  return eTYb[i];
330  }
Float_t eTYb[10000]
Definition: EdbShowerRec.h:66

◆ GetUseAliSub()

Bool_t EdbShowerRec::GetUseAliSub ( )
inline
678  {
679  return eUseAliSub;
680  }
Bool_t eUseAliSub
Definition: EdbShowerRec.h:109

◆ GetW0()

Int_t EdbShowerRec::GetW0 ( ) const
inline
272  {
273  return eW0;
274  }
Int_t eW0
Definition: EdbShowerRec.h:51

◆ GetWb()

Int_t EdbShowerRec::GetWb ( int  i) const
inline
334  {
335  return eWb[i];
336  }
Int_t eWb[10000]
Definition: EdbShowerRec.h:69

◆ GetX0()

Float_t EdbShowerRec::GetX0 ( ) const
inline
260  {
261  return eX0;
262  }
Float_t eX0
Definition: EdbShowerRec.h:44

◆ GetXb()

Float_t EdbShowerRec::GetXb ( int  i) const
inline
316  {
317  return eXb[i];
318  }
Float_t eXb[10000]
Definition: EdbShowerRec.h:62

◆ GetY0()

Float_t EdbShowerRec::GetY0 ( ) const
inline
263  {
264  return eY0;
265  }
Float_t eY0
Definition: EdbShowerRec.h:45

◆ GetYb()

Float_t EdbShowerRec::GetYb ( int  i) const
inline
319  {
320  return eYb[i];
321  }
Float_t eYb[10000]
Definition: EdbShowerRec.h:63

◆ GetZ0()

Float_t EdbShowerRec::GetZ0 ( ) const
inline
266  {
267  return eZ0;
268  }
Float_t eZ0
Definition: EdbShowerRec.h:46

◆ GetZb()

Float_t EdbShowerRec::GetZb ( int  i) const
inline
322  {
323  return eZb[i];
324  }
Float_t eZb[10000]
Definition: EdbShowerRec.h:64

◆ Help()

void EdbShowerRec::Help ( )
4908 {
4909  // Help Function
4910  cout << "--------------------------------------------------------------------------" << endl;
4911  cout << "-- --" << endl;
4912  cout << "-- EdbShowerRec --" << endl;
4913  cout << "-- --" << endl;
4914  cout << "-- Base Class for the shower reconstruction in OPERA brick. --" << endl;
4915  cout << "-- This class has been initially developed by F. Juget, G. Lutter --" << endl;
4916  cout << "-- and is ongoingly modified and developed by Frank Meisel, which is --" << endl;
4917  cout << "-- currently the corresponding author: frank.meisel@gmx.de --" << endl;
4918  cout << "-- --" << endl;
4919  cout << "-- The main goal of this library is to make the shower search in the --" << endl;
4920  cout << "-- scanned emulsion data as easy as possible, and as most automatically.--" << endl;
4921  cout << "-- There exist also two manuals, to be found under 'documentation'. In --" << endl;
4922  cout << "-- these some general handling of the package is explained. --" << endl;
4923  cout << "-- --" << endl;
4924  cout << "-- The EdbShowerRec class makes following things: --" << endl;
4925  cout << "-- Starting from the emulsion scanned data (represented as an EdbPVRec --" << endl;
4926  cout << "-- object in FEDRA), it does search and reconstruction of showers, --" << endl;
4927  cout << "-- based on different algorithms, which the user can set indivially --" << endl;
4928  cout << "-- (normaly not necessary). After that, we try to identify --" << endl;
4929  cout << "-- characteristics of the shower, as it is: energy and particle ID. --" << endl;
4930  cout << "-- --" << endl;
4931  cout << "--------------------------------------------------------------------------" << endl;
4932  return;
4933 }

◆ Init()

void EdbShowerRec::Init ( void  )
208 {
209  // Create (one time) needed internal objects
210 
211  // Check if eInBTArray array exits, otherwise create.
212  if (!eInitiatorBTIsCreated) {
213  eInBTArray=new TObjArray();
214  eInitiatorBTIsCreated=kTRUE;
215  eInBTArrayN=0;
216  }
217 
218  // Create Array For storing the reconstructed showers.
219  eRecoShowerArray=new TObjArray();
221 
222  return;
223 }

◆ InitPiece()

void EdbShowerRec::InitPiece ( EdbDataPiece piece,
const char *  cpfile,
const char *  parfile 
)
262 {
263  piece.eFileNameCP = cpfile;
264  piece.eFileNamePar = parfile;
265  piece.TakePiecePar();
266  //piece.Print();
267 }
TString eFileNameCP
root-style text cuts
Definition: EdbDataSet.h:49
int TakePiecePar()
Definition: EdbDataSet.cxx:281
TString eFileNamePar
Definition: EdbDataSet.h:50

◆ initproc()

void EdbShowerRec::initproc ( const char *  def,
int  iopt,
const char *  rcut = "1" 
)
270 {
271  dproc = new EdbDataProc(def);
272  dproc->InitVolume(iopt, rcut);
273  gAli = dproc->PVR();
274 }
Definition: EdbDataSet.h:180
EdbPVRec * PVR() const
Definition: EdbDataSet.h:197
int InitVolume(int datatype=0, const char *rcut="1")
Definition: EdbDataSet.cxx:2071
EdbPVRec * gAli
Definition: EdbShowerRec.h:227
EdbDataProc * dproc
Definition: EdbShowerRec.h:235
const char * def
Definition: shower_tr.C:24

◆ InvariantMass()

Double_t EdbShowerRec::InvariantMass ( EdbSegP s1,
EdbSegP s2,
Double_t  Momentum1 = -1,
Double_t  Momentum2 = -1,
Double_t  ID1 = 22,
Double_t  ID2 = 22 
)
4877 {
4878  cout << "EdbShowerRec::InvariantMass()" << endl;
4879  cout << "s1->P() " << s1->P() << endl;
4880  cout << "s2->P() " << s2->P() << endl;
4881 
4882  // If no momentum is specified, then it will be taken from segments momentum:
4883  if (Momentum1<0) Momentum1=s1->P();
4884  if (Momentum2<0) Momentum2=s2->P();
4885 
4886  //mass reconstruction for Pi0 using 2 tracks
4887  //you have to know the momentum of the 2 tracks and their slopes (Tx,Ty)
4888  //first implementation: frederic juget
4889  TLorentzVector v1;
4890  TLorentzVector v2;
4891  Double_t energy1=0;
4892  Double_t energy2=0;
4893  v1.SetPxPyPzE(s1->TX(),s1->TY(),1,Momentum1);
4894  v2.SetPxPyPzE(s2->TX(),s2->TY(),1,Momentum2);
4895  TLorentzVector vsum=v1+v1;
4896  Double_t invM=vsum.Mag2();
4897  cout << v1.Mag() << endl;
4898  cout << v2.Mag() << endl;
4899  cout << vsum.Mag() << endl;
4900  return invM;
4901 }

◆ IsInConeTube()

Bool_t EdbShowerRec::IsInConeTube ( EdbSegP TestingSegment,
EdbSegP StartingSegment,
Double_t  CylinderRadius,
Double_t  ConeAngle 
)

Outside if angle greater than ConeAngle (to be fulfilled for Cone and Tube in both cases)

if angle smaller than ConeAngle, then you can differ between Tuberadius and CylinderRadius

3535 {
3536  // General Function which returns kTRUE if the Testing BaeTrack is in a cone defined
3537  // by the StartingBaseTrack. In case of same starting Z position, a max distance cut ( in Delta R)
3538  // of 20microns is assumed (i.e. the cone is not totally closed at the start).
3539  // In case of TestingSegment==StartingSegment this function should also correctly return kTRUE.
3540 
3541  if (gEDBDEBUGLEVEL>3) cout << "Bool_t EdbShowerAlg::IsInConeTube("<<TestingSegment<< ","<< StartingSegment <<","<< CylinderRadius << "," << ConeAngle << endl;
3542  if (gEDBDEBUGLEVEL>3) cout << "Bool_t EdbShowerAlg::IsInConeTube() Test Segment " << TestingSegment << " vs. Starting Segment " << StartingSegment << endl;
3543 
3544  // if (TestingSegment->Z()-StartingSegment->Z()<2.0) return kFALSE; //wrong...
3545  if (StartingSegment->Z()>TestingSegment->Z() ) return kFALSE;
3546 
3547  TVector3 x1(StartingSegment->X(),StartingSegment->Y(),StartingSegment->Z());
3548  TVector3 x2(TestingSegment->X(),TestingSegment->Y(),TestingSegment->Z());
3549  TVector3 direction_x1(StartingSegment->TX()*1273,StartingSegment->TY()*1273,1273);
3550 
3551  // u1 is the difference vector of the position!
3552  TVector3 u1=x2-x1;
3553 
3554  Double_t direction_x1_norm= direction_x1.Mag();
3555  Double_t cosangle= (direction_x1*u1)/(u1.Mag()*direction_x1_norm);
3556  Double_t angle = TMath::ACos(cosangle);
3557  // This is the old version of angle calculation. It does not give the same results as in ROOT
3558  // when use TVector3.Angle(&TVector3). // For this IsInConeTube() we use therefore the ROOT calculation.
3559  angle=u1.Angle(direction_x1);
3560 
3561  // For the case where the two basetracks have same z position
3562  // the angle is about 90 degree so it makes no sense to calculate it...
3563  // therefore we set it artificially to zero:
3564  // if (TMath::Abs(StartingSegment->Z()-TestingSegment->Z())<2.0) {
3565  if (StartingSegment->Z()==TestingSegment->Z() ) {
3566  if (gEDBDEBUGLEVEL>3) cout << "Bool_t EdbShowerAlg::IsInConeTube() Same Z position of TestingSegment and StartingSegment, Set angle artificially to zero" << endl;
3567  angle=0.0;
3568 
3569  // Check for position distance for 20microns if
3570  // Testing Segment is in same Z as StartingSegment
3571  if (gEDBDEBUGLEVEL>3) cout << "Bool_t EdbShowerAlg::IsInConeTube() Check for position distance for 20microns if Testing Segment is in same Z as StartingSegment" << endl;
3572  if (gEDBDEBUGLEVEL>3) cout << "Bool_t EdbShowerAlg::IsInConeTube() DeltaR_WithoutPropagation(StartingSegment,TestingSegment) = "<< DeltaR_WithoutPropagation(StartingSegment,TestingSegment) << endl;
3573  if (DeltaR_WithoutPropagation(StartingSegment,TestingSegment)<20) return kTRUE;
3574  if (DeltaR_WithoutPropagation(StartingSegment,TestingSegment)>=20) return kFALSE;
3575  }
3576 
3577 
3579  if (gEDBDEBUGLEVEL>3) cout << "Bool_t EdbShowerAlg::IsInConeTube() Check if AngleVector now within the ConeAngleVector (<"<< ConeAngle<<"): " << angle << endl;
3580  if (angle>ConeAngle) {
3581  return kFALSE;
3582  }
3583 
3584 
3586  Double_t TubeDistance = 1.0/direction_x1_norm * ( (x2-x1).Cross(direction_x1) ).Mag();
3587 
3588  if (gEDBDEBUGLEVEL>3) cout << "Bool_t EdbShowerAlg::IsInConeTube() Check if TestingSegment is now within the Tube (<"<< CylinderRadius<<"): " << TubeDistance << endl;
3589 
3590  if (TubeDistance>CylinderRadius) {
3591  return kFALSE;
3592  }
3593 
3594  return kTRUE;
3595 }

◆ LoadEdbPVRec()

void EdbShowerRec::LoadEdbPVRec ( )
3688 {
3689  // Function to load the EdbPatterVolumeReconstruction object into memory.
3690  // Shower reco needs to have full basetrack data to improve performance.
3691  // Because full basetrack data (corresponds to cp.root files) is memory extensive,
3692  // standard operations rely on linked tracks only.
3693  // Warning: some hardcoded strings are inside herebject for analysis use!
3694 
3695  Log(2,"EdbShowerRec::LoadEdbPVRec","Loads the full cp Basetracks into the eAli object.");
3696  // Loads the full cp Basetracks into the eAli object:
3697  if (!eAli) eAli=new EdbPVRec();
3698 
3699  // **** Data set initialization
3700  EdbDataProc* dset = new EdbDataProc("lnk.def");
3701  // **** Volume initialization
3702  dset->InitVolume(0);
3703  // **** Get Pattern Volume Reconstruction object
3704  eAli = dset->PVR();
3705 
3706  if (gEDBDEBUGLEVEL>2) eAli->Print();
3707 
3708  // Set private variables for the EdbPVrec Object now:
3709  eAliNpat=eAli->Npatterns();
3710  eAliNpatM1=eAliNpat-1;
3712 
3713  eAliLoaded=kTRUE;
3714  Log(2,"EdbShowerRec::LoadEdbPVRec","Loads the full cp Basetracks into the eAli object.Done.");
3715 }
EdbDataProc * dset
Definition: RecDispEX.C:9

◆ LoadShowerFile()

void EdbShowerRec::LoadShowerFile ( TString  ShowerFileName = "Shower2.root")
2490 {
2491  if (gEDBDEBUGLEVEL>2) cout << "------------------------------------------------------"<<endl;
2492  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::LoadShowerFile()"<<endl;
2493  if (gEDBDEBUGLEVEL>2) cout << "------------------------------------------------------"<<endl;
2494 
2495  FileReconstructedShowerTree = new TFile(ShowerFileName,"READ");
2496  if (FileReconstructedShowerTree==0) {
2497  cout << "ERROR: FileReconstructedShowerTree==NULL. ABORTING."<<endl;
2498  return;
2499  }
2500 
2501  // if (gEDBDEBUGLEVEL>2) FileReconstructedShowerTree->ls();
2502  if (gEDBDEBUGLEVEL>2) cout << "void EdbShowerRec::LoadShowerFile() done."<<endl;
2503  return;
2504 }

◆ NeuralNet()

void EdbShowerRec::NeuralNet ( )
1918  {
1919 
1920  float offset; // Z position of last (first) plate in the data set (usually = 0.)
1921  offset = 0.;
1922 
1923 
1924  //output file
1925  fileout3 = new TFile("Shower2.root","RECREATE");
1926  //definition of treebranch
1927  treesaveb3 = new TTree("treebranch","tree of branchtrack");
1928  treesaveb3->Branch("number_eventb",&number_eventb,"number_eventb/I");
1929  treesaveb3->Branch("sizeb",&sizeb,"sizeb/I");
1930  treesaveb3->Branch("sizeb15",&sizeb15,"sizeb15/I");
1931  treesaveb3->Branch("sizeb20",&sizeb20,"sizeb20/I");
1932  treesaveb3->Branch("sizeb30",&sizeb30,"sizeb30/I");
1933  treesaveb3->Branch("output15",&output15,"output15/F");
1934  treesaveb3->Branch("output20",&output20,"output20/F");
1935  treesaveb3->Branch("output30",&output30,"output30/F");
1936  treesaveb3->Branch("output50",&output50,"output50/F");
1937  treesaveb3->Branch("eProb90",&eProb90,"eProb90/I");
1938  treesaveb3->Branch("eProb1",&eProb1,"eProb1/I");
1939  treesaveb3->Branch("E_MC",&E_MC,"E_MC/F");
1940  treesaveb3->Branch("idb",idb,"idb[sizeb]/I");
1941  treesaveb3->Branch("plateb",plateb,"plateb[sizeb]/I");
1942  treesaveb3->Branch("showerID",&showerID,"showerID/I");
1943  treesaveb3->Branch("isizeb",&isizeb,"isizeb/I");
1944  treesaveb3->Branch("xb",xb,"xb[sizeb]/F");
1945  treesaveb3->Branch("yb",yb,"yb[sizeb]/F");
1946  treesaveb3->Branch("zb",zb,"zb[sizeb]/F");
1947  treesaveb3->Branch("txb",txb,"txb[sizeb]/F");
1948  treesaveb3->Branch("tyb",tyb,"tyb[sizeb]/F");
1949  treesaveb3->Branch("nfilmb",nfilmb,"nfilmb[sizeb]/I");
1950  treesaveb3->Branch("ntrace1simub",ntrace1simub,"ntrace1simu[sizeb]/I");
1951  treesaveb3->Branch("ntrace2simub",ntrace2simub,"ntrace2simu[sizeb]/I");
1952  treesaveb3->Branch("ntrace4simub",ntrace4simub,"ntrace4simu[sizeb]/I");
1953  treesaveb3->Branch("ntrace3simub",ntrace3simub,"ntrace3simu[sizeb]/F");
1954  treesaveb3->Branch("chi2btkb",chi2btkb,"chi2btkb[sizeb]/F");
1955  treesaveb3->Branch("deltarb",deltarb,"deltarb[sizeb]/F");
1956  treesaveb3->Branch("deltathetab",deltathetab,"deltathetab[sizeb]/F");
1957  treesaveb3->Branch("deltaxb",deltaxb,"deltaxb[sizeb]/F");
1958  treesaveb3->Branch("deltayb",deltayb,"deltayb[sizeb]/F");
1959  treesaveb3->Branch("tagprimary",tagprimary,"tagprimary[sizeb]/F");
1960  treesaveb3->Branch("purityb",&purityb,"purityb/F");
1961  treesaveb3->Branch("trackdensb",&trackdensb,"trackdensb/F");
1962  treesaveb3->Branch("mcDigitIndexTop",mcDigitIndexTop,"mcDigitIndexTop[sizeb]/I");
1963  treesaveb3->Branch("mcDigitIndexBottom",mcDigitIndexBottom,"mcDigitIndexBottom[sizeb]/I");
1964 
1965  treesaveb3->Branch("Energy",&EnergyCorrectedb,"EnergyCorrectedb/F");
1966  treesaveb3->Branch("EnergyUnCorrected",&EnergyUnCorrectedb,"EnergyUnCorrectedb/F");
1967  treesaveb3->Branch("EnergySigma",&EnergySigmaCorrectedb,"EnergySigmaCorrectedb/F");
1968  treesaveb3->Branch("EnergySigmaUnCorrected",&EnergySigmaUnCorrectedb,"EnergySigmaUnCorrectedb/F");
1969 
1970 
1971 
1972  char fname_e[128];
1973  Float_t Rcut30, Tcut30;
1974  Float_t Rcut20, Tcut20;
1975  Float_t Rcut15, Tcut15;
1976  Float_t Rcut50, Tcut50;
1977 
1978  int flag15;
1979  int flag20;
1980  int flag30;
1981  int flag50;
1982 
1983  Double_t params[53];
1984 
1985  Float_t ntrke50;
1986  Float_t ntrke30;
1987  Float_t ntrke20;
1988  Float_t ntrke15;
1989 
1990  TTree *varia = new TTree("MonteCarlo", "Filtered Monte Carlo Events");
1991  varia->Branch("bin3", &bin3, "bin3/F");
1992  varia->Branch("bin4", &bin4, "bin4/F");
1993  varia->Branch("bin5", &bin5, "bin5/F");
1994  varia->Branch("bin6", &bin6, "bin6/F");
1995  varia->Branch("bin7", &bin7, "bin7/F");
1996  varia->Branch("bin8", &bin8, "bin8/F");
1997  varia->Branch("bin9", &bin9, "bin9/F");
1998  varia->Branch("bin10", &bin10, "bin10/F");
1999  varia->Branch("bin11", &bin11, "bin11/F");
2000  varia->Branch("bin12", &bin12, "bin12/F");
2001  varia->Branch("bin13", &bin13, "bin13/F");
2002  varia->Branch("bin14", &bin14, "bin14/F");
2003  varia->Branch("bin15", &bin15, "bin15/F");
2004  varia->Branch("bin16", &bin16, "bin16/F");
2005  varia->Branch("bin17", &bin17, "bin17/F");
2006  varia->Branch("bin18", &bin18, "bin18/F");
2007  varia->Branch("bin19", &bin19, "bin19/F");
2008  varia->Branch("bin20", &bin20, "bin20/F");
2009  varia->Branch("bin21", &bin21, "bin21/F");
2010  varia->Branch("bin22", &bin22, "bin22/F");
2011  varia->Branch("bin23", &bin23, "bin23/F");
2012  varia->Branch("bin24", &bin24, "bin24/F");
2013  varia->Branch("bin25", &bin25, "bin25/F");
2014  varia->Branch("bin26", &bin26, "bin26/F");
2015  varia->Branch("bin27", &bin27, "bin27/F");
2016  varia->Branch("bin28", &bin28, "bin28/F");
2017  varia->Branch("bin29", &bin29, "bin29/F");
2018  varia->Branch("bin30", &bin30, "bin30/F");
2019  varia->Branch("bin31", &bin31, "bin31/F");
2020  varia->Branch("bin32", &bin32, "bin32/F");
2021  varia->Branch("bin33", &bin33, "bin33/F");
2022  varia->Branch("bin34", &bin34, "bin34/F");
2023  varia->Branch("bin35", &bin35, "bin35/F");
2024  varia->Branch("bin41", &bin41, "bin41/F");
2025  varia->Branch("bin42", &bin42, "bin42/F");
2026  varia->Branch("bin43", &bin43, "bin43/F");
2027  varia->Branch("bin44", &bin44, "bin44/F");
2028  varia->Branch("bin45", &bin45, "bin45/F");
2029  varia->Branch("bin46", &bin46, "bin46/F");
2030  varia->Branch("bin47", &bin47, "bin47/F");
2031  varia->Branch("bin48", &bin48, "bin48/F");
2032  varia->Branch("bin49", &bin49, "bin49/F");
2033  varia->Branch("bin50", &bin50, "bin50/F");
2034  varia->Branch("bin51", &bin51, "bin51/F");
2035  varia->Branch("bin52", &bin52, "bin52/F");
2036  varia->Branch("bin53", &bin53, "bin53/F");
2037  varia->Branch("bin54", &bin54, "bin54/F");
2038  varia->Branch("bin55", &bin55, "bin55/F");
2039  varia->Branch("bin56", &bin56, "bin56/F");
2040  varia->Branch("bin57", &bin57, "bin57/F");
2041  varia->Branch("bin58", &bin58, "bin58/F");
2042  varia->Branch("bin59", &bin59, "bin59/F");
2043  varia->Branch("bin60", &bin60, "bin60/F");
2044  varia->Branch("type", &type, "type/I");
2045 
2046 
2047  // Weightfiles using Expanded Path Name, hopefully it does work for both windows and linux
2048  TString weightpath_20=TString(gSystem->ExpandPathName("$FEDRA_ROOT"))+TString("/src/libShower/weights_20.txt");
2049  TString weightpath_15=TString(gSystem->ExpandPathName("$FEDRA_ROOT"))+TString("/src/libShower/weights_15.txt");
2050  TString weightpath_30=TString(gSystem->ExpandPathName("$FEDRA_ROOT"))+TString("/src/libShower/weights_30.txt");
2051  TString weightpath_50=TString(gSystem->ExpandPathName("$FEDRA_ROOT"))+TString("/src/libShower/weights_50.txt");
2052 
2053  TMultiLayerPerceptron *mlp1 = new TMultiLayerPerceptron("@bin3,@bin4,@bin5,@bin6,@bin7,@bin8,@bin9,@bin10,@bin11,@bin12,@bin13,@bin14,@bin15,@bin16,@bin17,@bin18,@bin19,@bin20,@bin31,@bin32,@bin33,@bin34,@bin35:63:21:type",varia,"bin31>0","bin31>0");
2054  mlp1->LoadWeights(weightpath_20);
2055 
2056  TMultiLayerPerceptron *mlp2 = new TMultiLayerPerceptron("@bin3,@bin4,@bin5,@bin6,@bin7,@bin8,@bin9,@bin10,@bin11,@bin12,@bin13,@bin14,@bin15,@bin31,@bin32,@bin33,@bin34,@bin35:63:21:type",varia,"bin31>0","bin31>0");
2057  mlp2->LoadWeights(weightpath_15);
2058 
2059  TMultiLayerPerceptron *mlp3 = new TMultiLayerPerceptron("@bin3,@bin4,@bin5,@bin6,@bin7,@bin8,@bin9,@bin10,@bin11,@bin12,@bin13,@bin14,@bin15,@bin16,@bin17,@bin18,@bin19,@bin20,@bin21,@bin22,@bin23,@bin24,@bin25,@bin26,@bin27,@bin28,@bin29,@bin30,@bin31,@bin32,@bin33,@bin34,@bin35:63:21:type",varia,"bin31>0","bin31>0");
2060  mlp3->LoadWeights(weightpath_30);
2061 
2062  TMultiLayerPerceptron *mlp4 = new TMultiLayerPerceptron("@bin3,@bin4,@bin5,@bin6,@bin7,@bin8,@bin9,@bin10,@bin11,@bin12,@bin13,@bin14,@bin15,@bin16,@bin17,@bin18,@bin19,@bin20,@bin21,@bin22,@bin23,@bin24,@bin25,@bin26,@bin27,@bin28,@bin29,@bin30,@bin41,@bin42,@bin43,@bin44,@bin45,@bin46,@bin47,@bin48,@bin49,@bin50,@bin51,@bin52,@bin53,@bin54,@bin55,@bin56,@bin57,@bin58,@bin59,@bin60,@bin31,@bin32,@bin33,@bin34,@bin35:63:21:type",varia,"bin31>0","bin31>0");
2063  mlp4->LoadWeights(weightpath_50);
2064 
2065  TH1F *histogl_e = new TH1F("longitudinal profile","longitudinal profile",50,0,50);
2066 
2067  TH1F *historcut30 = new TH1F("Delta r 30"," ",50,0,200);
2068  TH1F *histotcut30 = new TH1F("Delta theta 30"," ",50,0,0.2);
2069  TH1F *historcut50 = new TH1F("Delta r 50"," ",50,0,200);
2070  TH1F *histotcut50 = new TH1F("Delta theta 50"," ",50,0,0.2);
2071 
2072  TH1F *historcut20 = new TH1F("Delta r 20 "," ",50,0,200);
2073  TH1F *histotcut20 = new TH1F("Delta theta 20"," ",50,0,0.2);
2074  TH1F *historcut15 = new TH1F("Delta r 15"," ",50,0,200);
2075  TH1F *histotcut15 = new TH1F("Delta theta 15"," ",50,0,0.2);
2076 
2077  float val30,val20,val15,val50;
2078 
2079  sprintf(fname_e,"shower1.root"); //input shower tree file
2080 
2081  TFile *file_e2 = new TFile(fname_e ,"READ");
2082  TTree *treebranch_e = (TTree *) file_e2->Get("treebranch");
2083  treebranch_e->SetBranchAddress("nfilmb", nfilmb);
2084  treebranch_e->SetBranchAddress("sizeb", &sizeb);
2085  treebranch_e->SetBranchAddress("sizeb15", &sizeb15);
2086  treebranch_e->SetBranchAddress("sizeb20", &sizeb20);
2087  treebranch_e->SetBranchAddress("sizeb30", &sizeb30);
2088  treebranch_e->SetBranchAddress("isizeb", &isizeb);
2089  treebranch_e->SetBranchAddress("chi2btkb", &chi2btkb);
2090  treebranch_e->SetBranchAddress("tagprimary", tagprimary);
2091  treebranch_e->SetBranchAddress("txb", txb);
2092  treebranch_e->SetBranchAddress("tyb", tyb);
2093  treebranch_e->SetBranchAddress("xb", xb);
2094  treebranch_e->SetBranchAddress("yb", yb);
2095  treebranch_e->SetBranchAddress("zb", zb);
2096  treebranch_e->SetBranchAddress("showerID", &showerID);
2097  treebranch_e->SetBranchAddress("plateb", plateb);
2098  treebranch_e->SetBranchAddress("idb", idb);
2099  treebranch_e->SetBranchAddress("deltarb", deltarb);
2100  treebranch_e->SetBranchAddress("deltathetab", deltathetab);
2101  treebranch_e->SetBranchAddress("number_eventb", &number_eventb);
2102  treebranch_e->SetBranchAddress("ntrace1simub", &ntrace1simub);
2103  treebranch_e->SetBranchAddress("ntrace2simub", &ntrace2simub);
2104  treebranch_e->SetBranchAddress("ntrace3simub", &ntrace3simub);
2105  treebranch_e->SetBranchAddress("ntrace4simub", &ntrace4simub);
2106  treebranch_e->SetBranchAddress("purityb", &purityb);
2107  treebranch_e->SetBranchAddress("E_MC", &E_MC);
2108  treebranch_e->SetBranchAddress("mcDigitIndexTop",mcDigitIndexTop);
2109  treebranch_e->SetBranchAddress("mcDigitIndexBottom",mcDigitIndexBottom);
2110 
2111 
2112  for (Int_t ik = 0; ik < treebranch_e->GetEntries(); ik++)
2113  {
2114  treebranch_e->GetEntry(ik);
2115  histogl_e->Reset();
2116  historcut15->Reset();
2117  histotcut15->Reset();
2118  historcut20->Reset();
2119  histotcut20->Reset();
2120  historcut30->Reset();
2121  histotcut30->Reset();
2122  historcut50->Reset();
2123  histotcut50->Reset();
2124 
2125  output50 = -10;
2126  output30 = -10;
2127  output20 = -10;
2128  output15 = -10;
2129 
2130  if (isizeb>0) {
2131  ntrke50 = 0;
2132  Rcut50 = 0.;
2133  Tcut50 = 0.;
2134  ntrke30 = 0;
2135  Rcut30 = 0.;
2136  Tcut30 = 0.;
2137  ntrke20 = 0;
2138  Rcut20 = 0.;
2139  Tcut20 = 0.;
2140  ntrke15 = 0;
2141  Rcut15 = 0.;
2142  Tcut15 = 0.;
2143  flag15 = 0;
2144  flag20 = 0;
2145  flag30 = 0;
2146  flag50 = 0;
2147 
2148  if (isizeb==15)flag15=1;
2149  if (isizeb==20)flag20=1;
2150  if (isizeb==30)flag30=1;
2151  if (isizeb==50)flag50=1;
2152 
2153 
2154  for (Int_t ibtke = 0; ibtke < sizeb; ibtke++) { // loop on btk
2155 
2156  histogl_e->Fill(nfilmb[ibtke]);
2157  if (nfilmb[ibtke]<51)ntrke50++;
2158  if (nfilmb[ibtke]<31)ntrke30++;
2159  if (nfilmb[ibtke]<21)ntrke20++;
2160  if (nfilmb[ibtke]<16)ntrke15++;
2161 
2162  if (ibtke>0&&nfilmb[ibtke]<51)
2163  {
2164  Rcut50 += deltarb[ibtke];
2165  Tcut50 += deltathetab[ibtke];
2166  historcut50->Fill(deltarb[ibtke]);
2167  histotcut50->Fill(deltathetab[ibtke]);
2168  }
2169  if (ibtke>0&&nfilmb[ibtke]<31)
2170  {
2171  Rcut30 += deltarb[ibtke];
2172  Tcut30 += deltathetab[ibtke];
2173  historcut30->Fill(deltarb[ibtke]);
2174  histotcut30->Fill(deltathetab[ibtke]);
2175  }
2176  if (ibtke>0&&nfilmb[ibtke]<21)
2177  {
2178  Rcut20 += deltarb[ibtke];
2179  Tcut20 += deltathetab[ibtke];
2180  historcut20->Fill(deltarb[ibtke]);
2181  histotcut20->Fill(deltathetab[ibtke]);
2182  }
2183  if (ibtke>0&&nfilmb[ibtke]<16)
2184  {
2185  Rcut15 += deltarb[ibtke];
2186  Tcut15 += deltathetab[ibtke];
2187  historcut15->Fill(deltarb[ibtke]);
2188  histotcut15->Fill(deltathetab[ibtke]);
2189  }
2190  }
2191 
2192  bin1 = histogl_e->GetBinContent(1);
2193  bin2 = histogl_e->GetBinContent(2);
2194  bin3 = histogl_e->GetBinContent(3);
2195  bin4 = histogl_e->GetBinContent(4);
2196  bin5 = histogl_e->GetBinContent(5);
2197  bin6 = histogl_e->GetBinContent(6);
2198  bin7 = histogl_e->GetBinContent(7);
2199  bin8 = histogl_e->GetBinContent(8);
2200  bin9 = histogl_e->GetBinContent(9);
2201  bin10 = histogl_e->GetBinContent(10);
2202  bin11 = histogl_e->GetBinContent(11);
2203  bin12 = histogl_e->GetBinContent(12);
2204  bin13 = histogl_e->GetBinContent(13);
2205  bin14 = histogl_e->GetBinContent(14);
2206  bin15 = histogl_e->GetBinContent(15);
2207  bin16 = histogl_e->GetBinContent(16);
2208  bin17 = histogl_e->GetBinContent(17);
2209  bin18 = histogl_e->GetBinContent(18);
2210  bin19 = histogl_e->GetBinContent(19);
2211  bin20 = histogl_e->GetBinContent(20);
2212  bin21 = histogl_e->GetBinContent(21);
2213  bin22 = histogl_e->GetBinContent(22);
2214  bin23 = histogl_e->GetBinContent(23);
2215  bin24 = histogl_e->GetBinContent(24);
2216  bin25 = histogl_e->GetBinContent(25);
2217  bin26 = histogl_e->GetBinContent(26);
2218  bin27 = histogl_e->GetBinContent(27);
2219  bin28 = histogl_e->GetBinContent(28);
2220  bin29 = histogl_e->GetBinContent(29);
2221  bin30 = histogl_e->GetBinContent(30);
2222  bin41 = histogl_e->GetBinContent(31);
2223  bin42 = histogl_e->GetBinContent(32);
2224  bin43 = histogl_e->GetBinContent(33);
2225  bin44 = histogl_e->GetBinContent(34);
2226  bin45 = histogl_e->GetBinContent(35);
2227  bin46 = histogl_e->GetBinContent(36);
2228  bin47 = histogl_e->GetBinContent(37);
2229  bin48 = histogl_e->GetBinContent(38);
2230  bin49 = histogl_e->GetBinContent(39);
2231  bin50 = histogl_e->GetBinContent(40);
2232  bin51 = histogl_e->GetBinContent(41);
2233  bin52 = histogl_e->GetBinContent(42);
2234  bin53 = histogl_e->GetBinContent(43);
2235  bin54 = histogl_e->GetBinContent(44);
2236  bin55 = histogl_e->GetBinContent(45);
2237  bin56 = histogl_e->GetBinContent(46);
2238  bin57 = histogl_e->GetBinContent(47);
2239  bin58 = histogl_e->GetBinContent(48);
2240  bin59 = histogl_e->GetBinContent(49);
2241  bin60 = histogl_e->GetBinContent(50);
2242 // input variables for 20 sheets
2243  bin31 = ntrke20;
2244  bin32 = Rcut20/ntrke20;
2245  bin33 = Tcut20/ntrke20;
2246  bin34 = historcut20->GetRMS();
2247  bin35 = histotcut20->GetRMS();
2248 
2249  params[0] = bin3;
2250  params[1] = bin4;
2251  params[2] = bin5;
2252  params[3] = bin6;
2253  params[4] = bin7;
2254  params[5] = bin8;
2255  params[6] = bin9;
2256  params[7] = bin10;
2257  params[8] = bin11;
2258  params[9] = bin12;
2259  params[10] = bin13;
2260  params[11] = bin14;
2261  params[12] = bin15;
2262  params[13] = bin16;
2263  params[14] = bin17;
2264  params[15] = bin18;
2265  params[16] = bin19;
2266  params[17] = bin20;
2267  params[18] = bin31;
2268  params[19] = bin32;
2269  params[20] = bin33;
2270  params[21] = bin34;
2271  params[22] = bin35;
2272 
2273  val20=mlp1->Evaluate(0, params);
2274 
2275 // input variables for 30 sheets
2276  bin31 = ntrke30;
2277  bin32 = Rcut30/ntrke30;
2278  bin33 = Tcut30/ntrke30;
2279  bin34 = historcut30->GetRMS();
2280  bin35 = histotcut30->GetRMS();
2281 
2282  params[18] = bin21;
2283  params[19] = bin22;
2284  params[20] = bin23;
2285  params[21] = bin24;
2286  params[22] = bin25;
2287  params[23] = bin26;
2288  params[24] = bin27;
2289  params[25] = bin28;
2290  params[26] = bin29;
2291  params[27] = bin30;
2292  params[28] = bin31;
2293  params[29] = bin32;
2294  params[30] = bin33;
2295  params[31] = bin34;
2296  params[32] = bin35;
2297  val30 = mlp3->Evaluate(0, params);
2298 
2299 // input variables for 50 sheets
2300  bin31 = ntrke50;
2301  bin32 = Rcut50/ntrke50;
2302  bin33 = Tcut50/ntrke50;
2303  bin34 = historcut50->GetRMS();
2304  bin35 = histotcut50->GetRMS();
2305 
2306  params[28] = bin41;
2307  params[29] = bin42;
2308  params[30] = bin43;
2309  params[31] = bin44;
2310  params[32] = bin45;
2311  params[33] = bin46;
2312  params[34] = bin47;
2313  params[35] = bin48;
2314  params[36] = bin49;
2315  params[37] = bin50;
2316  params[38] = bin51;
2317  params[39] = bin52;
2318  params[40] = bin53;
2319  params[41] = bin54;
2320  params[42] = bin55;
2321  params[43] = bin56;
2322  params[44] = bin57;
2323  params[45] = bin58;
2324  params[46] = bin59;
2325  params[47] = bin60;
2326 
2327  params[48] = bin31;
2328  params[49] = bin32;
2329  params[50] = bin33;
2330  params[51] = bin34;
2331  params[52] = bin35;
2332  val50 = mlp4->Evaluate(0, params);
2333 
2334 // input variables for 15 sheets
2335 
2336  bin31 = ntrke15;
2337  bin32 = Rcut15/ntrke15;
2338  bin33 = Tcut15/ntrke15;
2339  bin34 = historcut15->GetRMS();
2340  bin35 = histotcut15->GetRMS();
2341  params[13] = bin31;
2342  params[14] = bin32;
2343  params[15] = bin33;
2344  params[16] = bin34;
2345  params[17] = bin35;
2346 
2347  val15=mlp2->Evaluate(0, params);
2348 
2349 // save final output values
2350 
2351  output50= val50;
2352  output30= val30;
2353  output20= val20;
2354  output15= val15;
2355  eProb90=0;
2356  eProb1=0;
2357 
2358  if (output15>0.38&&isizeb==1) eProb90=1;
2359  if (flag15==1&&output15>0.38) eProb90=1;
2360  if (flag20==1&&output20>0.37) eProb90=1;
2361  if (flag30==1&&output30>0.36) eProb90=1;
2362  if (flag50==1&&output50>0.34) eProb90=1;
2363 
2364  if (output15>0.78&&isizeb==1) eProb1=1;
2365  if (flag15==1&&output15>0.78) eProb1=1;
2366  if (flag20==1&&output20>0.73) eProb1=1;
2367  if (flag30==1&&output30>0.7) eProb1=1;
2368  if (flag50==1&&output50>0.73) eProb1=1;
2369  /*
2370  if (output15>0.345) eProb90=1;
2371  if (output15>0.345&&output20>0.355) eProb90=1;
2372  if (output15>0.345&&output20>0.355&&output30>0.385) eProb90=1;
2373  if (output15>0.345&&output20>0.355&&output30>0.385&&output50>0.37) eProb90=1;
2374 
2375  if (output15>0.64) eProb1=1;
2376  if (output15>0.64&&output20>0.65) eProb1=1;
2377  if (output15>0.64&&output20>0.65&&output30>0.64) eProb1=1;
2378  if (output15>0.64&&output20>0.65&&output30>0.64&output50>0.645) eProb1=1;
2379  */
2380  if (eProb90==1&&flag50==1)
2381  {
2382  cout<< " output50: " << val50 << " output20: " << val20 << " output15: " << val15 << endl;
2383  }
2384  treesaveb3->Fill();
2385  //cout << "Do treesaveb3->Fill();"<<endl;
2386  }
2387  }
2388 
2389  eShowersN=treesaveb3->GetEntries();
2390 
2391  file_e2->Close();
2392 
2393  fileout3->cd();
2394  treesaveb3->Write();
2395  fileout3->Close();
2396 }
Double_t bin57
Definition: EdbShowerRec.h:243
TTree * varia
Definition: EdbShowerRec.h:233
Double_t bin60
Definition: EdbShowerRec.h:243
Double_t bin23
Definition: EdbShowerRec.h:240
Double_t bin5
Definition: EdbShowerRec.h:238
Double_t bin59
Definition: EdbShowerRec.h:243
Double_t bin22
Definition: EdbShowerRec.h:240
Double_t bin52
Definition: EdbShowerRec.h:243
Double_t bin35
Definition: EdbShowerRec.h:241
Double_t bin49
Definition: EdbShowerRec.h:242
Double_t bin32
Definition: EdbShowerRec.h:241
Double_t bin12
Definition: EdbShowerRec.h:239
Double_t bin2
Definition: EdbShowerRec.h:238
Double_t bin44
Definition: EdbShowerRec.h:242
Double_t bin4
Definition: EdbShowerRec.h:238
Double_t bin45
Definition: EdbShowerRec.h:242
TMultiLayerPerceptron * mlp1
Definition: EdbShowerRec.h:246
Double_t bin54
Definition: EdbShowerRec.h:243
Double_t bin41
Definition: EdbShowerRec.h:242
Double_t bin50
Definition: EdbShowerRec.h:242
Double_t bin28
Definition: EdbShowerRec.h:240
TMultiLayerPerceptron * mlp4
Definition: EdbShowerRec.h:249
Double_t bin29
Definition: EdbShowerRec.h:240
TMultiLayerPerceptron * mlp3
Definition: EdbShowerRec.h:248
Double_t bin20
Definition: EdbShowerRec.h:239
Double_t bin25
Definition: EdbShowerRec.h:240
Double_t bin58
Definition: EdbShowerRec.h:243
Double_t bin30
Definition: EdbShowerRec.h:240
Double_t bin47
Definition: EdbShowerRec.h:242
Double_t bin26
Definition: EdbShowerRec.h:240
Double_t bin53
Definition: EdbShowerRec.h:243
Double_t bin21
Definition: EdbShowerRec.h:240
Double_t bin46
Definition: EdbShowerRec.h:242
Double_t bin13
Definition: EdbShowerRec.h:239
TMultiLayerPerceptron * mlp2
Definition: EdbShowerRec.h:247
Double_t bin14
Definition: EdbShowerRec.h:239
Double_t bin42
Definition: EdbShowerRec.h:242
Double_t bin55
Definition: EdbShowerRec.h:243
Double_t bin11
Definition: EdbShowerRec.h:239
Double_t bin51
Definition: EdbShowerRec.h:243
Double_t bin24
Definition: EdbShowerRec.h:240
Double_t bin6
Definition: EdbShowerRec.h:238
Double_t bin34
Definition: EdbShowerRec.h:241
Double_t bin19
Definition: EdbShowerRec.h:239
Double_t bin48
Definition: EdbShowerRec.h:242
Double_t bin1
Definition: EdbShowerRec.h:238
Double_t bin27
Definition: EdbShowerRec.h:240
Double_t bin43
Definition: EdbShowerRec.h:242
Double_t bin56
Definition: EdbShowerRec.h:243
Double_t bin31
Definition: EdbShowerRec.h:241
Double_t bin9
Definition: EdbShowerRec.h:238
Double_t bin18
Definition: EdbShowerRec.h:239
Double_t bin15
Definition: EdbShowerRec.h:239
Double_t bin8
Definition: EdbShowerRec.h:238
Double_t bin17
Definition: EdbShowerRec.h:239
Double_t bin7
Definition: EdbShowerRec.h:238
Double_t bin10
Definition: EdbShowerRec.h:238
Double_t bin3
Definition: EdbShowerRec.h:238
Double_t bin16
Definition: EdbShowerRec.h:239
Double_t bin33
Definition: EdbShowerRec.h:241

◆ Print()

void EdbShowerRec::Print ( )
4939  {
4940  // Print Function
4941  cout << "-- EdbShowerRec Print --" << endl;
4942 }

◆ PrintEdbPVRec()

void EdbShowerRec::PrintEdbPVRec ( ) const
inline
745  {
746  eAli->Print();
747  };

◆ PrintInitiatorBTs()

void EdbShowerRec::PrintInitiatorBTs ( )
2423 {
2424  // Print the eInBTArray nice...
2425  if (!eInBTArrayIsFilled) {
2426  cout << "void EdbShowerRec::PrintInitiatorBTs() WARNING: eInBTArrayIsFilled="<<eInBTArrayIsFilled<<" . RETURN. "<< endl;
2427  return;
2428  }
2429 
2430  cout << "void EdbShowerRec::PrintInitiatorBTs() eInBTArray->GetEntries()=" << eInBTArray->GetEntries() << endl;
2431 
2432  EdbSegP* seg;
2433  for (int i=0; i< eInBTArray->GetEntries(); ++i) {
2434  seg=(EdbSegP*) eInBTArray->At(i);
2435  seg->PrintNice();
2436  }
2437  return;
2438 }

◆ PrintParameters()

void EdbShowerRec::PrintParameters ( )
4844  {
4845  cout << "void EdbShowerRec::PrintParameters() " << endl;
4846  cout << "eAlgoParameterConeRadius = " << eAlgoParameterConeRadius << endl;
4847  cout << "eAlgoParameterConeAngle = " << eAlgoParameterConeAngle << endl;
4848  cout << "eAlgoParameterConnectionDR = " << eAlgoParameterConnectionDR << endl;
4849  cout << "eAlgoParameterConnectionDT = " << eAlgoParameterConnectionDT << endl;
4850  cout << "eAlgoParameterNPropagation = " << eAlgoParameterNPropagation << endl;
4851  return;
4852 }

◆ PrintRecoShowerArray()

void EdbShowerRec::PrintRecoShowerArray ( )
3476 {
3477  // Print the array for the Reconstructed Showers.
3478  Log(2,"EdbShowerRec::PrintRecoShowerArray","EdbShowerRec::PrintRecoShowerArray");
3479  EdbTrackP* show=0;
3480  for (int i=0; i<GetRecoShowerArrayN(); ++i) {
3481  show=(EdbTrackP*)eRecoShowerArray->At(i);
3482  show->PrintNice();
3483  }
3484  cout << "Printed all " << GetRecoShowerArrayN() << " showers of the eRecoShowerArray" << endl;
3485  Log(2,"EdbShowerRec::PrintRecoShowerArray","EdbShowerRec::PrintRecoShowerArray...done.");
3486  return;
3487 }
Int_t GetRecoShowerArrayN() const
Definition: EdbShowerRec.h:711
void PrintNice()
Definition: EdbPattern.cxx:1262

◆ ReadAffAndZ()

void EdbShowerRec::ReadAffAndZ ( char *  fname,
Float_t *  pZoffs,
Float_t *  a11,
Float_t *  a12,
Float_t *  a21,
Float_t *  a22,
Float_t *  b1,
Float_t *  b2 
)
1859 {
1860  char buf[256];
1861  char key[256];
1862  Int_t id;
1863  Float_t fTranslateX,fTranslateY;
1864 
1865  FILE *fp=fopen(fname,"r");
1866  if (fp==NULL) {
1867  printf("ERROR open file: %s n", fname);
1868  return;
1869  } else
1870  // printf( "Read affine transformation from file: %s\n", fname );
1871  while ( fgets(buf,256,fp)!=NULL ) {
1872 
1873  for ( int i=0; i<(int)strlen(buf); i++ )
1874  if ( buf[i]=='#' ) {
1875  buf[i]='0'; // cut out comments starting from #
1876  break;
1877  }
1878 
1879  if ( sscanf(buf,"%s",key)!=1 ) continue;
1880  if ( !strcmp(key,"INCLUDE") )
1881  {
1882  // sscanf(buf+strlen(key),"%s",name);
1883  //ReadAffAndZ(name,pZoffs);
1884  }
1885  else if ( !strcmp(key,"AFFXY") )
1886  {
1887  sscanf(buf+strlen(key),"%d %f %f %f %f %f %f",&id,a11,a12,a21,a22,b1,b2);
1888  }
1889  else if ( !strcmp(key,"ZLAYER") )
1890  {
1891  sscanf(buf+strlen(key),"%d %f",&id,pZoffs);
1892  }
1893  else if ( !strcmp(key,"VOLUME0") )
1894  {
1895  sscanf(buf+strlen(key),"%f %f",&fTranslateX,&fTranslateY);
1896  }
1897  }
1898  fclose(fp);
1899 }
const char * fname
Definition: mc2raw.cxx:41
fclose(pFile)

◆ ReadPiece()

int EdbShowerRec::ReadPiece ( EdbDataPiece piece,
EdbPattern pat 
)
1904 {
1905  //assuming that piece was initialised correctly
1906 
1907  if (!piece.InitCouplesTree("READ")) return 0;
1908  piece.GetCPData_new( &pat,0,0,0 );
1909  pat.SetSegmentsZ();
1910  pat.Transform( piece.GetLayer(0)->GetAffineXY() );
1911  pat.TransformA( piece.GetLayer(0)->GetAffineTXTY() );
1912  pat.TransformShr( piece.GetLayer(0)->Shr() );
1913  return 1;
1914 }
int InitCouplesTree(const char *mode="READ")
Definition: EdbDataSet.cxx:1244
int GetCPData_new(EdbPattern *pat, EdbPattern *p1=0, EdbPattern *p2=0, TIndex2 *trseg=0)
Definition: EdbDataSet.cxx:797
EdbLayer * GetLayer(int id)
Definition: EdbDataSet.h:86
EdbAffine2D * GetAffineXY()
Definition: EdbLayer.h:120
float Shr() const
Definition: EdbLayer.h:90
EdbAffine2D * GetAffineTXTY()
Definition: EdbLayer.h:121
virtual void Transform(const EdbAffine2D *a)
Definition: EdbVirtual.cxx:154
void TransformA(const EdbAffine2D *affA)
Definition: EdbPattern.cxx:367
void TransformShr(const float shr)
Definition: EdbPattern.cxx:384
void SetSegmentsZ()
Definition: EdbPattern.cxx:275

◆ rec() [1/3]

void EdbShowerRec::rec ( int  num,
int  MAXPLATE,
int  DATA,
int  Ncand,
double *  x0,
double *  y0,
double *  z0,
double *  tx0,
double *  ty0,
double *  chi20,
int *  W0,
double *  P0,
int *  Flag0,
int *  plate0,
int *  id0,
int *  TRid,
double *  Esim,
int  piece2,
int  piece2par,
int  DOWN,
EdbPVRec pvr 
)
298 {
299  // General reconstruction intermediate function to differentiate between upstream
300  // or downstream reco.
301  // This function contains also arrays for Chi2,W,P,Flag of the first BT...
302 
303 // if (DOWN == 1) {
304 // recdown(num,MAXPLATE,DATA,Ncand,x0,y0,z0,tx0,ty0,chi20,W0,P0,Flag0,plate0,id0,TRid,Esim,mcDigitIndexTop0,mcDigitIndexBottom0,piece2, piece2par,pvr);
305 // }
306 // if (DOWN == 0) {
307 // recup(num,MAXPLATE,DATA,Ncand,x0,y0,z0,tx0,ty0,chi20,W0,P0,Flag0,plate0,id0,TRid,Esim,mcDigitIndexTop0,mcDigitIndexBottom0,piece2, piece2par,pvr);
308 // }
309  return;
310 }

◆ rec() [2/3]

void EdbShowerRec::rec ( int  num,
int  MAXPLATE,
int  DATA,
int  Ncand,
double *  x0,
double *  y0,
double *  z0,
double *  tx0,
double *  ty0,
int *  plate0,
int *  id0,
int *  TRid,
double *  Esim,
int *  mcDigitIndexTop,
int *  mcDigitIndexBottom,
int  piece2,
int  piece2par,
int  DOWN,
EdbPVRec pvr 
)

OLD — not used anymore....

NEW — to be used from now on .... (svn. Revision 889)

316 {
317  // Another reconstruction function ...
318  double chi20[10000];
319  double P0[10000];
320  int W0[10000];
321  int Flag0[10000];
322  chi20[0]=-9999999;
323  W0[0]=-9999999;
324  P0[0]=-9999999;
325  Flag0[0]=-9999999;
326  if (DOWN == 1) {
327  recdown(num,MAXPLATE,DATA,Ncand,x0,y0,z0,tx0,ty0,chi20,W0,P0,Flag0,plate0,id0,TRid,Esim,mcDigitIndexTop0,mcDigitIndexBottom0,piece2, piece2par,pvr);
328  }
329  if (DOWN == 0) {
330  recup(num,MAXPLATE,DATA,Ncand,x0,y0,z0,tx0,ty0,chi20,W0,P0,Flag0,plate0,id0,TRid,Esim,mcDigitIndexTop0,mcDigitIndexBottom0,piece2, piece2par,pvr);
331  }
332  return;
333 }
void recup(int num, int MAXPLATE, int DATA, int Ncand, double *x0, double *y0, double *z0, double *tx0, double *ty0, double *chi20, int *W0, double *P0, int *Flag0, int *plate0, int *id0, int *TRid, double *Esim, int *mcDigitIndexTop0, int *mcDigitIndexBottom0, int piece2, int piece2par, EdbPVRec *pvr)
Definition: EdbShowerRec.cxx:940
void recdown(int num, int MAXPLATE, int DATA, int Ncand, double *x0, double *y0, double *z0, double *tx0, double *ty0, double *chi20, int *W0, double *P0, int *Flag0, int *plate0, int *id0, int *TRid, double *Esim, int *mcDigitIndexTop0, int *mcDigitIndexBottom0, int piece2, int piece2par, EdbPVRec *pvr)
Definition: EdbShowerRec.cxx:389
int DOWN
Definition: shower_btr.C:16

◆ rec() [3/3]

void EdbShowerRec::rec ( TObjArray *  sarr,
EdbPVRec pvr 
)
338 {
339  // Another reconstruction function ...
340  int Ncand = 0;
341  double x0[10000];
342  double y0[10000];
343  double z0[10000];
344  double tx0[10000];
345  double ty0[10000];
346  double chi20[10000];
347  double P0[10000];
348  int W0[10000];
349  int Flag0[10000];
350  int TRid[10000];
351  double Esim[10000];
352  int id[10000];
353  int Pid[10000];
354  float Zoff;
355  int nentries = sarr->GetEntries();
356  EdbSegP *s = 0;
357  for (int i=0; i<nentries; i++) {
358 
359  s= (EdbSegP*)sarr->At(i);
360  x0[Ncand] = s->X();
361  y0[Ncand] = s->Y();
362  Zoff = s->Z();
363  z0[Ncand] = Zoff;
364  tx0[Ncand] = s->TX();
365  ty0[Ncand] = s->TY();
366  chi20[Ncand] = s->Chi2();
367  W0[Ncand] = s->W();
368  P0[Ncand] = s->P();
369  Flag0[Ncand] = s->Flag();
370  TRid[Ncand] = s->MCEvt(); //this has to be a positive number
371  Esim[Ncand] = s->P();
372  id[Ncand] = s->ID();
373  Pid[Ncand] = Zoff/1273+1;
374  //cout << s->X() << " " << s->Y() << " " << s->Z() << " " << s->TX() << " " << s->TY() << " " << Pid[Ncand] << " " << Esim[Ncand] << " " << TRid[Ncand] << endl;
375  //cout << chi20[Ncand] << " " << W0[Ncand] << " " << P0[Ncand] << " " << Flag0[Ncand] << endl;
376  Ncand++;
377  }
378  rec(0,57,0,Ncand,x0,y0,z0,tx0,ty0,chi20,W0,P0,Flag0,Pid,id,TRid,Esim,1,1,1,pvr);
379 
380 }

◆ recdown()

void EdbShowerRec::recdown ( int  num,
int  MAXPLATE,
int  DATA,
int  Ncand,
double *  x0,
double *  y0,
double *  z0,
double *  tx0,
double *  ty0,
double *  chi20,
int *  W0,
double *  P0,
int *  Flag0,
int *  plate0,
int *  id0,
int *  TRid,
double *  Esim,
int *  mcDigitIndexTop0,
int *  mcDigitIndexBottom0,
int  piece2,
int  piece2par,
EdbPVRec pvr 
)
390 {
391  // Old style implementation of downstream reconstruction.
392  // Starts with arrays that contain Initiator Basetracks,
393  // and uses the EdbPVRec object for source data.
394  // Reconstruction algorithm is the standard "ConeTube" basetrack
395  // connection algorithm.
396  // Reconstructed Showers are first saved as Float_t data in a
397  // Tree, afterwards they will be converted into an EdbTrackP array.
398  //
399 
400  // shower tree definition
401  treesaveb = new TTree("treebranch","tree of branchtrack");
402  treesaveb->Branch("number_eventb",&number_eventb,"number_eventb/I");
403  treesaveb->Branch("sizeb",&sizeb,"sizeb/I");
404  treesaveb->Branch("sizeb15",&sizeb15,"sizeb15/I");
405  treesaveb->Branch("sizeb20",&sizeb20,"sizeb20/I");
406  treesaveb->Branch("sizeb30",&sizeb30,"sizeb30/I");
407  treesaveb->Branch("E_MC",&E_MC,"E_MC/F");
408 
409  treesaveb->Branch("isizeb",&isizeb,"isizeb/I");
410  treesaveb->Branch("showerID",&showerID,"showerID/I");
411  treesaveb->Branch("idb",idb,"idb[sizeb]/I");
412  treesaveb->Branch("plateb",plateb,"plateb[sizeb]/I");
413  treesaveb->Branch("xb",xb,"xb[sizeb]/F");
414  treesaveb->Branch("yb",yb,"yb[sizeb]/F");
415  treesaveb->Branch("zb",zb,"zb[sizeb]/F");
416  treesaveb->Branch("txb",txb,"txb[sizeb]/F");
417  treesaveb->Branch("tyb",tyb,"tyb[sizeb]/F");
418  treesaveb->Branch("nfilmb",nfilmb,"nfilmb[sizeb]/I");
419  treesaveb->Branch("ntrace1simub",ntrace1simub,"ntrace1simu[sizeb]/I");
420  treesaveb->Branch("ntrace2simub",ntrace2simub,"ntrace2simu[sizeb]/I"); // s->W()
421  treesaveb->Branch("ntrace3simub",ntrace3simub,"ntrace3simu[sizeb]/F"); // s->P()
422  treesaveb->Branch("ntrace4simub",ntrace4simub,"ntrace4simu[sizeb]/I"); // s->Flag()
423  treesaveb->Branch("chi2btkb",chi2btkb,"chi2btkb[sizeb]/F");
424  treesaveb->Branch("deltarb",deltarb,"deltarb[sizeb]/F");
425  treesaveb->Branch("deltathetab",deltathetab,"deltathetab[sizeb]/F");
426  treesaveb->Branch("deltaxb",deltaxb,"deltaxb[sizeb]/F");
427  treesaveb->Branch("deltayb",deltayb,"deltayb[sizeb]/F");
428  treesaveb->Branch("tagprimary",tagprimary,"tagprimary[sizeb]/F");
429  treesaveb->Branch("purityb",&purityb,"purityb/F");
430  treesaveb->Branch("mcDigitIndexTop",mcDigitIndexTop,"mcDigitIndexTop[sizeb]/I");
431  treesaveb->Branch("mcDigitIndexBottom",mcDigitIndexBottom,"mcDigitIndexBottom[sizeb]/I");
432 
433  fileout = new TFile("shower1.root","RECREATE");
434 
435  //additionally needed, if not given by constructor.
436  // this is only a temporary solution. When giving over the constructor with
437  // segments of EdbSegP class, they will contain the needed information then.
438  cout << " void EdbShowerRec::recdown() Additionally needed, if not given by constructor: " << endl;
439  cout << " void EdbShowerRec::recdown() this is only a temporary solution. When giving over the constructor with " << endl;
440  cout << " void EdbShowerRec::recdown() segments of EdbSegP class, they will contain the needed information then." << endl;
441  cout << " void EdbShowerRec::recdown() For the momemt, if Chi2, W,P,Flag of the starting BT is not given..." << endl;
442  cout << " void EdbShowerRec::recdown() It is assumed to be ... -9999999 ..." << endl;
443 // float chi20[10000];
444 // float P0[10000];
445 // int W0[10000];
446 // int Flag0[10000];
447 // chi20[0]=-9999999;
448 // W0[0]=-9999999;
449 // P0[0]=-9999999;
450 // Flag0[0]=-9999999;
451 
452  float Z0, SX0,SY0;
453  float X0, Y0, Xss,Yss;
454  float Delta, rayon,rayon2, diff, delta;
455  float Xe[4], Ye[4];
456  char fname2[128];
457 
458  char nme[64];
459  float a11, a12, a21, a22, bb1, bb2;
460  a11=1;
461  a12=0;
462  a21=0;
463  a22=1;
464  bb1=0;
465  bb2=0;
466  float Zoff;
467  double ZZ0[60];
468  int ind;
469  const Int_t eNSM = 10000;
470  const Int_t eNTM = 1000;
471 
472  TArrayF xbb(eNTM*eNSM);
473  TArrayF ybb(eNTM*eNSM);
474  TArrayF zbb(eNTM*eNSM);
475  TArrayF txbb(eNTM*eNSM);
476  TArrayF tybb(eNTM*eNSM);
477  TArrayF chi2bb(eNTM*eNSM);
478  TArrayI sigbb(eNTM*eNSM);
479  TArrayI wbb(eNTM*eNSM);
480  TArrayI add(eNTM*eNSM);
481  TArrayF Pbb(eNTM*eNSM);
482  TArrayI Flagbb(eNTM*eNSM);
483 
484  for (int i=0; i<eNSM; i++)
485  {
486  for (int j=0; j<eNTM; j++)
487  {
488  ind = i*eNTM+j;
489  xbb[ind];
490  ybb[ind];
491  zbb[ind];
492  txbb[ind];
493  tybb[ind];
494  chi2bb[ind];
495  wbb[ind];
496  sigbb[ind];
497  Pbb[ind];
498  Flagbb[ind];
499  }
500  }
501 
502  TList *eS = new TList;
503  for (int ii=0; ii<Ncand; ii++)
504  {
505  EdbShowerRec* shower = new EdbShowerRec();
506 
507  shower->SetID(ii);
508  shower->SetX0(x0[ii]);
509  shower->SetY0(y0[ii]);
510  shower->SetZ0(z0[ii]);
511  shower->SetTx(tx0[ii]);
512  shower->SetTy(ty0[ii]);
513  shower->SetTrID(TRid[ii]);
514  shower->SetChi20(chi20[ii]);
515  shower->SetW0(W0[ii]);
516  shower->SetP0(P0[ii]);
517  shower->SetFlag0(Flag0[ii]);
518 
519 
520  shower->SetDeltarb(200.,0);
521  shower->SetDelthetab(0.5,0);
522  shower->SetPrimary(0,0);
523  shower->SetNFilmb(1,0);
524  shower->SetIDb(id0[ii],0);
525  shower->SetPlateb(plate0[ii],0);
526  shower->SetXb(x0[ii],0);
527  shower->SetYb(y0[ii],0);
528  shower->SetZb(z0[ii],0);
529  shower->SetTXb(tx0[ii],0);
530  shower->SetTYb(ty0[ii],0);
531  shower->SetChi2b(chi20[ii],0);
532  shower->SetWb(W0[ii],0);
533  shower->SetPb(P0[ii],0);
534  shower->SetFlagb(Flag0[ii],0);
535  shower->SetmcDigitIndexTop(mcDigitIndexTop0[ii],0);
536  shower->SetmcDigitIndexBottom(mcDigitIndexBottom0[ii],0);
537 
538 
539  ind = 0 + ii*eNTM;
540 
541  xbb[ind] = x0[ii];
542  ybb[ind] = y0[ii];
543  zbb[ind] = z0[ii];
544  txbb[ind] = tx0[ii];
545  tybb[ind] = ty0[ii];
546  chi2bb[ind] = chi20[ii];
547  wbb[ind] = W0[ii];
548  Pbb[ind] = P0[ii];
549  Flagbb[ind] = Flag0[ii];
550 
551  add[ii] = 1;
552  eS->Add(shower);
553  }
554 
555  EdbShowerRec* a=0;
556 // save the Z position of the first sheet
557  /*
558  if (num<10)
559  {
560  if (piece2par<10)
561  {
562  sprintf(nme,"%s/0%d_00%d.par","par",num,piece2par);
563  }
564  else
565  {
566  sprintf(nme,"%s/0%d_0%d.par","par",num,piece2par);
567  }
568  }
569  else
570  {
571  if (piece2par<10)
572  {
573  sprintf(nme,"%s/%d_00%d.par","par",num,piece2par);
574  }
575  else
576  {
577  sprintf(nme,"%s/%d_0%d.par","par",num,piece2par);
578  }
579  }
580  ReadAffAndZ(nme,&Zoff,&a11,&a12,&a21,&a22,&bb1,&bb2 );
581  // ZZ0[0]= z0[0];
582  ZZ0[0]= Zoff;
583  */
584  int nntr;
585  int ok;
586  int max=0 ;
587  int index = 0;
588  double rr;
589 
590 // float Rcut = 180.;
591 // float Tcut = 0.18;
592 // float Rcut = 150.;
593 // float Tcut = 0.15;
594  float Rcut = eAlgoParameterConnectionDR;
595  float Tcut = eAlgoParameterConnectionDT;
596 
597  float mini[5] = {-20000.,-20000.,-1,-1,0};
598  float maxi[5] = {20000.,20000.,1,1,100};
599  /*
600  for (int d=num+1; d<MAXPLATE+1; d++) {
601  index++;
602  printf( "Process plate nr (w.r.t.first BT) : %d\n",d);
603 
604  if (d<10)
605  {
606  if (piece2par<10)
607  {
608  sprintf(nme,"%s/0%d_00%d.par","par",d,piece2par);
609  sprintf(fname2,"%s/0%d_00%d.cp.root","data",d,piece2);
610  }
611  else
612  {
613  sprintf(nme,"%s/0%d_0%d.par","par",d,piece2par);
614  sprintf(fname2,"%s/0%d_0%d.cp.root","data",d,piece2);
615  }
616  }
617  else
618  {
619  if (piece2par<10)
620  {
621  sprintf(nme,"%s/%d_00%d.par","par",d,piece2par);
622  sprintf(fname2,"%s/%d_00%d.cp.root","data",d,piece2);
623  }
624  else
625  {
626  sprintf(nme,"%s/%d_0%d.par","par",d,piece2par);
627  sprintf(fname2,"%s/%d_0%d.cp.root","data",d,piece2);
628  }
629  }
630  */
631  EdbPVRec ali;
632  EdbPattern *pat=0;
633  EdbPattern *pat2=0;
634  EdbDataPiece Piece;
635  /*
636  InitPiece(Piece,fname2,nme);
637  pat2 = new EdbPattern(0.,0., Piece.GetLayer(0)->Z(),100 );
638  Z0 = Piece.GetLayer(0)->Z();
639  ReadPiece(Piece, *pat2);
640 
641  ReadAffAndZ(nme,&Zoff,&a11,&a12,&a21,&a22,&bb1,&bb2 );
642 
643 
644  Z0 = Zoff;
645  ZZ0[index] = Zoff;
646  */
647 // EdbPVRec *pvr;
648 // LoadEdbPVRec();
649 // pvr= GetEdbPVRec();
650 
651 
652 
653  for (int d=0; d<pvr->Npatterns(); d++) {
654  index++;
655  printf( "Process plate nr (w.r.t.first BT) : %d\r",d+1);
656  if (d==pvr->Npatterns()-1) printf("\n");
657  pat2 = pvr->GetPattern(d);
658 
659  Z0 = pat2->Z();
660  ZZ0[index] = pat2->Z();
661 
662  int ii =0;
663 
664  TIter next(eS);
665  while ((a=(EdbShowerRec*)next()))
666  {
667 
668  //cout << " DEBUG:: a->GetZ0() = " << a->GetZ0() << " Z0= " << Z0 << endl;
669 
670  if (a->GetZ0()>Z0) ii++;
671  if (a->GetZ0()>Z0) continue;
672  Xss = a->GetX0() + fabs(Z0-a->GetZ0())*a->GetTx();
673  Yss = a->GetY0() + fabs(Z0-a->GetZ0())*a->GetTy();
674 
675 
676  mini[0] = Xss-1250.;
677  mini[1] = Yss-1250.;
678  mini[2] = -0.5;
679  mini[3] = -0.5;
680  mini[4] = 0.;
681  maxi[0] = Xss+1250.;
682  maxi[1] = Yss+1250.;
683  maxi[2] = 0.5;
684  maxi[3] = 0.5;
685  maxi[4] = 100;
686 
687  pat = pat2->ExtractSubPattern(mini,maxi);
688  ali.AddPattern(pat);
689  //ali.Print(); cout << "This was ali.Print(); "<< endl;
690 
691  EdbSegP *ss=0;
692 
693  int incr=-1;
694 
695  for (int ip=0; ip<ali.Npatterns(); ip++) {
696  incr++;
697  };
698 
699  for (int i=0; i<ali.GetPattern(incr)->N(); i++)
700  {
701  ss = ali.GetPattern(incr)->GetSegment(i);
702 // ss->PrintNice();
703  ok = 0;
704  if (DATA ==1) {
705  X0 = a11*ss->X() + a12*ss->Y() + bb1;
706  Y0 = a21*ss->X() + a22*ss->Y() + bb2;
707 
708  SX0 = a11*ss->TX()+ a12*ss->TY() ;
709  SY0 = a21*ss->TX()+a22*ss->TY();
710  }
711  else
712  {
713  X0 = ss->X() ;
714  Y0 = ss->Y() ;
715  SX0 = ss->TX();
716  SY0 = ss->TY();
717  }
718 
719  if (fabs(SX0)>0.4) continue;
720  if (fabs(SY0)>0.4) continue;
721 
722  //if ( a->GetTrID() == ss->MCEvt()|| ss->MCEvt()<0)
723  //{
724  //Delta = 20.+ fabs(0.02*fabs(Z0-a->GetZ0())); // cone with 20 mrad
725  //rayon = 800.; // cylinder with 800 microns radius
726  Delta = 20.+ fabs(eAlgoParameterConeAngle*fabs(Z0-a->GetZ0())); // cone with eAlgoParameterConeAngle mrad
727  rayon = eAlgoParameterConeRadius; // cylinder with eAlgoParameterConeRadius microns radius
728 
729  diff = sqrt((X0-Xss)*(X0-Xss)+(Y0-Yss)*(Y0-Yss));
730 
731 // cout << "diff = " << diff << endl;
732 // ss->PrintNice();
733 
734  if ( diff<rayon&&diff<Delta )
735  {
736  if (index==1) max = 1;
737  if (index==2) max = 2;
738  if (index>2) max = 3;
739 
740  for (int el=0; el<max; el++)
741  {
742  //extrapolation in previous plate
743  Xe[el] = X0 - fabs(Z0-ZZ0[index-el-1])*SX0;
744  Ye[el] = Y0 - fabs(Z0-ZZ0[index-el-1])*SY0;
745  nntr = add[ii];
746 
747  for (int l2=0; l2<nntr; l2++)
748  {
749  ind = l2 + ii*eNTM;
750 
751  if (fabs(a->GetZb(l2)-(Z0-(el+1)*1273))<500)
752  {
753 // ss->PrintNice();
754 
755  rayon2 = sqrt((Xe[el]-a->GetXb(l2))*(Xe[el]-a->GetXb(l2))+((Ye[el]-a->GetYb(l2))*(Ye[el]-a->GetYb(l2))));
756  delta = sqrt((SX0-a->GetTXb(l2))*(SX0-a->GetTXb(l2))+((SY0-a->GetTYb(l2))*(SY0-a->GetTYb(l2))));
757  if (rayon2<Rcut&&delta<Tcut)
758  {
759 
760  if (ok==0)
761  {
762  ind = add[ii] + ii*eNTM;
763 
764  xbb[ind] = X0 ;
765  ybb[ind] = Y0 ;
766  zbb[ind] = Z0 ;
767  txbb[ind] = SX0 ;
768  tybb[ind] = SY0 ;
769  a->SetIDb(ss->ID(),add[ii]);
770  a->SetPlateb(d,add[ii]);
771  a->SetXb(X0,add[ii]);
772  a->SetYb(Y0,add[ii]);
773  a->SetZb(Z0,add[ii]);
774  a->SetTXb(SX0,add[ii]);
775  a->SetTYb(SY0,add[ii]);
776  a->SetDeltarb(rayon2,add[ii]);
777  a->SetDelthetab(delta,add[ii]);
778  //a->SetNFilmb( index+1,add[ii]);
779  rr = (Z0-a->GetZ0())/1273;
780  a->SetNFilmb(int(round(rr)+1),add[ii]);
781  if (ss->MCEvt()==a->GetTrID()) sigbb[ind] = 1;
782  if (ss->MCEvt()<0) sigbb[ind] = 0;
783  chi2bb[ind] = ss->Chi2();
784  wbb[ind] = int(ss->W());
785  Pbb[ind] = ss->P();
786  Flagbb[ind] = ss->Flag();
787 
788  a->SetmcDigitIndexTop(ss->MCEvt(),add[ii]);
789  a->SetmcDigitIndexBottom(ss->MCTrack(),add[ii]);
790  ok =1;
791 
792 // ss->PrintNice();
793 
794  add[ii]++;
795  }
796  else if (ok==1&&rayon2<a->GetDeltarb(add[ii]-1))
797  {
798  a->SetDeltarb(rayon2,add[ii]-1);
799  a->SetDelthetab(delta,add[ii]-1);
800 
801  }
802  }
803  }
804  }
805  }
806  }
807  //}
808  }
809  ii++;
810  }
811  }
812 
813 
814  int i = 0;
815  int loopcount=0;
816  int evtid = 0;
817  int nMC=0;
818  TIter next(eS);
819  while ((a=(EdbShowerRec*)next()))
820  {
821 // cout << "while ((a=(EdbShowerRec*)next())) loopcount= " << loopcount << endl;
822 
823  number_eventb = a->GetTrID();
824  sizeb = add[i];
825  a->SetSize(add[i]);
826  sizeb15 = 0;
827  sizeb20 = 0;
828  sizeb30 = 0;
829  isizeb = 0;
830  purityb = 0;
831  nMC=0;
832  E_MC = Esim[i];
833 
834  for (int j=0; j<add[i]; j++)
835  {
836  if ((a->GetZb(j)>a->GetZ0()+5000)&&isizeb==0) isizeb = 1; //cross at least 4 plates
837  if (a->GetNFilmb(j)<16) sizeb15++;
838  if (a->GetNFilmb(j)<21) sizeb20++;
839  if (a->GetNFilmb(j)<31) sizeb30++;
840  if (a->GetNFilmb(j)==15) isizeb=15;
841  if (a->GetNFilmb(j)==20) isizeb=20;
842  if (a->GetNFilmb(j)==30) isizeb=30;
843  if (a->GetNFilmb(j)==50) isizeb=50;
844  }
845  a->SetSize15(sizeb15);
846  a->SetSize20(sizeb20);
847  a->SetSize30(sizeb30);
848 
849  for (int j=0; j<add[i]; j++)
850  {
851  idb[j] = a->GetIDb(j);
852  //plateb[j] = a->GetPlateb(j);
853  plateb[j] = floor(a->GetZb(j)/1273)+31;// F. Brunet : ePlate setters and getters obsolet with new plate thickness
854  xb[j] = a->GetXb(j);
855  yb[j] = a->GetYb(j);
856  zb[j] = a->GetZb(j);
857  txb[j] = a->GetTXb(j);
858  tyb[j] = a->GetTYb(j);
859  deltarb[j] = a->GetDeltarb(j);
860  deltathetab[j] = a->GetDeltathetab(j);
861  nfilmb[j] = a->GetNFilmb(j);
862  tagprimary[j] = 0;
863 
864  mcDigitIndexTop[j] = a->GetmcDigitIndexTop(j);
865  mcDigitIndexBottom[j] = a->GetmcDigitIndexBottom(j);
866 
867  //gEDBDEBUGLEVEL=3;
868  if (gEDBDEBUGLEVEL>2) cout << xb[j] << " " << yb[j] << " " << zb[j] << " " << txb[j] << " " << tyb[j] << " " << sizeb << endl;
869 
870  if (j==0) tagprimary[j] = 1;
871  if (j==0) chi2btkb[j] = chi2bb[j+i*eNTM];
872  if (j>0) chi2btkb[j] = chi2bb[j+i*eNTM];
873  // if (j==0) ntrace1simub[j]= 1;
874  if (j==0&&a->GetTrID()>=0) ntrace1simub[j]= 1;
875  if (j==0&&a->GetTrID()<0) ntrace1simub[j]= 0;
876 
877  if (j>0) ntrace1simub[j] = sigbb[j+i*eNTM];
878  if (j==0) ntrace2simub[j]= wbb[j+i*eNTM];
879  if (j>0) ntrace2simub[j] = wbb[j+i*eNTM];
880  ntrace3simub[j]= Pbb[j+i*eNTM];
881  ntrace4simub[j]= Flagbb[j+i*eNTM];
882 
883  //cout << " j= " << j << " i= " << i << " eNTM= " << eNTM <<endl;
884  //cout << " j+i*eNTM= " << j+i*eNTM << " chi2bb[j+i*eNTM]; = " << chi2bb[j+i*eNTM] << " eNTM= " << eNTM <<endl;
885 
886  if (ntrace1simub[j]>=1) ++nMC;
887  }
888  if (sizeb>0) purityb=float(nMC)/float(sizeb);
889  if (isizeb > 0)//cross at least 4 plates
890  {
891  showerID = evtid;
892  treesaveb->Fill();
893  evtid++;
894  }
895  i++;
896  }
897 
898  eShowersN=treesaveb->GetEntries();
899  treesaveb->Show(0);
900  SaveResults();
901  NeuralNet();
902 
903 
904  //CalculateEnergyValues();
905  // deprecated since were going to have the transition to EdbShowerAlg, which does energy...
906  // New... still to check:
907  //TransferTreebranchShowerTreeIntoShowerObjectArray
908 
909 
910  // Open File. Get Tree.
911  TFile *_file0 = new TFile("Shower2.root");
912  TTree *tr = (TTree*)_file0->Get("treebranch");
914  TObjArray* RecoShowerArray = GetRecoShowerArray() ;
915  // Check the number of entries:
916  cout << tr->GetEntries() << endl;
917  cout << GetRecoShowerArrayN() << endl;
918  // Instantate ShowerAlgorithmEnergy Class
920  // Run Shower Energy Algorith on all shower/tracks
922  // Write the values then into "Shower.root" (old Shower.root will be replaced(and backuped)!");
923  ShowerAlgEnergyInstance->WriteNewRootFile("Shower2.root","treebranch");
924 
925 #ifndef WIN32
926  strcpy(cmd,"rm shower1.root");
927  gSystem->Exec(cmd);
928  strcpy(cmd,"rm Shower2.root");
929  gSystem->Exec(cmd);
930 #else
931  gSystem->Exec("del shower1.root");
932  gSystem->Exec("del Shower2.root");
933 #endif
934 
935  return;
936 }
int round(const T &x)
Definition: Functions.hh:83
void d()
Definition: RecDispEX.C:381
EdbShowerAlgESimple * ShowerAlgEnergyInstance
Definition: Shower_E_FromEdbTrackP.C:6
TObjArray * RecoShowerArray
Definition: Shower_E_FromShowerRoot.C:12
Expr< UnaryOp< Fabs< T >, Expr< A, T, D >, T >, T, D > fabs(const Expr< A, T, D > &rhs)
Definition: UnaryOperators.hh:96
Definition: EdbDataSet.h:25
EdbPattern * ExtractSubPattern(float min[5], float max[5], int MCevt=-1)
Definition: EdbPattern.cxx:1593
void AddPattern(EdbPattern *pat)
Definition: EdbPattern.cxx:1867
Definition: EdbShowerAlg.h:323
void WriteNewRootFile()
Definition: EdbShowerAlg.h:576
void DoRun()
Definition: EdbShowerAlg.cxx:2730
Definition: EdbShowerRec.h:25
void SetIDb(int idb2, int i)
Definition: EdbShowerRec.h:465
void SetZ0(float z)
Definition: EdbShowerRec.h:398
void SetmcDigitIndexTop(int mcDt, int i)
Definition: EdbShowerRec.h:507
void SetXb(float xb, int i)
Definition: EdbShowerRec.h:462
void SetPlateb(int plate2, int i)
Definition: EdbShowerRec.h:468
void SetChi20(float chi2)
Definition: EdbShowerRec.h:401
void SetFlag0(int flag)
Definition: EdbShowerRec.h:410
Float_t GetDeltarb(int i) const
Definition: EdbShowerRec.h:346
void SetTx(float tx)
Definition: EdbShowerRec.h:419
void SetY0(float y)
Definition: EdbShowerRec.h:395
void SetPrimary(int tagprimary, int i)
Definition: EdbShowerRec.h:504
void SetYb(float yb, int i)
Definition: EdbShowerRec.h:471
char cmd[500]
Definition: EdbShowerRec.h:251
void SetX0(float x)
Definition: EdbShowerRec.h:392
void SetZb(float zb, int i)
Definition: EdbShowerRec.h:474
TObjArray * GetRecoShowerArray() const
Definition: EdbShowerRec.h:704
void SetmcDigitIndexBottom(int mcDb, int i)
Definition: EdbShowerRec.h:510
void SetDelthetab(float deltathetab, int i)
Definition: EdbShowerRec.h:501
void SetW0(int w)
Definition: EdbShowerRec.h:404
void SetTy(float ty)
Definition: EdbShowerRec.h:422
void SetFlagb(int flag, int i)
Definition: EdbShowerRec.h:492
void SetTYb(float tyb, int i)
Definition: EdbShowerRec.h:480
void SetID(int id)
Definition: EdbShowerRec.h:388
void SetChi2b(float chi2b, int i)
Definition: EdbShowerRec.h:483
void TransferTreebranchShowerTreeIntoShowerObjectArray(TTree *treebranch)
Definition: EdbShowerRec.cxx:4597
void SetNFilmb(int nfilmb, int i)
Definition: EdbShowerRec.h:495
void SetWb(int w, int i)
Definition: EdbShowerRec.h:486
TFile * fileout
Definition: EdbShowerRec.h:218
EdbDataProc * a
Definition: EdbShowerRec.h:236
void SetP0(float p)
Definition: EdbShowerRec.h:407
void SaveResults()
Definition: EdbShowerRec.cxx:276
void SetPb(float p, int i)
Definition: EdbShowerRec.h:489
void SetTXb(float txb, int i)
Definition: EdbShowerRec.h:477
void SetDeltarb(float deltarb, int i)
Definition: EdbShowerRec.h:498
void SetTrID(int id)
Definition: EdbShowerRec.h:425
ss
Definition: energy.C:62
strcpy(cmd,"cp Shower.root Shower2.root")
float Z0
Definition: hwinit.C:67

◆ recup()

void EdbShowerRec::recup ( int  num,
int  MAXPLATE,
int  DATA,
int  Ncand,
double *  x0,
double *  y0,
double *  z0,
double *  tx0,
double *  ty0,
double *  chi20,
int *  W0,
double *  P0,
int *  Flag0,
int *  plate0,
int *  id0,
int *  TRid,
double *  Esim,
int *  mcDigitIndexTop0,
int *  mcDigitIndexBottom0,
int  piece2,
int  piece2par,
EdbPVRec pvr 
)
941 {
942 
943 // shower tree definition
944 
945  treesaveb = new TTree("treebranch","tree of branchtrack");
946  treesaveb->Branch("number_eventb",&number_eventb,"number_eventb/I");
947  treesaveb->Branch("sizeb",&sizeb,"sizeb/I");
948  treesaveb->Branch("sizeb15",&sizeb15,"sizeb15/I");
949  treesaveb->Branch("sizeb20",&sizeb20,"sizeb20/I");
950  treesaveb->Branch("sizeb30",&sizeb30,"sizeb30/I");
951  treesaveb->Branch("E_MC",&E_MC,"E_MC/F");
952  treesaveb->Branch("idb",idb,"idb[sizeb]/I");
953  treesaveb->Branch("plateb",plateb,"plateb[sizeb]/I");
954  treesaveb->Branch("showerID",&showerID,"showerID/I");
955  treesaveb->Branch("isizeb",&isizeb,"isizeb/I");
956  treesaveb->Branch("xb",xb,"xb[sizeb]/F");
957  treesaveb->Branch("yb",yb,"yb[sizeb]/F");
958  treesaveb->Branch("zb",zb,"zb[sizeb]/F");
959  treesaveb->Branch("txb",txb,"txb[sizeb]/F");
960  treesaveb->Branch("tyb",tyb,"tyb[sizeb]/F");
961  treesaveb->Branch("nfilmb",nfilmb,"nfilmb[sizeb]/I");
962  treesaveb->Branch("ntrace1simub",ntrace1simub,"ntrace1simu[sizeb]/I");
963  treesaveb->Branch("ntrace2simub",ntrace2simub,"ntrace2simu[sizeb]/I");
964  treesaveb->Branch("ntrace3simub",ntrace3simub,"ntrace3simu[sizeb]/F");
965  treesaveb->Branch("ntrace4simub",ntrace4simub,"ntrace4simu[sizeb]/I");
966  treesaveb->Branch("chi2btkb",chi2btkb,"chi2btkb[sizeb]/F");
967  treesaveb->Branch("deltarb",deltarb,"deltarb[sizeb]/F");
968  treesaveb->Branch("deltathetab",deltathetab,"deltathetab[sizeb]/F");
969  treesaveb->Branch("deltaxb",deltaxb,"deltaxb[sizeb]/F");
970  treesaveb->Branch("deltayb",deltayb,"deltayb[sizeb]/F");
971  treesaveb->Branch("tagprimary",tagprimary,"tagprimary[sizeb]/F");
972  treesaveb->Branch("purityb",&purityb,"purityb/F");
973  treesaveb->Branch("mcDigitIndexTop",mcDigitIndexTop,"mcDigitIndexTop[sizeb]/I");
974  treesaveb->Branch("mcDigitIndexBottom",mcDigitIndexBottom,"mcDigitIndexBottom[sizeb]/I");
975 
976  fileout = new TFile("shower1.root","RECREATE");
977 
978  //additionally needed, if not given by constructor.
979  // this is only a temporary solution. When giving over the constructor with
980  // segments of EdbSegP class, they will contain the needed information then.
981  cout << " void EdbShowerRec::recdown() Additionally needed, if not given by constructor: " << endl;
982  cout << " void EdbShowerRec::recdown() this is only a temporary solution. When giving over the constructor with " << endl;
983  cout << " void EdbShowerRec::recdown() segments of EdbSegP class, they will contain the needed information then." << endl;
984  cout << " void EdbShowerRec::recdown() For the momemt, if Chi2, W,P,Flag of the starting BT is not given..." << endl;
985  cout << " void EdbShowerRec::recdown() It is assumed to be ... -9999999 ..." << endl;
986 // float chi20[10000];
987 // float P0[10000];
988 // int W0[10000];
989 // int Flag0[10000];
990 // chi20[0]=-9999999;
991 // W0[0]=-9999999;
992 // P0[0]=-9999999;
993 // Flag0[0]=-9999999;
994 
995  float Z0, SX0,SY0;
996  float X0, Y0, Xss,Yss;
997  float Delta, rayon,rayon2, diff, delta;
998  float Xe[4], Ye[4];
999  char fname2[128];
1000 
1001  char nme[64];
1002  float a11, a12, a21, a22, bb1, bb2;
1003  a11=1;
1004  a12=0;
1005  a21=0;
1006  a22=1;
1007  bb1=0;
1008  bb2=0;
1009  float Zoff;
1010  double ZZ0[57];
1011  int ind;
1012  const Int_t eNSM = 10000;
1013  const Int_t eNTM = 1000;
1014 
1015  TArrayF xbb(eNTM*eNSM);
1016  TArrayF ybb(eNTM*eNSM);
1017  TArrayF zbb(eNTM*eNSM);
1018  TArrayF txbb(eNTM*eNSM);
1019  TArrayF tybb(eNTM*eNSM);
1020  TArrayI sigbb(eNTM*eNSM);
1021  TArrayF chi2bb(eNTM*eNSM);
1022  TArrayI wbb(eNTM*eNSM);
1023  TArrayI add(eNTM*eNSM);
1024  TArrayF Pbb(eNTM*eNSM);
1025  TArrayI Flagbb(eNTM*eNSM);
1026 
1027  for (int i=0; i<eNSM; i++)
1028  {
1029  for (int j=0; j<eNTM; j++)
1030  {
1031  ind = i*eNTM+j;
1032  xbb[ind];
1033  ybb[ind];
1034  zbb[ind];
1035  txbb[ind];
1036  tybb[ind];
1037  sigbb[ind];
1038  wbb[ind];
1039  chi2bb[ind];
1040  Pbb[ind];
1041  Flagbb[ind];
1042  }
1043  }
1044 
1045  TList *eS = new TList;
1046 
1047  for (int ii=0; ii<Ncand; ii++)
1048  {
1049  EdbShowerRec* shower = new EdbShowerRec();
1050 
1051  shower->SetID(ii);
1052  shower->SetX0(x0[ii]);
1053  shower->SetY0(y0[ii]);
1054  shower->SetZ0(z0[ii]);
1055  shower->SetTx(tx0[ii]);
1056  shower->SetTy(ty0[ii]);
1057  shower->SetTrID(TRid[ii]);
1058  shower->SetChi20(chi20[ii]);
1059  shower->SetW0(W0[ii]);
1060  shower->SetP0(P0[ii]);
1061  shower->SetFlag0(Flag0[ii]);
1062 
1063  shower->SetDeltarb(200.,0);
1064  shower->SetDelthetab(0.5,0);
1065  shower->SetPrimary(0,0);
1066  shower->SetNFilmb(1,0);
1067  shower->SetIDb(id0[ii],0);
1068  shower->SetPlateb(plate0[ii],0);
1069  shower->SetXb(x0[ii],0);
1070  shower->SetYb(y0[ii],0);
1071  shower->SetZb(z0[ii],0);
1072  shower->SetTXb(tx0[ii],0);
1073  shower->SetTYb(ty0[ii],0);
1074  shower->SetChi2b(chi20[ii],0);
1075  shower->SetWb(W0[ii],0);
1076  shower->SetPb(P0[ii],0);
1077  shower->SetFlagb(Flag0[ii],0);
1078  shower->SetmcDigitIndexTop(mcDigitIndexTop0[ii],0);
1079  shower->SetmcDigitIndexBottom(mcDigitIndexBottom0[ii],0);
1080 
1081  ind = 0 + ii*eNTM;
1082 
1083  xbb[ind] = x0[ii];
1084  ybb[ind] = y0[ii];
1085  zbb[ind] = z0[ii];
1086  txbb[ind] = tx0[ii];
1087  tybb[ind] = ty0[ii];
1088  chi2bb[ind] = chi20[ii];
1089  wbb[ind] = W0[ii];
1090  Pbb[ind] = P0[ii];
1091  Flagbb[ind] = Flag0[ii];
1092 
1093  add[ii] = 1;
1094  eS->Add(shower);
1095 
1096 
1097  }
1098 
1099  EdbShowerRec* a=0;
1100 // save the Z position of the first sheet
1101  if (num<10)
1102  {
1103  if (piece2par<10)
1104  {
1105  sprintf(nme,"%s/0%d_00%d.par","par",num,piece2par);
1106  }
1107  else
1108  {
1109  sprintf(nme,"%s/0%d_0%d.par","par",num,piece2par);
1110  }
1111  }
1112  else
1113  {
1114  if (piece2par<10)
1115  {
1116  sprintf(nme,"%s/%d_00%d.par","par",num,piece2par);
1117  }
1118  else
1119  {
1120  sprintf(nme,"%s/%d_0%d.par","par",num,piece2par);
1121  }
1122  }
1123 
1124  ReadAffAndZ(nme,&Zoff,&a11,&a12,&a21,&a22,&bb1,&bb2 );
1125  // ZZ0[0]= z0[0];
1126  ZZ0[0]= Zoff;
1127 
1128  int nntr;
1129  int ok;
1130  int max=0 ;
1131  int index = 0;
1132  double rr;
1133 
1134  float Rcut = 150.;
1135  float Tcut = 0.15;
1136 
1137  float mini[5] = {-20000.,-20000.,-1,-1,0};
1138  float maxi[5] = {20000.,20000.,1,1,100};
1139 
1140 // for (int d=num+1; d<MAXPLATE+1; d++){
1141 // if (DOWN==0) break;
1142  for (int d=num-1; d>num-MAXPLATE; d--) {
1143  index++;
1144  //sprintf( "Process plate number: %d/%d\n",index+1,MAXPLATE-PLATE);
1145 
1146  //if(d<10) {sprintf(nme,"%s/0%d_00%d.par","par",d,piece2par);}
1147  //else {sprintf(nme,"%s/%d_00%d.par","par",d,piece2par);}
1148 
1149  if (d<10) {
1150  sprintf(fname2,"%s/0%d_00%d.cp.root","data",d,piece2);
1151  }
1152  else {
1153  sprintf(fname2,"%s/%d_00%d.cp.root","data",d,piece2);
1154  }
1155 
1156  if (d<10)
1157  {
1158  if (piece2par<10)
1159  {
1160  sprintf(nme,"%s/0%d_00%d.par","par",d,piece2par);
1161  sprintf(fname2,"%s/0%d_00%d.cp.root","data",d,piece2);
1162  }
1163  else
1164  {
1165  sprintf(nme,"%s/0%d_0%d.par","par",d,piece2par);
1166  sprintf(fname2,"%s/0%d_0%d.cp.root","data",d,piece2);
1167  }
1168  }
1169  else
1170  {
1171  if (piece2par<10)
1172  {
1173  sprintf(nme,"%s/%d_00%d.par","par",d,piece2par);
1174  sprintf(fname2,"%s/%d_00%d.cp.root","data",d,piece2);
1175  }
1176  else
1177  {
1178  sprintf(nme,"%s/%d_0%d.par","par",d,piece2par);
1179  sprintf(fname2,"%s/%d_0%d.cp.root","data",d,piece2);
1180  }
1181  }
1182 
1183  EdbPVRec ali;
1184  EdbPattern *pat=0;
1185  EdbPattern *pat2=0;
1186  EdbDataPiece Piece;
1187 
1188  InitPiece(Piece,fname2,nme);
1189  pat2 = new EdbPattern(0.,0., Piece.GetLayer(0)->Z(),100 );
1190  Z0 = Piece.GetLayer(0)->Z();
1191  ReadPiece(Piece, *pat2);
1192 
1193  ReadAffAndZ(nme,&Zoff,&a11,&a12,&a21,&a22,&bb1,&bb2 );
1194  Z0 = Zoff;
1195  ZZ0[index] = Zoff;
1196 
1197  int ii =0;
1198  TIter next(eS);
1199  while ((a=(EdbShowerRec*)next()))
1200  {
1201  if (a->GetZ0()>Z0) ii++;
1202  if (a->GetZ0()>Z0) continue;
1203  Xss = a->GetX0() + fabs(Z0-a->GetZ0())*a->GetTx();
1204  Yss = a->GetY0() + fabs(Z0-a->GetZ0())*a->GetTy();
1205 
1206  mini[0] = Xss-1250.;
1207  mini[1] = Yss-1250.;
1208  mini[2] = -0.5;
1209  mini[3] = -0.5;
1210  mini[4] = 0.;
1211  maxi[0] = Xss+1250.;
1212  maxi[1] = Yss+1250.;
1213  maxi[2] = 0.5;
1214  maxi[3] = 0.5;
1215  maxi[4] = 100.;
1216 
1217  pat = pat2->ExtractSubPattern(mini,maxi);
1218  ali.AddPattern(pat);
1219 
1220  EdbSegP *ss=0;
1221 
1222  int incr=-1;
1223 
1224  for (int ip=0; ip<ali.Npatterns(); ip++) {
1225  incr++;
1226  };
1227 
1228  for (int i=0; i<ali.GetPattern(incr)->N(); i++)
1229  {
1230  ss = ali.GetPattern(incr)->GetSegment(i);
1231  ok = 0;
1232  if (DATA ==1) {
1233  X0 = a11*ss->X() + a12*ss->Y() + bb1;
1234  Y0 = a21*ss->X() + a22*ss->Y() + bb2;
1235 
1236  SX0 = a11*ss->TX()+ a12*ss->TY() ;
1237  SY0 = a21*ss->TX()+a22*ss->TY();
1238  }
1239  else
1240  {
1241  X0 = ss->X() ;
1242  Y0 = ss->Y() ;
1243  SX0 = ss->TX();
1244  SY0 = ss->TY();
1245  }
1246 
1247  if (fabs(SX0)>0.4) continue;
1248  if (fabs(SY0)>0.4) continue;
1249 
1250  //if ( a->GetTrID() == ss->MCEvt()|| ss->MCEvt()<0)
1251  //{
1252  Delta = 20.+ fabs(0.02*fabs(Z0-a->GetZ0())); // cone with 20 mrad
1253  rayon = 800.; // cylinder with 800 microns radius
1254  diff = sqrt((X0-Xss)*(X0-Xss)+(Y0-Yss)*(Y0-Yss));
1255 
1256  if ( diff<rayon&&diff<Delta )
1257  {
1258  if (index==1) max = 1;
1259  if (index==2) max = 2;
1260  if (index>2) max = 3;
1261 
1262  for (int el=0; el<max; el++)
1263  {
1264  //extrapolation in previous plate
1265  Xe[el] = X0 - fabs(Z0-ZZ0[index-el-1])*SX0;
1266  Ye[el] = Y0 - fabs(Z0-ZZ0[index-el-1])*SY0;
1267  nntr = add[ii];
1268 
1269  for (int l2=0; l2<nntr; l2++)
1270  {
1271  ind = l2 + ii*eNTM;
1272  if (fabs(zbb[ind]-(Z0-(el+1)*1273))<500)
1273  {
1274  rayon2 = sqrt((Xe[el]-xbb[ind])*(Xe[el]-xbb[ind])+((Ye[el]-ybb[ind])*(Ye[el]-ybb[ind])));
1275  delta = sqrt((SX0-txbb[ind])*(SX0-txbb[ind])+((SY0-tybb[ind])*(SY0-tybb[ind])));
1276  if (rayon2<Rcut&&delta<Tcut)
1277  {
1278  if (ok==0)
1279  {
1280  ind = add[ii] + ii*eNTM;
1281 
1282  xbb[ind] = X0 ;
1283  ybb[ind] = Y0 ;
1284  zbb[ind] = Z0 ;
1285  txbb[ind] = SX0 ;
1286  tybb[ind] = SY0 ;
1287 
1288  a->SetIDb(ss->ID(),add[ii]);
1289  a->SetPlateb(d,add[ii]);
1290  a->SetXb(X0,add[ii]);
1291  a->SetYb(Y0,add[ii]);
1292  a->SetZb(Z0,add[ii]);
1293  a->SetTXb(SX0,add[ii]);
1294  a->SetTYb(SY0,add[ii]);
1295  a->SetDeltarb(rayon2,add[ii]);
1296  a->SetDelthetab(delta,add[ii]);
1297  //a->SetNFilmb( index+1,add[ii]);
1298  rr = (Z0-a->GetZ0())/1273;
1299  a->SetNFilmb(int(round(rr)+1),add[ii]);
1300 
1301  if (ss->MCEvt()==a->GetTrID()) sigbb[ind] = 1;
1302  if (ss->MCEvt()<0) sigbb[ind] = 0;
1303  chi2bb[ind] = ss->Chi2();
1304  wbb[ind] = int(ss->W());
1305  Pbb[ind] = ss->P();
1306  Flagbb[ind] = ss->Flag();
1307 
1308  a->SetmcDigitIndexTop(ss->MCEvt(),add[ii]);
1309  a->SetmcDigitIndexBottom(ss->MCTrack(),add[ii]);
1310  ok =1;
1311  add[ii]++;
1312  }
1313  else if (ok==1&&rayon2<a->GetDeltarb(add[ii]-1))
1314  {
1315  a->SetDeltarb(rayon2,add[ii]-1);
1316  a->SetDelthetab(delta,add[ii]-1);
1317  }
1318  }
1319  }
1320  }
1321  }
1322  }
1323  //}
1324  }
1325  ii++;
1326  }
1327  }
1328 
1329  int i = 0;
1330  int evtid = 0;
1331  int nMC=0;
1332  TIter next(eS);
1333  while ((a=(EdbShowerRec*)next()))
1334  {
1335  number_eventb = a->GetID();
1336  sizeb = add[i];
1337  a->SetSize(add[i]);
1338  sizeb15 = 0;
1339  sizeb20 = 0;
1340  sizeb30 = 0;
1341  isizeb = 0;
1342  purityb = 0;
1343  nMC=0;
1344  E_MC = Esim[i];
1345 
1346  for (int j=0; j<add[i]; j++)
1347  {
1348  if ((a->GetZb(j)>a->GetZ0()+5000)&&isizeb==0) isizeb = 1; //cross at least 4 plates
1349  if (a->GetNFilmb(j)<16) sizeb15++;
1350  if (a->GetNFilmb(j)<21) sizeb20++;
1351  if (a->GetNFilmb(j)<31) sizeb30++;
1352  if (a->GetNFilmb(j)==15) isizeb=15;
1353  if (a->GetNFilmb(j)==20) isizeb=20;
1354  if (a->GetNFilmb(j)==30) isizeb=30;
1355  if (a->GetNFilmb(j)==50) isizeb=50;
1356  }
1357  a->SetSize15(sizeb15);
1358  a->SetSize20(sizeb20);
1359  a->SetSize30(sizeb30);
1360 
1361  for (int j=0; j<add[i]; j++)
1362  {
1363  idb[j] = a->GetIDb(j);
1364  plateb[j] = a->GetPlateb(j);
1365  xb[j] = a->GetXb(j);
1366  yb[j] = a->GetYb(j);
1367  zb[j] = a->GetZb(j);
1368  txb[j] = a->GetTXb(j);
1369  tyb[j] = a->GetTYb(j);
1370  deltarb[j] = a->GetDeltarb(j);
1371  deltathetab[j] = a->GetDeltathetab(j);
1372  nfilmb[j] = a->GetNFilmb(j);
1373  tagprimary[j] = 0;
1374 
1375  mcDigitIndexTop[j] = a->GetmcDigitIndexTop(j);
1376  mcDigitIndexBottom[j] = a->GetmcDigitIndexBottom(j);
1377 
1378 // printf("txb[j] %f\n", a->GetTXb(j));
1379 
1380  if (gEDBDEBUGLEVEL>2) cout << xb[j] << " " << yb[j] << " " << zb[j] << " " << txb[j] << " " << tyb[j] << " " << sizeb << endl;
1381 
1382  if (j==0) tagprimary[j] = 1;
1383  if (j==0) chi2btkb[j] = chi2bb[j+i*eNTM];
1384  if (j>0) chi2btkb[j] = chi2bb[j+i*eNTM];
1385  // if (j==0) ntrace1simub[j]= 1;
1386  if (j==0&&a->GetTrID()>=0) ntrace1simub[j]= 1;
1387  if (j==0&&a->GetTrID()<0) ntrace1simub[j]= 0;
1388 
1389  if (j>0) ntrace1simub[j] = sigbb[j+i*eNTM];
1390  if (j==0) ntrace2simub[j]= wbb[j+i*eNTM];
1391  if (j>0) ntrace2simub[j] = wbb[j+i*eNTM];
1392  ntrace3simub[j]= Pbb[j+i*eNTM];
1393  ntrace4simub[j]= Flagbb[j+i*eNTM];
1394 
1395  //cout << " j= " << j << " i= " << i << " eNTM= " << eNTM <<endl;
1396  //cout << " j+i*eNTM= " << j+i*eNTM << " chi2bb[j+i*eNTM]; = " << chi2bb[j+i*eNTM] << " eNTM= " << eNTM <<endl;
1397 
1398  if (ntrace1simub[j]>=1) ++nMC;
1399  }
1400  if (sizeb>0) purityb=float(nMC)/float(sizeb);
1401  if (isizeb >0) //cross at least 4 plates
1402  {
1403  // number_eventb = evtid;
1404  showerID = evtid;
1405  treesaveb->Fill();
1406  evtid++;
1407  }
1408  i++;
1409  }
1410 
1411  eShowersN=treesaveb->GetEntries();
1412  //treesaveb->Show(0);
1413 
1414  SaveResults();
1415  NeuralNet();
1416  // Attention: NeuralNet() ->Gives Shower2.root as output!
1417 
1418  // Open File. Get Tree.
1419  TFile *_file0 = new TFile("Shower2.root");
1420  TTree *tr = (TTree*)_file0->Get("treebranch");
1422  TObjArray* RecoShowerArray = GetRecoShowerArray() ;
1423  // Check the number of entries:
1424  cout << tr->GetEntries() << endl;
1425  cout << GetRecoShowerArrayN() << endl;
1426  // Instantate ShowerAlgorithmEnergy Class
1428  // Run Shower Energy Algorith on all shower/tracks
1430  cout << "// Write the values then into Shower.root (old Shower.root will be replaced(and backuped)!);" << endl;
1431 
1433 
1434 
1435 #ifndef WIN32
1436  strcpy(cmd,"rm shower1.root");
1437  gSystem->Exec(cmd);
1438  strcpy(cmd,"rm Shower2.root");
1439  gSystem->Exec(cmd);
1440 #else
1441  gSystem->Exec("del shower1.root");
1442  gSystem->Exec("del Shower2.root");
1443 #endif
1444 
1445  return;
1446 }
float Z() const
Definition: EdbLayer.h:78
void InitPiece(EdbDataPiece &piece, const char *cpfile, const char *parfile)
Definition: EdbShowerRec.cxx:261
int ReadPiece(EdbDataPiece &piece, EdbPattern &pat)
Definition: EdbShowerRec.cxx:1903
void ReadAffAndZ(char *fname, Float_t *pZoffs, Float_t *a11, Float_t *a12, Float_t *a21, Float_t *a22, Float_t *b1, Float_t *b2)
Definition: EdbShowerRec.cxx:1858

◆ remove()

void EdbShowerRec::remove ( char *  shfname,
char *  def,
int  MAXPLATE,
int  piece2par 
)
1453 {
1454 
1455  treesaveb = new TTree("treebranch","tree of branchtrack");
1456  treesaveb->Branch("number_eventb",&number_eventb,"number_eventb/I");
1457  treesaveb->Branch("sizeb",&sizeb,"sizeb/I");
1458  treesaveb->Branch("sizeb15",&sizeb15,"sizeb15/I");
1459  treesaveb->Branch("sizeb20",&sizeb20,"sizeb20/I");
1460  treesaveb->Branch("sizeb30",&sizeb30,"sizeb30/I");
1461  treesaveb->Branch("E_MC",&E_MC,"E_MC/F");
1462  treesaveb->Branch("isizeb",&isizeb,"isizeb/I");
1463  treesaveb->Branch("xb",xb,"xb[sizeb]/F");
1464  treesaveb->Branch("yb",yb,"yb[sizeb]/F");
1465  treesaveb->Branch("zb",zb,"zb[sizeb]/F");
1466  treesaveb->Branch("txb",txb,"txb[sizeb]/F");
1467  treesaveb->Branch("tyb",tyb,"tyb[sizeb]/F");
1468  treesaveb->Branch("nfilmb",nfilmb,"nfilmb[sizeb]/I");
1469  treesaveb->Branch("ntrace1simub",ntrace1simub,"ntrace1simu[sizeb]/I");
1470  treesaveb->Branch("ntrace2simub",ntrace2simub,"ntrace2simu[sizeb]/I");
1471  treesaveb->Branch("chi2btkb",chi2btkb,"chi2btkb[sizeb]/F");
1472  treesaveb->Branch("deltarb",deltarb,"deltarb[sizeb]/F");
1473  treesaveb->Branch("deltathetab",deltathetab,"deltathetab[sizeb]/F");
1474  treesaveb->Branch("deltaxb",deltaxb,"deltaxb[sizeb]/F");
1475  treesaveb->Branch("deltayb",deltayb,"deltayb[sizeb]/F");
1476  treesaveb->Branch("tagprimary",tagprimary,"tagprimary[sizeb]/F");
1477  fileout = new TFile("shower.root","RECREATE");
1478 
1479 // vert(shfname,def,Rcut,Tcut);
1480  vert(shfname,def,MAXPLATE,piece2par);
1481 
1482  SaveResults();
1483 
1484 }
void vert(const char *name2, const char *def, int MAXPLATE, int piece2par)
Definition: EdbShowerRec.cxx:1488

◆ ResetAlgoParameters()

void EdbShowerRec::ResetAlgoParameters ( )
4805 {
4806  eAlgoParameterConeRadius=800; // Radius of spanning cone from first BT
4807  eAlgoParameterConeAngle=0.015; // Opening angle of spanning cone from first BT
4808  eAlgoParameterConnectionDR=150; // Connection Criterium: delta R
4809  eAlgoParameterConnectionDT=0.15; // Connection Criterium: delta T
4810  eAlgoParameterNPropagation=3; // N plates backpropagating
4811  return;
4812 }

◆ ResetInBTArray()

void EdbShowerRec::ResetInBTArray ( )
inline
719  {
721  eInBTArrayN = 0;
722  }

◆ ResetRecoShowerArray()

void EdbShowerRec::ResetRecoShowerArray ( )
inline
723  {
725  eRecoShowerArrayN = 0;
726  }

◆ SaveLNK()

int EdbShowerRec::SaveLNK ( )
3100 {
3101  const char *fname="linked_tracks.root";
3102  const char *rcut="";
3103 
3104  FILE *f = fopen(fname, "r");
3105  if (!f)
3106  {
3107  printf("Cannot find linked_tracks.root file !\n");
3108  return -1;
3109  }
3110  fclose(f);
3111 
3112  EdbPVRec *ali = new EdbPVRec();
3113  EdbDataProc *dproc = new EdbDataProc();
3114  dproc->ReadTracksTree(*ali, "linked_tracks.root",rcut);
3115 
3116  sprintf(cmd,"cp -v linked_tracks.root linked_tracks.backup.root");
3117  gSystem->Exec(cmd);
3118 
3119  int ntracks=ali->Ntracks();
3120  cout << "nb tracks: " << ntracks << endl;
3121 
3122  ali->Link();
3123  ali->FillTracksCell();
3124  ali->MakeTracks(2,0);
3125 
3126  // --------------------------------------------------------------
3127 
3128  EdbSegP *segS;
3129  EdbTrackP *trackS;
3130 
3131  char fname_e[128];
3132  float x,y,tx,ty,z;
3133 
3134  Int_t sizeb;
3135  Int_t isizeb;
3136  Float_t xb[10000];
3137  Float_t yb[10000];
3138  Float_t zb[10000];
3139  Float_t txb[10000];
3140  Float_t tyb[10000];
3141  Int_t nfilmb[10000];
3142  // Int_t ngrainb[10000];
3143  // Int_t ntrace1simub[10000];
3144  Int_t ntrace2simub[10000];
3145  Float_t chi2btkb[10000];
3146  int eProb90;
3147  int eProb1;
3148 
3149  int number_eventb,w2,plate[10000];
3150 
3151  sprintf(fname_e,"Shower.root"); //input shower tree file
3152 
3153  f = fopen(fname_e, "r");
3154  if (!f)
3155  {
3156  printf("Cannot find Shower.root file !\n");
3157  return -2;
3158  }
3159  fclose(f);
3160 
3161 
3162  TFile *file_e2 = new TFile(fname_e ,"READ");
3163  TTree *treebranch_e = (TTree*)file_e2->Get("treebranch");
3164  treebranch_e->SetBranchAddress("nfilmb", nfilmb); // max(nfilmb)=npl
3165  treebranch_e->SetBranchAddress("sizeb", &sizeb); // nseg
3166  treebranch_e->SetBranchAddress("isizeb", &isizeb);
3167  treebranch_e->SetBranchAddress("chi2btkb", &chi2btkb);
3168  treebranch_e->SetBranchAddress("txb", txb);
3169  treebranch_e->SetBranchAddress("tyb", tyb);
3170  treebranch_e->SetBranchAddress("xb", xb);
3171  treebranch_e->SetBranchAddress("yb", yb);
3172  treebranch_e->SetBranchAddress("zb", zb);
3173  treebranch_e->SetBranchAddress("number_eventb", &number_eventb);
3174  treebranch_e->SetBranchAddress("ntrace2simub", &ntrace2simub); // grain
3175  treebranch_e->SetBranchAddress("eProb1", &eProb1);
3176  treebranch_e->SetBranchAddress("eProb90", &eProb90);
3177  int nentries = treebranch_e->GetEntries();
3178 
3179  for (int i=0; i<nentries; i++)
3180  {
3181  trackS = new EdbTrackP();
3182  treebranch_e->GetEntry(i);
3183 
3184  if (eProb1==0||eProb90==0) continue; // remove non electron!!!
3185 
3186  for (int j=0; j<sizeb; j++)
3187  {
3188  x=xb[j];
3189  y=yb[j];
3190  tx=txb[j];
3191  ty=tyb[j];
3192  z=zb[j];
3193  // plate[j] = abs(57+(int)(z/1273.)); // compiler instability with gcc4.3
3194  plate[j] = TMath::Abs(57+(int)(z/1273.)); // compiler instability with gcc4.3
3195  // cout << plate[j] << endl;
3196  w2=ntrace2simub[j];
3197  segS = new EdbSegP();
3198  segS->Set(j, x, y, tx, ty, w2, 0);
3199  segS->SetZ(z);
3200  segS->SetDZ(300.);
3201  //segS->SetPID(plate[j]); // DISPLAY PROBLEM IF RIGHT PID IS USED !!!!!!!!!!!!!!
3202  segS->SetPID(j);
3203  trackS->AddSegment(segS);
3204  trackS->AddSegmentF(segS);
3205 // cout << i<< " " << x << " " << y << " " << z << endl;
3206  }
3207  trackS->SetSegmentsTrack(i);
3208  trackS->SetPID(plate[0]);
3209  trackS->SetID(i);
3210  trackS->SetNpl(nfilmb[sizeb-1]);
3211  trackS->SetProb(1.);
3212  trackS->SetFlag(-100);
3213  trackS->FitTrack();
3214  ali->AddTrack(trackS);
3215  }
3216 
3217  file_e2->Close();
3218 
3219  // --------------------------------------------------------------
3220 
3221  dproc->MakeTracksTree(ali,"linked_tracks.root");
3222 
3223  cout << endl << "----------------------------------------------" << endl;
3224  cout << "Nb of tracks before adding showers : " << ntracks << endl;
3225  cout << "Nb of tracks after adding showers : " << ali->Ntracks() << endl;
3226  cout << "Nb of stored showers : " << ali->Ntracks()-ntracks << endl;
3227  cout << "----------------------------------------------" << endl << endl;
3228 
3229  return 1;
3230 }
FILE * f
Definition: RecDispMC.C:150
static int ReadTracksTree(EdbPVRec &ali, const char *fname="linked_tracks.root", const char *rcut="t.eFlag>-1&&nseg>2&&t.eProb>.01")
Definition: EdbDataSet.cxx:2937
static int MakeTracksTree(EdbPVRec *ali=0, const char *file="linked_tracks.root")
Definition: EdbDataSet.cxx:2511
int MakeTracks(int nsegments=2, int flag=0)
Definition: EdbPVRec.cxx:1985
void FillTracksCell()
Definition: EdbPVRec.cxx:1315
Int_t Ntracks() const
Definition: EdbPVRec.h:203
int Link()
Definition: EdbPVRec.cxx:1183
void AddTrack(EdbTrackP *track)
Definition: EdbPVRec.h:246
void SetPID(int pid)
Definition: EdbSegP.h:126
void SetProb(float prob)
Definition: EdbSegP.h:131
void SetID(int id)
Definition: EdbSegP.h:125
void SetZ(float z)
Definition: EdbSegP.h:122
void SetDZ(float dz)
Definition: EdbSegP.h:123
void SetFlag(int flag)
Definition: EdbSegP.h:127
void Set(int id, float x, float y, float tx, float ty, float w, int flag)
Definition: EdbSegP.h:86
void AddSegmentF(EdbSegP *s)
Definition: EdbPattern.h:238
void AddSegment(EdbSegP *s)
Definition: EdbPattern.h:219
void SetNpl(int npl)
Definition: EdbPattern.h:173
int SetSegmentsTrack(int id)
Definition: EdbPattern.h:252
void FitTrack()
Definition: EdbPattern.cxx:739
Int_t plate
Definition: merge_Energy_SytematicSources_Electron.C:1

◆ SaveResults()

void EdbShowerRec::SaveResults ( )
277 {
278  fileout->cd();
279  treesaveb->Write();
280  fileout->Close();
281  fileout->Delete();
282 }

◆ Set0()

void EdbShowerRec::Set0 ( )
229 {
230  // Reset all internal variables to default values.
231 
232  eUseAliSub=kFALSE;
233  // This is new/changed (06.June 2011):
234  // If we used eUseAliSub=true, then it results in large memory
235  // consumption when having many InitiatorBTs. To avoid this the standard
236  // behaviour is reconstruction on normal EdbPVRec object. Only in case
237  // of either large MC/Data ratio or only few InitiatorBTs, we do it this
238  // way. See also the function: CheckEdbPVRecSetUseAliSub.
239 
240  eShowerTreeIsDone=kFALSE;
241  eDoEnergyCalculation=kFALSE;
242  eEnergyIsDone=kFALSE;
243  eShowersN=0;
244 
245  eAlgoParameterConeRadius=800; // Radius of spanning cone from first BT
246  eAlgoParameterConeAngle=0.02; // Opening angle of spanning cone from first BT
247  eAlgoParameterConnectionDR=150; // Connection Criterium: delta R
248  eAlgoParameterConnectionDT=0.15; // Connection Criterium: delta T
249  eAlgoParameterNPropagation=3; // N plates backpropagating
250 
251  eFilename_LinkedTracks="linked_tracks.root";
252 
253  eQualityPar[0]=0.12;
254  eQualityPar[1]=1.0;
255  eUseQualityPar=kFALSE;
256 
257  mlp1=mlp2=mlp3=mlp4=0;
258 }
Bool_t eDoEnergyCalculation
Definition: EdbShowerRec.h:144

◆ SetAlgoParameter()

void EdbShowerRec::SetAlgoParameter ( Double_t  paravalue,
Int_t  paranr 
)
4817 {
4818  if (paranr==0) eAlgoParameterConeRadius=paravalue;
4819  else if (paranr==1) eAlgoParameterConeAngle=paravalue;
4820  else if (paranr==2) eAlgoParameterConnectionDR=paravalue;
4821  else if (paranr==3) eAlgoParameterConnectionDT=paravalue;
4822  else if (paranr==4) eAlgoParameterNPropagation=paravalue;
4823  else {
4824  return;
4825  }
4826 }

◆ SetChi20()

void EdbShowerRec::SetChi20 ( float  chi2)
inline
401  {
402  eChi20=chi2;
403  }
Float_t chi2
Definition: testBGReduction_By_ANN.C:14

◆ SetChi2b()

void EdbShowerRec::SetChi2b ( float  chi2b,
int  i 
)
inline
483  {
484  eChi2b[i]= chi2b;
485  }

◆ SetDeltarb()

void EdbShowerRec::SetDeltarb ( float  deltarb,
int  i 
)
inline
498  {
499  eDeltarb[i]= deltarb;
500  }

◆ SetDelthetab()

void EdbShowerRec::SetDelthetab ( float  deltathetab,
int  i 
)
inline
501  {
503  }

◆ SetDoEnergyCalculation()

void EdbShowerRec::SetDoEnergyCalculation ( Bool_t  DoEnergyCalculation)
inline
555  {
556  eDoEnergyCalculation=DoEnergyCalculation;
557  }

◆ SetDz()

void EdbShowerRec::SetDz ( float  dz)
inline
442  {
443  eDz = dz;
444  }
brick dz
Definition: RecDispMC.C:107

◆ SetEdbPVRec()

void EdbShowerRec::SetEdbPVRec ( EdbPVRec Ali)
inline
629  {
630  eAli = Ali;
634  eAliLoaded=kTRUE;
635  }

◆ SetFlag0()

void EdbShowerRec::SetFlag0 ( int  flag)
inline
410  {
411  eFlag0=flag;
412  }

◆ SetFlagb()

void EdbShowerRec::SetFlagb ( int  flag,
int  i 
)
inline
492  {
493  eFlagb[i]= flag;
494  }

◆ SetID()

void EdbShowerRec::SetID ( int  id)
inline
388  {
389  eID = id;
390  }

◆ SetIDb()

void EdbShowerRec::SetIDb ( int  idb2,
int  i 
)
inline
465  {
466  eIDb[i] = idb2;
467  }

◆ SetInBTArray() [1/3]

void EdbShowerRec::SetInBTArray ( EdbPVRec Ali,
Int_t  mode = 0 
)
4947  {
4948 
4949  // SetInBTArray( EdbPVRec* Ali , Int_t mode )
4950  // Set the Initiator BaseTrack Array From the EdbPVRec
4951  // object. Using a mode of:
4952  // -1) if it has tracks inside, we take first segment of the
4953  // -1) tracks (TO BE IMPLEMENTED...mode=-1)
4954  // 0) otherwise (mode is 0) ALL Basetracks in the volume.
4955  // 0) ATTENTION...TAKES VERY LONG
4956  // 1) If mode is 1, then we take only the
4957  // 1) first Z plate ... Mainly DEBUG purpose ....
4958  // 2) If mode is 2, then we take only 5 random
4959  // 2) basetracksfirst Z plate ... Mainly DEBUG purpose ....
4960 
4961  if (gEDBDEBUGLEVEL>1) {
4962  cout << "-----------------------------------------------------------------------------" << endl;
4963  cout << "-- EdbShowerRec SetInBTArray( EdbPVRec* Ali , Int_t mode ) --" << endl;
4964  cout << "-- EdbShowerRec Set the Initiator BaseTrack Array From the EdbPVRec --" << endl;
4965  cout << "-- EdbShowerRec object. --" << endl;
4966  cout << "-- EdbShowerRec A) if it has tracks inside, we take first segment of the --" << endl;
4967  cout << "-- EdbShowerRec A) tracks (TO BE IMPLEMENTED...mode=-1) --" << endl;
4968  cout << "-- EdbShowerRec B) otherwise (mode is 0) ALL Basetracks in the volume. --" << endl;
4969  cout << "-- EdbShowerRec B) ATTENTION...TAKES VERY LONG --" << endl;
4970  cout << "-- EdbShowerRec C) If mode is 1, then we take only the --" << endl;
4971  cout << "-- EdbShowerRec C) first Z plate ... Mainly DEBUG purpose ....--" << endl;
4972  cout << "-- EdbShowerRec D) If mode is 2, then we take only (1,5) random --" << endl;
4973  cout << "-- EdbShowerRec D) basetracksfirst Z plate ... Mainly DEBUG purpose ....--" << endl;
4974  }
4975 
4976  TObjArray* InBTArray = new TObjArray();
4977 
4978  Int_t nBT=1;
4979  if (mode>10) {
4980  // help construction, i hope noone ever needs to look at this ugly part of code :)
4981  nBT=mode;
4982  mode=2;
4983  }
4984 
4985  if (1==mode) {
4986  InBTArray->Clear();
4987  EdbPattern* pat = Ali->GetPatternZLowestHighest();
4988  int nseg= pat->N();
4989  for (int j=0; j<nseg; j++) {
4990  EdbSegP* seg = pat->GetSegment(j);
4991  InBTArray->Add(seg);
4992  }
4993  }
4994  else if (2==mode) {
4995  for (int k=0; k<nBT; k++) {
4996  EdbPattern* pat = Ali->GetPattern(gRandom->Uniform(0,Ali->Npatterns()));
4997  EdbSegP* seg = pat->GetSegment(gRandom->Uniform(0,pat->N()));
4998  //seg->PrintNice();
4999  InBTArray->Add(seg);
5000  }
5001  cout << "-- EdbShowerRec D) Set " << nBT << " Random BTs for shower reco. --" << endl;
5002  }
5003  else {
5004  int npat=Ali->Npatterns();
5005  for (int i=0; i<npat; i++) {
5006  EdbPattern* pat = Ali->GetPattern(i);
5007  int nseg= pat->N();
5008  for (int j=0; j<nseg; j++) {
5009  EdbSegP* seg = pat->GetSegment(j);
5010  InBTArray->Add(seg);
5011  }
5012  }
5013  }
5014 
5015 
5016  if (gEDBDEBUGLEVEL>1) cout << "-- EdbShowerRec InBTArray->GetEntries(): " << setw(20) << InBTArray->GetEntries() << " --" << endl;
5017  eInBTArray = InBTArray;
5018  eInBTArrayN=eInBTArray->GetEntries();
5019  if (eInBTArrayN>0) {
5020  eInBTArrayIsFilled=kTRUE;
5021  }
5022 
5023  if (gEDBDEBUGLEVEL>1) cout << "-- EdbShowerRec SetInBTArray( EdbPVRec* Ali ) done.--" << endl;
5024  if (gEDBDEBUGLEVEL>1) cout << "-----------------------------------------------------------------------------" << endl;
5025  return;
5026 }
EdbPattern * GetPatternZLowestHighest(Bool_t lowestZ=kTRUE) const
Definition: EdbPattern.cxx:1982

◆ SetInBTArray() [2/3]

void EdbShowerRec::SetInBTArray ( EdbSegP InBT)
inline
648  {
649  // check if eInBTArray was created, if not do it now.:
650  if (!eInBTArray) eInBTArray=new TObjArray();
651  eInBTArray->Clear();
652  eInBTArray->Add(InBT);
653  eInBTArrayN=eInBTArray->GetEntries();
654  if (eInBTArrayN>0) {
655  eInBTArrayIsFilled=kTRUE;
656  }
657  }

◆ SetInBTArray() [3/3]

void EdbShowerRec::SetInBTArray ( TObjArray *  InBTArray)
inline
636  {
637  eInBTArray = InBTArray;
638  eInBTArrayN=eInBTArray->GetEntries();
639  if (eInBTArrayN>0) {
640  eInBTArrayIsFilled=kTRUE;
641  }
642  }

◆ SetInBTArrayN()

void EdbShowerRec::SetInBTArrayN ( Int_t  InBTArrayN)
inline
644  {
645  eInBTArrayN = InBTArrayN;
646  }

◆ SetL()

void EdbShowerRec::SetL ( int  L)
inline
445  {
446  eL = L;
447  }

◆ SetmcDigitIndexBottom()

void EdbShowerRec::SetmcDigitIndexBottom ( int  mcDb,
int  i 
)
inline
510  {
511  emcDigitIndexBottom[i]= mcDb;
512  }

◆ SetmcDigitIndexBottom0()

void EdbShowerRec::SetmcDigitIndexBottom0 ( int  mcDb)
inline
416  {
418  }
Int_t emcDigitIndexBottom0
Definition: EdbShowerRec.h:55

◆ SetmcDigitIndexTop()

void EdbShowerRec::SetmcDigitIndexTop ( int  mcDt,
int  i 
)
inline
507  {
508  emcDigitIndexTop[i]= mcDt;
509  }

◆ SetmcDigitIndexTop0()

void EdbShowerRec::SetmcDigitIndexTop0 ( int  mcDt)
inline
413  {
414  emcDigitIndexTop0=mcDt;
415  }
Int_t emcDigitIndexTop0
Definition: EdbShowerRec.h:54

◆ SetNFilmb()

void EdbShowerRec::SetNFilmb ( int  nfilmb,
int  i 
)
inline
495  {
496  eNFilmb[i]= nfilmb;
497  }

◆ SetOutput()

void EdbShowerRec::SetOutput ( float  output)
inline
449  {
450  eOutput = output;
451  }

◆ SetOutput15()

void EdbShowerRec::SetOutput15 ( float  output)
inline
452  {
453  eOutput15= output;
454  }

◆ SetOutput20()

void EdbShowerRec::SetOutput20 ( float  output)
inline
455  {
456  eOutput20 = output;
457  }

◆ SetOutput30()

void EdbShowerRec::SetOutput30 ( float  output)
inline
458  {
459  eOutput30 = output;
460  }

◆ SetP0()

void EdbShowerRec::SetP0 ( float  p)
inline
407  {
408  eP0=p;
409  }
p
Definition: testBGReduction_AllMethods.C:8

◆ SetPb()

void EdbShowerRec::SetPb ( float  p,
int  i 
)
inline
489  {
490  ePb[i]= p;
491  }

◆ SetPlateb()

void EdbShowerRec::SetPlateb ( int  plate2,
int  i 
)
inline
468  {
469  ePlateb[i] = plate2;
470  }

◆ SetPrimary()

void EdbShowerRec::SetPrimary ( int  tagprimary,
int  i 
)
inline
504  {
506  }

◆ SetQualityCutValues()

void EdbShowerRec::SetQualityCutValues ( Double_t  p0,
Double_t  p1 
)
inline
670  {
671  eQualityPar[0]=p0;
672  eQualityPar[1]=p1;
673  eUseQualityPar=kTRUE;
674  }

◆ SetRecoShowerArray()

void EdbShowerRec::SetRecoShowerArray ( TObjArray *  RecoShowerArray)
inline
664  {
666  }

◆ SetRecoShowerArrayN()

void EdbShowerRec::SetRecoShowerArrayN ( Int_t  RecoShowerArrayN)
inline
661  {
662  eRecoShowerArrayN = RecoShowerArrayN;
663  }

◆ SetSize()

void EdbShowerRec::SetSize ( int  size)
inline
429  {
430  eSize = size;
431  }

◆ SetSize15()

void EdbShowerRec::SetSize15 ( int  size)
inline
432  {
433  eSize15 = size;
434  }

◆ SetSize20()

void EdbShowerRec::SetSize20 ( int  size)
inline
435  {
436  eSize20 = size;
437  }

◆ SetSize30()

void EdbShowerRec::SetSize30 ( int  size)
inline
438  {
439  eSize30 = size;
440  }

◆ SetTrID()

void EdbShowerRec::SetTrID ( int  id)
inline
425  {
426  eTrID = id;
427  }

◆ SetTx()

void EdbShowerRec::SetTx ( float  tx)
inline
419  {
420  eTx = tx;
421  }

◆ SetTXb()

void EdbShowerRec::SetTXb ( float  txb,
int  i 
)
inline
477  {
478  eTXb[i]= txb;
479  }

◆ SetTy()

void EdbShowerRec::SetTy ( float  ty)
inline
422  {
423  eTy = ty;
424  }

◆ SetTYb()

void EdbShowerRec::SetTYb ( float  tyb,
int  i 
)
inline
480  {
481  eTYb[i]= tyb;
482  }

◆ SetUseAliSub()

void EdbShowerRec::SetUseAliSub ( Bool_t  UseAliSub)
inline
625  {
626  eUseAliSub=UseAliSub;
627  }

◆ SetW0()

void EdbShowerRec::SetW0 ( int  w)
inline
404  {
405  eW0=w;
406  }
void w(int rid=2, int nviews=2)
Definition: test.C:27

◆ SetWb()

void EdbShowerRec::SetWb ( int  w,
int  i 
)
inline
486  {
487  eWb[i]= w;
488  }

◆ SetX0()

void EdbShowerRec::SetX0 ( float  x)
inline
392  {
393  eX0 = x;
394  }

◆ SetXb()

void EdbShowerRec::SetXb ( float  xb,
int  i 
)
inline
462  {
463  eXb[i]= xb;
464  }

◆ SetY0()

void EdbShowerRec::SetY0 ( float  y)
inline
395  {
396  eY0 = y;
397  }

◆ SetYb()

void EdbShowerRec::SetYb ( float  yb,
int  i 
)
inline
471  {
472  eYb[i]= yb;
473  }

◆ SetZ0()

void EdbShowerRec::SetZ0 ( float  z)
inline
398  {
399  eZ0 = z;
400  }

◆ SetZb()

void EdbShowerRec::SetZb ( float  zb,
int  i 
)
inline
474  {
475  eZb[i]= zb;
476  }

◆ ShowerToEdbSegPArray()

TObjArray * EdbShowerRec::ShowerToEdbSegPArray ( )
3238 {
3239  // Very simple function to transfer all treebranch entries to an
3240  // TObjArray of EdbSegPs. Mainly used for eda.C drawing framework
3241 
3242  cout << "-------------------EdbShowerRec::ShowerToEdbSegPArray()---------------------------" << endl << endl;
3243  TObjArray* segArray=new TObjArray(999999);
3244 
3245  float x,y,tx,ty,z;
3246  Int_t sizeb;
3247  Float_t xb[10000];
3248  Float_t yb[10000];
3249  Float_t zb[10000];
3250  Float_t txb[10000];
3251  Float_t tyb[10000];
3252  Int_t nfilmb[10000];
3253  Int_t ntrace2simub[10000];
3254  int eProb90;
3255  int eProb1;
3256  int w2,plate[10000];
3257 
3258  if (!eShowerTreeIsDone) {
3259  TTree * treesaveb = (TTree*)(FileReconstructedShowerTree->Get("treebranch"));
3260  treesaveb->SetBranchAddress("sizeb", &sizeb);
3261  treesaveb->SetBranchAddress("txb", txb);
3262  treesaveb->SetBranchAddress("tyb", tyb);
3263  treesaveb->SetBranchAddress("xb", xb);
3264  treesaveb->SetBranchAddress("yb", yb);
3265  treesaveb->SetBranchAddress("zb", zb);
3266  treesaveb->SetBranchAddress("eProb90", &eProb90);
3267  treesaveb->SetBranchAddress("eProb1", &eProb1);
3268  treesaveb->SetBranchAddress("nfilmb", nfilmb);
3269 
3270  }
3271  int nentries = treesaveb->GetEntries();
3272  if (gEDBDEBUGLEVEL>2) treesaveb->Print();
3273 
3274  cout << "nentries= " << nentries << endl;
3275 
3276  for (int i=0; i<nentries; i++)
3277  {
3278  treesaveb->GetEntry(i);
3279  treesaveb->Show(i);
3280 
3281  for (int j=0; j<sizeb; j++)
3282  {
3283  x=xb[j];
3284  y=yb[j];
3285  tx=txb[j];
3286  ty=tyb[j];
3287  z=zb[j];
3288  // This is to have the absolute plate reference frame where Plate 57 is at Z==0
3289  // plate[j] = abs(57+(int)(z/1273.)); // compiler instability with gcc4.3
3290  plate[j] = TMath::Abs(57+(int)(z/1273.)); // fix.
3291  cout << "DOING j= " << j << " Z== " << z << " Platee[j]= " << plate[j] << endl;
3292  w2=ntrace2simub[j];
3293  EdbSegP* segS = new EdbSegP();
3294  segS->Set(j, x, y, tx, ty, w2, 0);
3295  segS->SetZ(z);
3296  segS->SetDZ(300.);
3297  //segS->SetPID(plate[j]); // DISPLAY PROBLEM IF RIGHT PID IS USED !!!!!!!!!!!!!!
3298  segS->SetPID(j);
3299  segArray->Add(segS);
3300 // cout << i<< " " << x << " " << y << " " << z << endl;
3301  }
3302  }
3303  cout << "segArray->GetEntries();= " << segArray->GetEntries() << endl;
3304 
3305  return segArray;
3306 }

◆ TransferShowerObjectArrayIntoEntryOfTreebranchShowerTree()

void EdbShowerRec::TransferShowerObjectArrayIntoEntryOfTreebranchShowerTree ( TObjArray *  segarray)

---------— ONLY FOR EDBSHOWERREC.... NOT FOR MY OWN STUFF!!------------------------—

---------— ONLY FOR EDBSHOWERREC.... NOT FOR MY OWN STUFF!!------------------------—

4284 {
4285  Log(2, "EdbShowerRec", "--- void* TransferShowerObjectArrayIntoEntryOfTreebranchShowerTree() ---Interim SOLUTIION !!!! ");
4286 
4287  TFile* interim_fileout = new TFile("shower1.root","RECREATE");
4288  // EdbShowerRec::T-S-O-A-I-E-O-T-S-T
4289 
4290  // Interim SOLUTIION !!!! shower tree definition
4291 
4292  //---------------------------------------------------------------------------------
4293  //- VARIABLES: shower_ "treebranch" reconstruction
4294  //---------------------------------------------------------------------------------
4298  Float_t shower_xb[9999];
4299  Float_t shower_yb[9999];
4300  Float_t shower_zb[9999];
4301  Float_t shower_txb[9999];
4302  Float_t shower_tyb[9999];
4303  Float_t shower_deltarb[9999];
4304  Float_t shower_deltathetab[9999];
4305  Float_t shower_deltaxb[9999];
4306  Float_t shower_deltayb[9999];
4307  Int_t shower_nfilmb[9999];
4308  //Int_t shower_ngrainb[9999];
4309  Float_t shower_chi2btkb[9999];
4310  Int_t shower_ntrace1simub[9999]; // MCEvt
4311  Int_t shower_ntrace2simub[9999]; // s->W()
4312  Float_t shower_ntrace3simub[9999]; // s->P()
4313  Int_t shower_ntrace4simub[9999]; // s->Flag()
4314  Float_t shower_tagprimary[9999];
4315  Int_t shower_idb[9999];
4316  Int_t shower_plateb[9999];
4317  Float_t shower_deltasigmathetab[58];
4318  Int_t shower_numberofilms;
4319  Float_t shower_purityb,shower_E_MC,shower_trackdensb;
4320  //---------------------------------------------------------------------------------
4321 
4322  TTree* interim_treesaveb = new TTree("treebranch","tree of branchtrack");
4323  interim_treesaveb->Branch("number_eventb",&shower_number_eventb,"number_eventb/I");
4324  interim_treesaveb->Branch("sizeb",&shower_sizeb,"sizeb/I");
4325  interim_treesaveb->Branch("sizeb15",&shower_sizeb15,"sizeb15/I");
4326  interim_treesaveb->Branch("sizeb20",&shower_sizeb20,"sizeb20/I");
4327  interim_treesaveb->Branch("sizeb30",&shower_sizeb30,"sizeb30/I");
4328  interim_treesaveb->Branch("E_MC",&shower_E_MC,"E_MC/F");
4329  interim_treesaveb->Branch("isizeb",&shower_isizeb,"isizeb/I");
4330  interim_treesaveb->Branch("showerID",&shower_showerID,"showerID/I");
4331  interim_treesaveb->Branch("idb",shower_idb,"idb[sizeb]/I");
4332  interim_treesaveb->Branch("plateb",shower_plateb,"plateb[sizeb]/I");
4333  interim_treesaveb->Branch("xb",shower_xb,"xb[sizeb]/F");
4334  interim_treesaveb->Branch("yb",shower_yb,"yb[sizeb]/F");
4335  interim_treesaveb->Branch("zb",shower_zb,"zb[sizeb]/F");
4336  interim_treesaveb->Branch("txb",shower_txb,"txb[sizeb]/F");
4337  interim_treesaveb->Branch("tyb",shower_tyb,"tyb[sizeb]/F");
4338  interim_treesaveb->Branch("nfilmb",shower_nfilmb,"nfilmb[sizeb]/I");
4339  interim_treesaveb->Branch("ntrace1simub",shower_ntrace1simub,"ntrace1simu[sizeb]/I");
4340  interim_treesaveb->Branch("ntrace2simub",shower_ntrace2simub,"ntrace2simu[sizeb]/I"); // s->W()
4341  interim_treesaveb->Branch("ntrace3simub",shower_ntrace3simub,"ntrace3simu[sizeb]/F"); // s->P()
4342  interim_treesaveb->Branch("ntrace4simub",shower_ntrace4simub,"ntrace4simu[sizeb]/I"); // s->Flag()
4343  interim_treesaveb->Branch("chi2btkb",shower_chi2btkb,"chi2btkb[sizeb]/F");
4344  interim_treesaveb->Branch("deltarb",shower_deltarb,"deltarb[sizeb]/F");
4345  interim_treesaveb->Branch("deltathetab",shower_deltathetab,"deltathetab[sizeb]/F");
4346  interim_treesaveb->Branch("deltaxb",shower_deltaxb,"deltaxb[sizeb]/F");
4347  interim_treesaveb->Branch("deltayb",shower_deltayb,"deltayb[sizeb]/F");
4348  interim_treesaveb->Branch("tagprimary",shower_tagprimary,"tagprimary[sizeb]/F");
4349  interim_treesaveb->Branch("purityb",&shower_purityb,"purityb/F");
4350  interim_treesaveb->Branch("trackdensb",&shower_trackdensb,"trackdensb/F");
4351 
4352  Int_t showrecoarrayN=showrecoarray->GetEntries();
4353  cout << "showrecoarray->GetEntries(); " << showrecoarray->GetEntries() << endl;
4354 
4355 
4356  // LOOP OVER ENTRIES FROM showrecoarray:
4357  for (Int_t ooo=0; ooo< showrecoarrayN; ++ooo) {
4358  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::T-S-O-A-I-E-O-T-S-T: Doing entry " << ooo << endl;
4359 
4360  // Get Track from showrecoarray
4361  EdbTrackP* segarray = (EdbTrackP*)showrecoarray->At(ooo);
4362  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::T-S-O-A-I-E-O-T-S-T: segarray = " << segarray << endl;
4363  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::T-S-O-A-I-E-O-T-S-T: segarray->N(),N0(): " << segarray->N() << " " << segarray->N0() << endl;
4364  if (gEDBDEBUGLEVEL>2) segarray->PrintNice();
4365 
4366  EdbSegP* seg;
4367  EdbSegP* Inseg;
4368  Int_t diff_pid;
4369  Float_t min_shower_deltathetab=99999;
4370  Float_t min_shower_deltar=99999;
4371  Float_t test_shower_deltathetab=99999;
4372  Float_t test_shower_deltar=99999;
4373  Float_t test_shower_deltax,test_shower_deltay;
4374 
4375  Float_t shower_sizebNHELP=0;
4376  Float_t shower_sizebMCNHELP=0;
4377 
4378  Float_t extrapol_x,extrapol_y, extrapo_diffz;
4379 
4380  // Initialize arrays...
4381  shower_sizeb15=0;
4382  shower_sizeb20=0;
4383  shower_sizeb30=0;
4384  shower_sizeb=0;
4387  for (int ii=0; ii<9999; ii++) {
4388  shower_xb[ii]=0;
4389  shower_yb[ii]=0;
4390  shower_zb[ii]=0;
4391  shower_txb[ii]=0;
4392  shower_tyb[ii]=0;
4393  shower_nfilmb[ii]=0;
4394  shower_tagprimary[ii]=0;
4395  shower_ntrace1simub[ii]=0;
4396  shower_ntrace2simub[ii]=0;
4397  shower_ntrace3simub[ii]=0;
4398  shower_ntrace4simub[ii]=0;
4399  shower_deltaxb[ii]=0;
4400  shower_deltayb[ii]=0;
4401  shower_chi2btkb[ii]=0;
4402  shower_idb[ii]=0;
4403  shower_plateb[ii]=0;
4404  }
4405  for (int i=1; i<59; ++i) {
4407  }
4408 
4409  // Part To calculate the TransfereedVariables....
4410  shower_sizeb=segarray->N();
4411  Inseg=(EdbSegP*)segarray->GetSegment(0);
4412  shower_energy_shot_particle=Inseg->P();
4413  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::T-S-O-A-I-E-O-T-S-T shower_sizeb= "<< shower_sizeb << endl;
4414  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::T-S-O-A-I-E-O-T-S-T Inseg->PrintNice()= " << endl;
4415  if (gEDBDEBUGLEVEL>2) Inseg->PrintNice();
4416 
4417 
4418 
4419  if (gEDBDEBUGLEVEL>3) cout << "--- --- ---------------------"<<endl;
4420  //-------------------------------------
4421  for (int ii=0; ii<shower_sizeb; ii++) {
4422  if (gEDBDEBUGLEVEL>3) cout << "EdbShowerRec::T-S-O-A-I-E-O-T-S-T Doing Segment "<< ii << endl;
4423 
4424  if (ii>=9999) {
4425  cout << "EdbShowerRec::T-S-O-A-I-E-O-T-S-T: WARNING: shower_sizeb ( " << shower_sizeb<< ") greater than SHOWERARRAY. Set sizeb to 9999 and Stop filling!."<<endl;
4426  shower_sizeb=9999;
4427  break;
4428  }
4429 // seg=(EdbSegP*)segarray->At(ii); // works when TObjArray
4430  seg=(EdbSegP*)segarray->GetSegment(ii); // works when EdbTrackP
4431 
4432  //-------------------------------------
4433  shower_xb[ii]=seg->X();
4434  shower_yb[ii]=seg->Y();
4435  shower_txb[ii]=seg->TX();
4436  shower_tyb[ii]=seg->TY();
4437  shower_zb[ii]=seg->Z();
4438  shower_chi2btkb[ii]=seg->Chi2();
4439  shower_deltathetab[ii]=0.5;
4440  shower_deltarb[ii]=200;
4441  shower_tagprimary[ii]=0;
4442  if (ii==0) shower_tagprimary[ii]=1;
4443  shower_isizeb=1; // always 1, not needed anymore
4444  if (seg->MCEvt()>0) {
4445  shower_ntrace1simub[ii]=seg->MCEvt();
4446  shower_ntrace2simub[ii]=seg->W();
4447  shower_ntrace3simub[ii]=seg->P();
4448  shower_ntrace4simub[ii]=seg->Flag();
4449  }
4450  else {
4451  // keep the seg->BT settings for BG:
4452  // that come out of "normal" scanned data from fedra:
4453  // shower_ntrace1simub=-999
4454  // shower_ntrace2simub=seg->W();
4455  // shower_ntrace3simub=-999
4456  // shower_ntrace4simub=0
4457  shower_ntrace1simub[ii]=-999;
4458  shower_ntrace2simub[ii]=seg->W();
4459  shower_ntrace3simub[ii]=-999;
4460  shower_ntrace4simub[ii]=0;
4461  }
4462  shower_idb[ii]=seg->ID();
4463  shower_plateb[ii]=seg->PID();
4464  shower_E_MC=seg->P();
4465  //-------------------------------------
4466  // PUT HERE: deltarb,deltarb, nflimb, sizeb15......
4467  diff_pid=TMath::Abs( Inseg->PID()-seg->PID() )+1;
4468  // (does this work for up/downsream listing??)
4469  // (yes, since InBT->PID is also changed.)
4470  // but works only if the gAli Object has no missing plates
4471  // otherwise f.e. PID(1) and PID(2) are not necessaryly abay by dZ=1273
4472  // (could be Z(1)=1273 and Z(2)=3900...)
4473 
4474  // Calc pur:
4475  shower_sizebNHELP++;
4476  // Increase the shower_sizebMCNHELP variable ONLY and ONLY if there is MC segment
4477  if (seg->MCEvt()>0) shower_sizebMCNHELP++;
4478 
4479 
4480  // InBT:
4481  if (ii==0) {
4482  shower_deltathetab[0]=0.5;
4483  shower_deltarb[0]=200;
4484  shower_nfilmb[0]=1;
4485  }
4486  // All other BTs:
4487  if (ii>0) {
4488  // its correct like this, since this is the way it is done in
4489  // the official FJ-Algorithm:
4490  shower_nfilmb[ii]=diff_pid;
4491  if (gEDBDEBUGLEVEL>3) cout << "--- ---Inseg->PID() seg->PID() ii diif_pid shower_nfilmb[ii] " << Inseg->PID()<< " " << seg->PID() << " " << ii<< " " << diff_pid<<" "<< shower_nfilmb[ii]<<" " << endl;
4492 
4493  if (diff_pid >= 15 ) shower_sizeb15++;
4494  if (diff_pid >= 20 ) shower_sizeb20++;
4495  if (diff_pid >= 30 ) shower_sizeb30++;
4496 
4497  // PUT HERE: calculation routine for shower_deltasigmathetab
4498  // see referenc in thesis of Luillo Esposito, page 109.
4499  shower_deltasigmathetab[diff_pid]=shower_deltasigmathetab[diff_pid]+(TMath::Power(shower_txb[ii]-shower_txb[0],2)+TMath::Power(shower_tyb[ii]-shower_tyb[0],2));
4500 
4501  // PUT HERE: calculation routine for shower_deltathetab, shower_deltarb
4502  // ExSetTreebranchNametrapolate the BT [ii] to the position [jj] and then calc the
4503  // position and slope differences;
4504  // For the backward extrapolation of the shower_deltathetab and shower_deltarb
4505  // calulation for BaseTrack(ii), Basetrack(jj)->Z() hast to be smaller.
4506  min_shower_deltathetab=99999; // Reset
4507  min_shower_deltar=99999; // Reset
4508 
4509  for (int jj=0; jj<shower_sizeb; jj++) {
4510  if (ii==jj) continue;
4511 
4512  // since we do not know if BTs are ordered by their Z positions:
4513  // and cannot cut directly on the number in the shower entry:
4514  if (shower_zb[ii]<shower_zb[jj]) continue;
4515 
4516 
4517 
4518  extrapo_diffz=shower_zb[ii]-shower_zb[jj];
4519  if (TMath::Abs(extrapo_diffz)>4*1273+1.0) continue;
4520  if (TMath::Abs(extrapo_diffz)<1.0) continue; // remove same positions.
4521 
4522  extrapol_x=shower_xb[ii]-shower_txb[ii]*extrapo_diffz; // minus, because its ii after jj.
4523  extrapol_y=shower_yb[ii]-shower_tyb[ii]*extrapo_diffz; // minus, because its ii after jj.
4524 
4525  // Delta radius we need to extrapolate.
4526  test_shower_deltax=extrapol_x;//shower_txb[ii]*(shower_zb[ii]-shower_zb[jj])+shower_xb[ii];
4527  test_shower_deltay=extrapol_y;//shower_tyb[ii]*(shower_zb[ii]-shower_zb[jj])+shower_yb[ii];
4528  test_shower_deltax=test_shower_deltax-shower_xb[jj];
4529  test_shower_deltay=test_shower_deltay-shower_yb[jj];
4530  test_shower_deltar=TMath::Sqrt(test_shower_deltax*test_shower_deltax+test_shower_deltay*test_shower_deltay);
4531 
4532  // Delta theta we do not need to extrapolate. (old version...)
4533  //test_shower_deltathetab=TMath::Sqrt(shower_txb[ii]*shower_txb[ii]+shower_tyb[ii]*shower_tyb[ii]);
4534  //test_shower_deltathetab=test_shower_deltathetab-TMath::Sqrt(shower_txb[jj]*shower_txb[jj]+shower_tyb[jj]*shower_tyb[jj]);
4535  //test_shower_deltathetab=TMath::Abs(test_shower_deltathetab);
4536  //----
4537  // As before in ShowRec this way of calculation is not equivalent as calculating
4538  // DeltaTheta domponentwise:
4539  // Code from libShower:
4540  // delta = sqrt((SX0-a->GetTXb(l2))*(SX0-a->GetTXb(l2))+((SY0-a->GetTYb(l2))*(SY0-a->GetTYb(l2))));
4541  test_shower_deltathetab=TMath::Sqrt(TMath::Power(shower_txb[ii]-shower_txb[jj],2)+TMath::Power(shower_tyb[ii]-shower_tyb[jj],2));
4542 
4543  // Check if both dr,dt match parameter criteria and then just take these values.....
4544  // Maybe a change is necessary because it is not exactly the same as in the off. algorithm.
4545  //if (test_shower_deltar<400 && test_shower_deltathetab<0.8 ) {
4546  if (test_shower_deltar<150 && test_shower_deltathetab<0.15 ) {
4547  if (test_shower_deltar<min_shower_deltar) {
4548  min_shower_deltathetab=test_shower_deltathetab;
4549  min_shower_deltar=test_shower_deltar;
4550  shower_deltathetab[ii]=min_shower_deltathetab;
4551  shower_deltarb[ii]=min_shower_deltar;
4552  }
4553  }
4554  }
4555  }
4556  //-------------------------------------
4557 
4558  shower_purityb=shower_sizebMCNHELP/shower_sizebNHELP;
4560  }
4561  //-------------------------------------
4562  for (int i=1; i<59; ++i) {
4564  }
4565  shower_numberofilms=shower_nfilmb[shower_sizeb-1]; // there we assume (this is correct always?) when
4566  // the last shower BT is in the last film...(otherwise we would again have to loop on sizeb array);
4567 
4568 
4569  // Fill Tree:
4570  interim_treesaveb->Fill();
4571  if (gEDBDEBUGLEVEL>2) interim_treesaveb->Show(interim_treesaveb->GetEntries()-1);
4572 
4573  if (gEDBDEBUGLEVEL>2) cout << "Now we have interim_treesaveb Entries: " << interim_treesaveb->GetEntries() << endl;
4574  if (gEDBDEBUGLEVEL>3) interim_treesaveb->Show(interim_treesaveb->GetEntries()-1);
4575 
4576 
4577  } // LOOP OVER ENTRIES FROM showrecoarray: END.
4578  //-----------------------------------------------------------------------------------------------
4579 
4580 
4581 
4583  interim_fileout->cd();
4584  interim_treesaveb->Write();
4585  interim_fileout->Close();
4587 
4588 
4589  return;
4590 }
Int_t shower_nfilmb[5000]
Definition: ShowRec.h:382
Float_t shower_yb[5000]
Definition: ShowRec.h:374
Int_t shower_showerID
Definition: ShowRec.h:370
Float_t shower_ntrace3simub[5000]
Definition: ShowRec.h:387
Float_t shower_deltaxb[5000]
Definition: ShowRec.h:380
Int_t shower_sizeb20
Definition: ShowRec.h:371
Float_t shower_tyb[5000]
Definition: ShowRec.h:377
Float_t shower_deltathetab[5000]
Definition: ShowRec.h:379
Int_t shower_numberofilms
Definition: ShowRec.h:393
Int_t shower_ntrace2simub[5000]
Definition: ShowRec.h:386
Float_t shower_energy_shot_particle
Definition: ShowRec.h:372
Float_t shower_trackdensb
Definition: ShowRec.h:395
Int_t shower_idb[5000]
Definition: ShowRec.h:390
Int_t shower_number_eventb
Definition: ShowRec.h:370
Int_t shower_sizeb15
Definition: ShowRec.h:371
Float_t shower_deltasigmathetab[58]
Definition: ShowRec.h:392
Float_t shower_tagprimary[5000]
Definition: ShowRec.h:389
Int_t shower_isizeb
Definition: ShowRec.h:370
Float_t shower_deltayb[5000]
Definition: ShowRec.h:381
Int_t shower_sizeb30
Definition: ShowRec.h:371
Int_t shower_ntrace4simub[5000]
Definition: ShowRec.h:388
Int_t shower_sizeb
Definition: ShowRec.h:370
Float_t shower_chi2btkb[5000]
Definition: ShowRec.h:384
Float_t shower_zb[5000]
Definition: ShowRec.h:375
Float_t shower_deltarb[5000]
Definition: ShowRec.h:378
Float_t shower_xb[5000]
Definition: ShowRec.h:373
Float_t shower_txb[5000]
Definition: ShowRec.h:376
Int_t shower_plateb[5000]
Definition: ShowRec.h:391
Int_t shower_ntrace1simub[5000]
Definition: ShowRec.h:385
Int_t PID() const
Definition: EdbSegP.h:145
Int_t N0() const
Definition: EdbPattern.h:168

◆ TransferTreebranchShowerTreeIntoShowerObjectArray()

void EdbShowerRec::TransferTreebranchShowerTreeIntoShowerObjectArray ( TTree *  treebranch)

DEBUGTEST DEBUG TEST FOR FREDERIC !!! (FWM, 27.08.2010)

showseg->SetPID(shower_nfilmb[j]);

4597  {
4598  Log(2, "EdbShowerRec", "--- void* TransferTreebranchShowerTreeIntoShowerObjectArray() ---Interim SOLUTIION !!!! ");
4599 
4600  // Decaring ObjArray which are needed. Use out of private member variables of this class.
4601  TObjArray* showarray;
4602  showarray = new TObjArray();
4603  TTree* eShowerTree = treebranch;
4604 
4605  // EdbShowerP* show=0; // libShowRec
4606  EdbTrackP* show=0; // libShower
4607 
4608  EdbSegP* showseg=0;
4609 
4610  //- VARIABLES: shower_ "treebranch" reconstruction
4614  Float_t shower_xb[10000];
4615  Float_t shower_yb[10000];
4616  Float_t shower_zb[10000];
4617  Float_t shower_txb[10000];
4618  Float_t shower_tyb[10000];
4619  Float_t shower_deltarb[10000];
4620  Float_t shower_deltathetab[10000];
4621  Float_t shower_deltaxb[10000];
4622  Float_t shower_deltayb[10000];
4623  Int_t shower_nfilmb[10000];
4624  Float_t shower_chi2btkb[10000];
4625  Int_t shower_ntrace1simub[10000]; // MCEvt
4626  Int_t shower_ntrace2simub[10000]; // s->W()
4627  Float_t shower_ntrace3simub[10000]; // s->P()
4628  Int_t shower_ntrace4simub[10000]; // s->Flag()
4629  Float_t shower_tagprimary[10000];
4630  Int_t shower_idb[10000];
4631  Int_t shower_plateb[10000];
4632  Float_t shower_deltasigmathetab[58];
4633  Int_t shower_numberofilms;
4634  Float_t shower_purb; // purity of shower
4635  Int_t shower_mcDigitIndexTop[1000]; //
4636  Int_t shower_mcDigitIndexBottom[1000]; //
4637 
4638 
4639  // Set Addresses of treebranch tree:
4640  eShowerTree->SetBranchAddress("number_eventb",&shower_number_eventb);
4641  eShowerTree->SetBranchAddress("sizeb",&shower_sizeb);
4642  eShowerTree->SetBranchAddress("sizeb15",&shower_sizeb15);
4643  eShowerTree->SetBranchAddress("sizeb20",&shower_sizeb20);
4644  eShowerTree->SetBranchAddress("sizeb30",&shower_sizeb30);
4645  eShowerTree->SetBranchAddress("isizeb",&shower_isizeb);
4646  eShowerTree->SetBranchAddress("xb",shower_xb);
4647  eShowerTree->SetBranchAddress("yb",shower_yb);
4648  eShowerTree->SetBranchAddress("zb",shower_zb);
4649  eShowerTree->SetBranchAddress("txb",shower_txb);
4650  eShowerTree->SetBranchAddress("tyb",shower_tyb);
4651  eShowerTree->SetBranchAddress("nfilmb",shower_nfilmb);
4652  eShowerTree->SetBranchAddress("ntrace1simub",shower_ntrace1simub); // s.eMCEvt
4653  eShowerTree->SetBranchAddress("ntrace2simub",shower_ntrace2simub); // s.eW
4654  eShowerTree->SetBranchAddress("ntrace3simub",shower_ntrace3simub); // s.eP
4655  eShowerTree->SetBranchAddress("ntrace4simub",shower_ntrace4simub); // s.eFlag
4656  eShowerTree->SetBranchAddress("chi2btkb",shower_chi2btkb);
4657  eShowerTree->SetBranchAddress("deltarb",shower_deltarb);
4658  eShowerTree->SetBranchAddress("deltathetab",shower_deltathetab);
4659  eShowerTree->SetBranchAddress("deltaxb",shower_deltaxb);
4660  eShowerTree->SetBranchAddress("deltayb",shower_deltayb);
4661  eShowerTree->SetBranchAddress("tagprimary",shower_tagprimary);
4662  eShowerTree->SetBranchAddress("energy_shot_particle",&shower_energy_shot_particle);
4663  eShowerTree->SetBranchAddress("E_MC",&shower_energy_shot_particle);
4664  eShowerTree->SetBranchAddress("showerID",&shower_showerID);
4665  eShowerTree->SetBranchAddress("idb",shower_idb);
4666  eShowerTree->SetBranchAddress("plateb",shower_plateb);
4667  eShowerTree->SetBranchAddress("deltasigmathetab",shower_deltasigmathetab);
4668  eShowerTree->SetBranchAddress("lenghtfilmb",&shower_numberofilms);
4669  eShowerTree->SetBranchAddress("purityb",&shower_purb); // shower purity
4670  eShowerTree->SetBranchAddress("mcDigitIndexTop",shower_mcDigitIndexTop);
4671  eShowerTree->SetBranchAddress("mcDigitIndexBottom",shower_mcDigitIndexBottom);
4672 
4673 
4674  Int_t nent=eShowerTree->GetEntries();
4675  cout << "nent = " << nent << endl;
4676 
4677  Int_t nenttotalcount=0;
4678  cout << "nenttotalcount = " << nenttotalcount << endl;
4679 
4680  Bool_t QUICK_READ=kFALSE;
4681 // QUICK_READ=kTRUE; cout << "QUICK_READ=kTRUE; "<< endl;
4682  if (QUICK_READ) nent=1; // read only first shower... (mainly for debug purposes).
4683 
4684  // Loop over Tree Entries (==different showers):
4685  for (int i=0; i<nent; ++i) {
4686  eShowerTree->GetEntry(i);
4687  //cout << "i = " << i << endl;
4688  //cout << "shower_tagprimary[0] = " << shower_tagprimary[0] << endl;
4689  if (gEDBDEBUGLEVEL>3) eShowerTree->Show(i);
4690 
4691 
4692  // Since we do not take showers with below 1segment
4693  //if (shower_sizeb<=1) continue;
4694 
4695 // show = new EdbShowerP(shower_sizeb); // libShowRec
4696  show = new EdbTrackP(shower_sizeb); // libShower
4697 
4698  // For Frederics algorithm, shower_number_eventb gives NOT -999 as for a BG track,
4699  // but "0". So we need to disticnct also for "0" cases:
4701  if (shower_number_eventb==0) show ->SetMC(-999,999);
4702 
4703  // To Have unique profile histograms in the memory:
4704  // show = new EdbShowerP(0,eRecoShowerArrayN,shower_sizeb);
4705 
4706  //cout << "------------------- shower_tagprimary[0] shower_tagprimary[shower_sizeb-1] " << shower_tagprimary[0] << " " << shower_tagprimary[shower_sizeb-1] << endl;
4707 
4708  int nplmax=0;
4709 
4710  // Loop over shower Entries (==different basetracks):
4711  for (int j=0; j<shower_sizeb; ++j) {
4712 
4713  //cout << "------------------ --- j= " << j << endl;
4714 
4715  // Keep Notice of the order!!!
4716  // shower_tagprimary has to be added first!!
4717  // temporary solution: if that is not the case as below, no segment will be added....
4718  // ...
4719  if (shower_tagprimary[0]!=1) continue;
4720 
4721  // int id, float x, float y, float tx, float ty, float w = 0, int flag = 0
4722  showseg = new EdbSegP(j,shower_xb[j],shower_yb[j],shower_txb[j],shower_tyb[j],shower_ntrace2simub[j],0);
4723 
4724  showseg->SetZ(shower_zb[j]);
4725  showseg->SetChi2(shower_chi2btkb[j]);
4726  showseg->SetP(shower_ntrace3simub[j]);
4727  showseg->SetFlag(shower_ntrace4simub[j]);
4729  // For Frederics algorithm, ntrace1simub gives NOT -999 as for a BG track,
4730  // but "0". So we need to disticnct also for "0" cases:
4731  if (shower_ntrace1simub[j]==0) showseg->SetMC(-999,-999);
4732 
4733  showseg->SetPID(shower_plateb[j]);
4734  // in real data plateb is 57 for emulsion 57...(sim may be different, depending on orfeo...)
4735 
4738  showseg->SetPID(shower_nfilmb[j]);
4740  // in real data plateb is 57 for emulsion 57...(sim may be different, depending on orfeo...)
4741 
4742  showseg->SetID(shower_idb[j]);
4743  showseg->SetProb(1);
4744 
4745  //Set Npl right. In libShowRec we dont have to to this since we call the EdbShowerP::Update() function
4746  //int npl = TMath::Abs(shower_plateb[j]-shower_plateb[0]);
4747  // The first plate of shower_plateb[0] when used in ::rec() mode is somehow wrong,
4748  // therefore we rather take nfilmb for plate references...
4749  int npl = TMath::Abs(shower_nfilmb[j]-shower_nfilmb[0]);
4750  if (npl>nplmax) {
4751  show->SetNpl(npl);
4752  }
4753 
4754  //showseg->PrintNice();
4755 
4756  show->AddSegment(showseg);
4757  // Attention: If you have a EdbTrackP object and you add a segment, then
4758  // you have to manually set Counters for N(), NPl(). It is not done auto.
4759  show -> SetCounters();
4760  } // Loop over shower Entries (==different basetracks):
4761 
4762 
4763  // This ID should be unique!
4764  // (Means every shower has one different!)
4765  show->SetID(nenttotalcount);
4766  nenttotalcount++;
4767 
4768  // Add Shower Object to Shower Reco Array.
4769  // Not, if its empty:
4770  // Not, if its containing only one BT:
4771  if (show->N()>=1) {
4772  showarray->Add(show);
4774  if (gEDBDEBUGLEVEL>3) cout << "EdbShowRec::Treebranch_To_RecoShowerArray showarray->Add(show) ... done." << endl;
4775  }
4776 
4777  if (gEDBDEBUGLEVEL>3) show->PrintNice();
4778 
4779  }// Loop over Tree Entries (==different showers):
4780  //---------------------------------------------------
4781 
4782  if (gEDBDEBUGLEVEL>2) eShowerTree->Show(0);
4783  if (gEDBDEBUGLEVEL>2) eShowerTree->Show(nent-1);
4784 
4785  cout << "EdbShowRec::Treebranch_To_RecoShowerArray Loop over Tree Entries (==different showers) done." << endl;
4786  cout << "EdbShowRec::Treebranch_To_RecoShowerArray showarray->N()" << showarray->GetEntries() <<endl;
4787 
4788  SetRecoShowerArray(showarray);
4789  SetRecoShowerArrayN(showarray->GetEntries());
4790 
4791  Log(2,"EdbShowRec::Treebranch_To_RecoShowerArray","EdbShowRec::Treebranch_To_RecoShowerArray...done.");
4792  return;
4793 }
Float_t shower_purb
Definition: ShowRec.h:394
void SetChi2(float chi2)
Definition: EdbSegP.h:132
void SetP(float p)
Definition: EdbSegP.h:130
void SetMC(int mEvt, int mTrack)
Definition: EdbSegP.h:138
void SetRecoShowerArray(TObjArray *RecoShowerArray)
Definition: EdbShowerRec.h:664

◆ Transform_eAli()

void EdbShowerRec::Transform_eAli ( EdbSegP InitiatorBT,
Float_t  ExtractSize = 1000 
)

IMPLEMENT THIS !!!

DEBUG if (eAli_Sub) { delete eAli_Sub;eAli_Sub=0;} original, but keeps not adresses of segment in eAli; if it is deleted, then segfault will appear... But if not removed, memory can increase very quickly. In this case, use the SetUseAliSub(0), then reconstruction will operate on the on the original EdbPVRec Object.

do nothing now... let it live... delete eAli_Sub;eAli_Sub=0;}

3723 {
3724  // Transform an EdbPVRec Object into a smaller EdbPVRec object.
3725  // The length (number of plates/patterns) of eAli_Sub is not changed.
3726  // Only XY-size (+- ExtractSize) and MC cuts (same MC or BG) around
3727  // the InitiatorBT are applied.
3728  // This method increases speed of processing, useful for large simulation MC
3729  // datasets.
3730  // ( Code Detail Warning:
3731  // In case there are tooo many InitiatorBTs (order of 10k), the memory
3732  // consumption be very high, the reason is that we cannot delete the
3733  // small EdbPVRec objects build for the previous InitiatorBT, since the
3734  // addresses of the segments will be deleted as well, segfault will appear.
3735  // In this case the EdbPattern::ExtractSubPattern function will not only
3736  // clone the InitiatorBTs, but also the EdbPatterns, and the existing
3737  // EdbSegPs in it.
3738  // This method is more intended to use for the standalone program
3739  // __ShowReco__ because in this program the EdbSegP objects are not used
3740  // in its following code way, and then one can easyly delete the
3741  // eAli_Sub object.
3742  //
3743  // In this case, use the SetUseAliSub(0), then reconstruction will operate
3744  // on the original EdbPVRec object.
3745  // )
3746  //
3747  // Test have shown that, the Transform_eAli with ExtractSubPattern method
3748  // gains highly in speed the more MC BTs are in the volume. For a
3749  // sample consisting only of data, the only advantage is the loop over a
3750  // smaller reconstruction area. If many MC BTs are in the volume, the advantage
3751  // by cutting out also the other MC for one eAli_Sub object becomes really
3752  // visible in time (but unfortunately also in memory).
3753  //
3754  // So maybe a good tradeoff is like this:
3755  // If ratio of MC/Data basetracks in the volume is significant then
3756  // SetUseAliSub(1).
3757  // If number of InitiatorBTs exceeds 5000 (number choosen by me after few
3758  // tests) then we automatically switch to SetUseAliSub(0).
3759  // For volumes containing only Data basetracks (i.e. MCEvt==-999) we
3760  // do right from the start the operation on SetUseAliSub(0).
3762  //
3763  // -----------------------------------------------------------------------------
3764 
3765  Log(3,"EdbShowerRec::Transform_eAli","Transform eAli to eAli_Sub.");
3766 
3767  // eUseAliSub=kTRUE; // Now possible to choose between use of full ali, or extracted ali.
3768  eAli_Sub_halfsize=ExtractSize;
3769 
3770  // IF TO RECREATE THE gALI_SUB in RECONSTRUCTION or if to use gAli global (slowlier but maybe memory leak safe).
3771  if (eUseAliSub==0)
3772  {
3773  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Transform_eAli UseAliSub==0 No new eAli_Sub created. Use eAli instead. "<<endl;
3774  eAli_Sub=eAli;
3775  if (gEDBDEBUGLEVEL>3) eAli_Sub->Print();
3776  return;
3777  }
3778 
3779  Int_t npat;
3780  npat = eAli->Npatterns(); //number of plates
3781 
3782  // has to be deleted in some part of the script outside this function...
3783  // Dont forget , otherwise memory heap overflow!
3789  if (NULL!=eAli_Sub) {
3790  ;
3791  }
3792  eAli_Sub = new EdbPVRec();
3793 
3794  if (gEDBDEBUGLEVEL>2) cout << "EdbShowerRec::Transform_eAli eAli_Sub created."<<endl;
3795 
3796  // Create SubPattern objects
3797  EdbSegP* ExtrapolateInitiatorBT=0;
3798  ExtrapolateInitiatorBT = (EdbSegP*)InitiatorBT->Clone();
3799 
3800  Int_t InitiatorBTMCEvt=InitiatorBT->MCEvt();
3801 
3802  // Create Variables For ExtractSubpattern boundaries
3803  Float_t mini[5];
3804  Float_t maxi[5];
3805  //Float_t ExtractSize=1000;// now in fucntion header
3806  mini[0]=ExtrapolateInitiatorBT->X()-ExtractSize;
3807  mini[1]=ExtrapolateInitiatorBT->Y()-ExtractSize;
3808  maxi[0]=ExtrapolateInitiatorBT->X()+ExtractSize;
3809  maxi[1]=ExtrapolateInitiatorBT->Y()+ExtractSize;
3810  mini[2]=-0.7;
3811  mini[3]=-0.7;
3812  mini[4]=0.0;
3813  maxi[2]=0.7;
3814  maxi[3]=0.7;
3815  maxi[4]=100.0;
3816 
3817  EdbPattern* singlePattern;
3818  Float_t ExtrapolateInitiatorBT_zpos_orig=ExtrapolateInitiatorBT->Z();
3819 
3820  //InitiatorBT->PrintNice();
3821 
3822  // Add the subpatterns in a loop for the plates:
3823  // in reverse ordering.due to donwstream behaviour (!):
3824  // (Only downstream is supported now...)
3825  for (Int_t ii=0; ii<npat; ++ii) {
3826 
3827  Float_t zpos=eAli->GetPattern(ii)->Z();
3828  //cout << " Doing pattern " << ii << " at Z postion = " << zpos << endl;
3829 
3830  ExtrapolateInitiatorBT->PropagateTo(zpos);
3831 
3832  mini[0]=ExtrapolateInitiatorBT->X()-ExtractSize;
3833  mini[1]=ExtrapolateInitiatorBT->Y()-ExtractSize;
3834  maxi[0]=ExtrapolateInitiatorBT->X()+ExtractSize;
3835  maxi[1]=ExtrapolateInitiatorBT->Y()+ExtractSize;
3836 
3837  singlePattern=(EdbPattern*)eAli->GetPattern(ii)->ExtractSubPattern(mini,maxi,InitiatorBTMCEvt);
3838  // This sets PID() analogue to (upstream), nut not PID of the BTs !
3839  singlePattern-> SetID(eAli->GetPattern(ii)->ID());
3840  // This sets PID() analogue to (upstream), nut not PID of the BTs !
3841  singlePattern-> SetPID(eAli->GetPattern(ii)->PID());
3842 
3843  eAli_Sub->AddPattern(singlePattern);
3844 
3845  // Propagate back...! (in order not to change the original BT)
3846  ExtrapolateInitiatorBT->PropagateTo(ExtrapolateInitiatorBT_zpos_orig);
3847 
3848  //cout << "singlePattern: N segments filled: " << singlePattern->N() << endl;
3849  }
3850 
3851  delete ExtrapolateInitiatorBT;
3852  eAli_SubNpat=eAli_Sub->Npatterns(); //number of plates
3853 
3854  if (gEDBDEBUGLEVEL>2) eAli_Sub->Print();
3855  return;
3856 }
int ID() const
Definition: EdbPattern.h:328
Int_t eAli_SubNpat
Definition: EdbShowerRec.h:104

◆ vert()

void EdbShowerRec::vert ( const char *  name2,
const char *  def,
int  MAXPLATE,
int  piece2par 
)
1489 {
1490  double ZZ0[57];
1491  char nme[64];
1492  int ind;
1493  float a11, a12, a21, a22, bb1, bb2;
1494  float Zoff;
1495  const Int_t eNSM = 10000;
1496  const Int_t eNTM = 1000;
1497 
1498  TArrayF xbb(eNTM*eNSM);
1499  TArrayF ybb(eNTM*eNSM);
1500  TArrayF zbb(eNTM*eNSM);
1501  TArrayF txbb(eNTM*eNSM);
1502  TArrayF tybb(eNTM*eNSM);
1503  TArrayF deltarbb(eNTM*eNSM);
1504  TArrayF deltatbb(eNTM*eNSM);
1505  TArrayI sigbb(eNTM*eNSM);
1506  TArrayI nfilmbb(eNTM*eNSM);
1507  TArrayI Flag(eNTM*eNSM);
1508  TArrayI add(eNTM*eNSM);
1509  TArrayI EvNum(eNSM);
1510 
1511  for (int i=0; i<eNSM; i++)
1512  {
1513  for (int j=0; j<eNTM; j++)
1514  {
1515  ind = i*eNTM+j;
1516  xbb[ind];
1517  ybb[ind];
1518  zbb[ind];
1519  txbb[ind];
1520  tybb[ind];
1521  deltarbb[ind];
1522  deltatbb[ind];
1523  sigbb[ind];
1524  nfilmbb[ind];
1525  Flag[ind];
1526 
1527  }
1528  }
1529 
1530  file = new TFile(name2 ,"READ");
1531  TTree *treebranch_e = (TTree *) file->Get("treebranch");
1532  treebranch_e->SetBranchAddress("number_eventb", &number_eventb);
1533  treebranch_e->SetBranchAddress("nfilmb", nfilmb);
1534  treebranch_e->SetBranchAddress("sizeb", &sizeb);
1535  treebranch_e->SetBranchAddress("tagprimary", tagprimary);
1536  treebranch_e->SetBranchAddress("txb", txb);
1537  treebranch_e->SetBranchAddress("tyb", tyb);
1538  treebranch_e->SetBranchAddress("xb", xb);
1539  treebranch_e->SetBranchAddress("yb",yb);
1540  treebranch_e->SetBranchAddress("zb",zb);
1541  treebranch_e->SetBranchAddress("chi2btkb",chi2btkb);
1542 
1543  int nentries_e = int(treebranch_e->GetEntries());
1544  TList *eS = new TList;
1545 
1546  for (Int_t ii = 0; ii<nentries_e; ii++)
1547  {
1548  treebranch_e->GetEntry(ii);
1549 
1550  EdbShowerRec* shower = new EdbShowerRec();
1551  shower->SetID(ii);
1552  shower->SetX0(xb[0]);
1553  shower->SetY0(yb[0]);
1554  shower->SetZ0(zb[0]);
1555  shower->SetTx(txb[0]);
1556  shower->SetTy(tyb[0]);
1557  shower->SetTrID(number_eventb);
1558 
1559  shower->SetDeltarb(200.,0);
1560  shower->SetDelthetab(0.5,0);
1561  shower->SetPrimary(0,0);
1562  shower->SetNFilmb(1,0);
1563  shower->SetSize(sizeb);
1564 
1565  shower->SetXb(xb[0],0);
1566  shower->SetYb(yb[0],0);
1567  shower->SetZb(zb[0],0);
1568  shower->SetTXb(txb[0],0);
1569  shower->SetTYb(tyb[0],0);
1570 
1571  for (Int_t ibtke = 1; ibtke < sizeb; ibtke++)
1572  {
1573  shower->SetXb(xb[ibtke],ibtke);
1574  shower->SetYb(yb[ibtke],ibtke);
1575  shower->SetZb(zb[ibtke],ibtke);
1576  shower->SetTXb(txb[ibtke],ibtke);
1577  shower->SetTYb(tyb[ibtke],ibtke);
1578  shower->SetNFilmb(nfilmb[ibtke],ibtke);
1579  }
1580  eS->Add(shower);
1581  }
1582 
1583  EdbShowerRec* a=0;
1584 
1585  //================================================================
1586  float Z0, Z1, TX0,TY0 ;
1587  float X0, Y0, X1, Y1, Xss,Yss;
1588  float Delta, rayon,rayon2, diff, delta;
1589  float diff2, Delta2;
1590  float Xe[4], Ye[4];
1591  int nseg;
1592 
1593  for (int jj=0; jj<eNSM; jj++)
1594  {
1595  for (int ii=0; ii<eNTM; ii++)
1596  {
1597  ind = jj*eNTM +ii;
1598  Flag[ind] = 0;
1599  }
1600  }
1601 
1602  EdbTrackP *tr=0;
1603 //read the linked_tracks.root tree
1604  initproc(def, 100,"nseg>3");
1605 
1606  //printf("nseg>3&&s.eChi2<(s.eW*0.3-3.)\n");
1607  gAli->FillCell(30,30,0.009,0.009);
1608 
1609  int ntr = gAli->eTracks->GetEntries();
1610  printf("ntr = %d\n",ntr);
1611 
1612  EdbSegP *s = new EdbSegP();
1613  for (int i=0; i<ntr; i++) {
1614  tr = (EdbTrackP*)(gAli->eTracks->At(i));
1615  if (i%1000==0) printf( "Processed tracks %d/%d\n",i,ntr);
1616  nseg = tr->N();
1617  if (nseg<4) continue; //do not take into account tracks with less than 4 segments
1618 
1619  s = tr->GetSegment(0);
1620  X1 = s->X();
1621  Y1 = s->Y();
1622  Z1 = s->Z();
1623  for (int l=0; l<nseg; l++)
1624  {
1625  s = tr->GetSegment(l);
1626  Z0 = s->Z();
1627  TX0 = s->TX();
1628  TY0 = s->TY();
1629  X0 = s->X();
1630  Y0 = s->Y();
1631 // loop over the shower
1632  int ii=0;
1633  TIter next(eS);
1634  while ((a=(EdbShowerRec*)next()))
1635  {
1636  for (Int_t ibtke = 1; ibtke < a->GetSize(); ibtke++)
1637  {
1638  if ( a->GetXb(ibtke)==X0&&a->GetYb(ibtke)==Y0&&a->GetZb(ibtke)==Z0 )
1639  {
1640  rayon = 800.; // cylinder with 400 microns radius
1641 
1642  // Extrapolation of the first shower basetrack at the Z basetrack position of the first basetrack of the track
1643  Xss = a->GetX0() + (Z1-a->GetZ0())*a->GetTx();
1644  Yss = a->GetY0() + (Z1-a->GetZ0())*a->GetTy();
1645 
1646  // check if the first basetrack of the track is inside the cone
1647  diff2 = sqrt((X1-Xss)*(X1-Xss)+(Y1-Yss)*(Y1-Yss));
1648  Delta2 = 20. + fabs(0.02*(Z1-a->GetZ0())); // cone with 20 mrad
1649 
1650  // Extrapolation of the first shower basetrack at the current Z basetrack position
1651  Xss = a->GetX0() + (Z0-a->GetZ0())*a->GetTx();
1652  Yss = a->GetY0() + (Z0-a->GetZ0())*a->GetTy();
1653  // check if the current basetrack is inside the cone
1654  diff = sqrt((X0-Xss)*(X0-Xss)+(Y0-Yss)*(Y0-Yss));
1655  Delta = 20. + fabs(0.02*(Z0-a->GetZ0())); // cone with 20 mrad
1656 
1657  if ( (diff<rayon&&diff<Delta)&&(diff2>Delta2||diff2>rayon) ) // (the BT must be in the cone)&&(the first BT of the track must be outside the cone)
1658  {
1659  printf( "%f %f %f %f %d %f\n", Z1, Delta2,diff2,Z0,ii,chi2btkb[ibtke]);
1660  Flag[ibtke+ii*eNTM] = 1;
1661  }
1662  }
1663  }
1664  ii++;
1665  }
1666  }
1667  }
1668  file->Close();
1669  gAli->Delete();
1670 
1671 // get Z value for each plate
1672  ZZ0[0] = 0.;
1673  for (Int_t iii = 1; iii<MAXPLATE; iii++)
1674  {
1675  if (iii<10)
1676  {
1677  if (piece2par<10)
1678  {
1679  sprintf(nme,"%s/0%d_00%d.par","par",iii,piece2par);
1680  }
1681  else
1682  {
1683  sprintf(nme,"%s/0%d_0%d.par","par",iii,piece2par);
1684  }
1685  }
1686  else
1687  {
1688  if (piece2par<10)
1689  {
1690  sprintf(nme,"%s/%d_00%d.par","par",iii,piece2par);
1691  }
1692  else
1693  {
1694  sprintf(nme,"%s/%d_0%d.par","par",iii,piece2par);
1695  }
1696  }
1697  // if(iii<10) {sprintf(nme,"%s/0%d_00%d.par","par",iii,piece2par);}
1698  // else {sprintf(nme,"%s/%d_00%d.par","par",iii,piece2par);}
1699 
1700  ReadAffAndZ(nme,&Zoff,&a11,&a12,&a21,&a22,&bb1,&bb2);
1701  ZZ0[iii] = Zoff;
1702 
1703  }
1704 
1705  float zpos,rr;
1706  int nntr, d, max =0;
1707  int ok;
1708 // float Rcut = 100.;
1709 // float Tcut = 0.05;
1710  float Rcut = 150.;
1711  float Tcut = 0.15;
1712 
1713  int ige =0;
1714 
1715  TIter next(eS);
1716  while ((a=(EdbShowerRec*)next()))
1717  {
1718  ind = 0 + ige*eNTM;
1719  add[ige] = 1;
1720  EvNum[ige] = a->GetTrID();
1721  xbb[ind] = a->GetX0();
1722  ybb[ind] = a->GetY0();
1723  zbb[ind] = a->GetZ0();
1724  txbb[ind] = a->GetTx();
1725  tybb[ind] = a->GetTy();
1726  deltarbb[ind]= 200. ;
1727  deltatbb[ind]= 0.5;
1728 
1729  nfilmbb[ind] = 1;
1730  for ( int ibtke = 1; ibtke < a->GetSize() ; ibtke++)
1731  {
1732  ok = 0;
1733  Xss = a->GetX0() + (a->GetZb(ibtke)-a->GetZ0())*a->GetTx();
1734  Yss = a->GetY0() + (a->GetZb(ibtke)-a->GetZ0())*a->GetTy();
1735 
1736  Delta = 20. + fabs(0.02*(a->GetZb(ibtke)-a->GetZ0())); // cone with 20
1737  rayon = 800.; // cylinder with 400 microns radius
1738  diff = sqrt((a->GetXb(ibtke)-Xss)*(a->GetXb(ibtke)-Xss)+(a->GetYb(ibtke)-Yss)*(a->GetYb(ibtke)-Yss));
1739 
1740  if ( diff<rayon&&diff<Delta&&Flag[ibtke+ige*eNTM]==0 ) //BT must be in the cone and does not belong to a track which starts outside the cone volume
1741  {
1742 
1743  d = a->GetNFilmb(ibtke);
1744  zpos = a->GetZb(ibtke);
1745  if (zpos>1000&&zpos<1500.)
1746  {
1747  max = 1;
1748  } else if (zpos<3000)
1749  {
1750  max = 2;
1751  }
1752  else
1753  {
1754  max = 3;
1755  }
1756  for (int el=0; el<max; el++)
1757  {
1758 
1759  rr = a->GetZb(ibtke)/1273;
1760  d = int(round(rr));
1761 
1762  Xe[el] = a->GetXb(ibtke) -(a->GetZb(ibtke)-ZZ0[d-el])*a->GetTXb(ibtke);
1763  Ye[el] = a->GetYb(ibtke) -(a->GetZb(ibtke)-ZZ0[d-el])*a->GetTYb(ibtke);
1764  nntr = add[ige];
1765 
1766  for (int l2=0; l2<nntr; l2++) {
1767 
1768  if (fabs(a->GetZb(l2)-(a->GetZb(ibtke)-(el+1)*1273))<500)
1769  {
1770 
1771  rayon2 = sqrt((Xe[el]-a->GetXb(l2))*(Xe[el]-a->GetXb(l2))+((Ye[el]-a->GetYb(l2))*(Ye[el]-a->GetYb(l2))));
1772  delta = sqrt((a->GetTXb(ibtke)-a->GetTXb(l2))*(a->GetTXb(ibtke)-a->GetTXb(l2))+((a->GetTYb(ibtke)-a->GetTYb(l2))*(a->GetTYb(ibtke)-a->GetTYb(l2))));
1773 
1774 
1775  if (rayon2<Rcut&&delta<Tcut&&Flag[ige+l2*eNSM]==0) // connection criteria with a BT which does not belong to a track which starts outside the cone volume
1776  {
1777  if (ok==0)
1778  {
1779  //ind = ige + add[ige]*eNSM;
1780  ind = add[ige] + ige*eNTM;
1781  xbb[ind] = a->GetXb(ibtke);
1782  ybb[ind] = a->GetYb(ibtke);
1783  zbb[ind] = a->GetZb(ibtke);
1784  txbb[ind] = a->GetTXb(ibtke);
1785  tybb[ind] = a->GetTYb(ibtke);
1786  deltarbb[ind] = rayon2 ;
1787  deltatbb[ind] = delta ;
1788  EvNum[ige]= a->GetTrID();
1789 
1790  nfilmbb[ind] = a->GetNFilmb(ibtke);
1791 
1792  sigbb[ind] = int(chi2btkb[ibtke]);
1793  ok =1;
1794  add[ige]++;
1795 
1796  }
1797  else if (ok==1&&rayon2<deltarbb[(add[ige]-1)+ige*eNTM])
1798  {
1799  ind = (add[ige]-1) + ige*eNTM;
1800  deltarbb[ind] = rayon2 ;
1801  deltatbb[ind] = delta ;
1802  }
1803  }
1804  }
1805  } //for (int l2=0;l2<nntr;l2++)
1806  } // for (int el=0;el<max;el++)
1807  }//if ( diff<rayon&&diff<Delta )
1808  } // for ( ibtke = 1;
1809  ige++;
1810  } // while
1811 
1812  for (int i=0; i<nentries_e; i++)
1813  {
1814 // number_eventb = i;
1815  number_eventb = EvNum[i];
1816 
1817  sizeb = add[i];
1818  sizeb15 = 0;
1819  sizeb20 = 0;
1820  sizeb30 = 0;
1821 
1822  isizeb = 0;
1823 
1824  for (int j=0; j<sizeb; j++)
1825  {
1826  ind = j + i*eNTM;
1827  if (zbb[ind]>zb[0]+5000) isizeb = 1;
1828  if (nfilmbb[ind]<16) sizeb15++;
1829  if (nfilmbb[ind]<21) sizeb20++;
1830  if (nfilmbb[ind]<31) sizeb30++;
1831 // }
1832 
1833 // for (int j=0;j<sizeb; j++)
1834 // {
1835  xb[j] = xbb[ind];
1836  yb[j] = ybb[ind];
1837  zb[j] = zbb[ind];
1838  txb[j] = txbb[ind];
1839  tyb[j] = tybb[ind];
1840  deltarb[j] = deltarbb[ind] ;
1841  deltathetab[j] = deltatbb[ind];
1842 
1843  nfilmb[j] = nfilmbb[ind];
1844  tagprimary[j] = 0;
1845  if (j==0) tagprimary[j] = 1;
1846 // if (j==0) chi2btkb[j] = 1;
1847 // if (j>0) chi2btkb[j] = sigbb[ind];
1848  if (j==0) ntrace1simub[j]= 1;
1849  if (j>0) ntrace1simub[j] = sigbb[j+i*eNTM];
1850  }
1851  if (isizeb > 0)treesaveb->Fill();
1852  }
1853 
1854 }
TObjArray * eTracks
Definition: EdbPVRec.h:161
void FillCell(float stepx, float stepy, float steptx, float stepty)
Definition: EdbPVRec.cxx:1088
TFile * file
Definition: EdbShowerRec.h:220
void initproc(const char *def, int iopt, const char *rcut)
Definition: EdbShowerRec.cxx:269
void SetSize(int size)
Definition: EdbShowerRec.h:429

Member Data Documentation

◆ a

EdbDataProc* EdbShowerRec::a

◆ ANNInterimTreeInputvariables

TTree* EdbShowerRec::ANNInterimTreeInputvariables
private

◆ bin1

Double_t EdbShowerRec::bin1

◆ bin10

Double_t EdbShowerRec::bin10

◆ bin11

Double_t EdbShowerRec::bin11

◆ bin12

Double_t EdbShowerRec::bin12

◆ bin13

Double_t EdbShowerRec::bin13

◆ bin14

Double_t EdbShowerRec::bin14

◆ bin15

Double_t EdbShowerRec::bin15

◆ bin16

Double_t EdbShowerRec::bin16

◆ bin17

Double_t EdbShowerRec::bin17

◆ bin18

Double_t EdbShowerRec::bin18

◆ bin19

Double_t EdbShowerRec::bin19

◆ bin2

Double_t EdbShowerRec::bin2

◆ bin20

Double_t EdbShowerRec::bin20

◆ bin21

Double_t EdbShowerRec::bin21

◆ bin22

Double_t EdbShowerRec::bin22

◆ bin23

Double_t EdbShowerRec::bin23

◆ bin24

Double_t EdbShowerRec::bin24

◆ bin25

Double_t EdbShowerRec::bin25

◆ bin26

Double_t EdbShowerRec::bin26

◆ bin27

Double_t EdbShowerRec::bin27

◆ bin28

Double_t EdbShowerRec::bin28

◆ bin29

Double_t EdbShowerRec::bin29

◆ bin3

Double_t EdbShowerRec::bin3

◆ bin30

Double_t EdbShowerRec::bin30

◆ bin31

Double_t EdbShowerRec::bin31

◆ bin32

Double_t EdbShowerRec::bin32

◆ bin33

Double_t EdbShowerRec::bin33

◆ bin34

Double_t EdbShowerRec::bin34

◆ bin35

Double_t EdbShowerRec::bin35

◆ bin4

Double_t EdbShowerRec::bin4

◆ bin41

Double_t EdbShowerRec::bin41

◆ bin42

Double_t EdbShowerRec::bin42

◆ bin43

Double_t EdbShowerRec::bin43

◆ bin44

Double_t EdbShowerRec::bin44

◆ bin45

Double_t EdbShowerRec::bin45

◆ bin46

Double_t EdbShowerRec::bin46

◆ bin47

Double_t EdbShowerRec::bin47

◆ bin48

Double_t EdbShowerRec::bin48

◆ bin49

Double_t EdbShowerRec::bin49

◆ bin5

Double_t EdbShowerRec::bin5

◆ bin50

Double_t EdbShowerRec::bin50

◆ bin51

Double_t EdbShowerRec::bin51

◆ bin52

Double_t EdbShowerRec::bin52

◆ bin53

Double_t EdbShowerRec::bin53

◆ bin54

Double_t EdbShowerRec::bin54

◆ bin55

Double_t EdbShowerRec::bin55

◆ bin56

Double_t EdbShowerRec::bin56

◆ bin57

Double_t EdbShowerRec::bin57

◆ bin58

Double_t EdbShowerRec::bin58

◆ bin59

Double_t EdbShowerRec::bin59

◆ bin6

Double_t EdbShowerRec::bin6

◆ bin60

Double_t EdbShowerRec::bin60

◆ bin7

Double_t EdbShowerRec::bin7

◆ bin8

Double_t EdbShowerRec::bin8

◆ bin9

Double_t EdbShowerRec::bin9

◆ chi2btkb

Float_t EdbShowerRec::chi2btkb[10000]

◆ cmd

char EdbShowerRec::cmd[500]

◆ deltarb

Float_t EdbShowerRec::deltarb[10000]

◆ deltathetab

Float_t EdbShowerRec::deltathetab[10000]

◆ deltaxb

Float_t EdbShowerRec::deltaxb[10000]

◆ deltayb

Float_t EdbShowerRec::deltayb[10000]

◆ dproc

EdbDataProc* EdbShowerRec::dproc

◆ E_MC

Float_t EdbShowerRec::E_MC

◆ eAlgoParameterConeAngle

Double_t EdbShowerRec::eAlgoParameterConeAngle
private

◆ eAlgoParameterConeRadius

Double_t EdbShowerRec::eAlgoParameterConeRadius
private

◆ eAlgoParameterConnectionDR

Double_t EdbShowerRec::eAlgoParameterConnectionDR
private

◆ eAlgoParameterConnectionDT

Double_t EdbShowerRec::eAlgoParameterConnectionDT
private

◆ eAlgoParameterNPropagation

Int_t EdbShowerRec::eAlgoParameterNPropagation
private

◆ eAli

EdbPVRec* EdbShowerRec::eAli
private

◆ eAli_Sub

EdbPVRec* EdbShowerRec::eAli_Sub
private

◆ eAli_Sub_halfsize

Float_t EdbShowerRec::eAli_Sub_halfsize
private

◆ eAli_SubNpat

Int_t EdbShowerRec::eAli_SubNpat
private

◆ eAliLoaded

Bool_t EdbShowerRec::eAliLoaded
private

◆ eAliNpat

Int_t EdbShowerRec::eAliNpat
private

◆ eAliNpatM1

Int_t EdbShowerRec::eAliNpatM1
private

◆ eChi20

Float_t EdbShowerRec::eChi20
private

◆ eChi2b

Float_t EdbShowerRec::eChi2b[10000]
private

◆ eDeltarb

Float_t EdbShowerRec::eDeltarb[10000]
private

◆ eDeltathetab

Float_t EdbShowerRec::eDeltathetab[10000]
private

◆ eDoEnergyCalculation

Bool_t EdbShowerRec::eDoEnergyCalculation
private

◆ eDz

Float_t EdbShowerRec::eDz
private

◆ eEnergyANN

TObjArray* EdbShowerRec::eEnergyANN
private

◆ eEnergyCorrectedb

Float_t EdbShowerRec::eEnergyCorrectedb
private

◆ eEnergyIsDone

Bool_t EdbShowerRec::eEnergyIsDone
private

◆ eEnergyResolutionFitFunction_All

TF1* EdbShowerRec::eEnergyResolutionFitFunction_All
private

◆ eEnergySigmaCorrectedb

Float_t EdbShowerRec::eEnergySigmaCorrectedb
private

◆ eEnergySigmaUnCorrectedb

Float_t EdbShowerRec::eEnergySigmaUnCorrectedb
private

◆ eEnergyUnCorrectedb

Float_t EdbShowerRec::eEnergyUnCorrectedb
private

◆ eEnergyWeightFileString

TString* EdbShowerRec::eEnergyWeightFileString[9]
private

◆ eFilename_LinkedTracks

TString EdbShowerRec::eFilename_LinkedTracks
private

◆ eFlag0

Int_t EdbShowerRec::eFlag0
private

◆ eFlagb

Int_t EdbShowerRec::eFlagb[10000]
private

◆ eHistEnergyCorrectedb

TH1F* EdbShowerRec::eHistEnergyCorrectedb
private

◆ eHistEnergyNominal

TH1F* EdbShowerRec::eHistEnergyNominal
private

◆ eHistEnergySigmaCorrectedb

TH1F* EdbShowerRec::eHistEnergySigmaCorrectedb
private

◆ eHistEnergySigmaUnCorrectedb

TH1F* EdbShowerRec::eHistEnergySigmaUnCorrectedb
private

◆ eHistEnergyUnCorrectedb

TH1F* EdbShowerRec::eHistEnergyUnCorrectedb
private

◆ eID

Int_t EdbShowerRec::eID
private

◆ eIDb

Int_t EdbShowerRec::eIDb[10000]
private

◆ eInBTArray

TObjArray* EdbShowerRec::eInBTArray
private

◆ eInBTArrayIsFilled

Bool_t EdbShowerRec::eInBTArrayIsFilled
private

◆ eInBTArrayLoaded

Bool_t EdbShowerRec::eInBTArrayLoaded
private

◆ eInBTArrayMaxSize

Int_t EdbShowerRec::eInBTArrayMaxSize
private

◆ eInBTArrayN

Int_t EdbShowerRec::eInBTArrayN
private

◆ eInitiatorBTIsCreated

Bool_t EdbShowerRec::eInitiatorBTIsCreated
private

◆ eL

Int_t EdbShowerRec::eL
private

◆ emcDigitIndexBottom

Int_t EdbShowerRec::emcDigitIndexBottom[1000]
private

◆ emcDigitIndexBottom0

Int_t EdbShowerRec::emcDigitIndexBottom0
private

◆ emcDigitIndexTop

Int_t EdbShowerRec::emcDigitIndexTop[1000]
private

◆ emcDigitIndexTop0

Int_t EdbShowerRec::emcDigitIndexTop0
private

◆ energy_shot_particle

Float_t EdbShowerRec::energy_shot_particle
private

◆ EnergyCorrectedb

Float_t EdbShowerRec::EnergyCorrectedb

◆ EnergySigmaCorrectedb

Float_t EdbShowerRec::EnergySigmaCorrectedb

◆ EnergySigmaUnCorrectedb

Float_t EdbShowerRec::EnergySigmaUnCorrectedb

◆ EnergyUnCorrectedb

Float_t EdbShowerRec::EnergyUnCorrectedb

◆ eNFilmb

Int_t EdbShowerRec::eNFilmb[10000]
private

◆ eNumberPlate_eAliPID

Int_t EdbShowerRec::eNumberPlate_eAliPID
private

◆ eOutput

Float_t EdbShowerRec::eOutput
private

◆ eOutput15

Float_t EdbShowerRec::eOutput15
private

◆ eOutput20

Float_t EdbShowerRec::eOutput20
private

◆ eOutput30

Float_t EdbShowerRec::eOutput30
private

◆ eP0

Float_t EdbShowerRec::eP0
private

◆ ePb

Float_t EdbShowerRec::ePb[10000]
private

◆ ePlateb

Int_t EdbShowerRec::ePlateb[10000]
private

◆ eProb1

Int_t EdbShowerRec::eProb1

◆ eProb90

Int_t EdbShowerRec::eProb90

◆ eQualityPar

Double_t EdbShowerRec::eQualityPar[2]
private

◆ eRecoShowerArray

TObjArray* EdbShowerRec::eRecoShowerArray
private

◆ eRecoShowerArrayN

Int_t EdbShowerRec::eRecoShowerArrayN
private

◆ eShowersN

Int_t EdbShowerRec::eShowersN
private

◆ eShowerTreeIsDone

Bool_t EdbShowerRec::eShowerTreeIsDone
private

◆ eSize

Int_t EdbShowerRec::eSize
private

◆ eSize15

Int_t EdbShowerRec::eSize15
private

◆ eSize20

Int_t EdbShowerRec::eSize20
private

◆ eSize30

Int_t EdbShowerRec::eSize30
private

◆ eTagPrimary

Int_t EdbShowerRec::eTagPrimary[10000]
private

◆ eTrID

Int_t EdbShowerRec::eTrID
private

◆ eTx

Float_t EdbShowerRec::eTx
private

◆ eTXb

Float_t EdbShowerRec::eTXb[10000]
private

◆ eTy

Float_t EdbShowerRec::eTy
private

◆ eTYb

Float_t EdbShowerRec::eTYb[10000]
private

◆ eUseAliSub

Bool_t EdbShowerRec::eUseAliSub
private

◆ eUseQualityPar

Bool_t EdbShowerRec::eUseQualityPar
private

◆ eW0

Int_t EdbShowerRec::eW0
private

◆ eWb

Int_t EdbShowerRec::eWb[10000]
private

◆ eX0

Float_t EdbShowerRec::eX0
private

◆ eXb

Float_t EdbShowerRec::eXb[10000]
private

◆ eY0

Float_t EdbShowerRec::eY0
private

◆ eYb

Float_t EdbShowerRec::eYb[10000]
private

◆ eZ0

Float_t EdbShowerRec::eZ0
private

◆ eZb

Float_t EdbShowerRec::eZb[10000]
private

◆ file

TFile* EdbShowerRec::file

◆ fileout

TFile* EdbShowerRec::fileout

◆ fileout2

TFile* EdbShowerRec::fileout2

◆ fileout3

TFile* EdbShowerRec::fileout3

◆ FileReconstructedShowerTree

TFile* EdbShowerRec::FileReconstructedShowerTree

◆ FileShowerParametrisationTree

TFile* EdbShowerRec::FileShowerParametrisationTree

◆ gAli

EdbPVRec* EdbShowerRec::gAli

◆ histo_deltaR_mean

TH1D* EdbShowerRec::histo_deltaR_mean

◆ histo_deltaR_rms

TH1D* EdbShowerRec::histo_deltaR_rms

◆ histo_deltaT_mean

TH1D* EdbShowerRec::histo_deltaT_mean

◆ histo_deltaT_rms

TH1D* EdbShowerRec::histo_deltaT_rms

◆ histo_longprofile_av

TH1D* EdbShowerRec::histo_longprofile_av

◆ histo_nbtk_av

TH1D* EdbShowerRec::histo_nbtk_av

◆ idb

Int_t EdbShowerRec::idb[10000]

◆ inANN

Double_t EdbShowerRec::inANN[70]
private

◆ isizeb

Int_t EdbShowerRec::isizeb

◆ mcDigitIndexBottom

Int_t EdbShowerRec::mcDigitIndexBottom[1000]

◆ mcDigitIndexTop

Int_t EdbShowerRec::mcDigitIndexTop[1000]

◆ mlp1

TMultiLayerPerceptron* EdbShowerRec::mlp1

◆ mlp2

TMultiLayerPerceptron* EdbShowerRec::mlp2

◆ mlp3

TMultiLayerPerceptron* EdbShowerRec::mlp3

◆ mlp4

TMultiLayerPerceptron* EdbShowerRec::mlp4

◆ nfilmb

Int_t EdbShowerRec::nfilmb[10000]

◆ ngrainb

Int_t EdbShowerRec::ngrainb[10000]

◆ ntrace1simub

Int_t EdbShowerRec::ntrace1simub[10000]

◆ ntrace2simub

Int_t EdbShowerRec::ntrace2simub[10000]

◆ ntrace3simub

Float_t EdbShowerRec::ntrace3simub[10000]

◆ ntrace4simub

Int_t EdbShowerRec::ntrace4simub[10000]

◆ number_eventb

Int_t EdbShowerRec::number_eventb

◆ output15

Float_t EdbShowerRec::output15

◆ output20

Float_t EdbShowerRec::output20

◆ output30

Float_t EdbShowerRec::output30

◆ output50

Float_t EdbShowerRec::output50

◆ plateb

Int_t EdbShowerRec::plateb[10000]

◆ purityb

Float_t EdbShowerRec::purityb

◆ showerID

Int_t EdbShowerRec::showerID

◆ ShowerParametrisationTree

TTree* EdbShowerRec::ShowerParametrisationTree

◆ sizeb

Int_t EdbShowerRec::sizeb

◆ sizeb15

Int_t EdbShowerRec::sizeb15

◆ sizeb20

Int_t EdbShowerRec::sizeb20

◆ sizeb30

Int_t EdbShowerRec::sizeb30

◆ tagprimary

Float_t EdbShowerRec::tagprimary[10000]

◆ trackdensb

Float_t EdbShowerRec::trackdensb

◆ treesaveb

TTree* EdbShowerRec::treesaveb

◆ treesaveb2

TTree* EdbShowerRec::treesaveb2

◆ treesaveb3

TTree* EdbShowerRec::treesaveb3

◆ txb

Float_t EdbShowerRec::txb[10000]

◆ tyb

Float_t EdbShowerRec::tyb[10000]

◆ type

Int_t EdbShowerRec::type

◆ varia

TTree* EdbShowerRec::varia

◆ xb

Float_t EdbShowerRec::xb[10000]

◆ yb

Float_t EdbShowerRec::yb[10000]

◆ zb

Float_t EdbShowerRec::zb[10000]

The documentation for this class was generated from the following files: