ROOT logo
#ifndef ALIANAELECTRON_H
#define ALIANAELECTRON_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice     */

//_________________________________________________________________________
//
// Class for the electron identification, 
// Clusters from calorimeters are identified as electrons
// and kept in the AOD. Few histograms produced.
// Copy of AliAnaPhoton just add electron id.
//

//-- Author: Gustavo Conesa (LPSC-IN2P3-CNRS)

// --- ROOT system ---
class TH2F ;
class TH1F;
class TH3D;
class TObjString;

// --- ANALYSIS system ---
#include "AliAnaCaloTrackCorrBaseClass.h"
class AliStack;
class TParticle;

class TList ;

class AliAnaElectron : public AliAnaCaloTrackCorrBaseClass {

 public: 
  
  AliAnaElectron() ;                                       // default ctor
  
  virtual ~AliAnaElectron() { ; }                          // virtual dtor
	
  //---------------------------------------
  // General analysis frame methods
  //---------------------------------------
  
  TObjString * GetAnalysisCuts();
  
  TList      * GetCreateOutputObjects();
  
  void         Init();

  void         InitParameters();

  void         MakeAnalysisFillAOD()  ;

  void         MakeAnalysisFillHistograms() ; 
  
  void         Print(const Option_t * opt)const;
    
  
  // Analysis methods
  
  Bool_t       ClusterSelected(AliVCluster* cl, Int_t nMaxima) ;
  
  void         FillShowerShapeHistograms( AliVCluster* cluster, Int_t mcTag , Int_t pidTag) ;
  
  void         SwitchOnFillShowerShapeHistograms()    { fFillSSHistograms = kTRUE  ; }
  void         SwitchOffFillShowerShapeHistograms()   { fFillSSHistograms = kFALSE ; }  
    
  void         WeightHistograms(AliVCluster *clus);
  
  void         SwitchOnFillWeightHistograms()         { fFillWeightHistograms = kTRUE  ; }
  void         SwitchOffFillWeightHistograms()        { fFillWeightHistograms = kFALSE ; }  
  
  //---------------------------------------
  // Analysis parameters setters getters
  //---------------------------------------
  
  // ** Cluster selection methods **
  
  void         SetdEdxCut(Double_t min, Double_t max) { fdEdxMin    = min ; 
                                                        fdEdxMax    = max          ; }
  
  void         SetEOverP(Double_t min, Double_t max)  { fEOverPMin  = min ; 
                                                        fEOverPMax  = max          ; }

  
  void         SetMinDistanceToBadChannel(Float_t m1, Float_t m2, Float_t m3) {
                fMinDist = m1; fMinDist2 = m2; fMinDist3 = m3; }

  void         SetTimeCut(Double_t min, Double_t max) { fTimeCutMin = min; 
                                                        fTimeCutMax = max          ; }
  Double_t     GetTimeCutMin()                  const { return fTimeCutMin         ; }
  Double_t     GetTimeCutMax()                  const { return fTimeCutMax         ; }	
	
  void         SetNCellCut(Int_t n)                   { fNCellsCut = n             ; }
  Double_t     GetNCellCut()                    const { return fNCellsCut          ; }
  
  void         SetNLMCut(Int_t min, Int_t max)        { fNLMCutMin = min;
                                                        fNLMCutMax = max                ; }
  Int_t        GetNLMCutMin()                   const { return fNLMCutMin               ; }
  Int_t        GetNLMCutMax()                   const { return fNLMCutMax               ; }
  
  void         FillNOriginHistograms(Int_t n)         { fNOriginHistograms = n ; 
                                                        if(n > 10) fNOriginHistograms = 10; }

  
  void         FillAODWithElectrons()                 { fAODParticle = AliCaloPID::kElectron      ; }
  void         FillAODWithHadrons()                   { fAODParticle = AliCaloPID::kChargedHadron ; }
  void         FillAODWithAny()                       { fAODParticle = 0 ; }

