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(fHistClusterdEtadPhiBeforeQA) fHistClusterdEtadPhiBeforeQA->Fill(dEta, dPhi);
823 Float_t clusM02 = (Float_t)cluster->GetM02();
824 Float_t clusM20 = (Float_t)cluster->GetM20();
825 if(fExtendedMatching){
826 if(inTrack->Charge() > 0) fHistClusterdEtadPhiPosTracksBeforeQA->Fill(dEta, dPhi);
827 if(inTrack->Charge() < 0) fHistClusterdEtadPhiNegTracksBeforeQA->Fill(dEta, dPhi);
828 fHistClusterdEtadPtBeforeQA->Fill(dEta, inTrack->Pt());
829 fHistClusterdPhidPtBeforeQA->Fill(dPhi, inTrack->Pt());
830 if(abs(dPhi) > 0.05) fHistClusterM20Pt_dPhiBeforeQA->Fill(clusM20, inTrack->Pt());
831 if(abs(dPhi) > 0.05) fHistClusterM02Pt_dPhiBeforeQA->Fill(clusM02, inTrack->Pt());
832 fHistClusterM20M02BeforeQA->Fill(clusM20, clusM02);
835 if(dR2 < fMinDistTrackToCluster*fMinDistTrackToCluster){
838 if(fHistDistanceTrackToClusterAfterQA)fHistDistanceTrackToClusterAfterQA->Fill(TMath::Sqrt(dR2));
839 if(fHistClusterdEtadPhiAfterQA) fHistClusterdEtadPhiAfterQA->Fill(dEta, dPhi);
840 if(fHistClusterRAfterQA) fHistClusterRAfterQA->Fill(clusterR);
841 if(fExtendedMatching){
842 fHistClusterM20M02AfterQA->Fill(clusM20, clusM02);
853 //____________________________________________________________________________________________
856 ///________________________________________________________________________
857 Bool_t AliCaloPhotonCuts::UpdateCutString() {
858 ///Update the cut string (if it has been created yet)
860 if(fCutString && fCutString->GetString().Length() == kNCuts) {
861 fCutString->SetString(GetCutNumber());
868 ///________________________________________________________________________
869 Bool_t AliCaloPhotonCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
870 // Initialize Cuts from a given Cut string
871 AliInfo(Form("Set CaloCut Number: %s",analysisCutSelection.Data()));
872 if(analysisCutSelection.Length()!=kNCuts) {
873 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
876 if(!analysisCutSelection.IsDigit()){
877 AliError("Cut selection contains characters");
881 const char *cutSelection = analysisCutSelection.Data();
882 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
883 for(Int_t ii=0;ii<kNCuts;ii++){
887 // Set Individual Cuts
888 for(Int_t ii=0;ii<kNCuts;ii++){
889 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
891 PrintCutsWithValues();
895 ///________________________________________________________________________
896 Bool_t AliCaloPhotonCuts::SetCut(cutIds cutID, const Int_t value) {
897 ///Set individual cut ID
902 if( SetClusterTypeCut(value)) {
903 fCuts[kClusterType] = value;
906 } else return kFALSE;
909 if( SetMinEtaCut(value)) {
910 fCuts[kEtaMin] = value;
913 } else return kFALSE;
916 if( SetMaxEtaCut(value)) {
917 fCuts[kEtaMax] = value;
920 } else return kFALSE;
923 if( SetMinPhiCut(value)) {
924 fCuts[kPhiMin] = value;
927 } else return kFALSE;
930 if( SetMaxPhiCut(value)) {
931 fCuts[kPhiMax] = value;
934 } else return kFALSE;
936 case kDistanceToBadChannel:
937 if( SetDistanceToBadChannelCut(value)) {
938 fCuts[kDistanceToBadChannel] = value;
941 } else return kFALSE;
944 if( SetTimingCut(value)) {
945 fCuts[kTiming] = value;
948 } else return kFALSE;
951 if( SetTrackMatchingCut(value)) {
952 fCuts[kTrackMatching] = value;
955 } else return kFALSE;
958 if( SetExoticCellCut(value)) {
959 fCuts[kExoticCell] = value;
962 } else return kFALSE;
965 if( SetMinEnergyCut(value)) {
966 fCuts[kMinEnery] = value;
969 } else return kFALSE;
972 if( SetMinNCellsCut(value)) {
973 fCuts[kNMinCells] = value;
976 } else return kFALSE;
979 if( SetMinM02(value)) {
980 fCuts[kMinM02] = value;
983 } else return kFALSE;
986 if( SetMaxM02(value)) {
987 fCuts[kMaxM02] = value;
990 } else return kFALSE;
993 if( SetMinM20(value)) {
994 fCuts[kMinM20] = value;
997 } else return kFALSE;
1000 if( SetMaxM20(value)) {
1001 fCuts[kMaxM20] = value;
1004 } else return kFALSE;
1007 if( SetDispersion(value)) {
1008 fCuts[kDispersion] = value;
1011 } else return kFALSE;
1014 if( SetNLM(value)) {
1015 fCuts[kNLM] = value;
1018 } else return kFALSE;
1021 AliError("Cut id out of range");
1025 AliError("Cut id %d not recognized");
1030 ///________________________________________________________________________
1031 void AliCaloPhotonCuts::PrintCuts() {
1032 // Print out current Cut Selection
1033 for(Int_t ic = 0; ic < kNCuts; ic++) {
1034 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1038 void AliCaloPhotonCuts::PrintCutsWithValues() {
1039 // Print out current Cut Selection with value
1040 printf("\nCluster cutnumber \n");
1041 for(Int_t ic = 0; ic < kNCuts; ic++) {
1042 printf("%d",fCuts[ic]);
1046 printf("Acceptance cuts: \n");
1047 if (fClusterType == 0) printf("\tall calorimeter clusters are used\n");
1048 if (fClusterType == 1) printf("\tEMCAL calorimeter clusters are used\n");
1049 if (fClusterType == 2) printf("\tPHOS calorimeter clusters are used\n");
1050 if (fUseEtaCut) printf("\t%3.2f < eta_{cluster} < %3.2f\n", fMinEtaCut, fMaxEtaCut );
1051 if (fUsePhiCut) printf("\t%3.2f < phi_{cluster} < %3.2f\n", fMinPhiCut, fMaxPhiCut );
1052 if (fUseDistanceToBadChannel) printf("\tcut on exotics applied \n");
1054 printf("Cluster Quality cuts: \n");
1055 if (fUseTimeDiff) printf("\t time difference < %3.2f\n", fMaxTimeDiff );
1056 if (fUseDistTrackToCluster) printf("\tmin distance to track > %3.2f\n", fMinDistTrackToCluster );
1057 if (fUseExoticCell)printf("\t min distance to track > %3.2f\n", fMinDistTrackToCluster );
1058 if (fUseMinEnergy)printf("\t E_{cluster} > %3.2f\n", fMinEnergy );
1059 if (fUseNCells) printf("\t number of cells per cluster >= %d\n", fMinNCells );
1060 if (fUseM02) printf("\t %3.2f < M02 < %3.2f\n", fMinM02, fMaxM02 );
1061 if (fUseM20) printf("\t %3.2f < M20 < %3.2f\n", fMinM20, fMaxM20 );
1062 if (fUseDispersion) printf("\t dispersion < %3.2f\n", fMaxDispersion );
1063 if (fUseNLM) printf("\t %d < NLM < %d\n", fMinNLM, fMaxNLM );
1067 // EMCAL acceptance 2011
1068 // 1.39626, 3.125 (phi)
1069 // -0.66687,,0.66465
1072 ///________________________________________________________________________
1073 Bool_t AliCaloPhotonCuts::SetClusterTypeCut(Int_t clusterType)
1075 switch(clusterType){
1076 case 0: // all clusters
1079 case 1: // EMCAL clusters
1082 case 2: // PHOS clusters
1086 AliError(Form("ClusterTypeCut not defined %d",clusterType));
1092 //___________________________________________________________________
1093 Bool_t AliCaloPhotonCuts::SetMinEtaCut(Int_t minEta)
1097 if (!fUseEtaCut) fUseEtaCut=0;
1101 if (!fUseEtaCut) fUseEtaCut=1;
1105 if (!fUseEtaCut) fUseEtaCut=1;
1109 if (!fUseEtaCut) fUseEtaCut=1;
1113 AliError(Form("MinEta Cut not defined %d",minEta));
1120 //___________________________________________________________________
1121 Bool_t AliCaloPhotonCuts::SetMaxEtaCut(Int_t maxEta)
1125 if (!fUseEtaCut) fUseEtaCut=0;
1129 if (!fUseEtaCut) fUseEtaCut=1;
1133 if (!fUseEtaCut) fUseEtaCut=1;
1137 if (!fUseEtaCut) fUseEtaCut=1;
1141 AliError(Form("MaxEta Cut not defined %d",maxEta));
1147 //___________________________________________________________________
1148 Bool_t AliCaloPhotonCuts::SetMinPhiCut(Int_t minPhi)
1152 if (!fUsePhiCut) fUsePhiCut=0;
1156 if (!fUsePhiCut) fUsePhiCut=1;
1160 AliError(Form("MinPhi Cut not defined %d",minPhi));
1166 //___________________________________________________________________
1167 Bool_t AliCaloPhotonCuts::SetMaxPhiCut(Int_t maxPhi)
1171 if (!fUsePhiCut) fUsePhiCut=0;
1175 if (!fUsePhiCut) fUsePhiCut=1;
1179 AliError(Form("Max Phi Cut not defined %d",maxPhi));
1185 //___________________________________________________________________
1186 Bool_t AliCaloPhotonCuts::SetDistanceToBadChannelCut(Int_t distanceToBadChannel)
1188 switch(distanceToBadChannel){
1190 fUseDistanceToBadChannel=0;
1191 fMinDistanceToBadChannel=0;
1194 if (!fUseDistanceToBadChannel) fUseDistanceToBadChannel=1;
1195 fMinDistanceToBadChannel=5;
1198 AliError(Form("minimum distance to bad channel Cut not defined %d",distanceToBadChannel));
1204 //___________________________________________________________________
1205 Bool_t AliCaloPhotonCuts::SetTimingCut(Int_t timing)
1213 if (!fUseTimeDiff) fUseTimeDiff=1;
1214 fMaxTimeDiff=10e-7; //1000ns
1217 if (!fUseTimeDiff) fUseTimeDiff=1;
1218 fMaxTimeDiff=50e-8; //500ns
1221 if (!fUseTimeDiff) fUseTimeDiff=1;
1222 fMaxTimeDiff=20e-8; //200ns
1225 if (!fUseTimeDiff) fUseTimeDiff=1;
1226 fMaxTimeDiff=10e-8; //100ns
1229 if (!fUseTimeDiff) fUseTimeDiff=1;
1230 fMaxTimeDiff=50e-9; //50ns
1234 AliError(Form("Timing Cut not defined %d",timing));
1240 //___________________________________________________________________
1241 Bool_t AliCaloPhotonCuts::SetTrackMatchingCut(Int_t trackMatching)
1243 switch(trackMatching){
1245 fUseDistTrackToCluster=0;
1246 fMinDistTrackToCluster=0;
1249 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1250 fMinDistTrackToCluster= 0.03; //0.04;
1253 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1254 fMinDistTrackToCluster= 0.035; //0.05;
1257 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1258 fMinDistTrackToCluster= 0.04; //0.1;
1261 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1262 fMinDistTrackToCluster= 0.045; //0.13;
1265 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1266 fMinDistTrackToCluster= 0.05; //0.15
1269 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1270 fMinDistTrackToCluster= 0.055; //0.2;
1273 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1274 fMinDistTrackToCluster= 0.06; //0.3;
1277 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1278 fMinDistTrackToCluster= 0.07; //0.4;
1281 if (!fUseDistTrackToCluster) fUseDistTrackToCluster=1;
1282 fMinDistTrackToCluster= 0.1; //0.5;
1286 AliError(Form("Track Matching Cut not defined %d",trackMatching));
1292 //___________________________________________________________________
1293 Bool_t AliCaloPhotonCuts::SetExoticCellCut(Int_t exoticCell)
1301 if (!fUseExoticCell) fUseExoticCell=1;
1305 AliError(Form("Exotic cell Cut not defined %d",exoticCell));
1311 //___________________________________________________________________
1312 Bool_t AliCaloPhotonCuts::SetMinEnergyCut(Int_t minEnergy)
1316 if (!fUseMinEnergy) fUseMinEnergy=0;
1320 if (!fUseMinEnergy) fUseMinEnergy=1;
1324 if (!fUseMinEnergy) fUseMinEnergy=1;
1328 if (!fUseMinEnergy) fUseMinEnergy=1;
1332 if (!fUseMinEnergy) fUseMinEnergy=1;
1336 if (!fUseMinEnergy) fUseMinEnergy=1;
1340 if (!fUseMinEnergy) fUseMinEnergy=1;
1344 if (!fUseMinEnergy) fUseMinEnergy=1;
1348 if (!fUseMinEnergy) fUseMinEnergy=1;
1352 if (!fUseMinEnergy) fUseMinEnergy=1;
1356 AliError(Form("Minimum Energy Cut not defined %d",minEnergy));
1362 //___________________________________________________________________
1363 Bool_t AliCaloPhotonCuts::SetMinNCellsCut(Int_t minNCells)
1367 if (!fUseNCells) fUseNCells=0;
1371 if (!fUseNCells) fUseNCells=1;
1375 if (!fUseNCells) fUseNCells=1;
1379 if (!fUseNCells) fUseNCells=1;
1383 if (!fUseNCells) fUseNCells=1;
1387 if (!fUseNCells) fUseNCells=1;
1391 if (!fUseNCells) fUseNCells=1;
1396 AliError(Form("Min N cells Cut not defined %d",minNCells));
1402 //___________________________________________________________________
1403 Bool_t AliCaloPhotonCuts::SetMaxM02(Int_t maxM02)
1407 if (!fUseM02) fUseM02=0;
1411 if (!fUseM02) fUseM02=1;
1415 if (!fUseM02) fUseM02=1;
1419 if (!fUseM02) fUseM02=1;
1423 if (!fUseM02) fUseM02=1;
1427 AliError(Form("Max M02 Cut not defined %d",maxM02));
1433 //___________________________________________________________________
1434 Bool_t AliCaloPhotonCuts::SetMinM02(Int_t minM02)
1438 if (!fUseM02) fUseM02=0;
1442 if (!fUseM02) fUseM02=1;
1446 AliError(Form("Min M02 not defined %d",minM02));
1452 //___________________________________________________________________
1453 Bool_t AliCaloPhotonCuts::SetMaxM20(Int_t maxM20)
1457 if (!fUseM20) fUseM20=0;
1461 if (!fUseM20) fUseM20=1;
1465 AliError(Form("Max M20 Cut not defined %d",maxM20));
1471 //___________________________________________________________________
1472 Bool_t AliCaloPhotonCuts::SetMinM20(Int_t minM20)
1476 if (!fUseM20) fUseM20=0;
1480 if (!fUseM20) fUseM20=1;
1484 AliError(Form("Min M20 Cut not defined %d",minM20));
1490 //___________________________________________________________________
1491 Bool_t AliCaloPhotonCuts::SetDispersion(Int_t dispersion)
1495 if (!fUseDispersion) fUseDispersion=0;
1496 fMaxDispersion =100;
1499 if (!fUseDispersion) fUseDispersion=1;
1503 AliError(Form("Maximum Dispersion Cut not defined %d",dispersion));
1509 //___________________________________________________________________
1510 Bool_t AliCaloPhotonCuts::SetNLM(Int_t nlm)
1514 if (!fUseNLM) fUseNLM=0;
1519 if (!fUseNLM) fUseNLM=1;
1524 AliError(Form("NLM Cut not defined %d",nlm));
1530 ///________________________________________________________________________
1531 TString AliCaloPhotonCuts::GetCutNumber(){
1532 // returns TString with current cut number
1534 for(Int_t ii=0;ii<kNCuts;ii++){
1535 a.Append(Form("%d",fCuts[ii]));