Move initialization of common analysis services pointers from init parameters to...
[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
7//_________________________________________________________________________
8// Base class for analysis algorithms
9//-- Author: Gustavo Conesa (INFN-LNF)
10
fbeaf916 11#include <cstdlib>
12
1c5acb87 13//ROOT
14class TClonesArray ;
591cc579 15class TObjArray ;
a3aebfff 16#include <TList.h>
1c5acb87 17#include <TObject.h>
0c1383b5 18class TObjString;
1c5acb87 19
20//Analysis
e6e63685 21class AliESDCaloCluster;
1c5acb87 22class AliAODCaloCluster;
23class AliAODCaloCells;
e6e63685 24#include "AliCaloTrackReader.h"
decca433 25#include "AliCaloPID.h"
26#include "AliFiducialCut.h"
27#include "AliIsolationCut.h"
28#include "AliMCAnalysisUtils.h"
29#include "AliNeutralMesonSelection.h"
8cfc6870 30#include "AliCalorimeterUtils.h"
1c5acb87 31class AliStack ;
32class AliHeader ;
33class AliGenEventHeader ;
a3aebfff 34#include "AliAODPWG4ParticleCorrelation.h"
765d44e7 35class AliEMCALGeoUtils;
36class AliPHOSGeoUtils;
1c5acb87 37
38class AliAnaPartCorrBaseClass : public TObject {
39
78219bac 40 public:
477d6cee 41 AliAnaPartCorrBaseClass() ; // default ctor
78219bac 42 virtual ~AliAnaPartCorrBaseClass() ; //virtual dtor
43
44 private:
477d6cee 45 AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & g) ; // cpy ctor
46 AliAnaPartCorrBaseClass & operator = (const AliAnaPartCorrBaseClass & g) ;//cpy assignment
477d6cee 47
78219bac 48 public:
49 // virtual void AddAODCaloCluster(AliAODCaloCluster calo) ;
a3aebfff 50 virtual void AddAODParticle(AliAODPWG4Particle part) ;
51
477d6cee 52// virtual void ConnectAODCaloClusters();
53 virtual void ConnectAODPHOSCells();
54 virtual void ConnectAODEMCALCells();
55 virtual void ConnectInputOutputAODBranches();
56
4a745797 57 virtual TList * GetCreateOutputObjects() { return (new TList) ;}
58 //virtual TList * GetAnalysisOutputContainer() { return fAnaOutContainer ;}
59
a3aebfff 60 virtual void AddToHistogramsName(TString add) { fAddToHistogramsName = add; }
61 virtual TString GetAddedHistogramsStringToName() {return fAddToHistogramsName ;}
62
477d6cee 63 virtual void Init() {;}
64 virtual void InitParameters() ;
65
66 virtual void Print(const Option_t * ) const ;
67
68 virtual void MakeAnalysisFillAOD() {;}
69
70 virtual void MakeAnalysisFillHistograms() {;}
71
7787a778 72 virtual void MakeMixingAnalysisFillHistograms() {;}
73
0c1383b5 74 virtual TObjString * GetAnalysisCuts() {return 0x0;}
75
477d6cee 76 virtual Int_t GetDebug() const { return fDebug ; }
77 virtual void SetDebug(Int_t d) { fDebug = d ; }
78
79 virtual Int_t GetEventNumber() const ;
7cd4e982 80
477d6cee 81 virtual AliCaloTrackReader * GetReader() const {return fReader ; }
42dc8e7d 82 virtual void SetReader(AliCaloTrackReader * const reader) { fReader = reader ; }
477d6cee 83
765d44e7 84 //Calorimeter helper class access methods
85 AliEMCALGeoUtils * GetEMCALGeometry() const { return fCaloUtils->GetEMCALGeometry(); }
86 AliPHOSGeoUtils * GetPHOSGeometry() const { return fCaloUtils->GetPHOSGeometry() ; }
87
e6e63685 88 Int_t GetModuleNumberCellIndexes(const Int_t absId, const TString calo, Int_t & icol, Int_t & irow, Int_t &iRCU) const {
765d44e7 89 return fCaloUtils->GetModuleNumberCellIndexes(absId, calo, icol, irow,iRCU);}
b05a14a3 90 Int_t GetModuleNumber(AliAODPWG4Particle * part) const {
765d44e7 91 return fCaloUtils->GetModuleNumber(part, fReader->GetInputEvent());}
e6e63685 92 Int_t GetModuleNumber(AliESDCaloCluster * cluster) const {
765d44e7 93 return fCaloUtils->GetModuleNumber(cluster);}
e6e63685 94 Int_t GetModuleNumber(AliAODCaloCluster * cluster) const {
765d44e7 95 return fCaloUtils->GetModuleNumber(cluster);}
e6e63685 96
a5cc4f03 97 virtual void Terminate(TList * /*outputList*/) {;}
98
477d6cee 99 //analysis AOD branch
100 virtual TClonesArray * GetCreateOutputAODBranch() ;
101 virtual TString GetInputAODName() const {return fInputAODName ; }
102 virtual void SetInputAODName(TString name) { fInputAODName = name; }
103 virtual TString GetOutputAODName() const {return fOutputAODName ; }
104 virtual void SetOutputAODName(TString name) { fNewAOD = kTRUE ; fOutputAODName = name; }
105 virtual Bool_t NewOutputAOD() const {return fNewAOD;}
106 virtual TString GetOutputAODClassName() const {return fOutputAODClassName;}
107 virtual void SetOutputAODClassName(TString name) {fOutputAODClassName = name; }
765d44e7 108 virtual AliCalorimeterUtils * GetCaloUtils() const {return fCaloUtils ; }
109 void SetCaloUtils(AliCalorimeterUtils * caloutils) { fCaloUtils = caloutils ; }
110
591cc579 111 virtual TString GetAODObjArrayName() const {return fAODObjArrayName;}
112 virtual void SetAODObjArrayName(TString name) {fAODObjArrayName = name; }
a3aebfff 113
477d6cee 114 virtual TClonesArray* GetInputAODBranch() const {return fInputAODBranch ;}
1e86c71e 115 virtual TClonesArray* GetOutputAODBranch() const {if(fNewAOD) return fOutputAODBranch; else return fInputAODBranch ;}
42dc8e7d 116 virtual TClonesArray* GetAODBranch(TString aodBranchName) const ;
117
477d6cee 118// virtual TClonesArray* GetAODCaloClusters() const {return fAODCaloClusters ;}
119 virtual TClonesArray* GetAODCaloClusters() const ;
120 virtual TClonesArray* GetAODTracks() const ;
121 virtual AliAODCaloCells* GetAODCaloCells() const {return fAODCaloCells ;}
122
591cc579 123 virtual TObjArray* GetAODCTS() const ;
124 virtual TObjArray* GetAODEMCAL() const ;
125 virtual TObjArray* GetAODPHOS() const ;
477d6cee 126
127 virtual TString GetBaseParametersList();
128
129 virtual TNamed * GetEMCALCells() const ;
130 virtual TNamed * GetPHOSCells() const ;
131
132 virtual AliStack * GetMCStack() const ;
133 virtual AliHeader* GetMCHeader() const ;
134 virtual AliGenEventHeader* GetMCGenEventHeader() const ;
135
136 //Analysis helpers classes pointers setters and getters
decca433 137 virtual AliCaloPID * GetCaloPID() {if(!fCaloPID) fCaloPID = new AliCaloPID(); return fCaloPID ;}
42dc8e7d 138 virtual void SetCaloPID(AliCaloPID * const pid) { fCaloPID = pid ;}
477d6cee 139
decca433 140 virtual AliFiducialCut * GetFiducialCut() {if(fFidCut) fFidCut = new AliFiducialCut(); return fFidCut ;}
ff45398a 141 virtual void SetFiducialCut(AliFiducialCut * const fc) { fFidCut = fc ;}
477d6cee 142
decca433 143 virtual AliIsolationCut * GetIsolationCut() {if(!fIC) fIC = new AliIsolationCut(); return fIC ;}
42dc8e7d 144 virtual void SetIsolationCut(AliIsolationCut * const ic) { fIC = ic ;}
477d6cee 145
decca433 146 virtual AliMCAnalysisUtils * GetMCAnalysisUtils() {if(!fMCUtils) fMCUtils = new AliMCAnalysisUtils(); return fMCUtils ;}
42dc8e7d 147 virtual void SetMCAnalysisUtils(AliMCAnalysisUtils * const mcutils) { fMCUtils = mcutils ;}
477d6cee 148
decca433 149 virtual AliNeutralMesonSelection * GetNeutralMesonSelection() {if(!fNMS) fNMS = new AliNeutralMesonSelection(); return fNMS ;}
42dc8e7d 150 virtual void SetNeutralMesonSelection(AliNeutralMesonSelection * const nms) { fNMS = nms ;}
765d44e7 151
decca433 152 virtual Bool_t IsDataMC() {return fDataMC ; fMCUtils = new AliMCAnalysisUtils();}
153 virtual void SwitchOnDataMC() {fDataMC = kTRUE ; }
154 virtual void SwitchOffDataMC() {fDataMC = kFALSE ; }
155
156 virtual Bool_t IsFiducialCutOn() {return fCheckFidCut ; }
157 virtual void SwitchOnFiducialCut() { fCheckFidCut = kTRUE; fFidCut = new AliFiducialCut();}
158 virtual void SwitchOffFiducialCut() { fCheckFidCut = kFALSE;}
477d6cee 159
decca433 160 virtual Bool_t IsCaloPIDOn() {return fCheckCaloPID ; fCaloPID = new AliCaloPID();}
161 virtual void SwitchOnCaloPID() { fCheckCaloPID = kTRUE;}
162 virtual void SwitchOffCaloPID() { fCheckCaloPID = kFALSE;}
477d6cee 163
decca433 164 virtual Bool_t IsCaloPIDRecalculationOn() {return fRecalculateCaloPID ; }
165 virtual void SwitchOnCaloPIDRecalculation() { fRecalculateCaloPID = kTRUE;}
166 virtual void SwitchOffCaloPIDRecalculation() { fRecalculateCaloPID = kFALSE;}
477d6cee 167
168 virtual Float_t GetMaxPt() const {return fMaxPt ; }
169 virtual Float_t GetMinPt() const {return fMinPt ; }
decca433 170 virtual void SetMaxPt(Float_t pt) {fMaxPt = pt ; }
171 virtual void SetMinPt(Float_t pt) {fMinPt = pt ; }
765d44e7 172 virtual void SetPtCutRange(Double_t ptmin, Double_t ptmax)
477d6cee 173 { fMaxPt=ptmax; fMinPt=ptmin;}
174
175 //Histogrammes setters and getters
5a2dbc3c 176 //Pt, Energy
477d6cee 177 virtual void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 178 fHistoPtBins = n ;
477d6cee 179 fHistoPtMax = max ;
180 fHistoPtMin = min ;
181 }
182
765d44e7 183 virtual Int_t GetHistoPtBins() const { return fHistoPtBins; }
184 virtual Float_t GetHistoPtMin() const { return fHistoPtMin ; }
185 virtual Float_t GetHistoPtMax() const { return fHistoPtMax ; }
477d6cee 186
5a2dbc3c 187 //Azimuthal angle
477d6cee 188 virtual void SetHistoPhiRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 189 fHistoPhiBins = n ;
190 fHistoPhiMax = max ;
191 fHistoPhiMin = min ;
477d6cee 192 }
193
765d44e7 194 virtual Int_t GetHistoPhiBins() const { return fHistoPhiBins; }
195 virtual Float_t GetHistoPhiMin() const { return fHistoPhiMin ; }
196 virtual Float_t GetHistoPhiMax() const { return fHistoPhiMax ; }
477d6cee 197
5a2dbc3c 198 //Pseudorapidity-rapidity
477d6cee 199 virtual void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 200 fHistoEtaBins = n ;
201 fHistoEtaMax = max ;
202 fHistoEtaMin = min ;
477d6cee 203 }
204
765d44e7 205 virtual Int_t GetHistoEtaBins() const { return fHistoEtaBins; }
206 virtual Float_t GetHistoEtaMin() const { return fHistoEtaMin ; }
207 virtual Float_t GetHistoEtaMax() const { return fHistoEtaMax ; }
5a2dbc3c 208
209 //Mass
210 virtual void SetHistoMassRangeAndNBins(Float_t min, Float_t max, Int_t n) {
211 fHistoMassBins = n ;
212 fHistoMassMax = max ;
213 fHistoMassMin = min ;
214 }
215
765d44e7 216 virtual Int_t GetHistoMassBins() const { return fHistoMassBins ; }
217 virtual Float_t GetHistoMassMin() const { return fHistoMassMin ; }
218 virtual Float_t GetHistoMassMax() const { return fHistoMassMax ; }
5a2dbc3c 219
220 //Asymetry
221 virtual void SetHistoAsymmetryRangeAndNBins(Float_t min, Float_t max, Int_t n) {
222 fHistoAsymBins = n ;
223 fHistoAsymMax = max ;
224 fHistoAsymMin = min ;
225 }
226
765d44e7 227 virtual Int_t GetHistoAsymmetryBins() const { return fHistoAsymBins ; }
228 virtual Float_t GetHistoAsymmetryMin() const { return fHistoAsymMin ; }
229 virtual Float_t GetHistoAsymmetryMax() const { return fHistoAsymMax ; }
5a2dbc3c 230
477d6cee 231 private:
232
233 Bool_t fDataMC ; // Flag to access MC data when using ESD or AOD
234 Int_t fDebug ; // Debug level
235 Bool_t fCheckFidCut ; // Do analysis for clusters in defined region
236 Bool_t fCheckCaloPID ; // Do analysis for calorimeters
237 Bool_t fRecalculateCaloPID ; // Recalculate PID or use PID weights in calorimeters
238 Float_t fMinPt ; // Maximum pt of (trigger) particles in the analysis
239 Float_t fMaxPt ; // Minimum pt of (trigger) particles in the analysis
591cc579 240
39ffdc47 241 AliCaloTrackReader * fReader; // Acces to ESD/AOD/MC data
477d6cee 242
243 TClonesArray* fInputAODBranch ; //! Selected input particles branch
244 TString fInputAODName ; // Name of input AOD branch;
245 TClonesArray* fOutputAODBranch ; //! Selected output particles branch
246 Bool_t fNewAOD ; // Flag, new aod branch added to the analysis or not.
247 TString fOutputAODName ; // Name of output AOD branch;
248 TString fOutputAODClassName; // Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelation ...)
591cc579 249 TString fAODObjArrayName ; // Name of ref array kept in a TList in AliAODParticleCorrelation with clusters or track references.
a3aebfff 250 TString fAddToHistogramsName;// Add this string to histograms name
477d6cee 251
252 //TClonesArray* fAODCaloClusters ; //! selected PHOS/EMCAL CaloClusters
253 AliAODCaloCells * fAODCaloCells ; //! selected PHOS/EMCAL CaloCells
254
255 //Analysis helper classes access pointers
614701c6 256 AliCaloPID * fCaloPID; //! PID calculation
257 AliFiducialCut * fFidCut; //! Acceptance cuts
258 AliIsolationCut * fIC; //! Isolation cut
259 AliMCAnalysisUtils * fMCUtils; //! MonteCarlo Analysis utils
260 AliNeutralMesonSelection * fNMS; //! Neutral Meson Selection
765d44e7 261 AliCalorimeterUtils * fCaloUtils ; // Pointer to CalorimeterUtils
262
4a745797 263 //TList * fAnaOutContainer; // Temporal histogram output container, contents to be added to the main container passed to the main analysis frame
264
477d6cee 265 //Histograms binning and range
5a2dbc3c 266 Int_t fHistoPtBins ; // Number of bins in pt axis
267 Float_t fHistoPtMax ; // Maximum value of pt histogram range
268 Float_t fHistoPtMin ; // Minimum value of pt histogram range
269 Int_t fHistoPhiBins ; // Number of bins in phi axis
270 Float_t fHistoPhiMax ; // Maximum value of phi histogram range
271 Float_t fHistoPhiMin ; // Minimum value of phi histogram range
272 Int_t fHistoEtaBins ; // Number of bins in eta axis
273 Float_t fHistoEtaMax ; // Maximum value of eta histogram range
274 Float_t fHistoEtaMin ; // Minimum value of eta histogram range
275 Int_t fHistoMassBins ; // Number of bins in mass axis
276 Float_t fHistoMassMax ; // Maximum value of mass histogram range
277 Float_t fHistoMassMin ; // Minimum value of mass histogram range
278 Int_t fHistoAsymBins ; // Number of bins in asymmetry axis
279 Float_t fHistoAsymMax ; // Maximum value of asymmetry histogram range
280 Float_t fHistoAsymMin ; // Minimum value of asymmetry histogram range
281
765d44e7 282 ClassDef(AliAnaPartCorrBaseClass,7)
477d6cee 283 } ;
1c5acb87 284
285
286#endif //ALIANAPARTCORRBASECLASS_H
287
288
289