]>
Commit | Line | Data |
---|---|---|
8bdca7f1 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Authors: Friederike Bock, Baldo Sahlmueller * | |
5 | * Version 1.0 * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | //////////////////////////////////////////////// | |
17 | //--------------------------------------------- | |
18 | // Class handling all kinds of selection cuts for | |
19 | // Photon from EMCAL clusters | |
20 | //--------------------------------------------- | |
21 | //////////////////////////////////////////////// | |
22 | ||
23 | #include "AliCaloPhotonCuts.h" | |
24 | #include "AliAnalysisManager.h" | |
25 | #include "AliInputEventHandler.h" | |
26 | #include "AliMCEventHandler.h" | |
27 | #include "AliAODHandler.h" | |
28 | #include "TH1.h" | |
29 | #include "TH2.h" | |
30 | #include "TF1.h" | |
31 | #include "AliStack.h" | |
32 | #include "AliAODConversionMother.h" | |
d53bf4ac | 33 | #include "AliAODConversionPhoton.h" |
8bdca7f1 | 34 | #include "TObjString.h" |
35 | #include "AliAODEvent.h" | |
36 | #include "AliESDEvent.h" | |
37 | #include "AliCentrality.h" | |
38 | #include "TList.h" | |
39 | #include "TFile.h" | |
40 | #include "AliLog.h" | |
41 | #include "AliV0ReaderV1.h" | |
42 | #include "AliAODMCParticle.h" | |
43 | #include "AliAODMCHeader.h" | |
fd94f234 | 44 | #include "AliPicoTrack.h" |
d53bf4ac | 45 | #include "AliEMCALRecoUtils.h" |
2c75809c | 46 | #include "AliTrackerBase.h" |
8bdca7f1 | 47 | |
48 | class iostream; | |
49 | ||
50 | using namespace std; | |
51 | ||
52 | ClassImp(AliCaloPhotonCuts) | |
53 | ||
54 | ||
55 | const char* AliCaloPhotonCuts::fgkCutNames[AliCaloPhotonCuts::kNCuts] = { | |
fd94f234 | 56 | "ClusterType", //0 0: all, 1: EMCAL, 2: PHOS |
57 | "EtaMin", //1 0: -10, 1: -0.6687, 2: -0,5, 3: -2 | |
58 | "EtaMax", //2 0: 10, 1: 0.66465, 2: 0.5, 3: 2 | |
59 | "PhiMin", //3 0: -10000, 1: 1.39626 | |
60 | "PhiMax", //4 0: 10000, 1: 3.125 | |
61 | "DistanceToBadChannel", //5 0: 0, 1: 5 | |
62 | "Timing", //6 0: no cut | |
63 | "TrackMatching", //7 0: 0, 1: 5 | |
64 | "ExoticCell", //8 0: no cut | |
65 | "MinEnergy", //9 0: no cut, 1: 0.05, 2: 0.1, 3: 0.15, 4: 0.2, 5: 0.3, 6: 0.5, 7: 0.75, 8: 1, 9: 1.25 (all GeV) | |
66 | "MinNCells", //10 0: no cut, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6 | |
8bdca7f1 | 67 | "MinM02", //11 |
68 | "MaxM02", //12 | |
69 | "MinM20", //13 | |
70 | "MaxM20", //14 | |
71 | "MaximumDispersion", //15 | |
72 | "NLM" //16 | |
73 | }; | |
74 | ||
75 | ||
76 | //________________________________________________________________________ | |
77 | AliCaloPhotonCuts::AliCaloPhotonCuts(const char *name,const char *title) : | |
78 | AliAnalysisCuts(name,title), | |
79 | fHistograms(NULL), | |
80 | fClusterType(0), | |
81 | fMinEtaCut(-10), | |
82 | fMaxEtaCut(10), | |
9df9736d | 83 | fUseEtaCut(0), |
8bdca7f1 | 84 | fMinPhiCut(-10000), |
85 | fMaxPhiCut(-10000), | |
9df9736d | 86 | fUsePhiCut(0), |
8bdca7f1 | 87 | fMinDistanceToBadChannel(0), |
9df9736d | 88 | fUseDistanceToBadChannel(0), |
8bdca7f1 | 89 | fMaxTimeDiff(10e10), |
9df9736d | 90 | fUseTimeDiff(0), |
8bdca7f1 | 91 | fMinDistTrackToCluster(0), |
9df9736d | 92 | fUseDistTrackToCluster(0), |
8bdca7f1 | 93 | fExoticCell(0), |
9df9736d | 94 | fUseExoticCell(0), |
8bdca7f1 | 95 | fMinEnergy(0), |
9df9736d | 96 | fUseMinEnergy(0), |
8bdca7f1 | 97 | fMinNCells(0), |
9df9736d | 98 | fUseNCells(0), |
8bdca7f1 | 99 | fMaxM02(1000), |
100 | fMinM02(0), | |
9df9736d | 101 | fUseM02(0), |
8bdca7f1 | 102 | fMaxM20(1000), |
103 | fMinM20(0), | |
9df9736d | 104 | fUseM20(0), |
8bdca7f1 | 105 | fMaxDispersion(1000), |
9df9736d | 106 | fUseDispersion(0), |
8bdca7f1 | 107 | fMinNLM(0), |
108 | fMaxNLM(1000), | |
9df9736d | 109 | fUseNLM(0), |
8bdca7f1 | 110 | fCutString(NULL), |
111 | fHistCutIndex(NULL), | |
112 | fHistAcceptanceCuts(NULL), | |
113 | fHistClusterIdentificationCuts(NULL), | |
114 | fHistClusterEtavsPhiBeforeAcc(NULL), | |
115 | fHistClusterEtavsPhiAfterAcc(NULL), | |
116 | fHistClusterEtavsPhiAfterQA(NULL), | |
1a0b989a | 117 | //fHistDistanceToBadChannelBeforeAcc(NULL), |
118 | //fHistDistanceToBadChannelAfterAcc(NULL), | |
8bdca7f1 | 119 | fHistClusterTimevsEBeforeQA(NULL), |
120 | fHistClusterTimevsEAfterQA(NULL), | |
1a0b989a | 121 | //fHistExoticCellBeforeQA(NULL), |
122 | //fHistExoticCellAfterQA(NULL), | |
123 | //fHistNMatchedTracks(NULL), | |
8bdca7f1 | 124 | fHistEnergyOfClusterBeforeQA(NULL), |
125 | fHistEnergyOfClusterAfterQA(NULL), | |
126 | fHistNCellsBeforeQA(NULL), | |
127 | fHistNCellsAfterQA(NULL), | |
128 | fHistM02BeforeQA(NULL), | |
129 | fHistM02AfterQA(NULL), | |
130 | fHistM20BeforeQA(NULL), | |
131 | fHistM20AfterQA(NULL), | |
132 | fHistDispersionBeforeQA(NULL), | |
1a0b989a | 133 | fHistDispersionAfterQA(NULL), |
134 | //fHistNLMBeforeQA(NULL), | |
135 | //fHistNLMAfterQA(NULL), | |
136 | fHistClusterRBeforeQA(NULL), | |
137 | fHistClusterRAfterQA(NULL), | |
843ebf3b | 138 | fHistClusterdEtadPhiPosTracksBeforeQA(NULL), |
139 | fHistClusterdEtadPhiNegTracksBeforeQA(NULL), | |
1a0b989a | 140 | fHistClusterdEtadPhiAfterQA(NULL), |
141 | fHistDistanceTrackToClusterBeforeQA(NULL), | |
142 | fHistDistanceTrackToClusterAfterQA(NULL) | |
8bdca7f1 | 143 | { |
144 | for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;} | |
145 | fCutString=new TObjString((GetCutNumber()).Data()); | |
146 | } | |
147 | ||
148 | //________________________________________________________________________ | |
149 | AliCaloPhotonCuts::AliCaloPhotonCuts(const AliCaloPhotonCuts &ref) : | |
150 | AliAnalysisCuts(ref), | |
151 | fHistograms(NULL), | |
9df9736d | 152 | fClusterType(ref.fClusterType), |
8bdca7f1 | 153 | fMinEtaCut(ref.fMinEtaCut), |
154 | fMaxEtaCut(ref.fMaxEtaCut), | |
9df9736d | 155 | fUseEtaCut(ref.fUseEtaCut), |
8bdca7f1 | 156 | fMinPhiCut(ref.fMinPhiCut), |
157 | fMaxPhiCut(ref.fMaxPhiCut), | |
9df9736d | 158 | fUsePhiCut(ref.fUsePhiCut), |
8bdca7f1 | 159 | fMinDistanceToBadChannel(ref.fMinDistanceToBadChannel), |
9df9736d | 160 | fUseDistanceToBadChannel(ref.fUseDistanceToBadChannel), |
8bdca7f1 | 161 | fMaxTimeDiff(ref.fMaxTimeDiff), |
9df9736d | 162 | fUseTimeDiff(ref.fUseTimeDiff), |
8bdca7f1 | 163 | fMinDistTrackToCluster(ref.fMinDistTrackToCluster), |
9df9736d | 164 | fUseDistTrackToCluster(ref.fUseDistTrackToCluster), |
8bdca7f1 | 165 | fExoticCell(ref.fExoticCell), |
9df9736d | 166 | fUseExoticCell(ref.fUseExoticCell), |
8bdca7f1 | 167 | fMinEnergy(ref.fMinEnergy), |
9df9736d | 168 | fUseMinEnergy(ref.fUseMinEnergy), |
8bdca7f1 | 169 | fMinNCells(ref.fMinNCells), |
9df9736d | 170 | fUseNCells(ref.fUseNCells), |
8bdca7f1 | 171 | fMaxM02(ref.fMaxM02), |
172 | fMinM02(ref.fMinM02), | |
9df9736d | 173 | fUseM02(ref.fUseM02), |
8bdca7f1 | 174 | fMaxM20(ref.fMaxM20), |
175 | fMinM20(ref.fMinM20), | |
9df9736d | 176 | fUseM20(ref.fUseDispersion), |
8bdca7f1 | 177 | fMaxDispersion(ref.fMaxDispersion), |
9df9736d | 178 | fUseDispersion(ref.fUseDispersion), |
8bdca7f1 | 179 | fMinNLM(ref.fMinNLM), |
180 | fMaxNLM(ref.fMaxNLM), | |
9df9736d | 181 | fUseNLM(ref.fUseNLM), |
8bdca7f1 | 182 | fCutString(NULL), |
183 | fHistCutIndex(NULL), | |
184 | fHistAcceptanceCuts(NULL), | |
185 | fHistClusterIdentificationCuts(NULL), | |
186 | fHistClusterEtavsPhiBeforeAcc(NULL), | |
187 | fHistClusterEtavsPhiAfterAcc(NULL), | |
188 | fHistClusterEtavsPhiAfterQA(NULL), | |
1a0b989a | 189 | //fHistDistanceToBadChannelBeforeAcc(NULL), |
190 | //fHistDistanceToBadChannelAfterAcc(NULL), | |
8bdca7f1 | 191 | fHistClusterTimevsEBeforeQA(NULL), |
192 | fHistClusterTimevsEAfterQA(NULL), | |
1a0b989a | 193 | //fHistExoticCellBeforeQA(NULL), |
194 | //fHistExoticCellAfterQA(NULL), | |
195 | //fHistNMatchedTracks(NULL), | |
8bdca7f1 | 196 | fHistEnergyOfClusterBeforeQA(NULL), |
197 | fHistEnergyOfClusterAfterQA(NULL), | |
198 | fHistNCellsBeforeQA(NULL), | |
199 | fHistNCellsAfterQA(NULL), | |
200 | fHistM02BeforeQA(NULL), | |
201 | fHistM02AfterQA(NULL), | |
202 | fHistM20BeforeQA(NULL), | |
203 | fHistM20AfterQA(NULL), | |
204 | fHistDispersionBeforeQA(NULL), | |
1a0b989a | 205 | fHistDispersionAfterQA(NULL), |
206 | //fHistNLMBeforeQA(NULL), | |
207 | //fHistNLMAfterQA(NULL), | |
208 | fHistClusterRBeforeQA(NULL), | |
209 | fHistClusterRAfterQA(NULL), | |
843ebf3b | 210 | fHistClusterdEtadPhiPosTracksBeforeQA(NULL), |
211 | fHistClusterdEtadPhiNegTracksBeforeQA(NULL), | |
1a0b989a | 212 | fHistClusterdEtadPhiAfterQA(NULL), |
213 | fHistDistanceTrackToClusterBeforeQA(NULL), | |
214 | fHistDistanceTrackToClusterAfterQA(NULL) | |
8bdca7f1 | 215 | { |
216 | // Copy Constructor | |
217 | for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];} | |
218 | fCutString=new TObjString((GetCutNumber()).Data()); | |
219 | ||
220 | } | |
221 | ||
222 | ||
223 | //________________________________________________________________________ | |
224 | AliCaloPhotonCuts::~AliCaloPhotonCuts() { | |
225 | // Destructor | |
226 | //Deleting fHistograms leads to seg fault it it's added to output collection of a task | |
227 | // if(fHistograms) | |
228 | // delete fHistograms; | |
229 | // fHistograms = NULL; | |
230 | if(fCutString != NULL){ | |
231 | delete fCutString; | |
232 | fCutString = NULL; | |
233 | } | |
234 | } | |
235 | ||
236 | //________________________________________________________________________ | |
237 | void AliCaloPhotonCuts::InitCutHistograms(TString name){ | |
238 | ||
239 | // Initialize Cut Histograms for QA (only initialized and filled if function is called) | |
240 | TH1::AddDirectory(kFALSE); | |
241 | ||
242 | if(fHistograms != NULL){ | |
243 | delete fHistograms; | |
244 | fHistograms=NULL; | |
245 | } | |
246 | if(fHistograms==NULL){ | |
247 | fHistograms=new TList(); | |
248 | fHistograms->SetOwner(kTRUE); | |
249 | if(name=="")fHistograms->SetName(Form("CaloCuts_%s",GetCutNumber().Data())); | |
250 | else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data())); | |
251 | } | |
252 | ||
253 | // IsPhotonSelected | |
254 | fHistCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",5,-0.5,4.5); | |
255 | fHistCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in"); | |
256 | fHistCutIndex->GetXaxis()->SetBinLabel(kDetector+1,"detector"); | |
257 | fHistCutIndex->GetXaxis()->SetBinLabel(kAcceptance+1,"acceptance"); | |
258 | fHistCutIndex->GetXaxis()->SetBinLabel(kClusterQuality+1,"cluster QA"); | |
259 | fHistCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out"); | |
260 | fHistograms->Add(fHistCutIndex); | |
261 | ||
262 | // Acceptance Cuts | |
263 | fHistAcceptanceCuts=new TH1F(Form("AcceptanceCuts %s",GetCutNumber().Data()),"AcceptanceCuts",5,-0.5,4.5); | |
264 | fHistAcceptanceCuts->GetXaxis()->SetBinLabel(1,"in"); | |
265 | fHistAcceptanceCuts->GetXaxis()->SetBinLabel(2,"eta"); | |
266 | fHistAcceptanceCuts->GetXaxis()->SetBinLabel(3,"phi"); | |
267 | fHistAcceptanceCuts->GetXaxis()->SetBinLabel(4,"distance to bad channel"); | |
268 | fHistAcceptanceCuts->GetXaxis()->SetBinLabel(5,"out"); | |
269 | fHistograms->Add(fHistAcceptanceCuts); | |
270 | ||
271 | // Cluster Cuts | |
9df9736d | 272 | fHistClusterIdentificationCuts =new TH1F(Form("ClusterQualityCuts %s",GetCutNumber().Data()),"ClusterQualityCuts",11,-0.5,10.5); |
8bdca7f1 | 273 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(1,"in"); |
274 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(2,"timing"); | |
275 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(3,"track matching"); | |
276 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(4,"Exotics"); | |
277 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(5,"minimum energy"); | |
9df9736d | 278 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(6,"minimum NCells"); |
279 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(7,"M02"); | |
280 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(8,"M20"); | |
281 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(9,"dispersion"); | |
282 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(10,"NLM"); | |
283 | fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(11,"out"); | |
8bdca7f1 | 284 | fHistograms->Add(fHistClusterIdentificationCuts); |
285 | ||
286 | // Acceptance related histogramms | |
287 | fHistClusterEtavsPhiBeforeAcc=new TH2F(Form("EtaPhi_beforeAcceptance %s",GetCutNumber().Data()),"EtaPhi_beforeAcceptance",462,-TMath::Pi(),TMath::Pi(),110,-0.7,0.7); | |
288 | fHistograms->Add(fHistClusterEtavsPhiBeforeAcc); | |
289 | fHistClusterEtavsPhiAfterAcc=new TH2F(Form("EtaPhi_afterAcceptance %s",GetCutNumber().Data()),"EtaPhi_afterAcceptance",462,-TMath::Pi(),TMath::Pi(),110,-0.7,0.7); | |
290 | fHistograms->Add(fHistClusterEtavsPhiAfterAcc); | |
291 | fHistClusterEtavsPhiAfterQA=new TH2F(Form("EtaPhi_afterClusterQA %s",GetCutNumber().Data()),"EtaPhi_afterClusterQA",462,-TMath::Pi(),TMath::Pi(),110,-0.7,0.7); | |
292 | fHistograms->Add(fHistClusterEtavsPhiAfterQA); | |
1a0b989a | 293 | //fHistDistanceToBadChannelBeforeAcc = new TH1F(Form("DistanceToBadChannel_beforeAcceptance %s",GetCutNumber().Data()),"DistanceToBadChannel_beforeAcceptance",200,0,40); |
294 | //fHistograms->Add(fHistDistanceToBadChannelBeforeAcc); | |
295 | //fHistDistanceToBadChannelAfterAcc = new TH1F(Form("DistanceToBadChannel_afterAcceptance %s",GetCutNumber().Data()),"DistanceToBadChannel_afterAcceptance",200,0,40); | |
296 | //fHistograms->Add(fHistDistanceToBadChannelAfterAcc); | |
8bdca7f1 | 297 | |
298 | // Cluster quality related histograms | |
f57c67ac | 299 | Double_t timeMin = -10e-6; |
300 | Double_t timeMax = 10e-6; | |
301 | fHistClusterTimevsEBeforeQA=new TH2F(Form("ClusterTimeVsE_beforeClusterQA %s",GetCutNumber().Data()),"ClusterTimeVsE_beforeClusterQA",400,timeMin,timeMax,100,0.,40); | |
8bdca7f1 | 302 | fHistograms->Add(fHistClusterTimevsEBeforeQA); |
f57c67ac | 303 | fHistClusterTimevsEAfterQA=new TH2F(Form("ClusterTimeVsE_afterClusterQA %s",GetCutNumber().Data()),"ClusterTimeVsE_afterClusterQA",400,timeMin,timeMax,100,0.,40); |
8bdca7f1 | 304 | fHistograms->Add(fHistClusterTimevsEAfterQA); |
1a0b989a | 305 | //fHistExoticCellBeforeQA=new TH2F(Form("ExoticCell_beforeClusterQA %s",GetCutNumber().Data()),"ExoticCell_beforeClusterQA",400,0,40,50,0.75,1); |
306 | //fHistograms->Add(fHistExoticCellBeforeQA); | |
307 | //fHistExoticCellAfterQA=new TH2F(Form("ExoticCell_afterClusterQA %s",GetCutNumber().Data()),"ExoticCell_afterClusterQA",400,0,40,50,0.75,1); | |
308 | //fHistograms->Add(fHistExoticCellAfterQA); | |
309 | //fHistNMatchedTracks = new TH1F(Form("NMatchedTracks_%s",GetCutNumber().Data()),"NMatchedTracks",22,-1.5,20.5); | |
310 | //fHistograms->Add(fHistNMatchedTracks); | |
8bdca7f1 | 311 | fHistEnergyOfClusterBeforeQA = new TH1F(Form("EnergyOfCluster_beforeClusterQA %s",GetCutNumber().Data()),"EnergyOfCluster_beforeClusterQA",300,0,30); |
312 | fHistograms->Add(fHistEnergyOfClusterBeforeQA); | |
313 | fHistEnergyOfClusterAfterQA = new TH1F(Form("EnergyOfCluster_afterClusterQA %s",GetCutNumber().Data()),"EnergyOfCluster_afterClusterQA",300,0,30); | |
314 | fHistograms->Add(fHistEnergyOfClusterAfterQA); | |
315 | fHistNCellsBeforeQA = new TH1F(Form("NCellPerCluster_beforeClusterQA %s",GetCutNumber().Data()),"NCellPerCluster_beforeClusterQA",50,0,50); | |
316 | fHistograms->Add(fHistNCellsBeforeQA); | |
317 | fHistNCellsAfterQA = new TH1F(Form("NCellPerCluster_afterClusterQA %s",GetCutNumber().Data()),"NCellPerCluster_afterClusterQA",50,0,50); | |
318 | fHistograms->Add(fHistNCellsAfterQA); | |
72cfe7c8 | 319 | fHistM02BeforeQA = new TH1F(Form("M02_beforeClusterQA %s",GetCutNumber().Data()),"M02_beforeClusterQA",400,0,5); |
8bdca7f1 | 320 | fHistograms->Add(fHistM02BeforeQA); |
72cfe7c8 | 321 | fHistM02AfterQA = new TH1F(Form("M02_afterClusterQA %s",GetCutNumber().Data()),"M02_afterClusterQA",400,0,5); |
8bdca7f1 | 322 | fHistograms->Add(fHistM02AfterQA); |
72cfe7c8 | 323 | fHistM20BeforeQA = new TH1F(Form("M20_beforeClusterQA %s",GetCutNumber().Data()),"M20_beforeClusterQA",400,0,2.5); |
8bdca7f1 | 324 | fHistograms->Add(fHistM20BeforeQA); |
72cfe7c8 | 325 | fHistM20AfterQA = new TH1F(Form("M20_afterClusterQA %s",GetCutNumber().Data()),"M20_afterClusterQA",400,0,2.5); |
8bdca7f1 | 326 | fHistograms->Add(fHistM20AfterQA); |
327 | fHistDispersionBeforeQA = new TH1F(Form("Dispersion_beforeClusterQA %s",GetCutNumber().Data()),"Dispersion_beforeClusterQA",100,0,4); | |
328 | fHistograms->Add(fHistDispersionBeforeQA); | |
329 | fHistDispersionAfterQA = new TH1F(Form("Dispersion_afterClusterQA %s",GetCutNumber().Data()),"Dispersion_afterClusterQA",100,0,4); | |
330 | fHistograms->Add(fHistDispersionAfterQA); | |
1a0b989a | 331 | //fHistNLMBeforeQA = new TH1F(Form("NLM_beforeClusterQA %s",GetCutNumber().Data()),"NLM_beforeClusterQA",10,0,10); |
332 | //fHistograms->Add(fHistNLMBeforeQA); | |
333 | //fHistNLMAfterQA = new TH1F(Form("NLM_afterClusterQA %s",GetCutNumber().Data()),"NLM_afterClusterQA",10,0,10); | |
334 | //fHistograms->Add(fHistNLMAfterQA); | |
335 | ||
336 | //TrackMatching histograms | |
843ebf3b | 337 | if(fUseDistTrackToCluster) { |
1a0b989a | 338 | fHistClusterRBeforeQA = new TH1F(Form("R_Cluster_beforeClusterQA %s",GetCutNumber().Data()),"R of cluster",200,400,500); |
339 | fHistograms->Add(fHistClusterRBeforeQA); | |
340 | fHistClusterRAfterQA = new TH1F(Form("R_Cluster_afterClusterQA %s",GetCutNumber().Data()),"R of cluster_matched",200,400,500); | |
341 | fHistograms->Add(fHistClusterRAfterQA); | |
843ebf3b | 342 | fHistClusterdEtadPhiPosTracksBeforeQA=new TH2F(Form("dEtaVsdPhi_posTracks_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_posTracks_beforeClusterQA",240,-0.3,0.3,240,-0.3,0.3); |
343 | fHistograms->Add(fHistClusterdEtadPhiPosTracksBeforeQA); | |
344 | fHistClusterdEtadPhiNegTracksBeforeQA=new TH2F(Form("dEtaVsdPhi_negTracks_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_negTracks_beforeClusterQA",240,-0.3,0.3,240,-0.3,0.3); | |
345 | fHistograms->Add(fHistClusterdEtadPhiNegTracksBeforeQA); | |
1a0b989a | 346 | fHistClusterdEtadPhiAfterQA=new TH2F(Form("dEtaVsdPhi_afterClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_afterClusterQA",240,-0.3,0.3,240,-0.3,0.3); |
347 | fHistograms->Add(fHistClusterdEtadPhiAfterQA); | |
348 | fHistDistanceTrackToClusterBeforeQA = new TH1F(Form("DistanceToTrack_beforeClusterQA %s",GetCutNumber().Data()),"DistanceToTrack_beforeClusterQA",200,0,2); | |
349 | fHistograms->Add(fHistDistanceTrackToClusterBeforeQA); | |
350 | fHistDistanceTrackToClusterAfterQA = new TH1F(Form("DistanceToTrack_afterClusterQA %s",GetCutNumber().Data()),"DistanceToTrack_afterClusterQA",200,0,2); | |
351 | fHistograms->Add(fHistDistanceTrackToClusterAfterQA); | |
352 | } | |
8bdca7f1 | 353 | |
354 | TH1::AddDirectory(kTRUE); | |
355 | } | |
356 | ||
d53bf4ac | 357 | |
8bdca7f1 | 358 | ///________________________________________________________________________ |
d53bf4ac | 359 | Bool_t AliCaloPhotonCuts::ClusterIsSelectedMC(TParticle *particle,AliStack *fMCStack){ |
8bdca7f1 | 360 | // MonteCarlo Photon Selection |
361 | ||
d53bf4ac | 362 | if(!fMCStack)return kFALSE; |
363 | ||
364 | if (particle->GetPdgCode() == 22){ | |
365 | ||
366 | if ( particle->Eta() < fMinEtaCut || particle->Eta() > fMaxEtaCut ) return kFALSE; | |
367 | if ( particle->Phi() < fMinPhiCut || particle->Phi() > fMaxPhiCut ) return kFALSE; | |
368 | ||
369 | if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){ | |
370 | return kFALSE; // no photon as mothers! | |
371 | } | |
372 | if(particle->GetMother(0) >= fMCStack->GetNprimary()){ | |
373 | return kFALSE; // the gamma has a mother, and it is not a primary particle | |
374 | } | |
375 | return kTRUE; | |
376 | } | |
377 | return kFALSE; | |
8bdca7f1 | 378 | } |
379 | ///________________________________________________________________________ | |
d53bf4ac | 380 | Bool_t AliCaloPhotonCuts::ClusterIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray){ |
381 | // MonteCarlo Photon Selection | |
382 | ||
383 | if(!aodmcArray)return kFALSE; | |
384 | if (particle->GetPdgCode() == 22){ | |
385 | if ( particle->Eta() < fMinEtaCut || particle->Eta() > fMaxEtaCut ) return kFALSE; | |
386 | if ( particle->Phi() < fMinPhiCut || particle->Phi() > fMaxPhiCut ) return kFALSE; | |
387 | if(particle->GetMother() > -1){ | |
388 | if((static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){ | |
389 | return kFALSE; // no photon as mothers! | |
390 | } | |
391 | if(!(static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother()))->IsPrimary())){ | |
392 | return kFALSE; // the gamma has a mother, and it is not a primary particle | |
393 | } | |
394 | } | |
395 | return kTRUE; // return in case of accepted gamma | |
396 | } | |
397 | return kFALSE; | |
398 | } | |
8bdca7f1 | 399 | |
400 | ||
401 | ||
402 | ///________________________________________________________________________ | |
403 | // This function selects the clusters based on their quality criteria | |
404 | ///________________________________________________________________________ | |
405 | Bool_t AliCaloPhotonCuts::ClusterQualityCuts(AliVCluster* cluster, AliVEvent *event, Bool_t isMC) | |
406 | { // Specific Photon Cuts | |
407 | ||
408 | Int_t cutIndex = 0; | |
409 | if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); | |
410 | cutIndex++; | |
411 | ||
d53bf4ac | 412 | // Double_t minR = 999.0; |
e13e00c9 | 413 | // get the minimum radius of tracks to cluster |
d53bf4ac | 414 | // if(fHistDistanceTrackToClusterBeforeQA || fHistDistanceTrackToClusterAfterQA){ |
fdc1d2db | 415 | // Float_t pos[3]; |
416 | // cluster->GetPosition(pos); // Get cluster position | |
417 | // | |
418 | // TVector3 cp(pos); | |
419 | // int NtrMatched = 0; | |
420 | // NtrMatched = cluster->GetNTracksMatched(); | |
421 | // fHistNMatchedTracks->Fill(NtrMatched); | |
422 | // //loop over tracks for Jet QA | |
423 | // TList *l = event->GetList(); | |
424 | // TClonesArray *tracks = dynamic_cast<TClonesArray*>(l->FindObject("Tracks")); | |
425 | // for(int itrack = 0; itrack < NtrMatched; itrack++){ | |
426 | // AliVTrack *trackcluster = static_cast<AliVTrack*>(tracks->At(itrack)); | |
427 | // if (! trackcluster) { | |
428 | // AliError(Form("Couldn't get ESD track %d\n", itrack)); | |
429 | // continue; | |
430 | // } | |
431 | // Double_t dphi = -999.0; | |
432 | // Double_t deta = -999.0; | |
433 | // AliPicoTrack::GetEtaPhiDiff(trackcluster, cluster, dphi, deta); | |
e13e00c9 | 434 | // cout << "here" << endl; |
fdc1d2db | 435 | // Double_t dr = sqrt(dphi*dphi + deta+deta); |
436 | // if(dr < minR) | |
437 | // minR = dr; | |
438 | // }//loop over tracks | |
d53bf4ac | 439 | // } |
8bdca7f1 | 440 | |
441 | // Fill Histos before Cuts | |
442 | if(fHistClusterTimevsEBeforeQA) fHistClusterTimevsEBeforeQA->Fill(cluster->GetTOF(), cluster->E()); | |
443 | // if(fHistExoticCellBeforeQA) fHistExoticCellBeforeQA->Fill(cluster->E(), ); | |
d53bf4ac | 444 | // if(fHistDistanceTrackToClusterBeforeQA) fHistDistanceTrackToClusterBeforeQA->Fill(minR); |
8bdca7f1 | 445 | if(fHistEnergyOfClusterBeforeQA) fHistEnergyOfClusterBeforeQA->Fill(cluster->E()); |
446 | if(fHistNCellsBeforeQA) fHistNCellsBeforeQA->Fill(cluster->GetNCells()); | |
447 | if(fHistM02BeforeQA) fHistM02BeforeQA->Fill(cluster->GetM02()); | |
448 | if(fHistM20BeforeQA) fHistM20BeforeQA->Fill(cluster->GetM20()); | |
449 | if(fHistDispersionBeforeQA) fHistDispersionBeforeQA->Fill(cluster->GetDispersion()); | |
450 | // if(fHistNLMBeforeQA) fHistNLMBeforeQA->Fill(cluster->GetNExMax()); | |
451 | ||
452 | // Check wether timing is ok | |
9df9736d | 453 | if (fUseTimeDiff){ |
454 | if(abs(cluster->GetTOF()) > fMaxTimeDiff && !isMC){ | |
455 | if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //1 | |
456 | return kFALSE; | |
457 | } | |
458 | } | |
8bdca7f1 | 459 | cutIndex++; //2, next cut |
460 | ||
461 | // Minimum distance to track | |
d53bf4ac | 462 | // if (fUseDistTrackToCluster){ |
463 | // Float_t pos[3]; | |
464 | // cluster->GetPosition(pos); // Get cluster position | |
465 | // TVector3 cp(pos); | |
466 | // int NtrMatched = 0; | |
467 | // NtrMatched = cluster->GetNTracksMatched(); | |
468 | // fHistNMatchedTracks->Fill(NtrMatched); | |
469 | // if(NtrMatched > 0){ | |
470 | // //loop over tracks for QA | |
471 | // TList *l = event->GetList(); | |
472 | // TClonesArray *tracks = dynamic_cast<TClonesArray*>(l->FindObject("Tracks")); | |
473 | // | |
474 | // Double_t dphi = 999.0; | |
475 | // Double_t deta = 999.0; | |
476 | // Double_t dr2 = 999.0; | |
477 | // | |
478 | // for(int itrack = 0; itrack < NtrMatched; itrack++){ | |
479 | // AliVTrack *trackcluster = NULL; | |
480 | // trackcluster = static_cast<AliVTrack*>(tracks->At(itrack)); | |
481 | // if (! trackcluster) { | |
482 | // AliError(Form("Couldn't get ESD track %d\n", itrack)); | |
483 | // continue; | |
484 | // } | |
485 | // AliPicoTrack::GetEtaPhiDiff(trackcluster, cluster, dphi, deta); | |
486 | // dr2 = dphi*dphi + deta+deta; | |
487 | // //cout << dr << endl; | |
488 | // if(dr2 < fMinDistTrackToCluster*fMinDistTrackToCluster){ | |
489 | // // if(dphi < fMinDistTrackToCluster || deta < fMinDistTrackToCluster){ | |
490 | // if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //2 | |
491 | // return kFALSE; | |
492 | // } | |
493 | // | |
494 | // }//loop over tracks | |
495 | // } | |
496 | // // if(cluster->GetEmcCpvDistance() < fMinDistTrackToCluster){ | |
497 | // // if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //2 | |
498 | // // return kFALSE; | |
499 | // // } | |
500 | // } | |
8bdca7f1 | 501 | cutIndex++;//3, next cut |
502 | ||
503 | // exotic cell cut --IMPLEMENT LATER--- | |
504 | // if(!AcceptanceCuts(photon)){ | |
505 | // if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //3 | |
506 | // return kFALSE; | |
507 | // } | |
508 | cutIndex++; //4, next cut | |
509 | ||
510 | // minimum cell energy cut | |
9df9736d | 511 | if (fUseMinEnergy){ |
512 | if(cluster->E() < fMinEnergy){ | |
513 | if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //4 | |
514 | return kFALSE; | |
515 | } | |
516 | } | |
8bdca7f1 | 517 | cutIndex++; //5, next cut |
518 | ||
519 | // minimum number of cells | |
9df9736d | 520 | if (fUseNCells){ |
521 | if(cluster->GetNCells() < fMinNCells) { | |
522 | if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //5 | |
523 | return kFALSE; | |
524 | } | |
525 | } | |
8bdca7f1 | 526 | cutIndex++; //6, next cut |
527 | ||
528 | // M02 cut | |
9df9736d | 529 | if (fUseM02){ |
530 | if( cluster->GetM02()< fMinM02 || cluster->GetM02() > fMaxM02 ) { | |
531 | if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //6 | |
532 | return kFALSE; | |
533 | } | |
534 | } | |
8bdca7f1 | 535 | cutIndex++; //7, next cut |
536 | ||
537 | // M20 cut | |
9df9736d | 538 | if (fUseM20){ |
539 | if( cluster->GetM20()< fMinM20 || cluster->GetM20() > fMaxM20 ) { | |
540 | if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //7 | |
541 | return kFALSE; | |
542 | } | |
543 | } | |
8bdca7f1 | 544 | cutIndex++; //8, next cut |
545 | ||
546 | // dispersion cut | |
9df9736d | 547 | if (fUseDispersion){ |
548 | if( cluster->GetDispersion()> fMaxDispersion) { | |
549 | if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //8 | |
550 | return kFALSE; | |
551 | } | |
552 | } | |
8bdca7f1 | 553 | cutIndex++; //9, next cut |
554 | ||
555 | // NLM cut --IMPLEMENT LATER--- | |
9df9736d | 556 | // if (fUseNLM){ |
557 | // if( cluster->GetDispersion()> fMaxDispersion) { | |
558 | // if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //9 | |
559 | // return kFALSE; | |
560 | // } | |
561 | // } | |
8bdca7f1 | 562 | cutIndex++; //9, next cut |
563 | ||
564 | // DONE with selecting photons | |
565 | if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //10 | |
566 | ||
567 | // Histos after Cuts | |
568 | Double_t vertex[3] = {0}; | |
569 | event->GetPrimaryVertex()->GetXYZ(vertex); | |
570 | // TLorentzvector with cluster | |
571 | TLorentzVector clusterVector; | |
572 | cluster->GetMomentum(clusterVector,vertex); | |
573 | Double_t etaCluster = clusterVector.Eta(); | |
574 | Double_t phiCluster = clusterVector.Phi(); | |
575 | ||
576 | if(fHistClusterEtavsPhiAfterQA) fHistClusterEtavsPhiAfterQA->Fill(phiCluster,etaCluster); | |
577 | if(fHistClusterTimevsEAfterQA) fHistClusterTimevsEAfterQA->Fill(cluster->GetTOF(), cluster->E()); | |
578 | // if(fHistExoticCellAfterQA) fHistExoticCellAfterQA->Fill(cluster->E(), ); | |
d53bf4ac | 579 | // if(fHistDistanceTrackToClusterAfterQA) fHistDistanceTrackToClusterAfterQA->Fill(minR); |
8bdca7f1 | 580 | if(fHistEnergyOfClusterAfterQA) fHistEnergyOfClusterAfterQA->Fill(cluster->E()); |
581 | if(fHistNCellsAfterQA) fHistNCellsAfterQA->Fill(cluster->GetNCells()); | |
582 | if(fHistM02AfterQA) fHistM02AfterQA->Fill(cluster->GetM02()); | |
583 | if(fHistM20AfterQA) fHistM20AfterQA->Fill(cluster->GetM20()); | |
584 | if(fHistDispersionAfterQA) fHistDispersionAfterQA->Fill(cluster->GetDispersion()); | |
585 | // if(fHistNLMBeforeQA) fHistNLMAfterQA->Fill(cluster->GetNExMax()); | |
586 | ||
587 | return kTRUE; | |
588 | ||
589 | } | |
590 | ||
591 | ||
592 | ///________________________________________________________________________ | |
593 | Bool_t AliCaloPhotonCuts::ClusterIsSelected(AliVCluster *cluster, AliVEvent * event, Bool_t isMC) | |
594 | { | |
595 | //Selection of Reconstructed photon clusters with Calorimeters | |
596 | ||
597 | FillClusterCutIndex(kPhotonIn); | |
598 | ||
599 | Double_t vertex[3] = {0}; | |
600 | event->GetPrimaryVertex()->GetXYZ(vertex); | |
601 | // TLorentzvector with cluster | |
602 | TLorentzVector clusterVector; | |
603 | cluster->GetMomentum(clusterVector,vertex); | |
604 | Double_t etaCluster = clusterVector.Eta(); | |
605 | Double_t phiCluster = clusterVector.Phi(); | |
606 | ||
607 | // Histos before cuts | |
608 | if(fHistClusterEtavsPhiBeforeAcc) fHistClusterEtavsPhiBeforeAcc->Fill(phiCluster,etaCluster); | |
609 | ||
610 | // Cluster Selection - 0= accept any calo cluster | |
611 | if (fClusterType > 0){ | |
612 | //Select EMCAL cluster | |
613 | if (fClusterType == 1 && !cluster->IsEMCAL()){ | |
614 | FillClusterCutIndex(kDetector); | |
9df9736d | 615 | return kFALSE; |
8bdca7f1 | 616 | } |
617 | //Select PHOS cluster | |
618 | if (fClusterType == 2 && !cluster->IsPHOS()){ | |
619 | FillClusterCutIndex(kDetector); | |
9df9736d | 620 | return kFALSE; |
8bdca7f1 | 621 | } |
622 | } | |
623 | ||
624 | // Acceptance Cuts | |
625 | if(!AcceptanceCuts(cluster,event)){ | |
626 | FillClusterCutIndex(kAcceptance); | |
627 | return kFALSE; | |
628 | } | |
629 | // Cluster Quality Cuts | |
630 | if(!ClusterQualityCuts(cluster,event,isMC)){ | |
631 | FillClusterCutIndex(kClusterQuality); | |
632 | return kFALSE; | |
633 | } | |
634 | ||
635 | // Photon passed cuts | |
636 | FillClusterCutIndex(kPhotonOut); | |
637 | return kTRUE; | |
638 | } | |
639 | ||
640 | ||
641 | ///________________________________________________________________________ | |
642 | Bool_t AliCaloPhotonCuts::AcceptanceCuts(AliVCluster *cluster, AliVEvent* event) | |
643 | { | |
644 | // Exclude certain areas for photon reconstruction | |
645 | ||
646 | Int_t cutIndex=0; | |
647 | if(fHistAcceptanceCuts)fHistAcceptanceCuts->Fill(cutIndex); | |
648 | cutIndex++; | |
649 | ||
650 | ||
843ebf3b | 651 | Double_t vertex[3] = {0,0,0}; |
652 | // event->GetPrimaryVertex()->GetXYZ(vertex); | |
8bdca7f1 | 653 | // TLorentzvector with cluster |
654 | TLorentzVector clusterVector; | |
655 | cluster->GetMomentum(clusterVector,vertex); | |
656 | Double_t etaCluster = clusterVector.Eta(); | |
657 | Double_t phiCluster = clusterVector.Phi(); | |
658 | ||
659 | // check eta range | |
9df9736d | 660 | if (fUseEtaCut){ |
8bdca7f1 | 661 | if (etaCluster < fMinEtaCut || etaCluster > fMaxEtaCut){ |
662 | if(fHistAcceptanceCuts)fHistAcceptanceCuts->Fill(cutIndex); | |
663 | return kFALSE; | |
664 | } | |
9df9736d | 665 | } |
8bdca7f1 | 666 | cutIndex++; |
667 | ||
668 | // check phi range | |
9df9736d | 669 | if (fUsePhiCut ){ |
8bdca7f1 | 670 | if (phiCluster < fMinPhiCut || phiCluster > fMaxEtaCut){ |
671 | if(fHistAcceptanceCuts)fHistAcceptanceCuts->Fill(cutIndex); | |
672 | return kFALSE; | |
673 | } | |
674 | } | |
675 | cutIndex++; | |
676 | ||
677 | // check distance to bad channel | |
9df9736d | 678 | if (fUseDistanceToBadChannel){ |
679 | if (cluster->GetDistanceToBadChannel() < fMinDistanceToBadChannel){ | |
680 | if(fHistAcceptanceCuts)fHistAcceptanceCuts->Fill(cutIndex); | |
681 | return kFALSE; | |
682 | } | |
683 | } | |
684 | cutIndex++; | |
8bdca7f1 | 685 | if(fHistAcceptanceCuts)fHistAcceptanceCuts->Fill(cutIndex); |
686 | ||
687 | // Histos after cuts | |
688 | if(fHistClusterEtavsPhiAfterAcc) fHistClusterEtavsPhiAfterAcc->Fill(phiCluster,etaCluster); | |
689 | ||
690 | return kTRUE; | |
691 | } | |
692 | ||
d53bf4ac | 693 | Bool_t AliCaloPhotonCuts::MatchConvPhotonToCluster(AliAODConversionPhoton* convPhoton, AliVCluster* cluster, AliVEvent* event ){ |
694 | ||
695 | if (!fUseDistTrackToCluster) return kFALSE; | |
696 | ||
697 | AliESDEvent *esdev = dynamic_cast<AliESDEvent*>(event); | |
698 | AliAODEvent *aodev = 0; | |
699 | if (!esdev) { | |
700 | aodev = dynamic_cast<AliAODEvent*>(event); | |
701 | if (!aodev) { | |
702 | AliError("Task needs AOD or ESD event, returning"); | |
703 | return kFALSE; | |
704 | } | |
705 | } | |
706 | ||
925a074a | 707 | Double_t vertex[3] = {0,0,0}; |
d53bf4ac | 708 | event->GetPrimaryVertex()->GetXYZ(vertex); |
925a074a | 709 | |
710 | if(!cluster->IsEMCAL() && !cluster->IsPHOS()){AliError("Cluster is neither EMCAL nor PHOS, returning"); return kFALSE;} | |
d53bf4ac | 711 | |
925a074a | 712 | Float_t clusterPosition[3] = {0,0,0}; |
713 | cluster->GetPosition(clusterPosition); | |
714 | Double_t clusterR = TMath::Sqrt( clusterPosition[0]*clusterPosition[0] + clusterPosition[1]*clusterPosition[1] ); | |
715 | if(fHistClusterRBeforeQA) fHistClusterRBeforeQA->Fill(clusterR); | |
716 | ||
717 | //cout << "+++++++++ Cluster: x, y, z, R" << clusterPosition[0] << ", " << clusterPosition[1] << ", " << clusterPosition[2] << ", " << clusterR << "+++++++++" << endl; | |
718 | ||
d53bf4ac | 719 | Bool_t matched = kFALSE; |
720 | for (Int_t i = 0; i < 2; i++){ | |
721 | Int_t tracklabel = convPhoton->GetLabel(i); | |
722 | AliVTrack *inTrack = 0x0; | |
723 | if(esdev) { | |
724 | if(tracklabel > event->GetNumberOfTracks() ) continue; | |
725 | inTrack = esdev->GetTrack(tracklabel); | |
726 | } else { | |
727 | if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->AreAODsRelabeled()){ | |
728 | inTrack = dynamic_cast<AliVTrack*>(event->GetTrack(tracklabel)); | |
729 | } else { | |
730 | for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) { | |
731 | inTrack = dynamic_cast<AliVTrack*>(event->GetTrack(ii)); | |
732 | if(inTrack){ | |
733 | if(inTrack->GetID() == tracklabel) { | |
734 | continue; | |
735 | } | |
736 | } | |
737 | } | |
738 | } | |
739 | } | |
d404157c | 740 | // if( inTrack->Pt() < 0.005 ) continue; |
2c75809c | 741 | |
742 | AliESDtrack *esdt = dynamic_cast<AliESDtrack*>(inTrack); | |
743 | AliAODTrack *aodt = 0; | |
744 | if (!esdt) { | |
745 | aodt = dynamic_cast<AliAODTrack*>(inTrack); | |
746 | if (!aodt){AliError("Track is neither ESD nor AOD, continue"); continue;} | |
747 | } | |
748 | ||
749 | AliExternalTrackParam *trackParam = 0; | |
750 | if (esdt) { | |
751 | const AliExternalTrackParam *in = esdt->GetInnerParam(); | |
752 | if (!in){AliError("Could not get InnerParam of Track, continue"); continue;} | |
753 | trackParam = new AliExternalTrackParam(*in); | |
754 | } else { | |
755 | Double_t xyz[3] = {0}, pxpypz[3] = {0}, cv[21] = {0}; | |
756 | aodt->PxPyPz(pxpypz); | |
757 | aodt->XvYvZv(xyz); | |
758 | aodt->GetCovarianceXYZPxPyPz(cv); | |
759 | trackParam = new AliExternalTrackParam(xyz,pxpypz,cv,aodt->Charge()); | |
760 | } | |
d404157c | 761 | if (!trackParam){AliError("Could not get TrackParameters, continue"); continue;} |
762 | ||
2c75809c | 763 | Bool_t propagated = kFALSE; |
764 | AliExternalTrackParam emcParam(*trackParam); | |
765 | Float_t dPhi = 0; | |
766 | Float_t dEta = 0; | |
767 | ||
768 | if(cluster->IsEMCAL()){ | |
769 | Float_t eta = 0; Float_t phi = 0; Float_t pt = 0; | |
770 | propagated = AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&emcParam, 430, 0.000510999, 20, eta, phi, pt); | |
771 | if(propagated){ | |
772 | propagated = AliEMCALRecoUtils::ExtrapolateTrackToCluster(&emcParam, cluster, 0.000510999, 5, dEta, dPhi); | |
773 | } | |
774 | } | |
775 | if(cluster->IsPHOS()){ | |
776 | propagated = AliTrackerBase::PropagateTrackToBxByBz(&emcParam, clusterR, 0.000510999, 20, kTRUE, 0.8, -1); | |
777 | if (propagated){ | |
778 | Double_t trkPos[3] = {0,0,0}; | |
779 | emcParam.GetXYZ(trkPos); | |
780 | TVector3 trkPosVec(trkPos[0],trkPos[1],trkPos[2]); | |
781 | TVector3 clsPosVec(clusterPosition); | |
782 | dPhi = clsPosVec.DeltaPhi(trkPosVec); | |
783 | dEta = clsPosVec.Eta()-trkPosVec.Eta(); | |
784 | } | |
785 | } | |
786 | ||
787 | if (propagated){ | |
788 | Float_t dR2 = dPhi*dPhi + dEta*dEta; | |
789 | if (fHistDistanceTrackToClusterBeforeQA)fHistDistanceTrackToClusterBeforeQA->Fill(TMath::Sqrt(dR2)); | |
843ebf3b | 790 | if (fHistClusterdEtadPhiPosTracksBeforeQA && inTrack->Charge()< 0) fHistClusterdEtadPhiPosTracksBeforeQA->Fill(dEta, dPhi); |
791 | if (fHistClusterdEtadPhiNegTracksBeforeQA && inTrack->Charge()> 0) fHistClusterdEtadPhiNegTracksBeforeQA->Fill(dEta, dPhi); | |
2c75809c | 792 | if(dR2 < fMinDistTrackToCluster*fMinDistTrackToCluster){ |
793 | matched = kTRUE; | |
f57c67ac | 794 | } else { |
2c75809c | 795 | if (fHistDistanceTrackToClusterAfterQA)fHistDistanceTrackToClusterAfterQA->Fill(TMath::Sqrt(dR2)); |
796 | if (fHistClusterdEtadPhiAfterQA) fHistClusterdEtadPhiAfterQA->Fill(dEta, dPhi); | |
f57c67ac | 797 | if (fHistClusterRAfterQA) fHistClusterRAfterQA->Fill(clusterR); |
798 | } | |
2c75809c | 799 | } |
800 | delete trackParam; | |
801 | } | |
d53bf4ac | 802 | |
d53bf4ac | 803 | return matched; |
2c75809c | 804 | |
d53bf4ac | 805 | } |
806 | ||
807 | //____________________________________________________________________________________________ | |
808 | ||
809 | ||
8bdca7f1 | 810 | ///________________________________________________________________________ |
811 | Bool_t AliCaloPhotonCuts::UpdateCutString() { | |
812 | ///Update the cut string (if it has been created yet) | |
813 | ||
814 | if(fCutString && fCutString->GetString().Length() == kNCuts) { | |
815 | fCutString->SetString(GetCutNumber()); | |
816 | } else { | |
817 | return kFALSE; | |
818 | } | |
819 | return kTRUE; | |
820 | } | |
821 | ||
822 | ///________________________________________________________________________ | |
823 | Bool_t AliCaloPhotonCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) { | |
824 | // Initialize Cuts from a given Cut string | |
825 | AliInfo(Form("Set CaloCut Number: %s",analysisCutSelection.Data())); | |
826 | if(analysisCutSelection.Length()!=kNCuts) { | |
827 | AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts)); | |
828 | return kFALSE; | |
829 | } | |
830 | if(!analysisCutSelection.IsDigit()){ | |
831 | AliError("Cut selection contains characters"); | |
832 | return kFALSE; | |
833 | } | |
834 | ||
835 | const char *cutSelection = analysisCutSelection.Data(); | |
836 | #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0' | |
837 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
838 | ASSIGNARRAY(ii); | |
839 | } | |
840 | ||
841 | // Set Individual Cuts | |
842 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
843 | if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE; | |
844 | } | |
845 | PrintCutsWithValues(); | |
846 | return kTRUE; | |
847 | } | |
848 | ||
849 | ///________________________________________________________________________ | |
850 | Bool_t AliCaloPhotonCuts::SetCut(cutIds cutID, const Int_t value) { | |
851 | ///Set individual cut ID | |
852 | ||
853 | switch (cutID) { | |
854 | ||
855 | case kClusterType: | |
856 | if( SetClusterTypeCut(value)) { | |
857 | fCuts[kClusterType] = value; | |
858 | UpdateCutString(); | |
859 | return kTRUE; | |
860 | } else return kFALSE; | |
861 | ||
862 | case kEtaMin: | |
863 | if( SetMinEtaCut(value)) { | |
864 | fCuts[kEtaMin] = value; | |
865 | UpdateCutString(); | |
866 | return kTRUE; | |
867 | } else return kFALSE; | |
868 | ||
869 | case kEtaMax: | |
870 | if( SetMaxEtaCut(value)) { | |
871 | fCuts[kEtaMax] = value; | |
872 | UpdateCutString(); | |
873 | return kTRUE; | |
874 | } else return kFALSE; | |
875 | ||
876 | case kPhiMin: | |
877 | if( SetMinPhiCut(value)) { | |
878 | fCuts[kPhiMin] = value; | |
879 | UpdateCutString(); | |
880 | return kTRUE; | |
881 | } else return kFALSE; | |
882 | ||
883 | case kPhiMax: | |
884 | if( SetMaxPhiCut(value)) { | |
885 | fCuts[kPhiMax] = value; | |
886 | UpdateCutString(); | |
887 | return kTRUE; | |
888 | } else return kFALSE; | |
889 | ||
890 | case kDistanceToBadChannel: | |
891 | if( SetDistanceToBadChannelCut(value)) { | |
892 | fCuts[kDistanceToBadChannel] = value; | |
893 | UpdateCutString(); | |
894 | return kTRUE; | |
895 | } else return kFALSE; | |
896 | ||
897 | case kTiming: | |
898 | if( SetTimingCut(value)) { | |
899 | fCuts[kTiming] = value; | |
900 | UpdateCutString(); | |
901 | return kTRUE; | |
902 | } else return kFALSE; | |
903 | ||
904 | case kTrackMatching: | |
905 | if( SetTrackMatchingCut(value)) { | |
906 | fCuts[kTrackMatching] = value; | |
907 | UpdateCutString(); | |
908 | return kTRUE; | |
909 | } else return kFALSE; | |
910 | ||
911 | case kExoticCell: | |
912 | if( SetExoticCellCut(value)) { | |
913 | fCuts[kExoticCell] = value; | |
914 | UpdateCutString(); | |
915 | return kTRUE; | |
916 | } else return kFALSE; | |
917 | ||
918 | case kMinEnery: | |
919 | if( SetMinEnergyCut(value)) { | |
920 | fCuts[kMinEnery] = value; | |
921 | UpdateCutString(); | |
922 | return kTRUE; | |
923 | } else return kFALSE; | |
924 | ||
925 | case kNMinCells: | |
926 | if( SetMinNCellsCut(value)) { | |
927 | fCuts[kNMinCells] = value; | |
928 | UpdateCutString(); | |
929 | return kTRUE; | |
930 | } else return kFALSE; | |
931 | ||
932 | case kMinM02: | |
933 | if( SetMinM02(value)) { | |
934 | fCuts[kMinM02] = value; | |
935 | UpdateCutString(); | |
936 | return kTRUE; | |
937 | } else return kFALSE; | |
938 | ||
939 | case kMaxM02: | |
940 | if( SetMaxM02(value)) { | |
941 | fCuts[kMaxM02] = value; | |
942 | UpdateCutString(); | |
943 | return kTRUE; | |
944 | } else return kFALSE; | |
945 | ||
946 | case kMinM20: | |
947 | if( SetMinM20(value)) { | |
948 | fCuts[kMinM20] = value; | |
949 | UpdateCutString(); | |
950 | return kTRUE; | |
951 | } else return kFALSE; | |
952 | ||
953 | case kMaxM20: | |
954 | if( SetMaxM20(value)) { | |
955 | fCuts[kMaxM20] = value; | |
956 | UpdateCutString(); | |
957 | return kTRUE; | |
958 | } else return kFALSE; | |
959 | ||
960 | case kDispersion: | |
961 | if( SetDispersion(value)) { | |
962 | fCuts[kDispersion] = value; | |
963 | UpdateCutString(); | |
964 | return kTRUE; | |
965 | } else return kFALSE; | |
966 | ||
967 | case kNLM: | |
968 | if( SetNLM(value)) { | |
969 | fCuts[kNLM] = value; | |
970 | UpdateCutString(); | |
971 | return kTRUE; | |
972 | } else return kFALSE; | |
973 | ||
974 | case kNCuts: | |
975 | AliError("Cut id out of range"); | |
976 | return kFALSE; | |
977 | } | |
978 | ||
979 | AliError("Cut id %d not recognized"); | |
980 | return kFALSE; | |
981 | ||
982 | ||
983 | } | |
984 | ///________________________________________________________________________ | |
985 | void AliCaloPhotonCuts::PrintCuts() { | |
986 | // Print out current Cut Selection | |
987 | for(Int_t ic = 0; ic < kNCuts; ic++) { | |
988 | printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]); | |
989 | } | |
990 | } | |
991 | ||
992 | void AliCaloPhotonCuts::PrintCutsWithValues() { | |
993 | // Print out current Cut Selection with value | |
135c1186 | 994 | printf("\nCluster cutnumber \n"); |
995 | for(Int_t ic = 0; ic < kNCuts; ic++) { | |
996 | printf("%d",fCuts[ic]); | |
997 | } | |
998 | printf("\n\n"); | |
999 | ||
8bdca7f1 | 1000 | printf("Acceptance cuts: \n"); |
9df9736d | 1001 | if (fClusterType == 0) printf("\tall calorimeter clusters are used\n"); |
1002 | if (fClusterType == 1) printf("\tEMCAL calorimeter clusters are used\n"); | |
1003 | if (fClusterType == 2) printf("\tPHOS calorimeter clusters are used\n"); | |
1004 | if (fUseEtaCut) printf("\t%3.2f < eta_{cluster} < %3.2f\n", fMinEtaCut, fMaxEtaCut ); | |
1005 | if (fUsePhiCut) printf("\t%3.2f < phi_{cluster} < %3.2f\n", fMinPhiCut, fMaxPhiCut ); | |
1006 | if (fUseDistanceToBadChannel) printf("\tcut on exotics applied \n"); | |
8bdca7f1 | 1007 | |
1008 | printf("Cluster Quality cuts: \n"); | |
9df9736d | 1009 | if (fUseTimeDiff) printf("\t time difference < %3.2f\n", fMaxTimeDiff ); |
1010 | if (fUseDistTrackToCluster) printf("\tmin distance to track > %3.2f\n", fMinDistTrackToCluster ); | |
1011 | if (fUseExoticCell)printf("\t min distance to track > %3.2f\n", fMinDistTrackToCluster ); | |
1012 | if (fUseMinEnergy)printf("\t E_{cluster} > %3.2f\n", fMinEnergy ); | |
72cfe7c8 | 1013 | if (fUseNCells) printf("\t number of cells per cluster >= %d\n", fMinNCells ); |
9df9736d | 1014 | if (fUseM02) printf("\t %3.2f < M02 < %3.2f\n", fMinM02, fMaxM02 ); |
1015 | if (fUseM20) printf("\t %3.2f < M20 < %3.2f\n", fMinM20, fMaxM20 ); | |
1016 | if (fUseDispersion) printf("\t dispersion < %3.2f\n", fMaxDispersion ); | |
1017 | if (fUseNLM) printf("\t %d < NLM < %d\n", fMinNLM, fMaxNLM ); | |
8bdca7f1 | 1018 | |
1019 | } | |
1020 | ||
1021 | // EMCAL acceptance 2011 | |
1022 | // 1.39626, 3.125 (phi) | |
1023 | // -0.66687,,0.66465 | |
1024 | ||
1025 | ||
1026 | ///________________________________________________________________________ | |
1027 | Bool_t AliCaloPhotonCuts::SetClusterTypeCut(Int_t clusterType) | |
1028 | { // Set Cut | |
1029 | switch(clusterType){ | |
1030 | case 0: // all clusters | |
1031 | fClusterType=0; | |
1032 | break; | |
1033 | case 1: // EMCAL clusters | |
1034 | fClusterType=1; | |
1035 | break; | |
1036 | case 2: // PHOS clusters | |
1037 | fClusterType=2; | |
1038 | break; | |
1039 | default: | |
1040 | AliError(Form("ClusterTypeCut not defined %d",clusterType)); | |
1041 | return kFALSE; | |
1042 | } | |
1043 | return kTRUE; | |
1044 | } | |
1045 | ||
1046 | //___________________________________________________________________ | |
1047 | Bool_t AliCaloPhotonCuts::SetMinEtaCut(Int_t minEta) | |
1048 | { | |
1049 | switch(minEta){ | |
9df9736d | 1050 | case 0: |
1051 | if (!fUseEtaCut) fUseEtaCut=0; | |
1052 | fMinEtaCut=-10.; | |
1053 | break; | |
1054 | case 1: | |
1055 | if (!fUseEtaCut) fUseEtaCut=1; | |
8bdca7f1 | 1056 | fMinEtaCut=-0.6687; |
1057 | break; | |
9df9736d | 1058 | case 2: |
1059 | if (!fUseEtaCut) fUseEtaCut=1; | |
344100c4 | 1060 | fMinEtaCut=-0.5; |
8bdca7f1 | 1061 | break; |
9df9736d | 1062 | case 3: |
1063 | if (!fUseEtaCut) fUseEtaCut=1; | |
344100c4 | 1064 | fMinEtaCut=-2; |
8bdca7f1 | 1065 | break; |
1066 | default: | |
1067 | AliError(Form("MinEta Cut not defined %d",minEta)); | |
1068 | return kFALSE; | |
1069 | } | |
1070 | return kTRUE; | |
1071 | } | |
1072 | ||
1073 | ||
1074 | //___________________________________________________________________ | |
1075 | Bool_t AliCaloPhotonCuts::SetMaxEtaCut(Int_t maxEta) | |
1076 | { | |
1077 | switch(maxEta){ | |
1078 | case 0: | |
9df9736d | 1079 | if (!fUseEtaCut) fUseEtaCut=0; |
1080 | fMaxEtaCut=10; | |
1081 | break; | |
1082 | case 1: | |
1083 | if (!fUseEtaCut) fUseEtaCut=1; | |
8bdca7f1 | 1084 | fMaxEtaCut=0.66465; |
1085 | break; | |
9df9736d | 1086 | case 2: |
1087 | if (!fUseEtaCut) fUseEtaCut=1; | |
8bdca7f1 | 1088 | fMaxEtaCut=0.5; |
1089 | break; | |
9df9736d | 1090 | case 3: |
1091 | if (!fUseEtaCut) fUseEtaCut=1; | |
8bdca7f1 | 1092 | fMaxEtaCut=2; |
1093 | break; | |
1094 | default: | |
1095 | AliError(Form("MaxEta Cut not defined %d",maxEta)); | |
1096 | return kFALSE; | |
1097 | } | |
1098 | return kTRUE; | |
1099 | } | |
1100 | ||
1101 | //___________________________________________________________________ | |
1102 | Bool_t AliCaloPhotonCuts::SetMinPhiCut(Int_t minPhi) | |
1103 | { | |
1104 | switch(minPhi){ | |
1105 | case 0: | |
9df9736d | 1106 | if (!fUsePhiCut) fUsePhiCut=0; |
8bdca7f1 | 1107 | fMinPhiCut=-10000; |
1108 | break; | |
1109 | case 1: | |
9df9736d | 1110 | if (!fUsePhiCut) fUsePhiCut=1; |
8bdca7f1 | 1111 | fMinPhiCut=1.39626; |
1112 | break; | |
1113 | default: | |
1114 | AliError(Form("MinPhi Cut not defined %d",minPhi)); | |
1115 | return kFALSE; | |
1116 | } | |
1117 | return kTRUE; | |
1118 | } | |
1119 | ||
1120 | //___________________________________________________________________ | |
1121 | Bool_t AliCaloPhotonCuts::SetMaxPhiCut(Int_t maxPhi) | |
1122 | { | |
1123 | switch(maxPhi){ | |
1124 | case 0: | |
9df9736d | 1125 | if (!fUsePhiCut) fUsePhiCut=0; |
fd94f234 | 1126 | fMaxPhiCut=10000; |
8bdca7f1 | 1127 | break; |
1128 | case 1: | |
9df9736d | 1129 | if (!fUsePhiCut) fUsePhiCut=1; |
8bdca7f1 | 1130 | fMaxPhiCut=3.125; |
1131 | break; | |
1132 | default: | |
1133 | AliError(Form("Max Phi Cut not defined %d",maxPhi)); | |
1134 | return kFALSE; | |
1135 | } | |
1136 | return kTRUE; | |
1137 | } | |
1138 | ||
1139 | //___________________________________________________________________ | |
1140 | Bool_t AliCaloPhotonCuts::SetDistanceToBadChannelCut(Int_t distanceToBadChannel) | |
1141 | { | |
1142 | switch(distanceToBadChannel){ | |
1143 | case 0: | |
9df9736d | 1144 | fUseDistanceToBadChannel=0; |
8bdca7f1 | 1145 | fMinDistanceToBadChannel=0; |
1146 | break; | |
1147 | case 1: | |
9df9736d | 1148 | if (!fUseDistanceToBadChannel) fUseDistanceToBadChannel=1; |
8bdca7f1 | 1149 | fMinDistanceToBadChannel=5; |
1150 | break; | |
1151 | default: | |
1152 | AliError(Form("minimum distance to bad channel Cut not defined %d",distanceToBadChannel)); | |
1153 | return kFALSE; | |
1154 | } | |
1155 | return kTRUE; | |
1156 | } | |
1157 | ||
1158 | //___________________________________________________________________ | |
1159 | Bool_t AliCaloPhotonCuts::SetTimingCut(Int_t timing) | |
1160 | { | |
1161 | switch(timing){ | |
1162 | case 0: | |
9df9736d | 1163 | fUseTimeDiff=0; |
8bdca7f1 | 1164 | fMaxTimeDiff=500; |
1165 | break; | |
1166 | case 1: | |
9df9736d | 1167 | if (!fUseTimeDiff) fUseTimeDiff=1; |
8bdca7f1 | 1168 | fMaxTimeDiff=10e-7; //1000ns |
1169 | break; | |
1170 | case 2: | |
9df9736d | 1171 | if (!fUseTimeDiff) fUseTimeDiff=1; |
8bdca7f1 | 1172 | fMaxTimeDiff=50e-8; //500ns |
1173 | break; | |
1174 | case 3: | |
9df9736d | 1175 | if (!fUseTimeDiff) fUseTimeDiff=1; |
8bdca7f1 | 1176 | fMaxTimeDiff=20e-8; //200ns |
1177 | break; | |
1178 | case 4: | |
9df9736d | 1179 | if (!fUseTimeDiff) fUseTimeDiff=1; |
8bdca7f1 | 1180 | fMaxTimeDiff=10e-8; //100ns |
1181 | break; | |
1182 | case 5: | |
9df9736d | 1183 | if (!fUseTimeDiff) fUseTimeDiff=1; |
8bdca7f1 | 1184 | fMaxTimeDiff=50e-9; //50ns |
1185 | break; | |
1186 | ||
1187 | default: | |
1188 | AliError(Form("Timing Cut not defined %d",timing)); | |
1189 | return kFALSE; | |
1190 | } | |
1191 | return kTRUE; | |
1192 | } | |
1193 | ||
1194 | //___________________________________________________________________ | |
1195 | Bool_t AliCaloPhotonCuts::SetTrackMatchingCut(Int_t trackMatching) | |
1196 | { | |
1197 | switch(trackMatching){ | |
1198 | case 0: | |
9df9736d | 1199 | fUseDistTrackToCluster=0; |
8bdca7f1 | 1200 | fMinDistTrackToCluster=0; |
1201 | break; | |
1202 | case 1: | |
9df9736d | 1203 | if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1; |
2c75809c | 1204 | fMinDistTrackToCluster= 0.03; //0.04; |
d53bf4ac | 1205 | break; |
1206 | case 2: | |
1207 | if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1; | |
2c75809c | 1208 | fMinDistTrackToCluster= 0.035; //0.05; |
8bdca7f1 | 1209 | break; |
d53bf4ac | 1210 | case 3: |
1211 | if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1; | |
2c75809c | 1212 | fMinDistTrackToCluster= 0.04; //0.1; |
d53bf4ac | 1213 | break; |
1214 | case 4: | |
1215 | if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1; | |
2c75809c | 1216 | fMinDistTrackToCluster= 0.045; //0.13; |
d53bf4ac | 1217 | break; |
1218 | case 5: | |
1219 | if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1; | |
2c75809c | 1220 | fMinDistTrackToCluster= 0.05; //0.15 |
d53bf4ac | 1221 | break; |
1222 | case 6: | |
1223 | if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1; | |
2c75809c | 1224 | fMinDistTrackToCluster= 0.055; //0.2; |
d53bf4ac | 1225 | break; |
1226 | case 7: | |
1227 | if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1; | |
2c75809c | 1228 | fMinDistTrackToCluster= 0.06; //0.3; |
d53bf4ac | 1229 | break; |
1230 | case 8: | |
1231 | if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1; | |
2c75809c | 1232 | fMinDistTrackToCluster= 0.07; //0.4; |
d53bf4ac | 1233 | break; |
1234 | case 9: | |
1235 | if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1; | |
2c75809c | 1236 | fMinDistTrackToCluster= 0.1; //0.5; |
d53bf4ac | 1237 | break; |
1238 | ||
8bdca7f1 | 1239 | default: |
1240 | AliError(Form("Track Matching Cut not defined %d",trackMatching)); | |
1241 | return kFALSE; | |
1242 | } | |
1243 | return kTRUE; | |
1244 | } | |
1245 | ||
1246 | //___________________________________________________________________ | |
1247 | Bool_t AliCaloPhotonCuts::SetExoticCellCut(Int_t exoticCell) | |
1248 | { | |
1249 | switch(exoticCell){ | |
1250 | case 0: | |
9df9736d | 1251 | fUseExoticCell=0; |
8bdca7f1 | 1252 | fExoticCell=0; |
1253 | break; | |
1254 | case 1: | |
9df9736d | 1255 | if (!fUseExoticCell) fUseExoticCell=1; |
8bdca7f1 | 1256 | fExoticCell=5; |
1257 | break; | |
1258 | default: | |
1259 | AliError(Form("Exotic cell Cut not defined %d",exoticCell)); | |
1260 | return kFALSE; | |
1261 | } | |
1262 | return kTRUE; | |
1263 | } | |
1264 | ||
1265 | //___________________________________________________________________ | |
1266 | Bool_t AliCaloPhotonCuts::SetMinEnergyCut(Int_t minEnergy) | |
1267 | { | |
1268 | switch(minEnergy){ | |
1269 | case 0: | |
9df9736d | 1270 | if (!fUseMinEnergy) fUseMinEnergy=0; |
8bdca7f1 | 1271 | fMinEnergy=0; |
1272 | break; | |
1273 | case 1: | |
9df9736d | 1274 | if (!fUseMinEnergy) fUseMinEnergy=1; |
8bdca7f1 | 1275 | fMinEnergy=0.05; |
1276 | break; | |
1277 | case 2: | |
9df9736d | 1278 | if (!fUseMinEnergy) fUseMinEnergy=1; |
8bdca7f1 | 1279 | fMinEnergy=0.1; |
1280 | break; | |
1281 | case 3: | |
9df9736d | 1282 | if (!fUseMinEnergy) fUseMinEnergy=1; |
8bdca7f1 | 1283 | fMinEnergy=0.15; |
1284 | break; | |
1285 | case 4: | |
9df9736d | 1286 | if (!fUseMinEnergy) fUseMinEnergy=1; |
8bdca7f1 | 1287 | fMinEnergy=0.2; |
1288 | break; | |
1289 | case 5: | |
9df9736d | 1290 | if (!fUseMinEnergy) fUseMinEnergy=1; |
8bdca7f1 | 1291 | fMinEnergy=0.3; |
1292 | break; | |
1293 | case 6: | |
9df9736d | 1294 | if (!fUseMinEnergy) fUseMinEnergy=1; |
72cfe7c8 | 1295 | fMinEnergy=0.4; |
8bdca7f1 | 1296 | break; |
1297 | case 7: | |
9df9736d | 1298 | if (!fUseMinEnergy) fUseMinEnergy=1; |
72cfe7c8 | 1299 | fMinEnergy=0.5; |
8bdca7f1 | 1300 | break; |
1301 | case 8: | |
9df9736d | 1302 | if (!fUseMinEnergy) fUseMinEnergy=1; |
72cfe7c8 | 1303 | fMinEnergy=0.75; |
8bdca7f1 | 1304 | break; |
1305 | case 9: | |
9df9736d | 1306 | if (!fUseMinEnergy) fUseMinEnergy=1; |
72cfe7c8 | 1307 | fMinEnergy=1.; |
8bdca7f1 | 1308 | break; |
1309 | default: | |
1310 | AliError(Form("Minimum Energy Cut not defined %d",minEnergy)); | |
1311 | return kFALSE; | |
1312 | } | |
1313 | return kTRUE; | |
1314 | } | |
1315 | ||
1316 | //___________________________________________________________________ | |
1317 | Bool_t AliCaloPhotonCuts::SetMinNCellsCut(Int_t minNCells) | |
1318 | { | |
1319 | switch(minNCells){ | |
9df9736d | 1320 | case 0: |
1321 | if (!fUseNCells) fUseNCells=0; | |
8bdca7f1 | 1322 | fMinNCells=0; |
1323 | break; | |
1324 | case 1: | |
9df9736d | 1325 | if (!fUseNCells) fUseNCells=1; |
8bdca7f1 | 1326 | fMinNCells=1; |
1327 | break; | |
1328 | case 2: | |
9df9736d | 1329 | if (!fUseNCells) fUseNCells=1; |
8bdca7f1 | 1330 | fMinNCells=2; |
1331 | break; | |
1332 | case 3: | |
9df9736d | 1333 | if (!fUseNCells) fUseNCells=1; |
8bdca7f1 | 1334 | fMinNCells=3; |
1335 | break; | |
1336 | case 4: | |
9df9736d | 1337 | if (!fUseNCells) fUseNCells=1; |
8bdca7f1 | 1338 | fMinNCells=4; |
1339 | break; | |
1340 | case 5: | |
9df9736d | 1341 | if (!fUseNCells) fUseNCells=1; |
8bdca7f1 | 1342 | fMinNCells=5; |
1343 | break; | |
1344 | case 6: | |
9df9736d | 1345 | if (!fUseNCells) fUseNCells=1; |
8bdca7f1 | 1346 | fMinNCells=6; |
1347 | break; | |
1348 | ||
1349 | default: | |
1350 | AliError(Form("Min N cells Cut not defined %d",minNCells)); | |
1351 | return kFALSE; | |
1352 | } | |
1353 | return kTRUE; | |
1354 | } | |
1355 | ||
1356 | //___________________________________________________________________ | |
1357 | Bool_t AliCaloPhotonCuts::SetMaxM02(Int_t maxM02) | |
1358 | { | |
1359 | switch(maxM02){ | |
1360 | case 0: | |
9df9736d | 1361 | if (!fUseM02) fUseM02=0; |
8bdca7f1 | 1362 | fMaxM02=100; |
1363 | break; | |
1364 | case 1: | |
9df9736d | 1365 | if (!fUseM02) fUseM02=1; |
8bdca7f1 | 1366 | fMaxM02=1.; |
1367 | break; | |
1368 | case 2: | |
9df9736d | 1369 | if (!fUseM02) fUseM02=1; |
8bdca7f1 | 1370 | fMaxM02=0.7; |
1371 | break; | |
1372 | case 3: | |
9df9736d | 1373 | if (!fUseM02) fUseM02=1; |
8bdca7f1 | 1374 | fMaxM02=0.5; |
1375 | break; | |
1376 | case 4: | |
9df9736d | 1377 | if (!fUseM02) fUseM02=1; |
8bdca7f1 | 1378 | fMaxM02=0.4; |
1379 | break; | |
8bdca7f1 | 1380 | default: |
1381 | AliError(Form("Max M02 Cut not defined %d",maxM02)); | |
1382 | return kFALSE; | |
1383 | } | |
1384 | return kTRUE; | |
1385 | } | |
1386 | ||
1387 | //___________________________________________________________________ | |
1388 | Bool_t AliCaloPhotonCuts::SetMinM02(Int_t minM02) | |
1389 | { | |
1390 | switch(minM02){ | |
1391 | case 0: | |
9df9736d | 1392 | if (!fUseM02) fUseM02=0; |
8bdca7f1 | 1393 | fMinM02=0; |
1394 | break; | |
1395 | case 1: | |
9df9736d | 1396 | if (!fUseM02) fUseM02=1; |
8bdca7f1 | 1397 | fMinM02=0.002; |
1398 | break; | |
1399 | default: | |
1400 | AliError(Form("Min M02 not defined %d",minM02)); | |
1401 | return kFALSE; | |
1402 | } | |
1403 | return kTRUE; | |
1404 | } | |
1405 | ||
1406 | //___________________________________________________________________ | |
1407 | Bool_t AliCaloPhotonCuts::SetMaxM20(Int_t maxM20) | |
1408 | { | |
1409 | switch(maxM20){ | |
1410 | case 0: | |
9df9736d | 1411 | if (!fUseM20) fUseM20=0; |
8bdca7f1 | 1412 | fMaxM20=100; |
1413 | break; | |
1414 | case 1: | |
9df9736d | 1415 | if (!fUseM20) fUseM20=1; |
8bdca7f1 | 1416 | fMaxM20=0.5; |
1417 | break; | |
1418 | default: | |
1419 | AliError(Form("Max M20 Cut not defined %d",maxM20)); | |
1420 | return kFALSE; | |
1421 | } | |
1422 | return kTRUE; | |
1423 | } | |
1424 | ||
1425 | //___________________________________________________________________ | |
1426 | Bool_t AliCaloPhotonCuts::SetMinM20(Int_t minM20) | |
1427 | { | |
1428 | switch(minM20){ | |
1429 | case 0: | |
9df9736d | 1430 | if (!fUseM20) fUseM20=0; |
8bdca7f1 | 1431 | fMinM20=0; |
1432 | break; | |
1433 | case 1: | |
9df9736d | 1434 | if (!fUseM20) fUseM20=1; |
8bdca7f1 | 1435 | fMinM20=0.002; |
1436 | break; | |
1437 | default: | |
1438 | AliError(Form("Min M20 Cut not defined %d",minM20)); | |
1439 | return kFALSE; | |
1440 | } | |
1441 | return kTRUE; | |
1442 | } | |
1443 | ||
1444 | //___________________________________________________________________ | |
1445 | Bool_t AliCaloPhotonCuts::SetDispersion(Int_t dispersion) | |
1446 | { | |
1447 | switch(dispersion){ | |
1448 | case 0: | |
9df9736d | 1449 | if (!fUseDispersion) fUseDispersion=0; |
8bdca7f1 | 1450 | fMaxDispersion =100; |
1451 | break; | |
1452 | case 1: | |
9df9736d | 1453 | if (!fUseDispersion) fUseDispersion=1; |
8bdca7f1 | 1454 | fMaxDispersion=2.; |
1455 | break; | |
1456 | default: | |
1457 | AliError(Form("Maximum Dispersion Cut not defined %d",dispersion)); | |
1458 | return kFALSE; | |
1459 | } | |
1460 | return kTRUE; | |
1461 | } | |
1462 | ||
1463 | //___________________________________________________________________ | |
1464 | Bool_t AliCaloPhotonCuts::SetNLM(Int_t nlm) | |
1465 | { | |
1466 | switch(nlm){ | |
1467 | case 0: | |
9df9736d | 1468 | if (!fUseNLM) fUseNLM=0; |
8bdca7f1 | 1469 | fMinNLM =0; |
1470 | fMaxNLM =100; | |
1471 | break; | |
1472 | case 1: | |
9df9736d | 1473 | if (!fUseNLM) fUseNLM=1; |
8bdca7f1 | 1474 | fMinNLM =0; |
1475 | fMaxNLM =1; | |
1476 | break; | |
1477 | default: | |
1478 | AliError(Form("NLM Cut not defined %d",nlm)); | |
1479 | return kFALSE; | |
1480 | } | |
1481 | return kTRUE; | |
1482 | } | |
1483 | ||
1484 | ///________________________________________________________________________ | |
1485 | TString AliCaloPhotonCuts::GetCutNumber(){ | |
1486 | // returns TString with current cut number | |
1487 | TString a(kNCuts); | |
1488 | for(Int_t ii=0;ii<kNCuts;ii++){ | |
1489 | a.Append(Form("%d",fCuts[ii])); | |
1490 | } | |
1491 | return a; | |
1492 | } | |
1493 | ||
925a074a | 1494 |