1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Authors: Friederike Bock, Baldo Sahlmueller *
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 **************************************************************************/
16 ////////////////////////////////////////////////
17 //---------------------------------------------
18 // Class handling all kinds of selection cuts for
19 // Photon from EMCAL clusters
20 //---------------------------------------------
21 ////////////////////////////////////////////////
23 #include "AliCaloPhotonCuts.h"
24 #include "AliAnalysisManager.h"
25 #include "AliInputEventHandler.h"
26 #include "AliMCEventHandler.h"
27 #include "AliAODHandler.h"
32 #include "AliAODConversionMother.h"
33 #include "AliAODConversionPhoton.h"
34 #include "TObjString.h"
35 #include "AliAODEvent.h"
36 #include "AliESDEvent.h"
37 #include "AliCentrality.h"
41 #include "AliV0ReaderV1.h"
42 #include "AliAODMCParticle.h"
43 #include "AliAODMCHeader.h"
44 #include "AliPicoTrack.h"
45 #include "AliEMCALRecoUtils.h"
46 #include "AliTrackerBase.h"
52 ClassImp(AliCaloPhotonCuts)
55 const char* AliCaloPhotonCuts::fgkCutNames[AliCaloPhotonCuts::kNCuts] = {
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
71 "MaximumDispersion", //15
76 //________________________________________________________________________
77 AliCaloPhotonCuts::AliCaloPhotonCuts(const char *name,const char *title) :
78 AliAnalysisCuts(name,title),
87 fMinDistanceToBadChannel(0),
88 fUseDistanceToBadChannel(0),
91 fMinDistTrackToCluster(0),
92 fUseDistTrackToCluster(0),
93 fExtendedMatching(kFALSE),
106 fMaxDispersion(1000),
113 fHistAcceptanceCuts(NULL),
114 fHistClusterIdentificationCuts(NULL),
115 fHistClusterEtavsPhiBeforeAcc(NULL),
116 fHistClusterEtavsPhiAfterAcc(NULL),
117 fHistClusterEtavsPhiAfterQA(NULL),
118 //fHistDistanceToBadChannelBeforeAcc(NULL),
119 //fHistDistanceToBadChannelAfterAcc(NULL),
120 fHistClusterTimevsEBeforeQA(NULL),
121 fHistClusterTimevsEAfterQA(NULL),
122 //fHistExoticCellBeforeQA(NULL),
123 //fHistExoticCellAfterQA(NULL),
124 //fHistNMatchedTracks(NULL),
125 fHistEnergyOfClusterBeforeQA(NULL),
126 fHistEnergyOfClusterAfterQA(NULL),
127 fHistNCellsBeforeQA(NULL),
128 fHistNCellsAfterQA(NULL),
129 fHistM02BeforeQA(NULL),
130 fHistM02AfterQA(NULL),
131 fHistM20BeforeQA(NULL),
132 fHistM20AfterQA(NULL),
133 fHistDispersionBeforeQA(NULL),
134 fHistDispersionAfterQA(NULL),
135 //fHistNLMBeforeQA(NULL),
136 //fHistNLMAfterQA(NULL),
137 fHistClusterRBeforeQA(NULL),
138 fHistClusterRAfterQA(NULL),
139 fHistClusterdEtadPhiBeforeQA(NULL),
140 fHistClusterdEtadPhiAfterQA(NULL),
141 fHistDistanceTrackToClusterBeforeQA(NULL),
142 fHistDistanceTrackToClusterAfterQA(NULL),
143 fHistClusterdEtadPhiPosTracksBeforeQA(NULL),
144 fHistClusterdEtadPhiNegTracksBeforeQA(NULL),
145 fHistClusterdEtadPtBeforeQA(NULL),
146 fHistClusterdPhidPtBeforeQA(NULL),
147 fHistClusterM20Pt_dPhiBeforeQA(NULL),
148 fHistClusterM02Pt_dPhiBeforeQA(NULL),
149 fHistClusterM20M02BeforeQA(NULL),
150 fHistClusterM20M02AfterQA(NULL)
152 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
153 fCutString=new TObjString((GetCutNumber()).Data());
156 //________________________________________________________________________
157 AliCaloPhotonCuts::AliCaloPhotonCuts(const AliCaloPhotonCuts &ref) :
158 AliAnalysisCuts(ref),
160 fClusterType(ref.fClusterType),
161 fMinEtaCut(ref.fMinEtaCut),
162 fMaxEtaCut(ref.fMaxEtaCut),
163 fUseEtaCut(ref.fUseEtaCut),
164 fMinPhiCut(ref.fMinPhiCut),
165 fMaxPhiCut(ref.fMaxPhiCut),
166 fUsePhiCut(ref.fUsePhiCut),
167 fMinDistanceToBadChannel(ref.fMinDistanceToBadChannel),
168 fUseDistanceToBadChannel(ref.fUseDistanceToBadChannel),
169 fMaxTimeDiff(ref.fMaxTimeDiff),
170 fUseTimeDiff(ref.fUseTimeDiff),
171 fMinDistTrackToCluster(ref.fMinDistTrackToCluster),
172 fUseDistTrackToCluster(ref.fUseDistTrackToCluster),
173 fExtendedMatching(ref.fExtendedMatching),
174 fExoticCell(ref.fExoticCell),
175 fUseExoticCell(ref.fUseExoticCell),
176 fMinEnergy(ref.fMinEnergy),
177 fUseMinEnergy(ref.fUseMinEnergy),
178 fMinNCells(ref.fMinNCells),
179 fUseNCells(ref.fUseNCells),
180 fMaxM02(ref.fMaxM02),
181 fMinM02(ref.fMinM02),
182 fUseM02(ref.fUseM02),
183 fMaxM20(ref.fMaxM20),
184 fMinM20(ref.fMinM20),
185 fUseM20(ref.fUseDispersion),
186 fMaxDispersion(ref.fMaxDispersion),
187 fUseDispersion(ref.fUseDispersion),
188 fMinNLM(ref.fMinNLM),
189 fMaxNLM(ref.fMaxNLM),
190 fUseNLM(ref.fUseNLM),
193 fHistAcceptanceCuts(NULL),
194 fHistClusterIdentificationCuts(NULL),
195 fHistClusterEtavsPhiBeforeAcc(NULL),
196 fHistClusterEtavsPhiAfterAcc(NULL),
197 fHistClusterEtavsPhiAfterQA(NULL),
198 //fHistDistanceToBadChannelBeforeAcc(NULL),
199 //fHistDistanceToBadChannelAfterAcc(NULL),
200 fHistClusterTimevsEBeforeQA(NULL),
201 fHistClusterTimevsEAfterQA(NULL),
202 //fHistExoticCellBeforeQA(NULL),
203 //fHistExoticCellAfterQA(NULL),
204 //fHistNMatchedTracks(NULL),
205 fHistEnergyOfClusterBeforeQA(NULL),
206 fHistEnergyOfClusterAfterQA(NULL),
207 fHistNCellsBeforeQA(NULL),
208 fHistNCellsAfterQA(NULL),
209 fHistM02BeforeQA(NULL),
210 fHistM02AfterQA(NULL),
211 fHistM20BeforeQA(NULL),
212 fHistM20AfterQA(NULL),
213 fHistDispersionBeforeQA(NULL),
214 fHistDispersionAfterQA(NULL),
215 //fHistNLMBeforeQA(NULL),
216 //fHistNLMAfterQA(NULL),
217 fHistClusterRBeforeQA(NULL),
218 fHistClusterRAfterQA(NULL),
219 fHistClusterdEtadPhiBeforeQA(NULL),
220 fHistClusterdEtadPhiAfterQA(NULL),
221 fHistDistanceTrackToClusterBeforeQA(NULL),
222 fHistDistanceTrackToClusterAfterQA(NULL),
223 fHistClusterdEtadPhiPosTracksBeforeQA(NULL),
224 fHistClusterdEtadPhiNegTracksBeforeQA(NULL),
225 fHistClusterdEtadPtBeforeQA(NULL),
226 fHistClusterdPhidPtBeforeQA(NULL),
227 fHistClusterM20Pt_dPhiBeforeQA(NULL),
228 fHistClusterM02Pt_dPhiBeforeQA(NULL),
229 fHistClusterM20M02BeforeQA(NULL),
230 fHistClusterM20M02AfterQA(NULL)
233 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
234 fCutString=new TObjString((GetCutNumber()).Data());
239 //________________________________________________________________________
240 AliCaloPhotonCuts::~AliCaloPhotonCuts() {
242 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
244 // delete fHistograms;
245 // fHistograms = NULL;
246 if(fCutString != NULL){
252 //________________________________________________________________________
253 void AliCaloPhotonCuts::InitCutHistograms(TString name){
255 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
256 TH1::AddDirectory(kFALSE);
258 if(fHistograms != NULL){
262 if(fHistograms==NULL){
263 fHistograms=new TList();
264 fHistograms->SetOwner(kTRUE);
265 if(name=="")fHistograms->SetName(Form("CaloCuts_%s",GetCutNumber().Data()));
266 else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
270 fHistCutIndex=new TH1F(Form("IsPhotonSelected %s",GetCutNumber().Data()),"IsPhotonSelected",5,-0.5,4.5);
271 fHistCutIndex->GetXaxis()->SetBinLabel(kPhotonIn+1,"in");
272 fHistCutIndex->GetXaxis()->SetBinLabel(kDetector+1,"detector");
273 fHistCutIndex->GetXaxis()->SetBinLabel(kAcceptance+1,"acceptance");
274 fHistCutIndex->GetXaxis()->SetBinLabel(kClusterQuality+1,"cluster QA");
275 fHistCutIndex->GetXaxis()->SetBinLabel(kPhotonOut+1,"out");
276 fHistograms->Add(fHistCutIndex);
279 fHistAcceptanceCuts=new TH1F(Form("AcceptanceCuts %s",GetCutNumber().Data()),"AcceptanceCuts",5,-0.5,4.5);
280 fHistAcceptanceCuts->GetXaxis()->SetBinLabel(1,"in");
281 fHistAcceptanceCuts->GetXaxis()->SetBinLabel(2,"eta");
282 fHistAcceptanceCuts->GetXaxis()->SetBinLabel(3,"phi");
283 fHistAcceptanceCuts->GetXaxis()->SetBinLabel(4,"distance to bad channel");
284 fHistAcceptanceCuts->GetXaxis()->SetBinLabel(5,"out");
285 fHistograms->Add(fHistAcceptanceCuts);
288 fHistClusterIdentificationCuts =new TH1F(Form("ClusterQualityCuts %s",GetCutNumber().Data()),"ClusterQualityCuts",11,-0.5,10.5);
289 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(1,"in");
290 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(2,"timing");
291 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(3,"track matching");
292 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(4,"Exotics");
293 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(5,"minimum energy");
294 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(6,"minimum NCells");
295 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(7,"M02");
296 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(8,"M20");
297 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(9,"dispersion");
298 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(10,"NLM");
299 fHistClusterIdentificationCuts->GetXaxis()->SetBinLabel(11,"out");
300 fHistograms->Add(fHistClusterIdentificationCuts);
302 // Acceptance related histogramms
303 fHistClusterEtavsPhiBeforeAcc=new TH2F(Form("EtaPhi_beforeAcceptance %s",GetCutNumber().Data()),"EtaPhi_beforeAcceptance",430,-TMath::Pi(),TMath::Pi(),96,-0.7,0.7); // 462->430, 110->96
304 fHistograms->Add(fHistClusterEtavsPhiBeforeAcc);
305 fHistClusterEtavsPhiAfterAcc=new TH2F(Form("EtaPhi_afterAcceptance %s",GetCutNumber().Data()),"EtaPhi_afterAcceptance",430,-TMath::Pi(),TMath::Pi(),96,-0.7,0.7); // 462->430, 110->96
306 fHistograms->Add(fHistClusterEtavsPhiAfterAcc);
307 fHistClusterEtavsPhiAfterQA=new TH2F(Form("EtaPhi_afterClusterQA %s",GetCutNumber().Data()),"EtaPhi_afterClusterQA",430,-TMath::Pi(),TMath::Pi(),96,-0.7,0.7); // 462->430, 110->96
308 fHistograms->Add(fHistClusterEtavsPhiAfterQA);
309 //fHistDistanceToBadChannelBeforeAcc = new TH1F(Form("DistanceToBadChannel_beforeAcceptance %s",GetCutNumber().Data()),"DistanceToBadChannel_beforeAcceptance",200,0,40);
310 //fHistograms->Add(fHistDistanceToBadChannelBeforeAcc);
311 //fHistDistanceToBadChannelAfterAcc = new TH1F(Form("DistanceToBadChannel_afterAcceptance %s",GetCutNumber().Data()),"DistanceToBadChannel_afterAcceptance",200,0,40);
312 //fHistograms->Add(fHistDistanceToBadChannelAfterAcc);
314 // Cluster quality related histograms
315 Double_t timeMin = -10e-6;
316 Double_t timeMax = 10e-6;
317 fHistClusterTimevsEBeforeQA=new TH2F(Form("ClusterTimeVsE_beforeClusterQA %s",GetCutNumber().Data()),"ClusterTimeVsE_beforeClusterQA",400,timeMin,timeMax,100,0.,40);
318 fHistograms->Add(fHistClusterTimevsEBeforeQA);
319 fHistClusterTimevsEAfterQA=new TH2F(Form("ClusterTimeVsE_afterClusterQA %s",GetCutNumber().Data()),"ClusterTimeVsE_afterClusterQA",400,timeMin,timeMax,100,0.,40);
320 fHistograms->Add(fHistClusterTimevsEAfterQA);
321 //fHistExoticCellBeforeQA=new TH2F(Form("ExoticCell_beforeClusterQA %s",GetCutNumber().Data()),"ExoticCell_beforeClusterQA",400,0,40,50,0.75,1);
322 //fHistograms->Add(fHistExoticCellBeforeQA);
323 //fHistExoticCellAfterQA=new TH2F(Form("ExoticCell_afterClusterQA %s",GetCutNumber().Data()),"ExoticCell_afterClusterQA",400,0,40,50,0.75,1);
324 //fHistograms->Add(fHistExoticCellAfterQA);
325 //fHistNMatchedTracks = new TH1F(Form("NMatchedTracks_%s",GetCutNumber().Data()),"NMatchedTracks",22,-1.5,20.5);
326 //fHistograms->Add(fHistNMatchedTracks);
327 fHistEnergyOfClusterBeforeQA = new TH1F(Form("EnergyOfCluster_beforeClusterQA %s",GetCutNumber().Data()),"EnergyOfCluster_beforeClusterQA",300,0,30);
328 fHistograms->Add(fHistEnergyOfClusterBeforeQA);
329 fHistEnergyOfClusterAfterQA = new TH1F(Form("EnergyOfCluster_afterClusterQA %s",GetCutNumber().Data()),"EnergyOfCluster_afterClusterQA",300,0,30);
330 fHistograms->Add(fHistEnergyOfClusterAfterQA);
331 fHistNCellsBeforeQA = new TH1F(Form("NCellPerCluster_beforeClusterQA %s",GetCutNumber().Data()),"NCellPerCluster_beforeClusterQA",50,0,50);
332 fHistograms->Add(fHistNCellsBeforeQA);
333 fHistNCellsAfterQA = new TH1F(Form("NCellPerCluster_afterClusterQA %s",GetCutNumber().Data()),"NCellPerCluster_afterClusterQA",50,0,50);
334 fHistograms->Add(fHistNCellsAfterQA);
335 fHistM02BeforeQA = new TH1F(Form("M02_beforeClusterQA %s",GetCutNumber().Data()),"M02_beforeClusterQA",400,0,5);
336 fHistograms->Add(fHistM02BeforeQA);
337 fHistM02AfterQA = new TH1F(Form("M02_afterClusterQA %s",GetCutNumber().Data()),"M02_afterClusterQA",400,0,5);
338 fHistograms->Add(fHistM02AfterQA);
339 fHistM20BeforeQA = new TH1F(Form("M20_beforeClusterQA %s",GetCutNumber().Data()),"M20_beforeClusterQA",400,0,2.5);
340 fHistograms->Add(fHistM20BeforeQA);
341 fHistM20AfterQA = new TH1F(Form("M20_afterClusterQA %s",GetCutNumber().Data()),"M20_afterClusterQA",400,0,2.5);
342 fHistograms->Add(fHistM20AfterQA);
343 fHistDispersionBeforeQA = new TH1F(Form("Dispersion_beforeClusterQA %s",GetCutNumber().Data()),"Dispersion_beforeClusterQA",100,0,4);
344 fHistograms->Add(fHistDispersionBeforeQA);
345 fHistDispersionAfterQA = new TH1F(Form("Dispersion_afterClusterQA %s",GetCutNumber().Data()),"Dispersion_afterClusterQA",100,0,4);
346 fHistograms->Add(fHistDispersionAfterQA);
347 //fHistNLMBeforeQA = new TH1F(Form("NLM_beforeClusterQA %s",GetCutNumber().Data()),"NLM_beforeClusterQA",10,0,10);
348 //fHistograms->Add(fHistNLMBeforeQA);
349 //fHistNLMAfterQA = new TH1F(Form("NLM_afterClusterQA %s",GetCutNumber().Data()),"NLM_afterClusterQA",10,0,10);
350 //fHistograms->Add(fHistNLMAfterQA);
352 //TrackMatching histograms
353 if(fUseDistTrackToCluster) {
354 fHistClusterRBeforeQA = new TH1F(Form("R_Cluster_beforeClusterQA %s",GetCutNumber().Data()),"R of cluster",200,400,500);
355 fHistograms->Add(fHistClusterRBeforeQA);
356 fHistClusterRAfterQA = new TH1F(Form("R_Cluster_afterClusterQA %s",GetCutNumber().Data()),"R of cluster_matched",200,400,500);
357 fHistograms->Add(fHistClusterRAfterQA);
358 fHistClusterdEtadPhiBeforeQA=new TH2F(Form("dEtaVsdPhi_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_beforeClusterQA",240,-0.3,0.3,240,-0.3,0.3);
359 fHistograms->Add(fHistClusterdEtadPhiBeforeQA);
360 fHistClusterdEtadPhiAfterQA=new TH2F(Form("dEtaVsdPhi_afterClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_afterClusterQA",240,-0.3,0.3,240,-0.3,0.3);
361 fHistograms->Add(fHistClusterdEtadPhiAfterQA);
362 fHistDistanceTrackToClusterBeforeQA = new TH1F(Form("DistanceToTrack_beforeClusterQA %s",GetCutNumber().Data()),"DistanceToTrack_beforeClusterQA",200,0,2);
363 fHistograms->Add(fHistDistanceTrackToClusterBeforeQA);
364 fHistDistanceTrackToClusterAfterQA = new TH1F(Form("DistanceToTrack_afterClusterQA %s",GetCutNumber().Data()),"DistanceToTrack_afterClusterQA",200,0,2);
365 fHistograms->Add(fHistDistanceTrackToClusterAfterQA);
367 if(fExtendedMatching){
368 fHistClusterdEtadPhiPosTracksBeforeQA = new TH2F(Form("dEtaVsdPhi_posTracks_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_posTracks_beforeClusterQA",240,-0.3,0.3,240,-0.3,0.3);
369 fHistograms->Add(fHistClusterdEtadPhiPosTracksBeforeQA);
370 fHistClusterdEtadPhiNegTracksBeforeQA = new TH2F(Form("dEtaVsdPhi_negTracks_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_negTracks_beforeClusterQA",240,-0.3,0.3,240,-0.3,0.3);
371 fHistograms->Add(fHistClusterdEtadPhiNegTracksBeforeQA);
372 fHistClusterdEtadPtBeforeQA = new TH2F(Form("dEtaVsPt_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsPt_beforeClusterQA",240,-0.3,0.3,250,0,25);
373 fHistograms->Add(fHistClusterdEtadPtBeforeQA);
374 fHistClusterdPhidPtBeforeQA = new TH2F(Form("dPhiVsPt_beforeClusterQA %s",GetCutNumber().Data()),"dPhiVsPt_beforeClusterQA",480,-0.6,0.6,250,0,25);
375 fHistograms->Add(fHistClusterdPhidPtBeforeQA);
376 fHistClusterM20Pt_dPhiBeforeQA = new TH2F(Form("M20VsPt_dPhi_beforeClusterQA %s",GetCutNumber().Data()),"M20VsPt_dPhi_beforeClusterQA",200,0,2.5,250,0,25);
377 fHistograms->Add(fHistClusterM20Pt_dPhiBeforeQA);
378 fHistClusterM02Pt_dPhiBeforeQA = new TH2F(Form("M02VsPt_dPhi_beforeClusterQA %s",GetCutNumber().Data()),"M20VsPt_dPhi_beforeClusterQA",400,0,5,250,0,25);
379 fHistograms->Add(fHistClusterM02Pt_dPhiBeforeQA);
380 fHistClusterM20M02BeforeQA = new TH2F(Form("M20VsM02_beforeClusterQA %s",GetCutNumber().Data()),"M20VsM02_beforeClusterQA",200,0,2.5,400,0,5);
381 fHistograms->Add(fHistClusterM20M02BeforeQA);
382 fHistClusterM20M02AfterQA = new TH2F(Form("M20VsM02_afterClusterQA %s",GetCutNumber().Data()),"M20VsM02_afterClusterQA",200,0,2.5,400,0,5);
383 fHistograms->Add(fHistClusterM20M02AfterQA);
386 TH1::AddDirectory(kTRUE);
390 ///________________________________________________________________________
391 Bool_t AliCaloPhotonCuts::ClusterIsSelectedMC(TParticle *particle,AliStack *fMCStack){
392 // MonteCarlo Photon Selection
394 if(!fMCStack)return kFALSE;
396 if (particle->GetPdgCode() == 22){
398 if ( particle->Eta() < fMinEtaCut || particle->Eta() > fMaxEtaCut ) return kFALSE;
399 if ( particle->Phi() < fMinPhiCut || particle->Phi() > fMaxPhiCut ) return kFALSE;
401 if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){
402 return kFALSE; // no photon as mothers!
404 if(particle->GetMother(0) >= fMCStack->GetNprimary()){
405 return kFALSE; // the gamma has a mother, and it is not a primary particle
411 ///________________________________________________________________________
412 Bool_t AliCaloPhotonCuts::ClusterIsSelectedAODMC(AliAODMCParticle *particle,TClonesArray *aodmcArray){
413 // MonteCarlo Photon Selection
415 if(!aodmcArray)return kFALSE;
416 if (particle->GetPdgCode() == 22){
417 if ( particle->Eta() < fMinEtaCut || particle->Eta() > fMaxEtaCut ) return kFALSE;
418 if ( particle->Phi() < fMinPhiCut || particle->Phi() > fMaxPhiCut ) return kFALSE;
419 if(particle->GetMother() > -1){
420 if((static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
421 return kFALSE; // no photon as mothers!
423 if(!(static_cast<AliAODMCParticle*>(aodmcArray->At(particle->GetMother()))->IsPrimary())){
424 return kFALSE; // the gamma has a mother, and it is not a primary particle
427 return kTRUE; // return in case of accepted gamma
434 ///________________________________________________________________________
435 // This function selects the clusters based on their quality criteria
436 ///________________________________________________________________________
437 Bool_t AliCaloPhotonCuts::ClusterQualityCuts(AliVCluster* cluster, AliVEvent *event, Bool_t isMC)
438 { // Specific Photon Cuts
441 if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex);
444 // Double_t minR = 999.0;
445 // get the minimum radius of tracks to cluster
446 // if(fHistDistanceTrackToClusterBeforeQA || fHistDistanceTrackToClusterAfterQA){
448 // cluster->GetPosition(pos); // Get cluster position
451 // int NtrMatched = 0;
452 // NtrMatched = cluster->GetNTracksMatched();
453 // fHistNMatchedTracks->Fill(NtrMatched);
454 // //loop over tracks for Jet QA
455 // TList *l = event->GetList();
456 // TClonesArray *tracks = dynamic_cast<TClonesArray*>(l->FindObject("Tracks"));
457 // for(int itrack = 0; itrack < NtrMatched; itrack++){
458 // AliVTrack *trackcluster = static_cast<AliVTrack*>(tracks->At(itrack));
459 // if (! trackcluster) {
460 // AliError(Form("Couldn't get ESD track %d\n", itrack));
463 // Double_t dphi = -999.0;
464 // Double_t deta = -999.0;
465 // AliPicoTrack::GetEtaPhiDiff(trackcluster, cluster, dphi, deta);
466 // cout << "here" << endl;
467 // Double_t dr = sqrt(dphi*dphi + deta+deta);
470 // }//loop over tracks
473 // Fill Histos before Cuts
474 if(fHistClusterTimevsEBeforeQA) fHistClusterTimevsEBeforeQA->Fill(cluster->GetTOF(), cluster->E());
475 // if(fHistExoticCellBeforeQA) fHistExoticCellBeforeQA->Fill(cluster->E(), );
476 // if(fHistDistanceTrackToClusterBeforeQA) fHistDistanceTrackToClusterBeforeQA->Fill(minR);
477 if(fHistEnergyOfClusterBeforeQA) fHistEnergyOfClusterBeforeQA->Fill(cluster->E());
478 if(fHistNCellsBeforeQA) fHistNCellsBeforeQA->Fill(cluster->GetNCells());
479 if(fHistM02BeforeQA) fHistM02BeforeQA->Fill(cluster->GetM02());
480 if(fHistM20BeforeQA) fHistM20BeforeQA->Fill(cluster->GetM20());
481 if(fHistDispersionBeforeQA) fHistDispersionBeforeQA->Fill(cluster->GetDispersion());
482 // if(fHistNLMBeforeQA) fHistNLMBeforeQA->Fill(cluster->GetNExMax());
484 // Check wether timing is ok
486 if(abs(cluster->GetTOF()) > fMaxTimeDiff && !isMC){
487 if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //1
491 cutIndex++; //2, next cut
493 // Minimum distance to track
494 // if (fUseDistTrackToCluster){
496 // cluster->GetPosition(pos); // Get cluster position
498 // int NtrMatched = 0;
499 // NtrMatched = cluster->GetNTracksMatched();
500 // fHistNMatchedTracks->Fill(NtrMatched);
501 // if(NtrMatched > 0){
502 // //loop over tracks for QA
503 // TList *l = event->GetList();
504 // TClonesArray *tracks = dynamic_cast<TClonesArray*>(l->FindObject("Tracks"));
506 // Double_t dphi = 999.0;
507 // Double_t deta = 999.0;
508 // Double_t dr2 = 999.0;
510 // for(int itrack = 0; itrack < NtrMatched; itrack++){
511 // AliVTrack *trackcluster = NULL;
512 // trackcluster = static_cast<AliVTrack*>(tracks->At(itrack));
513 // if (! trackcluster) {
514 // AliError(Form("Couldn't get ESD track %d\n", itrack));
517 // AliPicoTrack::GetEtaPhiDiff(trackcluster, cluster, dphi, deta);
518 // dr2 = dphi*dphi + deta+deta;
519 // //cout << dr << endl;
520 // if(dr2 < fMinDistTrackToCluster*fMinDistTrackToCluster){
521 // // if(dphi < fMinDistTrackToCluster || deta < fMinDistTrackToCluster){
522 // if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //2
526 // }//loop over tracks
528 // // if(cluster->GetEmcCpvDistance() < fMinDistTrackToCluster){
529 // // if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //2
533 cutIndex++;//3, next cut
535 // exotic cell cut --IMPLEMENT LATER---
536 // if(!AcceptanceCuts(photon)){
537 // if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //3
540 cutIndex++; //4, next cut
542 // minimum cell energy cut
544 if(cluster->E() < fMinEnergy){
545 if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //4
549 cutIndex++; //5, next cut
551 // minimum number of cells
553 if(cluster->GetNCells() < fMinNCells) {
554 if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //5
558 cutIndex++; //6, next cut
562 if( cluster->GetM02()< fMinM02 || cluster->GetM02() > fMaxM02 ) {
563 if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //6
567 cutIndex++; //7, next cut
571 if( cluster->GetM20()< fMinM20 || cluster->GetM20() > fMaxM20 ) {
572 if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //7
576 cutIndex++; //8, next cut
580 if( cluster->GetDispersion()> fMaxDispersion) {
581 if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //8
585 cutIndex++; //9, next cut
587 // NLM cut --IMPLEMENT LATER---
589 // if( cluster->GetDispersion()> fMaxDispersion) {
590 // if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //9
594 cutIndex++; //9, next cut
596 // DONE with selecting photons
597 if(fHistClusterIdentificationCuts)fHistClusterIdentificationCuts->Fill(cutIndex); //10
600 Double_t vertex[3] = {0,0,0};
601 // event->GetPrimaryVertex()->GetXYZ(vertex);
602 // TLorentzvector with cluster
603 TLorentzVector clusterVector;
604 cluster->GetMomentum(clusterVector,vertex);
605 Double_t etaCluster = clusterVector.Eta();
606 Double_t phiCluster = clusterVector.Phi();
608 if(fHistClusterEtavsPhiAfterQA) fHistClusterEtavsPhiAfterQA->Fill(phiCluster,etaCluster);
609 if(fHistClusterTimevsEAfterQA) fHistClusterTimevsEAfterQA->Fill(cluster->GetTOF(), cluster->E());
610 // if(fHistExoticCellAfterQA) fHistExoticCellAfterQA->Fill(cluster->E(), );
611 // if(fHistDistanceTrackToClusterAfterQA) fHistDistanceTrackToClusterAfterQA->Fill(minR);
612 if(fHistEnergyOfClusterAfterQA) fHistEnergyOfClusterAfterQA->Fill(cluster->E());
613 if(fHistNCellsAfterQA) fHistNCellsAfterQA->Fill(cluster->GetNCells());
614 if(fHistM02AfterQA) fHistM02AfterQA->Fill(cluster->GetM02());
615 if(fHistM20AfterQA) fHistM20AfterQA->Fill(cluster->GetM20());
616 if(fHistDispersionAfterQA) fHistDispersionAfterQA->Fill(cluster->GetDispersion());
617 // if(fHistNLMBeforeQA) fHistNLMAfterQA->Fill(cluster->GetNExMax());
624 ///________________________________________________________________________
625 Bool_t AliCaloPhotonCuts::ClusterIsSelected(AliVCluster *cluster, AliVEvent * event, Bool_t isMC)
627 //Selection of Reconstructed photon clusters with Calorimeters
629 FillClusterCutIndex(kPhotonIn);
631 Double_t vertex[3] = {0,0,0};
632 // event->GetPrimaryVertex()->GetXYZ(vertex);
633 // TLorentzvector with cluster
634 TLorentzVector clusterVector;
635 cluster->GetMomentum(clusterVector,vertex);
636 Double_t etaCluster = clusterVector.Eta();
637 Double_t phiCluster = clusterVector.Phi();
639 // Histos before cuts
640 if(fHistClusterEtavsPhiBeforeAcc) fHistClusterEtavsPhiBeforeAcc->Fill(phiCluster,etaCluster);
642 // Cluster Selection - 0= accept any calo cluster
643 if (fClusterType > 0){
644 //Select EMCAL cluster
645 if (fClusterType == 1 && !cluster->IsEMCAL()){
646 FillClusterCutIndex(kDetector);
649 //Select PHOS cluster
650 if (fClusterType == 2 && !cluster->IsPHOS()){
651 FillClusterCutIndex(kDetector);
657 if(!AcceptanceCuts(cluster,event)){
658 FillClusterCutIndex(kAcceptance);
661 // Cluster Quality Cuts
662 if(!ClusterQualityCuts(cluster,event,isMC)){
663 FillClusterCutIndex(kClusterQuality);
667 // Photon passed cuts
668 FillClusterCutIndex(kPhotonOut);
673 ///________________________________________________________________________
674 Bool_t AliCaloPhotonCuts::AcceptanceCuts(AliVCluster *cluster, AliVEvent* event)
676 // Exclude certain areas for photon reconstruction
679 if(fHistAcceptanceCuts)fHistAcceptanceCuts->Fill(cutIndex);
683 Double_t vertex[3] = {0,0,0};
684 // event->GetPrimaryVertex()->GetXYZ(vertex);
685 // TLorentzvector with cluster
686 TLorentzVector clusterVector;
687 cluster->GetMomentum(clusterVector,vertex);
688 Double_t etaCluster = clusterVector.Eta();
689 Double_t phiCluster = clusterVector.Phi();
693 if (etaCluster < fMinEtaCut || etaCluster > fMaxEtaCut){
694 if(fHistAcceptanceCuts)fHistAcceptanceCuts->Fill(cutIndex);
702 if (phiCluster < fMinPhiCut || phiCluster > fMaxPhiCut){
703 if(fHistAcceptanceCuts)fHistAcceptanceCuts->Fill(cutIndex);
709 // check distance to bad channel
710 if (fUseDistanceToBadChannel){
711 if (cluster->GetDistanceToBadChannel() < fMinDistanceToBadChannel){
712 if(fHistAcceptanceCuts)fHistAcceptanceCuts->Fill(cutIndex);
717 if(fHistAcceptanceCuts)fHistAcceptanceCuts->Fill(cutIndex);
720 if(fHistClusterEtavsPhiAfterAcc) fHistClusterEtavsPhiAfterAcc->Fill(phiCluster,etaCluster);
725 Bool_t AliCaloPhotonCuts::MatchConvPhotonToCluster(AliAODConversionPhoton* convPhoton, AliVCluster* cluster, AliVEvent* event ){
727 if (!fUseDistTrackToCluster) return kFALSE;
729 AliESDEvent *esdev = dynamic_cast<AliESDEvent*>(event);
730 AliAODEvent *aodev = 0;
732 aodev = dynamic_cast<AliAODEvent*>(event);
734 AliError("Task needs AOD or ESD event, returning");
739 // Double_t vertex[3] = {0,0,0};
740 // event->GetPrimaryVertex()->GetXYZ(vertex);
742 if(!cluster->IsEMCAL() && !cluster->IsPHOS()){AliError("Cluster is neither EMCAL nor PHOS, returning"); return kFALSE;}
744 Float_t clusterPosition[3] = {0,0,0};
745 cluster->GetPosition(clusterPosition);
746 Double_t clusterR = TMath::Sqrt( clusterPosition[0]*clusterPosition[0] + clusterPosition[1]*clusterPosition[1] );
747 if(fHistClusterRBeforeQA) fHistClusterRBeforeQA->Fill(clusterR);
749 //cout << "+++++++++ Cluster: x, y, z, R" << clusterPosition[0] << ", " << clusterPosition[1] << ", " << clusterPosition[2] << ", " << clusterR << "+++++++++" << endl;
751 Bool_t matched = kFALSE;
752 for (Int_t i = 0; i < 2; i++){
753 Int_t tracklabel = convPhoton->GetLabel(i);
754 AliVTrack *inTrack = 0x0;
756 if(tracklabel > event->GetNumberOfTracks() ) continue;
757 inTrack = esdev->GetTrack(tracklabel);
759 if(((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"))->AreAODsRelabeled()){
760 inTrack = dynamic_cast<AliVTrack*>(event->GetTrack(tracklabel));
762 for(Int_t ii=0; ii<event->GetNumberOfTracks(); ii++) {
763 inTrack = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
765 if(inTrack->GetID() == tracklabel) {
773 AliESDtrack *esdt = dynamic_cast<AliESDtrack*>(inTrack);
774 AliAODTrack *aodt = 0;
776 aodt = dynamic_cast<AliAODTrack*>(inTrack);
777 if (!aodt){AliError("Track is neither ESD nor AOD, continue"); continue;}
780 AliExternalTrackParam *trackParam = 0;
782 const AliExternalTrackParam *in = esdt->GetInnerParam();
783 if (!in){AliError("Could not get InnerParam of Track, continue"); continue;}
784 trackParam = new AliExternalTrackParam(*in);
786 Double_t xyz[3] = {0}, pxpypz[3] = {0}, cv[21] = {0};
787 aodt->PxPyPz(pxpypz);
789 aodt->GetCovarianceXYZPxPyPz(cv);
790 trackParam = new AliExternalTrackParam(xyz,pxpypz,cv,aodt->Charge());
792 if (!trackParam){AliError("Could not get TrackParameters, continue"); continue;}
794 Bool_t propagated = kFALSE;
795 AliExternalTrackParam emcParam(*trackParam);
799 if(cluster->IsEMCAL()){
800 Float_t eta = 0; Float_t phi = 0; Float_t pt = 0;
801 propagated = AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&emcParam, 430, 0.000510999, 20, eta, phi, pt);
803 propagated = AliEMCALRecoUtils::ExtrapolateTrackToCluster(&emcParam, cluster, 0.000510999, 5, dEta, dPhi);
806 if(cluster->IsPHOS()){
807 propagated = AliTrackerBase::PropagateTrackToBxByBz(&emcParam, clusterR, 0.000510999, 20, kTRUE, 0.8, -1);
809 Double_t trkPos[3] = {0,0,0};
810 emcParam.GetXYZ(trkPos);
811 TVector3 trkPosVec(trkPos[0],trkPos[1],trkPos[2]);
812 TVector3 clsPosVec(clusterPosition);
813 dPhi = clsPosVec.DeltaPhi(trkPosVec);
814 dEta = clsPosVec.Eta()-trkPosVec.Eta();
819 Float_t dR2 = dPhi*dPhi + dEta*dEta;
820 if(fHistDistanceTrackToClusterBeforeQA)fHistDistanceTrackToClusterBeforeQA->Fill(TMath::Sqrt(dR2));
821 if(fHistDistanceTrackToClusterBeforeQA)fHistDistanceTrackToClusterBeforeQA->Fill(TMath::Sqrt(dR2));
822 if(fHistClusterdEtadPhiBeforeQA) fHistClusterdEtadPhiBeforeQA->Fill(dEta, dPhi);
824 Float_t clusM02 = (Float_t)cluster->GetM02();
825 Float_t clusM20 = (Float_t)cluster->GetM20();
826 if(fExtendedMatching){
827 if(fHistClusterdEtadPhiPosTracksBeforeQA && inTrack->Charge() > 0) fHistClusterdEtadPhiPosTracksBeforeQA->Fill(dEta, dPhi);
828 if(fHistClusterdEtadPhiNegTracksBeforeQA && inTrack->Charge() < 0) fHistClusterdEtadPhiNegTracksBeforeQA->Fill(dEta, dPhi);
829 fHistClusterdEtadPtBeforeQA->Fill(dEta, inTrack->Pt());
830 fHistClusterdPhidPtBeforeQA->Fill(dPhi, inTrack->Pt());
831 if(abs(dPhi) > 0.05) fHistClusterM20Pt_dPhiBeforeQA->Fill(clusM20, inTrack->Pt());
832 if(abs(dPhi) > 0.05) fHistClusterM02Pt_dPhiBeforeQA->Fill(clusM02, inTrack->Pt());
833 fHistClusterM20M02BeforeQA->Fill(clusM20, clusM02);
836 if(dR2 < fMinDistTrackToCluster*fMinDistTrackToCluster){
839 if(fHistDistanceTrackToClusterAfterQA)fHistDistanceTrackToClusterAfterQA->Fill(TMath::Sqrt(dR2));
840 if(fHistClusterdEtadPhiAfterQA) fHistClusterdEtadPhiAfterQA->Fill(dEta, dPhi);
841 if(fHistClusterRAfterQA) fHistClusterRAfterQA->Fill(clusterR);
842 if(fExtendedMatching){
843 fHistClusterM20M02AfterQA->Fill(clusM20, clusM02);
854 //____________________________________________________________________________________________
857 ///________________________________________________________________________
858 Bool_t AliCaloPhotonCuts::UpdateCutString() {
859 ///Update the cut string (if it has been created yet)
861 if(fCutString && fCutString->GetString().Length() == kNCuts) {
862 fCutString->SetString(GetCutNumber());
869 ///________________________________________________________________________
870 Bool_t AliCaloPhotonCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
871 // Initialize Cuts from a given Cut string
872 AliInfo(Form("Set CaloCut Number: %s",analysisCutSelection.Data()));
873 if(analysisCutSelection.Length()!=kNCuts) {
874 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
877 if(!analysisCutSelection.IsDigit()){
878 AliError("Cut selection contains characters");
882 const char *cutSelection = analysisCutSelection.Data();
883 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
884 for(Int_t ii=0;ii<kNCuts;ii++){
888 // Set Individual Cuts
889 for(Int_t ii=0;ii<kNCuts;ii++){
890 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
892 PrintCutsWithValues();
896 ///________________________________________________________________________
897 Bool_t AliCaloPhotonCuts::SetCut(cutIds cutID, const Int_t value) {
898 ///Set individual cut ID
903 if( SetClusterTypeCut(value)) {
904 fCuts[kClusterType] = value;
907 } else return kFALSE;
910 if( SetMinEtaCut(value)) {
911 fCuts[kEtaMin] = value;
914 } else return kFALSE;
917 if( SetMaxEtaCut(value)) {
918 fCuts[kEtaMax] = value;
921 } else return kFALSE;
924 if( SetMinPhiCut(value)) {
925 fCuts[kPhiMin] = value;
928 } else return kFALSE;
931 if( SetMaxPhiCut(value)) {
932 fCuts[kPhiMax] = value;
935 } else return kFALSE;
937 case kDistanceToBadChannel:
938 if( SetDistanceToBadChannelCut(value)) {
939 fCuts[kDistanceToBadChannel] = value;
942 } else return kFALSE;
945 if( SetTimingCut(value)) {
946 fCuts[kTiming] = value;
949 } else return kFALSE;
952 if( SetTrackMatchingCut(value)) {
953 fCuts[kTrackMatching] = value;
956 } else return kFALSE;
959 if( SetExoticCellCut(value)) {
960 fCuts[kExoticCell] = value;
963 } else return kFALSE;
966 if( SetMinEnergyCut(value)) {
967 fCuts[kMinEnery] = value;
970 } else return kFALSE;
973 if( SetMinNCellsCut(value)) {
974 fCuts[kNMinCells] = value;
977 } else return kFALSE;
980 if( SetMinM02(value)) {
981 fCuts[kMinM02] = value;
984 } else return kFALSE;
987 if( SetMaxM02(value)) {
988 fCuts[kMaxM02] = value;
991 } else return kFALSE;
994 if( SetMinM20(value)) {
995 fCuts[kMinM20] = value;
998 } else return kFALSE;
1001 if( SetMaxM20(value)) {
1002 fCuts[kMaxM20] = value;
1005 } else return kFALSE;
1008 if( SetDispersion(value)) {
1009 fCuts[kDispersion] = value;
1012 } else return kFALSE;
1015 if( SetNLM(value)) {
1016 fCuts[kNLM] = value;
1019 } else return kFALSE;
1022 AliError("Cut id out of range");
1026 AliError("Cut id %d not recognized");
1031 ///________________________________________________________________________
1032 void AliCaloPhotonCuts::PrintCuts() {
1033 // Print out current Cut Selection
1034 for(Int_t ic = 0; ic < kNCuts; ic++) {
1035 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1039 void AliCaloPhotonCuts::PrintCutsWithValues() {
1040 // Print out current Cut Selection with value
1041 printf("\nCluster cutnumber \n");
1042 for(Int_t ic = 0; ic < kNCuts; ic++) {
1043 printf("%d",fCuts[ic]);
1047 printf("Acceptance cuts: \n");
1048 if (fClusterType == 0) printf("\tall calorimeter clusters are used\n");
1049 if (fClusterType == 1) printf("\tEMCAL calorimeter clusters are used\n");
1050 if (fClusterType == 2) printf("\tPHOS calorimeter clusters are used\n");
1051 if (fUseEtaCut) printf("\t%3.2f < eta_{cluster} < %3.2f\n", fMinEtaCut, fMaxEtaCut );
1052 if (fUsePhiCut) printf("\t%3.2f < phi_{cluster} < %3.2f\n", fMinPhiCut, fMaxPhiCut );
1053 if (fUseDistanceToBadChannel) printf("\tcut on exotics applied \n");
1055 printf("Cluster Quality cuts: \n");
1056 if (fUseTimeDiff) printf("\t time difference < %3.2f\n", fMaxTimeDiff );
1057 if (fUseDistTrackToCluster) printf("\tmin distance to track > %3.2f\n", fMinDistTrackToCluster );
1058 if (fUseExoticCell)printf("\t min distance to track > %3.2f\n", fMinDistTrackToCluster );
1059 if (fUseMinEnergy)printf("\t E_{cluster} > %3.2f\n", fMinEnergy );
1060 if (fUseNCells) printf("\t number of cells per cluster >= %d\n", fMinNCells );
1061 if (fUseM02) printf("\t %3.2f < M02 < %3.2f\n", fMinM02, fMaxM02 );
1062 if (fUseM20) printf("\t %3.2f < M20 < %3.2f\n", fMinM20, fMaxM20 );
1063 if (fUseDispersion) printf("\t dispersion < %3.2f\n", fMaxDispersion );
1064 if (fUseNLM) printf("\t %d < NLM < %d\n", fMinNLM, fMaxNLM );
1068 // EMCAL acceptance 2011
1069 // 1.39626, 3.125 (phi)
1070 // -0.66687,,0.66465
1073 ///________________________________________________________________________
1074 Bool_t AliCaloPhotonCuts::SetClusterTypeCut(Int_t clusterType)
1076 switch(clusterType){
1077 case 0: // all clusters
1080 case 1: // EMCAL clusters
1083 case 2: // PHOS clusters
1087 AliError(Form("ClusterTypeCut not defined %d",clusterType));
1093 //___________________________________________________________________
1094 Bool_t AliCaloPhotonCuts::SetMinEtaCut(Int_t minEta)
1098 if (!fUseEtaCut) fUseEtaCut=0;
1102 if (!fUseEtaCut) fUseEtaCut=1;
1106 if (!fUseEtaCut) fUseEtaCut=1;
1110 if (!fUseEtaCut) fUseEtaCut=1;
1114 AliError(Form("MinEta Cut not defined %d",minEta));
1121 //___________________________________________________________________
1122 Bool_t AliCaloPhotonCuts::SetMaxEtaCut(Int_t maxEta)
1126 if (!fUseEtaCut) fUseEtaCut=0;
1130 if (!fUseEtaCut) fUseEtaCut=1;
1134 if (!fUseEtaCut) fUseEtaCut=1;
1138 if (!fUseEtaCut) fUseEtaCut=1;
1142 AliError(Form("MaxEta Cut not defined %d",maxEta));
1148 //___________________________________________________________________
1149 Bool_t AliCaloPhotonCuts::SetMinPhiCut(Int_t minPhi)
1153 if (!fUsePhiCut) fUsePhiCut=0;
1157 if (!fUsePhiCut) fUsePhiCut=1;
1161 AliError(Form("MinPhi Cut not defined %d",minPhi));
1167 //___________________________________________________________________
1168 Bool_t AliCaloPhotonCuts::SetMaxPhiCut(Int_t maxPhi)
1172 if (!fUsePhiCut) fUsePhiCut=0;
1176 if (!fUsePhiCut) fUsePhiCut=1;
1180 AliError(Form("Max Phi Cut not defined %d",maxPhi));
1186 //___________________________________________________________________
1187 Bool_t AliCaloPhotonCuts::SetDistanceToBadChannelCut(Int_t distanceToBadChannel)
1189 switch(distanceToBadChannel){
1191 fUseDistanceToBadChannel=0;
1192 fMinDistanceToBadChannel=0;
1195 if (!fUseDistanceToBadChannel) fUseDistanceToBadChannel=1;
1196 fMinDistanceToBadChannel=5;
1199 AliError(Form("minimum distance to bad channel Cut not defined %d",distanceToBadChannel));
1205 //___________________________________________________________________
1206 Bool_t AliCaloPhotonCuts::SetTimingCut(Int_t timing)
1214 if (!fUseTimeDiff) fUseTimeDiff=1;
1215 fMaxTimeDiff=10e-7; //1000ns
1218 if (!fUseTimeDiff) fUseTimeDiff=1;
1219 fMaxTimeDiff=50e-8; //500ns
1222 if (!fUseTimeDiff) fUseTimeDiff=1;
1223 fMaxTimeDiff=20e-8; //200ns
1226 if (!fUseTimeDiff) fUseTimeDiff=1;
1227 fMaxTimeDiff=10e-8; //100ns
1230 if (!fUseTimeDiff) fUseTimeDiff=1;
1231 fMaxTimeDiff=50e-9; //50ns
1235 AliError(Form("Timing Cut not defined %d",timing));
1241 //___________________________________________________________________
1242 Bool_t AliCaloPhotonCuts::SetTrackMatchingCut(Int_t trackMatching)
1244 switch(trackMatching){
1246 fUseDistTrackToCluster=0;
1247 fMinDistTrackToCluster=0;
1250 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1251 fMinDistTrackToCluster= 0.03; //0.04;
1254 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1255 fMinDistTrackToCluster= 0.035; //0.05;
1258 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1259 fMinDistTrackToCluster= 0.04; //0.1;
1262 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1263 fMinDistTrackToCluster= 0.045; //0.13;
1266 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1267 fMinDistTrackToCluster= 0.05; //0.15
1270 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1271 fMinDistTrackToCluster= 0.055; //0.2;
1274 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1275 fMinDistTrackToCluster= 0.06; //0.3;
1278 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1279 fMinDistTrackToCluster= 0.07; //0.4;
1282 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1283 fMinDistTrackToCluster= 0.1; //0.5;
1287 AliError(Form("Track Matching Cut not defined %d",trackMatching));
1293 //___________________________________________________________________
1294 Bool_t AliCaloPhotonCuts::SetExoticCellCut(Int_t exoticCell)
1302 if (!fUseExoticCell) fUseExoticCell=1;
1306 AliError(Form("Exotic cell Cut not defined %d",exoticCell));
1312 //___________________________________________________________________
1313 Bool_t AliCaloPhotonCuts::SetMinEnergyCut(Int_t minEnergy)
1317 if (!fUseMinEnergy) fUseMinEnergy=0;
1321 if (!fUseMinEnergy) fUseMinEnergy=1;
1325 if (!fUseMinEnergy) fUseMinEnergy=1;
1329 if (!fUseMinEnergy) fUseMinEnergy=1;
1333 if (!fUseMinEnergy) fUseMinEnergy=1;
1337 if (!fUseMinEnergy) fUseMinEnergy=1;
1341 if (!fUseMinEnergy) fUseMinEnergy=1;
1345 if (!fUseMinEnergy) fUseMinEnergy=1;
1349 if (!fUseMinEnergy) fUseMinEnergy=1;
1353 if (!fUseMinEnergy) fUseMinEnergy=1;
1357 AliError(Form("Minimum Energy Cut not defined %d",minEnergy));
1363 //___________________________________________________________________
1364 Bool_t AliCaloPhotonCuts::SetMinNCellsCut(Int_t minNCells)
1368 if (!fUseNCells) fUseNCells=0;
1372 if (!fUseNCells) fUseNCells=1;
1376 if (!fUseNCells) fUseNCells=1;
1380 if (!fUseNCells) fUseNCells=1;
1384 if (!fUseNCells) fUseNCells=1;
1388 if (!fUseNCells) fUseNCells=1;
1392 if (!fUseNCells) fUseNCells=1;
1397 AliError(Form("Min N cells Cut not defined %d",minNCells));
1403 //___________________________________________________________________
1404 Bool_t AliCaloPhotonCuts::SetMaxM02(Int_t maxM02)
1408 if (!fUseM02) fUseM02=0;
1412 if (!fUseM02) fUseM02=1;
1416 if (!fUseM02) fUseM02=1;
1420 if (!fUseM02) fUseM02=1;
1424 if (!fUseM02) fUseM02=1;
1428 AliError(Form("Max M02 Cut not defined %d",maxM02));
1434 //___________________________________________________________________
1435 Bool_t AliCaloPhotonCuts::SetMinM02(Int_t minM02)
1439 if (!fUseM02) fUseM02=0;
1443 if (!fUseM02) fUseM02=1;
1447 AliError(Form("Min M02 not defined %d",minM02));
1453 //___________________________________________________________________
1454 Bool_t AliCaloPhotonCuts::SetMaxM20(Int_t maxM20)
1458 if (!fUseM20) fUseM20=0;
1462 if (!fUseM20) fUseM20=1;
1466 AliError(Form("Max M20 Cut not defined %d",maxM20));
1472 //___________________________________________________________________
1473 Bool_t AliCaloPhotonCuts::SetMinM20(Int_t minM20)
1477 if (!fUseM20) fUseM20=0;
1481 if (!fUseM20) fUseM20=1;
1485 AliError(Form("Min M20 Cut not defined %d",minM20));
1491 //___________________________________________________________________
1492 Bool_t AliCaloPhotonCuts::SetDispersion(Int_t dispersion)
1496 if (!fUseDispersion) fUseDispersion=0;
1497 fMaxDispersion =100;
1500 if (!fUseDispersion) fUseDispersion=1;
1504 AliError(Form("Maximum Dispersion Cut not defined %d",dispersion));
1510 //___________________________________________________________________
1511 Bool_t AliCaloPhotonCuts::SetNLM(Int_t nlm)
1515 if (!fUseNLM) fUseNLM=0;
1520 if (!fUseNLM) fUseNLM=1;
1525 AliError(Form("NLM Cut not defined %d",nlm));
1531 ///________________________________________________________________________
1532 TString AliCaloPhotonCuts::GetCutNumber(){
1533 // returns TString with current cut number
1535 for(Int_t ii=0;ii<kNCuts;ii++){
1536 a.Append(Form("%d",fCuts[ii]));