]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrDep/AliAnaPhoton.cxx
Update
[u/mrichter/AliRoot.git] / PWG4 / PartCorrDep / AliAnaPhoton.cxx
CommitLineData
a3aebfff 1 /**************************************************************************
1c5acb87 2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes hereby granted *
cadbb0f3 9 * without fee, provided that the above copyright notice appears in all *
1c5acb87 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/* $Id: AliAnaPhoton.cxx 28688 2008-09-11 15:04:07Z gconesab $ */
16
17//_________________________________________________________________________
18//
19// Class for the photon identification.
20// Clusters from calorimeters are identified as photons
21// and kept in the AOD. Few histograms produced.
6175da48 22// Produces input for other analysis classes like AliAnaPi0,
23// AliAnaParticleHadronCorrelation ...
1c5acb87 24//
25// -- Author: Gustavo Conesa (LNF-INFN)
26//////////////////////////////////////////////////////////////////////////////
27
28
29// --- ROOT system ---
30#include <TH2F.h>
2244659d 31#include <TH3D.h>
477d6cee 32#include <TClonesArray.h>
0c1383b5 33#include <TObjString.h>
477d6cee 34//#include <Riostream.h>
123fc3bd 35#include "TParticle.h"
6175da48 36#include "TDatabasePDG.h"
1c5acb87 37
38// --- Analysis system ---
39#include "AliAnaPhoton.h"
40#include "AliCaloTrackReader.h"
123fc3bd 41#include "AliStack.h"
1c5acb87 42#include "AliCaloPID.h"
6639984f 43#include "AliMCAnalysisUtils.h"
ff45398a 44#include "AliFiducialCut.h"
0ae57829 45#include "AliVCluster.h"
591cc579 46#include "AliAODMCParticle.h"
c8fe2783 47#include "AliMixedEvent.h"
48
1c5acb87 49
50ClassImp(AliAnaPhoton)
51
52//____________________________________________________________________________
521636d2 53AliAnaPhoton::AliAnaPhoton() :
54 AliAnaPartCorrBaseClass(), fCalorimeter(""),
55 fMinDist(0.), fMinDist2(0.), fMinDist3(0.),
56 fRejectTrackMatch(0), fTimeCutMin(-1), fTimeCutMax(999999),
f66d95af 57 fNCellsCut(0), fFillSSHistograms(kFALSE),
58 fNOriginHistograms(8), fNPrimaryHistograms(4),
521636d2 59 fCheckConversion(kFALSE), fRemoveConvertedPair(kFALSE),
60 fAddConvertedPairsToAOD(kFALSE),
61 fMassCut(0), fConvAsymCut(1.), fConvDEtaCut(2.),
62 fConvDPhiMinCut(-1.), fConvDPhiMaxCut(7.),
63
c4a7d28a 64 // Histograms
f66d95af 65 fhNCellsE(0), fhMaxCellDiffClusterE(0),
66 fhEPhoton(0), fhPtPhoton(0),
521636d2 67 fhPhiPhoton(0), fhEtaPhoton(0),
68 fhEtaPhiPhoton(0), fhEtaPhi05Photon(0),
69
c4a7d28a 70 // Conversion histograms
521636d2 71 fhPtPhotonConv(0), fhEtaPhiPhotonConv(0), fhEtaPhi05PhotonConv(0),
72 fhConvDeltaEta(0), fhConvDeltaPhi(0), fhConvDeltaEtaPhi(0),
73 fhConvAsym(0), fhConvPt(0),
74 fhConvDistEta(0), fhConvDistEn(0), fhConvDistMass(0),
75 fhConvDistEtaCutEta(0), fhConvDistEnCutEta(0), fhConvDistMassCutEta(0),
76 fhConvDistEtaCutMass(0), fhConvDistEnCutMass(0),
77 fhConvDistEtaCutAsy(0), fhConvDistEnCutAsy(0),
78
4c8f7c2e 79 // Shower shape histograms
521636d2 80 fhDispE(0), fhLam0E(0), fhLam1E(0),
521636d2 81 fhDispETRD(0), fhLam0ETRD(0), fhLam1ETRD(0),
521636d2 82
83 fhNCellsLam0LowE(0), fhNCellsLam1LowE(0), fhNCellsDispLowE(0),
84 fhNCellsLam0HighE(0), fhNCellsLam1HighE(0), fhNCellsDispHighE(0),
521636d2 85
86 fhEtaLam0LowE(0), fhPhiLam0LowE(0),
87 fhEtaLam0HighE(0), fhPhiLam0HighE(0),
88 fhLam0DispLowE(0), fhLam0DispHighE(0),
89 fhLam1Lam0LowE(0), fhLam1Lam0HighE(0),
90 fhDispLam1LowE(0), fhDispLam1HighE(0),
521636d2 91
4c8f7c2e 92 // MC histograms
521636d2 93 // Conversion MC histograms
94 fhPtConversionTagged(0), fhPtAntiNeutronTagged(0),
95 fhPtAntiProtonTagged(0), fhPtUnknownTagged(0),
96 fhEtaPhiConversion(0), fhEtaPhi05Conversion(0),
97
98 fhConvDeltaEtaMCConversion(0), fhConvDeltaPhiMCConversion(0), fhConvDeltaEtaPhiMCConversion(0),
99 fhConvAsymMCConversion(0), fhConvPtMCConversion(0),
100 fhConvDispersionMCConversion(0), fhConvM02MCConversion(0),
101
102 fhConvDeltaEtaMCAntiNeutron(0), fhConvDeltaPhiMCAntiNeutron(0), fhConvDeltaEtaPhiMCAntiNeutron(0),
103 fhConvAsymMCAntiNeutron(0), fhConvPtMCAntiNeutron(0),
104 fhConvDispersionMCAntiNeutron(0), fhConvM02MCAntiNeutron(0),
105 fhConvDeltaEtaMCAntiProton(0), fhConvDeltaPhiMCAntiProton(0), fhConvDeltaEtaPhiMCAntiProton(0),
106 fhConvAsymMCAntiProton(0), fhConvPtMCAntiProton(0),
107 fhConvDispersionMCAntiProton(0), fhConvM02MCAntiProton(0),
108 fhConvDeltaEtaMCString(0), fhConvDeltaPhiMCString(0), fhConvDeltaEtaPhiMCString(0),
109 fhConvAsymMCString(0), fhConvPtMCString(0),
110 fhConvDispersionMCString(0), fhConvM02MCString(0),
3d5d5078 111 fhConvDistMCConversion(0), fhConvDistMCConversionCuts(0),
112
113 // Photon SS MC histograms
114 fhMCPhotonELambda0NoOverlap(0), fhMCPhotonELambda0TwoOverlap(0), fhMCPhotonELambda0NOverlap(0),
3d5d5078 115
116 //Embedding
7c65ad18 117 fhEmbeddedSignalFractionEnergy(0),
118 fhEmbedPhotonELambda0FullSignal(0), fhEmbedPhotonELambda0MostlySignal(0),
119 fhEmbedPhotonELambda0MostlyBkg(0), fhEmbedPhotonELambda0FullBkg(0),
120 fhEmbedPi0ELambda0FullSignal(0), fhEmbedPi0ELambda0MostlySignal(0),
121 fhEmbedPi0ELambda0MostlyBkg(0), fhEmbedPi0ELambda0FullBkg(0)
1c5acb87 122{
123 //default ctor
124
f66d95af 125 for(Int_t i = 0; i < 14; i++){
4c8f7c2e 126 fhMCPt [i] = 0;
127 fhMCE [i] = 0;
128 fhMCPhi [i] = 0;
129 fhMCEta [i] = 0;
130 fhMCDeltaE [i] = 0;
131 fhMCDeltaPt[i] = 0;
132 fhMCRatioE [i] = 0;
133 fhMCRatioPt[i] = 0;
134 fhMC2E [i] = 0;
135 fhMC2Pt [i] = 0;
136
521636d2 137 }
138
3d5d5078 139 for(Int_t i = 0; i < 7; i++){
140 fhPtPrimMC [i] = 0;
141 fhEPrimMC [i] = 0;
142 fhPhiPrimMC[i] = 0;
143 fhYPrimMC [i] = 0;
144
145 fhPtPrimMCAcc [i] = 0;
146 fhEPrimMCAcc [i] = 0;
147 fhPhiPrimMCAcc[i] = 0;
148 fhYPrimMCAcc [i] = 0;
149 }
150
151 for(Int_t i = 0; i < 6; i++){
f66d95af 152 fhMCELambda0 [i] = 0;
153 fhMCELambda1 [i] = 0;
154 fhMCEDispersion [i] = 0;
f66d95af 155 fhMCNCellsE [i] = 0;
156 fhMCMaxCellDiffClusterE[i] = 0;
157 fhMCLambda0vsClusterMaxCellDiffE0[i] = 0;
158 fhMCLambda0vsClusterMaxCellDiffE2[i] = 0;
159 fhMCLambda0vsClusterMaxCellDiffE6[i] = 0;
160 fhMCNCellsvsClusterMaxCellDiffE0 [i] = 0;
161 fhMCNCellsvsClusterMaxCellDiffE2 [i] = 0;
162 fhMCNCellsvsClusterMaxCellDiffE6 [i] = 0;
521636d2 163 }
164
1c5acb87 165 //Initialize parameters
166 InitParameters();
167
5ae09196 168}//____________________________________________________________________________
1c5acb87 169AliAnaPhoton::~AliAnaPhoton()
170{
171 //dtor
172
173}
174
c4a7d28a 175//__________________________________________________________________
176Bool_t AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom)
177{
178 //Select clusters if they pass different cuts
179 if(GetDebug() > 2)
180 printf("AliAnaPhoton::ClusterSelected() Current Event %d; Before selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f\n",
181 GetReader()->GetEventNumber(),
182 mom.E(), mom.Pt(),calo->E(),mom.Phi()*TMath::RadToDeg(),mom.Eta());
183
184 //.......................................
185 //If too small or big energy, skip it
186 if(mom.E() < GetMinEnergy() || mom.E() > GetMaxEnergy() ) return kFALSE ;
187 if(GetDebug() > 2) printf("\t Cluster %d Pass E Cut \n",calo->GetID());
188
189 //.......................................
190 // TOF cut, BE CAREFUL WITH THIS CUT
191 Double_t tof = calo->GetTOF()*1e9;
192 if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
193 if(GetDebug() > 2) printf("\t Cluster %d Pass Time Cut \n",calo->GetID());
194
195 //.......................................
196 if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
197 if(GetDebug() > 2) printf("\t Cluster %d Pass NCell Cut \n",calo->GetID());
198
199 //.......................................
200 //Check acceptance selection
201 if(IsFiducialCutOn()){
202 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
203 if(! in ) return kFALSE ;
204 }
205 if(GetDebug() > 2) printf("Fiducial cut passed \n");
206
207 //.......................................
208 //Skip matched clusters with tracks
209 if(fRejectTrackMatch){
210 if(IsTrackMatched(calo)) {
211 if(GetDebug() > 2) printf("\t Reject track-matched clusters\n");
212 return kFALSE ;
213 }
214 else
215 if(GetDebug() > 2) printf(" Track-matching cut passed \n");
216 }// reject matched clusters
217
218 //.......................................
219 //Check Distance to Bad channel, set bit.
220 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
221 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
222 if(distBad < fMinDist) {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
223 return kFALSE ;
224 }
225 else if(GetDebug() > 2) printf("\t Bad channel cut passed %4.2f > %2.2f \n",distBad, fMinDist);
226 //printf("Cluster %d Pass Bad Dist Cut \n",icalo);
227
228 if(GetDebug() > 0)
229 printf("AliAnaPhoton::ClusterSelected() Current Event %d; After selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f\n",
230 GetReader()->GetEventNumber(),
231 mom.E(), mom.Pt(),calo->E(),mom.Phi()*TMath::RadToDeg(),mom.Eta());
232
233 //All checks passed, cluster selected
234 return kTRUE;
235
236}
237
3d5d5078 238//_____________________________________________________________
239void AliAnaPhoton::FillAcceptanceHistograms(){
240 //Fill acceptance histograms if MC data is available
241
242 if(GetReader()->ReadStack()){
243 AliStack * stack = GetMCStack();
244 if(stack){
245 for(Int_t i=0 ; i<stack->GetNtrack(); i++){
246 TParticle * prim = stack->Particle(i) ;
247 Int_t pdg = prim->GetPdgCode();
248 //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
249 // prim->GetName(), prim->GetPdgCode());
250
251 if(pdg == 22){
252
253 // Get tag of this particle photon from fragmentation, decay, prompt ...
254 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader(), 0);
255 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton)){
256 //A conversion photon from a hadron, skip this kind of photon
257 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!: tag %d, conv %d, pi0 %d, hadron %d, electron %d, unk %d, muon %d,pion %d, proton %d, neutron %d, kaon %d, antiproton %d, antineutron %d\n",tag,
258 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion),
259 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0),
260 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOther),
261 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron),
262 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCUnknown),
263 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCMuon),
264 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPion),
265 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCProton),
266 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron),
267 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCKaon),
268 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton),
269 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron));
270
271 return;
272 }
273
274 //Get photon kinematics
275 if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
276
277 Double_t photonY = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
278 Double_t photonE = prim->Energy() ;
279 Double_t photonPt = prim->Pt() ;
280 Double_t photonPhi = TMath::RadToDeg()*prim->Phi() ;
281 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
282 Double_t photonEta = prim->Eta() ;
283
284
285 //Check if photons hit the Calorimeter
286 TLorentzVector lv;
287 prim->Momentum(lv);
288 Bool_t inacceptance = kFALSE;
289 if (fCalorimeter == "PHOS"){
290 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet()){
291 Int_t mod ;
292 Double_t x,z ;
293 if(GetPHOSGeometry()->ImpactOnEmc(prim,mod,z,x))
294 inacceptance = kTRUE;
295 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
296 }
297 else{
298 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
299 inacceptance = kTRUE ;
300 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
301 }
302 }
303 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
304 if(GetEMCALGeometry()){
305
306 Int_t absID=0;
307
308 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
309
310 if( absID >= 0)
311 inacceptance = kTRUE;
312
313 // if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
314 // inacceptance = kTRUE;
315 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
316 }
317 else{
318 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
319 inacceptance = kTRUE ;
320 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
321 }
322 } //In EMCAL
323
324 //Fill histograms
325
f66d95af 326 fhYPrimMC[mcPPhoton]->Fill(photonPt, photonY) ;
3d5d5078 327 if(TMath::Abs(photonY) < 1.0)
328 {
f66d95af 329 fhEPrimMC [mcPPhoton]->Fill(photonE ) ;
330 fhPtPrimMC [mcPPhoton]->Fill(photonPt) ;
331 fhPhiPrimMC[mcPPhoton]->Fill(photonE , photonPhi) ;
332 fhYPrimMC[mcPPhoton] ->Fill(photonE , photonEta) ;
3d5d5078 333 }
334 if(inacceptance){
f66d95af 335 fhEPrimMCAcc[mcPPhoton] ->Fill(photonE ) ;
336 fhPtPrimMCAcc[mcPPhoton] ->Fill(photonPt) ;
337 fhPhiPrimMCAcc[mcPPhoton]->Fill(photonE , photonPhi) ;
338 fhYPrimMCAcc[mcPPhoton] ->Fill(photonE , photonY) ;
3d5d5078 339 }//Accepted
340
341 //Origin of photon
f66d95af 342 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[mcPPrompt])
3d5d5078 343 {
f66d95af 344 fhYPrimMC[mcPPrompt]->Fill(photonPt, photonY) ;
3d5d5078 345 if(TMath::Abs(photonY) < 1.0){
f66d95af 346 fhEPrimMC [mcPPrompt]->Fill(photonE ) ;
347 fhPtPrimMC [mcPPrompt]->Fill(photonPt) ;
348 fhPhiPrimMC[mcPPrompt]->Fill(photonE , photonPhi) ;
349 fhYPrimMC[mcPPrompt] ->Fill(photonE , photonEta) ;
3d5d5078 350 }
351 if(inacceptance){
f66d95af 352 fhEPrimMCAcc[mcPPrompt] ->Fill(photonE ) ;
353 fhPtPrimMCAcc[mcPPrompt] ->Fill(photonPt) ;
354 fhPhiPrimMCAcc[mcPPrompt]->Fill(photonE , photonPhi) ;
355 fhYPrimMCAcc[mcPPrompt] ->Fill(photonE , photonY) ;
3d5d5078 356 }//Accepted
357 }
f66d95af 358 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[mcPFragmentation])
3d5d5078 359 {
f66d95af 360 fhYPrimMC[mcPFragmentation]->Fill(photonPt, photonY) ;
3d5d5078 361 if(TMath::Abs(photonY) < 1.0){
f66d95af 362 fhEPrimMC [mcPFragmentation]->Fill(photonE ) ;
363 fhPtPrimMC [mcPFragmentation]->Fill(photonPt) ;
364 fhPhiPrimMC[mcPFragmentation]->Fill(photonE , photonPhi) ;
365 fhYPrimMC[mcPFragmentation] ->Fill(photonE , photonEta) ;
3d5d5078 366 }
367 if(inacceptance){
f66d95af 368 fhEPrimMCAcc[mcPFragmentation] ->Fill(photonE ) ;
369 fhPtPrimMCAcc[mcPFragmentation] ->Fill(photonPt) ;
370 fhPhiPrimMCAcc[mcPFragmentation]->Fill(photonE , photonPhi) ;
371 fhYPrimMCAcc[mcPFragmentation] ->Fill(photonE , photonY) ;
3d5d5078 372 }//Accepted
373 }
f66d95af 374 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[mcPISR])
3d5d5078 375 {
f66d95af 376 fhYPrimMC[mcPISR]->Fill(photonPt, photonY) ;
3d5d5078 377 if(TMath::Abs(photonY) < 1.0){
f66d95af 378 fhEPrimMC [mcPISR]->Fill(photonE ) ;
379 fhPtPrimMC [mcPISR]->Fill(photonPt) ;
380 fhPhiPrimMC[mcPISR]->Fill(photonE , photonPhi) ;
381 fhYPrimMC[mcPISR]->Fill(photonE , photonEta) ;
3d5d5078 382 }
383 if(inacceptance){
f66d95af 384 fhEPrimMCAcc[mcPISR] ->Fill(photonE ) ;
385 fhPtPrimMCAcc[mcPISR] ->Fill(photonPt) ;
386 fhPhiPrimMCAcc[mcPISR]->Fill(photonE , photonPhi) ;
387 fhYPrimMCAcc[mcPISR] ->Fill(photonE , photonY) ;
3d5d5078 388 }//Accepted
389 }
f66d95af 390 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[mcPPi0Decay])
3d5d5078 391 {
f66d95af 392 fhYPrimMC[mcPPi0Decay]->Fill(photonPt, photonY) ;
3d5d5078 393 if(TMath::Abs(photonY) < 1.0){
f66d95af 394 fhEPrimMC [mcPPi0Decay]->Fill(photonE ) ;
395 fhPtPrimMC [mcPPi0Decay]->Fill(photonPt) ;
396 fhPhiPrimMC[mcPPi0Decay]->Fill(photonE , photonPhi) ;
397 fhYPrimMC[mcPPi0Decay] ->Fill(photonE , photonEta) ;
3d5d5078 398 }
399 if(inacceptance){
f66d95af 400 fhEPrimMCAcc[mcPPi0Decay] ->Fill(photonE ) ;
401 fhPtPrimMCAcc[mcPPi0Decay] ->Fill(photonPt) ;
402 fhPhiPrimMCAcc[mcPPi0Decay]->Fill(photonE , photonPhi) ;
403 fhYPrimMCAcc[mcPPi0Decay] ->Fill(photonE , photonY) ;
3d5d5078 404 }//Accepted
405 }
406 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
f66d95af 407 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) && fhEPrimMC[mcPOtherDecay])
3d5d5078 408 {
f66d95af 409 fhYPrimMC[mcPOtherDecay]->Fill(photonPt, photonY) ;
3d5d5078 410 if(TMath::Abs(photonY) < 1.0){
f66d95af 411 fhEPrimMC [mcPOtherDecay]->Fill(photonE ) ;
412 fhPtPrimMC [mcPOtherDecay]->Fill(photonPt) ;
413 fhPhiPrimMC[mcPOtherDecay]->Fill(photonE , photonPhi) ;
414 fhYPrimMC[mcPOtherDecay] ->Fill(photonE , photonEta) ;
3d5d5078 415 }
416 if(inacceptance){
f66d95af 417 fhEPrimMCAcc[mcPOtherDecay] ->Fill(photonE ) ;
418 fhPtPrimMCAcc[mcPOtherDecay] ->Fill(photonPt) ;
419 fhPhiPrimMCAcc[mcPOtherDecay]->Fill(photonE , photonPhi) ;
420 fhYPrimMCAcc[mcPOtherDecay] ->Fill(photonE , photonY) ;
3d5d5078 421 }//Accepted
422 }
f66d95af 423 else if(fhEPrimMC[mcPOther])
3d5d5078 424 {
f66d95af 425 fhYPrimMC[mcPOther]->Fill(photonPt, photonY) ;
3d5d5078 426 if(TMath::Abs(photonY) < 1.0){
f66d95af 427 fhEPrimMC [mcPOther]->Fill(photonE ) ;
428 fhPtPrimMC [mcPOther]->Fill(photonPt) ;
429 fhPhiPrimMC[mcPOther]->Fill(photonE , photonPhi) ;
430 fhYPrimMC[mcPOther] ->Fill(photonE , photonEta) ;
3d5d5078 431 }
432 if(inacceptance){
f66d95af 433 fhEPrimMCAcc[mcPOther] ->Fill(photonE ) ;
434 fhPtPrimMCAcc[mcPOther] ->Fill(photonPt) ;
435 fhPhiPrimMCAcc[mcPOther]->Fill(photonE , photonPhi) ;
436 fhYPrimMCAcc[mcPOther] ->Fill(photonE , photonY) ;
3d5d5078 437 }//Accepted
438 }//Other origin
439 }// Primary photon
440 }//loop on primaries
441 }//stack exists and data is MC
442 }//read stack
443 else if(GetReader()->ReadAODMCParticles()){
444 TClonesArray * mcparticles = GetReader()->GetAODMCParticles(0);
445 if(mcparticles){
446 Int_t nprim = mcparticles->GetEntriesFast();
447
448 for(Int_t i=0; i < nprim; i++)
449 {
450 AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);
451
452 Int_t pdg = prim->GetPdgCode();
453
454 if(pdg == 22){
455
456 // Get tag of this particle photon from fragmentation, decay, prompt ...
457 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader(), 0);
458 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton)){
459 //A conversion photon from a hadron, skip this kind of photon
460// printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!: tag %d, conv %d, pi0 %d, hadron %d, electron %d, unk %d, muon %d,pion %d, proton %d, neutron %d, kaon %d, antiproton %d, antineutron %d\n",tag,
461// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion),
462// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0),
463// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOther),
464// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron),
465// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCUnknown),
466// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCMuon),
467// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPion),
468// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCProton),
469// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron),
470// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCKaon),
471// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton),
472// GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron));
473
474 return;
475 }
476
477 //Get photon kinematics
478 if(prim->E() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
479
480 Double_t photonY = 0.5*TMath::Log((prim->E()-prim->Pz())/(prim->E()+prim->Pz())) ;
481 Double_t photonE = prim->E() ;
482 Double_t photonPt = prim->Pt() ;
483 Double_t photonPhi = TMath::RadToDeg()*prim->Phi() ;
484 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
485 Double_t photonEta = prim->Eta() ;
486
487 //Check if photons hit the Calorimeter
488 TLorentzVector lv;
489 lv.SetPxPyPzE(prim->Px(),prim->Py(),prim->Pz(),prim->E());
490 Bool_t inacceptance = kFALSE;
491 if (fCalorimeter == "PHOS"){
492 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet()){
493 Int_t mod ;
494 Double_t x,z ;
495 Double_t vtx[]={prim->Xv(),prim->Yv(),prim->Zv()};
496 if(GetPHOSGeometry()->ImpactOnEmc(vtx, prim->Theta(),prim->Phi(),mod,z,x))
497 inacceptance = kTRUE;
498 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
499 }
500 else{
501 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
502 inacceptance = kTRUE ;
503 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
504 }
505 }
506 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
507 if(GetEMCALGeometry()){
508
509 Int_t absID=0;
510
511 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
512
513 if( absID >= 0)
514 inacceptance = kTRUE;
515
516 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
517 }
518 else{
519 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
520 inacceptance = kTRUE ;
521 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
522 }
523 } //In EMCAL
524
525 //Fill histograms
526
f66d95af 527 fhYPrimMC[mcPPhoton]->Fill(photonPt, photonY) ;
3d5d5078 528 if(TMath::Abs(photonY) < 1.0)
529 {
f66d95af 530 fhEPrimMC [mcPPhoton]->Fill(photonE ) ;
531 fhPtPrimMC [mcPPhoton]->Fill(photonPt) ;
532 fhPhiPrimMC[mcPPhoton]->Fill(photonE , photonPhi) ;
533 fhYPrimMC[mcPPhoton]->Fill(photonE , photonEta) ;
3d5d5078 534 }
535 if(inacceptance){
f66d95af 536 fhEPrimMCAcc[mcPPhoton] ->Fill(photonE ) ;
537 fhPtPrimMCAcc[mcPPhoton] ->Fill(photonPt) ;
538 fhPhiPrimMCAcc[mcPPhoton]->Fill(photonE , photonPhi) ;
539 fhYPrimMCAcc[mcPPhoton] ->Fill(photonE , photonY) ;
3d5d5078 540 }//Accepted
541
542
543 //Origin of photon
f66d95af 544 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[mcPPrompt])
3d5d5078 545 {
f66d95af 546 fhYPrimMC[mcPPrompt]->Fill(photonPt, photonY) ;
3d5d5078 547 if(TMath::Abs(photonY) < 1.0){
f66d95af 548 fhEPrimMC [mcPPrompt]->Fill(photonE ) ;
549 fhPtPrimMC [mcPPrompt]->Fill(photonPt) ;
550 fhPhiPrimMC[mcPPrompt]->Fill(photonE , photonPhi) ;
551 fhYPrimMC[mcPPrompt]->Fill(photonE , photonEta) ;
3d5d5078 552 }
553 if(inacceptance){
f66d95af 554 fhEPrimMCAcc[mcPPrompt] ->Fill(photonE ) ;
555 fhPtPrimMCAcc[mcPPrompt] ->Fill(photonPt) ;
556 fhPhiPrimMCAcc[mcPPrompt]->Fill(photonE , photonPhi) ;
557 fhYPrimMCAcc[mcPPrompt] ->Fill(photonE , photonY) ;
3d5d5078 558 }//Accepted
559 }
f66d95af 560 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[mcPFragmentation] )
3d5d5078 561 {
f66d95af 562 fhYPrimMC[mcPFragmentation]->Fill(photonPt, photonY) ;
3d5d5078 563 if(TMath::Abs(photonY) < 1.0){
f66d95af 564 fhEPrimMC [mcPFragmentation]->Fill(photonE ) ;
565 fhPtPrimMC [mcPFragmentation]->Fill(photonPt) ;
566 fhPhiPrimMC[mcPFragmentation]->Fill(photonE , photonPhi) ;
567 fhYPrimMC[mcPFragmentation]->Fill(photonE , photonEta) ;
3d5d5078 568 }
569 if(inacceptance){
f66d95af 570 fhEPrimMCAcc[mcPFragmentation] ->Fill(photonE ) ;
571 fhPtPrimMCAcc[mcPFragmentation] ->Fill(photonPt) ;
572 fhPhiPrimMCAcc[mcPFragmentation]->Fill(photonE , photonPhi) ;
573 fhYPrimMCAcc[mcPFragmentation] ->Fill(photonE , photonY) ;
3d5d5078 574 }//Accepted
575 }
f66d95af 576 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[mcPISR])
3d5d5078 577 {
f66d95af 578 fhYPrimMC[mcPISR]->Fill(photonPt, photonY) ;
3d5d5078 579 if(TMath::Abs(photonY) < 1.0){
f66d95af 580 fhEPrimMC [mcPISR]->Fill(photonE ) ;
581 fhPtPrimMC [mcPISR]->Fill(photonPt) ;
582 fhPhiPrimMC[mcPISR]->Fill(photonE , photonPhi) ;
583 fhYPrimMC[mcPISR]->Fill(photonE , photonEta) ;
3d5d5078 584 }
585 if(inacceptance){
f66d95af 586 fhEPrimMCAcc[mcPISR] ->Fill(photonE ) ;
587 fhPtPrimMCAcc[mcPISR] ->Fill(photonPt) ;
588 fhPhiPrimMCAcc[mcPISR]->Fill(photonE , photonPhi) ;
589 fhYPrimMCAcc[mcPISR] ->Fill(photonE , photonY) ;
3d5d5078 590 }//Accepted
591 }
f66d95af 592 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[mcPPi0Decay])
3d5d5078 593 {
f66d95af 594 fhYPrimMC[mcPPi0Decay]->Fill(photonPt, photonY) ;
3d5d5078 595 if(TMath::Abs(photonY) < 1.0){
f66d95af 596 fhEPrimMC [mcPPi0Decay]->Fill(photonE ) ;
597 fhPtPrimMC [mcPPi0Decay]->Fill(photonPt) ;
598 fhPhiPrimMC[mcPPi0Decay]->Fill(photonE , photonPhi) ;
599 fhYPrimMC[mcPPi0Decay]->Fill(photonE , photonEta) ;
3d5d5078 600 }
601 if(inacceptance){
f66d95af 602 fhEPrimMCAcc[mcPPi0Decay] ->Fill(photonE ) ;
603 fhPtPrimMCAcc[mcPPi0Decay] ->Fill(photonPt) ;
604 fhPhiPrimMCAcc[mcPPi0Decay]->Fill(photonE , photonPhi) ;
605 fhYPrimMCAcc[mcPPi0Decay] ->Fill(photonE , photonY) ;
3d5d5078 606 }//Accepted
607 }
608 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
f66d95af 609 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) && fhEPrimMC[mcPOtherDecay])
3d5d5078 610 {
f66d95af 611 fhYPrimMC[mcPOtherDecay]->Fill(photonPt, photonY) ;
3d5d5078 612 if(TMath::Abs(photonY) < 1.0){
f66d95af 613 fhEPrimMC [mcPOtherDecay]->Fill(photonE ) ;
614 fhPtPrimMC [mcPOtherDecay]->Fill(photonPt) ;
615 fhPhiPrimMC[mcPOtherDecay]->Fill(photonE , photonPhi) ;
616 fhYPrimMC[mcPOtherDecay]->Fill(photonE , photonEta) ;
3d5d5078 617 }
618 if(inacceptance){
f66d95af 619 fhEPrimMCAcc[mcPOtherDecay] ->Fill(photonE ) ;
620 fhPtPrimMCAcc[mcPOtherDecay] ->Fill(photonPt) ;
621 fhPhiPrimMCAcc[mcPOtherDecay]->Fill(photonE , photonPhi) ;
622 fhYPrimMCAcc[mcPOtherDecay] ->Fill(photonE , photonY) ;
3d5d5078 623 }//Accepted
624 }
f66d95af 625 else if(fhEPrimMC[mcPOther])
3d5d5078 626 {
f66d95af 627 fhYPrimMC[mcPOther]->Fill(photonPt, photonY) ;
3d5d5078 628 if(TMath::Abs(photonY) < 1.0){
f66d95af 629 fhEPrimMC [mcPOther]->Fill(photonE ) ;
630 fhPtPrimMC [mcPOther]->Fill(photonPt) ;
631 fhPhiPrimMC[mcPOther]->Fill(photonE , photonPhi) ;
632 fhYPrimMC[mcPOther]->Fill(photonE , photonEta) ;
3d5d5078 633 }
634 if(inacceptance){
f66d95af 635 fhEPrimMCAcc[mcPOther] ->Fill(photonE ) ;
636 fhPtPrimMCAcc[mcPOther] ->Fill(photonPt) ;
637 fhPhiPrimMCAcc[mcPOther]->Fill(photonE , photonPhi) ;
638 fhYPrimMCAcc[mcPOther] ->Fill(photonE , photonY) ;
3d5d5078 639 }//Accepted
640 }//Other origin
641 }// Primary photon
642 }//loop on primaries
643
644 }//mc array exists and data is MC
645 } // read AOD MC
646}
521636d2 647
648//__________________________________________________________________
649void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, const Int_t mcTag){
650
651 //Fill cluster Shower Shape histograms
652
653 if(!fFillSSHistograms || GetMixedEvent()) return;
654
655 Float_t energy = cluster->E();
656 Int_t ncells = cluster->GetNCells();
521636d2 657 Float_t lambda0 = cluster->GetM02();
658 Float_t lambda1 = cluster->GetM20();
659 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
660
661 TLorentzVector mom;
662 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC){
663 cluster->GetMomentum(mom,GetVertex(0)) ;}//Assume that come from vertex in straight line
664 else{
665 Double_t vertex[]={0,0,0};
666 cluster->GetMomentum(mom,vertex) ;
667 }
668
669 Float_t eta = mom.Eta();
670 Float_t phi = mom.Phi();
671 if(phi < 0) phi+=TMath::TwoPi();
672
673 fhLam0E ->Fill(energy,lambda0);
674 fhLam1E ->Fill(energy,lambda1);
675 fhDispE ->Fill(energy,disp);
521636d2 676
677 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5){
678 fhLam0ETRD->Fill(energy,lambda0);
679 fhLam1ETRD->Fill(energy,lambda1);
680 fhDispETRD->Fill(energy,disp);
521636d2 681 }
682
683 if(energy < 2){
684 fhNCellsLam0LowE ->Fill(ncells,lambda0);
685 fhNCellsLam1LowE ->Fill(ncells,lambda1);
686 fhNCellsDispLowE ->Fill(ncells,disp);
521636d2 687
688 fhLam1Lam0LowE ->Fill(lambda1,lambda0);
689 fhLam0DispLowE ->Fill(lambda0,disp);
690 fhDispLam1LowE ->Fill(disp,lambda1);
691 fhEtaLam0LowE ->Fill(eta,lambda0);
692 fhPhiLam0LowE ->Fill(phi,lambda0);
693
521636d2 694 }
695 else {
696 fhNCellsLam0HighE ->Fill(ncells,lambda0);
697 fhNCellsLam1HighE ->Fill(ncells,lambda1);
698 fhNCellsDispHighE ->Fill(ncells,disp);
7c65ad18 699
521636d2 700 fhLam1Lam0HighE ->Fill(lambda1,lambda0);
701 fhLam0DispHighE ->Fill(lambda0,disp);
702 fhDispLam1HighE ->Fill(disp,lambda1);
703 fhEtaLam0HighE ->Fill(eta, lambda0);
704 fhPhiLam0HighE ->Fill(phi, lambda0);
521636d2 705 }
706
707 if(IsDataMC()){
3d5d5078 708
f66d95af 709 AliVCaloCells* cells = 0;
710 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
711 else cells = GetPHOSCells();
3d5d5078 712
713 //Fill histograms to check shape of embedded clusters
714 Float_t fraction = 0;
f66d95af 715 if(GetReader()->IsEmbeddedClusterSelectionOn()){//Only working for EMCAL
716
3d5d5078 717 Float_t clusterE = 0; // recalculate in case corrections applied.
718 Float_t cellE = 0;
719 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++){
720 cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
721 clusterE+=cellE;
722 fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
723 }
724
725 //Fraction of total energy due to the embedded signal
726 fraction/=clusterE;
727
728 if(GetDebug() > 1 ) printf("AliAnaPhoton::FillShowerShapeHistogram() - Energy fraction of embedded signal %2.3f, Energy %2.3f\n",fraction, clusterE);
729
730 fhEmbeddedSignalFractionEnergy->Fill(clusterE,fraction);
731
732 } // embedded fraction
733
f66d95af 734 // Get the fraction of the cluster energy that carries the cell with highest energy
735 Int_t absID =-1 ;
736 Float_t maxCellFraction = 0.;
737
738 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
739
740 // Check the origin and fill histograms
521636d2 741 if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
3d5d5078 742 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
743 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
744 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta)){
745 fhMCELambda0[mcssPhoton] ->Fill(energy, lambda0);
3d5d5078 746 fhMCELambda1[mcssPhoton] ->Fill(energy, lambda1);
3d5d5078 747 fhMCEDispersion[mcssPhoton] ->Fill(energy, disp);
f66d95af 748 fhMCNCellsE[mcssPhoton] ->Fill(energy, ncells);
749 fhMCMaxCellDiffClusterE[mcssPhoton]->Fill(energy,maxCellFraction);
3d5d5078 750
f66d95af 751 if (energy < 2.){
752 fhMCLambda0vsClusterMaxCellDiffE0[mcssPhoton]->Fill(lambda0, maxCellFraction);
753 fhMCNCellsvsClusterMaxCellDiffE0[mcssPhoton] ->Fill(ncells, maxCellFraction);
754 }
755 else if(energy < 6.){
756 fhMCLambda0vsClusterMaxCellDiffE2[mcssPhoton]->Fill(lambda0, maxCellFraction);
757 fhMCNCellsvsClusterMaxCellDiffE2[mcssPhoton] ->Fill(ncells, maxCellFraction);
758 }
759 else{
760 fhMCLambda0vsClusterMaxCellDiffE6[mcssPhoton]->Fill(lambda0, maxCellFraction);
761 fhMCNCellsvsClusterMaxCellDiffE6[mcssPhoton] ->Fill(ncells, maxCellFraction);
762 }
3d5d5078 763
764 if(!GetReader()->IsEmbeddedClusterSelectionOn()){
765 //Check particle overlaps in cluster
766
767 //Compare the primary depositing more energy with the rest, if no photon/electron as comon ancestor (conversions), count as other particle
768 Int_t ancPDG = 0, ancStatus = -1;
769 TLorentzVector momentum; TVector3 prodVertex;
770 Int_t ancLabel = 0;
771 Int_t noverlaps = 1;
772 for (UInt_t ilab = 0; ilab < cluster->GetNLabels(); ilab++ ) {
773 ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(cluster->GetLabels()[0],cluster->GetLabels()[ilab], GetReader(),ancPDG,ancStatus,momentum,prodVertex);
774 if(ancPDG!=22 && TMath::Abs(ancPDG)!=11) noverlaps++;
775 }
776
777 if(noverlaps == 1){
778 fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0);
3d5d5078 779 }
780 else if(noverlaps == 2){
781 fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0);
3d5d5078 782 }
783 else if(noverlaps > 2){
784 fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0);
3d5d5078 785 }
786 else {
787 printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!", noverlaps);
788 }
789 }//No embedding
790
791 //Fill histograms to check shape of embedded clusters
792 if(GetReader()->IsEmbeddedClusterSelectionOn()){
793
794 if (fraction > 0.9)
795 {
796 fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0);
3d5d5078 797 }
798 else if(fraction > 0.5)
799 {
800 fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0);
3d5d5078 801 }
802 else if(fraction > 0.1)
803 {
804 fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0);
3d5d5078 805 }
806 else
807 {
808 fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0);
3d5d5078 809 }
810 } // embedded
811
521636d2 812 }//photon no conversion
813 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron)){
3d5d5078 814 fhMCELambda0[mcssElectron] ->Fill(energy, lambda0);
3d5d5078 815 fhMCELambda1[mcssElectron] ->Fill(energy, lambda1);
3d5d5078 816 fhMCEDispersion[mcssElectron] ->Fill(energy, disp);
f66d95af 817 fhMCNCellsE[mcssElectron] ->Fill(energy, ncells);
818 fhMCMaxCellDiffClusterE[mcssElectron]->Fill(energy,maxCellFraction);
819
820 if (energy < 2.){
821 fhMCLambda0vsClusterMaxCellDiffE0[mcssElectron]->Fill(lambda0, maxCellFraction);
822 fhMCNCellsvsClusterMaxCellDiffE0[mcssElectron] ->Fill(ncells, maxCellFraction);
823 }
824 else if(energy < 6.){
825 fhMCLambda0vsClusterMaxCellDiffE2[mcssElectron]->Fill(lambda0, maxCellFraction);
826 fhMCNCellsvsClusterMaxCellDiffE2[mcssElectron] ->Fill(ncells, maxCellFraction);
827 }
828 else{
829 fhMCLambda0vsClusterMaxCellDiffE6[mcssElectron]->Fill(lambda0, maxCellFraction);
830 fhMCNCellsvsClusterMaxCellDiffE6[mcssElectron] ->Fill(ncells, maxCellFraction);
831 }
521636d2 832 }//electron
3d5d5078 833 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
521636d2 834 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) ){
3d5d5078 835 fhMCELambda0[mcssConversion] ->Fill(energy, lambda0);
3d5d5078 836 fhMCELambda1[mcssConversion] ->Fill(energy, lambda1);
3d5d5078 837 fhMCEDispersion[mcssConversion] ->Fill(energy, disp);
f66d95af 838 fhMCNCellsE[mcssConversion] ->Fill(energy, ncells);
839 fhMCMaxCellDiffClusterE[mcssConversion]->Fill(energy,maxCellFraction);
840
841 if (energy < 2.){
842 fhMCLambda0vsClusterMaxCellDiffE0[mcssConversion]->Fill(lambda0, maxCellFraction);
843 fhMCNCellsvsClusterMaxCellDiffE0[mcssConversion] ->Fill(ncells, maxCellFraction);
844 }
845 else if(energy < 6.){
846 fhMCLambda0vsClusterMaxCellDiffE2[mcssConversion]->Fill(lambda0, maxCellFraction);
847 fhMCNCellsvsClusterMaxCellDiffE2[mcssConversion] ->Fill(ncells, maxCellFraction);
848 }
849 else{
850 fhMCLambda0vsClusterMaxCellDiffE6[mcssConversion]->Fill(lambda0, maxCellFraction);
851 fhMCNCellsvsClusterMaxCellDiffE6[mcssConversion] ->Fill(ncells, maxCellFraction);
852 }
3d5d5078 853
521636d2 854 }//conversion photon
855 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) ){
3d5d5078 856 fhMCELambda0[mcssPi0] ->Fill(energy, lambda0);
3d5d5078 857 fhMCELambda1[mcssPi0] ->Fill(energy, lambda1);
3d5d5078 858 fhMCEDispersion[mcssPi0] ->Fill(energy, disp);
f66d95af 859 fhMCNCellsE[mcssPi0] ->Fill(energy, ncells);
860 fhMCMaxCellDiffClusterE[mcssPi0]->Fill(energy,maxCellFraction);
861
862 if (energy < 2.){
863 fhMCLambda0vsClusterMaxCellDiffE0[mcssPi0]->Fill(lambda0, maxCellFraction);
864 fhMCNCellsvsClusterMaxCellDiffE0[mcssPi0] ->Fill(ncells, maxCellFraction);
865 }
866 else if(energy < 6.){
867 fhMCLambda0vsClusterMaxCellDiffE2[mcssPi0]->Fill(lambda0, maxCellFraction);
868 fhMCNCellsvsClusterMaxCellDiffE2[mcssPi0] ->Fill(ncells, maxCellFraction);
869 }
870 else{
871 fhMCLambda0vsClusterMaxCellDiffE6[mcssPi0]->Fill(lambda0, maxCellFraction);
872 fhMCNCellsvsClusterMaxCellDiffE6[mcssPi0] ->Fill(ncells, maxCellFraction);
873 }
3d5d5078 874
875 //Fill histograms to check shape of embedded clusters
876 if(GetReader()->IsEmbeddedClusterSelectionOn()){
877
878 if (fraction > 0.9)
879 {
880 fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0);
3d5d5078 881 }
882 else if(fraction > 0.5)
883 {
884 fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0);
3d5d5078 885 }
886 else if(fraction > 0.1)
887 {
888 fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0);
3d5d5078 889 }
890 else
891 {
892 fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0);
3d5d5078 893 }
894 } // embedded
895
521636d2 896 }//pi0
3d5d5078 897 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) ){
898 fhMCELambda0[mcssEta] ->Fill(energy, lambda0);
3d5d5078 899 fhMCELambda1[mcssEta] ->Fill(energy, lambda1);
3d5d5078 900 fhMCEDispersion[mcssEta] ->Fill(energy, disp);
f66d95af 901 fhMCNCellsE[mcssEta] ->Fill(energy, ncells);
902 fhMCMaxCellDiffClusterE[mcssEta]->Fill(energy,maxCellFraction);
903
904 if (energy < 2.){
905 fhMCLambda0vsClusterMaxCellDiffE0[mcssEta]->Fill(lambda0, maxCellFraction);
906 fhMCNCellsvsClusterMaxCellDiffE0[mcssEta] ->Fill(ncells, maxCellFraction);
907 }
908 else if(energy < 6.){
909 fhMCLambda0vsClusterMaxCellDiffE2[mcssEta]->Fill(lambda0, maxCellFraction);
910 fhMCNCellsvsClusterMaxCellDiffE2[mcssEta] ->Fill(ncells, maxCellFraction);
911 }
912 else{
913 fhMCLambda0vsClusterMaxCellDiffE6[mcssEta]->Fill(lambda0, maxCellFraction);
914 fhMCNCellsvsClusterMaxCellDiffE6[mcssEta] ->Fill(ncells, maxCellFraction);
915 }
916
3d5d5078 917 }//eta
521636d2 918 else {
3d5d5078 919 fhMCELambda0[mcssOther] ->Fill(energy, lambda0);
3d5d5078 920 fhMCELambda1[mcssOther] ->Fill(energy, lambda1);
3d5d5078 921 fhMCEDispersion[mcssOther] ->Fill(energy, disp);
f66d95af 922 fhMCNCellsE[mcssOther] ->Fill(energy, ncells);
923 fhMCMaxCellDiffClusterE[mcssOther]->Fill(energy,maxCellFraction);
924
925 if (energy < 2.){
926 fhMCLambda0vsClusterMaxCellDiffE0[mcssOther]->Fill(lambda0, maxCellFraction);
927 fhMCNCellsvsClusterMaxCellDiffE0[mcssOther] ->Fill(ncells, maxCellFraction);
928 }
929 else if(energy < 6.){
930 fhMCLambda0vsClusterMaxCellDiffE2[mcssOther]->Fill(lambda0, maxCellFraction);
931 fhMCNCellsvsClusterMaxCellDiffE2[mcssOther] ->Fill(ncells, maxCellFraction);
932 }
933 else{
934 fhMCLambda0vsClusterMaxCellDiffE6[mcssOther]->Fill(lambda0, maxCellFraction);
935 fhMCNCellsvsClusterMaxCellDiffE6[mcssOther] ->Fill(ncells, maxCellFraction);
936 }
937
521636d2 938 }//other particles
939
940 }//MC data
941
942}
943
0c1383b5 944//________________________________________________________________________
945TObjString * AliAnaPhoton::GetAnalysisCuts()
946{
947 //Save parameters used for analysis
948 TString parList ; //this will be list of parameters used for this analysis.
5ae09196 949 const Int_t buffersize = 255;
950 char onePar[buffersize] ;
0c1383b5 951
5ae09196 952 snprintf(onePar,buffersize,"--- AliAnaPhoton ---\n") ;
0c1383b5 953 parList+=onePar ;
5ae09196 954 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
0c1383b5 955 parList+=onePar ;
5ae09196 956 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
0c1383b5 957 parList+=onePar ;
5ae09196 958 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
0c1383b5 959 parList+=onePar ;
5ae09196 960 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
0c1383b5 961 parList+=onePar ;
5ae09196 962 snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
0c1383b5 963 parList+=onePar ;
41121cfe 964 snprintf(onePar,buffersize,"Conversion Selection: fConvAsymCut %1.2f, fConvDEtaCut %1.2f fConvDPhiCut (%1.2f,%1.2f)\n",
965 fConvAsymCut, fConvDEtaCut, fConvDPhiMinCut, fConvDPhiMaxCut) ;
6175da48 966 parList+=onePar ;
0c1383b5 967
968 //Get parameters set in base class.
969 parList += GetBaseParametersList() ;
970
971 //Get parameters set in PID class.
972 parList += GetCaloPID()->GetPIDParametersList() ;
973
974 //Get parameters set in FiducialCut class (not available yet)
975 //parlist += GetFidCut()->GetFidCutParametersList()
976
977 return new TObjString(parList) ;
978}
979
1c5acb87 980//________________________________________________________________________
981TList * AliAnaPhoton::GetCreateOutputObjects()
982{
477d6cee 983 // Create histograms to be saved in output file and
984 // store them in outputContainer
985 TList * outputContainer = new TList() ;
986 outputContainer->SetName("PhotonHistos") ;
4a745797 987
521636d2 988 Int_t nptbins = GetHistoPtBins(); Float_t ptmax = GetHistoPtMax(); Float_t ptmin = GetHistoPtMin();
989 Int_t nphibins = GetHistoPhiBins(); Float_t phimax = GetHistoPhiMax(); Float_t phimin = GetHistoPhiMin();
990 Int_t netabins = GetHistoEtaBins(); Float_t etamax = GetHistoEtaMax(); Float_t etamin = GetHistoEtaMin();
991 Int_t ssbins = GetHistoShowerShapeBins(); Float_t ssmax = GetHistoShowerShapeMax(); Float_t ssmin = GetHistoShowerShapeMin();
e1e62b89 992 Int_t nbins = GetHistoNClusterCellBins(); Int_t nmax = GetHistoNClusterCellMax(); Int_t nmin = GetHistoNClusterCellMin();
521636d2 993
e1e62b89 994 fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
c4a7d28a 995 fhNCellsE->SetXTitle("E (GeV)");
996 fhNCellsE->SetYTitle("# of cells in cluster");
997 outputContainer->Add(fhNCellsE);
6175da48 998
f66d95af 999 fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1000 nptbins,ptmin,ptmax, 500,0,1.);
1001 fhMaxCellDiffClusterE->SetXTitle("E_{cluster} (GeV) ");
1002 fhMaxCellDiffClusterE->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1003 outputContainer->Add(fhMaxCellDiffClusterE);
1004
20218aea 1005 fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
1006 fhEPhoton->SetYTitle("N");
1007 fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
1008 outputContainer->Add(fhEPhoton) ;
1009
1010 fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax);
477d6cee 1011 fhPtPhoton->SetYTitle("N");
1012 fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
1013 outputContainer->Add(fhPtPhoton) ;
1014
1015 fhPhiPhoton = new TH2F
20218aea 1016 ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
6175da48 1017 fhPhiPhoton->SetYTitle("#phi (rad)");
477d6cee 1018 fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
1019 outputContainer->Add(fhPhiPhoton) ;
1020
1021 fhEtaPhoton = new TH2F
20218aea 1022 ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
477d6cee 1023 fhEtaPhoton->SetYTitle("#eta");
1024 fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
1025 outputContainer->Add(fhEtaPhoton) ;
1026
6175da48 1027 fhEtaPhiPhoton = new TH2F
1028 ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1029 fhEtaPhiPhoton->SetYTitle("#phi (rad)");
1030 fhEtaPhiPhoton->SetXTitle("#eta");
1031 outputContainer->Add(fhEtaPhiPhoton) ;
20218aea 1032 if(GetMinPt() < 0.5){
1033 fhEtaPhi05Photon = new TH2F
1034 ("hEtaPhi05Photon","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
1035 fhEtaPhi05Photon->SetYTitle("#phi (rad)");
1036 fhEtaPhi05Photon->SetXTitle("#eta");
1037 outputContainer->Add(fhEtaPhi05Photon) ;
1038 }
6175da48 1039
1040 //Conversion
20218aea 1041 if(fCheckConversion){
521636d2 1042
1043 fhEtaPhiConversion = new TH2F
1044 ("hEtaPhiConversion","#eta vs #phi for converted clusters",netabins,etamin,etamax,nphibins,phimin,phimax);
1045 fhEtaPhiConversion->SetYTitle("#phi (rad)");
1046 fhEtaPhiConversion->SetXTitle("#eta");
1047 outputContainer->Add(fhEtaPhiConversion) ;
1048 if(GetMinPt() < 0.5){
1049 fhEtaPhi05Conversion = new TH2F
1050 ("hEtaPhi05Conversion","#eta vs #phi, E > 0.5, for converted clusters",netabins,etamin,etamax,nphibins,phimin,phimax);
1051 fhEtaPhi05Conversion->SetYTitle("#phi (rad)");
1052 fhEtaPhi05Conversion->SetXTitle("#eta");
1053 outputContainer->Add(fhEtaPhi05Conversion) ;
1054 }
1055
20218aea 1056 fhPtPhotonConv = new TH1F("hPtPhotonConv","Number of #gamma over calorimeter, conversion",nptbins,ptmin,ptmax);
1057 fhPtPhotonConv->SetYTitle("N");
1058 fhPtPhotonConv->SetXTitle("p_{T #gamma}(GeV/c)");
1059 outputContainer->Add(fhPtPhotonConv) ;
1060
1061 fhEtaPhiPhotonConv = new TH2F
1062 ("hEtaPhiPhotonConv","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1063 fhEtaPhiPhotonConv->SetYTitle("#phi (rad)");
1064 fhEtaPhiPhotonConv->SetXTitle("#eta");
1065 outputContainer->Add(fhEtaPhiPhotonConv) ;
1066 if(GetMinPt() < 0.5){
1067 fhEtaPhi05PhotonConv = new TH2F
1068 ("hEtaPhi05PhotonConv","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
1069 fhEtaPhi05PhotonConv->SetYTitle("#phi (rad)");
1070 fhEtaPhi05PhotonConv->SetXTitle("#eta");
1071 outputContainer->Add(fhEtaPhi05PhotonConv) ;
1072 }
1073
1074 fhConvDeltaEta = new TH2F
1075 ("hConvDeltaEta","#Delta #eta of selected conversion pairs",100,0,fMassCut,netabins*2,-0.5,0.5);
1076 fhConvDeltaEta->SetYTitle("#Delta #eta");
1077 fhConvDeltaEta->SetXTitle("Pair Mass (GeV/c^2)");
1078 outputContainer->Add(fhConvDeltaEta) ;
1079
1080 fhConvDeltaPhi = new TH2F
1081 ("hConvDeltaPhi","#Delta #phi of selected conversion pairs",100,0,fMassCut,nphibins*2,-0.5,0.5);
1082 fhConvDeltaPhi->SetYTitle("#Delta #phi");
1083 fhConvDeltaPhi->SetXTitle("Pair Mass (GeV/c^2)");
1084 outputContainer->Add(fhConvDeltaPhi) ;
1085
1086 fhConvDeltaEtaPhi = new TH2F
1087 ("hConvDeltaEtaPhi","#Delta #eta vs #Delta #phi of selected conversion pairs",netabins,-0.5,0.5,nphibins,-0.5,0.5);
1088 fhConvDeltaEtaPhi->SetYTitle("#Delta #phi");
1089 fhConvDeltaEtaPhi->SetXTitle("#Delta #eta");
1090 outputContainer->Add(fhConvDeltaEtaPhi) ;
1091
1092 fhConvAsym = new TH2F
1093 ("hConvAsym","Asymmetry of selected conversion pairs",100,0,fMassCut,100,0,1);
1094 fhConvAsym->SetYTitle("Asymmetry");
1095 fhConvAsym->SetXTitle("Pair Mass (GeV/c^2)");
1096 outputContainer->Add(fhConvAsym) ;
1097
1098 fhConvPt = new TH2F
1099 ("hConvPt","p_{T} of selected conversion pairs",100,0,fMassCut,100,0.,10.);
1100 fhConvPt->SetYTitle("Pair p_{T} (GeV/c)");
1101 fhConvPt->SetXTitle("Pair Mass (GeV/c^2)");
1102 outputContainer->Add(fhConvPt) ;
c4a7d28a 1103
1104 fhConvDistEta = new TH2F
1105 ("hConvDistEta","distance to conversion vertex",100,-0.7,0.7,100,0.,5.);
1106 fhConvDistEta->SetXTitle("#eta");
1107 fhConvDistEta->SetYTitle(" distance (m)");
1108 outputContainer->Add(fhConvDistEta) ;
1109
1110 fhConvDistEn = new TH2F
1111 ("hConvDistEn","distance to conversion vertex",nptbins,ptmin,ptmax,100,0.,5.);
1112 fhConvDistEn->SetXTitle("E (GeV)");
1113 fhConvDistEn->SetYTitle(" distance (m)");
1114 outputContainer->Add(fhConvDistEn) ;
1115
1116 fhConvDistMass = new TH2F
1117 ("hConvDistMass","distance to conversion vertex",100,0,fMassCut,100,0.,5.);
1118 fhConvDistMass->SetXTitle("m (GeV/c^2)");
1119 fhConvDistMass->SetYTitle(" distance (m)");
1120 outputContainer->Add(fhConvDistMass) ;
1121
1122 fhConvDistEtaCutEta = new TH2F
1123 ("hConvDistEtaCutEta","distance to conversion vertex, dEta < 0.05",100,-0.7,0.7,100,0.,5.);
1124 fhConvDistEtaCutEta->SetXTitle("#eta");
1125 fhConvDistEtaCutEta->SetYTitle(" distance (m)");
1126 outputContainer->Add(fhConvDistEtaCutEta) ;
1127
1128 fhConvDistEnCutEta = new TH2F
1129 ("hConvDistEnCutEta","distance to conversion vertex, dEta < 0.05",nptbins,ptmin,ptmax,100,0.,5.);
1130 fhConvDistEnCutEta->SetXTitle("E (GeV)");
1131 fhConvDistEnCutEta->SetYTitle(" distance (m)");
1132 outputContainer->Add(fhConvDistEnCutEta) ;
1133
1134 fhConvDistMassCutEta = new TH2F
1135 ("hConvDistMassCutEta","distance to conversion vertex, dEta < 0.05",100,0,fMassCut,100,0.,5.);
1136 fhConvDistMassCutEta->SetXTitle("m (GeV/c^2)");
1137 fhConvDistMassCutEta->SetYTitle(" distance (m)");
1138 outputContainer->Add(fhConvDistMassCutEta) ;
1139
1140 fhConvDistEtaCutMass = new TH2F
1141 ("hConvDistEtaCutMass","distance to conversion vertex, dEta < 0.05, m < 10 MeV",100,-0.7,0.7,100,0.,5.);
1142 fhConvDistEtaCutMass->SetXTitle("#eta");
1143 fhConvDistEtaCutMass->SetYTitle(" distance (m)");
1144 outputContainer->Add(fhConvDistEtaCutMass) ;
1145
1146 fhConvDistEnCutMass = new TH2F
1147 ("hConvDistEnCutMass","distance to conversion vertex, dEta < 0.05, m < 10 MeV",nptbins,ptmin,ptmax,100,0.,5.);
1148 fhConvDistEnCutMass->SetXTitle("E (GeV)");
1149 fhConvDistEnCutMass->SetYTitle(" distance (m)");
1150 outputContainer->Add(fhConvDistEnCutMass) ;
1151
1152 fhConvDistEtaCutAsy = new TH2F
1153 ("hConvDistEtaCutAsy","distance to conversion vertex, dEta < 0.05, m < 10 MeV, A < 0.1",100,-0.7,0.7,100,0.,5.);
1154 fhConvDistEtaCutAsy->SetXTitle("#eta");
1155 fhConvDistEtaCutAsy->SetYTitle(" distance (m)");
1156 outputContainer->Add(fhConvDistEtaCutAsy) ;
1157
1158 fhConvDistEnCutAsy = new TH2F
1159 ("hConvDistEnCutAsy","distance to conversion vertex, dEta < 0.05, m < 10 MeV, A < 0.1",nptbins,ptmin,ptmax,100,0.,5.);
1160 fhConvDistEnCutAsy->SetXTitle("E (GeV)");
1161 fhConvDistEnCutAsy->SetYTitle(" distance (m)");
1162 outputContainer->Add(fhConvDistEnCutAsy) ;
1163
521636d2 1164 } // check conversion
1165
1166
1167 //Shower shape
1168 if(fFillSSHistograms){
1169
1170 fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1171 fhLam0E->SetYTitle("#lambda_{0}^{2}");
1172 fhLam0E->SetXTitle("E (GeV)");
1173 outputContainer->Add(fhLam0E);
1174
1175 fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1176 fhLam1E->SetYTitle("#lambda_{1}^{2}");
1177 fhLam1E->SetXTitle("E (GeV)");
1178 outputContainer->Add(fhLam1E);
1179
1180 fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1181 fhDispE->SetYTitle("D^{2}");
1182 fhDispE->SetXTitle("E (GeV) ");
1183 outputContainer->Add(fhDispE);
1184
521636d2 1185 if(fCalorimeter == "EMCAL"){
1186 fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1187 fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
1188 fhLam0ETRD->SetXTitle("E (GeV)");
1189 outputContainer->Add(fhLam0ETRD);
1190
1191 fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1192 fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
1193 fhLam1ETRD->SetXTitle("E (GeV)");
1194 outputContainer->Add(fhLam1ETRD);
1195
1196 fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1197 fhDispETRD->SetYTitle("Dispersion^{2}");
1198 fhDispETRD->SetXTitle("E (GeV) ");
1199 outputContainer->Add(fhDispETRD);
521636d2 1200 }
1201
1202 fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", 20,0, 20, ssbins,ssmin,ssmax);
1203 fhNCellsLam0LowE->SetXTitle("N_{cells}");
1204 fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
1205 outputContainer->Add(fhNCellsLam0LowE);
1206
1207 fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, E > 2 GeV", 20,0, 20, ssbins,ssmin,ssmax);
1208 fhNCellsLam0HighE->SetXTitle("N_{cells}");
1209 fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
1210 outputContainer->Add(fhNCellsLam0HighE);
1211
1212 fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", 20,0, 20, ssbins,ssmin,ssmax);
1213 fhNCellsLam1LowE->SetXTitle("N_{cells}");
1214 fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
1215 outputContainer->Add(fhNCellsLam1LowE);
1216
1217 fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, E > 2 GeV", 20,0, 20, ssbins,ssmin,ssmax);
1218 fhNCellsLam1HighE->SetXTitle("N_{cells}");
1219 fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
1220 outputContainer->Add(fhNCellsLam1HighE);
1221
1222 fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", 20,0, 20, ssbins,ssmin,ssmax);
1223 fhNCellsDispLowE->SetXTitle("N_{cells}");
1224 fhNCellsDispLowE->SetYTitle("D^{2}");
1225 outputContainer->Add(fhNCellsDispLowE);
1226
1227 fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", 20,0, 20, ssbins,ssmin,ssmax);
1228 fhNCellsDispHighE->SetXTitle("N_{cells}");
1229 fhNCellsDispHighE->SetYTitle("D^{2}");
1230 outputContainer->Add(fhNCellsDispHighE);
1231
521636d2 1232 fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1233 fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
1234 fhEtaLam0LowE->SetXTitle("#eta");
1235 outputContainer->Add(fhEtaLam0LowE);
1236
1237 fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1238 fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
1239 fhPhiLam0LowE->SetXTitle("#phi");
1240 outputContainer->Add(fhPhiLam0LowE);
1241
1242 fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, E > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1243 fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
1244 fhEtaLam0HighE->SetXTitle("#eta");
1245 outputContainer->Add(fhEtaLam0HighE);
1246
1247 fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, E > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1248 fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
1249 fhPhiLam0HighE->SetXTitle("#phi");
1250 outputContainer->Add(fhPhiLam0HighE);
1251
1252 fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1253 fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
1254 fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
1255 outputContainer->Add(fhLam1Lam0LowE);
1256
1257 fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1258 fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
1259 fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
1260 outputContainer->Add(fhLam1Lam0HighE);
1261
1262 fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1263 fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
1264 fhLam0DispLowE->SetYTitle("D^{2}");
1265 outputContainer->Add(fhLam0DispLowE);
1266
1267 fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1268 fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
1269 fhLam0DispHighE->SetYTitle("D^{2}");
1270 outputContainer->Add(fhLam0DispHighE);
1271
1272 fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1273 fhDispLam1LowE->SetXTitle("D^{2}");
1274 fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
1275 outputContainer->Add(fhDispLam1LowE);
1276
1277 fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1278 fhDispLam1HighE->SetXTitle("D^{2}");
1279 fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
1280 outputContainer->Add(fhDispLam1HighE);
1281
521636d2 1282 } // Shower shape
1283
6175da48 1284
477d6cee 1285 if(IsDataMC()){
123fc3bd 1286
f66d95af 1287 TString ptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}", "#pi^{0}","#eta",
1288 "e^{#pm}","#gamma->e^{#pm}","hadron?","Anti-N","Anti-P",
1289 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}","String" } ;
3d5d5078 1290
f66d95af 1291 TString pname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Pi0","Eta","Electron",
1292 "Conversion", "Hadron", "AntiNeutron","AntiProton",
1293 "PhotonPrompt","PhotonFragmentation","PhotonISR","String" } ;
521636d2 1294
f66d95af 1295 for(Int_t i = 0; i < fNOriginHistograms; i++){
521636d2 1296
3d5d5078 1297 fhMCE[i] = new TH1F(Form("hE_MC%s",pname[i].Data()),
521636d2 1298 Form("cluster from %s : E ",ptype[i].Data()),
1299 nptbins,ptmin,ptmax);
3d5d5078 1300 fhMCE[i]->SetXTitle("E (GeV)");
1301 outputContainer->Add(fhMCE[i]) ;
521636d2 1302
4c8f7c2e 1303 fhMCPt[i] = new TH1F(Form("hPt_MC%s",pname[i].Data()),
521636d2 1304 Form("cluster from %s : p_{T} ",ptype[i].Data()),
1305 nptbins,ptmin,ptmax);
4c8f7c2e 1306 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
1307 outputContainer->Add(fhMCPt[i]) ;
521636d2 1308
4c8f7c2e 1309 fhMCEta[i] = new TH2F(Form("hEta_MC%s",pname[i].Data()),
521636d2 1310 Form("cluster from %s : #eta ",ptype[i].Data()),
1311 nptbins,ptmin,ptmax,netabins,etamin,etamax);
4c8f7c2e 1312 fhMCEta[i]->SetYTitle("#eta");
1313 fhMCEta[i]->SetXTitle("E (GeV)");
1314 outputContainer->Add(fhMCEta[i]) ;
521636d2 1315
4c8f7c2e 1316 fhMCPhi[i] = new TH2F(Form("hPhi_MC%s",pname[i].Data()),
521636d2 1317 Form("cluster from %s : #phi ",ptype[i].Data()),
1318 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
4c8f7c2e 1319 fhMCPhi[i]->SetYTitle("#phi (rad)");
1320 fhMCPhi[i]->SetXTitle("E (GeV)");
1321 outputContainer->Add(fhMCPhi[i]) ;
1322
1323
1324 fhMCDeltaE[i] = new TH1F (Form("hDeltaE_MC%s",pname[i].Data()),
1325 Form("MC - Reco E from %s",pname[i].Data()), 200,-50,50);
1326 fhMCDeltaE[i]->SetXTitle("#Delta E (GeV)");
1327 outputContainer->Add(fhMCDeltaE[i]);
1328
1329 fhMCDeltaPt[i] = new TH1F (Form("hDeltaPt_MC%s",pname[i].Data()),
1330 Form("MC - Reco p_{T} from %s",pname[i].Data()), 200,-50,50);
1331 fhMCDeltaPt[i]->SetXTitle("#Delta p_{T} (GeV/c)");
1332 outputContainer->Add(fhMCDeltaPt[i]);
1333
1334 fhMCRatioE[i] = new TH1F (Form("hRatioE_MC%s",pname[i].Data()),
1335 Form("Reco/MC E from %s",pname[i].Data()), 200,0,2);
1336 fhMCRatioE[i]->SetXTitle("E_{reco}/E_{gen}");
1337 outputContainer->Add(fhMCRatioE[i]);
1338
1339 fhMCRatioPt[i] = new TH1F (Form("hRatioPt_MC%s",pname[i].Data()),
1340 Form("Reco/MC p_{T} from %s",pname[i].Data()), 200,0,2);
1341 fhMCRatioPt[i]->SetXTitle("p_{T, reco}/p_{T, gen}");
1342 outputContainer->Add(fhMCRatioPt[i]);
1343
1344 fhMC2E[i] = new TH2F (Form("h2E_MC%s",pname[i].Data()),
1345 Form("E distribution, reconstructed vs generated from %s",pname[i].Data()),
1346 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1347 fhMC2E[i]->SetXTitle("E_{rec} (GeV)");
1348 fhMC2E[i]->SetYTitle("E_{gen} (GeV)");
1349 outputContainer->Add(fhMC2E[i]);
1350
1351 fhMC2Pt[i] = new TH2F (Form("h2Pt_MC%s",pname[i].Data()),
1352 Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()),
1353 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1354 fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/c)");
1355 fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/c)");
1356 outputContainer->Add(fhMC2Pt[i]);
1357
521636d2 1358
1359 }
3d5d5078 1360
f66d95af 1361 TString pptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}","hadron?",
1362 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ;
1363
1364 TString ppname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Hadron",
1365 "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
1366
1367 for(Int_t i = 0; i < fNPrimaryHistograms; i++){
1368 fhEPrimMC[i] = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
1369 Form("primary photon %s : E ",pptype[i].Data()),
3d5d5078 1370 nptbins,ptmin,ptmax);
1371 fhEPrimMC[i]->SetXTitle("E (GeV)");
1372 outputContainer->Add(fhEPrimMC[i]) ;
1373
f66d95af 1374 fhPtPrimMC[i] = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
1375 Form("primary photon %s : p_{T} ",pptype[i].Data()),
3d5d5078 1376 nptbins,ptmin,ptmax);
1377 fhPtPrimMC[i]->SetXTitle("p_{T} (GeV/c)");
1378 outputContainer->Add(fhPtPrimMC[i]) ;
1379
f66d95af 1380 fhYPrimMC[i] = new TH2F(Form("hYPrim_MC%s",ppname[i].Data()),
1381 Form("primary photon %s : Rapidity ",pptype[i].Data()),
3d5d5078 1382 nptbins,ptmin,ptmax,800,-8,8);
1383 fhYPrimMC[i]->SetYTitle("Rapidity");
1384 fhYPrimMC[i]->SetXTitle("E (GeV)");
1385 outputContainer->Add(fhYPrimMC[i]) ;
1386
f66d95af 1387 fhPhiPrimMC[i] = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
1388 Form("primary photon %s : #phi ",pptype[i].Data()),
3d5d5078 1389 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1390 fhPhiPrimMC[i]->SetYTitle("#phi (rad)");
1391 fhPhiPrimMC[i]->SetXTitle("E (GeV)");
1392 outputContainer->Add(fhPhiPrimMC[i]) ;
1393
1394
f66d95af 1395 fhEPrimMCAcc[i] = new TH1F(Form("hEPrimAcc_MC%s",ppname[i].Data()),
1396 Form("primary photon %s in acceptance: E ",pptype[i].Data()),
3d5d5078 1397 nptbins,ptmin,ptmax);
1398 fhEPrimMCAcc[i]->SetXTitle("E (GeV)");
1399 outputContainer->Add(fhEPrimMCAcc[i]) ;
1400
f66d95af 1401 fhPtPrimMCAcc[i] = new TH1F(Form("hPtPrimAcc_MC%s",ppname[i].Data()),
1402 Form("primary photon %s in acceptance: p_{T} ",pptype[i].Data()),
3d5d5078 1403 nptbins,ptmin,ptmax);
1404 fhPtPrimMCAcc[i]->SetXTitle("p_{T} (GeV/c)");
1405 outputContainer->Add(fhPtPrimMCAcc[i]) ;
1406
f66d95af 1407 fhYPrimMCAcc[i] = new TH2F(Form("hYPrimAcc_MC%s",ppname[i].Data()),
1408 Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
3d5d5078 1409 nptbins,ptmin,ptmax,100,-1,1);
1410 fhYPrimMCAcc[i]->SetYTitle("Rapidity");
1411 fhYPrimMCAcc[i]->SetXTitle("E (GeV)");
1412 outputContainer->Add(fhYPrimMCAcc[i]) ;
1413
f66d95af 1414 fhPhiPrimMCAcc[i] = new TH2F(Form("hPhiPrimAcc_MC%s",ppname[i].Data()),
1415 Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
3d5d5078 1416 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1417 fhPhiPrimMCAcc[i]->SetYTitle("#phi (rad)");
1418 fhPhiPrimMCAcc[i]->SetXTitle("E (GeV)");
1419 outputContainer->Add(fhPhiPrimMCAcc[i]) ;
1420
1421 }
1422
20218aea 1423 if(fCheckConversion){
1424 fhPtConversionTagged = new TH1F("hPtMCConversionTagged","Number of converted #gamma over calorimeter, tagged as converted",nptbins,ptmin,ptmax);
1425 fhPtConversionTagged->SetYTitle("N");
1426 fhPtConversionTagged->SetXTitle("p_{T #gamma}(GeV/c)");
1427 outputContainer->Add(fhPtConversionTagged) ;
1428
1429
1430 fhPtAntiNeutronTagged = new TH1F("hPtMCAntiNeutronTagged","Number of AntiNeutron id as Photon over calorimeter, tagged as converted",nptbins,ptmin,ptmax);
1431 fhPtAntiNeutronTagged->SetYTitle("N");
1432 fhPtAntiNeutronTagged->SetXTitle("p_{T #gamma}(GeV/c)");
1433 outputContainer->Add(fhPtAntiNeutronTagged) ;
1434
1435 fhPtAntiProtonTagged = new TH1F("hPtMCAntiProtonTagged","Number of AntiProton id as Photon over calorimeter, tagged as converted",nptbins,ptmin,ptmax);
1436 fhPtAntiProtonTagged->SetYTitle("N");
1437 fhPtAntiProtonTagged->SetXTitle("p_{T #gamma}(GeV/c)");
1438 outputContainer->Add(fhPtAntiProtonTagged) ;
1439
1440 fhPtUnknownTagged = new TH1F("hPtMCUnknownTagged","Number of Unknown id as Photon over calorimeter, tagged as converted",nptbins,ptmin,ptmax);
1441 fhPtUnknownTagged->SetYTitle("N");
1442 fhPtUnknownTagged->SetXTitle("p_{T #gamma}(GeV/c)");
1443 outputContainer->Add(fhPtUnknownTagged) ;
1444
1445 fhConvDeltaEtaMCConversion = new TH2F
1446 ("hConvDeltaEtaMCConversion","#Delta #eta of selected conversion pairs from real conversions",100,0,fMassCut,netabins,-0.5,0.5);
1447 fhConvDeltaEtaMCConversion->SetYTitle("#Delta #eta");
1448 fhConvDeltaEtaMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
1449 outputContainer->Add(fhConvDeltaEtaMCConversion) ;
1450
1451 fhConvDeltaPhiMCConversion = new TH2F
1452 ("hConvDeltaPhiMCConversion","#Delta #phi of selected conversion pairs from real conversions",100,0,fMassCut,nphibins,-0.5,0.5);
1453 fhConvDeltaPhiMCConversion->SetYTitle("#Delta #phi");
1454 fhConvDeltaPhiMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
1455 outputContainer->Add(fhConvDeltaPhiMCConversion) ;
1456
1457 fhConvDeltaEtaPhiMCConversion = new TH2F
1458 ("hConvDeltaEtaPhiMCConversion","#Delta #eta vs #Delta #phi of selected conversion pairs, from real conversions",netabins,-0.5,0.5,nphibins,-0.5,0.5);
1459 fhConvDeltaEtaPhiMCConversion->SetYTitle("#Delta #phi");
1460 fhConvDeltaEtaPhiMCConversion->SetXTitle("#Delta #eta");
1461 outputContainer->Add(fhConvDeltaEtaPhiMCConversion) ;
1462
1463 fhConvAsymMCConversion = new TH2F
1464 ("hConvAsymMCConversion","Asymmetry of selected conversion pairs from real conversions",100,0,fMassCut,100,0,1);
1465 fhConvAsymMCConversion->SetYTitle("Asymmetry");
1466 fhConvAsymMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
1467 outputContainer->Add(fhConvAsymMCConversion) ;
1468
1469 fhConvPtMCConversion = new TH2F
1470 ("hConvPtMCConversion","p_{T} of selected conversion pairs from real conversions",100,0,fMassCut,100,0.,10.);
1471 fhConvPtMCConversion->SetYTitle("Pair p_{T} (GeV/c)");
1472 fhConvPtMCConversion->SetXTitle("Pair Mass (GeV/c^2)");
1473 outputContainer->Add(fhConvPtMCConversion) ;
1474
1475 fhConvDispersionMCConversion = new TH2F
1476 ("hConvDispersionMCConversion","p_{T} of selected conversion pairs from real conversions",100,0.,1.,100,0.,1.);
1477 fhConvDispersionMCConversion->SetYTitle("Dispersion cluster 1");
1478 fhConvDispersionMCConversion->SetXTitle("Dispersion cluster 2");
1479 outputContainer->Add(fhConvDispersionMCConversion) ;
1480
1481 fhConvM02MCConversion = new TH2F
1482 ("hConvM02MCConversion","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.);
1483 fhConvM02MCConversion->SetYTitle("M02 cluster 1");
1484 fhConvM02MCConversion->SetXTitle("M02 cluster 2");
1485 outputContainer->Add(fhConvM02MCConversion) ;
1486
1487 fhConvDeltaEtaMCAntiNeutron = new TH2F
1488 ("hConvDeltaEtaMCAntiNeutron","#Delta #eta of selected conversion pairs from anti-neutrons",100,0,fMassCut,netabins,-0.5,0.5);
1489 fhConvDeltaEtaMCAntiNeutron->SetYTitle("#Delta #eta");
1490 fhConvDeltaEtaMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
1491 outputContainer->Add(fhConvDeltaEtaMCAntiNeutron) ;
1492
1493 fhConvDeltaPhiMCAntiNeutron = new TH2F
1494 ("hConvDeltaPhiMCAntiNeutron","#Delta #phi of selected conversion pairs from anti-neutrons",100,0,fMassCut,nphibins,-0.5,0.5);
1495 fhConvDeltaPhiMCAntiNeutron->SetYTitle("#Delta #phi");
1496 fhConvDeltaPhiMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
1497 outputContainer->Add(fhConvDeltaPhiMCAntiNeutron) ;
1498
1499 fhConvDeltaEtaPhiMCAntiNeutron = new TH2F
1500 ("hConvDeltaEtaPhiMCAntiNeutron","#Delta #eta vs #Delta #phi of selected conversion pairs from anti-neutrons",netabins,-0.5,0.5,nphibins,-0.5,0.5);
1501 fhConvDeltaEtaPhiMCAntiNeutron->SetYTitle("#Delta #phi");
1502 fhConvDeltaEtaPhiMCAntiNeutron->SetXTitle("#Delta #eta");
1503 outputContainer->Add(fhConvDeltaEtaPhiMCAntiNeutron) ;
1504
1505 fhConvAsymMCAntiNeutron = new TH2F
1506 ("hConvAsymMCAntiNeutron","Asymmetry of selected conversion pairs from anti-neutrons",100,0,fMassCut,100,0,1);
1507 fhConvAsymMCAntiNeutron->SetYTitle("Asymmetry");
1508 fhConvAsymMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
1509 outputContainer->Add(fhConvAsymMCAntiNeutron) ;
1510
1511 fhConvPtMCAntiNeutron = new TH2F
1512 ("hConvPtMCAntiNeutron","p_{T} of selected conversion pairs from anti-neutrons",100,0,fMassCut,100,0.,10.);
1513 fhConvPtMCAntiNeutron->SetYTitle("Pair p_{T} (GeV/c)");
1514 fhConvPtMCAntiNeutron->SetXTitle("Pair Mass (GeV/c^2)");
1515 outputContainer->Add(fhConvPtMCAntiNeutron) ;
1516
1517 fhConvDispersionMCAntiNeutron = new TH2F
1518 ("hConvDispersionMCAntiNeutron","p_{T} of selected conversion pairs from anti-neutrons",100,0.,1.,100,0.,1.);
1519 fhConvDispersionMCAntiNeutron->SetYTitle("Dispersion cluster 1");
1520 fhConvDispersionMCAntiNeutron->SetXTitle("Dispersion cluster 2");
1521 outputContainer->Add(fhConvDispersionMCAntiNeutron) ;
1522
1523 fhConvM02MCAntiNeutron = new TH2F
1524 ("hConvM02MCAntiNeutron","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.);
1525 fhConvM02MCAntiNeutron->SetYTitle("M02 cluster 1");
1526 fhConvM02MCAntiNeutron->SetXTitle("M02 cluster 2");
1527 outputContainer->Add(fhConvM02MCAntiNeutron) ;
1528
1529 fhConvDeltaEtaMCAntiProton = new TH2F
1530 ("hConvDeltaEtaMCAntiProton","#Delta #eta of selected conversion pairs from anti-protons",100,0,fMassCut,netabins,-0.5,0.5);
1531 fhConvDeltaEtaMCAntiProton->SetYTitle("#Delta #eta");
1532 fhConvDeltaEtaMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
1533 outputContainer->Add(fhConvDeltaEtaMCAntiProton) ;
1534
1535 fhConvDeltaPhiMCAntiProton = new TH2F
1536 ("hConvDeltaPhiMCAntiProton","#Delta #phi of selected conversion pairs from anti-protons",100,0,fMassCut,nphibins,-0.5,0.5);
1537 fhConvDeltaPhiMCAntiProton->SetYTitle("#Delta #phi");
1538 fhConvDeltaPhiMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
1539 outputContainer->Add(fhConvDeltaPhiMCAntiProton) ;
1540
1541 fhConvDeltaEtaPhiMCAntiProton = new TH2F
1542 ("hConvDeltaEtaPhiMCAntiProton","#Delta #eta vs #Delta #phi of selected conversion pairs from anti-protons",netabins,-0.5,0.5,nphibins,-0.5,0.5);
1543 fhConvDeltaEtaPhiMCAntiProton->SetYTitle("#Delta #phi");
1544 fhConvDeltaEtaPhiMCAntiProton->SetXTitle("#Delta #eta");
1545 outputContainer->Add(fhConvDeltaEtaPhiMCAntiProton) ;
1546
1547 fhConvAsymMCAntiProton = new TH2F
1548 ("hConvAsymMCAntiProton","Asymmetry of selected conversion pairs from anti-protons",100,0,fMassCut,100,0,1);
1549 fhConvAsymMCAntiProton->SetYTitle("Asymmetry");
1550 fhConvAsymMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
1551 outputContainer->Add(fhConvAsymMCAntiProton) ;
1552
1553 fhConvPtMCAntiProton = new TH2F
1554 ("hConvPtMCAntiProton","p_{T} of selected conversion pairs from anti-protons",100,0,fMassCut,100,0.,10.);
1555 fhConvPtMCAntiProton->SetYTitle("Pair p_{T} (GeV/c)");
1556 fhConvPtMCAntiProton->SetXTitle("Pair Mass (GeV/c^2)");
1557 outputContainer->Add(fhConvPtMCAntiProton) ;
1558
1559 fhConvDispersionMCAntiProton = new TH2F
1560 ("hConvDispersionMCAntiProton","p_{T} of selected conversion pairs from anti-protons",100,0.,1.,100,0.,1.);
1561 fhConvDispersionMCAntiProton->SetYTitle("Dispersion cluster 1");
1562 fhConvDispersionMCAntiProton->SetXTitle("Dispersion cluster 2");
1563 outputContainer->Add(fhConvDispersionMCAntiProton) ;
1564
1565 fhConvM02MCAntiProton = new TH2F
1566 ("hConvM02MCAntiProton","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.);
1567 fhConvM02MCAntiProton->SetYTitle("M02 cluster 1");
1568 fhConvM02MCAntiProton->SetXTitle("M02 cluster 2");
1569 outputContainer->Add(fhConvM02MCAntiProton) ;
1570
1571 fhConvDeltaEtaMCString = new TH2F
1572 ("hConvDeltaEtaMCString","#Delta #eta of selected conversion pairs from string",100,0,fMassCut,netabins,-0.5,0.5);
1573 fhConvDeltaEtaMCString->SetYTitle("#Delta #eta");
1574 fhConvDeltaEtaMCString->SetXTitle("Pair Mass (GeV/c^2)");
1575 outputContainer->Add(fhConvDeltaEtaMCString) ;
1576
1577 fhConvDeltaPhiMCString = new TH2F
1578 ("hConvDeltaPhiMCString","#Delta #phi of selected conversion pairs from string",100,0,fMassCut,nphibins,-0.5,0.5);
1579 fhConvDeltaPhiMCString->SetYTitle("#Delta #phi");
1580 fhConvDeltaPhiMCString->SetXTitle("Pair Mass (GeV/c^2)");
1581 outputContainer->Add(fhConvDeltaPhiMCString) ;
1582
1583 fhConvDeltaEtaPhiMCString = new TH2F
1584 ("hConvDeltaEtaPhiMCString","#Delta #eta vs #Delta #phi of selected conversion pairs from string",netabins,-0.5,0.5,nphibins,-0.5,0.5);
1585 fhConvDeltaEtaPhiMCString->SetYTitle("#Delta #phi");
1586 fhConvDeltaEtaPhiMCString->SetXTitle("#Delta #eta");
1587 outputContainer->Add(fhConvDeltaEtaPhiMCString) ;
1588
1589 fhConvAsymMCString = new TH2F
1590 ("hConvAsymMCString","Asymmetry of selected conversion pairs from string",100,0,fMassCut,100,0,1);
1591 fhConvAsymMCString->SetYTitle("Asymmetry");
1592 fhConvAsymMCString->SetXTitle("Pair Mass (GeV/c^2)");
1593 outputContainer->Add(fhConvAsymMCString) ;
1594
1595 fhConvPtMCString = new TH2F
1596 ("hConvPtMCString","p_{T} of selected conversion pairs from string",100,0,fMassCut,100,0.,10.);
1597 fhConvPtMCString->SetYTitle("Pair p_{T} (GeV/c)");
1598 fhConvPtMCString->SetXTitle("Pair Mass (GeV/c^2)");
1599 outputContainer->Add(fhConvPtMCString) ;
1600
1601 fhConvDispersionMCString = new TH2F
1602 ("hConvDispersionMCString","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.);
1603 fhConvDispersionMCString->SetYTitle("Dispersion cluster 1");
1604 fhConvDispersionMCString->SetXTitle("Dispersion cluster 2");
1605 outputContainer->Add(fhConvDispersionMCString) ;
1606
1607 fhConvM02MCString = new TH2F
1608 ("hConvM02MCString","p_{T} of selected conversion pairs from string",100,0.,1.,100,0.,1.);
1609 fhConvM02MCString->SetYTitle("M02 cluster 1");
1610 fhConvM02MCString->SetXTitle("M02 cluster 2");
c4a7d28a 1611 outputContainer->Add(fhConvM02MCString) ;
1612
1613 fhConvDistMCConversion = new TH2F
1614 ("hConvDistMCConversion","calculated conversion distance vs real vertes for MC conversion",100,0.,5.,100,0.,5.);
1615 fhConvDistMCConversion->SetYTitle("distance");
1616 fhConvDistMCConversion->SetXTitle("vertex R");
1617 outputContainer->Add(fhConvDistMCConversion) ;
1618
1619 fhConvDistMCConversionCuts = new TH2F
1620 ("hConvDistMCConversionCuts","calculated conversion distance vs real vertes for MC conversion, deta < 0.05, m < 10 MeV, asym < 0.1",100,0.,5.,100,0.,5.);
1621 fhConvDistMCConversionCuts->SetYTitle("distance");
1622 fhConvDistMCConversionCuts->SetXTitle("vertex R");
1623 outputContainer->Add(fhConvDistMCConversionCuts) ;
20218aea 1624 }
6175da48 1625
521636d2 1626 if(fFillSSHistograms){
1627
3d5d5078 1628 TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
1629
1630 TString pnamess[] = { "Photon","Hadron","Pi0","Eta","Conversion","Electron"} ;
1631
1632 for(Int_t i = 0; i < 6; i++){
521636d2 1633
3d5d5078 1634 fhMCELambda0[i] = new TH2F(Form("hELambda0_MC%s",pnamess[i].Data()),
1635 Form("cluster from %s : E vs #lambda_{0}^{2}",ptypess[i].Data()),
521636d2 1636 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 1637 fhMCELambda0[i]->SetYTitle("#lambda_{0}^{2}");
1638 fhMCELambda0[i]->SetXTitle("E (GeV)");
1639 outputContainer->Add(fhMCELambda0[i]) ;
521636d2 1640
3d5d5078 1641 fhMCELambda1[i] = new TH2F(Form("hELambda1_MC%s",pnamess[i].Data()),
1642 Form("cluster from %s : E vs #lambda_{1}^{2}",ptypess[i].Data()),
521636d2 1643 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 1644 fhMCELambda1[i]->SetYTitle("#lambda_{1}^{2}");
1645 fhMCELambda1[i]->SetXTitle("E (GeV)");
1646 outputContainer->Add(fhMCELambda1[i]) ;
7c65ad18 1647
3d5d5078 1648 fhMCEDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pnamess[i].Data()),
1649 Form("cluster from %s : E vs dispersion^{2}",ptypess[i].Data()),
521636d2 1650 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3d5d5078 1651 fhMCEDispersion[i]->SetYTitle("D^{2}");
1652 fhMCEDispersion[i]->SetXTitle("E (GeV)");
1653 outputContainer->Add(fhMCEDispersion[i]) ;
7c65ad18 1654
f66d95af 1655 fhMCNCellsE[i] = new TH2F (Form("hNCellsE_MC%s",pnamess[i].Data()),
1656 Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()),
1657 nptbins,ptmin,ptmax, nbins,nmin,nmax);
1658 fhMCNCellsE[i]->SetXTitle("E (GeV)");
1659 fhMCNCellsE[i]->SetYTitle("# of cells in cluster");
1660 outputContainer->Add(fhMCNCellsE[i]);
1661
1662 fhMCMaxCellDiffClusterE[i] = new TH2F (Form("hMaxCellDiffClusterE_MC%s",pnamess[i].Data()),
1663 Form("energy vs difference of cluster energy from %s - max cell energy / cluster energy, good clusters",ptypess[i].Data()),
1664 nptbins,ptmin,ptmax, 500,0,1.);
1665 fhMCMaxCellDiffClusterE[i]->SetXTitle("E_{cluster} (GeV) ");
1666 fhMCMaxCellDiffClusterE[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1667 outputContainer->Add(fhMCMaxCellDiffClusterE[i]);
1668
1669 fhMCLambda0vsClusterMaxCellDiffE0[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
1670 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
1671 ssbins,ssmin,ssmax,500,0,1.);
1672 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetXTitle("#lambda_{0}^{2}");
1673 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1674 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ;
1675
1676 fhMCLambda0vsClusterMaxCellDiffE2[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
1677 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
1678 ssbins,ssmin,ssmax,500,0,1.);
1679 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetXTitle("#lambda_{0}^{2}");
1680 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1681 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ;
1682
1683 fhMCLambda0vsClusterMaxCellDiffE6[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
1684 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
1685 ssbins,ssmin,ssmax,500,0,1.);
1686 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetXTitle("#lambda_{0}^{2}");
1687 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1688 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ;
1689
1690 fhMCNCellsvsClusterMaxCellDiffE0[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
1691 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
1692 nbins/5,nmin,nmax/5,500,0,1.);
1693 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetXTitle("N cells in cluster");
1694 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1695 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ;
1696
1697 fhMCNCellsvsClusterMaxCellDiffE2[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
1698 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
1699 nbins/5,nmin,nmax/5,500,0,1.);
1700 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetXTitle("N cells in cluster");
1701 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1702 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ;
1703
1704 fhMCNCellsvsClusterMaxCellDiffE6[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
1705 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
1706 nbins/5,nmin,nmax/5,500,0,1.);
1707 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetXTitle("N cells in cluster");
1708 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("E (GeV)");
1709 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ;
1710
3d5d5078 1711 }// loop
1712
1713 if(!GetReader()->IsEmbeddedClusterSelectionOn())
1714 {
1715 fhMCPhotonELambda0NoOverlap = new TH2F("hELambda0_MCPhoton_NoOverlap",
1716 "cluster from Photon : E vs #lambda_{0}^{2}",
1717 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1718 fhMCPhotonELambda0NoOverlap->SetYTitle("#lambda_{0}^{2}");
1719 fhMCPhotonELambda0NoOverlap->SetXTitle("E (GeV)");
1720 outputContainer->Add(fhMCPhotonELambda0NoOverlap) ;
1721
3d5d5078 1722 fhMCPhotonELambda0TwoOverlap = new TH2F("hELambda0_MCPhoton_TwoOverlap",
1723 "cluster from Photon : E vs #lambda_{0}^{2}",
1724 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1725 fhMCPhotonELambda0TwoOverlap->SetYTitle("#lambda_{0}^{2}");
1726 fhMCPhotonELambda0TwoOverlap->SetXTitle("E (GeV)");
1727 outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ;
1728
3d5d5078 1729 fhMCPhotonELambda0NOverlap = new TH2F("hELambda0_MCPhoton_NOverlap",
1730 "cluster from Photon : E vs #lambda_{0}^{2}",
1731 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1732 fhMCPhotonELambda0NOverlap->SetYTitle("#lambda_{0}^{2}");
1733 fhMCPhotonELambda0NOverlap->SetXTitle("E (GeV)");
1734 outputContainer->Add(fhMCPhotonELambda0NOverlap) ;
521636d2 1735
3d5d5078 1736 } //No embedding
1737
1738 //Fill histograms to check shape of embedded clusters
1739 if(GetReader()->IsEmbeddedClusterSelectionOn())
1740 {
1741
1742 fhEmbeddedSignalFractionEnergy = new TH2F("hEmbeddedSignal_FractionEnergy",
1743 "Energy Fraction of embedded signal versus cluster energy",
1744 nptbins,ptmin,ptmax,100,0.,1.);
1745 fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
1746 fhEmbeddedSignalFractionEnergy->SetXTitle("E (GeV)");
1747 outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
1748
1749 fhEmbedPhotonELambda0FullSignal = new TH2F("hELambda0_EmbedPhoton_FullSignal",
1750 "cluster from Photon embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
1751 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1752 fhEmbedPhotonELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
1753 fhEmbedPhotonELambda0FullSignal->SetXTitle("E (GeV)");
1754 outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ;
7c65ad18 1755
3d5d5078 1756 fhEmbedPhotonELambda0MostlySignal = new TH2F("hELambda0_EmbedPhoton_MostlySignal",
1757 "cluster from Photon embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
1758 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1759 fhEmbedPhotonELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
1760 fhEmbedPhotonELambda0MostlySignal->SetXTitle("E (GeV)");
1761 outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ;
1762
3d5d5078 1763 fhEmbedPhotonELambda0MostlyBkg = new TH2F("hELambda0_EmbedPhoton_MostlyBkg",
1764 "cluster from Photon embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
1765 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1766 fhEmbedPhotonELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
1767 fhEmbedPhotonELambda0MostlyBkg->SetXTitle("E (GeV)");
1768 outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ;
7c65ad18 1769
3d5d5078 1770 fhEmbedPhotonELambda0FullBkg = new TH2F("hELambda0_EmbedPhoton_FullBkg",
1771 "cluster from Photonm embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
1772 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1773 fhEmbedPhotonELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
1774 fhEmbedPhotonELambda0FullBkg->SetXTitle("E (GeV)");
1775 outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ;
1776
3d5d5078 1777 fhEmbedPi0ELambda0FullSignal = new TH2F("hELambda0_EmbedPi0_FullSignal",
1778 "cluster from Pi0 embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
1779 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1780 fhEmbedPi0ELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
1781 fhEmbedPi0ELambda0FullSignal->SetXTitle("E (GeV)");
1782 outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ;
7c65ad18 1783
3d5d5078 1784 fhEmbedPi0ELambda0MostlySignal = new TH2F("hELambda0_EmbedPi0_MostlySignal",
1785 "cluster from Pi0 embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
1786 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1787 fhEmbedPi0ELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
1788 fhEmbedPi0ELambda0MostlySignal->SetXTitle("E (GeV)");
1789 outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ;
1790
3d5d5078 1791 fhEmbedPi0ELambda0MostlyBkg = new TH2F("hELambda0_EmbedPi0_MostlyBkg",
1792 "cluster from Pi0 embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
1793 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1794 fhEmbedPi0ELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
1795 fhEmbedPi0ELambda0MostlyBkg->SetXTitle("E (GeV)");
1796 outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ;
1797
3d5d5078 1798 fhEmbedPi0ELambda0FullBkg = new TH2F("hELambda0_EmbedPi0_FullBkg",
1799 "cluster from Pi0 embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
1800 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1801 fhEmbedPi0ELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
1802 fhEmbedPi0ELambda0FullBkg->SetXTitle("E (GeV)");
1803 outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ;
7c65ad18 1804
3d5d5078 1805 }// embedded histograms
1806
521636d2 1807
1808 }// Fill SS MC histograms
1809
477d6cee 1810 }//Histos with MC
0c1383b5 1811
d39cba7e 1812 //Store calo PID histograms
1813 if(fRejectTrackMatch){
1814 TList * caloPIDHistos = GetCaloPID()->GetCreateOutputObjects() ;
1815 for(Int_t i = 0; i < caloPIDHistos->GetEntries(); i++) {
1816 outputContainer->Add(caloPIDHistos->At(i)) ;
1817 }
1818 delete caloPIDHistos;
1819 }
1820
477d6cee 1821 return outputContainer ;
1822
1c5acb87 1823}
1824
6639984f 1825//____________________________________________________________________________
1826void AliAnaPhoton::Init()
1827{
1828
1829 //Init
1830 //Do some checks
1e86c71e 1831 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD()){
591cc579 1832 printf("AliAnaPhoton::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
6639984f 1833 abort();
1834 }
1e86c71e 1835 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD()){
591cc579 1836 printf("AliAnaPhoton::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
6639984f 1837 abort();
1838 }
1839
1840}
1841
1c5acb87 1842//____________________________________________________________________________
1843void AliAnaPhoton::InitParameters()
1844{
1845
1846 //Initialize the parameters of the analysis.
a3aebfff 1847 AddToHistogramsName("AnaPhoton_");
521636d2 1848
6175da48 1849 fCalorimeter = "EMCAL" ;
1850 fMinDist = 2.;
1851 fMinDist2 = 4.;
1852 fMinDist3 = 5.;
1853 fMassCut = 0.03; //30 MeV
1e86c71e 1854
4cf55759 1855 fTimeCutMin = -1;
1856 fTimeCutMax = 9999999;
6175da48 1857 fNCellsCut = 0;
2ac125bf 1858
1e86c71e 1859 fRejectTrackMatch = kTRUE ;
1860 fCheckConversion = kFALSE;
20218aea 1861 fRemoveConvertedPair = kFALSE;
1e86c71e 1862 fAddConvertedPairsToAOD = kFALSE;
1863
1c5acb87 1864}
1865
1866//__________________________________________________________________
1867void AliAnaPhoton::MakeAnalysisFillAOD()
1868{
f8006433 1869 //Do photon analysis and fill aods
f37fa8d2 1870
6175da48 1871 //Get the vertex
5025c139 1872 Double_t v[3] = {0,0,0}; //vertex ;
1873 GetReader()->GetVertex(v);
f8006433 1874
f37fa8d2 1875 //Select the Calorimeter of the photon
c8fe2783 1876 TObjArray * pl = 0x0;
477d6cee 1877 if(fCalorimeter == "PHOS")
be518ab0 1878 pl = GetPHOSClusters();
477d6cee 1879 else if (fCalorimeter == "EMCAL")
be518ab0 1880 pl = GetEMCALClusters();
5ae09196 1881
1882 if(!pl) {
1883 Info("MakeAnalysisFillAOD","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
1884 return;
1885 }
521636d2 1886
6175da48 1887 //Init arrays, variables, get number of clusters
1e86c71e 1888 TLorentzVector mom, mom2 ;
1889 Int_t nCaloClusters = pl->GetEntriesFast();
6175da48 1890 //List to be used in conversion analysis, to tag the cluster as candidate for conversion
20218aea 1891 Bool_t * indexConverted = 0x0;
1892 if(fCheckConversion){
1893 indexConverted = new Bool_t[nCaloClusters];
1894 for (Int_t i = 0; i < nCaloClusters; i++)
1895 indexConverted[i] = kFALSE;
1896 }
1897
6175da48 1898 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - input %s cluster entries %d\n", fCalorimeter.Data(), nCaloClusters);
521636d2 1899
6175da48 1900 //----------------------------------------------------
1901 // Fill AOD with PHOS/EMCAL AliAODPWG4Particle objects
1902 //----------------------------------------------------
1903 // Loop on clusters
1e86c71e 1904 for(Int_t icalo = 0; icalo < nCaloClusters; icalo++){
1905
0ae57829 1906 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
1907 //printf("calo %d, %f\n",icalo,calo->E());
521636d2 1908
f8006433 1909 //Get the index where the cluster comes, to retrieve the corresponding vertex
c8fe2783 1910 Int_t evtIndex = 0 ;
1911 if (GetMixedEvent()) {
1912 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
5025c139 1913 //Get the vertex and check it is not too large in z
96539743 1914 if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
c8fe2783 1915 }
521636d2 1916
1917 //Cluster selection, not charged, with photon id and in fiducial cut
f8006433 1918 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC){
1919 calo->GetMomentum(mom,GetVertex(evtIndex)) ;}//Assume that come from vertex in straight line
1920 else{
1921 Double_t vertex[]={0,0,0};
1922 calo->GetMomentum(mom,vertex) ;
1923 }
c8fe2783 1924
6175da48 1925 //--------------------------------------
1926 // Cluster selection
1927 //--------------------------------------
c4a7d28a 1928 if(!ClusterSelected(calo,mom)) continue;
6175da48 1929
1930 //----------------------------
1931 //Create AOD for analysis
1932 //----------------------------
1933 AliAODPWG4Particle aodph = AliAODPWG4Particle(mom);
1934
1935 //...............................................
1936 //Set the indeces of the original caloclusters (MC, ID), and calorimeter
1937 Int_t label = calo->GetLabel();
1938 aodph.SetLabel(label);
6175da48 1939 aodph.SetCaloLabel(calo->GetID(),-1);
1940 aodph.SetDetector(fCalorimeter);
c4a7d28a 1941 //printf("Index %d, Id %d, iaod %d\n",icalo, calo->GetID(),GetOutputAODBranch()->GetEntriesFast());
521636d2 1942
6175da48 1943 //...............................................
1944 //Set bad channel distance bit
c4a7d28a 1945 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
f37fa8d2 1946 if (distBad > fMinDist3) aodph.SetDistToBad(2) ;
477d6cee 1947 else if(distBad > fMinDist2) aodph.SetDistToBad(1) ;
f37fa8d2 1948 else aodph.SetDistToBad(0) ;
af7b3903 1949 //printf("DistBad %f Bit %d\n",distBad, aodph.DistToBad());
c8fe2783 1950
521636d2 1951 //--------------------------------------------------------------------------------------
1952 //Play with the MC stack if available
1953 //--------------------------------------------------------------------------------------
1954
1955 //Check origin of the candidates
1956 if(IsDataMC()){
1957 aodph.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader(), aodph.GetInputFileIndex()));
3d5d5078 1958
521636d2 1959 if(GetDebug() > 0)
1960 printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag());
1961 }//Work with stack also
1962
1963 //--------------------------------------------------------------------------------------
1964 //Fill some shower shape histograms before PID is applied
1965 //--------------------------------------------------------------------------------------
1966
1967 FillShowerShapeHistograms(calo,aodph.GetTag());
6175da48 1968
1969 //-------------------------------------
f37fa8d2 1970 //PID selection or bit setting
6175da48 1971 //-------------------------------------
1972 // MC
477d6cee 1973 if(GetReader()->GetDataType() == AliCaloTrackReader::kMC){
f37fa8d2 1974 //Get most probable PID, check PID weights (in MC this option is mandatory)
21a4b1c0 1975 aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(fCalorimeter,calo->GetPID(),mom.E()));//PID with weights
1976 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetIdentifiedParticleType());
f37fa8d2 1977 //If primary is not photon, skip it.
21a4b1c0 1978 if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
6175da48 1979 }
1980 //...............................................
1981 // Data, PID check on
477d6cee 1982 else if(IsCaloPIDOn()){
f37fa8d2 1983 //Get most probable PID, 2 options check PID weights
3d5d5078 1984 //or redo PID, recommended option for MCEal.
477d6cee 1985 if(!IsCaloPIDRecalculationOn())
21a4b1c0 1986 aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(fCalorimeter,calo->GetPID(),mom.E()));//PID with weights
477d6cee 1987 else
21a4b1c0 1988 aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(fCalorimeter,mom,calo));//PID recalculated
477d6cee 1989
21a4b1c0 1990 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetIdentifiedParticleType());
477d6cee 1991
f37fa8d2 1992 //If cluster does not pass pid, not photon, skip it.
21a4b1c0 1993 if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
477d6cee 1994
1995 }
6175da48 1996 //...............................................
1997 // Data, PID check off
477d6cee 1998 else{
f37fa8d2 1999 //Set PID bits for later selection (AliAnaPi0 for example)
2000 //GetPDG already called in SetPIDBits.
f2ccb5b8 2001 GetCaloPID()->SetPIDBits(fCalorimeter,calo,&aodph, GetCaloUtils());
a3aebfff 2002 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PID Bits set \n");
477d6cee 2003 }
2004
21a4b1c0 2005 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Photon selection cuts passed: pT %3.2f, pdg %d\n",aodph.Pt(), aodph.GetIdentifiedParticleType());
477d6cee 2006
477d6cee 2007
6175da48 2008 //--------------------------------------------------------------------------------------
2009 // Conversions pairs analysis
f37fa8d2 2010 // Check if cluster comes from a conversion in the material in front of the calorimeter
2011 // Do invariant mass of all pairs, if mass is close to 0, then it is conversion.
6175da48 2012 //--------------------------------------------------------------------------------------
521636d2 2013
6175da48 2014 // Do analysis only if there are more than one cluster
20218aea 2015 if( nCaloClusters > 1 && fCheckConversion){
c8fe2783 2016 Bool_t bConverted = kFALSE;
2017 Int_t id2 = -1;
1e86c71e 2018
f37fa8d2 2019 //Check if set previously as converted couple, if so skip its use.
20218aea 2020 if (indexConverted[icalo]) continue;
1e86c71e 2021
6175da48 2022 // Second cluster loop
c8fe2783 2023 for(Int_t jcalo = icalo + 1 ; jcalo < nCaloClusters ; jcalo++) {
f37fa8d2 2024 //Check if set previously as converted couple, if so skip its use.
c8fe2783 2025 if (indexConverted[jcalo]) continue;
f37fa8d2 2026 //printf("Check Conversion indeces %d and %d\n",icalo,jcalo);
521636d2 2027 AliVCluster * calo2 = (AliVCluster*) (pl->At(jcalo)); //Get cluster kinematics
6175da48 2028
c4a7d28a 2029
6175da48 2030 //Mixed event, get index of event
c8fe2783 2031 Int_t evtIndex2 = 0 ;
2032 if (GetMixedEvent()) {
2033 evtIndex2=GetMixedEvent()->EventIndexForCaloCluster(calo2->GetID()) ;
f8006433 2034
6175da48 2035 }
2036
2037 //Get kinematics of second cluster
f8006433 2038 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC){
8cdc266d 2039 calo2->GetMomentum(mom2,GetVertex(evtIndex2)) ;}//Assume that come from vertex in straight line
f8006433 2040 else{
2041 Double_t vertex[]={0,0,0};
8cdc266d 2042 calo2->GetMomentum(mom2,vertex) ;
f8006433 2043 }
2044
c4a7d28a 2045 //--------------------------------------
2046 // Cluster selection
2047 //--------------------------------------
2048
2049 if(!ClusterSelected(calo2,mom2)) continue;
2050
2051 //................................................
2052 // Get TOF of each cluster in pair, calculate difference if small,
2053 // take this pair. Way to reject clusters from hadrons (or pileup?)
2054 Double_t t12diff = calo2->GetTOF()-calo->GetTOF()*1e9;
2055 if(TMath::Abs(t12diff) > GetPairTimeCut()) continue;
c8fe2783 2056
6175da48 2057 //................................................
f37fa8d2 2058 //Get mass of pair, if small, take this pair.
41121cfe 2059 Float_t pairM = (mom+mom2).M();
2060 //printf("\t both in calo, mass %f, cut %f\n",pairM,fMassCut);
2061 if(pairM < fMassCut){
2062 aodph.SetTagged(kFALSE);
c8fe2783 2063 id2 = calo2->GetID();
6175da48 2064 indexConverted[icalo]=kTRUE;
c4a7d28a 2065 indexConverted[jcalo]=kTRUE;
41121cfe 2066 Float_t asymmetry = TMath::Abs(mom.E()-mom2.E())/(mom.E()+mom2.E());
2067 Float_t dPhi = mom.Phi()-mom2.Phi();
d39cba7e 2068 Float_t dEta = mom.Eta()-mom2.Eta();
41121cfe 2069
c4a7d28a 2070 //...............................................
2071 //Fill few histograms with kinematics of the pair
2072 //FIXME, move all this to MakeAnalysisFillHistograms ...
2073
2074 fhConvDeltaEta ->Fill( pairM, dPhi );
2075 fhConvDeltaPhi ->Fill( pairM, dEta );
2076 fhConvAsym ->Fill( pairM, asymmetry );
2077 fhConvDeltaEtaPhi->Fill( dEta , dPhi );
2078 fhConvPt ->Fill( pairM, (mom+mom2).Pt());
2079
d39cba7e 2080 //Estimate conversion distance, T. Awes, M. Ivanov
2081 //Under the assumption that the pair has zero mass, and that each electron
2082 //of the pair has the same momentum, they will each have the same bend radius
2083 //given by R=p/(qB) = p / (300 B) with p in [MeV/c], B in [Tesla] and R in [m].
2084 //With nominal ALICE magnet current of 30kA B=0.5T, and so with E_cluster=p,
2085 //R = E/1.5 [cm]. Under these assumptions, the distance from the conversion
3d5d5078 2086 //point to the MCEal can be related to the separation distance, L=2y, on the MCEal
d39cba7e 2087 //as d = sqrt(R^2 -(R-y)^2) = sqrt(2Ry - y^2). And since R>>y we can write as
2088 //d = sqrt(E*L/1.5) where E is the cluster energy and L is the distance in cm between
2089 //the clusters.
c4a7d28a 2090 Float_t pos1[3];
2091 calo->GetPosition(pos1);
2092 Float_t pos2[3];
2093 calo2->GetPosition(pos2);
2094 Float_t clustDist = TMath::Sqrt((pos1[0]-pos2[0])*(pos1[0]-pos2[0])+
521636d2 2095 (pos1[1]-pos2[1])*(pos1[1]-pos2[1])+
2096 (pos1[2]-pos2[2])*(pos1[2]-pos2[2]));
c4a7d28a 2097
2098 Float_t convDist = TMath::Sqrt(mom.E() *clustDist*0.01/0.15);
2099 Float_t convDist2 = TMath::Sqrt(mom2.E()*clustDist*0.01/0.15);
2100 //printf("l = %f, e1 = %f, d1=%f, e2 = %f, d2=%f\n",clustDist,mom.E(),convDist,mom2.E(),convDist2);
8cdc266d 2101 if(GetDebug() > 2)
41121cfe 2102 printf("AliAnaPhoton::MakeAnalysisFillAOD(): Pair with mass %2.3f < %2.3f, %1.2f < dPhi %2.2f < %2.2f, dEta %f < %2.2f, asymmetry %2.2f< %2.2f; \n cluster1 id %d, e %2.3f SM %d, eta %2.3f, phi %2.3f ; \n cluster2 id %d, e %2.3f, SM %d,eta %2.3f, phi %2.3f\n",
2103 pairM,fMassCut,fConvDPhiMinCut, dPhi, fConvDPhiMaxCut, dEta, fConvDEtaCut, asymmetry, fConvAsymCut,
8cdc266d 2104 calo->GetID(),calo->E(),GetCaloUtils()->GetModuleNumber(calo), mom.Eta(), mom.Phi(),
2105 id2, calo2->E(), GetCaloUtils()->GetModuleNumber(calo2),mom2.Eta(), mom2.Phi());
6175da48 2106
c4a7d28a 2107 fhConvDistEta ->Fill(mom .Eta(), convDist );
2108 fhConvDistEta ->Fill(mom2.Eta(), convDist2);
521636d2 2109 fhConvDistEn ->Fill(mom .E(), convDist );
2110 fhConvDistEn ->Fill(mom2.E(), convDist2);
c4a7d28a 2111 fhConvDistMass->Fill((mom+mom2).M(), convDist );
2112 //dEta cut
2113 if(dEta<0.05){
2114 fhConvDistEtaCutEta ->Fill(mom .Eta(), convDist );
2115 fhConvDistEtaCutEta ->Fill(mom2.Eta(), convDist2);
2116 fhConvDistEnCutEta ->Fill(mom .E(), convDist );
2117 fhConvDistEnCutEta ->Fill(mom2.E(), convDist2);
2118 fhConvDistMassCutEta->Fill((mom+mom2).M(), convDist );
2119 //mass cut
2120 if(pairM<0.01){//10 MeV
2121 fhConvDistEtaCutMass ->Fill(mom .Eta(), convDist );
2122 fhConvDistEtaCutMass ->Fill(mom2.Eta(), convDist2);
2123 fhConvDistEnCutMass ->Fill(mom .E(), convDist );
2124 fhConvDistEnCutMass ->Fill(mom2.E(), convDist2);
2125 // asymmetry cut
2126 if(asymmetry<0.1){
2127 fhConvDistEtaCutAsy ->Fill(mom .Eta(), convDist );
2128 fhConvDistEtaCutAsy ->Fill(mom2.Eta(), convDist2);
2129 fhConvDistEnCutAsy ->Fill(mom .E(), convDist );
2130 fhConvDistEnCutAsy ->Fill(mom2.E(), convDist2);
2131 }//asymmetry cut
2132 }//mass cut
2133 }//dEta cut
6175da48 2134
2135 //...............................................
2136 //Select pairs in a eta-phi window
41121cfe 2137 if(TMath::Abs(dEta) < fConvDEtaCut &&
2138 TMath::Abs(dPhi) < fConvDPhiMaxCut &&
2139 TMath::Abs(dPhi) > fConvDPhiMinCut &&
2140 asymmetry < fConvAsymCut ){
521636d2 2141 bConverted = kTRUE;
41121cfe 2142 }
2143 //printf("Accepted? %d\n",bConverted);
6175da48 2144 //...........................................
2145 //Fill more histograms, simulated data
2146 //FIXME, move all this to MakeAnalysisFillHistograms ...
2147 if(IsDataMC()){
2148
2149 //Check the origin of the pair, look for conversion, antinucleons or jet correlations (strings)
2150 Int_t ancPDG = 0;
2151 Int_t ancStatus = 0;
2152 TLorentzVector momentum;
c4a7d28a 2153 TVector3 prodVertex;
6175da48 2154 Int_t ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(calo->GetLabel(), calo2->GetLabel(),
c4a7d28a 2155 GetReader(), ancPDG, ancStatus, momentum, prodVertex);
6175da48 2156
2157 // printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Common ancestor label %d, pdg %d, name %s, status %d; \n",
2158 // ancLabel,ancPDG,TDatabasePDG::Instance()->GetParticle(ancPDG)->GetName(),ancStatus);
2159
2160 Int_t tag2 = GetMCAnalysisUtils()->CheckOrigin(calo2->GetLabels(),calo2->GetNLabels(),GetReader(), 0);
2161 if(GetMCAnalysisUtils()->CheckTagBit(aodph.GetTag(),AliMCAnalysisUtils::kMCConversion)){
2162 if(GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCConversion) && (ancPDG==22 || TMath::Abs(ancPDG)==11) && ancLabel > -1){
41121cfe 2163 fhConvDeltaEtaMCConversion ->Fill( pairM, dEta );
2164 fhConvDeltaPhiMCConversion ->Fill( pairM, dPhi );
2165 fhConvAsymMCConversion ->Fill( pairM, asymmetry );
2166 fhConvDeltaEtaPhiMCConversion->Fill( dEta , dPhi );
2167 fhConvPtMCConversion ->Fill( pairM, (mom+mom2).Pt());
6175da48 2168 fhConvDispersionMCConversion ->Fill( calo->GetDispersion(), calo2->GetDispersion());
2169 fhConvM02MCConversion ->Fill( calo->GetM02(), calo2->GetM02());
c4a7d28a 2170 fhConvDistMCConversion ->Fill( convDist , prodVertex.Mag() );
2171 fhConvDistMCConversion ->Fill( convDist2, prodVertex.Mag() );
2172
2173 if(dEta<0.05 && pairM<0.01 && asymmetry<0.1){
2174 fhConvDistMCConversionCuts->Fill( convDist , prodVertex.Mag() );
2175 fhConvDistMCConversionCuts->Fill( convDist2, prodVertex.Mag() );
2176 }
521636d2 2177
6175da48 2178 }
2179 }
2180 else if(GetMCAnalysisUtils()->CheckTagBit(aodph.GetTag(),AliMCAnalysisUtils::kMCAntiNeutron)){
2181 if(GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCAntiNeutron) && ancPDG==-2112 && ancLabel > -1){
41121cfe 2182 fhConvDeltaEtaMCAntiNeutron ->Fill( pairM, dEta );
2183 fhConvDeltaPhiMCAntiNeutron ->Fill( pairM, dPhi );
2184 fhConvAsymMCAntiNeutron ->Fill( pairM, asymmetry );
2185 fhConvDeltaEtaPhiMCAntiNeutron ->Fill( dEta , dPhi );
2186 fhConvPtMCAntiNeutron ->Fill( pairM, (mom+mom2).Pt());
6175da48 2187 fhConvDispersionMCAntiNeutron ->Fill( calo->GetDispersion(), calo2->GetDispersion());
2188 fhConvM02MCAntiNeutron ->Fill( calo->GetM02(), calo2->GetM02());
2189 }
2190 }
2191 else if(GetMCAnalysisUtils()->CheckTagBit(aodph.GetTag(),AliMCAnalysisUtils::kMCAntiProton)){
2192 if(GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCAntiProton) && ancPDG==-2212 && ancLabel > -1){
41121cfe 2193 fhConvDeltaEtaMCAntiProton ->Fill( pairM, dEta );
2194 fhConvDeltaPhiMCAntiProton ->Fill( pairM, dPhi );
2195 fhConvAsymMCAntiProton ->Fill( pairM, asymmetry );
2196 fhConvDeltaEtaPhiMCAntiProton ->Fill( dEta , dPhi );
2197 fhConvPtMCAntiProton ->Fill( pairM, (mom+mom2).Pt());
6175da48 2198 fhConvDispersionMCAntiProton ->Fill( calo->GetDispersion(), calo2->GetDispersion());
2199 fhConvM02MCAntiProton ->Fill( calo->GetM02(), calo2->GetM02());
2200 }
2201 }
2202
2203 //Pairs coming from fragmenting pairs.
2204 if(ancPDG < 22 && ancLabel > 7 && (ancStatus == 11 || ancStatus == 12) ){
41121cfe 2205 fhConvDeltaEtaMCString ->Fill( pairM, dPhi);
2206 fhConvDeltaPhiMCString ->Fill( pairM, dPhi);
2207 fhConvAsymMCString ->Fill( pairM, TMath::Abs(mom.E()-mom2.E())/(mom.E()+mom2.E()) );
2208 fhConvDeltaEtaPhiMCString ->Fill( dPhi, dPhi );
2209 fhConvPtMCString ->Fill( pairM, (mom+mom2).Pt());
6175da48 2210 fhConvDispersionMCString ->Fill( calo->GetDispersion(), calo2->GetDispersion());
2211 fhConvM02MCString ->Fill( calo->GetM02(), calo2->GetM02());
2212 }
2213
2214 }// Data MC
521636d2 2215
c8fe2783 2216 break;
2217 }
1e86c71e 2218
c8fe2783 2219 }//Mass loop
1e86c71e 2220
6175da48 2221 //..........................................................................................................
2222 //Pair selected as converted, remove both clusters or recombine them into a photon and put them in the AOD
c8fe2783 2223 if(bConverted){
6175da48 2224 //Add to AOD
c8fe2783 2225 if(fAddConvertedPairsToAOD){
f37fa8d2 2226 //Create AOD of pair analysis
c8fe2783 2227 TLorentzVector mpair = mom+mom2;
2228 AliAODPWG4Particle aodpair = AliAODPWG4Particle(mpair);
2229 aodpair.SetLabel(aodph.GetLabel());
f8006433 2230 //aodpair.SetInputFileIndex(input);
c8fe2783 2231
f37fa8d2 2232 //printf("Index %d, Id %d\n",icalo, calo->GetID());
2233 //Set the indeces of the original caloclusters
c8fe2783 2234 aodpair.SetCaloLabel(calo->GetID(),id2);
2235 aodpair.SetDetector(fCalorimeter);
21a4b1c0 2236 aodpair.SetIdentifiedParticleType(aodph.GetIdentifiedParticleType());
c8fe2783 2237 aodpair.SetTag(aodph.GetTag());
6175da48 2238 aodpair.SetTagged(kTRUE);
f37fa8d2 2239 //Add AOD with pair object to aod branch
c8fe2783 2240 AddAODParticle(aodpair);
f37fa8d2 2241 //printf("\t \t both added pair\n");
c8fe2783 2242 }
2243
f37fa8d2 2244 //Do not add the current calocluster
20218aea 2245 if(fRemoveConvertedPair) continue;
6175da48 2246 else {
2247 //printf("TAGGED\n");
2248 //Tag this cluster as likely conversion
2249 aodph.SetTagged(kTRUE);
2250 }
c8fe2783 2251 }//converted pair
2252 }//check conversion
f37fa8d2 2253 //printf("\t \t added single cluster %d\n",icalo);
1e86c71e 2254
6175da48 2255 //FIXME, this to MakeAnalysisFillHistograms ...
f66d95af 2256 Int_t absID = 0;
2257 Float_t maxCellFraction = 0;
2258 AliVCaloCells* cells = 0;
6175da48 2259
f66d95af 2260 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
2261 else cells = GetPHOSCells();
2262
2263 absID = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
2264
2265 fhMaxCellDiffClusterE->Fill(aodph.E(),maxCellFraction);
2266 fhNCellsE ->Fill(aodph.E(),calo->GetNCells());
2267
f37fa8d2 2268 //Add AOD with photon object to aod branch
477d6cee 2269 AddAODParticle(aodph);
2270
2271 }//loop
2272
4a745797 2273 delete [] indexConverted;
2274
f37fa8d2 2275 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() End fill AODs, with %d entries \n",GetOutputAODBranch()->GetEntriesFast());
477d6cee 2276
1c5acb87 2277}
2278
2279//__________________________________________________________________
2280void AliAnaPhoton::MakeAnalysisFillHistograms()
2281{
6175da48 2282 //Fill histograms
f8006433 2283
6175da48 2284 //-------------------------------------------------------------------
577d9801 2285 // Access MC information in stack if requested, check that it exists.
521636d2 2286 AliStack * stack = 0x0;
2287 TParticle * primary = 0x0;
2288 TClonesArray * mcparticles = 0x0;
2289 AliAODMCParticle * aodprimary = 0x0;
2290
577d9801 2291 if(IsDataMC()){
521636d2 2292
577d9801 2293 if(GetReader()->ReadStack()){
2294 stack = GetMCStack() ;
2295 if(!stack) {
3d5d5078 2296 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
2297 abort();
577d9801 2298 }
f8006433 2299
577d9801 2300 }
2301 else if(GetReader()->ReadAODMCParticles()){
f8006433 2302
577d9801 2303 //Get the list of MC particles
521636d2 2304 mcparticles = GetReader()->GetAODMCParticles(0);
2305 if(!mcparticles && GetDebug() > 0) {
3d5d5078 2306 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n");
577d9801 2307 }
577d9801 2308 }
2309 }// is data and MC
521636d2 2310
6175da48 2311
2312 // Get vertex
2244659d 2313 Double_t v[3] = {0,0,0}; //vertex ;
2314 GetReader()->GetVertex(v);
6175da48 2315 //fhVertex->Fill(v[0],v[1],v[2]);
2316 if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
2317
2318 //----------------------------------
577d9801 2319 //Loop on stored AOD photons
2320 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
577d9801 2321 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
521636d2 2322
577d9801 2323 for(Int_t iaod = 0; iaod < naod ; iaod++){
2324 AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
2325 Int_t pdg = ph->GetIdentifiedParticleType();
521636d2 2326
577d9801 2327 if(GetDebug() > 3)
2328 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n", ph->GetIdentifiedParticleType(),ph->GetTag(), (ph->GetDetector()).Data()) ;
521636d2 2329
577d9801 2330 //If PID used, fill histos with photons in Calorimeter fCalorimeter
2331 if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue;
2332 if(ph->GetDetector() != fCalorimeter) continue;
521636d2 2333
577d9801 2334 if(GetDebug() > 2)
2335 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ;
521636d2 2336
6175da48 2337 //................................
577d9801 2338 //Fill photon histograms
2339 Float_t ptcluster = ph->Pt();
2340 Float_t phicluster = ph->Phi();
2341 Float_t etacluster = ph->Eta();
2342 Float_t ecluster = ph->E();
521636d2 2343
20218aea 2344 fhEPhoton ->Fill(ecluster);
577d9801 2345 fhPtPhoton ->Fill(ptcluster);
2346 fhPhiPhoton ->Fill(ptcluster,phicluster);
2347 fhEtaPhoton ->Fill(ptcluster,etacluster);
521636d2 2348 if (ecluster > 0.5) fhEtaPhiPhoton ->Fill(etacluster, phicluster);
20218aea 2349 else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster);
2350
2351 if(fCheckConversion &&ph->IsTagged()){
2352 fhPtPhotonConv->Fill(ptcluster);
2353 if(ecluster > 0.5) fhEtaPhiPhotonConv ->Fill(etacluster, phicluster);
2354 else if(GetMinPt() < 0.5) fhEtaPhi05PhotonConv->Fill(etacluster, phicluster);
6175da48 2355 }
20218aea 2356
6175da48 2357 //.......................................
577d9801 2358 //Play with the MC data if available
2359 if(IsDataMC()){
521636d2 2360
3d5d5078 2361 FillAcceptanceHistograms();
2362
4c8f7c2e 2363
2364 //....................................................................
2365 // Access MC information in stack if requested, check that it exists.
2366 Int_t label =ph->GetLabel();
2367 if(label < 0) {
2368 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** bad label ***: label %d \n", label);
2369 continue;
2370 }
2371
2372 Float_t eprim = 0;
2373 Float_t ptprim = 0;
2374 if(GetReader()->ReadStack()){
2375
2376 if(label >= stack->GetNtrack()) {
2377 if(GetDebug() > 2) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n", label, stack->GetNtrack());
2378 continue ;
2379 }
2380
2381 primary = stack->Particle(label);
2382 if(!primary){
2383 printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** no primary ***: label %d \n", label);
2384 continue;
2385 }
2386 eprim = primary->Energy();
2387 ptprim = primary->Pt();
2388
2389 }
2390 else if(GetReader()->ReadAODMCParticles()){
2391 //Check which is the input
2392 if(ph->GetInputFileIndex() == 0){
2393 if(!mcparticles) continue;
2394 if(label >= mcparticles->GetEntriesFast()) {
2395 if(GetDebug() > 2) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n",
2396 label, mcparticles->GetEntriesFast());
2397 continue ;
2398 }
2399 //Get the particle
2400 aodprimary = (AliAODMCParticle*) mcparticles->At(label);
2401
2402 }
2403
2404 if(!aodprimary){
2405 printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** no primary ***: label %d \n", label);
2406 continue;
2407 }
2408
2409 eprim = aodprimary->E();
2410 ptprim = aodprimary->Pt();
2411
2412 }
2413
577d9801 2414 Int_t tag =ph->GetTag();
521636d2 2415
f66d95af 2416 if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[mcPhoton])
3d5d5078 2417 {
2418 fhMCE [mcPhoton] ->Fill(ecluster);
4c8f7c2e 2419 fhMCPt [mcPhoton] ->Fill(ptcluster);
2420 fhMCPhi[mcPhoton] ->Fill(ecluster,phicluster);
2421 fhMCEta[mcPhoton] ->Fill(ecluster,etacluster);
2422
2423 fhMC2E[mcPhoton] ->Fill(ecluster, eprim);
2424 fhMC2Pt[mcPhoton] ->Fill(ptcluster, ptprim);
2425 fhMCDeltaE[mcPhoton] ->Fill(eprim-ecluster);
2426 fhMCDeltaPt[mcPhoton]->Fill(ptprim-ptcluster);
2427 if(eprim > 0) fhMCRatioE[mcPhoton] ->Fill(ecluster/eprim);
2428 if(ptprim > 0) fhMCRatioPt[mcPhoton] ->Fill(ptcluster/ptprim);
3d5d5078 2429
f66d95af 2430 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) && fhMCE[mcConversion])
3d5d5078 2431 {
2432 fhMCE [mcConversion] ->Fill(ecluster);
4c8f7c2e 2433 fhMCPt [mcConversion] ->Fill(ptcluster);
2434 fhMCPhi[mcConversion] ->Fill(ecluster,phicluster);
2435 fhMCEta[mcConversion] ->Fill(ecluster,etacluster);
2436
2437 fhMC2E[mcConversion] ->Fill(ecluster, eprim);
2438 fhMC2Pt[mcConversion] ->Fill(ptcluster, ptprim);
2439 fhMCDeltaE[mcConversion] ->Fill(eprim-ecluster);
2440 fhMCDeltaPt[mcConversion]->Fill(ptprim-ptcluster);
2441 if(eprim > 0) fhMCRatioE[mcConversion] ->Fill(ecluster/eprim);
2442 if(ptprim > 0) fhMCRatioPt[mcConversion] ->Fill(ptcluster/ptprim);
3d5d5078 2443
2444 if(fCheckConversion){
2445 if(ph->IsTagged()) fhPtConversionTagged ->Fill(ptcluster);
2446 if(ptcluster > 0.5)fhEtaPhiConversion ->Fill(etacluster,phicluster);
2447 else fhEtaPhi05Conversion ->Fill(etacluster,phicluster);
2448 }
2449 }
2450
f66d95af 2451 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhMCE[mcPrompt]){
3d5d5078 2452 fhMCE [mcPrompt] ->Fill(ecluster);
4c8f7c2e 2453 fhMCPt [mcPrompt] ->Fill(ptcluster);
2454 fhMCPhi[mcPrompt] ->Fill(ecluster,phicluster);
2455 fhMCEta[mcPrompt] ->Fill(ecluster,etacluster);
2456
2457 fhMC2E[mcPrompt] ->Fill(ecluster, eprim);
2458 fhMC2Pt[mcPrompt] ->Fill(ptcluster, ptprim);
2459 fhMCDeltaE[mcPrompt] ->Fill(eprim-ecluster);
2460 fhMCDeltaPt[mcPrompt]->Fill(ptprim-ptcluster);
2461 if(eprim > 0) fhMCRatioE[mcPrompt] ->Fill(ecluster/eprim);
2462 if(ptprim > 0) fhMCRatioPt[mcPrompt] ->Fill(ptcluster/ptprim);
2463
3d5d5078 2464 }
f66d95af 2465 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)&& fhMCE[mcFragmentation])
3d5d5078 2466 {
2467 fhMCE [mcFragmentation] ->Fill(ecluster);
4c8f7c2e 2468 fhMCPt [mcFragmentation] ->Fill(ptcluster);
2469 fhMCPhi[mcFragmentation] ->Fill(ecluster,phicluster);
2470 fhMCEta[mcFragmentation] ->Fill(ecluster,etacluster);
2471
2472 fhMC2E[mcFragmentation] ->Fill(ecluster, eprim);
2473 fhMC2Pt[mcFragmentation] ->Fill(ptcluster, ptprim);
2474 fhMCDeltaE[mcFragmentation] ->Fill(eprim-ecluster);
2475 fhMCDeltaPt[mcFragmentation]->Fill(ptprim-ptcluster);
2476 if(eprim > 0) fhMCRatioE[mcFragmentation] ->Fill(ecluster/eprim);
2477 if(ptprim > 0) fhMCRatioPt[mcFragmentation] ->Fill(ptcluster/ptprim);
3d5d5078 2478
2479 }
f66d95af 2480 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR)&& fhMCE[mcISR])
3d5d5078 2481 {
2482 fhMCE [mcISR] ->Fill(ecluster);
4c8f7c2e 2483 fhMCPt [mcISR] ->Fill(ptcluster);
2484 fhMCPhi[mcISR] ->Fill(ecluster,phicluster);
2485 fhMCEta[mcISR] ->Fill(ecluster,etacluster);
2486
2487 fhMC2E[mcISR] ->Fill(ecluster, eprim);
2488 fhMC2Pt[mcISR] ->Fill(ptcluster, ptprim);
2489 fhMCDeltaE[mcISR] ->Fill(eprim-ecluster);
2490 fhMCDeltaPt[mcISR]->Fill(ptprim-ptcluster);
2491 if(eprim > 0) fhMCRatioE[mcISR] ->Fill(ecluster/eprim);
2492 if(ptprim > 0) fhMCRatioPt[mcISR] ->Fill(ptcluster/ptprim);
2493
3d5d5078 2494 }
2495 else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
f66d95af 2496 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[mcPi0Decay])
3d5d5078 2497 {
2498 fhMCE [mcPi0Decay] ->Fill(ecluster);
4c8f7c2e 2499 fhMCPt [mcPi0Decay] ->Fill(ptcluster);
2500 fhMCPhi[mcPi0Decay] ->Fill(ecluster,phicluster);
2501 fhMCEta[mcPi0Decay] ->Fill(ecluster,etacluster);
2502
2503 fhMC2E[mcPi0Decay] ->Fill(ecluster, eprim);
2504 fhMC2Pt[mcPi0Decay] ->Fill(ptcluster, ptprim);
2505 fhMCDeltaE[mcPi0Decay] ->Fill(eprim-ecluster);
2506 fhMCDeltaPt[mcPi0Decay]->Fill(ptprim-ptcluster);
2507 if(eprim > 0) fhMCRatioE[mcPi0Decay] ->Fill(ecluster/eprim);
2508 if(ptprim > 0) fhMCRatioPt[mcPi0Decay] ->Fill(ptcluster/ptprim);
2509
2510
3d5d5078 2511 }
2512 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
f66d95af 2513 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) && fhMCE[mcOtherDecay])
3d5d5078 2514 {
2515 fhMCE [mcOtherDecay] ->Fill(ecluster);
4c8f7c2e 2516 fhMCPt [mcOtherDecay] ->Fill(ptcluster);
2517 fhMCPhi[mcOtherDecay] ->Fill(ecluster,phicluster);
2518 fhMCEta[mcOtherDecay] ->Fill(ecluster,etacluster);
2519
2520 fhMC2E[mcOtherDecay] ->Fill(ecluster, eprim);
2521 fhMC2Pt[mcOtherDecay] ->Fill(ptcluster, ptprim);
2522 fhMCDeltaE[mcOtherDecay] ->Fill(eprim-ecluster);
2523 fhMCDeltaPt[mcOtherDecay]->Fill(ptprim-ptcluster);
2524 if(eprim > 0) fhMCRatioE[mcOtherDecay] ->Fill(ecluster/eprim);
2525 if(ptprim > 0) fhMCRatioPt[mcOtherDecay] ->Fill(ptcluster/ptprim);
2526
3d5d5078 2527 }
f66d95af 2528 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE [mcPi0])
3d5d5078 2529 {
2530 fhMCE [mcPi0] ->Fill(ecluster);
4c8f7c2e 2531 fhMCPt [mcPi0] ->Fill(ptcluster);
2532 fhMCPhi[mcPi0] ->Fill(ecluster,phicluster);
2533 fhMCEta[mcPi0] ->Fill(ecluster,etacluster);
2534
2535 fhMC2E[mcPi0] ->Fill(ecluster, eprim);
2536 fhMC2Pt[mcPi0] ->Fill(ptcluster, ptprim);
2537 fhMCDeltaE[mcPi0] ->Fill(eprim-ecluster);
2538 fhMCDeltaPt[mcPi0]->Fill(ptprim-ptcluster);
2539 if(eprim > 0) fhMCRatioE[mcPi0] ->Fill(ecluster/eprim);
2540 if(ptprim > 0) fhMCRatioPt[mcPi0] ->Fill(ptcluster/ptprim);
2541
f66d95af 2542 }
2543 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[mcEta])
2544 {
2545 fhMCE [mcEta] ->Fill(ecluster);
4c8f7c2e 2546 fhMCPt [mcEta] ->Fill(ptcluster);
2547 fhMCPhi[mcEta] ->Fill(ecluster,phicluster);
2548 fhMCEta[mcEta] ->Fill(ecluster,etacluster);
2549
2550 fhMC2E[mcEta] ->Fill(ecluster, eprim);
2551 fhMC2Pt[mcEta] ->Fill(ptcluster, ptprim);
2552 fhMCDeltaE[mcEta] ->Fill(eprim-ecluster);
2553 fhMCDeltaPt[mcEta]->Fill(ptprim-ptcluster);
2554 if(eprim > 0) fhMCRatioE[mcEta] ->Fill(ecluster/eprim);
2555 if(ptprim > 0) fhMCRatioPt[mcEta] ->Fill(ptcluster/ptprim);
2556
f66d95af 2557 }
3d5d5078 2558 }
f66d95af 2559 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[mcAntiNeutron])
3d5d5078 2560 {
2561 fhMCE [mcAntiNeutron] ->Fill(ecluster);
4c8f7c2e 2562 fhMCPt [mcAntiNeutron] ->Fill(ptcluster);
2563 fhMCPhi[mcAntiNeutron] ->Fill(ecluster,phicluster);
2564 fhMCEta[mcAntiNeutron] ->Fill(ecluster,etacluster);
3d5d5078 2565 if(ph->IsTagged() && fCheckConversion) fhPtAntiNeutronTagged ->Fill(ptcluster);
2566
4c8f7c2e 2567 fhMC2E[mcAntiNeutron] ->Fill(ecluster, eprim);
2568 fhMC2Pt[mcAntiNeutron] ->Fill(ptcluster, ptprim);
2569 fhMCDeltaE[mcAntiNeutron] ->Fill(eprim-ecluster);
2570 fhMCDeltaPt[mcAntiNeutron]->Fill(ptprim-ptcluster);
2571 if(eprim > 0) fhMCRatioE[mcAntiNeutron] ->Fill(ecluster/eprim);
2572 if(ptprim > 0) fhMCRatioPt[mcAntiNeutron] ->Fill(ptcluster/ptprim);
2573
3d5d5078 2574 }
f66d95af 2575 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[mcAntiProton])
3d5d5078 2576 {
2577 fhMCE [mcAntiProton] ->Fill(ecluster);
4c8f7c2e 2578 fhMCPt [mcAntiProton] ->Fill(ptcluster);
2579 fhMCPhi[mcAntiProton] ->Fill(ecluster,phicluster);
2580 fhMCEta[mcAntiProton] ->Fill(ecluster,etacluster);
3d5d5078 2581 if(ph->IsTagged() && fCheckConversion) fhPtAntiProtonTagged ->Fill(ptcluster);
4c8f7c2e 2582
2583 fhMC2E[mcAntiProton] ->Fill(ecluster, eprim);
2584 fhMC2Pt[mcAntiProton] ->Fill(ptcluster, ptprim);
2585 fhMCDeltaE[mcAntiProton] ->Fill(eprim-ecluster);
2586 fhMCDeltaPt[mcAntiProton]->Fill(ptprim-ptcluster);
2587 if(eprim > 0) fhMCRatioE[mcAntiProton] ->Fill(ecluster/eprim);
2588 if(ptprim > 0) fhMCRatioPt[mcAntiProton] ->Fill(ptcluster/ptprim);
2589
3d5d5078 2590 }
f66d95af 2591 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[mcElectron])
3d5d5078 2592 {
2593 fhMCE [mcElectron] ->Fill(ecluster);
4c8f7c2e 2594 fhMCPt [mcElectron] ->Fill(ptcluster);
2595 fhMCPhi[mcElectron] ->Fill(ecluster,phicluster);
2596 fhMCEta[mcElectron] ->Fill(ecluster,etacluster);
2597
2598 fhMC2E[mcElectron] ->Fill(ecluster, eprim);
2599 fhMC2Pt[mcElectron] ->Fill(ptcluster, ptprim);
2600 fhMCDeltaE[mcElectron] ->Fill(eprim-ecluster);
2601 fhMCDeltaPt[mcElectron]->Fill(ptprim-ptcluster);
2602 if(eprim > 0) fhMCRatioE[mcElectron] ->Fill(ecluster/eprim);
2603 if(ptprim > 0) fhMCRatioPt[mcElectron] ->Fill(ptcluster/ptprim);
2604
3d5d5078 2605 }
f66d95af 2606 else if( fhMCE[mcOther]){
3d5d5078 2607 fhMCE [mcOther] ->Fill(ecluster);
4c8f7c2e 2608 fhMCPt [mcOther] ->Fill(ptcluster);
2609 fhMCPhi[mcOther] ->Fill(ecluster,phicluster);
2610 fhMCEta[mcOther] ->Fill(ecluster,etacluster);
20218aea 2611 if(ph->IsTagged() && fCheckConversion) fhPtUnknownTagged ->Fill(ptcluster);
521636d2 2612
4c8f7c2e 2613 fhMC2E[mcOther] ->Fill(ecluster, eprim);
2614 fhMC2Pt[mcOther] ->Fill(ptcluster, ptprim);
2615 fhMCDeltaE[mcOther] ->Fill(eprim-ecluster);
2616 fhMCDeltaPt[mcOther]->Fill(ptprim-ptcluster);
2617 if(eprim > 0) fhMCRatioE[mcOther] ->Fill(ecluster/eprim);
2618 if(ptprim > 0) fhMCRatioPt[mcOther] ->Fill(ptcluster/ptprim);
2619
3d5d5078 2620
f8006433 2621 // printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ",
2622 // ph->GetLabel(),ph->Pt());
2623 // for(Int_t i = 0; i < 20; i++) {
2624 // if(GetMCAnalysisUtils()->CheckTagBit(tag,i)) printf(" %d, ",i);
2625 // }
2626 // printf("\n");
2627
577d9801 2628 }
521636d2 2629
577d9801 2630 }//Histograms with MC
521636d2 2631
577d9801 2632 }// aod loop
521636d2 2633
1c5acb87 2634}
2635
2636
2637//__________________________________________________________________
2638void AliAnaPhoton::Print(const Option_t * opt) const
2639{
477d6cee 2640 //Print some relevant parameters set for the analysis
2641
2642 if(! opt)
2643 return;
2644
2645 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2646 AliAnaPartCorrBaseClass::Print(" ");
a3aebfff 2647
477d6cee 2648 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
2649 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
2650 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
2651 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);
a3aebfff 2652 printf("Reject clusters with a track matched = %d\n",fRejectTrackMatch);
1e86c71e 2653 printf("Check Pair Conversion = %d\n",fCheckConversion);
2654 printf("Add conversion pair to AOD = %d\n",fAddConvertedPairsToAOD);
2655 printf("Conversion pair mass cut = %f\n",fMassCut);
41121cfe 2656 printf("Conversion selection cut : A < %1.2f; %1.3f < Dphi < %1.3f; Deta < %1.3f\n",
2657 fConvAsymCut,fConvDPhiMinCut, fConvDPhiMaxCut, fConvDEtaCut);
4cf55759 2658 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2ac125bf 2659 printf("Number of cells in cluster is > %d \n", fNCellsCut);
477d6cee 2660 printf(" \n") ;
1c5acb87 2661
2662}