]>
Commit | Line | Data |
---|---|---|
3b77b2d1 | 1 | #ifndef ALICONVERSIONCUTS_H |
2 | #define ALICONVERSIONCUTS_H | |
3 | ||
4 | // Class handling all kinds of selection cuts for Gamma Conversion analysis | |
5 | // Authors: Svein Lindal, Daniel Lohner * | |
6 | ||
7 | #include "AliAODpidUtil.h" | |
8 | #include "AliConversionPhotonBase.h" | |
9 | #include "AliAODConversionMother.h" | |
10 | #include "AliAODTrack.h" | |
11 | #include "AliESDtrack.h" | |
12 | #include "AliVTrack.h" | |
13 | #include "AliAODTrack.h" | |
14 | #include "AliStack.h" | |
15 | #include "AliAnalysisCuts.h" | |
d008165e | 16 | #include "TH1F.h" |
3b77b2d1 | 17 | |
18 | class AliESDEvent; | |
19 | class AliAODEvent; | |
20 | class AliConversionPhotonBase; | |
21 | class AliKFVertex; | |
22 | class TH1F; | |
23 | class TH2F; | |
24 | class AliPIDResponse; | |
25 | class AliAnalysisCuts; | |
26 | class iostream; | |
27 | class TList; | |
28 | class AliAnalysisManager; | |
29 | ||
30 | ||
31 | using namespace std; | |
32 | ||
33 | class AliConversionCuts : public AliAnalysisCuts { | |
34 | ||
35 | public: | |
36 | ||
37 | ||
38 | enum cutIds { | |
ca91a3e1 | 39 | kisHeavyIon, |
40 | kCentralityMin, | |
41 | kCentralityMax, | |
42 | kselectV0AND, | |
43 | kmultiplicityMethod, | |
44 | kremovePileUp, | |
45 | kExtraSignals, | |
3b77b2d1 | 46 | kv0FinderType, |
ca91a3e1 | 47 | ketaCut, |
48 | kRCut, | |
3b77b2d1 | 49 | ksinglePtCut, |
50 | kclsTPCCut, | |
ca91a3e1 | 51 | kededxSigmaCut, |
52 | kpidedxSigmaCut, | |
53 | kpiMomdedxSigmaCut, | |
3b77b2d1 | 54 | kpiMaxMomdedxSigmaCut, |
ca91a3e1 | 55 | kLowPRejectionSigmaCut, |
3b77b2d1 | 56 | kTOFelectronPID, |
ca91a3e1 | 57 | kQtMaxCut, |
58 | kchi2GammaCut, | |
3b77b2d1 | 59 | kPsiPair, |
ca91a3e1 | 60 | kdoPhotonAsymmetryCut, |
3b77b2d1 | 61 | kCosPAngle, |
ca91a3e1 | 62 | kElecShare, |
63 | kToCloseV0s, | |
3b77b2d1 | 64 | kNCuts |
65 | }; | |
66 | ||
d008165e | 67 | enum photonCuts { |
68 | kPhotonIn=0, | |
69 | kOnFly, | |
70 | kNoTracks, | |
71 | kTrackCuts, | |
72 | kdEdxCuts, | |
92efd725 | 73 | kConvPointFail, |
d008165e | 74 | kPhotonCuts, |
75 | kPhotonOut | |
76 | }; | |
77 | ||
78 | ||
3b77b2d1 | 79 | Bool_t SetCutIds(TString cutString); |
80 | Int_t fCuts[kNCuts]; | |
81 | Bool_t SetCut(cutIds cutID, Int_t cut); | |
82 | Bool_t UpdateCutString(cutIds cutID, Int_t value); | |
83 | ||
84 | ||
85 | static const char * fgkCutNames[kNCuts]; | |
86 | ||
92efd725 | 87 | Double_t GetCosineOfPointingAngle(const AliConversionPhotonBase * photon, AliVEvent * event) const; |
3b77b2d1 | 88 | |
89 | ||
90 | Bool_t InitializeCutsFromCutString(const TString analysisCutSelection); | |
92efd725 | 91 | void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB) {fOfflineTriggerMask = offlineTriggerMask;} |
92 | void FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0); | |
ca91a3e1 | 93 | void SetAcceptedHeader(TList *HeaderList){fHeaderList = HeaderList;} |
94 | ||
92efd725 | 95 | Int_t GetEventQuality(){return fEventQuality;} |
3b77b2d1 | 96 | |
97 | AliConversionCuts(const char *name="V0Cuts", const char * title="V0 Cuts"); | |
98 | virtual ~AliConversionCuts(); //virtual destructor | |
99 | ||
100 | virtual Bool_t IsSelected(TObject* /*obj*/){return kTRUE;} | |
101 | virtual Bool_t IsSelected(TList* /*list*/) {return kTRUE;} | |
102 | ||
103 | TString GetCutNumber(); | |
104 | ||
92efd725 | 105 | void GetCentralityRange(Double_t range[2]){range[0]=10*fCentralityMin;range[1]=10*fCentralityMax;}; |
106 | ||
3b77b2d1 | 107 | // Cut Selection |
92efd725 | 108 | Bool_t EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent); |
d008165e | 109 | Bool_t PhotonIsSelected(AliConversionPhotonBase * photon, AliVEvent * event); |
92efd725 | 110 | Bool_t PhotonIsSelectedMC(TParticle *particle,AliStack *fMCStack,Bool_t checkForConvertedGamma=kTRUE); |
2bb2434e | 111 | Bool_t ElectronIsSelectedMC(TParticle *particle,AliStack *fMCStack); |
3b77b2d1 | 112 | Bool_t TracksAreSelected(AliVTrack * negTrack, AliVTrack * posTrack); |
113 | Bool_t MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal=kTRUE); | |
92efd725 | 114 | Bool_t MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack, Bool_t bMCDaughtersInAcceptance=kFALSE); |
3b77b2d1 | 115 | |
116 | void InitAODpidUtil(Int_t type); | |
3b77b2d1 | 117 | Bool_t InitPIDResponse(); |
118 | ||
119 | void SetPIDResponse(AliPIDResponse * pidResponse) {fPIDResponse = pidResponse;} | |
120 | AliPIDResponse * GetPIDResponse() { return fPIDResponse;} | |
121 | ||
122 | void PrintCuts(); | |
123 | ||
92efd725 | 124 | void InitCutHistograms(TString name="",Bool_t preCut = kTRUE); |
125 | void SetFillCutHistograms(TString name="",Bool_t preCut = kTRUE){if(!fHistograms){InitCutHistograms(name,preCut);};} | |
3b77b2d1 | 126 | TList *GetCutHistograms(){return fHistograms;} |
d008165e | 127 | void FillPhotonCutIndex(Int_t photoncut){if(hCutIndex)hCutIndex->Fill(photoncut);} |
3b77b2d1 | 128 | |
92efd725 | 129 | static AliVTrack * GetTrack(AliVEvent * event, Int_t label); |
130 | ||
3b77b2d1 | 131 | ///Cut functions |
132 | Bool_t SpecificTrackCuts(AliAODTrack * negTrack, AliAODTrack * posTrack,Int_t &cutIndex); | |
133 | Bool_t SpecificTrackCuts(AliESDtrack * negTrack, AliESDtrack * posTrack,Int_t &cutIndex); | |
134 | Bool_t AcceptanceCuts(AliConversionPhotonBase *photon); | |
135 | Bool_t AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg); | |
136 | Bool_t dEdxCuts(AliVTrack * track); | |
137 | Bool_t ArmenterosQtCut(AliConversionPhotonBase *photon); | |
138 | Bool_t AsymmetryCut(AliConversionPhotonBase *photon,AliVEvent *event); | |
139 | Bool_t PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent * event); | |
92efd725 | 140 | Bool_t SelectV0Finder(Bool_t onfly){ |
141 | if(onfly == fUseOnFlyV0Finder) return kTRUE; | |
142 | else return kFALSE; | |
143 | } | |
3b77b2d1 | 144 | Bool_t PhotonCuts(AliConversionPhotonBase *photon,AliVEvent *event); |
145 | Bool_t CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent * event); | |
92efd725 | 146 | Bool_t PsiPairCut(const AliConversionPhotonBase * photon) const; |
147 | Bool_t CosinePAngleCut(const AliConversionPhotonBase * photon, AliVEvent * event) const; | |
148 | Bool_t RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s); | |
149 | Bool_t RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0); | |
ca91a3e1 | 150 | Bool_t IsParticleFromBGEvent(Int_t index, AliStack *MCStack); |
151 | void GetNotRejectedParticles(Int_t rejection, TList *HeaderList, AliMCEvent *MCEvent); | |
152 | ||
3b77b2d1 | 153 | // Event Cuts |
154 | Bool_t IsCentralitySelected(AliVEvent *fInputEvent); | |
155 | Double_t GetCentrality(AliVEvent *event); | |
156 | Int_t GetNumberOfContributorsVtx(AliVEvent *event); | |
157 | Bool_t VertexZCut(AliVEvent *fInputEvent); | |
92efd725 | 158 | Bool_t IsTriggerSelected(); |
3b77b2d1 | 159 | |
160 | // Set Individual Cuts | |
161 | Bool_t SetRCut(Int_t RCut); | |
162 | Bool_t SetV0Finder(Int_t v0FinderType); | |
3b77b2d1 | 163 | Bool_t SetChi2GammaCut(Int_t chi2GammaCut); |
164 | Bool_t SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut); | |
165 | Bool_t SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut); | |
166 | Bool_t SetSinglePtCut(Int_t singlePtCut); | |
167 | Bool_t SetTPCClusterCut(Int_t clsTPCCut); | |
168 | Bool_t SetEtaCut(Int_t etaCut); | |
3b77b2d1 | 169 | Bool_t SetMinMomPiondEdxCut(Int_t piMinMomdedxSigmaCut); |
170 | Bool_t SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut); | |
171 | Bool_t SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut); | |
172 | Bool_t SetQtMaxCut(Int_t QtMaxCut); | |
3b77b2d1 | 173 | Bool_t SetTOFElectronPIDCut(Int_t TOFelectronPID); |
174 | Bool_t SetTRDElectronCut(Int_t TRDElectronCut); | |
92efd725 | 175 | Bool_t SetCentralityMin(Int_t useCentrality); |
3b77b2d1 | 176 | Bool_t SetIsHeavyIon(Int_t isHeavyIon); |
92efd725 | 177 | Bool_t SetCentralityMax(Int_t centralityBin); |
3b77b2d1 | 178 | Bool_t SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut); |
ca91a3e1 | 179 | Bool_t SetRemovePileUp(Int_t removePileUp); |
92efd725 | 180 | Bool_t SetMultiplicityMethod(Int_t multiplicityMethod); |
3b77b2d1 | 181 | Bool_t SetSelectV0AND(Int_t selectV0AND); |
182 | Bool_t SetCosPAngleCut(Int_t cosCut); | |
183 | Bool_t SetPsiPairCut(Int_t psiCut); | |
92efd725 | 184 | Bool_t SetSharedElectronCut(Int_t sharedElec); |
185 | Bool_t SetToCloseV0sCut(Int_t toClose); | |
ca91a3e1 | 186 | Bool_t SetRejectExtraSignalsCut(Int_t extraSignal); |
3b77b2d1 | 187 | |
188 | // Request Flags | |
189 | ||
3b77b2d1 | 190 | Bool_t IsHeavyIon(){return fIsHeavyIon;} |
3b77b2d1 | 191 | Int_t GetFirstTPCRow(Double_t radius); |
ca91a3e1 | 192 | |
92efd725 | 193 | Bool_t UseElecSharingCut(){return fDoSharedElecCut;} |
194 | Bool_t UseToCloseV0sCut(){return fDoToCloseV0sCut;} | |
195 | Int_t GetMultiplicityMethod(){return fMultiplicityMethod;} | |
196 | Double_t GetEtaCut(){return fEtaCut;} | |
ca91a3e1 | 197 | Int_t GetSignalRejection(){return fRejectExtraSignals;} |
198 | TList* GetAcceptedHeader(){return fHeaderList;} | |
3b77b2d1 | 199 | |
200 | protected: | |
201 | TList *fHistograms; | |
ca91a3e1 | 202 | TList *fHeaderList; |
3b77b2d1 | 203 | AliPIDResponse *fPIDResponse; |
204 | ||
92efd725 | 205 | |
206 | Int_t fEventQuality; // EventQuality | |
3b77b2d1 | 207 | //cuts |
208 | Double_t fMaxR; //r cut | |
209 | Double_t fMinR; //r cut | |
210 | Double_t fEtaCut; //eta cut | |
211 | Double_t fEtaCutMin; //eta cut | |
212 | Double_t fPtCut; // pt cut | |
213 | Double_t fSinglePtCut; // pt cut for electron/positron | |
214 | Double_t fMaxZ; //z cut | |
215 | Double_t fMinClsTPC; // minimum clusters in the TPC | |
216 | Double_t fMinClsTPCToF; // minimum clusters to findable clusters | |
217 | Double_t fLineCutZRSlope; //linecut | |
218 | Double_t fLineCutZValue; //linecut | |
219 | Double_t fLineCutZRSlopeMin; //linecut | |
220 | Double_t fLineCutZValueMin; //linecut | |
221 | Double_t fChi2CutConversion; //chi2cut | |
3b77b2d1 | 222 | Double_t fPIDProbabilityCutNegativeParticle; |
223 | Double_t fPIDProbabilityCutPositiveParticle; | |
224 | Bool_t fDodEdxSigmaCut; // flag to use the dEdxCut based on sigmas | |
225 | Bool_t fDoTOFsigmaCut; // flag to use TOF pid cut RRnewTOF | |
226 | Double_t fPIDTRDEfficiency; // required electron efficiency for TRD PID | |
227 | Bool_t fDoTRDPID; // flag to use TRD pid | |
228 | Double_t fPIDnSigmaAboveElectronLine; // sigma cut | |
229 | Double_t fPIDnSigmaBelowElectronLine; // sigma cut | |
230 | Double_t fTofPIDnSigmaAboveElectronLine; // sigma cut RRnewTOF | |
231 | Double_t fTofPIDnSigmaBelowElectronLine; // sigma cut RRnewTOF | |
232 | Double_t fPIDnSigmaAbovePionLine; // sigma cut | |
233 | Double_t fPIDnSigmaAbovePionLineHighPt; // sigma cut | |
234 | Double_t fPIDMinPnSigmaAbovePionLine; // sigma cut | |
235 | Double_t fPIDMaxPnSigmaAbovePionLine; // sigma cut | |
236 | Double_t fDoKaonRejectionLowP; // Kaon rejection at low p | |
237 | Double_t fDoProtonRejectionLowP; // Proton rejection at low p | |
238 | Double_t fDoPionRejectionLowP; // Pion rejection at low p | |
239 | Double_t fPIDnSigmaAtLowPAroundKaonLine; // sigma cut | |
240 | Double_t fPIDnSigmaAtLowPAroundProtonLine; // sigma cut | |
241 | Double_t fPIDnSigmaAtLowPAroundPionLine; // sigma cut | |
242 | Double_t fPIDMinPKaonRejectionLowP; // Momentum limit to apply kaon rejection | |
243 | Double_t fPIDMinPProtonRejectionLowP; // Momentum limit to apply proton rejection | |
244 | Double_t fPIDMinPPionRejectionLowP; // Momentum limit to apply proton rejection | |
245 | Bool_t fDoQtGammaSelection; // Select gammas using qtMax | |
246 | Bool_t fDoHighPtQtGammaSelection; // RRnew Select gammas using qtMax for high pT | |
247 | Double_t fQtMax; // Maximum Qt from Armenteros to select Gammas | |
248 | Double_t fHighPtQtMax; // RRnew Maximum Qt for High pT from Armenteros to select Gammas | |
249 | Double_t fPtBorderForQt; // RRnew | |
250 | Double_t fXVertexCut; //vertex cut | |
251 | Double_t fYVertexCut; //vertex cut | |
252 | Double_t fZVertexCut; // vertexcut | |
253 | Double_t fNSigmaMass; //nsigma cut | |
254 | Bool_t fUseEtaMinCut; //flag | |
255 | Bool_t fUseOnFlyV0Finder; //flag | |
256 | Bool_t fDoPhotonAsymmetryCut; // flag to use the PhotonAsymetryCut | |
257 | Double_t fMinPPhotonAsymmetryCut; // Min Momentum for Asymmetry Cut | |
258 | Double_t fMinPhotonAsymmetry; // Asymmetry Cut | |
259 | Bool_t fIsHeavyIon; // flag for heavy ion | |
92efd725 | 260 | Int_t fDetectorCentrality; // centrality detecotor V0M or CL1 |
261 | Int_t fModCentralityClass; // allows to select smaller centrality classes | |
3b77b2d1 | 262 | Double_t fMaxVertexZ; // max z offset of vertex |
92efd725 | 263 | Int_t fCentralityMin; // centrality selection lower bin value |
264 | Int_t fCentralityMax; // centrality selection upper bin value | |
3b77b2d1 | 265 | Bool_t fUseCorrectedTPCClsInfo; // flag to use corrected tpc cl info |
266 | Bool_t fUseTOFpid; // flag to use tof pid | |
92efd725 | 267 | Int_t fMultiplicityMethod; // selected multiplicity method |
3b77b2d1 | 268 | Bool_t fSelectV0AND; // flag |
269 | Bool_t fRemovePileUp; //flag | |
270 | Float_t fOpeningAngle; // min opening angle for meson | |
271 | Float_t fPsiPairCut; | |
272 | Float_t fCosPAngleCut; | |
92efd725 | 273 | Bool_t fDoToCloseV0sCut; // |
ca91a3e1 | 274 | Int_t fRejectExtraSignals;// |
92efd725 | 275 | Double_t fminV0Dist; // |
276 | Bool_t fDoSharedElecCut; // | |
277 | UInt_t fOfflineTriggerMask; // Task processes collision candidates only | |
278 | TRandom3 fRandom; // | |
279 | Int_t *fElectronLabelArray; // Array with elec/pos v0 label | |
2bb2434e | 280 | Float_t fConversionPointXArray; // Array with conversion Point x |
281 | Float_t fConversionPointYArray; // Array with conversion Point y | |
282 | Float_t fConversionPointZArray; // Array with conversion Point z | |
ca91a3e1 | 283 | Int_t *fNotRejectedStart; |
284 | Int_t *fNotRejectedEnd; | |
285 | TString *fGeneratorNames; | |
286 | Int_t fnHeaders; | |
287 | ||
3b77b2d1 | 288 | |
289 | // Histograms | |
290 | TObjString *fCutString; // cut number used for analysis | |
291 | TH1F *hdEdxCuts; // bookkeeping for dEdx cuts | |
292 | TH2F *hTPCdEdxbefore; // TPC dEdx before cuts | |
293 | TH2F *hTPCdEdxafter; // TPC dEdx after cuts | |
92efd725 | 294 | TH2F *hTOFbefore; // TOF after cuts |
295 | TH2F *hTOFafter; // TOF after cuts | |
3b77b2d1 | 296 | TH1F *hTrackCuts; // bookkeeping for track cuts |
297 | TH1F *hPhotonCuts; // bookkeeping for photon specific cuts | |
298 | TH1F *hInvMassbefore; // e+e- inv mass distribution before cuts | |
299 | TH2F *hArmenterosbefore; // armenteros podolanski plot before cuts | |
300 | TH1F *hInvMassafter; // e+e- inv mass distribution after cuts | |
301 | TH2F *hArmenterosafter; // armenteros podolanski plot after cuts | |
302 | TH1F *hAcceptanceCuts; // bookkeeping for acceptance cuts | |
303 | TH1F *hCutIndex; // bookkeeping for cuts | |
304 | TH1F *hV0EventCuts; // bookkeeping for event selection cuts | |
305 | TH1F *hCentrality; // centrality distribution for selected events | |
306 | TH1F *hVertexZ; // vertex z distribution for selected events | |
92efd725 | 307 | TH1F *hTriggerClass; //fired offline trigger class |
3b77b2d1 | 308 | |
309 | ||
310 | private: | |
311 | ||
312 | AliConversionCuts(const AliConversionCuts&); // not implemented | |
313 | AliConversionCuts& operator=(const AliConversionCuts&); // not implemented | |
314 | ||
315 | ||
316 | ClassDef(AliConversionCuts,2) | |
317 | }; | |
318 | ||
319 | ||
320 | inline void AliConversionCuts::InitAODpidUtil(Int_t type) { | |
321 | if (!fPIDResponse) fPIDResponse = new AliAODpidUtil(); | |
322 | Double_t alephParameters[5]; | |
323 | // simulation | |
324 | alephParameters[0] = 2.15898e+00/50.; | |
325 | alephParameters[1] = 1.75295e+01; | |
326 | alephParameters[2] = 3.40030e-09; | |
327 | alephParameters[3] = 1.96178e+00; | |
328 | alephParameters[4] = 3.91720e+00; | |
329 | fPIDResponse->GetTOFResponse().SetTimeResolution(80.); | |
330 | ||
331 | // data | |
332 | if (type==1){ | |
333 | alephParameters[0] = 0.0283086/0.97; | |
334 | alephParameters[1] = 2.63394e+01; | |
335 | alephParameters[2] = 5.04114e-11; | |
336 | alephParameters[3] = 2.12543e+00; | |
337 | alephParameters[4] = 4.88663e+00; | |
338 | fPIDResponse->GetTOFResponse().SetTimeResolution(130.); | |
339 | fPIDResponse->GetTPCResponse().SetMip(50.); | |
340 | } | |
341 | ||
342 | fPIDResponse->GetTPCResponse().SetBetheBlochParameters( | |
343 | alephParameters[0],alephParameters[1],alephParameters[2], | |
344 | alephParameters[3],alephParameters[4]); | |
345 | ||
346 | fPIDResponse->GetTPCResponse().SetSigma(3.79301e-03, 2.21280e+04); | |
347 | } | |
348 | ||
349 | ||
350 | #endif |