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