  void         SwitchOnOnlySimpleSSHistoFill()        { fFillOnlySimpleSSHisto = kTRUE  ; }
  void         SwitchOffOnlySimpleHistoFill()         { fFillOnlySimpleSSHisto = kFALSE ; }
  
  // For histograms in arrays, index in the array, corresponding to a particle
  enum mcTypes    { kmcPhoton = 0,        kmcPi0Decay = 1,       kmcOtherDecay = 2,  
                    kmcPi0 = 3,           kmcEta = 4,            kmcElectron = 5,       
                    kmcConversion = 6,    kmcOther = 7,          kmcAntiNeutron = 8,    
                    kmcAntiProton = 9                                                 };    
  
  enum mcssTypes  { kmcssPhoton = 0,      kmcssOther = 1,       kmcssPi0 = 2,         
                    kmcssEta = 3,         kmcssConversion = 4,  kmcssElectron = 5       };  
  
  private:
 
  Float_t  fMinDist ;                          // Minimal distance to bad channel to accept cluster
  Float_t  fMinDist2;                          // Cuts on Minimal distance to study acceptance evaluation
  Float_t  fMinDist3;                          // One more cut on distance used for acceptance-efficiency study
  Double_t fTimeCutMin  ;                      // Remove clusters/cells with time smaller than this value, in ns
  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
  Int_t    fNLMCutMin  ;                       // Remove clusters/cells with number of local maxima smaller than this value
  Int_t    fNLMCutMax  ;                       // Remove clusters/cells with number of local maxima larger than this value
  Bool_t   fFillSSHistograms ;                 // Fill shower shape histograms
  Bool_t   fFillOnlySimpleSSHisto;             // Fill selected cluster histograms, selected SS histograms
  Bool_t   fFillWeightHistograms ;             // Fill weigth histograms
  Int_t    fNOriginHistograms;                 // Fill only NOriginHistograms of the 14 defined types

  Float_t  fdEdxMin;                           // Max dEdx for electrons
  Float_t  fdEdxMax;                           // Min dEdx for electrons
  Float_t  fEOverPMin;                         // Max E/p for electrons, after dEdx cut
  Float_t  fEOverPMax;                         // Min E/p for electrons, after dEdx cut

  Int_t    fAODParticle;                       // Select the type of particle to put in AODs for other analysis
  
  TLorentzVector fMomentum;                    //! cluster momentum
  TLorentzVector fMomentumMC;                  //! mc particle momentum
  TVector3       fProdVertex;                  //! mc particle production vertex

  //Histograms
  TH2F * fhdEdxvsE;                            //! matched track dEdx vs cluster E 
  TH2F * fhdEdxvsP;                            //! matched track dEdx vs track P
  TH2F * fhEOverPvsE;                          //! matched track E cluster over P track vs cluster E, after dEdx cut 
  TH2F * fhEOverPvsP;                          //! matched track E cluster over P track vs track P, after dEdx cut 

  TH2F * fhdEdxvsECutM02;                      //! matched track dEdx vs cluster E, mild M02 cut
  TH2F * fhdEdxvsPCutM02;                      //! matched track dEdx vs track P, mild M02 cut
  TH2F * fhEOverPvsECutM02;                    //! matched track E cluster over P track vs cluster E, after dEdx cut, mild M02 cut
  TH2F * fhEOverPvsPCutM02;                    //! matched track E cluster over P track vs track P, after dEdx cut, mild M02 cut
  
  TH2F * fhdEdxvsECutEOverP;                   //! matched track dEdx vs cluster E , cut on EOverP
  TH2F * fhdEdxvsPCutEOverP;                   //! matched track dEdx vs track P, cut on EOverP
  TH2F * fhEOverPvsECutM02CutdEdx;             //! matched track E cluster over P track vs cluster E, after dEdx cut and mild M02 cut
  TH2F * fhEOverPvsPCutM02CutdEdx;             //! matched track E cluster over P track vs track P, after dEdx cut and mild M02 cut

