AliPhysics  9b6b435 (9b6b435)
AliAnaElectron.cxx
Go to the documentation of this file.
1  /**************************************************************************
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 *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 // --- ROOT system ---
17 #include <TH2F.h>
18 #include <TH3D.h>
19 #include <TClonesArray.h>
20 #include <TObjString.h>
21 //#include <Riostream.h>
22 #include "TDatabasePDG.h"
23 #include "AliVTrack.h"
24 
25 // --- Analysis system ---
26 #include "AliAnaElectron.h"
27 #include "AliCaloTrackReader.h"
28 #include "AliMCEvent.h"
29 #include "AliCaloPID.h"
30 #include "AliMCAnalysisUtils.h"
31 #include "AliFiducialCut.h"
32 #include "AliVCluster.h"
33 #include "AliVParticle.h"
34 #include "AliMixedEvent.h"
35 #include "AliPIDResponse.h"
36 #include "AliESDInputHandler.h"
37 #include "AliAODInputHandler.h"
38 
40 ClassImp(AliAnaElectron) ;
42 
43 //________________________________
45 //________________________________
48 fMinDist(0.),
49 fTimeCutMin(-1), fTimeCutMax(999999),
50 fNCellsCut(0), fNLMCutMin(-1), fNLMCutMax(10),
51 fFillSSHistograms(kFALSE), fFillOnlySimpleSSHisto(1),
52 fFillWeightHistograms(kFALSE), fNOriginHistograms(8),
53 fdEdxMin(0.), fdEdxMax(400.),
54 fEOverPMin(0), fEOverPMax(2),
55 fNSigmaMin(-100), fNSigmaMax(100),
56 fM20Min(-1), fM20Max(100),
57 fM02Min(0), fM02Max(100),
58 fdEdxMinHad(0.), fdEdxMaxHad(400.),
59 fEOverPMinHad(0), fEOverPMaxHad(100),
60 fNSigmaMinHad(-100), fNSigmaMaxHad(100),
61 fAODParticle(0),
62 fMomentum(), fMomentumMC(), fProdVertex(),
63 
64 // Histograms
65 fhdEdxvsE(0), fhdEdxvsP(0),
66 fhdEdxvsECutM02(0), fhdEdxvsPCutM02(0),
67 fhdEdxvsECutM02AndM20(0), fhdEdxvsPCutM02AndM20(0),
68 fhdEdxvsECutEOverP(0), fhdEdxvsPCutEOverP(0),
69 fhdEdxvsECutNSigma(0), fhdEdxvsPCutNSigma(0),
70 fhdEdxvsECutM02CutNSigma(0), fhdEdxvsPCutM02CutNSigma(0),
71 fhdEdxvsECutM02AndM20CutNSigma(0), fhdEdxvsPCutM02AndM20CutNSigma(0),
72 
73 fhEOverPvsE(0), fhEOverPvsP(0),
74 fhEOverPvsECutM02(0), fhEOverPvsPCutM02(0),
75 fhEOverPvsECutM02AndM20(0), fhEOverPvsPCutM02AndM20(0),
76 fhEOverPvsECutdEdx(0), fhEOverPvsPCutdEdx(0),
77 fhEOverPvsECutM02CutdEdx(0), fhEOverPvsPCutM02CutdEdx(0),
78 fhEOverPvsECutM02AndM20CutdEdx(0), fhEOverPvsPCutM02AndM20CutdEdx(0),
79 fhEOverPvsECutNSigma(0), fhEOverPvsPCutNSigma(0),
80 fhEOverPvsECutM02CutNSigma(0), fhEOverPvsPCutM02CutNSigma(0),
81 fhEOverPvsECutM02AndM20CutNSigma(0), fhEOverPvsPCutM02AndM20CutNSigma(0),
82 
83 fhNSigmavsE(0), fhNSigmavsP(0),
84 fhNSigmavsECutM02(0), fhNSigmavsPCutM02(0),
85 fhNSigmavsECutM02AndM20(0), fhNSigmavsPCutM02AndM20(0),
86 fhNSigmavsECutdEdx(0), fhNSigmavsPCutdEdx(0),
87 fhNSigmavsECutM02CutdEdx(0), fhNSigmavsPCutM02CutdEdx(0),
88 fhNSigmavsECutM02AndM20CutdEdx(0), fhNSigmavsPCutM02AndM20CutdEdx(0),
89 fhNSigmavsECutEOverP(0), fhNSigmavsPCutEOverP(0),
90 
91 // Weight studies
92 fhECellClusterRatio(0), fhECellClusterLogRatio(0),
93 fhEMaxCellClusterRatio(0), fhEMaxCellClusterLogRatio(0),
94 
95 // MC histograms
96 // Electron SS MC histograms
97 fhMCElectronELambda0NoOverlap(0),
98 fhMCElectronELambda0TwoOverlap(0), fhMCElectronELambda0NOverlap(0),
99 
100 //Embedding
101 fhEmbeddedSignalFractionEnergy(0),
102 fhEmbedElectronELambda0FullSignal(0), fhEmbedElectronELambda0MostlySignal(0),
103 fhEmbedElectronELambda0MostlyBkg(0), fhEmbedElectronELambda0FullBkg(0)
104 {
105  for(Int_t index = 0; index < 2; index++)
106  {
107  fhNCellsE [index] = 0;
108  fhNLME [index] = 0;
109  fhTimeE [index] = 0;
110  fhMaxCellDiffClusterE[index] = 0;
111  fhE [index] = 0;
112  fhPt [index] = 0;
113  fhPhi [index] = 0;
114  fhEta [index] = 0;
115  fhEtaPhi [index] = 0;
116  fhEtaPhi05[index] = 0;
117 
118  // Shower shape histograms
119  fhDispE [index] = 0;
120  fhLam0E [index] = 0;
121  fhLam1E [index] = 0;
122  fhDispETRD[index] = 0;
123  fhLam0ETRD[index] = 0;
124  fhLam1ETRD[index] = 0;
125  fhNCellsLam0LowE [index] = 0;
126  fhNCellsLam0HighE[index] = 0;
127  fhEtaLam0LowE [index] = 0;
128  fhPhiLam0LowE [index] = 0;
129  fhEtaLam0HighE [index] = 0;
130  fhPhiLam0HighE [index] = 0;
131 
132  fhDispEtaE [index] = 0;
133  fhDispPhiE [index] = 0;
134  fhSumEtaE [index] = 0;
135  fhSumPhiE [index] = 0;
136  fhSumEtaPhiE [index] = 0;
137  fhDispEtaPhiDiffE[index] = 0;
138  fhSphericityE [index] = 0;
139 
140  for(Int_t i = 0; i < 10; i++)
141  {
142  fhMCPt [index][i] = 0;
143  fhMCE [index][i] = 0;
144  fhMCPhi [index][i] = 0;
145  fhMCEta [index][i] = 0;
146  fhMCDeltaE [index][i] = 0;
147  fhMC2E [index][i] = 0;
148  fhMCdEdxvsE [i] = 0;
149  fhMCdEdxvsP [i] = 0;
150  fhMCNSigmavsE [i] = 0;
151  fhMCNSigmavsP [i] = 0;
152  fhMCEOverPvsE [i] = 0;
153  fhMCEOverPvsP [i] = 0;
154  fhMCEOverPvsEAfterCuts[i][index] = 0;
155  fhMCEOverPvsPAfterCuts[i][index] = 0;
156  }
157 
158  for(Int_t i = 0; i < 6; i++)
159  {
160  fhMCELambda0 [index][i] = 0;
161  fhMCELambda1 [index][i] = 0;
162  fhMCEDispEta [index][i] = 0;
163  fhMCEDispPhi [index][i] = 0;
164  fhMCESumEtaPhi [index][i] = 0;
165  fhMCEDispEtaPhiDiff[index][i] = 0;
166  fhMCESphericity [index][i] = 0;
167  }
168 
169  for(Int_t i = 0; i < 5; i++)
170  {
171  fhDispEtaDispPhiEBin[index][i] = 0 ;
172  }
173  }
174 
175  // Mathching Residuals
176  for(Int_t indexPID = 0; indexPID < 3; indexPID++)
177  {
178  for(Int_t ich = 0; ich < 2; ich++)
179  {
180  fhDEtavsE [indexPID][ich] = 0 ;
181  fhDPhivsE [indexPID][ich] = 0 ;
182  fhDEtavsP [indexPID][ich] = 0 ;
183  fhDPhivsP [indexPID][ich] = 0 ;
184  fhDEtaDPhi[indexPID][ich] = 0 ;
185  }
186  }
187 
188  // Weight studies
189  for(Int_t i =0; i < 14; i++)
190  {
191  fhLambda0ForW0[i] = 0;
192  //fhLambda1ForW0[i] = 0;
193  }
194 
195  // Initialize parameters
196  InitParameters();
197 }
198 
199 //____________________________________________________________________________
215 //____________________________________________________________________________
216 Bool_t AliAnaElectron::ClusterSelected(AliVCluster* calo, Int_t nMaxima)
217 {
218  AliDebug(1,Form("Current Event %d; Before selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f",
220  calo->E(),GetPhi(fMomentum.Phi())*TMath::RadToDeg(),fMomentum.Eta()));
221 
222  //.......................................
223  // If too small or big energy, skip it
224  if ( fMomentum.E() < GetMinEnergy() ||
225  fMomentum.E() > GetMaxEnergy() ) return kFALSE ;
226  AliDebug(2,Form("\t Cluster %d Pass E Cut",calo->GetID()));
227 
228  //.......................................
229  // TOF cut, BE CAREFUL WITH THIS CUT
230  Double_t tof = calo->GetTOF()*1e9;
231  if ( tof < fTimeCutMin || tof > fTimeCutMax ) return kFALSE;
232  AliDebug(2,Form("\t Cluster %d Pass Time Cut",calo->GetID()));
233 
234  //.......................................
235  if ( calo->GetNCells() <= fNCellsCut &&
236  GetReader()->GetDataType() != AliCaloTrackReader::kMC ) return kFALSE;
237  AliDebug(2,Form("\t Cluster %d Pass NCell Cut",calo->GetID()));
238 
239  //.......................................
240  // Check acceptance selection
241  if ( IsFiducialCutOn() )
242  {
244  if ( !in ) return kFALSE ;
245  }
246  AliDebug(2,"\t Fiducial cut passed");
247 
248  //.......................................
249  // Skip not matched clusters with tracks
250  if ( !IsTrackMatched(calo, GetReader()->GetInputEvent()) )
251  {
252  AliDebug(1,"\t Reject non track-matched clusters");
253  return kFALSE ;
254  }
255  else AliDebug(2,"\t Track-matching cut passed");
256 
257  //...........................................
258  // Skip clusters with too many maxima
259  if ( nMaxima < fNLMCutMin || nMaxima > fNLMCutMax ) return kFALSE ;
260  AliDebug(2,Form("\t Cluster %d pass NLM %d of out of range",calo->GetID(), nMaxima));
261 
262  //.......................................
263  // Check Distance to Bad channel, set bit.
264  Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
265  if ( distBad < 0. ) distBad=9999. ; //workout strange convension dist = -1. ;
266  if ( distBad < fMinDist ) //In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
267  return kFALSE ;
268  else AliDebug(2,Form("\t Bad channel cut passed %4.2f > %2.2f",distBad, fMinDist));
269  //printf("Cluster %d Pass Bad Dist Cut \n",icalo);
270 
271  AliDebug(1,Form("Current Event %d; After selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f",
273  fMomentum.E(), fMomentum.Pt(),fMomentum.E(),
274  GetPhi(fMomentum.Phi())*TMath::RadToDeg(),fMomentum.Eta()));
275 
276  // All checks passed, cluster selected
277  return kTRUE;
278 
279 }
280 
281 //______________________________________________________________________________________________
283 //______________________________________________________________________________________________
284 void AliAnaElectron::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag, Int_t pidTag)
285 {
286  if ( !fFillSSHistograms || GetMixedEvent() ) return;
287 
288  Int_t pidIndex = 0;// Electron
289  if ( pidTag == AliCaloPID::kElectron ) pidIndex = 0;
290  else if ( pidTag == AliCaloPID::kChargedHadron ) pidIndex = 1;
291  else return;
292 
293  Float_t energy = cluster->E();
294  Int_t ncells = cluster->GetNCells();
295  Float_t lambda0 = cluster->GetM02();
296  Float_t lambda1 = cluster->GetM20();
297  Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
298 
299  Float_t l0 = 0., l1 = 0.;
300  Float_t dispp= 0., dEta = 0., dPhi = 0.;
301  Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
302 
303  Float_t eta = fMomentum.Eta();
304  Float_t phi = GetPhi(fMomentum.Phi());
305 
306  fhLam0E[pidIndex] ->Fill(energy, lambda0, GetEventWeight());
307  fhLam1E[pidIndex] ->Fill(energy, lambda1, GetEventWeight());
308  if ( !fFillOnlySimpleSSHisto ) fhDispE[pidIndex] ->Fill(energy, disp , GetEventWeight());
309 
310  if ( GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 &&
312  {
313  fhLam0ETRD[pidIndex]->Fill(energy, lambda0, GetEventWeight());
314  fhLam1ETRD[pidIndex]->Fill(energy, lambda1, GetEventWeight());
315  if ( !fFillOnlySimpleSSHisto ) fhDispETRD[pidIndex]->Fill(energy, disp , GetEventWeight());
316  }
317 
318  if ( !fFillOnlySimpleSSHisto )
319  {
320  if ( energy < 2 )
321  {
322  fhNCellsLam0LowE[pidIndex] ->Fill(ncells, lambda0, GetEventWeight());
323  fhEtaLam0LowE[pidIndex] ->Fill(eta, lambda0, GetEventWeight());
324  fhPhiLam0LowE[pidIndex] ->Fill(phi, lambda0, GetEventWeight());
325  }
326  else
327  {
328  fhNCellsLam0HighE[pidIndex]->Fill(ncells, lambda0, GetEventWeight());
329  fhEtaLam0HighE[pidIndex] ->Fill(eta, lambda0, GetEventWeight());
330  fhPhiLam0HighE[pidIndex] ->Fill(phi, lambda0, GetEventWeight());
331  }
332 
333  if ( GetCalorimeter() == kEMCAL )
334  {
336  l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
337  fhDispEtaE [pidIndex]-> Fill(energy, dEta , GetEventWeight());
338  fhDispPhiE [pidIndex]-> Fill(energy, dPhi , GetEventWeight());
339  fhSumEtaE [pidIndex]-> Fill(energy, sEta , GetEventWeight());
340  fhSumPhiE [pidIndex]-> Fill(energy, sPhi , GetEventWeight());
341  fhSumEtaPhiE [pidIndex]-> Fill(energy, sEtaPhi , GetEventWeight());
342  fhDispEtaPhiDiffE [pidIndex]-> Fill(energy, dPhi-dEta, GetEventWeight());
343  if ( dEta+dPhi > 0 )
344  fhSphericityE [pidIndex]-> Fill(energy, (dPhi-dEta)/(dEta+dPhi), GetEventWeight());
345 
346  if (energy < 2 ) fhDispEtaDispPhiEBin[pidIndex][0]->Fill(dEta, dPhi, GetEventWeight());
347  else if (energy < 4 ) fhDispEtaDispPhiEBin[pidIndex][1]->Fill(dEta, dPhi, GetEventWeight());
348  else if (energy < 6 ) fhDispEtaDispPhiEBin[pidIndex][2]->Fill(dEta, dPhi, GetEventWeight());
349  else if (energy < 10) fhDispEtaDispPhiEBin[pidIndex][3]->Fill(dEta, dPhi, GetEventWeight());
350  else fhDispEtaDispPhiEBin[pidIndex][4]->Fill(dEta, dPhi, GetEventWeight());
351  }
352  }
353 
354  if ( IsDataMC() )
355  {
356  AliVCaloCells* cells = 0;
357  if ( GetCalorimeter() == kEMCAL ) cells = GetEMCALCells();
358  else cells = GetPHOSCells();
359 
360  //Fill histograms to check shape of embedded clusters
361  Float_t fraction = 0;
362  if ( GetReader()->IsEmbeddedClusterSelectionOn() )
363  {//Only working for EMCAL
364  Float_t clusterE = 0; // recalculate in case corrections applied.
365  Float_t cellE = 0;
366  for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
367  {
368  cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
369  clusterE+=cellE;
370  fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
371  }
372 
373  // Fraction of total energy due to the embedded signal
374  fraction/=clusterE;
375 
376  AliDebug(1,Form("Energy fraction of embedded signal %2.3f, Energy %2.3f",fraction, clusterE));
377 
378  fhEmbeddedSignalFractionEnergy->Fill(clusterE, fraction, GetEventWeight());
379  } // embedded fraction
380 
381  // Check the origin and fill histograms
382  Int_t index = -1;
383 
384  if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
385  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
386  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
387  {
388  index = kmcssPhoton;
389  }//photon no conversion
390  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron &&
392  {
393  index = kmcssElectron;
394 
395  if ( !GetReader()->IsEmbeddedClusterSelectionOn() )
396  {
397  //Check particle overlaps in cluster
398 
399  //Compare the primary depositing more energy with the rest, if no photon/electron as comon ancestor (conversions), count as other particle
400  Int_t ancPDG = 0, ancStatus = -1;
401  Int_t ancLabel = 0;
402  Int_t noverlaps = 1;
403  for (UInt_t ilab = 0; ilab < cluster->GetNLabels(); ilab++ )
404  {
405  ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(cluster->GetLabels()[0],cluster->GetLabels()[ilab], GetMC(),
406  ancPDG,ancStatus,fMomentumMC,fProdVertex);
407  if ( ancPDG!=22 && TMath::Abs(ancPDG)!=11 ) noverlaps++;
408  }
409 
410  if ( noverlaps == 1 ) {
411  fhMCElectronELambda0NoOverlap ->Fill(energy, lambda0, GetEventWeight());
412  }
413  else if ( noverlaps == 2 ) {
414  fhMCElectronELambda0TwoOverlap ->Fill(energy, lambda0, GetEventWeight());
415  }
416  else if ( noverlaps > 2 ) {
417  fhMCElectronELambda0NOverlap ->Fill(energy, lambda0, GetEventWeight());
418  }
419  else
420  {
421  AliWarning(Form("N overlaps = %d for ancestor %d!!", noverlaps, ancLabel));
422  }
423  }//No embedding
424 
425  //Fill histograms to check shape of embedded clusters
426  if ( GetReader()->IsEmbeddedClusterSelectionOn() )
427  {
428  if ( fraction > 0.9 )
429  {
430  fhEmbedElectronELambda0FullSignal ->Fill(energy, lambda0, GetEventWeight());
431  }
432  else if ( fraction > 0.5 )
433  {
434  fhEmbedElectronELambda0MostlySignal ->Fill(energy, lambda0, GetEventWeight());
435  }
436  else if ( fraction > 0.1 )
437  {
438  fhEmbedElectronELambda0MostlyBkg ->Fill(energy, lambda0, GetEventWeight());
439  }
440  else
441  {
442  fhEmbedElectronELambda0FullBkg ->Fill(energy, lambda0, GetEventWeight());
443  }
444  } // embedded
445  } // electron
446  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron) &&
448  {
449  index = kmcssConversion;
450  } // conversion photon
451  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) )
452  {
453  index = kmcssPi0;
454  } // pi0
455  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
456  {
457  index = kmcssEta;
458  } // eta
459  else
460  {
461  index = kmcssOther;
462  } // other particles
463 
464  fhMCELambda0[pidIndex][index] ->Fill(energy, lambda0, GetEventWeight());
465  fhMCELambda1[pidIndex][index] ->Fill(energy, lambda1, GetEventWeight());
466 
468  {
469  fhMCEDispEta [pidIndex][index]-> Fill(energy, dEta , GetEventWeight());
470  fhMCEDispPhi [pidIndex][index]-> Fill(energy, dPhi , GetEventWeight());
471  fhMCESumEtaPhi [pidIndex][index]-> Fill(energy, sEtaPhi , GetEventWeight());
472  fhMCEDispEtaPhiDiff [pidIndex][index]-> Fill(energy, dPhi-dEta, GetEventWeight());
473  if ( dEta+dPhi > 0 )
474  fhMCESphericity [pidIndex][index]-> Fill(energy, (dPhi-dEta)/(dEta+dPhi), GetEventWeight());
475  }
476  } // MC data
477 }
478 
479 //_____________________________________________
481 //_____________________________________________
483 {
484  TString parList ; //this will be list of parameters used for this analysis.
485  const Int_t buffersize = 255;
486  char onePar[buffersize] ;
487 
488  snprintf(onePar,buffersize,"--- AliAnaElectron ---: ") ;
489  parList+=onePar ;
490  snprintf(onePar,buffersize,"Calorimeter: %s;",GetCalorimeterString().Data()) ;
491  parList+=onePar ;
492  snprintf(onePar,buffersize," %2.2f < dEdx < %2.2f;",fdEdxMin,fdEdxMax) ;
493  parList+=onePar ;
494  snprintf(onePar,buffersize," %2.2f < E/P < %2.2f;",fEOverPMin, fEOverPMax) ;
495  parList+=onePar ;
496  snprintf(onePar,buffersize," %2.2f < M20 < %2.2f;",fM20Min, fM20Max) ;
497  parList+=onePar ;
498  snprintf(onePar,buffersize," %2.2f < dEdx < %2.2f;",fdEdxMinHad,fdEdxMaxHad) ;
499  parList+=onePar ;
500  snprintf(onePar,buffersize," %2.2f < E/P < %2.2f;",fEOverPMinHad, fEOverPMaxHad) ;
501  parList+=onePar ;
502  snprintf(onePar,buffersize,"fMinDist =%2.2f;",fMinDist) ;
503  parList+=onePar ;
504 
505  //Get parameters set in base class.
506  parList += GetBaseParametersList() ;
507 
508  //Get parameters set in PID class.
509  //parList += GetCaloPID()->GetPIDParametersList() ;
510 
511  //Get parameters set in FiducialCut class (not available yet)
512  //parlist += GetFidCut()->GetFidCutParametersList()
513 
514  return new TObjString(parList) ;
515 }
516 
517 //_______________________________________________
518 // Create histograms to be saved in output file and
519 // store them in outputContainer.
520 //_______________________________________________
522 {
523  TList * outputContainer = new TList() ;
524  outputContainer->SetName("ElectronHistos") ;
525 
535 
542 
543  // MC labels, titles, for originator particles
544  TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
545  TString pnamess[] = { "Photon","Hadron" ,"Pi0" ,"Eta" ,"Conversion" ,"Electron"} ;
546  TString ptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}", "#pi^{0}","#eta",
547  "e^{#pm}","#gamma->e^{#pm}","hadron?","Anti-N","Anti-P" } ;
548 
549  TString pname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Pi0","Eta","Electron",
550  "Conversion", "Hadron", "AntiNeutron","AntiProton" } ;
551 
552  TString pidParticle[] = {"Electron","ChargedHadron","NoPID"} ;
553 
554  //
555  // E/p histograms
556  //
557  fhEOverPvsE = new TH2F
558  ("hEOverP_clusE","matched track #it{E/p} vs cluster #it{E}",
559  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
560  fhEOverPvsE->SetXTitle("#it{E} (GeV)");
561  fhEOverPvsE->SetYTitle("#it{E/p}");
562  outputContainer->Add(fhEOverPvsE);
563 
564  fhEOverPvsP = new TH2F
565  ("hEOverP_TraP","matched track #it{E/p} vs track #it{p}",
566  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
567  fhEOverPvsP->SetXTitle("#it{p} (GeV/#it{c})");
568  fhEOverPvsP->SetYTitle("#it{E/p}");
569  outputContainer->Add(fhEOverPvsP);
570 
571  fhEOverPvsECutM02 = new TH2F
572  ("hEOverP_clusE_CutM02",
573  "matched track #it{E/p} vs cluster #it{E}, #sigma_{long}^{2} cut",
574  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
575  fhEOverPvsECutM02->SetXTitle("#it{E} (GeV)");
576  fhEOverPvsECutM02->SetYTitle("#it{E/p}");
577  outputContainer->Add(fhEOverPvsECutM02);
578 
579  fhEOverPvsPCutM02 = new TH2F
580  ("hEOverP_TraP_CutM02",
581  "matched track #it{E/p} vs track #it{p}, #sigma_{long}^{2} cut",
582  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
583  fhEOverPvsPCutM02->SetXTitle("#it{p} (GeV/#it{c})");
584  fhEOverPvsPCutM02->SetYTitle("#it{E/p}");
585  outputContainer->Add(fhEOverPvsPCutM02);
586 
587  fhEOverPvsECutdEdx = new TH2F
588  ("hEOverP_clusE_CutdEdx","matched track #it{E/p} vs cluster #it{E}, <d#it{E}/d#it{x}> cut",
589  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
590  fhEOverPvsECutdEdx->SetXTitle("#it{E} (GeV)");
591  fhEOverPvsECutdEdx->SetYTitle("#it{E/p}");
592  outputContainer->Add(fhEOverPvsECutdEdx);
593 
594  fhEOverPvsPCutdEdx = new TH2F
595  ("hEOverP_TraP_CutdEdx","matched track #it{E/p} vs track #it{p}, <d#it{E}/d#it{x}> cut",
596  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
597  fhEOverPvsPCutdEdx->SetXTitle("#it{p} (GeV/#it{c})");
598  fhEOverPvsPCutdEdx->SetYTitle("#it{E/p}");
599  outputContainer->Add(fhEOverPvsPCutdEdx);
600 
602  ("hEOverP_clusE_CutM02AndM20",
603  "matched track #it{E/p} vs cluster #it{E}, #sigma_{long}^{2} cut, #sigma_{short}^{2} cut",
604  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
605  fhEOverPvsECutM02AndM20->SetXTitle("#it{E} (GeV)");
606  fhEOverPvsECutM02AndM20->SetYTitle("#it{E/p}");
607  outputContainer->Add(fhEOverPvsECutM02AndM20);
608 
610  ("hEOverP_TraP_CutM02AndM20",
611  "matched track #it{E/p} vs track #it{p}, #sigma_{long}^{2} cut, #sigma_{short}^{2} cut",
612  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
613  fhEOverPvsPCutM02AndM20->SetXTitle("#it{p} (GeV/#it{c})");
614  fhEOverPvsPCutM02AndM20->SetYTitle("#it{E/p}");
615  outputContainer->Add(fhEOverPvsPCutM02AndM20);
616 
618  ("hEOverP_clusE_CutM02CutdEdx",
619  "matched track #it{E/p} vs cluster #it{E}, <d#it{E}/d#it{x}> cut, #sigma_{long}^{2} cut",
620  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
621  fhEOverPvsECutM02CutdEdx->SetXTitle("#it{E} (GeV)");
622  fhEOverPvsECutM02CutdEdx->SetYTitle("#it{E/p}");
623  outputContainer->Add(fhEOverPvsECutM02CutdEdx);
624 
626  ("hEOverP_TraP_CutM02CutdEdx",
627  "matched track #it{E/p} vs track #it{p}, <d#it{E}/d#it{x}> cut, #sigma_{long}^{2} cut",
628  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
629  fhEOverPvsPCutM02CutdEdx->SetXTitle("#it{p} (GeV/#it{c})");
630  fhEOverPvsPCutM02CutdEdx->SetYTitle("#it{E/p}");
631  outputContainer->Add(fhEOverPvsPCutM02CutdEdx);
632 
634  ("hEOverP_clusE_CutM02AndM20CutdEdx",
635  "matched track #it{E/p} vs cluster #it{E}, <d#it{E}/d#it{x}> cut, #sigma_{long}^{2} cut, #sigma_{short}^{2} cut",
636  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
637  fhEOverPvsECutM02AndM20CutdEdx->SetXTitle("#it{E} (GeV)");
638  fhEOverPvsECutM02AndM20CutdEdx->SetYTitle("#it{E/p}");
639  outputContainer->Add(fhEOverPvsECutM02AndM20CutdEdx);
640 
642  ("hEOverP_TraP_CutM02AndM20CutdEdx",
643  "matched track #it{E/p} vs track #it{p}, <d#it{E}/d#it{x}> cut, #sigma_{long}^{2} cut, #sigma_{short}^{2} cut",
644  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
645  fhEOverPvsPCutM02AndM20CutdEdx->SetXTitle("#it{p} (GeV/#it{c})");
646  fhEOverPvsPCutM02AndM20CutdEdx->SetYTitle("#it{E/p}");
647  outputContainer->Add(fhEOverPvsPCutM02AndM20CutdEdx);
648 
650  ("hEOverP_clusE_CutNSigma","matched track #it{E/p} vs cluster #it{E}, n#sigma cut cut",
651  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
652  fhEOverPvsECutNSigma->SetXTitle("#it{E} (GeV)");
653  fhEOverPvsECutNSigma->SetYTitle("#it{E/p}");
654  outputContainer->Add(fhEOverPvsECutNSigma);
655 
657  ("hEOverP_TraP_CutNSigma","matched track #it{E/p} vs track #it{p}, n#sigma cut cut",
658  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
659  fhEOverPvsPCutNSigma->SetXTitle("#it{p} (GeV/#it{c})");
660  fhEOverPvsPCutNSigma->SetYTitle("#it{E/p}");
661  outputContainer->Add(fhEOverPvsPCutNSigma);
662 
664  ("hEOverP_clusE_CutM02CutNSigma",
665  "matched track #it{E/p} vs cluster #it{E}, n#sigma cut, #sigma_{long}^{2} cut",
666  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
667  fhEOverPvsECutM02CutNSigma->SetXTitle("#it{E} (GeV)");
668  fhEOverPvsECutM02CutNSigma->SetYTitle("#it{E/p}");
669  outputContainer->Add(fhEOverPvsECutM02CutNSigma);
670 
672  ("hEOverP_TraP_CutM02CutNSigma",
673  "matched track #it{E/p} vs track #it{p}, n#sigma cut, #sigma_{long}^{2} cut",
674  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
675  fhEOverPvsPCutM02CutNSigma->SetXTitle("#it{p} (GeV/#it{c})");
676  fhEOverPvsPCutM02CutNSigma->SetYTitle("#it{E/p}");
677  outputContainer->Add(fhEOverPvsPCutM02CutNSigma);
678 
680  ("hEOverP_clusE_CutM02AndM20CutNSigma",
681  "matched track #it{E/p} vs cluster #it{E}, n#sigma cut, #sigma_{long}^{2} cut, #sigma_{short}^{2} cut",
682  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
683  fhEOverPvsECutM02AndM20CutNSigma->SetXTitle("#it{E} (GeV)");
684  fhEOverPvsECutM02AndM20CutNSigma->SetYTitle("#it{E/p}");
685  outputContainer->Add(fhEOverPvsECutM02AndM20CutNSigma);
686 
688  ("hEOverP_TraP_CutM02AndM20CutNSigma",
689  "matched track #it{E/p} vs track #it{p}, n#sigma cut, #sigma_{long}^{2} cut, #sigma_{short}^{2} cut",
690  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
691  fhEOverPvsPCutM02AndM20CutNSigma->SetXTitle("#it{p} (GeV/#it{c})");
692  fhEOverPvsPCutM02AndM20CutNSigma->SetYTitle("#it{E/p}");
693  outputContainer->Add(fhEOverPvsPCutM02AndM20CutNSigma);
694 
695  // dE/dX histograms
696 
697  fhdEdxvsE = new TH2F
698  ("hdEdx_clusE","matched track <d#it{E}/d#it{x}> vs cluster #it{E} ",
699  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
700  fhdEdxvsE->SetXTitle("#it{E} (GeV)");
701  fhdEdxvsE->SetYTitle("<d#it{E}/d#it{x}>");
702  outputContainer->Add(fhdEdxvsE);
703 
704  fhdEdxvsP = new TH2F
705  ("hdEdx_TraP","matched track <d#it{E}/d#it{x}> vs track #it{p} ",
706  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
707  fhdEdxvsP->SetXTitle("#it{p} (GeV/#it{c})");
708  fhdEdxvsP->SetYTitle("<d#it{E}/d#it{x}>");
709  outputContainer->Add(fhdEdxvsP);
710 
711  fhdEdxvsECutM02 = new TH2F
712  ("hdEdx_clusE_CutM02",
713  "matched track <d#it{E}/d#it{x}> vs cluster #it{E}, #sigma_{long}^{2} cut",
714  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
715  fhdEdxvsECutM02->SetXTitle("#it{E} (GeV)");
716  fhdEdxvsECutM02->SetYTitle("<d#it{E}/d#it{x}>");
717  outputContainer->Add(fhdEdxvsECutM02);
718 
719  fhdEdxvsPCutM02 = new TH2F
720  ("hdEdx_TraP_CutM02",
721  "matched track <d#it{E}/d#it{x}> vs track #it{p}, #sigma_{long}^{2} cut",
722  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
723  fhdEdxvsPCutM02->SetXTitle("#it{p} (GeV/#it{c})");
724  fhdEdxvsPCutM02->SetYTitle("<d#it{E}/d#it{x}>");
725  outputContainer->Add(fhdEdxvsPCutM02);
726 
728  ("hdEdx_clusE_CutM02AndM20",
729  "matched track <d#it{E}/d#it{x}> vs cluster #it{E}, #sigma_{long}^{2} cut",
730  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
731  fhdEdxvsECutM02AndM20->SetXTitle("#it{E} (GeV)");
732  fhdEdxvsECutM02AndM20->SetYTitle("<d#it{E}/d#it{x}>");
733  outputContainer->Add(fhdEdxvsECutM02AndM20);
734 
736  ("hdEdx_TraP_CutM02AndM20",
737  "matched track <d#it{E}/d#it{x}> vs track #it{p}, #sigma_{long}^{2} cut",
738  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
739  fhdEdxvsPCutM02AndM20->SetXTitle("#it{p} (GeV/#it{c})");
740  fhdEdxvsPCutM02AndM20->SetYTitle("<d#it{E}/d#it{x}>");
741  outputContainer->Add(fhdEdxvsPCutM02AndM20);
742 
743  fhdEdxvsECutEOverP = new TH2F
744  ("hdEdx_clusE_CutEOverP","matched track <d#it{E}/d#it{x}> vs cluster #it{E}, cut on #it{E/p}",
745  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
746  fhdEdxvsECutEOverP->SetXTitle("#it{E} (GeV)");
747  fhdEdxvsECutEOverP->SetYTitle("<d#it{E}/d#it{x}>");
748  outputContainer->Add(fhdEdxvsECutEOverP);
749 
750  fhdEdxvsPCutEOverP = new TH2F
751  ("hdEdx_TraP_CutEOverP","matched track <d#it{E}/d#it{x}> vs track #it{p}, cut on #it{E/p}",
752  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
753  fhdEdxvsPCutEOverP->SetXTitle("#it{p} (GeV/#it{c})");
754  fhdEdxvsPCutEOverP->SetYTitle("<d#it{E}/d#it{x}>");
755  outputContainer->Add(fhdEdxvsPCutEOverP);
756 
757  fhdEdxvsECutNSigma = new TH2F
758  ("hdEdx_clusE_CutNSigma","matched track <d#it{E}/d#it{x}> vs cluster #it{E}, n#sigma cut",
759  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
760  fhdEdxvsECutNSigma->SetXTitle("#it{E} (GeV)");
761  fhdEdxvsECutNSigma->SetYTitle("<d#it{E}/d#it{x}>");
762  outputContainer->Add(fhdEdxvsECutNSigma);
763 
764  fhdEdxvsPCutNSigma = new TH2F
765  ("hdEdx_TraP_CutNSigma","matched track <d#it{E}/d#it{x}> vs track #it{p}, n#sigma cut",
766  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
767  fhdEdxvsPCutNSigma->SetXTitle("#it{p} (GeV/#it{c})");
768  fhdEdxvsPCutNSigma->SetYTitle("<d#it{E}/d#it{x}>");
769  outputContainer->Add(fhdEdxvsPCutNSigma);
770 
772  ("hdEdx_clusE_CutM02CutNSigma",
773  "matched track <d#it{E}/d#it{x}> vs cluster #it{E}, #sigma_{long}^{2} cut, n#sigma cut",
774  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
775  fhdEdxvsECutM02CutNSigma->SetXTitle("#it{E} (GeV)");
776  fhdEdxvsECutM02CutNSigma->SetYTitle("<d#it{E}/d#it{x}>");
777  outputContainer->Add(fhdEdxvsECutM02CutNSigma);
778 
780  ("hdEdx_TraP_CutM02CutNSigma",
781  "matched track <d#it{E}/d#it{x}> vs track #it{p}, #sigma_{long}^{2} cut, n#sigma cut",
782  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
783  fhdEdxvsPCutM02CutNSigma->SetXTitle("#it{p} (GeV/#it{c})");
784  fhdEdxvsPCutM02CutNSigma->SetYTitle("<d#it{E}/d#it{x}>");
785  outputContainer->Add(fhdEdxvsPCutM02CutNSigma);
786 
788  ("hdEdx_clusE_CutM02AndM20CutNSigma",
789  "matched track <d#it{E}/d#it{x}> vs cluster #it{E}, #sigma_{long}^{2} cut, n#sigma cut",
790  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
791  fhdEdxvsECutM02AndM20CutNSigma->SetXTitle("#it{E} (GeV)");
792  fhdEdxvsECutM02AndM20CutNSigma->SetYTitle("<d#it{E}/d#it{x}>");
793  outputContainer->Add(fhdEdxvsECutM02AndM20CutNSigma);
794 
796  ("hdEdx_TraP_CutM02AndM20CutNSigma",
797  "matched track <d#it{E}/d#it{x}> vs track #it{p}, #sigma_{long}^{2} cut, n#sigma cut",
798  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
799  fhdEdxvsPCutM02AndM20CutNSigma->SetXTitle("#it{p} (GeV/#it{c})");
800  fhdEdxvsPCutM02AndM20CutNSigma->SetYTitle("<d#it{E}/d#it{x}>");
801  outputContainer->Add(fhdEdxvsPCutM02AndM20CutNSigma);
802 
803  // TPC nSigma histograms
804 
805  fhNSigmavsE = new TH2F
806  ("hNSigma_clusE","matched track <d#it{E}/d#it{x}> vs cluster #it{E} ",
807  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
808  fhNSigmavsE->SetXTitle("#it{E} (GeV)");
809  fhNSigmavsE->SetYTitle("n#sigma");
810  outputContainer->Add(fhNSigmavsE);
811 
812  fhNSigmavsP = new TH2F
813  ("hNSigma_TraP","matched track n#sigma vs track #it{p} ",
814  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
815  fhNSigmavsP->SetXTitle("#it{p} (GeV/#it{c})");
816  fhNSigmavsP->SetYTitle("n#sigma");
817  outputContainer->Add(fhNSigmavsP);
818 
819  fhNSigmavsECutM02 = new TH2F
820  ("hNSigma_clusE_CutM02",
821  "matched track n#sigma vs cluster #it{E}, #sigma_{long}^{2} cut",
822  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
823  fhNSigmavsECutM02->SetXTitle("#it{E} (GeV)");
824  fhNSigmavsECutM02->SetYTitle("n#sigma");
825  outputContainer->Add(fhNSigmavsECutM02);
826 
827  fhNSigmavsPCutM02 = new TH2F
828  ("hNSigma_TraP_CutM02",
829  "matched track n#sigma vs track #it{p}, #sigma_{long}^{2} cut",
830  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
831  fhNSigmavsPCutM02->SetXTitle("#it{p} (GeV/#it{c})");
832  fhNSigmavsPCutM02->SetYTitle("n#sigma");
833  outputContainer->Add(fhNSigmavsPCutM02);
834 
836  ("hNSigma_clusE_CutM02AndM20",
837  "matched track n#sigma vs cluster #it{E}, #sigma_{long}^{2} cut",
838  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
839  fhNSigmavsECutM02AndM20->SetXTitle("#it{E} (GeV)");
840  fhNSigmavsECutM02AndM20->SetYTitle("n#sigma");
841  outputContainer->Add(fhNSigmavsECutM02AndM20);
842 
844  ("hNSigma_TraP_CutM02AndM20",
845  "matched track n#sigma vs track #it{p}, #sigma_{long}^{2} cut",
846  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
847  fhNSigmavsPCutM02AndM20->SetXTitle("#it{p} (GeV/#it{c})");
848  fhNSigmavsPCutM02AndM20->SetYTitle("n#sigma");
849  outputContainer->Add(fhNSigmavsPCutM02AndM20);
850 
852  ("hNSigma_clusE_CutEOverP","matched track n#sigma vs cluster #it{E}, cut on #it{E/p}",
853  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
854  fhNSigmavsECutEOverP->SetXTitle("#it{E} (GeV)");
855  fhNSigmavsECutEOverP->SetYTitle("n#sigma");
856  outputContainer->Add(fhNSigmavsECutEOverP);
857 
859  ("hNSigma_TraP_CutEOverP","matched track n#sigma vs track #it{p}, cut on #it{E/p}",
860  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
861  fhNSigmavsPCutEOverP->SetXTitle("#it{p} (GeV/#it{c})");
862  fhNSigmavsPCutEOverP->SetYTitle("n#sigma");
863  outputContainer->Add(fhNSigmavsPCutEOverP);
864 
865  fhNSigmavsECutdEdx = new TH2F
866  ("hNSigma_clusE_CutdEdx","matched track n#sigma vs cluster #it{E}, <d#it{E}/d#it{x}> cut",
867  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
868  fhNSigmavsECutdEdx->SetXTitle("#it{E} (GeV)");
869  fhNSigmavsECutdEdx->SetYTitle("n#sigma");
870  outputContainer->Add(fhNSigmavsECutdEdx);
871 
872  fhNSigmavsPCutdEdx = new TH2F
873  ("hNSigma_TraP_CutdEdx","matched track n#sigma vs track #it{p}, <d#it{E}/d#it{x}> cut",
874  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
875  fhNSigmavsPCutdEdx->SetXTitle("#it{p} (GeV/#it{c})");
876  fhNSigmavsPCutdEdx->SetYTitle("n#sigma");
877  outputContainer->Add(fhNSigmavsPCutdEdx);
878 
880  ("hNSigma_clusE_CutM02CutdEdx",
881  "matched track n#sigma vs cluster #it{E}, #sigma_{long}^{2} cut, <d#it{E}/d#it{x}> cut",
882  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
883  fhNSigmavsECutM02CutdEdx->SetXTitle("#it{E} (GeV)");
884  fhNSigmavsECutM02CutdEdx->SetYTitle("n#sigma");
885  outputContainer->Add(fhNSigmavsECutM02CutdEdx);
886 
888  ("hNSigma_TraP_CutM02CutdEdx",
889  "matched track n#sigma vs track #it{p}, #sigma_{long}^{2} cut, <d#it{E}/d#it{x}> cut",
890  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
891  fhNSigmavsPCutM02CutdEdx->SetXTitle("#it{p} (GeV/#it{c})");
892  fhNSigmavsPCutM02CutdEdx->SetYTitle("n#sigma");
893  outputContainer->Add(fhNSigmavsPCutM02CutdEdx);
894 
896  ("hNSigma_clusE_CutM02AndM20CutdEdx",
897  "matched track n#sigma vs cluster #it{E}, #sigma_{long}^{2} cut, <d#it{E}/d#it{x}> cut",
898  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
899  fhNSigmavsECutM02AndM20CutdEdx->SetXTitle("#it{E} (GeV)");
900  fhNSigmavsECutM02AndM20CutdEdx->SetYTitle("n#sigma");
901  outputContainer->Add(fhNSigmavsECutM02AndM20CutdEdx);
902 
904  ("hNSigma_TraP_CutM02AndM20CutdEdx",
905  "matched track n#sigma vs track #it{p}, #sigma_{long}^{2} cut, <d#it{E}/d#it{x}> cut",
906  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
907  fhNSigmavsPCutM02AndM20CutdEdx->SetXTitle("#it{p} (GeV/#it{c})");
908  fhNSigmavsPCutM02AndM20CutdEdx->SetYTitle("n#sigma");
909  outputContainer->Add(fhNSigmavsPCutM02AndM20CutdEdx);
910 
911 
912  if ( IsDataMC() )
913  {
914  for(Int_t i = 0; i < fNOriginHistograms; i++)
915  {
916  fhMCdEdxvsE[i] = new TH2F
917  (Form("hdEdx_clusE_MC%s",pname[i].Data()),
918  Form("matched track <d#it{E}/d#it{x}> vs cluster #it{E} from %s",ptype[i].Data()),
919  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
920  fhMCdEdxvsE[i]->SetXTitle("#it{E} (GeV)");
921  fhMCdEdxvsE[i]->SetYTitle("<d#it{E}/d#it{x}>");
922  outputContainer->Add(fhMCdEdxvsE[i]) ;
923 
924  fhMCdEdxvsP[i] = new TH2F
925  (Form("hdEdx_TraP_MC%s",pname[i].Data()),
926  Form("matched track <d#it{E}/d#it{x}> vs track P from %s",ptype[i].Data()),
927  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
928  fhMCdEdxvsP[i]->SetXTitle("#it{E} (GeV)");
929  fhMCdEdxvsP[i]->SetYTitle("<d#it{E}/d#it{x}>");
930  outputContainer->Add(fhMCdEdxvsP[i]) ;
931 
932  fhMCNSigmavsE[i] = new TH2F
933  (Form("hNSigma_clusE_MC%s",pname[i].Data()),
934  Form("matched track n#sigma vs cluster #it{E} from %s",ptype[i].Data()),
935  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
936  fhMCNSigmavsE[i]->SetXTitle("#it{E} (GeV)");
937  fhMCNSigmavsE[i]->SetYTitle("n#sigma");
938  outputContainer->Add(fhMCNSigmavsE[i]) ;
939 
940  fhMCNSigmavsP[i] = new TH2F
941  (Form("hNSigma_TraP_MC%s",pname[i].Data()),
942  Form("matched track n#sigma vs track P from %s",ptype[i].Data()),
943  nptbins,ptmin,ptmax, nNSigmabins, nSigmamin, nSigmamax);
944  fhMCNSigmavsP[i]->SetXTitle("#it{E} (GeV)");
945  fhMCNSigmavsP[i]->SetYTitle("n#sigma");
946  outputContainer->Add(fhMCNSigmavsP[i]) ;
947 
948  fhMCEOverPvsE[i] = new TH2F
949  (Form("hEOverP_clusE_MC%s",pname[i].Data()),
950  Form("matched track #it{E/p} vs cluster #it{E} from %s",ptype[i].Data()),
951  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
952  fhMCEOverPvsE[i]->SetXTitle("#it{E} (GeV)");
953  fhMCEOverPvsE[i]->SetYTitle("<d#it{E}/d#it{x}>");
954  outputContainer->Add(fhMCEOverPvsE[i]) ;
955 
956  fhMCEOverPvsP[i] = new TH2F
957  (Form("hEOverP_TraP_MC%s",pname[i].Data()),
958  Form("matched track #it{E/p} vs track P from %s",ptype[i].Data()),
959  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
960  fhMCEOverPvsP[i]->SetXTitle("#it{E} (GeV)");
961  fhMCEOverPvsP[i]->SetYTitle("<d#it{E}/d#it{x}>");
962  outputContainer->Add(fhMCEOverPvsP[i]) ;
963 
964  for(Int_t j = 0; j < 2; j++)
965  {
966  fhMCEOverPvsEAfterCuts[i][j] = new TH2F
967  (Form("hEOverP_clusE_%s_MC%s",pidParticle[j].Data(), pname[i].Data()),
968  Form("matched track #it{E/p} vs cluster #it{E}, id %s from MC %s",pidParticle[j].Data(),ptype[i].Data()),
969  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
970  fhMCEOverPvsEAfterCuts[i][j]->SetXTitle("#it{E} (GeV)");
971  fhMCEOverPvsEAfterCuts[i][j]->SetYTitle("<d#it{E}/d#it{x}>");
972  outputContainer->Add(fhMCEOverPvsEAfterCuts[i][j]) ;
973 
974  fhMCEOverPvsPAfterCuts[i][j] = new TH2F
975  (Form("hEOverP_TraP_%s_MC%s",pidParticle[j].Data(),pname[i].Data()),
976  Form("matched track #it{E/p} vs track P, id %s, from MC %s",pidParticle[j].Data(),ptype[i].Data()),
977  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
978  fhMCEOverPvsPAfterCuts[i][j]->SetXTitle("#it{E} (GeV)");
979  fhMCEOverPvsPAfterCuts[i][j]->SetYTitle("<d#it{E}/d#it{x}>");
980  outputContainer->Add(fhMCEOverPvsPAfterCuts[i][j]) ;
981  }
982 
983  } // MC particle loop
984  } // Is MC
985 
986 
987  // Matching residuals
988  TString sCharge[] = {"Positive","Negative"};
989  for(Int_t indexPID = 0; indexPID < 3; indexPID++)
990  {
991  for(Int_t ich = 0; ich < 2; ich++)
992  {
993  fhDEtavsE[indexPID][ich] = new TH2F
994  (Form("hDEta_clusE_%s_%s",sCharge[ich].Data(),pidParticle[indexPID].Data()),
995  Form("#Delta #eta of cluster - %s track vs #it{E}_{cluster}, ID: %s",
996  sCharge[ich].Data(),pidParticle[indexPID].Data()),
997  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
998  fhDEtavsE[indexPID][ich]->SetYTitle("#Delta #eta");
999  fhDEtavsE[indexPID][ich]->SetXTitle("#it{E}_{cluster} (GeV)");
1000  outputContainer->Add(fhDEtavsE[indexPID][ich]) ;
1001 
1002  fhDPhivsE[indexPID][ich] = new TH2F
1003  (Form("hDPhi_clusE_%s_%s",sCharge[ich].Data(),pidParticle[indexPID].Data()),
1004  Form("#Delta #varphi of cluster - %s track vs #it{E}_{cluster}, ID: %s",
1005  sCharge[ich].Data(),pidParticle[indexPID].Data()),
1006  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1007  fhDPhivsE[indexPID][ich]->SetYTitle("#Delta #varphi (rad)");
1008  fhDPhivsE[indexPID][ich]->SetXTitle("#it{E}_{cluster} (GeV)");
1009  outputContainer->Add(fhDPhivsE[indexPID][ich]) ;
1010 
1011  fhDEtavsP[indexPID][ich] = new TH2F
1012  (Form("hDEta_TraP_%s_%s",sCharge[ich].Data(),pidParticle[indexPID].Data()),
1013  Form("#Delta #eta of cluster - %s track vs #it{p}_{track}, ID: %s",
1014  sCharge[ich].Data(),pidParticle[indexPID].Data()),
1015  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1016  fhDEtavsP[indexPID][ich]->SetYTitle("#Delta #eta");
1017  fhDEtavsP[indexPID][ich]->SetXTitle("#it{p}_{track} (GeV/#it{c})");
1018  outputContainer->Add(fhDEtavsP[indexPID][ich]) ;
1019 
1020  fhDPhivsP[indexPID][ich] = new TH2F
1021  (Form("hDPhi_TraP_%s_%s",sCharge[ich].Data(),pidParticle[indexPID].Data()),
1022  Form("#Delta #varphi of cluster - %s track vs #it{p}_{track}, ID: %s",
1023  sCharge[ich].Data(),pidParticle[indexPID].Data()),
1024  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1025  fhDPhivsP[indexPID][ich]->SetYTitle("#Delta #varphi (rad)");
1026  fhDPhivsP[indexPID][ich]->SetXTitle("#it{p}_{track} (GeV/#it{c})");
1027  outputContainer->Add(fhDPhivsP[indexPID][ich]) ;
1028 
1029  fhDEtaDPhi[indexPID][ich] = new TH2F
1030  (Form("hDEtaDPhi_%s_%s",sCharge[ich].Data(),pidParticle[indexPID].Data()),
1031  Form("#Delta #eta vs #Delta #varphi of cluster - %s track, ID: %s",
1032  sCharge[ich].Data(),pidParticle[indexPID].Data()),
1033  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1034  fhDEtaDPhi[indexPID][ich]->SetYTitle("#Delta #varphi (rad)");
1035  fhDEtaDPhi[indexPID][ich]->SetXTitle("#Delta #eta");
1036  outputContainer->Add(fhDEtaDPhi[indexPID][ich]) ;
1037  }
1038  }
1039 
1040 
1041 
1042  if ( fFillWeightHistograms )
1043  {
1044  fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy, for selected electrons",
1045  nptbins,ptmin,ptmax, 100,0,1.);
1046  fhECellClusterRatio->SetXTitle("#it{E}_{cluster} (GeV)");
1047  fhECellClusterRatio->SetYTitle("#it{E}_{cell i}/#it{E}_{cluster}");
1048  outputContainer->Add(fhECellClusterRatio);
1049 
1050  fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy, for selected electrons",
1051  nptbins,ptmin,ptmax, 100,-10,0);
1052  fhECellClusterLogRatio->SetXTitle("#it{E}_{cluster} (GeV)");
1053  fhECellClusterLogRatio->SetYTitle("Log (#it{E}_{max cell}/#it{E}_{cluster})");
1054  outputContainer->Add(fhECellClusterLogRatio);
1055 
1056  fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy, for selected electrons",
1057  nptbins,ptmin,ptmax, 100,0,1.);
1058  fhEMaxCellClusterRatio->SetXTitle("#it{E}_{cluster} (GeV)");
1059  fhEMaxCellClusterRatio->SetYTitle("#it{E}_{max cell}/#it{E}_{cluster}");
1060  outputContainer->Add(fhEMaxCellClusterRatio);
1061 
1062  fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy, for selected electrons",
1063  nptbins,ptmin,ptmax, 100,-10,0);
1064  fhEMaxCellClusterLogRatio->SetXTitle("#it{E}_{cluster} (GeV)");
1065  fhEMaxCellClusterLogRatio->SetYTitle("Log (#it{E}_{max cell}/#it{E}_{cluster})");
1066  outputContainer->Add(fhEMaxCellClusterLogRatio);
1067 
1068  for(Int_t iw = 0; iw < 14; iw++)
1069  {
1070  fhLambda0ForW0[iw] = new TH2F (Form("hLambda0ForW0%d",iw),Form("shower shape, #sigma_{long}_{2} vs E, w0 = %1.1f, for selected electrons",1+0.5*iw),
1071  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1072  fhLambda0ForW0[iw]->SetXTitle("#it{E}_{cluster}");
1073  fhLambda0ForW0[iw]->SetYTitle("#sigma_{long}_{2}");
1074  outputContainer->Add(fhLambda0ForW0[iw]);
1075 
1076  // fhLambda1ForW0[iw] = new TH2F (Form("hLambda1ForW0%d",iw),Form("shower shape, #sigma_{short}_{2} vs E, w0 = %1.1f, for selected electrons",1+0.5*iw),
1077  // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1078  // fhLambda1ForW0[iw]->SetXTitle("#it{E}_{cluster}");
1079  // fhLambda1ForW0[iw]->SetYTitle("#sigma_{short}_{2}");
1080  // outputContainer->Add(fhLambda1ForW0[iw]);
1081  }
1082  } // weight
1083 
1084  for(Int_t pidIndex = 0; pidIndex < 2; pidIndex++)
1085  {
1086  // Shower shape
1087  if ( fFillSSHistograms )
1088  {
1089  fhLam0E[pidIndex] = new TH2F (Form("h%sLam0E",pidParticle[pidIndex].Data()),
1090  Form("%s: #sigma_{long}^{2} vs E",pidParticle[pidIndex].Data()),
1091  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1092  fhLam0E[pidIndex]->SetYTitle("#sigma_{long}^{2}");
1093  fhLam0E[pidIndex]->SetXTitle("#it{E} (GeV)");
1094  outputContainer->Add(fhLam0E[pidIndex]);
1095 
1096  fhLam1E[pidIndex] = new TH2F (Form("h%sLam1E",pidParticle[pidIndex].Data()),
1097  Form("%s: #sigma_{short}^{2} vs E",pidParticle[pidIndex].Data()),
1098  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1099  fhLam1E[pidIndex]->SetYTitle("#sigma_{short}^{2}");
1100  fhLam1E[pidIndex]->SetXTitle("#it{E} (GeV)");
1101  outputContainer->Add(fhLam1E[pidIndex]);
1102 
1103  if ( !fFillOnlySimpleSSHisto )
1104  {
1105  fhDispE[pidIndex] = new TH2F (Form("h%sDispE",pidParticle[pidIndex].Data()),
1106  Form("%s: dispersion^{2} vs E",pidParticle[pidIndex].Data()),
1107  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1108  fhDispE[pidIndex]->SetYTitle("#it{D}^{2}");
1109  fhDispE[pidIndex]->SetXTitle("#it{E} (GeV) ");
1110  outputContainer->Add(fhDispE[pidIndex]);
1111  }
1112 
1113  if ( GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >=0 )
1114  {
1115  fhLam0ETRD[pidIndex] = new TH2F (Form("h%sLam0ETRD",pidParticle[pidIndex].Data()),
1116  Form("%s: #sigma_{long}^{2} vs E, EMCAL SM covered by TRD",pidParticle[pidIndex].Data()),
1117  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1118  fhLam0ETRD[pidIndex]->SetYTitle("#sigma_{long}^{2}");
1119  fhLam0ETRD[pidIndex]->SetXTitle("#it{E} (GeV)");
1120  outputContainer->Add(fhLam0ETRD[pidIndex]);
1121 
1122  fhLam1ETRD[pidIndex] = new TH2F (Form("h%sLam1ETRD",pidParticle[pidIndex].Data()),
1123  Form("%s: #sigma_{short}^{2} vs E, EMCAL SM covered by TRD",pidParticle[pidIndex].Data()),
1124  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1125  fhLam1ETRD[pidIndex]->SetYTitle("#sigma_{short}^{2}");
1126  fhLam1ETRD[pidIndex]->SetXTitle("#it{E} (GeV)");
1127  outputContainer->Add(fhLam1ETRD[pidIndex]);
1128 
1129  if ( !fFillOnlySimpleSSHisto )
1130  {
1131  fhDispETRD[pidIndex] = new TH2F (Form("h%sDispETRD",pidParticle[pidIndex].Data()),
1132  Form("%s: dispersion^{2} vs #it{E}, EMCal SM covered by TRD",pidParticle[pidIndex].Data()),
1133  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1134  fhDispETRD[pidIndex]->SetYTitle("Dispersion^{2}");
1135  fhDispETRD[pidIndex]->SetXTitle("#it{E} (GeV) ");
1136  outputContainer->Add(fhDispETRD[pidIndex]);
1137  }
1138  }
1139 
1140  if ( !fFillOnlySimpleSSHisto )
1141  {
1142  fhNCellsLam0LowE[pidIndex] = new TH2F (Form("h%sNCellsLam0LowE",pidParticle[pidIndex].Data()),
1143  Form("%s: N_{cells} in cluster vs #sigma_{long}^{2}, #it{E} < 2 GeV",pidParticle[pidIndex].Data()),
1144  nbins,nmin, nmax, ssbins,ssmin,ssmax);
1145  fhNCellsLam0LowE[pidIndex]->SetXTitle("N_{cells}");
1146  fhNCellsLam0LowE[pidIndex]->SetYTitle("#sigma_{long}^{2}");
1147  outputContainer->Add(fhNCellsLam0LowE[pidIndex]);
1148 
1149  fhNCellsLam0HighE[pidIndex] = new TH2F (Form("h%sNCellsLam0HighE",pidParticle[pidIndex].Data()),
1150  Form("%s: N_{cells} in cluster vs #sigma_{long}^{2}, #it{E} > 2 GeV",pidParticle[pidIndex].Data()),
1151  nbins,nmin, nmax, ssbins,ssmin,ssmax);
1152  fhNCellsLam0HighE[pidIndex]->SetXTitle("#it{N}_{cells}");
1153  fhNCellsLam0HighE[pidIndex]->SetYTitle("#sigma_{long}^{2}");
1154  outputContainer->Add(fhNCellsLam0HighE[pidIndex]);
1155 
1156 
1157  fhEtaLam0LowE[pidIndex] = new TH2F (Form("h%sEtaLam0LowE",pidParticle[pidIndex].Data()),
1158  Form("%s: #eta vs #sigma_{long}^{2}, #it{E} < 2 GeV",pidParticle[pidIndex].Data()),
1159  netabins,etamin,etamax, ssbins,ssmin,ssmax);
1160  fhEtaLam0LowE[pidIndex]->SetYTitle("#sigma_{long}^{2}");
1161  fhEtaLam0LowE[pidIndex]->SetXTitle("#eta");
1162  outputContainer->Add(fhEtaLam0LowE[pidIndex]);
1163 
1164  fhPhiLam0LowE[pidIndex] = new TH2F (Form("h%sPhiLam0LowE",pidParticle[pidIndex].Data()),
1165  Form("%s: #varphi vs #sigma_{long}^{2}, #it{E} < 2 GeV",pidParticle[pidIndex].Data()),
1166  nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1167  fhPhiLam0LowE[pidIndex]->SetYTitle("#sigma_{long}^{2}");
1168  fhPhiLam0LowE[pidIndex]->SetXTitle("#varphi (rad)");
1169  outputContainer->Add(fhPhiLam0LowE[pidIndex]);
1170 
1171  fhEtaLam0HighE[pidIndex] = new TH2F (Form("h%sEtaLam0HighE",pidParticle[pidIndex].Data()),
1172  Form("%s: #eta vs #sigma_{long}^{2}, #it{E} > 2 GeV",pidParticle[pidIndex].Data()),
1173  netabins,etamin,etamax, ssbins,ssmin,ssmax);
1174  fhEtaLam0HighE[pidIndex]->SetYTitle("#sigma_{long}^{2}");
1175  fhEtaLam0HighE[pidIndex]->SetXTitle("#eta");
1176  outputContainer->Add(fhEtaLam0HighE[pidIndex]);
1177 
1178  fhPhiLam0HighE[pidIndex] = new TH2F (Form("h%sPhiLam0HighE",pidParticle[pidIndex].Data()),
1179  Form("%s: #varphi vs #sigma_{long}^{2}, #it{E} > 2 GeV",pidParticle[pidIndex].Data()),
1180  nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1181  fhPhiLam0HighE[pidIndex]->SetYTitle("#sigma_{long}^{2}");
1182  fhPhiLam0HighE[pidIndex]->SetXTitle("#varphi (rad)");
1183  outputContainer->Add(fhPhiLam0HighE[pidIndex]);
1184 
1185  if ( GetCalorimeter() == kEMCAL )
1186  {
1187  fhDispEtaE[pidIndex] = new TH2F (Form("h%sDispEtaE",pidParticle[pidIndex].Data()),
1188  Form("%s: #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",pidParticle[pidIndex].Data()),
1189  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1190  fhDispEtaE[pidIndex]->SetXTitle("#it{E} (GeV)");
1191  fhDispEtaE[pidIndex]->SetYTitle("#sigma^{2}_{#eta #eta}");
1192  outputContainer->Add(fhDispEtaE[pidIndex]);
1193 
1194  fhDispPhiE[pidIndex] = new TH2F (Form("h%sDispPhiE",pidParticle[pidIndex].Data()),
1195  Form("%s: #sigma^{2}_{#varphi #varphi} = #Sigma w_{i}(#varphi_{i} - <#varphi>)^{2} / #Sigma w_{i} vs E",pidParticle[pidIndex].Data()),
1196  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1197  fhDispPhiE[pidIndex]->SetXTitle("#it{E} (GeV)");
1198  fhDispPhiE[pidIndex]->SetYTitle("#sigma^{2}_{#varphi #varphi}");
1199  outputContainer->Add(fhDispPhiE[pidIndex]);
1200 
1201  fhSumEtaE[pidIndex] = new TH2F (Form("h%sSumEtaE",pidParticle[pidIndex].Data()),
1202  Form("%s: #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i})^{2} / #Sigma w_{i} - <#eta>^{2} vs E",pidParticle[pidIndex].Data()),
1203  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1204  fhSumEtaE[pidIndex]->SetXTitle("#it{E} (GeV)");
1205  fhSumEtaE[pidIndex]->SetYTitle("#delta^{2}_{#eta #eta}");
1206  outputContainer->Add(fhSumEtaE[pidIndex]);
1207 
1208  fhSumPhiE[pidIndex] = new TH2F (Form("h%sSumPhiE",pidParticle[pidIndex].Data()),
1209  Form("%s: #sigma^{2}_{#varphi #varphi} = #Sigma w_{i}(#varphi_{i})^{2}/ #Sigma w_{i} - <#varphi>^{2} vs E",pidParticle[pidIndex].Data()),
1210  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1211  fhSumPhiE[pidIndex]->SetXTitle("#it{E} (GeV)");
1212  fhSumPhiE[pidIndex]->SetYTitle("#delta^{2}_{#varphi #varphi}");
1213  outputContainer->Add(fhSumPhiE[pidIndex]);
1214 
1215  fhSumEtaPhiE[pidIndex] = new TH2F (Form("h%sSumEtaPhiE",pidParticle[pidIndex].Data()),
1216  Form("%s: #delta^{2}_{#eta #varphi} = #Sigma w_{i}(#varphi_{i} #eta_{i} ) / #Sigma w_{i} - <#varphi><#eta> vs E",pidParticle[pidIndex].Data()),
1217  nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1218  fhSumEtaPhiE[pidIndex]->SetXTitle("#it{E} (GeV)");
1219  fhSumEtaPhiE[pidIndex]->SetYTitle("#delta^{2}_{#eta #varphi}");
1220  outputContainer->Add(fhSumEtaPhiE[pidIndex]);
1221 
1222  fhDispEtaPhiDiffE[pidIndex] = new TH2F (Form("h%sDispEtaPhiDiffE",pidParticle[pidIndex].Data()),
1223  Form("%s: #sigma^{2}_{#varphi #varphi} - #sigma^{2}_{#eta #eta} vs E",pidParticle[pidIndex].Data()),
1224  nptbins,ptmin,ptmax,200, -10,10);
1225  fhDispEtaPhiDiffE[pidIndex]->SetXTitle("#it{E} (GeV)");
1226  fhDispEtaPhiDiffE[pidIndex]->SetYTitle("#sigma^{2}_{#varphi #varphi}-#sigma^{2}_{#eta #eta}");
1227  outputContainer->Add(fhDispEtaPhiDiffE[pidIndex]);
1228 
1229  fhSphericityE[pidIndex] = new TH2F (Form("h%sSphericityE",pidParticle[pidIndex].Data()),
1230  Form("%s: (#sigma^{2}_{#varphi #varphi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#varphi #varphi}) vs E",pidParticle[pidIndex].Data()),
1231  nptbins,ptmin,ptmax, 200, -1,1);
1232  fhSphericityE[pidIndex]->SetXTitle("#it{E} (GeV)");
1233  fhSphericityE[pidIndex]->SetYTitle("s = (#sigma^{2}_{#varphi #varphi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#varphi #varphi})");
1234  outputContainer->Add(fhSphericityE[pidIndex]);
1235 
1236  Int_t bin[] = {0,2,4,6,10,1000};
1237  for(Int_t i = 0; i < 5; i++)
1238  {
1239  fhDispEtaDispPhiEBin[pidIndex][i] = new TH2F (Form("h%sDispEtaDispPhi_EBin%d",pidParticle[pidIndex].Data(),i),
1240  Form("%s: #sigma^{2}_{#varphi #varphi} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pidParticle[pidIndex].Data(),bin[i],bin[i+1]),
1241  ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1242  fhDispEtaDispPhiEBin[pidIndex][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1243  fhDispEtaDispPhiEBin[pidIndex][i]->SetYTitle("#sigma^{2}_{#varphi #varphi}");
1244  outputContainer->Add(fhDispEtaDispPhiEBin[pidIndex][i]);
1245  }
1246  }
1247  }
1248  } // Shower shape
1249 
1250  if ( IsDataMC() )
1251  {
1252  if ( fFillSSHistograms )
1253  {
1254  for(Int_t i = 0; i < 6; i++)
1255  {
1256  fhMCELambda0[pidIndex][i] = new TH2F(Form("h%sELambda0_MC%s",pidParticle[pidIndex].Data(),pnamess[i].Data()),
1257  Form("%s like cluster from %s : #it{E} vs #sigma_{long}^{2}",pidParticle[pidIndex].Data(),ptypess[i].Data()),
1258  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1259  fhMCELambda0[pidIndex][i]->SetYTitle("#sigma_{long}^{2}");
1260  fhMCELambda0[pidIndex][i]->SetXTitle("#it{E} (GeV)");
1261  outputContainer->Add(fhMCELambda0[pidIndex][i]) ;
1262 
1263  fhMCELambda1[pidIndex][i] = new TH2F(Form("h%sELambda1_MC%s",pidParticle[pidIndex].Data(),pnamess[i].Data()),
1264  Form("%s like cluster from %s : #it{E} vs #sigma_{short}^{2}",pidParticle[pidIndex].Data(),ptypess[i].Data()),
1265  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1266  fhMCELambda1[pidIndex][i]->SetYTitle("#sigma_{short}^{2}");
1267  fhMCELambda1[pidIndex][i]->SetXTitle("#it{E} (GeV)");
1268  outputContainer->Add(fhMCELambda1[pidIndex][i]) ;
1269 
1271  {
1272  fhMCEDispEta[pidIndex][i] = new TH2F (Form("h%sEDispEtaE_MC%s",pidParticle[pidIndex].Data(),pnamess[i].Data()),
1273  Form("cluster from %s : %s like, #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs #it{E}",
1274  ptypess[i].Data(),pidParticle[pidIndex].Data()),
1275  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1276  fhMCEDispEta[pidIndex][i]->SetXTitle("#it{E} (GeV)");
1277  fhMCEDispEta[pidIndex][i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1278  outputContainer->Add(fhMCEDispEta[pidIndex][i]);
1279 
1280  fhMCEDispPhi[pidIndex][i] = new TH2F (Form("h%sEDispPhiE_MC%s",pidParticle[pidIndex].Data(),pnamess[i].Data()),
1281  Form("cluster from %s : %s like, #sigma^{2}_{#varphi #varphi} = #Sigma w_{i}(#varphi_{i} - <#varphi>)^{2} / #Sigma w_{i} vs #it{E}",
1282  ptypess[i].Data(),pidParticle[pidIndex].Data()),
1283  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1284  fhMCEDispPhi[pidIndex][i]->SetXTitle("#it{E} (GeV)");
1285  fhMCEDispPhi[pidIndex][i]->SetYTitle("#sigma^{2}_{#varphi #varphi}");
1286  outputContainer->Add(fhMCEDispPhi[pidIndex][i]);
1287 
1288  fhMCESumEtaPhi[pidIndex][i] = new TH2F (Form("h%sESumEtaPhiE_MC%s",pidParticle[pidIndex].Data(),pnamess[i].Data()),
1289  Form("cluster from %s : %s like, #delta^{2}_{#eta #varphi} = #Sigma w_{i}(#varphi_{i} #eta_{i} ) / #Sigma w_{i} - <#varphi><#eta> vs E",
1290  ptypess[i].Data(),pidParticle[pidIndex].Data()),
1291  nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1292  fhMCESumEtaPhi[pidIndex][i]->SetXTitle("#it{E} (GeV)");
1293  fhMCESumEtaPhi[pidIndex][i]->SetYTitle("#delta^{2}_{#eta #varphi}");
1294  outputContainer->Add(fhMCESumEtaPhi[pidIndex][i]);
1295 
1296  fhMCEDispEtaPhiDiff[pidIndex][i] = new TH2F (Form("h%sEDispEtaPhiDiffE_MC%s",pidParticle[pidIndex].Data(),pnamess[i].Data()),
1297  Form("cluster from %s : %s like, #sigma^{2}_{#varphi #varphi} - #sigma^{2}_{#eta #eta} vs #it{E}",
1298  ptypess[i].Data(),pidParticle[pidIndex].Data()),
1299  nptbins,ptmin,ptmax,200,-10,10);
1300  fhMCEDispEtaPhiDiff[pidIndex][i]->SetXTitle("#it{E} (GeV)");
1301  fhMCEDispEtaPhiDiff[pidIndex][i]->SetYTitle("#sigma^{2}_{#varphi #varphi}-#sigma^{2}_{#eta #eta}");
1302  outputContainer->Add(fhMCEDispEtaPhiDiff[pidIndex][i]);
1303 
1304  fhMCESphericity[pidIndex][i] = new TH2F (Form("h%sESphericity_MC%s",pidParticle[pidIndex].Data(),pnamess[i].Data()),
1305  Form("cluster from %s : %s like, (#sigma^{2}_{#varphi #varphi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#varphi #varphi}) vs #it{E}",
1306  ptypess[i].Data(),pidParticle[pidIndex].Data()),
1307  nptbins,ptmin,ptmax, 200,-1,1);
1308  fhMCESphericity[pidIndex][i]->SetXTitle("#it{E} (GeV)");
1309  fhMCESphericity[pidIndex][i]->SetYTitle("#it{s} = (#sigma^{2}_{#varphi #varphi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#varphi #varphi})");
1310  outputContainer->Add(fhMCESphericity[pidIndex][i]);
1311  }
1312 
1313  }// loop
1314  }
1315  }
1316 
1317  //if ( IsCaloPIDOn() && pidIndex > 0 ) continue;
1318 
1319  fhNCellsE[pidIndex] = new TH2F (Form("h%sNCellsE",pidParticle[pidIndex].Data()),
1320  Form("N cells in %s cluster vs #it{E}",pidParticle[pidIndex].Data()),
1321  nptbins,ptmin,ptmax, nbins,nmin,nmax);
1322  fhNCellsE[pidIndex]->SetXTitle("#it{E} (GeV)");
1323  fhNCellsE[pidIndex]->SetYTitle("# of cells in cluster");
1324  outputContainer->Add(fhNCellsE[pidIndex]);
1325 
1326  fhNLME[pidIndex] = new TH2F (Form("h%sNLME",pidParticle[pidIndex].Data()),
1327  Form("NLM in %s cluster vs #it{E}",pidParticle[pidIndex].Data()),
1328  nptbins,ptmin,ptmax, 10,0,10);
1329  fhNLME[pidIndex]->SetXTitle("#it{E} (GeV)");
1330  fhNLME[pidIndex]->SetYTitle("# of cells in cluster");
1331  outputContainer->Add(fhNLME[pidIndex]);
1332 
1333  fhTimeE[pidIndex] = new TH2F(Form("h%sTimeE",pidParticle[pidIndex].Data()),
1334  Form("Time in %s cluster vs #it{E}",pidParticle[pidIndex].Data())
1335  ,nptbins,ptmin,ptmax, tbins,tmin,tmax);
1336  fhTimeE[pidIndex]->SetXTitle("#it{E} (GeV)");
1337  fhTimeE[pidIndex]->SetYTitle("#it{t} (ns)");
1338  outputContainer->Add(fhTimeE[pidIndex]);
1339 
1340  fhMaxCellDiffClusterE[pidIndex] = new TH2F (Form("h%sMaxCellDiffClusterE",pidParticle[pidIndex].Data()),
1341  Form("%s: energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",pidParticle[pidIndex].Data()),
1342  nptbins,ptmin,ptmax, 500,0,1.);
1343  fhMaxCellDiffClusterE[pidIndex]->SetXTitle("#it{E}_{cluster} (GeV) ");
1344  fhMaxCellDiffClusterE[pidIndex]->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
1345  outputContainer->Add(fhMaxCellDiffClusterE[pidIndex]);
1346 
1347  fhE[pidIndex] = new TH1F(Form("h%sE",pidParticle[pidIndex].Data()),
1348  Form("Number of %s over calorimeter vs energy",pidParticle[pidIndex].Data()),
1349  nptbins,ptmin,ptmax);
1350  fhE[pidIndex]->SetYTitle("#it{N}");
1351  fhE[pidIndex]->SetXTitle("#it{E}(GeV)");
1352  outputContainer->Add(fhE[pidIndex]) ;
1353 
1354  fhPt[pidIndex] = new TH1F(Form("h%sPt",pidParticle[pidIndex].Data()),
1355  Form("Number of %s over calorimeter vs #it{p}_{T}",pidParticle[pidIndex].Data()),
1356  nptbins,ptmin,ptmax);
1357  fhPt[pidIndex]->SetYTitle("#it{N}");
1358  fhPt[pidIndex]->SetXTitle("#it{p} (GeV/#it{c})");
1359  outputContainer->Add(fhPt[pidIndex]) ;
1360 
1361  fhPhi[pidIndex] = new TH2F(Form("h%sPhi",pidParticle[pidIndex].Data()),
1362  Form("%s: #varphi vs #it{p}_{T}",pidParticle[pidIndex].Data()),
1363  nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1364  fhPhi[pidIndex]->SetYTitle("#varphi (rad)");
1365  fhPhi[pidIndex]->SetXTitle("#it{p} (GeV/#it{c})");
1366  outputContainer->Add(fhPhi[pidIndex]) ;
1367 
1368  fhEta[pidIndex] = new TH2F(Form("h%sEta",pidParticle[pidIndex].Data()),
1369  Form("%s: #eta vs #it{p}_{T}",pidParticle[pidIndex].Data()),
1370  nptbins,ptmin,ptmax,netabins,etamin,etamax);
1371  fhEta[pidIndex]->SetYTitle("#eta");
1372  fhEta[pidIndex]->SetXTitle("#it{p} (GeV/#it{c})");
1373  outputContainer->Add(fhEta[pidIndex]) ;
1374 
1375  fhEtaPhi[pidIndex] = new TH2F(Form("h%sEtaPhi",pidParticle[pidIndex].Data()),
1376  Form("%s: #eta vs #varphi",pidParticle[pidIndex].Data()),
1377  netabins,etamin,etamax,nphibins,phimin,phimax);
1378  fhEtaPhi[pidIndex]->SetYTitle("#varphi (rad)");
1379  fhEtaPhi[pidIndex]->SetXTitle("#eta");
1380  outputContainer->Add(fhEtaPhi[pidIndex]) ;
1381 
1382  if ( GetMinPt() < 0.5 )
1383  {
1384  fhEtaPhi05[pidIndex] = new TH2F(Form("h%sEtaPhi05",pidParticle[pidIndex].Data()),
1385  Form("%s: #eta vs #varphi, #it{E} > 0.5 GeV",pidParticle[pidIndex].Data()),
1386  netabins,etamin,etamax,nphibins,phimin,phimax);
1387  fhEtaPhi05[pidIndex]->SetYTitle("#varphi (rad)");
1388  fhEtaPhi05[pidIndex]->SetXTitle("#eta");
1389  outputContainer->Add(fhEtaPhi05[pidIndex]) ;
1390  }
1391 
1392 
1393  if ( IsDataMC() )
1394  {
1395  for(Int_t i = 0; i < fNOriginHistograms; i++)
1396  {
1397  fhMCE[pidIndex][i] = new TH1F(Form("h%sE_MC%s",pidParticle[pidIndex].Data(),pname[i].Data()),
1398  Form("%s like cluster from %s : E ",pidParticle[pidIndex].Data(),ptype[i].Data()),
1399  nptbins,ptmin,ptmax);
1400  fhMCE[pidIndex][i]->SetXTitle("#it{E} (GeV)");
1401  outputContainer->Add(fhMCE[pidIndex][i]) ;
1402 
1403  fhMCPt[pidIndex][i] = new TH1F(Form("h%sPt_MC%s",pidParticle[pidIndex].Data(),pname[i].Data()),
1404  Form("%s like cluster from %s : #it{p}_{T} ",pidParticle[pidIndex].Data(),ptype[i].Data()),
1405  nptbins,ptmin,ptmax);
1406  fhMCPt[pidIndex][i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1407  outputContainer->Add(fhMCPt[pidIndex][i]) ;
1408 
1409  fhMCEta[pidIndex][i] = new TH2F(Form("h%sEta_MC%s",pidParticle[pidIndex].Data(),pname[i].Data()),
1410  Form("%s like cluster from %s : #eta ",pidParticle[pidIndex].Data(),ptype[i].Data()),
1411  nptbins,ptmin,ptmax,netabins,etamin,etamax);
1412  fhMCEta[pidIndex][i]->SetYTitle("#eta");
1413  fhMCEta[pidIndex][i]->SetXTitle("#it{E} (GeV)");
1414  outputContainer->Add(fhMCEta[pidIndex][i]) ;
1415 
1416  fhMCPhi[pidIndex][i] = new TH2F(Form("h%sPhi_MC%s",pidParticle[pidIndex].Data(),pname[i].Data()),
1417  Form("%s like cluster from %s : #varphi ",pidParticle[pidIndex].Data(),ptype[i].Data()),
1418  nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1419  fhMCPhi[pidIndex][i]->SetYTitle("#varphi (rad)");
1420  fhMCPhi[pidIndex][i]->SetXTitle("#it{E} (GeV)");
1421  outputContainer->Add(fhMCPhi[pidIndex][i]) ;
1422 
1423 
1424  fhMCDeltaE[pidIndex][i] = new TH2F (Form("h%sDeltaE_MC%s",pidParticle[pidIndex].Data(),pname[i].Data()),
1425  Form("%s like MC - Reco E from %s",pidParticle[pidIndex].Data(),pname[i].Data()),
1426  nptbins,ptmin,ptmax, 200,-50,50);
1427  fhMCDeltaE[pidIndex][i]->SetXTitle("#Delta #it{E} (GeV)");
1428  outputContainer->Add(fhMCDeltaE[pidIndex][i]);
1429 
1430  fhMC2E[pidIndex][i] = new TH2F (Form("h%s2E_MC%s",pidParticle[pidIndex].Data(),pname[i].Data()),
1431  Form("%s like E distribution, reconstructed vs generated from %s",pidParticle[pidIndex].Data(),pname[i].Data()),
1432  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1433  fhMC2E[pidIndex][i]->SetXTitle("#it{E}_{rec} (GeV)");
1434  fhMC2E[pidIndex][i]->SetYTitle("#it{E}_{gen} (GeV)");
1435  outputContainer->Add(fhMC2E[pidIndex][i]);
1436 
1437  }
1438  } // MC
1439  }// pid Index
1440 
1441 
1442  if ( fFillSSHistograms )
1443  {
1444  if ( IsDataMC() )
1445  {
1446  if ( !GetReader()->IsEmbeddedClusterSelectionOn() )
1447  {
1448  fhMCElectronELambda0NoOverlap = new TH2F("hELambda0_MCElectron_NoOverlap",
1449  "cluster from Electron : E vs #sigma_{long}^{2}",
1450  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1451  fhMCElectronELambda0NoOverlap->SetYTitle("#sigma_{long}^{2}");
1452  fhMCElectronELambda0NoOverlap->SetXTitle("#it{E} (GeV)");
1453  outputContainer->Add(fhMCElectronELambda0NoOverlap) ;
1454 
1455  fhMCElectronELambda0TwoOverlap = new TH2F("hELambda0_MCElectron_TwoOverlap",
1456  "cluster from Electron : E vs #sigma_{long}^{2}",
1457  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1458  fhMCElectronELambda0TwoOverlap->SetYTitle("#sigma_{long}^{2}");
1459  fhMCElectronELambda0TwoOverlap->SetXTitle("#it{E} (GeV)");
1460  outputContainer->Add(fhMCElectronELambda0TwoOverlap) ;
1461 
1462  fhMCElectronELambda0NOverlap = new TH2F("hELambda0_MCElectron_NOverlap",
1463  "cluster from Electron : E vs #sigma_{long}^{2}",
1464  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1465  fhMCElectronELambda0NOverlap->SetYTitle("#sigma_{long}^{2}");
1466  fhMCElectronELambda0NOverlap->SetXTitle("#it{E} (GeV)");
1467  outputContainer->Add(fhMCElectronELambda0NOverlap) ;
1468  } // No embedding
1469 
1470  // Fill histograms to check shape of embedded clusters
1471  if ( GetReader()->IsEmbeddedClusterSelectionOn() )
1472  {
1473  fhEmbeddedSignalFractionEnergy = new TH2F("hEmbeddedSignal_FractionEnergy",
1474  "Energy Fraction of embedded signal versus cluster energy",
1475  nptbins,ptmin,ptmax,100,0.,1.);
1476  fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
1477  fhEmbeddedSignalFractionEnergy->SetXTitle("#it{E} (GeV)");
1478  outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
1479 
1480  fhEmbedElectronELambda0FullSignal = new TH2F("hELambda0_EmbedElectron_FullSignal",
1481  "cluster from Electron embedded with more than 90% energy in cluster : E vs #sigma_{long}^{2}",
1482  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1483  fhEmbedElectronELambda0FullSignal->SetYTitle("#sigma_{long}^{2}");
1484  fhEmbedElectronELambda0FullSignal->SetXTitle("#it{E} (GeV)");
1485  outputContainer->Add(fhEmbedElectronELambda0FullSignal) ;
1486 
1487  fhEmbedElectronELambda0MostlySignal = new TH2F("hELambda0_EmbedElectron_MostlySignal",
1488  "cluster from Electron embedded with 50% to 90% energy in cluster : E vs #sigma_{long}^{2}",
1489  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1490  fhEmbedElectronELambda0MostlySignal->SetYTitle("#sigma_{long}^{2}");
1491  fhEmbedElectronELambda0MostlySignal->SetXTitle("#it{E} (GeV)");
1492  outputContainer->Add(fhEmbedElectronELambda0MostlySignal) ;
1493 
1494  fhEmbedElectronELambda0MostlyBkg = new TH2F("hELambda0_EmbedElectron_MostlyBkg",
1495  "cluster from Electron embedded with 10% to 50% energy in cluster : E vs #sigma_{long}^{2}",
1496  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1497  fhEmbedElectronELambda0MostlyBkg->SetYTitle("#sigma_{long}^{2}");
1498  fhEmbedElectronELambda0MostlyBkg->SetXTitle("#it{E} (GeV)");
1499  outputContainer->Add(fhEmbedElectronELambda0MostlyBkg) ;
1500 
1501  fhEmbedElectronELambda0FullBkg = new TH2F("hELambda0_EmbedElectron_FullBkg",
1502  "cluster from Electronm embedded with 0% to 10% energy in cluster : E vs #sigma_{long}^{2}",
1503  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1504  fhEmbedElectronELambda0FullBkg->SetYTitle("#sigma_{long}^{2}");
1505  fhEmbedElectronELambda0FullBkg->SetXTitle("#it{E} (GeV)");
1506  outputContainer->Add(fhEmbedElectronELambda0FullBkg) ;
1507  } // Embedded histograms
1508  } // Histos with MC
1509  } // Fill SS MC histograms
1510 
1511  return outputContainer ;
1512 }
1513 
1514 //_________________________
1516 //_________________________
1518 {
1519  if ( GetCalorimeter() == kPHOS && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD() )
1520  AliFatal("STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!");
1521  else if ( GetCalorimeter() == kEMCAL && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD() )
1522  AliFatal("STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!");
1523 }
1524 
1525 //___________________________________
1527 //___________________________________
1529 {
1530  AddToHistogramsName("AnaElectron_");
1531 
1532  fMinDist = 2.;
1533 
1534  fTimeCutMin = -1;
1535  fTimeCutMax = 9999999;
1536 
1537  fNCellsCut = 1;
1538 
1539 // fM20Min = 0.00;
1540 // fM20Max = 0.30;
1541 
1542  fM02Min = 0.05;
1543  fM02Max = 0.35;
1544 
1545 //fdEdxMin = 75;//76. for LHC11a, but for LHC11c pass1 56.
1546 //fdEdxMax = 95;//85. for LHC11a, but for LHC11c pass1 64.
1547 
1548  fEOverPMin = 0.9; // 0.8 for LHC11a, but for LHC11c pass1 0.9
1549  fEOverPMax = 1.2; // for LHC11a and LHC11c pass1
1550 
1551  fNSigmaMax = 3;
1552  fNSigmaMin =-1;
1553 
1554  fNSigmaMaxHad=-4;
1555  fNSigmaMinHad=-10;
1556 
1557 }
1558 
1559 //_________________________________________
1561 //_________________________________________
1563 {
1564  // Get the vertex
1565  Double_t v[3] = {0,0,0}; //vertex ;
1566  GetReader()->GetVertex(v);
1567 
1568  // Select the Calorimeter of the photon
1569  TObjArray * pl = 0x0;
1570  if ( GetCalorimeter() == kPHOS ) pl = GetPHOSClusters ();
1571  else if ( GetCalorimeter() == kEMCAL ) pl = GetEMCALClusters();
1572 
1573  if ( !pl )
1574  {
1575  AliWarning(Form("TObjArray with %s clusters is NULL!",GetCalorimeterString().Data()));
1576  return;
1577  }
1579 
1580  AliPIDResponse *pidResponse = 0;
1581 
1582  if ( dataType == AliCaloTrackReader::kESD )
1583  pidResponse = (dynamic_cast<AliESDInputHandler*>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()))->GetPIDResponse();
1584  else if ( dataType == AliCaloTrackReader::kAOD )
1585  pidResponse = (dynamic_cast<AliAODInputHandler*>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()))->GetPIDResponse();
1586 
1587  if ( !pidResponse )
1588  {
1589  AliFatal("AliPIDResponse not available, did you initialize the task?");
1590  return; // not needed, coverity ...
1591  }
1592 
1593  //Init arrays, variables, get number of clusters
1594  Int_t nCaloClusters = pl->GetEntriesFast();
1595  //List to be used in conversion analysis, to tag the cluster as candidate for conversion
1596 
1597  AliDebug(1,Form("Input %s cluster entries %d", GetCalorimeterString().Data(), nCaloClusters));
1598 
1599  //----------------------------------------------------
1600  // Fill AOD with PHOS/EMCAL AliCaloTrackParticle objects
1601  //----------------------------------------------------
1602  // Loop on clusters
1603  for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
1604  {
1605  AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
1606  //printf("calo %d, %f\n",icalo,cluE);
1607 
1608  //Get the index where the cluster comes, to retrieve the corresponding vertex
1609  Int_t evtIndex = 0 ;
1610  if ( GetMixedEvent() )
1611  {
1612  evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
1613  //Get the vertex and check it is not too large in z
1614  if ( TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut() ) continue;
1615  }
1616 
1617  //Cluster selection, not charged, with photon id and in fiducial cut
1619  {
1620  calo->GetMomentum(fMomentum,GetVertex(evtIndex)) ;
1621  }//Assume that come from vertex in straight line
1622  else
1623  {
1624  Double_t vertex[]={0,0,0};
1625  calo->GetMomentum(fMomentum,vertex) ;
1626  }
1627 
1628  //--------------------------------------
1629  // Cluster selection
1630  //--------------------------------------
1631  AliVCaloCells* cells = 0;
1632  if ( GetCalorimeter() == kEMCAL ) cells = GetEMCALCells();
1633  else cells = GetPHOSCells();
1634 
1635  Int_t nMaxima = GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells); // NLM
1636  if ( !ClusterSelected(calo,nMaxima) ) continue;
1637 
1638  //-------------------------------------
1639  // PID selection
1640  //-------------------------------------
1641 
1642  AliVTrack *track = GetCaloUtils()->GetMatchedTrack(calo, GetReader()->GetInputEvent());
1643 
1644  if ( !track )
1645  {
1646  AliWarning("Null track");
1647  continue;
1648  }
1649 
1650  Float_t cluE = calo ->E();
1651  Float_t traP = track->P();
1652 
1653  if ( traP < 0.1 )
1654  {
1655  AliWarning(Form("Too Low P track %f GeV/#it{c}, continue\n",traP));
1656  continue;
1657  }
1658 
1659  //
1660  // Get Identification cuts
1661  //
1662  Float_t dEdx = track->GetTPCsignal();
1663  Float_t eOverp = cluE/traP;
1664 
1665  Float_t m02 = calo->GetM02();
1666  Float_t m20 = calo->GetM20();
1667 
1668  Double_t nSigma = pidResponse->NumberOfSigmasTPC(track, AliPID::kElectron);
1669 
1670  AliDebug(1,Form("Cluster E %2.2f, Track P %2.2f, E/P %2.2f, dEdx %2.2f, n sigma %2.2f",
1671  cluE,traP,eOverp, dEdx,nSigma));
1672 
1673  //printf("Cluster E %2.2f, Track P %2.2f, E/P %2.2f, dEdx %2.2f, n sigma %2.2f\n",
1674  // cluE,traP,eOverp, dEdx,nSigma);
1675 
1676  //
1677  // Plot different track PID distributions without and with different cut combinations
1678  //
1679  fhdEdxvsE ->Fill(cluE, dEdx, GetEventWeight());
1680  fhdEdxvsP ->Fill(traP, dEdx, GetEventWeight());
1681 
1682  fhEOverPvsE->Fill(cluE, eOverp, GetEventWeight());
1683  fhEOverPvsP->Fill(traP, eOverp, GetEventWeight());
1684 
1685  fhNSigmavsE->Fill(cluE, nSigma, GetEventWeight());
1686  fhNSigmavsP->Fill(traP, nSigma, GetEventWeight());
1687 
1688  if ( eOverp < fEOverPMax && eOverp > fEOverPMin )
1689  {
1690  fhdEdxvsECutEOverP ->Fill(cluE, dEdx , GetEventWeight());
1691  fhdEdxvsPCutEOverP ->Fill(traP, dEdx , GetEventWeight());
1692 
1693  fhNSigmavsECutEOverP->Fill(cluE, nSigma, GetEventWeight());
1694  fhNSigmavsPCutEOverP->Fill(traP, nSigma, GetEventWeight());
1695  }
1696 
1697  if ( m02 > fM02Min && m02 < fM02Max )
1698  {
1699  fhdEdxvsECutM02 ->Fill(cluE, dEdx , GetEventWeight());
1700  fhdEdxvsPCutM02 ->Fill(traP, dEdx , GetEventWeight());
1701  fhEOverPvsECutM02->Fill(cluE, eOverp, GetEventWeight());
1702  fhEOverPvsPCutM02->Fill(traP, eOverp, GetEventWeight());
1703  fhNSigmavsECutM02->Fill(cluE, nSigma, GetEventWeight());
1704  fhNSigmavsPCutM02->Fill(traP, nSigma, GetEventWeight());
1705 
1706  if ( m20 > fM20Min && m20 < fM20Max )
1707  {
1708  fhdEdxvsECutM02AndM20 ->Fill(cluE, dEdx , GetEventWeight());
1709  fhdEdxvsPCutM02AndM20 ->Fill(traP, dEdx , GetEventWeight());
1710  fhEOverPvsECutM02AndM20->Fill(cluE, eOverp, GetEventWeight());
1711  fhEOverPvsPCutM02AndM20->Fill(traP, eOverp, GetEventWeight());
1712  fhNSigmavsECutM02AndM20->Fill(cluE, nSigma, GetEventWeight());
1713  fhNSigmavsPCutM02AndM20->Fill(traP, nSigma, GetEventWeight());
1714  }
1715  } // shower shape cut
1716 
1717  if ( dEdx < fdEdxMax && dEdx > fdEdxMin )
1718  {
1719  fhEOverPvsECutdEdx->Fill(cluE, eOverp, GetEventWeight());
1720  fhEOverPvsPCutdEdx->Fill(traP, eOverp, GetEventWeight());
1721  fhNSigmavsECutdEdx->Fill(cluE, nSigma, GetEventWeight());
1722  fhNSigmavsPCutdEdx->Fill(traP, nSigma, GetEventWeight());
1723 
1724  if ( m02 > fM02Min && m02 < fM02Max )
1725  {
1726  fhEOverPvsECutM02CutdEdx->Fill(cluE, eOverp, GetEventWeight());
1727  fhEOverPvsPCutM02CutdEdx->Fill(traP, eOverp, GetEventWeight());
1728  fhNSigmavsECutM02CutdEdx->Fill(cluE, nSigma, GetEventWeight());
1729  fhNSigmavsPCutM02CutdEdx->Fill(traP, nSigma, GetEventWeight());
1730 
1731  if ( m20 > fM20Min && m20 < fM20Max )
1732  {
1733  fhEOverPvsECutM02AndM20CutdEdx->Fill(cluE, eOverp, GetEventWeight());
1734  fhEOverPvsPCutM02AndM20CutdEdx->Fill(traP, eOverp, GetEventWeight());
1735  fhNSigmavsECutM02AndM20CutdEdx->Fill(cluE, eOverp, GetEventWeight());
1736  fhNSigmavsPCutM02AndM20CutdEdx->Fill(traP, eOverp, GetEventWeight());
1737  }
1738  } // shower shape cut
1739  }// dE/dx
1740 
1741  if ( nSigma < fNSigmaMax && nSigma > fNSigmaMin )
1742  {
1743  fhdEdxvsECutNSigma ->Fill(cluE, dEdx, GetEventWeight());
1744  fhdEdxvsPCutNSigma ->Fill(traP, dEdx, GetEventWeight());
1745  fhEOverPvsECutNSigma->Fill(cluE, eOverp, GetEventWeight());
1746  fhEOverPvsPCutNSigma->Fill(traP, eOverp, GetEventWeight());
1747 
1748  if ( m02 > fM02Min && m02 < fM02Max )
1749  {
1750  fhdEdxvsECutM02CutNSigma ->Fill(cluE, dEdx, GetEventWeight());
1751  fhdEdxvsPCutM02CutNSigma ->Fill(traP, dEdx, GetEventWeight());
1752  fhEOverPvsECutM02CutNSigma->Fill(cluE, eOverp, GetEventWeight());
1753  fhEOverPvsPCutM02CutNSigma->Fill(traP, eOverp, GetEventWeight());
1754 
1755  if ( m20 > fM20Min && m20 < fM20Max )
1756  {
1757  fhdEdxvsECutM02AndM20CutNSigma ->Fill(cluE, dEdx, GetEventWeight());
1758  fhdEdxvsPCutM02AndM20CutNSigma ->Fill(traP, dEdx, GetEventWeight());
1759  fhEOverPvsECutM02AndM20CutNSigma->Fill(cluE, eOverp, GetEventWeight());
1760  fhEOverPvsPCutM02AndM20CutNSigma->Fill(traP, eOverp, GetEventWeight());
1761  }
1762  } // shower shape cut
1763  }// n sigma
1764 
1765  //--------------------------------------------------------------------------
1766  // Select as hadron or electron or none
1767  //--------------------------------------------------------------------------
1768  Int_t pid = -1;
1769  Int_t pidNoSS = -1;
1770  Int_t pidIndex = -1;
1771 
1772  //
1773  // Electron?
1774  //
1775 
1776  if ( dEdx < fdEdxMax && dEdx > fdEdxMin &&
1777  eOverp < fEOverPMax && eOverp > fEOverPMin &&
1778  nSigma < fNSigmaMax && nSigma > fNSigmaMin )
1779  {
1780  pidNoSS = AliCaloPID::kElectron;
1781  }
1782 
1783  if ( dEdx < fdEdxMax && dEdx > fdEdxMin &&
1784  eOverp < fEOverPMax && eOverp > fEOverPMin &&
1785  nSigma < fNSigmaMax && nSigma > fNSigmaMin &&
1786  m02 < fM02Max && m02 > fM02Min &&
1787  m20 < fM20Max && m20 > fM20Min )
1788  {
1789  pid = AliCaloPID::kElectron;
1790  pidIndex = 0;
1791  }
1792 
1793  //
1794  // Hadron?
1795  //
1796  else if ( dEdx < fdEdxMaxHad && dEdx > fdEdxMinHad &&
1797  eOverp < fEOverPMaxHad && eOverp > fEOverPMinHad &&
1798  nSigma < fNSigmaMaxHad && nSigma > fNSigmaMinHad )
1799  {
1801  pidNoSS = AliCaloPID::kChargedHadron;
1802  pidIndex = 1;
1803  }
1804 
1805  //--------------------------------------------------------------------------
1806  // Histograms with track matching residuals, with and without PID selection
1807  //--------------------------------------------------------------------------
1808 
1809  Float_t dEta = calo->GetTrackDz();
1810  Float_t dPhi = calo->GetTrackDx();
1811  Bool_t positive = kFALSE;
1812  if(track) positive = (track->Charge()>0);
1813 
1814  AliDebug(1,Form("\tt charge %d, dEta %2.2f, dPhi %2.2f",
1815  positive,dEta,dPhi));
1816 
1817  //printf("\t charge %d, dEta %2.2f, dPhi %2.2f\n",positive,dEta,dPhi);
1818 
1819  // Any accepted cluster
1820  fhDEtavsE[2][positive]->Fill(cluE, dEta, GetEventWeight());
1821  fhDPhivsE[2][positive]->Fill(cluE, dPhi, GetEventWeight());
1822  fhDEtavsP[2][positive]->Fill(traP, dEta, GetEventWeight());
1823  fhDPhivsP[2][positive]->Fill(traP, dPhi, GetEventWeight());
1824 
1825  if ( cluE > 1 && track->P() > 1 )
1826  fhDEtaDPhi[2][positive]->Fill(dEta,dPhi, GetEventWeight());
1827 
1828  // Identified clusters
1829  if ( pidIndex != -1 )
1830  {
1831  fhDEtavsE[pidIndex][positive]->Fill(cluE, dEta, GetEventWeight());
1832  fhDPhivsE[pidIndex][positive]->Fill(cluE, dPhi, GetEventWeight());
1833  fhDEtavsP[pidIndex][positive]->Fill(traP, dEta, GetEventWeight());
1834  fhDPhivsP[pidIndex][positive]->Fill(traP, dPhi, GetEventWeight());
1835 
1836  if ( cluE > 1 && track->P() > 1 )
1837  fhDEtaDPhi[pidIndex][positive]->Fill(dEta,dPhi, GetEventWeight());
1838  }
1839 
1840  //--------------------------------------------------------------------------
1841  // Play with the MC stack if available
1842  //--------------------------------------------------------------------------
1843 
1844  // Check origin of the candidates
1845  Int_t tag = -1 ;
1846  if ( IsDataMC() )
1847  {
1848  tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),
1849  calo->GetClusterMCEdepFraction(),
1850  calo->GetNLabels(), GetMC(),
1852  cluE);
1853 
1854  AliDebug(1,Form("Origin of candidate, bit map %d",tag));
1855 
1856  Int_t mcFlag = -1;
1857  if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) )
1858  {
1859  fhMCdEdxvsE [kmcPhoton]->Fill(cluE, dEdx , GetEventWeight());
1860  fhMCdEdxvsP [kmcPhoton]->Fill(traP, dEdx , GetEventWeight());
1861  fhMCNSigmavsE[kmcPhoton]->Fill(cluE, nSigma, GetEventWeight());
1862  fhMCNSigmavsP[kmcPhoton]->Fill(traP, nSigma, GetEventWeight());
1863  fhMCEOverPvsE[kmcPhoton]->Fill(cluE, eOverp, GetEventWeight());
1864  fhMCEOverPvsP[kmcPhoton]->Fill(traP, eOverp, GetEventWeight());
1865 
1866  if(pidIndex!=-1)
1867  {
1868  fhMCEOverPvsEAfterCuts[kmcPhoton][pidIndex]->Fill(cluE, eOverp, GetEventWeight());
1869  fhMCEOverPvsPAfterCuts[kmcPhoton][pidIndex]->Fill(traP, eOverp, GetEventWeight());
1870  }
1871 
1872  if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1873  {
1874  mcFlag = kmcConversion;
1875  }
1876  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
1877  !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) )
1878  {
1879  mcFlag = kmcPi0Decay;
1880  }
1881  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) )
1882  {
1883  mcFlag = kmcPi0;
1884  }
1885  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) )
1886  {
1887  mcFlag = kmcEta;
1888  }
1889  else if ( fhMCE[pidIndex][kmcOtherDecay] )
1890  {
1891  mcFlag = kmcOtherDecay;
1892  }
1893  }
1894  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) )
1895  {
1896  mcFlag = kmcAntiNeutron;
1897  }
1898  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) )
1899  {
1900  mcFlag = kmcAntiProton;
1901  }
1902  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) )
1903  {
1904  mcFlag = kmcElectron;
1905  }
1906  else if ( fhMCE[pidIndex][kmcOther] )
1907  {
1908  mcFlag = kmcOther;
1909  }
1910 
1911  if ( mcFlag > 0 && fhMCdEdxvsE[mcFlag])
1912  {
1913  fhMCdEdxvsE [mcFlag]->Fill(cluE, dEdx , GetEventWeight());
1914  fhMCdEdxvsP [mcFlag]->Fill(traP, dEdx , GetEventWeight());
1915  fhMCNSigmavsE[mcFlag]->Fill(cluE, nSigma, GetEventWeight());
1916  fhMCNSigmavsP[mcFlag]->Fill(traP, nSigma, GetEventWeight());
1917  fhMCEOverPvsE[mcFlag]->Fill(cluE, eOverp, GetEventWeight());
1918  fhMCEOverPvsP[mcFlag]->Fill(traP, eOverp, GetEventWeight());
1919 
1920  if(pidIndex!=-1)
1921  {
1922  fhMCEOverPvsEAfterCuts[mcFlag][pidIndex]->Fill(cluE, eOverp, GetEventWeight());
1923  fhMCEOverPvsPAfterCuts[mcFlag][pidIndex]->Fill(traP, eOverp, GetEventWeight());
1924  }
1925  }
1926 
1927  }// set MC tag and fill Histograms with MC
1928 
1929  //---------------------------------
1930  // Fill some shower shape histograms
1931  //---------------------------------
1932 
1933  FillShowerShapeHistograms(calo,tag,pidNoSS);
1934 
1935  if ( pidNoSS == AliCaloPID::kElectron )
1936  WeightHistograms(calo);
1937 
1938 // Do not rely for the moment on AliCaloPID method, all electron/hadron
1939 // selection implemented here in the lines above
1940 //
1941 // //-----------------------------------------
1942 // // PID Shower Shape selection or bit setting
1943 // //-----------------------------------------
1944 //
1945 // // Data, PID check on
1946 // if ( IsCaloPIDOn() )
1947 // {
1948 // // Get most probable PID, 2 options check bayesian PID weights or redo PID
1949 // // By default, redo PID
1950 //
1951 // if ( GetCaloPID()->GetIdentifiedParticleType(calo)!=AliCaloPID::kPhoton )
1952 // {
1953 // if ( fAODParticle == AliCaloPID::kElectron )
1954 // continue;
1955 //
1956 // if ( fAODParticle == 0 )
1957 // pid = AliCaloPID::kChargedHadron ;
1958 // }
1959 //
1960 // AliDebug(1,Form("PDG of identified particle %d",pid));
1961 // }
1962 
1963 
1964  //--------------------------------------------------------------------------
1965  // From no on select either identified electron or hadron clusters
1966  //--------------------------------------------------------------------------
1967  if ( pidIndex < 0 ) continue;
1968 
1969  AliDebug(1,Form("Selection cuts passed: pT %3.2f, type %d",fMomentum.Pt(),pidIndex));
1970 
1971  Float_t maxCellFraction = 0;
1972  Int_t absID = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
1973  if ( absID >= 0 )
1974  fhMaxCellDiffClusterE[pidIndex]->Fill(fMomentum.E(), maxCellFraction, GetEventWeight());
1975 
1976  fhNCellsE[pidIndex] ->Fill(fMomentum.E(), calo->GetNCells() , GetEventWeight());
1977  fhNLME [pidIndex] ->Fill(fMomentum.E(), nMaxima , GetEventWeight());
1978  fhTimeE [pidIndex] ->Fill(fMomentum.E(), calo->GetTOF()*1.e9, GetEventWeight());
1979 
1980  //----------------------------
1981  // Create AOD for analysis
1982  //----------------------------
1983 
1984  // Add AOD with electron/hadron object to aod branch
1985  if ( pid == fAODParticle || fAODParticle == 0 )
1986  {
1988 
1989  //...............................................
1990  //Set the indeces of the original caloclusters (MC, ID), and calorimeter
1991  Int_t label = calo->GetLabel();
1992  aodpart.SetLabel(label);
1993  aodpart.SetCaloLabel (calo->GetID(),-1);
1994  aodpart.SetTrackLabel(GetReader()->GetTrackID(track),-1); // needed instead of track->GetID() since AOD needs some manipulations
1995 
1996  aodpart.SetDetectorTag(GetCalorimeter());
1997  //printf("Index %d, Id %d, iaod %d\n",icalo, calo->GetID(),GetOutputAODBranch()->GetEntriesFast());
1998 
1999  aodpart.SetM02(calo->GetM02());
2000  aodpart.SetM20(calo->GetM20());
2001  aodpart.SetNLM(nMaxima);
2002  aodpart.SetTime(calo->GetTOF()*1e9);
2003  aodpart.SetNCells(calo->GetNCells());
2004  Int_t nSM = GetModuleNumber(calo);
2005  aodpart.SetSModNumber(nSM);
2006 
2007  // MC tag
2008  aodpart.SetTag(tag);
2009 
2010  // PID tag
2011  aodpart.SetIdentifiedParticleType(pid);
2012 
2013  AddAODParticle(aodpart);
2014  }
2015 
2016  }//loop
2017 
2018  AliDebug(1,Form("End fill AODs, with %d entries",GetOutputAODBranch()->GetEntriesFast()));
2019 
2020 }
2021 
2022 //________________________________________________
2024 //________________________________________________
2026 {
2027  // Access MC information in stack if requested, check that it exists.
2028 
2029  AliVParticle * primary = 0x0;
2030 
2031  if ( IsDataMC() && !GetMC() )
2032  {
2033  AliFatal("MCEvent not available! STOP");
2034  return;
2035  }
2036 
2037  // Get vertex
2038  Double_t v[3] = {0,0,0}; //vertex ;
2039  GetReader()->GetVertex(v);
2040  //fhVertex->Fill(v[0], v[1], v[2], GetEventWeight());
2041  if ( TMath::Abs(v[2]) > GetZvertexCut() ) return ; // done elsewhere for Single Event analysis, but there for mixed event
2042 
2043  //----------------------------------
2044  //Loop on stored AOD photons
2045  Int_t naod = GetOutputAODBranch()->GetEntriesFast();
2046  AliDebug(1,Form("AOD branch entries %d", naod));
2047 
2048  for(Int_t iaod = 0; iaod < naod ; iaod++)
2049  {
2052 
2053  Int_t pidIndex = 0;// Electron
2054  if ( pdg == AliCaloPID::kElectron ) pidIndex = 0;
2055  else if ( pdg == AliCaloPID::kChargedHadron ) pidIndex = 1;
2056  else continue ;
2057 
2058  if ( ((Int_t) ph->GetDetectorTag()) != GetCalorimeter() ) continue;
2059 
2060  AliDebug(1,Form("ID Electron: pt %f, phi %f, eta %f", ph->Pt(),ph->Phi(),ph->Eta())) ;
2061 
2062  //................................
2063  //Fill photon histograms
2064  Float_t ptcluster = ph->Pt();
2065  Float_t phicluster = ph->Phi();
2066  Float_t etacluster = ph->Eta();
2067  Float_t ecluster = ph->E();
2068 
2069  fhE [pidIndex] ->Fill(ecluster, GetEventWeight());
2070  fhPt[pidIndex] ->Fill(ptcluster, GetEventWeight());
2071 
2072  fhPhi[pidIndex] ->Fill(ptcluster, phicluster, GetEventWeight());
2073  fhEta[pidIndex] ->Fill(ptcluster, etacluster, GetEventWeight());
2074 
2075  if ( ecluster > 0.5 ) fhEtaPhi [pidIndex]->Fill(etacluster, phicluster, GetEventWeight());
2076  else if ( GetMinPt() < 0.5 ) fhEtaPhi05[pidIndex]->Fill(etacluster, phicluster, GetEventWeight());
2077 
2078  //.......................................
2079  //Play with the MC data if available
2080  if ( IsDataMC() )
2081  {
2082  //....................................................................
2083  // Access MC information in stack if requested, check that it exists.
2084  Int_t label =ph->GetLabel();
2085  if ( label < 0 )
2086  {
2087  AliDebug(1,Form("*** bad label ***: label %d", label));
2088  continue;
2089  }
2090 
2091  Int_t nprim = GetMC()->GetNumberOfTracks();
2092  if ( label >= nprim )
2093  {
2094  AliDebug(1,Form("*** large label ***: label %d, n tracks %d", label, nprim));
2095  continue ;
2096  }
2097 
2098  Float_t eprim = 0;
2099  //Float_t ptprim = 0;
2100  primary = GetMC()->GetTrack(label);
2101 
2102  if ( !primary )
2103  {
2104  AliWarning(Form("*** no primary ***: label %d", label));
2105  continue;
2106  }
2107 
2108  eprim = primary->E();
2109  //ptprim = aodprimary->Pt();
2110 
2111  Int_t tag =ph->GetTag();
2112 
2113  if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[pidIndex][kmcPhoton] )
2114  {
2115  fhMCE [pidIndex][kmcPhoton] ->Fill(ecluster , GetEventWeight());
2116  fhMCPt [pidIndex][kmcPhoton] ->Fill(ptcluster, GetEventWeight());
2117 
2118  fhMCPhi[pidIndex][kmcPhoton] ->Fill(ecluster, phicluster, GetEventWeight());
2119  fhMCEta[pidIndex][kmcPhoton] ->Fill(ecluster, etacluster, GetEventWeight());
2120 
2121  fhMC2E [pidIndex][kmcPhoton] ->Fill(ecluster, eprim , GetEventWeight());
2122  fhMCDeltaE[pidIndex][kmcPhoton] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
2123 
2124  if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) && fhMCE[pidIndex][kmcConversion] )
2125  {
2126  fhMCE [pidIndex][kmcConversion] ->Fill(ecluster , GetEventWeight());
2127  fhMCPt [pidIndex][kmcConversion] ->Fill(ptcluster, GetEventWeight());
2128 
2129  fhMCPhi[pidIndex][kmcConversion] ->Fill(ecluster, phicluster, GetEventWeight());
2130  fhMCEta[pidIndex][kmcConversion] ->Fill(ecluster, etacluster, GetEventWeight());
2131 
2132  fhMC2E[pidIndex][kmcConversion] ->Fill(ecluster, eprim , GetEventWeight());
2133  fhMCDeltaE[pidIndex][kmcConversion] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
2134  }
2135  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
2136  !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[pidIndex][kmcPi0Decay] )
2137  {
2138  fhMCE [pidIndex][kmcPi0Decay] ->Fill(ecluster , GetEventWeight());
2139  fhMCPt [pidIndex][kmcPi0Decay] ->Fill(ptcluster, GetEventWeight());
2140 
2141  fhMCPhi[pidIndex][kmcPi0Decay] ->Fill(ecluster, phicluster, GetEventWeight());
2142  fhMCEta[pidIndex][kmcPi0Decay] ->Fill(ecluster, etacluster, GetEventWeight());
2143 
2144  fhMC2E[pidIndex][kmcPi0Decay] ->Fill(ecluster, eprim , GetEventWeight());
2145  fhMCDeltaE[pidIndex][kmcPi0Decay] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
2146  }
2147  else if ( ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
2148  GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhMCE[pidIndex][kmcOtherDecay] )
2149  {
2150  fhMCE [pidIndex][kmcOtherDecay] ->Fill(ecluster , GetEventWeight());
2151  fhMCPt [pidIndex][kmcOtherDecay] ->Fill(ptcluster, GetEventWeight());
2152 
2153  fhMCPhi[pidIndex][kmcOtherDecay] ->Fill(ecluster, phicluster, GetEventWeight());
2154  fhMCEta[pidIndex][kmcOtherDecay] ->Fill(ecluster, etacluster, GetEventWeight());
2155 
2156  fhMC2E [pidIndex][kmcOtherDecay] ->Fill(ecluster, eprim , GetEventWeight());
2157  fhMCDeltaE[pidIndex][kmcOtherDecay] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
2158  }
2159  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE [pidIndex][kmcPi0] )
2160  {
2161  fhMCE [pidIndex][kmcPi0] ->Fill(ecluster , GetEventWeight());
2162  fhMCPt [pidIndex][kmcPi0] ->Fill(ptcluster, GetEventWeight());
2163 
2164  fhMCPhi[pidIndex][kmcPi0] ->Fill(ecluster, phicluster, GetEventWeight());
2165  fhMCEta[pidIndex][kmcPi0] ->Fill(ecluster, etacluster, GetEventWeight());
2166 
2167  fhMC2E[pidIndex][kmcPi0] ->Fill(ecluster, eprim , GetEventWeight());
2168  fhMCDeltaE[pidIndex][kmcPi0] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
2169  }
2170  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[pidIndex][kmcEta] )
2171  {
2172  fhMCE [pidIndex][kmcEta] ->Fill(ecluster , GetEventWeight());
2173  fhMCPt [pidIndex][kmcEta] ->Fill(ptcluster, GetEventWeight());
2174 
2175  fhMCPhi[pidIndex][kmcEta] ->Fill(ecluster, phicluster, GetEventWeight());
2176  fhMCEta[pidIndex][kmcEta] ->Fill(ecluster, etacluster, GetEventWeight());
2177 
2178  fhMC2E [pidIndex][kmcEta] ->Fill(ecluster, eprim , GetEventWeight());
2179  fhMCDeltaE[pidIndex][kmcEta] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
2180  }
2181  }
2182  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[pidIndex][kmcAntiNeutron] )
2183  {
2184  fhMCE [pidIndex][kmcAntiNeutron] ->Fill(ecluster , GetEventWeight());
2185  fhMCPt [pidIndex][kmcAntiNeutron] ->Fill(ptcluster, GetEventWeight());
2186 
2187  fhMCPhi[pidIndex][kmcAntiNeutron] ->Fill(ecluster, phicluster, GetEventWeight());
2188  fhMCEta[pidIndex][kmcAntiNeutron] ->Fill(ecluster, etacluster, GetEventWeight());
2189 
2190  fhMC2E[pidIndex][kmcAntiNeutron] ->Fill(ecluster, eprim , GetEventWeight());
2191  fhMCDeltaE[pidIndex][kmcAntiNeutron] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
2192  }
2193  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[pidIndex][kmcAntiProton] )
2194  {
2195  fhMCE [pidIndex][kmcAntiProton] ->Fill(ecluster , GetEventWeight());
2196  fhMCPt [pidIndex][kmcAntiProton] ->Fill(ptcluster, GetEventWeight());
2197 
2198  fhMCPhi[pidIndex][kmcAntiProton] ->Fill(ecluster, phicluster, GetEventWeight());
2199  fhMCEta[pidIndex][kmcAntiProton] ->Fill(ecluster, etacluster, GetEventWeight());
2200 
2201  fhMC2E [pidIndex][kmcAntiProton] ->Fill(ecluster, eprim , GetEventWeight());
2202  fhMCDeltaE[pidIndex][kmcAntiProton] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
2203  }
2204  else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[pidIndex][kmcElectron] )
2205  {
2206  fhMCE [pidIndex][kmcElectron] ->Fill(ecluster , GetEventWeight());
2207  fhMCPt [pidIndex][kmcElectron] ->Fill(ptcluster, GetEventWeight());
2208 
2209  fhMCPhi[pidIndex][kmcElectron] ->Fill(ecluster, phicluster, GetEventWeight());
2210  fhMCEta[pidIndex][kmcElectron] ->Fill(ecluster, etacluster, GetEventWeight());
2211 
2212  fhMC2E[pidIndex][kmcElectron] ->Fill(ecluster, eprim , GetEventWeight());
2213  fhMCDeltaE[pidIndex][kmcElectron] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
2214  }
2215  else if ( fhMCE[pidIndex][kmcOther] )
2216  {
2217  fhMCE [pidIndex][kmcOther] ->Fill(ecluster , GetEventWeight());
2218  fhMCPt [pidIndex][kmcOther] ->Fill(ptcluster, GetEventWeight());
2219 
2220  fhMCPhi[pidIndex][kmcOther] ->Fill(ecluster, phicluster, GetEventWeight());
2221  fhMCEta[pidIndex][kmcOther] ->Fill(ecluster, etacluster, GetEventWeight());
2222 
2223  fhMC2E [pidIndex][kmcOther] ->Fill(ecluster, eprim , GetEventWeight());
2224  fhMCDeltaE[pidIndex][kmcOther] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
2225  }
2226  } // Histograms with MC
2227  } // aod loop
2228 }
2229 
2230 //____________________________________________________
2232 //____________________________________________________
2234 {
2235  if ( !opt )
2236  return;
2237 
2238  printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2239  //AliAnaCaloTrackCorrBaseClass::Print(" ");
2240 
2241  printf("Calorimeter = %s\n", GetCalorimeterString().Data()) ;
2242  printf("Select particle type (0-both): %d\n",fAODParticle);
2243 
2244  printf("Basic cuts:");
2245  printf("\t Dist. to bad channel > %2.1f \n",fMinDist);
2246  printf("\t %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2247  printf("\t %d < NLM < %d \n",fNLMCutMin,fNLMCutMax) ;
2248  printf("\t N cells > %d \n", fNCellsCut);
2249 
2250  printf("Electron cuts:\n");
2251  printf(" \t %2.2f < dEdx < %2.2f \n",fdEdxMin,fdEdxMax) ;
2252  printf(" \t %2.2f < E/P < %2.2f \n",fEOverPMin,fEOverPMax) ;
2253  printf(" \t %2.2f < nSig < %2.2f \n",fNSigmaMin,fNSigmaMax) ;
2254  printf(" \t %2.2f < M02 < %2.2f \n",fM02Min,fM02Max) ;
2255  printf(" \t %2.2f < M20 < %2.2f \n",fM20Min,fM20Max) ;
2256 
2257  printf("Hadron cuts:\n");
2258  printf(" \t %2.2f < dEdx < %2.2f \n",fdEdxMinHad,fdEdxMaxHad) ;
2259  printf(" \t %2.2f < E/P < %2.2f \n",fEOverPMinHad,fEOverPMaxHad) ;
2260  printf(" \t %2.2f < nSig < %2.2f \n",fNSigmaMinHad,fNSigmaMaxHad) ;
2261 }
2262 
2263 //______________________________________________________
2265 //______________________________________________________
2266 void AliAnaElectron::WeightHistograms(AliVCluster *clus)
2267 {
2268  if ( !fFillWeightHistograms || GetMixedEvent() ) return;
2269 
2270  AliVCaloCells* cells = 0;
2271  if ( GetCalorimeter() == kEMCAL ) cells = GetEMCALCells();
2272  else cells = GetPHOSCells();
2273 
2274  // First recalculate energy in case non linearity was applied
2275  Float_t energy = 0;
2276  Float_t ampMax = 0;
2277  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
2278  {
2279  Int_t id = clus->GetCellsAbsId()[ipos];
2280 
2281  // Recalibrate cell energy if needed
2282  Float_t amp = cells->GetCellAmplitude(id);
2284 
2285  energy += amp;
2286 
2287  if ( amp> ampMax )
2288  ampMax = amp;
2289  } // energy loop
2290 
2291  if ( energy <= 0 )
2292  {
2293  AliWarning(Form("Wrong calculated energy %f",energy));
2294  return;
2295  }
2296 
2297  //printf("AliAnaElectron::WeightHistograms() - energy %f, ampmax %f, rat %f, lograt %f\n",energy,ampMax,ampMax/energy,TMath::Log(ampMax/energy));
2298  fhEMaxCellClusterRatio ->Fill(energy, ampMax/energy , GetEventWeight());
2299  fhEMaxCellClusterLogRatio->Fill(energy, TMath::Log(ampMax/energy), GetEventWeight());
2300 
2301  // Get the ratio and log ratio to all cells in cluster
2302  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
2303  {
2304  Int_t id = clus->GetCellsAbsId()[ipos];
2305 
2306  //Recalibrate cell energy if needed
2307  Float_t amp = cells->GetCellAmplitude(id);
2309 
2310  //printf("energy %f, amp %f, rat %f, lograt %f\n",energy,amp,amp/energy,TMath::Log(amp/energy));
2311  fhECellClusterRatio ->Fill(energy, amp/energy , GetEventWeight());
2312  fhECellClusterLogRatio->Fill(energy, TMath::Log(amp/energy), GetEventWeight());
2313  }
2314 
2315  // Recalculate shower shape for different W0
2316  if ( GetCalorimeter()==kEMCAL )
2317  {
2318  Float_t l0org = clus->GetM02();
2319  Float_t l1org = clus->GetM20();
2320  Float_t dorg = clus->GetDispersion();
2321 
2322  for(Int_t iw = 0; iw < 14; iw++)
2323  {
2324  GetCaloUtils()->GetEMCALRecoUtils()->SetW0(1+iw*0.5);
2326 
2327  fhLambda0ForW0[iw]->Fill(energy, clus->GetM02(), GetEventWeight());
2328 // fhLambda1ForW0[iw]->Fill(energy, clus->GetM20(), GetEventWeight());
2329 
2330  //printf("\t w %1.1f, l0 %f, l1 %f,\n",3+iw*0.5,clus->GetM02(),clus->GetM20());
2331  } // w0 loop
2332 
2333  // Set the original values back
2334  clus->SetM02(l0org);
2335  clus->SetM20(l1org);
2336  clus->SetDispersion(dorg);
2337  } // EMCAL
2338 }
2339 
2340 
Float_t GetHistoPtMax() const
TH2F * fhDispEtaPhiDiffE[2]
! shower dispersion eta - phi
TH2F * fhEtaPhi05[2]
! Pseudorapidity vs Phi of identified electron for transerse momentum < 0.5
TH2F * fhMCESumEtaPhi[2][6]
! shower dispersion in eta vs phi direction from MC particle
Int_t pdg
Float_t fEOverPMax
Min E/p for electrons.
virtual Double_t Eta() const
TH2F * fhSumPhiE[2]
! shower dispersion in phi direction
void FillShowerShapeHistograms(AliVCluster *cluster, Int_t mcTag, Int_t pidTag)
Fill cluster Shower Shape histograms.
virtual void SetNLM(Int_t nlm)
TH2F * fhMCEDispPhi[2][6]
! shower dispersion in phi direction from MC particle
TH2F * fhLambda0ForW0[14]
! L0 for 7 defined w0= 3, 3.5 ... 6 for selected electrons
TH2F * fhMCELambda1[2][6]
! E vs shower shape short axis from MC particle
Float_t GetHistoNSigmaMin() const
virtual Double_t Pt() const
Int_t GetHistoNClusterCellMin() const
Float_t GetHistoPtMin() const
TH2F * fhEOverPvsECutM02AndM20CutdEdx
! Matched track E cluster over P track vs cluster E, after dEdx cut M02 and M20 cut ...
double Double_t
Definition: External.C:58
Int_t GetHistoShowerShapeBins() const
Float_t GetHistodEdxMax() const
virtual void AddAODParticle(AliCaloTrackParticle part)
virtual void AddToHistogramsName(TString add)
virtual AliVCaloCells * GetEMCALCells() const
TH2F * fhNLME[2]
! Number of local maxima in cluster vs E
Definition: External.C:236
TH1F * fhMCPt[2][10]
! Number of identified electron vs cluster energy coming from MC particle
TH2F * fhdEdxvsECutNSigma
! Matched track dEdx vs cluster E, cut on TPC nSigma
TH2F * fhEmbedElectronELambda0MostlyBkg
! Lambda0 vs E for embedded electrons with 50%<fraction<10%
TH2F * fhEOverPvsECutNSigma
! Matched track E cluster over P track vs cluster E, after TPC nSigma cut
TH2F * fhdEdxvsECutM02CutNSigma
! Matched track dEdx vs cluster E, M02 cut, cut on TPC nSigma
AliEMCALRecoUtils * GetEMCALRecoUtils() const
TH2F * fhMCEDispEtaPhiDiff[2][6]
! shower dispersion in eta -phi direction from MC particle
virtual void GetVertex(Double_t vertex[3]) const
virtual TString GetNameOfMCEventHederGeneratorToAccept() const
Float_t GetPhi(Float_t phi) const
Shift phi angle in case of negative value 360 degrees. Example TLorenzVector::Phi defined in -pi to p...
Int_t fNLMCutMax
Remove clusters/cells with number of local maxima larger.
TH2F * fhDEtavsE[3][2]
! Track-cluster Matching eta residual vs cluster E
TH2F * fhMCEOverPvsEAfterCuts[10][2]
! Matched track E cluster over P track vs cluster E, after cuts, coming from MC particle ...
virtual Int_t GetLabel() const
TH2F * fhdEdxvsECutM02
! Matched track dEdx vs cluster E, M02 cut
TH2F * fhEOverPvsPCutM02
! Matched track E cluster over P track vs track P, after dEdx cut, M02 cut
virtual void SetNCells(Int_t nce)
TH2F * fhEOverPvsPCutM02AndM20
! Matched track E cluster over P track vs track P, after dEdx cut, M02 and M20 cut ...
TH2F * fhMCEta[2][10]
! eta of identified electron coming from MC particle
energy
Definition: HFPtSpectrum.C:44
virtual Float_t GetZvertexCut() const
Maximal number of events for mixin.
TH1F * fhMCE[2][10]
! Number of identified electron vs cluster energy coming from MC particle
TH2F * fhLam1ETRD[2]
! cluster lambda1 vs E, SM covered by TRD
TH2F * fhPhi[2]
! Azimuthal angle of identified electron vs transerse momentum
Bool_t fFillSSHistograms
Fill shower shape histograms.
virtual Bool_t IsTrackMatched(AliVCluster *cluster, AliVEvent *event)
TH2F * fhTimeE[2]
! E vs Time of selected cluster
TH2F * fhdEdxvsPCutEOverP
! Matched track dEdx vs track P, cut on E/P
TH2F * fhMCdEdxvsE[10]
! Matched track dEdx vs cluster E, coming from MC particle
Int_t GetHistoPhiBins() const
Float_t GetHistoEOverPMin() const
TH2F * fhdEdxvsP
! Matched track dEdx vs track P
TH2F * fhMCEOverPvsP[10]
! Matched track E cluster over P track vs track P, coming from MC particle
TLorentzVector fMomentumMC
! mc particle momentum
virtual void SetDetectorTag(UInt_t d)
TH2F * fhEmbedElectronELambda0FullSignal
! Lambda0 vs E for embedded electrons with more than 90% of the cluster energy
Float_t fM02Max
Min long axis for electrons.
Float_t GetHistoTrackResidualPhiMin() const
TH2F * fhDispEtaE[2]
! shower dispersion in eta direction
Float_t GetHistoTrackResidualEtaMin() const
Int_t GetHistoNClusterCellBins() const
virtual TClonesArray * GetOutputAODBranch() const
virtual void SetTime(Float_t tim)
TH2F * fhPhiLam0LowE[2]
! cluster phi vs lambda0, E<2
Selection of electron clusters in calorimeter.
TH2F * fhDispETRD[2]
! cluster dispersion vs E, SM covered by TRD
TH2F * fhMCESphericity[2][6]
! shower sphericity, eta vs phi from MC particle
Int_t CheckOrigin(Int_t label, AliMCEvent *mcevent, TString selectHeaderName, Float_t clusE)
TH2F * fhdEdxvsECutEOverP
! Matched track dEdx vs cluster E, cut on E/P
virtual void GetVertex(Double_t v[3]) const
virtual UInt_t GetDetectorTag() const
Float_t fM20Min
Max short axis for electrons.
TH2F * fhMCEDispEta[2][6]
! shower dispersion in eta direction from MC particle
Int_t fAODParticle
Select the type of particle to put in AODs for other analysis.
TH2F * fhECellClusterRatio
! E cell / e cluster vs e cluster for selected electrons
virtual void SetIdentifiedParticleType(Int_t pdg)
Float_t GetHistoPhiMin() const
virtual Double_t E() const
void InitParameters()
Initialize the parameters of the analysis with default values.
TH2F * fhMCELambda0[2][6]
! E vs shower shape long axis from MC particle
TH2F * fhdEdxvsECutM02AndM20
! Matched track dEdx vs cluster E, M02 and M20 cut
TH2F * fhECellClusterLogRatio
! log (E cell / E cluster) vs E cluster for selected electrons
TH2F * fhdEdxvsPCutM02AndM20CutNSigma
! Matched track dEdx vs track P, M02 and M20 cut, cut on TPC nSigma
TH2F * fhNSigmavsE
! Matched track TPC nSigma vs cluster E
TH2F * fhLam1E[2]
! cluster lambda1 vs E
TH2F * fhdEdxvsPCutM02
! Matched track dEdx vs track P, M02 cut
TH2F * fhEOverPvsPCutdEdx
! Matched track E cluster over P track vs track P, after dEdx cut
TH2F * fhNCellsLam0HighE[2]
! cluster N Cells vs lambda0, E>2
TH2F * fhNSigmavsPCutM02
! Matched track TPC nSigma vs track P, after dEdx cut, M02 cut
const Double_t etamin
Float_t fdEdxMinHad
Max dEdx for hadrons.
TH2F * fhNSigmavsECutM02
! Matched track TPC nSigma vs cluster E, after dEdx cut, M02 cut
Base class for CaloTrackCorr analysis algorithms.
virtual TString GetCalorimeterString() const
TObjString * GetAnalysisCuts()
Save parameters used for analysis.
Float_t fNSigmaMinHad
Max nSigma for hadrons.
TH2F * fhNSigmavsECutM02CutdEdx
! Matched track TPC nSigma vs cluster E, after dEdx cut M02 cut
TH2F * fhEOverPvsECutM02CutdEdx
! Matched track E cluster over P track vs cluster E, after dEdx cut M02 cut
TH2F * fhSphericityE[2]
! shower sphericity in eta vs phi
Double_t fTimeCutMin
Remove clusters/cells with time smaller than this value, in ns.
Float_t GetHistodEdxMin() const
virtual AliFiducialCut * GetFiducialCut()
TH2F * fhEOverPvsECutdEdx
! Matched track E cluster over P track vs cluster E, after dEdx cut
int Int_t
Definition: External.C:63
Container for input particle information on CaloTrackCorr package.
virtual AliHistogramRanges * GetHistogramRanges()
Float_t fEOverPMin
Max E/p for electrons.
TH2F * fhMCEOverPvsE[10]
! Matched track E cluster over P track vs cluster E, coming from MC particle
unsigned int UInt_t
Definition: External.C:33
Float_t GetHistoNSigmaMax() const
TH2F * fhEOverPvsPCutM02CutdEdx
! Matched track E cluster over P track vs track P, after dEdx cut M02 cut
void RecalculateClusterShowerShapeParameters(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *cluster)
TH2F * fhEOverPvsPCutM02AndM20CutNSigma
! Matched track E cluster over P track vs track P, after dEdx cut, M02 and M20 cut, after TPC nSigma cut
float Float_t
Definition: External.C:68
Double_t fTimeCutMax
Remove clusters/cells with time larger than this value, in ns.
Int_t fNCellsCut
Accept for the analysis clusters with more than fNCellsCut cells.
Float_t GetHistoTrackResidualPhiMax() const
TH2F * fhNSigmavsECutEOverP
! Matched track TPC nSigma vs cluster E, after E/P cut
TH2F * fhMCdEdxvsP[10]
! Matched track dEdx vs track P, coming from MC particle
TH2F * fhEmbeddedSignalFractionEnergy
! Fraction of electron energy of embedded signal vs cluster energy
const Double_t ptmax
void Init()
Init. Check if requested calorimeter is on, if not, abort.
TLorentzVector fMomentum
! cluster momentum
virtual AliEMCALGeometry * GetEMCALGeometry() const
TH2F * fhSumEtaPhiE[2]
! shower dispersion in eta and phi direction
TList * GetCreateOutputObjects()
TH2F * fhDEtaDPhi[3][2]
! Track-cluster Matching eta vs phi residual
TH2F * fhEmbedElectronELambda0MostlySignal
! Lambda0 vs E for embedded electrons with 90%<fraction<50%
Bool_t IsInFiducialCut(Float_t eta, Float_t phi, Int_t det) const
virtual void SetTrackLabel(Int_t a, Int_t b)
TH2F * fhMCEOverPvsPAfterCuts[10][2]
! Matched track E cluster over P track vs track P, after cuts, coming from MC particle ...
Float_t GetHistoShowerShapeMin() const
Float_t fdEdxMin
Max dEdx for electrons.
Int_t GetHistodEdxBins() const
virtual AliCalorimeterUtils * GetCaloUtils() const
Int_t GetHistoNClusterCellMax() const
Int_t GetHistoTrackResidualEtaBins() const
TH2F * fhNSigmavsPCutM02AndM20CutdEdx
! Matched track TPC nSigma vs track P, after dEdx cut M02 and M20 cut
TH2F * fhNSigmavsPCutEOverP
! Matched track TPC nSigma vs track P, after E/P cut
TH2F * fhMCNSigmavsE[10]
! Matched track TPC nSigma vs cluster E, after dEdx cut, coming from MC particle
Int_t GetHistoTrackResidualPhiBins() const
Float_t fdEdxMax
Min dEdx for electrons.
const Double_t ptmin
TH2F * fhEtaLam0HighE[2]
! cluster eta vs lambda0, E>2
TH2F * fhdEdxvsE
! Matched track dEdx vs cluster E
Float_t fEOverPMinHad
Max E/p for hadrons.
TH2F * fhNSigmavsECutdEdx
! Matched track TPC nSigma vs cluster E, after dEdx cut
void WeightHistograms(AliVCluster *clus)
Calculate weights and fill histograms.
virtual Double_t GetEventWeight() const
virtual void SetM02(Float_t m02)
TH2F * fhEtaPhi[2]
! Pseudorapidity vs Phi of identified electron for transerse momentum > 0.5
TH2F * fhEOverPvsPCutNSigma
! Matched track E cluster over P track vs track P, after TPC nSigma cut
TH2F * fhEmbedElectronELambda0FullBkg
! Lambda0 vs E for embedded electrons with less than 10% of the cluster energy
Int_t fNOriginHistograms
Fill only NOriginHistograms of the 14 defined types.
Int_t GetNumberOfLocalMaxima(AliVCluster *cluster, AliVCaloCells *cells)
Find the number of local maxima in cluster.
Float_t fNSigmaMaxHad
Min nSigma for hadrons.
TH2F * fhEMaxCellClusterLogRatio
! log (e max cell / e cluster) vs e cluster for selected electrons
void SetW0(Float_t w0)
TH2F * fhLam0ETRD[2]
! cluster lambda0 vs E, SM covered by TRD
Bool_t fFillWeightHistograms
Fill weigth histograms.
TH2F * fhEOverPvsECutM02AndM20CutNSigma
! Matched track E cluster over P track vs cluster E, after dEdx cut, M02 and M20 cut, after TPC nSigma cut
Float_t GetHistoEOverPMax() const
TH2F * fhPhiLam0HighE[2]
! cluster phi vs lambda0, E>2
TH2F * fhEOverPvsECutM02
! Matched track E cluster over P track vs cluster E, after dEdx cut, M02 cut
virtual TObjArray * GetPHOSClusters() const
Float_t GetHistoEtaMin() const
virtual void SetLabel(Int_t l)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
virtual void SetTag(Int_t tag)
virtual void SetSModNumber(Int_t sm)
TH2F * fhMCDeltaE[2][10]
! MC-Reco E distribution coming from MC particle
TH2F * fhMCPhi[2][10]
! Phi of identified electron coming from MC particle
TH2F * fhDPhivsP[3][2]
! Track-cluster Matching phi residual vs track P
Bool_t fFillOnlySimpleSSHisto
Fill selected cluster histograms, selected SS histograms.
TH2F * fhMCElectronELambda0TwoOverlap
! E vs Lambda0 from MC electrons, 2 particles overlap
Float_t fM20Max
Min short axis for electrons.
TH2F * fhNSigmavsECutM02AndM20
! Matched track TPC nSigma vs cluster E, after dEdx cut, M02 and M20 cut
TH2F * fhEOverPvsPCutM02CutNSigma
! Matched track E cluster over P track vs track P, after dEdx cut, M02 cut, after TPC nSigma cut ...
TH2F * fhEOverPvsE
! Matched track E cluster over P track vs cluster E
virtual void SetCaloLabel(Int_t a, Int_t b)
TH1F * fhPt[2]
! Number of identified electron vs transerse momentum
Float_t GetHistoEtaMax() const
TH2F * fhLam0E[2]
! cluster lambda0 vs E
TH2F * fhMCElectronELambda0NoOverlap
! E vs Lambda0 from MC electrons, no overlap
TH2F * fhEtaLam0LowE[2]
! cluster eta vs lambda0, E<2
TH2F * fhDispPhiE[2]
! shower dispersion in phi direction
Int_t GetHistoPtBins() const
TH2F * fhMC2E[2][10]
! E distribution, Reco vs MC coming from MC particle
TH2F * fhdEdxvsPCutM02AndM20
! Matched track dEdx vs track P, M02 and M20 cut
Int_t GetHistoNSigmaBins() const
AliVTrack * GetMatchedTrack(AliVCluster *cluster, AliVEvent *event, Int_t index=-1) const
TH2F * fhEOverPvsECutM02AndM20
! Matched track E cluster over P track vs cluster E, after dEdx cut, M02 and M20 cut ...
virtual Int_t GetModuleNumber(AliCaloTrackParticle *part) const
Bool_t ClusterSelected(AliVCluster *cl, Int_t nMaxima)
TH2F * fhdEdxvsECutM02AndM20CutNSigma
! Matched track dEdx vs cluster E, M02 and M20 cut, cut on TPC nSigma
TH2F * fhDPhivsE[3][2]
! Track-cluster Matching phi residual vs cluster E
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
const Double_t etamax
virtual Double_t Phi() const
void RecalibrateCellAmplitude(Float_t &amp, Int_t calo, Int_t absId) const
Recalculate cell energy if recalibration factor.
virtual AliMCAnalysisUtils * GetMCAnalysisUtils()
TH2F * fhEOverPvsP
! Matched track E cluster over P track vs track P
void MakeAnalysisFillAOD()
Do photon analysis selecting electron clusters (or charged non electron) and fill aods...
TH2F * fhEta[2]
! Pseudorapidity of identified electron vs transerse momentum
TH1F * fhE[2]
! Number of identified electron vs energy
Int_t GetHistoTimeBins() const
TH2F * fhDEtavsP[3][2]
! Track-cluster Matching eta residual vs track P
TH2F * fhSumEtaE[2]
! shower dispersion in eta direction
Float_t fMinDist
Minimal distance to bad channel to accept cluster.
const char Option_t
Definition: External.C:48
TH2F * fhNSigmavsP
! Matched track TPC nSigma vs track P
Float_t GetHistoTimeMax() const
Int_t CheckCommonAncestor(Int_t index1, Int_t index2, const AliMCEvent *mcevent, Int_t &ancPDG, Int_t &ancStatus, TLorentzVector &momentum, TVector3 &prodVertex)
virtual Int_t GetDataType() const
Float_t GetHistoTimeMin() const
Float_t GetHistoShowerShapeMax() const
Float_t fNSigmaMin
Max nSigma for electrons.
Float_t fNSigmaMax
Min nSigma for electrons.
virtual void SetM20(Float_t m20)
const Int_t nbins
TH2F * fhNCellsE[2]
! Number of cells in cluster vs E
Float_t GetHistoPhiMax() const
Float_t fdEdxMaxHad
Min dEdx for hadrons.
TH2F * fhEOverPvsPCutM02AndM20CutdEdx
! Matched track E cluster over P track vs track P, after dEdx cut M02 and M20 cut ...
virtual AliCaloTrackReader * GetReader() const
bool Bool_t
Definition: External.C:53
Int_t GetHistoEOverPBins() const
Int_t GetHistoEtaBins() const
TH2F * fhNSigmavsPCutdEdx
! Matched track TPC nSigma vs track P, after dEdx cut
TH2F * fhDispE[2]
! cluster dispersion vs E
Float_t fEOverPMaxHad
Min E/p for hadrons.
Int_t fNLMCutMin
Remove clusters/cells with number of local maxima smaller.
Float_t GetHistoTrackResidualEtaMax() const
TH2F * fhEOverPvsECutM02CutNSigma
! Matched track E cluster over P track vs cluster E, after dEdx cut, M02 cut, after TPC nSigma cut ...
virtual Int_t GetTag() const
TH2F * fhMCNSigmavsP[10]
! Matched track TPC nSigma vs track P, after dEdx cut, coming from MC particle
virtual TObjArray * GetEMCALClusters() const
TH2F * fhMaxCellDiffClusterE[2]
! Fraction of energy carried by cell with maximum energy
TH2F * fhDispEtaDispPhiEBin[2][5]
! shower dispersion in eta direction vs phi direction for 5 E bins [0-2],[2-4],[4-6],[6-10],[> 10]
TH2F * fhNCellsLam0LowE[2]
! cluster N cells vs lambda0, E<2
TH2F * fhNSigmavsPCutM02AndM20
! Matched track TPC nSigma vs track P, after dEdx cut, mild M02 and M20 cut
virtual AliVCaloCells * GetPHOSCells() const
AliAnaElectron()
Default constructor. Initialize parameters.
TH2F * fhdEdxvsPCutNSigma
! Matched track dEdx vs track P, cut on TPC nSigma
TH2F * fhNSigmavsECutM02AndM20CutdEdx
! Matched track TPC nSigma vs cluster E, after dEdx cut M02 and M20 cut
Int_t GetMaxEnergyCell(AliVCaloCells *cells, AliVCluster *clu, Float_t &fraction) const
For a given CaloCluster, it gets the absId of the cell with maximum energy deposit.
virtual Int_t GetIdentifiedParticleType() const
TH2F * fhNSigmavsPCutM02CutdEdx
! Matched track TPC nSigma vs track P, after dEdx cut M02 cut
Int_t nptbins
TH2F * fhEMaxCellClusterRatio
! E max cell / E cluster vs E cluster for selected electrons
TH2F * fhdEdxvsPCutM02CutNSigma
! Matched track dEdx vs track P, M02 cut, cut on TPC nSigma
virtual AliMixedEvent * GetMixedEvent() const
void MakeAnalysisFillHistograms()
Fill histograms for selected clusters.
TH2F * fhMCElectronELambda0NOverlap
! E vs Lambda0 from MC electrons, N particles overlap
TVector3 fProdVertex
! mc particle production vertex
const Double_t phimin
Int_t GetFirstSMCoveredByTRD() const
Time cut in ns.
Float_t fM02Min
Max long axis for electrons.