]>
Commit | Line | Data |
---|---|---|
275a301c | 1 | #ifndef ALIITSTRACKLETERSPDEFF_H |
2 | #define ALIITSTRACKLETERSPDEFF_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | //____________________________________________________________________ | |
9 | // | |
10 | // AliITSTrackleterSPDEff - find SPD chips efficiencies by using tracklets. | |
11 | // | |
12 | // This class has been derived from AliITSMultReconstructor (see | |
13 | // it for more details). It is the class for the Trackleter used to estimate | |
14 | // SPD plane efficiency. | |
15 | // The trackleter prediction is built using the vertex and 1 cluster. | |
16 | ||
17 | // | |
18 | // | |
19 | // Author : Giuseppe Eugenio Bruno, based on the skeleton of Reconstruct method provided by Tiziano Virgili | |
20 | // email: giuseppe.bruno@ba.infn.it | |
21 | // | |
22 | //____________________________________________________________________ | |
23 | ||
84161aec | 24 | class AliStack; |
275a301c | 25 | #include "AliITSMultReconstructor.h" |
26 | #include "AliITSPlaneEffSPD.h" | |
27 | ||
275a301c | 28 | class AliITSTrackleterSPDEff : public AliITSMultReconstructor |
29 | { | |
30 | public: | |
31 | AliITSTrackleterSPDEff(); | |
32 | virtual ~AliITSTrackleterSPDEff(); | |
84161aec | 33 | // Main method to perform the trackleter and the SPD efficiency evaluation |
a3b31967 | 34 | void Reconstruct(TTree* tree, Float_t* vtx, Float_t* vtxRes, AliStack* pStack=0x0, TTree* tRef=0x0); |
275a301c | 35 | |
0fce916f | 36 | void SetReflectClusterAroundZAxisForLayer(Int_t ilayer,Bool_t b=kTRUE){ // method to study residual background: |
37 | if(b) AliInfo(Form("All clusters on layer %d will be rotated by 180 deg around z",ilayer)); | |
38 | if(ilayer==0) fReflectClusterAroundZAxisForLayer0=b; // a rotation by 180degree around the Z axis | |
39 | else if(ilayer==1) fReflectClusterAroundZAxisForLayer1=b; // (x->-x; y->-y) to all RecPoints on a | |
40 | else AliInfo("Nothing done: input argument (ilayer) either 0 or 1"); // given layer is applied. In such a way | |
41 | } // you remove all the true tracklets. | |
42 | ||
84161aec | 43 | void SetPhiWindowL1(Float_t w=0.08) {fPhiWindowL1=w;} // method to set the cuts in the interpolation |
44 | void SetZetaWindowL1(Float_t w=1.) {fZetaWindowL1=w;} // phase; use method of the base class for extrap. | |
45 | void SetOnlyOneTrackletPerC1(Bool_t b = kTRUE) {fOnlyOneTrackletPerC1 = b;} // as in the base class but | |
46 | // for the inner layer | |
a3b31967 | 47 | void SetUpdateOncePerEventPlaneEff(Bool_t b = kTRUE) {fUpdateOncePerEventPlaneEff = b;} |
275a301c | 48 | |
84161aec | 49 | AliITSPlaneEffSPD* GetPlaneEff() const {return fPlaneEffSPD;} // return a pointer to the AliITSPlaneEffSPD |
275a301c | 50 | |
84161aec | 51 | void SetMC(Bool_t mc=kTRUE) {fMC=mc; InitPredictionMC(); return;} // switch on access to MC true |
52 | Bool_t GetMC() const {return fMC;} // check the access to MC true | |
53 | // Only for MC: use only "primary" particles (according to PrimaryTrackChecker) for the tracklet prediction | |
54 | void SetUseOnlyPrimaryForPred(Bool_t flag=kTRUE) {CallWarningMC(); fUseOnlyPrimaryForPred = flag; } | |
55 | // Only for MC: use only "secondary" particles (according to PrimaryTrackChecker) for the tracklet prediction | |
275a301c | 56 | void SetUseOnlySecondaryForPred(Bool_t flag=kTRUE) {CallWarningMC(); fUseOnlySecondaryForPred = flag;} |
84161aec | 57 | // Only for MC: associate a cluster to the tracklet prediction if from the same particle |
275a301c | 58 | void SetUseOnlySameParticle(Bool_t flag=kTRUE) {CallWarningMC(); fUseOnlySameParticle = flag;} |
84161aec | 59 | // Only for MC: associate a cluster to the tracklet prediction if from different particles |
275a301c | 60 | void SetUseOnlyDifferentParticle(Bool_t flag=kTRUE) {CallWarningMC(); fUseOnlyDifferentParticle = flag;} |
84161aec | 61 | // Only for MC: re-define "primary" a particle if it is also "stable" (according to definition in method DecayingTrackChecker) |
275a301c | 62 | void SetUseOnlyStableParticle(Bool_t flag=kTRUE) {CallWarningMC(); fUseOnlyStableParticle = flag;} |
84161aec | 63 | // only for MC: Getters relative to the above setters |
275a301c | 64 | Bool_t GetUseOnlyPrimaryForPred() const {CallWarningMC(); return fUseOnlyPrimaryForPred; } |
65 | Bool_t GetUseOnlySecondaryForPred() const {CallWarningMC(); return fUseOnlySecondaryForPred;} | |
66 | Bool_t GetUseOnlySameParticle() const {CallWarningMC(); return fUseOnlySameParticle;} | |
67 | Bool_t GetUseOnlyDifferentParticle() const {CallWarningMC(); return fUseOnlyDifferentParticle;} | |
68 | Bool_t GetUseOnlyStableParticle() const {CallWarningMC(); return fUseOnlyStableParticle;} | |
84161aec | 69 | // Getters for the data members related to MC true statisitcs (see below) |
275a301c | 70 | Int_t GetPredictionPrimary(const UInt_t key) const; |
71 | Int_t GetPredictionSecondary(const UInt_t key) const; | |
72 | Int_t GetClusterPrimary(const UInt_t key) const; | |
73 | Int_t GetClusterSecondary(const UInt_t key) const; | |
a3b31967 | 74 | Int_t GetSuccessPP(const UInt_t key) const; |
75 | Int_t GetSuccessTT(const UInt_t key) const; | |
76 | Int_t GetSuccessS(const UInt_t key) const; | |
77 | Int_t GetSuccessP(const UInt_t key) const; | |
78 | Int_t GetFailureS(const UInt_t key) const; | |
79 | Int_t GetFailureP(const UInt_t key) const; | |
80 | Int_t GetRecons(const UInt_t key) const; | |
81 | Int_t GetNonRecons(const UInt_t key) const; | |
275a301c | 82 | Int_t GetPredictionPrimary(const UInt_t mod, const UInt_t chip) const |
83 | {return GetPredictionPrimary(fPlaneEffSPD->GetKey(mod,chip));}; | |
84 | Int_t GetPredictionSecondary(const UInt_t mod, const UInt_t chip) const | |
85 | {return GetPredictionSecondary(fPlaneEffSPD->GetKey(mod,chip));}; | |
86 | Int_t GetClusterPrimary(const UInt_t mod, const UInt_t chip) const | |
87 | {return GetClusterPrimary(fPlaneEffSPD->GetKey(mod,chip));}; | |
88 | Int_t GetClusterSecondary(const UInt_t mod, const UInt_t chip) const | |
89 | {return GetClusterSecondary(fPlaneEffSPD->GetKey(mod,chip));}; | |
a3b31967 | 90 | Int_t GetSuccessPP(const UInt_t mod, const UInt_t chip) const |
91 | {return GetSuccessPP(fPlaneEffSPD->GetKey(mod,chip));}; | |
92 | Int_t GetSuccessTT(const UInt_t mod, const UInt_t chip) const | |
93 | {return GetSuccessTT(fPlaneEffSPD->GetKey(mod,chip));}; | |
94 | Int_t GetSuccessS(const UInt_t mod, const UInt_t chip) const | |
95 | {return GetSuccessS(fPlaneEffSPD->GetKey(mod,chip));}; | |
96 | Int_t GetSuccessP(const UInt_t mod, const UInt_t chip) const | |
97 | {return GetSuccessP(fPlaneEffSPD->GetKey(mod,chip));}; | |
98 | Int_t GetFailureS(const UInt_t mod, const UInt_t chip) const | |
99 | {return GetFailureS(fPlaneEffSPD->GetKey(mod,chip));}; | |
100 | Int_t GetFailureP(const UInt_t mod, const UInt_t chip) const | |
101 | {return GetFailureP(fPlaneEffSPD->GetKey(mod,chip));}; | |
102 | Int_t GetRecons(const UInt_t mod, const UInt_t chip) const | |
103 | {return GetRecons(fPlaneEffSPD->GetKey(mod,chip));}; | |
104 | Int_t GetNonRecons(const UInt_t mod, const UInt_t chip) const | |
105 | {return GetNonRecons(fPlaneEffSPD->GetKey(mod,chip));}; | |
84161aec | 106 | // methods to write/reas cuts and MC statistics into/from file |
275a301c | 107 | void SavePredictionMC(TString filename="TrackletsMCpred.txt") const; |
108 | void ReadPredictionMC(TString filename="TrackletsMCpred.txt"); | |
109 | // Print some class info in ascii form to stream (cut values and MC statistics) | |
110 | virtual void PrintAscii(ostream *os)const; | |
111 | // Read some class info in ascii form from stream (cut values and MC statistics) | |
112 | virtual void ReadAscii(istream *is); | |
113 | Bool_t GetHistOn() const {return fHistOn;}; // return status of histograms | |
84161aec | 114 | // write histograms into a root file on disk |
275a301c | 115 | Bool_t WriteHistosToFile(TString filename="TrackleterSPDHistos.root",Option_t* option = "RECREATE"); |
84161aec | 116 | // switch on/off the extra histograms |
275a301c | 117 | void SetHistOn(Bool_t his=kTRUE) {AliITSMultReconstructor::SetHistOn(his); |
118 | if(GetHistOn()) {DeleteHistos(); BookHistos();} else DeleteHistos(); return;} | |
119 | ||
120 | protected: | |
84161aec | 121 | AliITSTrackleterSPDEff(const AliITSTrackleterSPDEff& mr); // protected method: no copy allowed from outside |
275a301c | 122 | AliITSTrackleterSPDEff& operator=(const AliITSTrackleterSPDEff& mr); |
123 | ||
124 | Bool_t* fAssociationFlag1; // flag for the associations (Layer 1) | |
125 | UInt_t* fChipPredOnLay2; // prediction for the chip traversed by the tracklet | |
126 | // based on vtx and ClusterLay1 (to be used in extrapolation) | |
127 | UInt_t* fChipPredOnLay1; // prediction for the chip traversed by the tracklet | |
128 | // based on vtx and ClusterLay2 (to be used in interpolation) | |
129 | Int_t fNTracklets1; // Number of tracklets layer 1 | |
a3b31967 | 130 | // possible cuts : |
275a301c | 131 | Float_t fPhiWindowL1; // Search window in phi (Layer 1) |
132 | Float_t fZetaWindowL1; // SEarch window in zeta (Layer 1) | |
133 | Bool_t fOnlyOneTrackletPerC1; // only one tracklet per cluster in L. 1 | |
a3b31967 | 134 | Bool_t fUpdateOncePerEventPlaneEff; // If this is kTRUE, then you can update the chip efficiency only once |
135 | // per event in that chip. This to avoid double counting from the | |
136 | // same tracklets which has two rec-points on one layer. | |
137 | Bool_t* fChipUpdatedInEvent; // boolean (chip by chip) to flag which chip has been updated its efficiency | |
138 | // in that event | |
275a301c | 139 | AliITSPlaneEffSPD* fPlaneEffSPD; // pointer to SPD plane efficiency class |
0fce916f | 140 | Bool_t fReflectClusterAroundZAxisForLayer0; // if kTRUE, then a 180degree rotation around Z is applied to all |
141 | Bool_t fReflectClusterAroundZAxisForLayer1; // clusters on that layer (x->-x; y->-y) | |
275a301c | 142 | Bool_t fMC; // Boolean to access Kinematics (only for MC events ) |
143 | Bool_t fUseOnlyPrimaryForPred; // Only for MC: if this is true, build tracklet prediction using only primary particles | |
144 | Bool_t fUseOnlySecondaryForPred; // Only for MC: if this is true build tracklet prediction using only secondary particles | |
145 | Bool_t fUseOnlySameParticle; // Only for MC: if this is true, assign a success only if clusters from same particles | |
146 | // (i.e. PP or SS) otherwise ignore the combination | |
147 | Bool_t fUseOnlyDifferentParticle; // Only for MC: if this is true, assign a success only if clusters from different particles | |
148 | // (i.e. PP' or PS or SS') otherwise ignore the combination | |
149 | Bool_t fUseOnlyStableParticle; // Only for MC: if this is kTRUE then method PrimaryTrackChecker return kTRUE only | |
150 | // for particles decaying (eventually) after pixel layers | |
151 | Int_t *fPredictionPrimary; // those for correction of bias from secondaries | |
152 | Int_t *fPredictionSecondary; // chip_by_chip: number of Prediction built with primaries/secondaries | |
153 | Int_t *fClusterPrimary; // number of clusters on a given chip fired by (at least) a primary | |
154 | Int_t *fClusterSecondary; // number of clusters on a given chip fired by (only) secondaries | |
a3b31967 | 155 | Int_t *fSuccessPP; // number of successes by using the same primary track (vs. chip of the success) |
156 | Int_t *fSuccessTT; // number of successes by using the same track (either a primary or a secondary) (vs. chip of the success) | |
157 | Int_t *fSuccessS; // number of successes by using a secondary for the prediction (vs. chip of the success) | |
158 | Int_t *fSuccessP; // number of successes by using a primary for the prediction (vs. chip of the success) | |
159 | Int_t *fFailureS; // number of failures by using a secondary for the prediction (vs. chip of the failure) | |
160 | Int_t *fFailureP; // number of failures by using a primary for the prediction (vs. chip of the failure) | |
161 | Int_t *fRecons; // number of particle which can be reconstructed (only for MC from TrackRef) | |
162 | Int_t *fNonRecons; // unmber of particle which cannot be reconstructed (only for MC from TrackRef) | |
275a301c | 163 | // extra histograms with respect to the base class AliITSMultReconstructor |
164 | TH1F* fhClustersDPhiInterpAcc; // Phi2 - Phi1 for tracklets (interpolation phase) | |
165 | TH1F* fhClustersDThetaInterpAcc; // Theta2 - Theta1 for tracklets (interpolation phase) | |
166 | TH1F* fhClustersDZetaInterpAcc; // z2 - z1projected for tracklets (interpolation phase) | |
167 | TH1F* fhClustersDPhiInterpAll; // Phi2 - Phi1 all the combinations (interpolation phase) | |
168 | TH1F* fhClustersDThetaInterpAll; // Theta2 - Theta1 all the combinations (interpolation phase) | |
169 | TH1F* fhClustersDZetaInterpAll; // z2 - z1projected all the combinations (interpolation phase) | |
170 | TH2F* fhDPhiVsDThetaInterpAll; // 2D plot for all the combinations | |
171 | TH2F* fhDPhiVsDThetaInterpAcc; // same plot for tracklets | |
172 | TH2F* fhDPhiVsDZetaInterpAll; // 2d plot for all the combination | |
173 | TH2F* fhDPhiVsDZetaInterpAcc; // same plot for tracklets | |
174 | TH1F* fhetaClustersLay2; // Pseudorapidity distr. for Clusters L. 2 | |
175 | TH1F* fhphiClustersLay2; // Azimuthal (Phi) distr. for Clusters L. 2 | |
176 | // | |
177 | Double_t GetRLayer(Int_t layer); // return average radius of layer (0,1) from Geometry | |
178 | Bool_t PrimaryTrackChecker(Int_t ipart,AliStack* stack=0x0); // check if a MC particle is primary (need AliStack) | |
179 | Int_t DecayingTrackChecker(Int_t ipart,AliStack* stack=0x0); // For a primary particle, check if it is stable (see cxx) | |
a3b31967 | 180 | // check if a MC particle is reconstructable |
181 | Bool_t IsReconstructableAt(Int_t layer,Int_t iC,Int_t ipart,Float_t* vtx,AliStack* stack=0x0,TTree* ref=0x0); | |
275a301c | 182 | void InitPredictionMC(); |
183 | // method to locate a chip using current vtx and polar coordinate od tracklet w.r.t. to vtx (zVtx may not be given) | |
184 | Bool_t FindChip(UInt_t &key, Int_t layer, Float_t* vtx, Float_t thetaVtx, Float_t phiVtx, Float_t zVtx=999.); | |
185 | // method to transform from Global Cilindrical coordinate to local (module) Cartesian coordinate | |
186 | Bool_t FromGloCilToLocCart(Int_t ilayer,Int_t idet, Double_t r, Double_t phi, Double_t z, | |
187 | Float_t &xloc, Float_t &zloc); | |
188 | // method to obtain the module (detector) index using global coordinates | |
189 | Int_t FindDetectorIndex(Int_t layer, Double_t phi, Double_t z); | |
190 | // this method gives you the intersections between a line and a circle (centred in the origin) | |
191 | // using polar coordinates | |
192 | Bool_t FindIntersectionPolar(Double_t vtx[2],Double_t phiVtx, Double_t R,Double_t &phi); | |
193 | Bool_t SetAngleRange02Pi(Double_t &angle); // set the range of angle in [0,2pi[ | |
194 | Bool_t SetAngleRange02Pi(Float_t &angle) | |
195 | {Double_t tmp=(Double_t)angle; Bool_t ret=SetAngleRange02Pi(tmp);angle=(Float_t)tmp;return ret;}; | |
196 | void CallWarningMC() const {if(!fMC) AliWarning("You can use this method only for MC! Call SetMC() first");} | |
197 | Bool_t SaveHists(); | |
198 | void BookHistos(); // booking of extra histograms w.r.t. base class | |
199 | void DeleteHistos(); //delete histos from memory | |
0fce916f | 200 | // Method to apply a rotation by 180degree to all RecPoints (x->-x; y->-y) on a given layer |
201 | void ReflectClusterAroundZAxisForLayer(Int_t ilayer); // to be used for backgnd estimation on real data | |
275a301c | 202 | |
0fce916f | 203 | ClassDef(AliITSTrackleterSPDEff,3) |
275a301c | 204 | }; |
205 | // Input and output function for standard C++ input/output (for the cut values and MC statistics). | |
206 | ostream &operator<<(ostream &os,const AliITSTrackleterSPDEff &s); | |
207 | istream &operator>>(istream &is, AliITSTrackleterSPDEff &s); | |
208 | #endif |