  TH2F * fhMCdEdxvsE[10];                       //! matched track dEdx vs cluster E, coming from MC particle
  TH2F * fhMCdEdxvsP[10];                       //! matched track dEdx vs track P, coming from MC particle
  TH2F * fhMCEOverPvsE[10];                     //! matched track E cluster over P track vs cluster E, after dEdx cut, coming from MC particle
  TH2F * fhMCEOverPvsP[10];                     //! matched track E cluster over P track vs track P, after dEdx cut, coming from MC particle
  
  TH2F * fhNCellsE[2];                         //! number of cells in cluster vs E
  TH2F * fhNLME[2];                            //! number of local maxima in cluster vs E
  TH2F * fhMaxCellDiffClusterE[2];             //! Fraction of energy carried by cell with maximum energy
  TH2F * fhTimeE[2];                           //! E vs Time of selected cluster 

  TH1F * fhE[2]    ;                           //! Number of identified electron vs energy
  TH1F * fhPt[2]   ;                           //! Number of identified electron vs transerse momentum 
  TH2F * fhPhi[2]  ;                           //! Azimuthal angle of identified  electron vs transerse momentum 
  TH2F * fhEta[2]  ;                           //! Pseudorapidity of identified  electron vs transerse momentum 
  TH2F * fhEtaPhi[2]  ;                        //! Pseudorapidity vs Phi of identified  electron for transerse momentum > 0.5
  TH2F * fhEtaPhi05[2]  ;                      //! Pseudorapidity vs Phi of identified  electron for transerse momentum < 0.5
  
  //Shower shape
  
  TH2F * fhDispE[2];                           //! cluster dispersion vs E
  TH2F * fhLam0E[2];                           //! cluster lambda0 vs  E
  TH2F * fhLam1E[2];                           //! cluster lambda1 vs  E  

  TH2F * fhDispETRD[2];                        //! cluster dispersion vs E, SM covered by TRD
  TH2F * fhLam0ETRD[2];                        //! cluster lambda0 vs  E, SM covered by TRD
  TH2F * fhLam1ETRD[2];                        //! cluster lambda1 vs  E, SM covered by TRD 
  
  TH2F * fhNCellsLam0LowE[2];                  //! cluster N cells vs lambda0, E<2
  TH2F * fhNCellsLam0HighE[2];                 //! cluster N Cells vs lambda0, E>2

  TH2F * fhEtaLam0LowE[2];                     //! cluster eta vs lambda0, E<2
  TH2F * fhPhiLam0LowE[2];                     //! cluster phi vs lambda0, E<2
  TH2F * fhEtaLam0HighE[2];                    //! cluster eta vs lambda0, E>2
  TH2F * fhPhiLam0HighE[2];                    //! cluster phi vs lambda0, E>2
    
