]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.h
New track selection and new track matching
[u/mrichter/AliRoot.git] / PWG4 / CaloCalib / AliAnalysisTaskEMCALPi0PbPb.h
CommitLineData
6bf90832 1#ifndef AliAnalysisTaskEMCALPi0PbPb_h
2#define AliAnalysisTaskEMCALPi0PbPb_h
ea3fd2d5 3
4// $Id$
5
fa443410 6class TAxis;
f5d4ab70 7class TClonesArray;
296ea9b4 8class TH1;
9class TH2;
f5d4ab70 10class TNtuple;
717fe7de 11class TObjArray;
12class AliAODCaloCells;
13class AliAODCaloCluster;
ea3fd2d5 14class AliAODEvent;
296ea9b4 15class AliAODTrack;
788ca675 16class AliAODVertex;
d595acbb 17class AliEMCALGeoUtils;
296ea9b4 18class AliEMCALRecoUtils;
717fe7de 19class AliESDCaloCells;
ea3fd2d5 20class AliESDCaloCluster;
717fe7de 21class AliESDEvent;
0ec74551 22class AliESDTrack;
788ca675 23class AliESDVertex;
0ec74551 24class AliESDtrackCuts;
788ca675 25class AliStaHeader;
26class AliStaVertex;
ea3fd2d5 27
28#include "AliAnalysisTaskSE.h"
29
30class AliAnalysisTaskEMCALPi0PbPb : public AliAnalysisTaskSE {
31 public:
d595acbb 32 AliAnalysisTaskEMCALPi0PbPb(const char *name=0);
ea3fd2d5 33 virtual ~AliAnalysisTaskEMCALPi0PbPb();
34
286b47a5 35 void UserCreateOutputObjects();
36 void UserExec(Option_t *option);
37 void Terminate(Option_t *);
717fe7de 38
b6c599fe 39 void SetAsymMax(Double_t asymMax) { fAsymMax = asymMax; }
40 void SetCentrality(const char *n) { fCentVar = n; }
286b47a5 41 void SetCentralityRange(Double_t from, Double_t to) { fCentFrom=from; fCentTo=to; }
b6c599fe 42 void SetClusName(const char *n) { fClusName = n; }
a49742b5 43 void SetDoAfterburner(Bool_t b) { fDoAfterburner = b; }
b6c599fe 44 void SetDoTrackMatWithGeom(Bool_t b) { fDoTrMatGeom = b; }
45 void SetFillNtuple(Bool_t b) { fDoNtuple = b; }
46 void SetGeoName(const char *n) { fGeoName = n; }
47 void SetIsoDist(Double_t d) { fIsoDist = d; }
48 void SetMinNClustersPerTrack(Double_t m) { fMinNClusPerTr = m; }
49 void SetMinClusEnergy(Double_t e) { fMinE = e; }
50 void SetMinEcc(Double_t ecc) { fMinEcc = ecc; }
51 void SetMinErat(Double_t erat) { fMinErat = erat; }
52 void SetNminCells(Int_t n) { fNminCells = n; }
53 void SetTrClassNames(const char *n) { fTrClassNames = n; }
54 void SetTrackCuts(AliESDtrackCuts *c) { fTrCuts = c; }
55 void SetPrimTrackCuts(AliESDtrackCuts *c) { fPrimTrCuts = c; }
56 void SetUseQualFlag(Bool_t b) { fUseQualFlag = b; }
d595acbb 57 void SetVertexRange(Double_t z1, Double_t z2) { fVtxZMin=z1; fVtxZMax=z2; }
717fe7de 58
59 protected:
296ea9b4 60 virtual void CalcClusterProps();
61 virtual void CalcTracks();
b6c599fe 62 virtual void CalcPrimTracks();
323834f0 63 virtual void ClusterAfterburner();
76332037 64 virtual void FillCellHists();
65 virtual void FillClusHists();
788ca675 66 virtual void FillNtuple();
323834f0 67 virtual void FillOtherHists();
788ca675 68 virtual void FillPionHists();
69 void FillVertex(AliStaVertex *v, const AliESDVertex *esdv);
70 void FillVertex(AliStaVertex *v, const AliAODVertex *aodv);
71
b6c599fe 72 Double_t GetCellIsolation(Double_t cEta, Double_t cPhi, Double_t radius=0.2) const;
788ca675 73 Double_t GetMaxCellEnergy(AliVCluster *c) const { Short_t id=-1; return GetMaxCellEnergy(c,id); }
b6c599fe 74 Double_t GetMaxCellEnergy(AliVCluster *c, Short_t &id) const;
75 Int_t GetNCells(AliVCluster *c, Double_t emin=0.) const;
76 void GetSigma(AliVCluster *c, Double_t &sigmaMax, Double_t &sigmaMin) const;
77 Double_t GetTrackIsolation(Double_t cEta, Double_t cPhi, Double_t radius=0.2, Double_t pt=0.) const;
286b47a5 78
296ea9b4 79 class ClusProps {
80 public:
81 ClusProps() : fTrIndex(-1), fTrDz(-1), fTrDr(-1), fTrDist(-1), fTrEp(0),
b6c599fe 82 fTrIso(0), fTrIso1(0), fTrIso2(0), fCellIso(0), fPhiInd(-1) {}
83 void Reset() { fTrIndex=-1; fTrDz=-1; fTrDr=-1; fTrDist=-1; fTrEp=0; fTrIso=0; fTrIso1=0; fTrIso2=0; fCellIso=0; fPhiInd=-1; }
296ea9b4 84 Int_t fTrIndex;
85 Double_t fTrDz;
86 Double_t fTrDr;
87 Double_t fTrDist;
88 Double_t fTrEp;
89 Double_t fTrIso;
b6c599fe 90 Double_t fTrIso1;
91 Double_t fTrIso2;
296ea9b4 92 Double_t fCellIso;
b6c599fe 93 Short_t fPhiInd;
296ea9b4 94 };
717fe7de 95 // input members
6eb6260e 96 TString fCentVar; // variable for centrality determination
97 Double_t fCentFrom; // min centrality (def=0)
98 Double_t fCentTo; // max centrality (def=100)
99 Double_t fVtxZMin; // min primary vertex z (def=-10cm)
100 Double_t fVtxZMax; // max primary vertex z (def=+10cm)
101 Bool_t fUseQualFlag; // if true use quality flag for centrality
102 TString fClusName; // cluster branch name (def="")
103 Bool_t fDoNtuple; // if true write out ntuple
a49742b5 104 Bool_t fDoAfterburner; // if true run after burner
f224d35b 105 Double_t fAsymMax; // maximum energy asymmetry (def=1)
106 Int_t fNminCells; // minimum number of cells attached to cluster (def=1)
296ea9b4 107 Double_t fMinE; // minimum cluster energy (def=0.1 GeV/c)
f224d35b 108 Double_t fMinErat; // minimum emax/ec ratio (def=0)
109 Double_t fMinEcc; // minimum eccentricity (def=0)
6bf90832 110 TString fGeoName; // geometry name (def = EMCAL_FIRSTYEARV1)
b6c599fe 111 Double_t fMinNClusPerTr; // minimum number of cluster per track (def=50)
296ea9b4 112 Double_t fIsoDist; // isolation distance (def=0.2)
b3ee6797 113 TString fTrClassNames; // trigger class names
114 AliESDtrackCuts *fTrCuts; // track cuts
b6c599fe 115 AliESDtrackCuts *fPrimTrCuts; // track cuts
116 Bool_t fDoTrMatGeom; // track matching including geometry
296ea9b4 117
f5d4ab70 118 // derived members (ie with ! after //)
27c2e3d9 119 Bool_t fIsGeoMatsSet; //!indicate that geo matrices are set
d9f26424 120 ULong64_t fNEvs; //!accepted events
121 AliEMCALGeoUtils *fGeom; //!geometry utils
296ea9b4 122 AliEMCALRecoUtils *fReco; //!geometry utils
6eb6260e 123 TList *fOutput; //!container of output histograms
b3ee6797 124 TObjArray *fTrClassNamesArr; //!array of trig class names
6eb6260e 125 AliESDEvent *fEsdEv; //!pointer to input esd event
126 AliAODEvent *fAodEv; //!pointer to input aod event
127 TObjArray *fRecPoints; //!pointer to rec points (AliAnalysisTaskEMCALClusterizeFast)
128 TObjArray *fEsdClusters; //!pointer to esd clusters
129 AliESDCaloCells *fEsdCells; //!pointer to esd cells
130 TObjArray *fAodClusters; //!pointer to aod clusters
131 AliAODCaloCells *fAodCells; //!pointer to aod cells
132 TAxis *fPtRanges; //!pointer to pt ranges
296ea9b4 133 TObjArray *fSelTracks; //!pointer to selected tracks
b6c599fe 134 TObjArray *fSelPrimTracks; //!pointer to selected tracks
296ea9b4 135 ClusProps fClusProps[1000]; //!array of cluster properties
788ca675 136 // ntuple
137 TTree *fNtuple; //!pointer to ntuple
138 AliStaHeader *fHeader; //!pointer to header
139 AliStaVertex *fPrimVert; //!pointer to primary vertex
140 AliStaVertex *fSpdVert; //!pointer to SPD vertex
141 AliStaVertex *fTpcVert; //!pointer to TPC vertex
142 TClonesArray *fClusters; //!pointer to clusters
717fe7de 143 // histograms
296ea9b4 144 TH1 *fHCuts; //!histo for cuts
145 TH1 *fHVertexZ; //!histo for vtxz
146 TH1 *fHVertexZ2; //!histo for vtxz after vtx cuts
147 TH1 *fHCent; //!histo for cent
148 TH1 *fHCentQual; //!histo for cent after quality flag cut
b3ee6797 149 TH1 *fHTclsBeforeCuts; //!histo for trigger classes before cuts
150 TH1 *fHTclsAfterCuts; //!histo for trigger classes after cuts
151
d595acbb 152 // histograms for cells
296ea9b4 153 TH2 **fHColuRow; //!histo for cell column and row
154 TH2 **fHColuRowE; //!histo for cell column and row weight energy
155 TH1 **fHCellMult; //!histo for cell multiplicity in module
156 TH1 *fHCellE; //!histo for cell energy
157 TH1 *fHCellH; //!histo for highest cell energy
158 TH1 *fHCellM; //!histo for mean cell energy (normalized to hit cells)
159 TH1 *fHCellM2; //!histo for mean cell energy (normalized to all cells)
160 TH1 **fHCellFreqNoCut; //!histo for cell frequency without cut
2e4d8148 161 TH1 **fHCellFreqCut100M; //!histo for cell frequency with cut 100MeV
162 TH1 **fHCellFreqCut300M; //!histo for cell frequency with cut 300MeV
163 TH1 **fHCellFreqE; //!histo for cell frequency weighted with energy
296ea9b4 164 TH1 **fHCellCheckE; //!histo for cell E distribution for given channels
fa443410 165 // histograms for clusters
296ea9b4 166 TH1 *fHClustEccentricity; //!histo for cluster eccentricity
167 TH2 *fHClustEtaPhi; //!histo for cluster eta vs. phi
168 TH2 *fHClustEnergyPt; //!histo for cluster energy vs. pT
169 TH2 *fHClustEnergySigma; //!histo for cluster energy vs. variance over long axis
170 TH2 *fHClustSigmaSigma; //!histo for sigma vs. lambda_0 comparison
171 TH2 *fHClustNCellEnergyRatio; //!histo for cluster n tow vs. energy ratio
b6c599fe 172 // histograms for track matching
173 TH1 *fHMatchDr; //!histo for dR track cluster matching
174 TH1 *fHMatchDz; //!histo for dZ track cluster matching
175 TH1 *fHMatchEp; //!histo for E/p track cluster matching
fa443410 176 // histograms for pion candidates
296ea9b4 177 TH2 *fHPionEtaPhi; //!histo for pion eta vs. phi
178 TH2 *fHPionMggPt; //!histo for pion mass vs. pT
179 TH2 *fHPionMggAsym; //!histo for pion mass vs. asym
180 TH2 *fHPionMggDgg; //!histo for pion mass vs. opening angle
181 TH1 *fHPionInvMasses[21]; //!histos for invariant mass plots
ea3fd2d5 182
ea3fd2d5 183 private:
717fe7de 184 AliAnalysisTaskEMCALPi0PbPb(const AliAnalysisTaskEMCALPi0PbPb&); // not implemented
185 AliAnalysisTaskEMCALPi0PbPb &operator=(const AliAnalysisTaskEMCALPi0PbPb&); // not implemented
ea3fd2d5 186
b6c599fe 187 ClassDef(AliAnalysisTaskEMCALPi0PbPb, 6) // Analysis task for neutral pions in Pb+Pb
ea3fd2d5 188};
ea3fd2d5 189#endif
788ca675 190
191#ifndef AliStaObjs_h
192#define AliStaObjs_h
193class AliStaHeader
194{
195 public:
196 AliStaHeader() : fRun(0), fOrbit(0), fPeriod(0), fBx(0), fL0(0), fL1(0), fL2(0),
197 fTrClassMask(0), fTrCluster(0), fOffTriggers(0), fFiredTriggers(),
b6c599fe 198 fTcls(0), fV0Cent(0), fCl1Cent(0), fTrCent(0), fCqual(-1),
199 fPsi(0), fPsiRes(0) {;}
788ca675 200 virtual ~AliStaHeader() {;}
788ca675 201
202 public:
203 Int_t fRun; // run number
204 UInt_t fOrbit; // orbit number
205 UInt_t fPeriod; // period number
206 UShort_t fBx; // bunch crossing id
207 UInt_t fL0; // l0 trigger bits
208 UInt_t fL1; // l1 trigger bits
209 UShort_t fL2; // l2 trigger bits
210 ULong64_t fTrClassMask; // trigger class mask
211 UChar_t fTrCluster; // trigger cluster mask
212 UInt_t fOffTriggers; // fired offline triggers for this event
213 TString fFiredTriggers; // string with fired triggers
214 UInt_t fTcls; // custom trigger definition
215 Double32_t fV0Cent; //[0,0,16] v0 cent
216 Double32_t fCl1Cent; //[0,0,16] cl1 cent
217 Double32_t fTrCent; //[0,0,16] tr cent
218 Int_t fCqual; // centrality quality
b6c599fe 219 Double32_t fPsi; //[0,0,16] event-plane angle
220 Double32_t fPsiRes; //[0,0,16] event-plane ange resolution
788ca675 221
b6c599fe 222 ClassDef(AliStaHeader,2) // Header class
788ca675 223};
224
225class AliStaVertex
226{
227 public:
228 AliStaVertex(Double_t x=0, Double_t y=0, Double_t z=0) : fVx(x), fVy(y), fVz(z), fVc(-1), fDisp(0), fZres(0),
229 fChi2(0), fSt(0), fIs3D(0), fIsZ(0) {;}
230 virtual ~AliStaVertex() {;}
231
232 public:
233 Double_t fVx; //[0,0,16] vertex x
234 Double_t fVy; //[0,0,16] vertex y
235 Double_t fVz; //[0,0,16] vertex z
236 Double_t fVc; //[0,0,16] number of contributors to vertex
237 Double_t fDisp; //[0,0,16] dispersion
238 Double_t fZres; //[0,0,16] z-resolution
239 Double_t fChi2; //[0,0,16] chi2 of fit
240 Bool_t fSt; // status bit
241 Bool_t fIs3D; // is vertex from 3D
242 Bool_t fIsZ; // is vertex from Z only
243
244 ClassDef(AliStaVertex,1) // Vertex class
245};
246
247class AliStaCluster : public TObject
248{
249 public:
b6c599fe 250 AliStaCluster() : TObject(), fE(0), fR(0), fEta(0), fPhi(0), fN(0), fN1(0), fN3(0), fIdMax(0), fEmax(0),
251 fDbc(0), fDisp(0), fM20(0), fM02(0), fEcc(0), fSig(0), fTrDz(0), fTrDr(-1), fTrEp(0),
252 fTrIso(0), fTrIso1(0), fTrIso2(0), fCeIso(0) {;}
788ca675 253
254 public:
255 Double32_t fE; //[0,0,16] energy
256 Double32_t fR; //[0,0,16] radius
257 Double32_t fEta; //[0,0,16] eta
258 Double32_t fPhi; //[0,0,16] phi
259 UChar_t fN; // number of cells
260 UChar_t fN1; // number of cells > 100 MeV
261 UChar_t fN3; // number of cells > 300 MeV
262 UShort_t fIdMax; // id maximum cell
263 Double32_t fEmax; //[0,0,16] energy of maximum cell
264 Double32_t fDbc; //[0,0,16] distance to nearest bad channel
265 Double32_t fDisp; //[0,0,16] cluster dispersion, for shape analysis
266 Double32_t fM20; //[0,0,16] 2-nd moment along the main eigen axis
267 Double32_t fM02; //[0,0,16] 2-nd moment along the second eigen axis
268 Double32_t fEcc; //[0,0,16] eccentricity
269 Double32_t fSig; //[0,0,16] sigma
270 Double32_t fTrDz; //[0,0,16] dZ to nearest track
271 Double32_t fTrDr; //[0,0,16] dR to nearest track (in x,y; if neg then no match)
272 Double32_t fTrEp; //[0,0,16] E/P to nearest track
273 Double32_t fTrIso; //[0,0,16] track isolation
b6c599fe 274 Double32_t fTrIso1; //[0,0,16] track isolation (pt>1GeV/c)
275 Double32_t fTrIso2; //[0,0,16] track isolation (pt>2GeV/c)
788ca675 276 Double32_t fCeIso; //[0,0,16] cell isolation
277
b6c599fe 278 ClassDef(AliStaCluster,2) // Cluster class
788ca675 279};
280#endif