Added QA histo prod
[u/mrichter/AliRoot.git] / PWG4 / PartCorrBase / AliAnaPartCorrBaseClass.h
CommitLineData
1c5acb87 1#ifndef ALIANAPARTCORRBASECLASS_H
2#define ALIANAPARTCORRBASECLASS_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5/* $Id: $ */
6
c8fe2783 7 //_________________________________________________________________________
8 // Base class for analysis algorithms
9 //-- Author: Gustavo Conesa (INFN-LNF)
5025c139 10//-Add the possibality for event selection analysis based on vertex and multiplicity bins (Yaxian Mao, 10/10/2010)
fbeaf916 11#include <cstdlib>
12
c8fe2783 13 //ROOT
1c5acb87 14class TClonesArray ;
591cc579 15class TObjArray ;
a3aebfff 16#include <TList.h>
1c5acb87 17#include <TObject.h>
0c1383b5 18class TObjString;
1c5acb87 19
c8fe2783 20 //Analysis
f37fa8d2 21class AliVCaloCells;
e6e63685 22#include "AliCaloTrackReader.h"
decca433 23#include "AliCaloPID.h"
24#include "AliFiducialCut.h"
25#include "AliIsolationCut.h"
26#include "AliMCAnalysisUtils.h"
27#include "AliNeutralMesonSelection.h"
8cfc6870 28#include "AliCalorimeterUtils.h"
1c5acb87 29class AliStack ;
30class AliHeader ;
31class AliGenEventHeader ;
a3aebfff 32#include "AliAODPWG4ParticleCorrelation.h"
765d44e7 33class AliEMCALGeoUtils;
34class AliPHOSGeoUtils;
c8fe2783 35#include "AliMixedEvent.h"
1c5acb87 36
37class AliAnaPartCorrBaseClass : public TObject {
38
c8fe2783 39public:
477d6cee 40 AliAnaPartCorrBaseClass() ; // default ctor
78219bac 41 virtual ~AliAnaPartCorrBaseClass() ; //virtual dtor
42
c8fe2783 43private:
477d6cee 44 AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & g) ; // cpy ctor
45 AliAnaPartCorrBaseClass & operator = (const AliAnaPartCorrBaseClass & g) ;//cpy assignment
477d6cee 46
c8fe2783 47public:
f37fa8d2 48
a3aebfff 49 virtual void AddAODParticle(AliAODPWG4Particle part) ;
50
477d6cee 51 virtual void ConnectInputOutputAODBranches();
52
4a745797 53 virtual TList * GetCreateOutputObjects() { return (new TList) ;}
4a745797 54
a3aebfff 55 virtual void AddToHistogramsName(TString add) { fAddToHistogramsName = add; }
56 virtual TString GetAddedHistogramsStringToName() {return fAddToHistogramsName ;}
57
477d6cee 58 virtual void Init() {;}
59 virtual void InitParameters() ;
60
61 virtual void Print(const Option_t * ) const ;
62
63 virtual void MakeAnalysisFillAOD() {;}
64
65 virtual void MakeAnalysisFillHistograms() {;}
f37fa8d2 66
0c1383b5 67 virtual TObjString * GetAnalysisCuts() {return 0x0;}
68
477d6cee 69 virtual Int_t GetDebug() const { return fDebug ; }
70 virtual void SetDebug(Int_t d) { fDebug = d ; }
71
72 virtual Int_t GetEventNumber() const ;
c8fe2783 73
477d6cee 74 virtual AliCaloTrackReader * GetReader() const {return fReader ; }
42dc8e7d 75 virtual void SetReader(AliCaloTrackReader * const reader) { fReader = reader ; }
477d6cee 76
3a58eee6 77 Int_t GetTrackMultiplicity() const {return fReader->GetTrackMultiplicity();}
78
f37fa8d2 79 //Calorimeter helper class access methods
765d44e7 80 AliEMCALGeoUtils * GetEMCALGeometry() const { return fCaloUtils->GetEMCALGeometry(); }
81 AliPHOSGeoUtils * GetPHOSGeometry() const { return fCaloUtils->GetPHOSGeometry() ; }
c8fe2783 82
e6e63685 83 Int_t GetModuleNumberCellIndexes(const Int_t absId, const TString calo, Int_t & icol, Int_t & irow, Int_t &iRCU) const {
765d44e7 84 return fCaloUtils->GetModuleNumberCellIndexes(absId, calo, icol, irow,iRCU);}
b05a14a3 85 Int_t GetModuleNumber(AliAODPWG4Particle * part) const {
765d44e7 86 return fCaloUtils->GetModuleNumber(part, fReader->GetInputEvent());}
c8fe2783 87 Int_t GetModuleNumber(AliVCluster * cluster) const {
765d44e7 88 return fCaloUtils->GetModuleNumber(cluster);}
f37fa8d2 89
a5cc4f03 90 virtual void Terminate(TList * /*outputList*/) {;}
91
f37fa8d2 92 //analysis AOD branch
477d6cee 93 virtual TClonesArray * GetCreateOutputAODBranch() ;
94 virtual TString GetInputAODName() const {return fInputAODName ; }
95 virtual void SetInputAODName(TString name) { fInputAODName = name; }
96 virtual TString GetOutputAODName() const {return fOutputAODName ; }
97 virtual void SetOutputAODName(TString name) { fNewAOD = kTRUE ; fOutputAODName = name; }
98 virtual Bool_t NewOutputAOD() const {return fNewAOD;}
99 virtual TString GetOutputAODClassName() const {return fOutputAODClassName;}
100 virtual void SetOutputAODClassName(TString name) {fOutputAODClassName = name; }
765d44e7 101 virtual AliCalorimeterUtils * GetCaloUtils() const {return fCaloUtils ; }
102 void SetCaloUtils(AliCalorimeterUtils * caloutils) { fCaloUtils = caloutils ; }
103
591cc579 104 virtual TString GetAODObjArrayName() const {return fAODObjArrayName;}
105 virtual void SetAODObjArrayName(TString name) {fAODObjArrayName = name; }
c8fe2783 106
477d6cee 107 virtual TClonesArray* GetInputAODBranch() const {return fInputAODBranch ;}
1e86c71e 108 virtual TClonesArray* GetOutputAODBranch() const {if(fNewAOD) return fOutputAODBranch; else return fInputAODBranch ;}
42dc8e7d 109 virtual TClonesArray* GetAODBranch(TString aodBranchName) const ;
110
477d6cee 111 virtual TClonesArray* GetAODCaloClusters() const ;
112 virtual TClonesArray* GetAODTracks() const ;
f37fa8d2 113 virtual AliVCaloCells* GetPHOSCells() const {return fReader->GetPHOSCells() ;}
114 virtual AliVCaloCells* GetEMCALCells() const {return fReader->GetEMCALCells() ;}
115
591cc579 116 virtual TObjArray* GetAODCTS() const ;
117 virtual TObjArray* GetAODEMCAL() const ;
118 virtual TObjArray* GetAODPHOS() const ;
477d6cee 119
120 virtual TString GetBaseParametersList();
f37fa8d2 121
477d6cee 122 virtual AliStack * GetMCStack() const ;
123 virtual AliHeader* GetMCHeader() const ;
124 virtual AliGenEventHeader* GetMCGenEventHeader() const ;
125
f37fa8d2 126 //Analysis helpers classes pointers setters and getters
decca433 127 virtual AliCaloPID * GetCaloPID() {if(!fCaloPID) fCaloPID = new AliCaloPID(); return fCaloPID ;}
42dc8e7d 128 virtual void SetCaloPID(AliCaloPID * const pid) { fCaloPID = pid ;}
477d6cee 129
2ebb9054 130 virtual AliFiducialCut * GetFiducialCut() {if(!fFidCut) fFidCut = new AliFiducialCut(); return fFidCut ;}
ff45398a 131 virtual void SetFiducialCut(AliFiducialCut * const fc) { fFidCut = fc ;}
477d6cee 132
decca433 133 virtual AliIsolationCut * GetIsolationCut() {if(!fIC) fIC = new AliIsolationCut(); return fIC ;}
42dc8e7d 134 virtual void SetIsolationCut(AliIsolationCut * const ic) { fIC = ic ;}
477d6cee 135
decca433 136 virtual AliMCAnalysisUtils * GetMCAnalysisUtils() {if(!fMCUtils) fMCUtils = new AliMCAnalysisUtils(); return fMCUtils ;}
42dc8e7d 137 virtual void SetMCAnalysisUtils(AliMCAnalysisUtils * const mcutils) { fMCUtils = mcutils ;}
477d6cee 138
decca433 139 virtual AliNeutralMesonSelection * GetNeutralMesonSelection() {if(!fNMS) fNMS = new AliNeutralMesonSelection(); return fNMS ;}
42dc8e7d 140 virtual void SetNeutralMesonSelection(AliNeutralMesonSelection * const nms) { fNMS = nms ;}
765d44e7 141
1e274f1c 142 virtual Bool_t IsDataMC() {return fDataMC ; }
143 virtual void SwitchOnDataMC() {fDataMC = kTRUE ; if(!fMCUtils)fMCUtils = new AliMCAnalysisUtils();}
decca433 144 virtual void SwitchOffDataMC() {fDataMC = kFALSE ; }
c8fe2783 145
1e274f1c 146 virtual Bool_t IsFiducialCutOn() { return fCheckFidCut ; }
147 virtual void SwitchOnFiducialCut() { fCheckFidCut = kTRUE; if(!fFidCut)fFidCut = new AliFiducialCut();}
decca433 148 virtual void SwitchOffFiducialCut() { fCheckFidCut = kFALSE;}
477d6cee 149
1e274f1c 150 virtual Bool_t IsCaloPIDOn() { return fCheckCaloPID ; }
151 virtual void SwitchOnCaloPID() { fCheckCaloPID = kTRUE; if(!fCaloPID)fCaloPID = new AliCaloPID();}
decca433 152 virtual void SwitchOffCaloPID() { fCheckCaloPID = kFALSE;}
477d6cee 153
1e274f1c 154 virtual Bool_t IsCaloPIDRecalculationOn() { return fRecalculateCaloPID ; }
decca433 155 virtual void SwitchOnCaloPIDRecalculation() { fRecalculateCaloPID = kTRUE;}
156 virtual void SwitchOffCaloPIDRecalculation() { fRecalculateCaloPID = kFALSE;}
477d6cee 157
158 virtual Float_t GetMaxPt() const {return fMaxPt ; }
159 virtual Float_t GetMinPt() const {return fMinPt ; }
decca433 160 virtual void SetMaxPt(Float_t pt) {fMaxPt = pt ; }
161 virtual void SetMinPt(Float_t pt) {fMinPt = pt ; }
765d44e7 162 virtual void SetPtCutRange(Double_t ptmin, Double_t ptmax)
477d6cee 163 { fMaxPt=ptmax; fMinPt=ptmin;}
5025c139 164 //Setters for parameters of event buffers
165 virtual void SetMultiBin(Int_t n=1) {fMultiBin=n ;} //number of bins in Multiplicity
166 virtual void SetNZvertBin(Int_t n=1) {fNZvertBin=n ;} //number of bins for vertex position
167 virtual void SetNRPBin(Int_t n=1) {fNrpBin=n ;} //number of bins in reaction plain
168 virtual void SetZvertexCut(Float_t zcut=40.){fZvtxCut=zcut ;} //cut on vertex position
169 virtual void SetMultiplicity(Int_t multimin, Int_t multimax) {fMinMulti = multimin ; fMaxMulti = multimax ; }
170 virtual void SwitchOnEventSelection() {fUseSelectEvent = kTRUE ; }
171 virtual void SwitchOffEventSelection() {fUseSelectEvent = kFALSE ; }
172 //Getters for event selection
173 virtual Int_t GetMultiBin() const {return fMultiBin ;} //number of bins in Multiplicity
174 virtual Int_t GetNZvertBin() const {return fNZvertBin ;} //number of bins in vertex
175 virtual Int_t GetNRPBin() const {return fNrpBin ;} //number of bins in reaction plain
176 //Getters for event selection
177 virtual Float_t GetZvertexCut() const {return fZvtxCut ;} //cut on vertex position
178 virtual Int_t GetMaxMulti() const {return fMaxMulti ; }
179 virtual Int_t GetMinMulti() const {return fMinMulti ; }
180
181 // Do correlation analysis with different event buffers
182 virtual Bool_t DoEventSelect() const {return fUseSelectEvent ; }
477d6cee 183
f37fa8d2 184 //Histogrammes setters and getters
185 //Pt, Energy
477d6cee 186 virtual void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 187 fHistoPtBins = n ;
477d6cee 188 fHistoPtMax = max ;
189 fHistoPtMin = min ;
190 }
191
765d44e7 192 virtual Int_t GetHistoPtBins() const { return fHistoPtBins; }
193 virtual Float_t GetHistoPtMin() const { return fHistoPtMin ; }
194 virtual Float_t GetHistoPtMax() const { return fHistoPtMax ; }
477d6cee 195
c8fe2783 196 //Azimuthal angle
477d6cee 197 virtual void SetHistoPhiRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 198 fHistoPhiBins = n ;
199 fHistoPhiMax = max ;
200 fHistoPhiMin = min ;
477d6cee 201 }
202
765d44e7 203 virtual Int_t GetHistoPhiBins() const { return fHistoPhiBins; }
204 virtual Float_t GetHistoPhiMin() const { return fHistoPhiMin ; }
205 virtual Float_t GetHistoPhiMax() const { return fHistoPhiMax ; }
477d6cee 206
f37fa8d2 207 //Pseudorapidity-rapidity
477d6cee 208 virtual void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 209 fHistoEtaBins = n ;
210 fHistoEtaMax = max ;
211 fHistoEtaMin = min ;
477d6cee 212 }
213
765d44e7 214 virtual Int_t GetHistoEtaBins() const { return fHistoEtaBins; }
215 virtual Float_t GetHistoEtaMin() const { return fHistoEtaMin ; }
216 virtual Float_t GetHistoEtaMax() const { return fHistoEtaMax ; }
5a2dbc3c 217
f37fa8d2 218 //Mass
5a2dbc3c 219 virtual void SetHistoMassRangeAndNBins(Float_t min, Float_t max, Int_t n) {
c8fe2783 220 fHistoMassBins = n ;
221 fHistoMassMax = max ;
222 fHistoMassMin = min ;
5a2dbc3c 223 }
224
765d44e7 225 virtual Int_t GetHistoMassBins() const { return fHistoMassBins ; }
226 virtual Float_t GetHistoMassMin() const { return fHistoMassMin ; }
227 virtual Float_t GetHistoMassMax() const { return fHistoMassMax ; }
5a2dbc3c 228
f37fa8d2 229 //Asymetry
5a2dbc3c 230 virtual void SetHistoAsymmetryRangeAndNBins(Float_t min, Float_t max, Int_t n) {
c8fe2783 231 fHistoAsymBins = n ;
232 fHistoAsymMax = max ;
233 fHistoAsymMin = min ;
5a2dbc3c 234 }
235
765d44e7 236 virtual Int_t GetHistoAsymmetryBins() const { return fHistoAsymBins ; }
237 virtual Float_t GetHistoAsymmetryMin() const { return fHistoAsymMin ; }
238 virtual Float_t GetHistoAsymmetryMax() const { return fHistoAsymMax ; }
c8fe2783 239
f8006433 240 virtual AliMixedEvent * GetMixedEvent() { return GetReader()->GetMixedEvent() ; }
241 virtual Int_t GetNMixedEvent() const { return GetReader()->GetNMixedEvent() ; }
242
243 virtual void GetVertex(Double_t vertex[3]) const { GetReader()->GetVertex(vertex) ; }
244 virtual void GetVertex(Double_t vertex[3],const Int_t evtIndex) const { GetReader()->GetVertex(vertex,evtIndex) ; }
245 virtual Double_t* GetVertex(const Int_t evtIndex) const { return GetReader()->GetVertex(evtIndex) ; }
c8fe2783 246
f2ccb5b8 247 virtual Bool_t IsTrackMatched(const AliVCluster * cluster) const { return fCaloPID->IsTrackMatched(cluster, fCaloUtils); }
f37fa8d2 248
d7c10d78 249 void SwitchOnPlotsMaking() {fMakePlots = kTRUE ;}
250 void SwitchOffPlotsMaking() {fMakePlots = kFALSE ;}
251 Bool_t MakePlotsOn() const {return fMakePlots;}
252
c8fe2783 253private:
477d6cee 254
255 Bool_t fDataMC ; // Flag to access MC data when using ESD or AOD
256 Int_t fDebug ; // Debug level
257 Bool_t fCheckFidCut ; // Do analysis for clusters in defined region
258 Bool_t fCheckCaloPID ; // Do analysis for calorimeters
259 Bool_t fRecalculateCaloPID ; // Recalculate PID or use PID weights in calorimeters
260 Float_t fMinPt ; // Maximum pt of (trigger) particles in the analysis
261 Float_t fMaxPt ; // Minimum pt of (trigger) particles in the analysis
5025c139 262 Int_t fMultiBin ; // Number of bins in event container for multiplicity
263 Int_t fNZvertBin ; // Number of bins in event container for vertex position
264 Int_t fNrpBin ; // Number of bins in event container for reaction plain
265 Float_t fZvtxCut ; // Cut on vertex position
266 Int_t fMaxMulti ; // Maximum multiplicity of particles in the analysis
267 Int_t fMinMulti ; // Maximum multiplicity of particles in the analysis
268 Bool_t fUseSelectEvent ; // Select events based on multiplicity and vertex cuts
d7c10d78 269 Bool_t fMakePlots ; // Print plots
270
591cc579 271
39ffdc47 272 AliCaloTrackReader * fReader; // Acces to ESD/AOD/MC data
477d6cee 273
274 TClonesArray* fInputAODBranch ; //! Selected input particles branch
275 TString fInputAODName ; // Name of input AOD branch;
276 TClonesArray* fOutputAODBranch ; //! Selected output particles branch
277 Bool_t fNewAOD ; // Flag, new aod branch added to the analysis or not.
278 TString fOutputAODName ; // Name of output AOD branch;
279 TString fOutputAODClassName; // Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelation ...)
591cc579 280 TString fAODObjArrayName ; // Name of ref array kept in a TList in AliAODParticleCorrelation with clusters or track references.
a3aebfff 281 TString fAddToHistogramsName;// Add this string to histograms name
477d6cee 282
f37fa8d2 283 //Analysis helper classes access pointers
614701c6 284 AliCaloPID * fCaloPID; //! PID calculation
285 AliFiducialCut * fFidCut; //! Acceptance cuts
286 AliIsolationCut * fIC; //! Isolation cut
287 AliMCAnalysisUtils * fMCUtils; //! MonteCarlo Analysis utils
288 AliNeutralMesonSelection * fNMS; //! Neutral Meson Selection
765d44e7 289 AliCalorimeterUtils * fCaloUtils ; // Pointer to CalorimeterUtils
f37fa8d2 290
291 //Histograms binning and range
5a2dbc3c 292 Int_t fHistoPtBins ; // Number of bins in pt axis
293 Float_t fHistoPtMax ; // Maximum value of pt histogram range
294 Float_t fHistoPtMin ; // Minimum value of pt histogram range
295 Int_t fHistoPhiBins ; // Number of bins in phi axis
296 Float_t fHistoPhiMax ; // Maximum value of phi histogram range
297 Float_t fHistoPhiMin ; // Minimum value of phi histogram range
298 Int_t fHistoEtaBins ; // Number of bins in eta axis
299 Float_t fHistoEtaMax ; // Maximum value of eta histogram range
300 Float_t fHistoEtaMin ; // Minimum value of eta histogram range
301 Int_t fHistoMassBins ; // Number of bins in mass axis
302 Float_t fHistoMassMax ; // Maximum value of mass histogram range
303 Float_t fHistoMassMin ; // Minimum value of mass histogram range
304 Int_t fHistoAsymBins ; // Number of bins in asymmetry axis
305 Float_t fHistoAsymMax ; // Maximum value of asymmetry histogram range
306 Float_t fHistoAsymMin ; // Minimum value of asymmetry histogram range
c8fe2783 307
d7c10d78 308 ClassDef(AliAnaPartCorrBaseClass,11)
c8fe2783 309} ;
1c5acb87 310
311
312#endif //ALIANAPARTCORRBASECLASS_H
313
314
315