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