]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.h
Enable fast and slow trackmatching, and use secondaries as well
[u/mrichter/AliRoot.git] / PWG4 / CaloCalib / AliAnalysisTaskEMCALPi0PbPb.h
1 #ifndef AliAnalysisTaskEMCALPi0PbPb_h
2 #define AliAnalysisTaskEMCALPi0PbPb_h
3
4 // $Id$
5
6 class TAxis;
7 class TClonesArray;
8 class TH1;
9 class TH2;
10 class TNtuple;
11 class TObjArray;
12 class AliAODCaloCells;
13 class AliAODCaloCluster;
14 class AliAODEvent;
15 class AliAODTrack;
16 class AliEMCALGeoUtils;
17 class AliEMCALRecoUtils;
18 class AliESDCaloCells;
19 class AliESDCaloCluster;
20 class AliESDEvent;
21 class AliESDTrack;
22 class AliESDtrackCuts;
23
24 #include "AliAnalysisTaskSE.h"
25
26 class AliAnalysisTaskEMCALPi0PbPb : public AliAnalysisTaskSE {
27  public:
28   AliAnalysisTaskEMCALPi0PbPb(const char *name=0);
29   virtual ~AliAnalysisTaskEMCALPi0PbPb(); 
30   
31   void         UserCreateOutputObjects();
32   void         UserExec(Option_t *option);
33   void         Terminate(Option_t *);
34
35   void         SetAsymMax(Double_t asymMax)                   { fAsymMax = asymMax;         }
36   void         SetCentrality(const char *name)                { fCentVar = name;            }
37   void         SetCentralityRange(Double_t from, Double_t to) { fCentFrom=from; fCentTo=to; }
38   void         SetClusName(const char *name)                  { fClusName = name;           }
39   void         SetDoAfterburner(Bool_t b)                     { fDoAfterburner = b;         }
40   void         SetDoTrackMatWithGeom(Bool_t b)                { fDoTrackMatWithGeom = b;    }
41   void         SetDoTrackVtxConstrain(Bool_t b)               { fDoConstrain = b;           }
42   void         SetFillNtuple(Bool_t b)                        { fDoNtuple = b;              }
43   void         SetGeoName(const char *n)                      { fGeoName = n;               }
44   void         SetIsoDist(Double_t d)                         { fIsoDist = d;               }
45   void         SetMinClusEnergy(Double_t e)                   { fMinE = e;                  }
46   void         SetMinEcc(Double_t ecc)                        { fMinEcc = ecc;              }
47   void         SetMinErat(Double_t erat)                      { fMinErat = erat;            }
48   void         SetMinNClustersPerTrack(Double_t mct)          { fMinNClustPerTrack = mct;   }
49   void         SetMinPtPerMatchedTrack(Double_t mpt)          { fMinPtPerTrack = mpt;       }
50   void         SetNminCells(Int_t n)                          { fNminCells = n;             }
51   void         SetTrClassNames(const char *n)                 { fTrClassNames = n;          }
52   void         SetTrackCuts(AliESDtrackCuts *c)               { fTrCuts = c;                }
53   void         SetUseQualFlag(Bool_t b)                       { fUseQualFlag = b;           }
54   void         SetVertexRange(Double_t z1, Double_t z2)       { fVtxZMin=z1; fVtxZMax=z2;   }
55
56  protected:
57   virtual void CalcClusterProps();
58   virtual void CalcTracks();
59   virtual void ClusterAfterburner();
60   virtual void FillCellHists();
61   virtual void FillClusHists();
62   virtual void FillPionHists();
63   virtual void FillOtherHists();
64   Double_t     GetCellIsolation(Double_t cEta, Double_t cPhi, Double_t radius=0.2)                const;
65   Double_t     GetMaxCellEnergy(AliVCluster *c)                                                   const;
66   Int_t        GetNCells(AliVCluster *c, Double_t emin=0.)                                        const;
67   void         GetSigma(AliVCluster *c, Double_t &sigmaMax, Double_t &sigmaMin)                   const;
68   Double_t     GetTrackIsolation(Double_t cEta, Double_t cPhi, Double_t radius=0.2)               const;
69
70   class ClusProps {
71     public:
72       ClusProps() : fTrIndex(-1), fTrDz(-1), fTrDr(-1), fTrDist(-1), fTrEp(0), 
73                     fTrIso(0), fTrLowPtIso(0), fCellIso(0) {}
74       void Reset() { fTrIndex=-1; fTrDz=-1; fTrDr=-1; fTrDist=-1; fTrEp=0; fTrIso=0; fTrLowPtIso=0; fCellIso=0; }
75       Int_t    fTrIndex;
76       Double_t fTrDz;
77       Double_t fTrDr;
78       Double_t fTrDist;
79       Double_t fTrEp;
80       Double_t fTrIso;
81       Double_t fTrLowPtIso;
82       Double_t fCellIso;
83   };
84     // input members
85   TString                fCentVar;                // variable for centrality determination
86   Double_t               fCentFrom;               // min centrality (def=0)
87   Double_t               fCentTo;                 // max centrality (def=100)
88   Double_t               fVtxZMin;                // min primary vertex z (def=-10cm)
89   Double_t               fVtxZMax;                // max primary vertex z (def=+10cm)
90   Bool_t                 fUseQualFlag;            // if true use quality flag for centrality
91   TString                fClusName;               // cluster branch name (def="")
92   Bool_t                 fDoNtuple;               // if true write out ntuple
93   Bool_t                 fDoAfterburner;          // if true run after burner
94   Double_t               fAsymMax;                // maximum energy asymmetry (def=1)
95   Int_t                  fNminCells;              // minimum number of cells attached to cluster (def=1)
96   Double_t               fMinE;                   // minimum cluster energy (def=0.1 GeV/c)
97   Double_t               fMinErat;                // minimum emax/ec ratio (def=0)
98   Double_t               fMinEcc;                 // minimum eccentricity (def=0)
99   TString                fGeoName;                // geometry name (def = EMCAL_FIRSTYEARV1)
100   Double_t               fMinNClustPerTrack;      // minimum number of cluster per track (def=50)
101   Double_t               fMinPtPerTrack;          // minimum pT per track (def=0.25 GeV/c)
102   Double_t               fIsoDist;                // isolation distance (def=0.2)
103   TString                fTrClassNames;           // trigger class names
104   AliESDtrackCuts       *fTrCuts;                 // track cuts
105   Bool_t                 fDoTrackMatWithGeom;     // track matching including geometry
106   Bool_t                 fDoConstrain;            // if true constrain tracks to vertex 
107
108     // derived members (ie with ! after //)
109   ULong64_t              fNEvs;                   //!accepted events 
110   AliEMCALGeoUtils      *fGeom;                   //!geometry utils
111   AliEMCALRecoUtils     *fReco;                   //!geometry utils
112   TList                 *fOutput;                 //!container of output histograms
113   TObjArray             *fTrClassNamesArr;        //!array of trig class names  
114   AliESDEvent           *fEsdEv;                  //!pointer to input esd event
115   AliAODEvent           *fAodEv;                  //!pointer to input aod event
116   TObjArray             *fRecPoints;              //!pointer to rec points (AliAnalysisTaskEMCALClusterizeFast)
117   TObjArray             *fEsdClusters;            //!pointer to esd clusters
118   AliESDCaloCells       *fEsdCells;               //!pointer to esd cells
119   TObjArray             *fAodClusters;            //!pointer to aod clusters
120   AliAODCaloCells       *fAodCells;               //!pointer to aod cells
121   TAxis                 *fPtRanges;               //!pointer to pt ranges
122   TNtuple               *fNtuple;                 //!pointer to ntuple
123   TObjArray             *fSelTracks;              //!pointer to selected tracks
124   ClusProps              fClusProps[1000];        //!array of cluster properties
125     // histograms
126   TH1                   *fHCuts;                  //!histo for cuts
127   TH1                   *fHVertexZ;               //!histo for vtxz
128   TH1                   *fHVertexZ2;              //!histo for vtxz after vtx cuts
129   TH1                   *fHCent;                  //!histo for cent
130   TH1                   *fHCentQual;              //!histo for cent after quality flag cut
131   TH1                   *fHTclsBeforeCuts;        //!histo for trigger classes before cuts
132   TH1                   *fHTclsAfterCuts;         //!histo for trigger classes after cuts
133
134     // histograms for cells
135   TH2                  **fHColuRow;               //!histo for cell column and row
136   TH2                  **fHColuRowE;              //!histo for cell column and row weight energy
137   TH1                  **fHCellMult;              //!histo for cell multiplicity in module
138   TH1                   *fHCellE;                 //!histo for cell energy
139   TH1                   *fHCellH;                 //!histo for highest cell energy
140   TH1                   *fHCellM;                 //!histo for mean cell energy (normalized to hit cells)
141   TH1                   *fHCellM2;                //!histo for mean cell energy (normalized to all cells)
142   TH1                  **fHCellFreqNoCut;         //!histo for cell frequency without cut
143   TH1                  **fHCellFreqCut100M;       //!histo for cell frequency with cut 100MeV
144   TH1                  **fHCellFreqCut300M;       //!histo for cell frequency with cut 300MeV
145   TH1                  **fHCellFreqE;             //!histo for cell frequency weighted with energy
146   TH1                  **fHCellCheckE;            //!histo for cell E distribution for given channels
147     // histograms for clusters
148   TH1                   *fHClustEccentricity;     //!histo for cluster eccentricity
149   TH2                   *fHClustEtaPhi;           //!histo for cluster eta vs. phi
150   TH2                   *fHClustEnergyPt;         //!histo for cluster energy vs. pT
151   TH2                   *fHClustEnergySigma;      //!histo for cluster energy vs. variance over long axis 
152   TH2                   *fHClustSigmaSigma;       //!histo for sigma vs. lambda_0 comparison
153   TH2                   *fHClustNCellEnergyRatio; //!histo for cluster n tow vs. energy ratio
154     // histograms for pion candidates
155   TH2                   *fHPionEtaPhi;            //!histo for pion eta vs. phi
156   TH2                   *fHPionMggPt;             //!histo for pion mass vs. pT
157   TH2                   *fHPionMggAsym;           //!histo for pion mass vs. asym
158   TH2                   *fHPionMggDgg;            //!histo for pion mass vs. opening angle
159   TH1                   *fHPionInvMasses[21];     //!histos for invariant mass plots 
160
161  private:
162   AliAnalysisTaskEMCALPi0PbPb(const AliAnalysisTaskEMCALPi0PbPb&);            // not implemented
163   AliAnalysisTaskEMCALPi0PbPb &operator=(const AliAnalysisTaskEMCALPi0PbPb&); // not implemented
164
165   ClassDef(AliAnalysisTaskEMCALPi0PbPb, 5); // Analysis task for neutral pions in Pb+Pb
166 };
167 #endif