revert unwanted changes from previous commit
[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)
1c5acb87 10
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
f37fa8d2 77 //Calorimeter helper class access methods
765d44e7 78 AliEMCALGeoUtils * GetEMCALGeometry() const { return fCaloUtils->GetEMCALGeometry(); }
79 AliPHOSGeoUtils * GetPHOSGeometry() const { return fCaloUtils->GetPHOSGeometry() ; }
c8fe2783 80
e6e63685 81 Int_t GetModuleNumberCellIndexes(const Int_t absId, const TString calo, Int_t & icol, Int_t & irow, Int_t &iRCU) const {
765d44e7 82 return fCaloUtils->GetModuleNumberCellIndexes(absId, calo, icol, irow,iRCU);}
b05a14a3 83 Int_t GetModuleNumber(AliAODPWG4Particle * part) const {
765d44e7 84 return fCaloUtils->GetModuleNumber(part, fReader->GetInputEvent());}
c8fe2783 85 Int_t GetModuleNumber(AliVCluster * cluster) const {
765d44e7 86 return fCaloUtils->GetModuleNumber(cluster);}
f37fa8d2 87
a5cc4f03 88 virtual void Terminate(TList * /*outputList*/) {;}
89
f37fa8d2 90 //analysis AOD branch
477d6cee 91 virtual TClonesArray * GetCreateOutputAODBranch() ;
92 virtual TString GetInputAODName() const {return fInputAODName ; }
93 virtual void SetInputAODName(TString name) { fInputAODName = name; }
94 virtual TString GetOutputAODName() const {return fOutputAODName ; }
95 virtual void SetOutputAODName(TString name) { fNewAOD = kTRUE ; fOutputAODName = name; }
96 virtual Bool_t NewOutputAOD() const {return fNewAOD;}
97 virtual TString GetOutputAODClassName() const {return fOutputAODClassName;}
98 virtual void SetOutputAODClassName(TString name) {fOutputAODClassName = name; }
765d44e7 99 virtual AliCalorimeterUtils * GetCaloUtils() const {return fCaloUtils ; }
100 void SetCaloUtils(AliCalorimeterUtils * caloutils) { fCaloUtils = caloutils ; }
101
591cc579 102 virtual TString GetAODObjArrayName() const {return fAODObjArrayName;}
103 virtual void SetAODObjArrayName(TString name) {fAODObjArrayName = name; }
c8fe2783 104
477d6cee 105 virtual TClonesArray* GetInputAODBranch() const {return fInputAODBranch ;}
1e86c71e 106 virtual TClonesArray* GetOutputAODBranch() const {if(fNewAOD) return fOutputAODBranch; else return fInputAODBranch ;}
42dc8e7d 107 virtual TClonesArray* GetAODBranch(TString aodBranchName) const ;
108
477d6cee 109 virtual TClonesArray* GetAODCaloClusters() const ;
110 virtual TClonesArray* GetAODTracks() const ;
f37fa8d2 111 virtual AliVCaloCells* GetPHOSCells() const {return fReader->GetPHOSCells() ;}
112 virtual AliVCaloCells* GetEMCALCells() const {return fReader->GetEMCALCells() ;}
113
591cc579 114 virtual TObjArray* GetAODCTS() const ;
115 virtual TObjArray* GetAODEMCAL() const ;
116 virtual TObjArray* GetAODPHOS() const ;
477d6cee 117
118 virtual TString GetBaseParametersList();
f37fa8d2 119
477d6cee 120 virtual AliStack * GetMCStack() const ;
121 virtual AliHeader* GetMCHeader() const ;
122 virtual AliGenEventHeader* GetMCGenEventHeader() const ;
123
f37fa8d2 124 //Analysis helpers classes pointers setters and getters
decca433 125 virtual AliCaloPID * GetCaloPID() {if(!fCaloPID) fCaloPID = new AliCaloPID(); return fCaloPID ;}
42dc8e7d 126 virtual void SetCaloPID(AliCaloPID * const pid) { fCaloPID = pid ;}
477d6cee 127
2ebb9054 128 virtual AliFiducialCut * GetFiducialCut() {if(!fFidCut) fFidCut = new AliFiducialCut(); return fFidCut ;}
ff45398a 129 virtual void SetFiducialCut(AliFiducialCut * const fc) { fFidCut = fc ;}
477d6cee 130
decca433 131 virtual AliIsolationCut * GetIsolationCut() {if(!fIC) fIC = new AliIsolationCut(); return fIC ;}
42dc8e7d 132 virtual void SetIsolationCut(AliIsolationCut * const ic) { fIC = ic ;}
477d6cee 133
decca433 134 virtual AliMCAnalysisUtils * GetMCAnalysisUtils() {if(!fMCUtils) fMCUtils = new AliMCAnalysisUtils(); return fMCUtils ;}
42dc8e7d 135 virtual void SetMCAnalysisUtils(AliMCAnalysisUtils * const mcutils) { fMCUtils = mcutils ;}
477d6cee 136
decca433 137 virtual AliNeutralMesonSelection * GetNeutralMesonSelection() {if(!fNMS) fNMS = new AliNeutralMesonSelection(); return fNMS ;}
42dc8e7d 138 virtual void SetNeutralMesonSelection(AliNeutralMesonSelection * const nms) { fNMS = nms ;}
765d44e7 139
1e274f1c 140 virtual Bool_t IsDataMC() {return fDataMC ; }
141 virtual void SwitchOnDataMC() {fDataMC = kTRUE ; if(!fMCUtils)fMCUtils = new AliMCAnalysisUtils();}
decca433 142 virtual void SwitchOffDataMC() {fDataMC = kFALSE ; }
c8fe2783 143
1e274f1c 144 virtual Bool_t IsFiducialCutOn() { return fCheckFidCut ; }
145 virtual void SwitchOnFiducialCut() { fCheckFidCut = kTRUE; if(!fFidCut)fFidCut = new AliFiducialCut();}
decca433 146 virtual void SwitchOffFiducialCut() { fCheckFidCut = kFALSE;}
477d6cee 147
1e274f1c 148 virtual Bool_t IsCaloPIDOn() { return fCheckCaloPID ; }
149 virtual void SwitchOnCaloPID() { fCheckCaloPID = kTRUE; if(!fCaloPID)fCaloPID = new AliCaloPID();}
decca433 150 virtual void SwitchOffCaloPID() { fCheckCaloPID = kFALSE;}
477d6cee 151
1e274f1c 152 virtual Bool_t IsCaloPIDRecalculationOn() { return fRecalculateCaloPID ; }
decca433 153 virtual void SwitchOnCaloPIDRecalculation() { fRecalculateCaloPID = kTRUE;}
154 virtual void SwitchOffCaloPIDRecalculation() { fRecalculateCaloPID = kFALSE;}
477d6cee 155
156 virtual Float_t GetMaxPt() const {return fMaxPt ; }
157 virtual Float_t GetMinPt() const {return fMinPt ; }
decca433 158 virtual void SetMaxPt(Float_t pt) {fMaxPt = pt ; }
159 virtual void SetMinPt(Float_t pt) {fMinPt = pt ; }
765d44e7 160 virtual void SetPtCutRange(Double_t ptmin, Double_t ptmax)
477d6cee 161 { fMaxPt=ptmax; fMinPt=ptmin;}
162
f37fa8d2 163 //Histogrammes setters and getters
164 //Pt, Energy
477d6cee 165 virtual void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 166 fHistoPtBins = n ;
477d6cee 167 fHistoPtMax = max ;
168 fHistoPtMin = min ;
169 }
170
765d44e7 171 virtual Int_t GetHistoPtBins() const { return fHistoPtBins; }
172 virtual Float_t GetHistoPtMin() const { return fHistoPtMin ; }
173 virtual Float_t GetHistoPtMax() const { return fHistoPtMax ; }
477d6cee 174
c8fe2783 175 //Azimuthal angle
477d6cee 176 virtual void SetHistoPhiRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 177 fHistoPhiBins = n ;
178 fHistoPhiMax = max ;
179 fHistoPhiMin = min ;
477d6cee 180 }
181
765d44e7 182 virtual Int_t GetHistoPhiBins() const { return fHistoPhiBins; }
183 virtual Float_t GetHistoPhiMin() const { return fHistoPhiMin ; }
184 virtual Float_t GetHistoPhiMax() const { return fHistoPhiMax ; }
477d6cee 185
f37fa8d2 186 //Pseudorapidity-rapidity
477d6cee 187 virtual void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n) {
5a2dbc3c 188 fHistoEtaBins = n ;
189 fHistoEtaMax = max ;
190 fHistoEtaMin = min ;
477d6cee 191 }
192
765d44e7 193 virtual Int_t GetHistoEtaBins() const { return fHistoEtaBins; }
194 virtual Float_t GetHistoEtaMin() const { return fHistoEtaMin ; }
195 virtual Float_t GetHistoEtaMax() const { return fHistoEtaMax ; }
5a2dbc3c 196
f37fa8d2 197 //Mass
5a2dbc3c 198 virtual void SetHistoMassRangeAndNBins(Float_t min, Float_t max, Int_t n) {
c8fe2783 199 fHistoMassBins = n ;
200 fHistoMassMax = max ;
201 fHistoMassMin = min ;
5a2dbc3c 202 }
203
765d44e7 204 virtual Int_t GetHistoMassBins() const { return fHistoMassBins ; }
205 virtual Float_t GetHistoMassMin() const { return fHistoMassMin ; }
206 virtual Float_t GetHistoMassMax() const { return fHistoMassMax ; }
5a2dbc3c 207
f37fa8d2 208 //Asymetry
5a2dbc3c 209 virtual void SetHistoAsymmetryRangeAndNBins(Float_t min, Float_t max, Int_t n) {
c8fe2783 210 fHistoAsymBins = n ;
211 fHistoAsymMax = max ;
212 fHistoAsymMin = min ;
5a2dbc3c 213 }
214
765d44e7 215 virtual Int_t GetHistoAsymmetryBins() const { return fHistoAsymBins ; }
216 virtual Float_t GetHistoAsymmetryMin() const { return fHistoAsymMin ; }
217 virtual Float_t GetHistoAsymmetryMax() const { return fHistoAsymMax ; }
c8fe2783 218
f8006433 219 virtual AliMixedEvent * GetMixedEvent() { return GetReader()->GetMixedEvent() ; }
220 virtual Int_t GetNMixedEvent() const { return GetReader()->GetNMixedEvent() ; }
221
222 virtual void GetVertex(Double_t vertex[3]) const { GetReader()->GetVertex(vertex) ; }
223 virtual void GetVertex(Double_t vertex[3],const Int_t evtIndex) const { GetReader()->GetVertex(vertex,evtIndex) ; }
224 virtual Double_t* GetVertex(const Int_t evtIndex) const { return GetReader()->GetVertex(evtIndex) ; }
c8fe2783 225
5ae09196 226 virtual Bool_t IsTrackMatched(const AliVCluster * cluster) const { return fCaloPID->IsTrackMatched(cluster); }
f37fa8d2 227
c8fe2783 228private:
477d6cee 229
230 Bool_t fDataMC ; // Flag to access MC data when using ESD or AOD
231 Int_t fDebug ; // Debug level
232 Bool_t fCheckFidCut ; // Do analysis for clusters in defined region
233 Bool_t fCheckCaloPID ; // Do analysis for calorimeters
234 Bool_t fRecalculateCaloPID ; // Recalculate PID or use PID weights in calorimeters
235 Float_t fMinPt ; // Maximum pt of (trigger) particles in the analysis
236 Float_t fMaxPt ; // Minimum pt of (trigger) particles in the analysis
591cc579 237
39ffdc47 238 AliCaloTrackReader * fReader; // Acces to ESD/AOD/MC data
477d6cee 239
240 TClonesArray* fInputAODBranch ; //! Selected input particles branch
241 TString fInputAODName ; // Name of input AOD branch;
242 TClonesArray* fOutputAODBranch ; //! Selected output particles branch
243 Bool_t fNewAOD ; // Flag, new aod branch added to the analysis or not.
244 TString fOutputAODName ; // Name of output AOD branch;
245 TString fOutputAODClassName; // Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelation ...)
591cc579 246 TString fAODObjArrayName ; // Name of ref array kept in a TList in AliAODParticleCorrelation with clusters or track references.
a3aebfff 247 TString fAddToHistogramsName;// Add this string to histograms name
477d6cee 248
f37fa8d2 249 //Analysis helper classes access pointers
614701c6 250 AliCaloPID * fCaloPID; //! PID calculation
251 AliFiducialCut * fFidCut; //! Acceptance cuts
252 AliIsolationCut * fIC; //! Isolation cut
253 AliMCAnalysisUtils * fMCUtils; //! MonteCarlo Analysis utils
254 AliNeutralMesonSelection * fNMS; //! Neutral Meson Selection
765d44e7 255 AliCalorimeterUtils * fCaloUtils ; // Pointer to CalorimeterUtils
c8fe2783 256
f37fa8d2 257
258 //Histograms binning and range
5a2dbc3c 259 Int_t fHistoPtBins ; // Number of bins in pt axis
260 Float_t fHistoPtMax ; // Maximum value of pt histogram range
261 Float_t fHistoPtMin ; // Minimum value of pt histogram range
262 Int_t fHistoPhiBins ; // Number of bins in phi axis
263 Float_t fHistoPhiMax ; // Maximum value of phi histogram range
264 Float_t fHistoPhiMin ; // Minimum value of phi histogram range
265 Int_t fHistoEtaBins ; // Number of bins in eta axis
266 Float_t fHistoEtaMax ; // Maximum value of eta histogram range
267 Float_t fHistoEtaMin ; // Minimum value of eta histogram range
268 Int_t fHistoMassBins ; // Number of bins in mass axis
269 Float_t fHistoMassMax ; // Maximum value of mass histogram range
270 Float_t fHistoMassMin ; // Minimum value of mass histogram range
271 Int_t fHistoAsymBins ; // Number of bins in asymmetry axis
272 Float_t fHistoAsymMax ; // Maximum value of asymmetry histogram range
273 Float_t fHistoAsymMin ; // Minimum value of asymmetry histogram range
c8fe2783 274
f8006433 275 ClassDef(AliAnaPartCorrBaseClass,9)
c8fe2783 276} ;
1c5acb87 277
278
279#endif //ALIANAPARTCORRBASECLASS_H
280
281
282