  TH2F * fhDispEtaE[2] ;                       //! shower dispersion in eta direction
  TH2F * fhDispPhiE[2] ;                       //! shower dispersion in phi direction
  TH2F * fhSumEtaE[2] ;                        //! shower dispersion in eta direction
  TH2F * fhSumPhiE[2] ;                        //! shower dispersion in phi direction
  TH2F * fhSumEtaPhiE[2] ;                     //! shower dispersion in eta and phi direction
  TH2F * fhDispEtaPhiDiffE[2] ;                //! shower dispersion eta - phi
  TH2F * fhSphericityE[2] ;                    //! shower sphericity in eta vs phi
  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]

  // Weight studies
  
  TH2F * fhECellClusterRatio;                  //! e cell / e cluster vs e cluster for selected electrons
  TH2F * fhECellClusterLogRatio;               //! log (e cell / e cluster)  vs e cluster for selected electrons
  TH2F * fhEMaxCellClusterRatio;               //! e max cell / e cluster vs e cluster for selected electrons
  TH2F * fhEMaxCellClusterLogRatio;            //! log (e max cell / e cluster) vs e cluster for selected electrons
  TH2F * fhLambda0ForW0[14];                   //! L0 for 7 defined w0= 3, 3.5 ... 6 for selected electrons
  //TH2F * fhLambda1ForW0[14];                    //! L1 for 7 defined w0= 3, 3.5 ... 6 for selected electrons
  
  //Fill MC dependent histograms, Origin of this cluster is ...

  TH2F * fhMCDeltaE[2][10]  ;                  //! MC-Reco E distribution coming from MC particle     
  TH2F * fhMC2E[2][10]  ;                      //! E distribution, Reco vs MC coming from MC particle
  
  TH1F * fhMCE[2][10];                          //! Number of identified electron vs cluster energy coming from MC particle
  TH1F * fhMCPt[2][10];                         //! Number of identified electron vs cluster energy coming from MC particle
  TH2F * fhMCPhi[2][10];                        //! Phi of identified electron coming from MC particle
  TH2F * fhMCEta[2][10];                        //! eta of identified electron coming from MC particle
  
  // Shower Shape MC

  TH2F * fhMCELambda0[2][6] ;                   //! E vs Lambda0 from MC particle
  
  TH2F * fhMCEDispEta[2][6] ;                   //! shower dispersion in eta direction from MC particle
  TH2F * fhMCEDispPhi[2][6] ;                   //! shower dispersion in phi direction from MC particle
  TH2F * fhMCESumEtaPhi[2][6] ;                 //! shower dispersion in eta vs phi direction from MC particle
  TH2F * fhMCEDispEtaPhiDiff[2][6] ;            //! shower dispersion in eta -phi direction from MC particle
  TH2F * fhMCESphericity[2][6] ;                //! shower sphericity, eta vs phi from MC particle

  TH2F * fhMCElectronELambda0NoOverlap ;        //! E vs Lambda0 from MC electrons, no overlap
  TH2F * fhMCElectronELambda0TwoOverlap ;       //! E vs Lambda0 from MC electrons, 2 particles overlap
  TH2F * fhMCElectronELambda0NOverlap ;         //! E vs Lambda0 from MC electrons, N particles overlap
  
  //Embedding
  TH2F * fhEmbeddedSignalFractionEnergy ;       //! Fraction of electron energy of embedded signal vs cluster energy
  
  TH2F * fhEmbedElectronELambda0FullSignal ;    //!  Lambda0 vs E for embedded electrons with more than 90% of the cluster energy
  TH2F * fhEmbedElectronELambda0MostlySignal ;  //!  Lambda0 vs E for embedded electrons with 90%<fraction<50% 
  TH2F * fhEmbedElectronELambda0MostlyBkg ;     //!  Lambda0 vs E for embedded electrons with 50%<fraction<10% 
  TH2F * fhEmbedElectronELambda0FullBkg ;       //!  Lambda0 vs E for embedded electrons with less than 10% of the cluster energy
  
  AliAnaElectron(              const AliAnaElectron & el) ; // cpy ctor  
  AliAnaElectron & operator = (const AliAnaElectron & el) ; // cpy assignment
  
  ClassDef(AliAnaElectron,5)

} ;
 

#endif//ALIANAELECTRON_H



 AliAnaElectron.h:1
 AliAnaElectron.h:2
 AliAnaElectron.h:3
 AliAnaElectron.h:4
 AliAnaElectron.h:5
 AliAnaElectron.h:6
 AliAnaElectron.h:7
 AliAnaElectron.h:8
 AliAnaElectron.h:9
 AliAnaElectron.h:10
 AliAnaElectron.h:11
 AliAnaElectron.h:12
 AliAnaElectron.h:13
 AliAnaElectron.h:14
 AliAnaElectron.h:15
 AliAnaElectron.h:16
 AliAnaElectron.h:17
 AliAnaElectron.h:18
 AliAnaElectron.h:19
 AliAnaElectron.h:20
 AliAnaElectron.h:21
 AliAnaElectron.h:22
 AliAnaElectron.h:23
 AliAnaElectron.h:24
 AliAnaElectron.h:25
 AliAnaElectron.h:26
 AliAnaElectron.h:27
 AliAnaElectron.h:28
 AliAnaElectron.h:29
 AliAnaElectron.h:30
 AliAnaElectron.h:31
 AliAnaElectron.h:32
 AliAnaElectron.h:33
 AliAnaElectron.h:34
 AliAnaElectron.h:35
 AliAnaElectron.h:36
 AliAnaElectron.h:37
 AliAnaElectron.h:38
 AliAnaElectron.h:39
 AliAnaElectron.h:40
 AliAnaElectron.h:41
 AliAnaElectron.h:42
 AliAnaElectron.h:43
 AliAnaElectron.h:44
 AliAnaElectron.h:45
 AliAnaElectron.h:46
 AliAnaElectron.h:47
 AliAnaElectron.h:48
 AliAnaElectron.h:49
 AliAnaElectron.h:50
 AliAnaElectron.h:51
 AliAnaElectron.h:52
 AliAnaElectron.h:53
 AliAnaElectron.h:54
 AliAnaElectron.h:55
 AliAnaElectron.h:56
 AliAnaElectron.h:57
 AliAnaElectron.h:58
 AliAnaElectron.h:59
 AliAnaElectron.h:60
 AliAnaElectron.h:61
 AliAnaElectron.h:62
 AliAnaElectron.h:63
 AliAnaElectron.h:64
 AliAnaElectron.h:65
 AliAnaElectron.h:66
 AliAnaElectron.h:67
 AliAnaElectron.h:68
 AliAnaElectron.h:69
 AliAnaElectron.h:70
 AliAnaElectron.h:71
 AliAnaElectron.h:72
 AliAnaElectron.h:73
 AliAnaElectron.h:74
 AliAnaElectron.h:75
 AliAnaElectron.h:76
 AliAnaElectron.h:77
 AliAnaElectron.h:78
 AliAnaElectron.h:79
 AliAnaElectron.h:80
 AliAnaElectron.h:81
 AliAnaElectron.h:82
 AliAnaElectron.h:83
 AliAnaElectron.h:84
 AliAnaElectron.h:85
 AliAnaElectron.h:86
 AliAnaElectron.h:87
 AliAnaElectron.h:88
 AliAnaElectron.h:89
 AliAnaElectron.h:90
 AliAnaElectron.h:91
 AliAnaElectron.h:92
 AliAnaElectron.h:93
 AliAnaElectron.h:94
 AliAnaElectron.h:95
 AliAnaElectron.h:96
 AliAnaElectron.h:97
 AliAnaElectron.h:98
 AliAnaElectron.h:99
 AliAnaElectron.h:100
 AliAnaElectron.h:101
 AliAnaElectron.h:102
 AliAnaElectron.h:103
 AliAnaElectron.h:104
 AliAnaElectron.h:105
 AliAnaElectron.h:106
 AliAnaElectron.h:107
 AliAnaElectron.h:108
 AliAnaElectron.h:109
 AliAnaElectron.h:110
 AliAnaElectron.h:111
 AliAnaElectron.h:112
 AliAnaElectron.h:113
 AliAnaElectron.h:114
 AliAnaElectron.h:115
 AliAnaElectron.h:116
 AliAnaElectron.h:117
 AliAnaElectron.h:118
 AliAnaElectron.h:119
 AliAnaElectron.h:120
 AliAnaElectron.h:121
 AliAnaElectron.h:122
 AliAnaElectron.h:123
 AliAnaElectron.h:124
 AliAnaElectron.h:125
 AliAnaElectron.h:126
 AliAnaElectron.h:127
 AliAnaElectron.h:128
 AliAnaElectron.h:129
 AliAnaElectron.h:130
 AliAnaElectron.h:131
 AliAnaElectron.h:132
 AliAnaElectron.h:133
 AliAnaElectron.h:134
 AliAnaElectron.h:135
 AliAnaElectron.h:136
 AliAnaElectron.h:137
 AliAnaElectron.h:138
 AliAnaElectron.h:139
 AliAnaElectron.h:140
 AliAnaElectron.h:141
 AliAnaElectron.h:142
 AliAnaElectron.h:143
 AliAnaElectron.h:144
 AliAnaElectron.h:145
 AliAnaElectron.h:146
 AliAnaElectron.h:147
 AliAnaElectron.h:148
 AliAnaElectron.h:149
 AliAnaElectron.h:150
 AliAnaElectron.h:151
 AliAnaElectron.h:152
 AliAnaElectron.h:153
 AliAnaElectron.h:154
 AliAnaElectron.h:155
 AliAnaElectron.h:156
 AliAnaElectron.h:157
 AliAnaElectron.h:158
 AliAnaElectron.h:159
 AliAnaElectron.h:160
 AliAnaElectron.h:161
 AliAnaElectron.h:162
 AliAnaElectron.h:163
 AliAnaElectron.h:164
 AliAnaElectron.h:165
 AliAnaElectron.h:166
 AliAnaElectron.h:167
 AliAnaElectron.h:168
 AliAnaElectron.h:169
 AliAnaElectron.h:170
 AliAnaElectron.h:171
 AliAnaElectron.h:172
 AliAnaElectron.h:173
 AliAnaElectron.h:174
 AliAnaElectron.h:175
 AliAnaElectron.h:176
 AliAnaElectron.h:177
 AliAnaElectron.h:178
 AliAnaElectron.h:179
 AliAnaElectron.h:180
 AliAnaElectron.h:181
 AliAnaElectron.h:182
 AliAnaElectron.h:183
 AliAnaElectron.h:184
 AliAnaElectron.h:185
 AliAnaElectron.h:186
 AliAnaElectron.h:187
 AliAnaElectron.h:188
 AliAnaElectron.h:189
 AliAnaElectron.h:190
 AliAnaElectron.h:191
 AliAnaElectron.h:192
 AliAnaElectron.h:193
 AliAnaElectron.h:194
 AliAnaElectron.h:195
 AliAnaElectron.h:196
 AliAnaElectron.h:197
 AliAnaElectron.h:198
 AliAnaElectron.h:199
 AliAnaElectron.h:200
 AliAnaElectron.h:201
 AliAnaElectron.h:202
 AliAnaElectron.h:203
 AliAnaElectron.h:204
 AliAnaElectron.h:205
 AliAnaElectron.h:206
 AliAnaElectron.h:207
 AliAnaElectron.h:208
 AliAnaElectron.h:209
 AliAnaElectron.h:210
 AliAnaElectron.h:211
 AliAnaElectron.h:212
 AliAnaElectron.h:213
 AliAnaElectron.h:214
 AliAnaElectron.h:215
 AliAnaElectron.h:216
 AliAnaElectron.h:217
 AliAnaElectron.h:218
 AliAnaElectron.h:219
 AliAnaElectron.h:220
 AliAnaElectron.h:221
 AliAnaElectron.h:222
 AliAnaElectron.h:223
 AliAnaElectron.h:224
 AliAnaElectron.h:225
 AliAnaElectron.h:226
 AliAnaElectron.h:227
 AliAnaElectron.h:228
 AliAnaElectron.h:229
 AliAnaElectron.h:230
 AliAnaElectron.h:231
 AliAnaElectron.h:232
 AliAnaElectron.h:233
 AliAnaElectron.h:234
 AliAnaElectron.h:235
 AliAnaElectron.h:236
 AliAnaElectron.h:237
 AliAnaElectron.h:238
 AliAnaElectron.h:239
 AliAnaElectron.h:240
 AliAnaElectron.h:241
 AliAnaElectron.h:242
 AliAnaElectron.h:243
 AliAnaElectron.h:244
 AliAnaElectron.h:245
 AliAnaElectron.h:246
 AliAnaElectron.h:247
 AliAnaElectron.h:248
 AliAnaElectron.h:249
 AliAnaElectron.h:250
 AliAnaElectron.h:251
 AliAnaElectron.h:252
 AliAnaElectron.h:253
 AliAnaElectron.h:254
 AliAnaElectron.h:255
 AliAnaElectron.h:256
 AliAnaElectron.h:257