]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/GammaConv/AliAnalysisTaskGammaConversion.h
changes from gsi svn
[u/mrichter/AliRoot.git] / PWG4 / GammaConv / AliAnalysisTaskGammaConversion.h
CommitLineData
d7d7e825 1#ifndef ALIANALYSISTASKGAMMACONVERSION_H
2#define ALIANALYSISTASKGAMMACONVERSION_H
a0b94e5c 3
d7d7e825 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7////////////////////////////////////////////////
8//---------------------------------------------
9// Class used to do analysis on conversion pairs
10//---------------------------------------------
11////////////////////////////////////////////////
a0b94e5c 12
d7d7e825 13#include "AliAnalysisTaskSE.h"
14#include <vector>
15#include "AliV0Reader.h"
5ce758b0 16#include "AliGammaConversionBGHandler.h"
2ea0dd4a 17#include "TRandom3.h"
18#include "TF1.h"
cc5a88a2 19#include "AliMultiplicity.h"
4a6157dc 20//#include "AliCFManager.h" // for CF
21//#include "AliCFContainer.h" // for CF
2eedd4ed 22#include "AliAODConversionMother.h"
d7d7e825 23
6441e967 24
25class AliAODPWG4Particle;
2eedd4ed 26class AliAODConversionPhoton;
27class AliAODConversionMother;
28class AliKFConversionPhoton;
29class AliKFConversionMother;
d7d7e825 30class TNtuple;
31class AliGammaConversionHistograms;
32class AliESDv0;
9c1cb6f7 33class AliV0;
d7d7e825 34class AliKFParticle;
9c1cb6f7 35class AliKFVertex;
d7d7e825 36class AliESDInputHandler;
37class AliESDEvent;
38class AliAODEvent;
a0b94e5c 39class AliMCEvent;
d7d7e825 40class TList;
41class AliStack;
42class AliESDtrackCuts;
18a1e325 43class AliTriggerAnalysis;
a0b94e5c 44class AliCFManager; // for CF
45class AliCFContainer; // for CF
77ac6f3e 46class TRandom3;
2ea0dd4a 47class TF1;
d7d7e825 48
49class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
50{
a0b94e5c 51
d7d7e825 52 public:
3c45d101 53 typedef enum { kProcSD, kProcDD, kProcND, kProcUnknown, kNProcs } ProcType_t;
d7d7e825 54 AliAnalysisTaskGammaConversion();
55 AliAnalysisTaskGammaConversion(const char* name);
56 virtual ~AliAnalysisTaskGammaConversion() ;// virtual destructor
a0b94e5c 57
d7d7e825 58 // Implementation of interface methods
59 virtual void UserCreateOutputObjects();
60 virtual void Init();
61 virtual void LocalInit() {Init();}
c00009fb 62 virtual void UserExec(Option_t *option);
d7d7e825 63 virtual void Terminate(Option_t *option);
48682642 64 //virtual void ConnectInputData(Option_t * option);
77ac6f3e 65 void CheckMesonProcessTypeEventQuality(Int_t evtQ);
66 Int_t GetProcessType(const AliMCEvent * mcEvt) ;
d7d7e825 67 void ProcessMCData();
68 void ProcessV0sNoCut();
69 void ProcessV0s();
70 void ProcessGammasForNeutralMesonAnalysis();
6272370b 71 void ProcessGammasForOmegaMesonAnalysis();
77ac6f3e 72 // void ProcessConvPHOSGammasForNeutralMesonAnalysis();
2eedd4ed 73// void RecalculateV0ForGamma();
a0b94e5c 74 // for CF
4a6157dc 75 void SetCFManager(AliCFManager * const io) {fCFManager = io;};
a0b94e5c 76 AliCFManager *GetCFManager() const {return fCFManager;}
77
78
d7d7e825 79 // AOD
80 TString GetAODBranchName() const {return fAODBranchName;}
81 void SetAODBranchName(TString name) {fAODBranchName = name ;}
d765d400 82 void SetForceAOD(Bool_t forceAOD ) { fKFForceAOD = forceAOD; }
d7d7e825 83 void FillAODWithConversionGammas();
2eedd4ed 84 void AddGammaToAOD(AliKFConversionPhoton * kfParticle);
85 // void AddPionToAOD(AliKFConversionMother * kfParticle);
86 // void AddOmegaToAOD(AliKFParticle * kfParticle, Int_t daughter1, Int_t daughter2);
81900183 87 void TagDaughter(Int_t gammaIndex);
2eedd4ed 88
d7d7e825 89 // end AOD
a0b94e5c 90
77ac6f3e 91 static Bool_t IsGoodImpPar(const AliESDtrack *const track);
6272370b 92
a0b94e5c 93 // for GammaJetAnalysis
d7d7e825 94 void ProcessGammasForGammaJetAnalysis();
95 void CreateListOfChargedParticles();
6c84d371 96 Double_t GetMinimumDistanceToCharge(Int_t indexHighestPtGamma);
97 void CalculateJetCone(Int_t gammaIndex);
d7d7e825 98 Int_t GetIndexHighestPtGamma();
99 void SetESDtrackCuts();
100 // end of Gamma Jet
a0b94e5c 101
d7d7e825 102 void SetMinPtForGammaJet(Double_t minPtForGammaJet){fMinPtForGammaJet=minPtForGammaJet;}
103 void SetMinIsoConeSize(Double_t minIsoConeSize){fMinIsoConeSize=minIsoConeSize;}
104 void SetMinPtIsoCone(Double_t minPtIsoCone){fMinPtIsoCone=minPtIsoCone;}
105 void SetMinPtGamChargedCorr(Double_t minPtGamChargedCorr){fMinPtGamChargedCorr=minPtGamChargedCorr;}
106 void SetMinPtJetCone(Double_t minPtJetCone){fMinPtJetCone=minPtJetCone;}
9640a3d1 107
108 void SetLowPtMapping(Double_t lowPtMapping){fLowPtMapping=lowPtMapping;}
109 void SetHighPtMapping(Double_t highPtMapping){fHighPtMapping=highPtMapping;}
110
a0b94e5c 111
d7d7e825 112 void SetHistograms(AliGammaConversionHistograms *const histograms){fHistograms=histograms;}
b5832f95 113 void SetTriggerCINT1B(Bool_t flag){fTriggerCINT1B=flag;}
d7d7e825 114 void SetDoMCTruth(Bool_t flag){fDoMCTruth=flag;}
115 void SetDoNeutralMeson(Bool_t flag){fDoNeutralMeson=flag;}
6272370b 116 void SetDoOmegaMeson(Bool_t flag){fDoOmegaMeson=flag;}
037dc2db 117 void SetDoNeutralMesonV0MCCheck(Bool_t flag){fDoNeutralMesonV0MCCheck=flag;}
d7d7e825 118 void SetDoJet(Bool_t flag){fDoJet=flag;}
119 void SetDoChic(Bool_t flag){fDoChic=flag;}
9c1cb6f7 120 void SetRecalculateV0ForGamma(Bool_t flag){fRecalculateV0ForGamma=flag;}
121
d7d7e825 122 void SetElectronMass(Double_t electronMass){fElectronMass = electronMass;}
123 void SetGammaMass(Double_t gammaMass){fGammaMass = gammaMass;}
124 void SetGammaWidth(Double_t gammaWidth){fGammaWidth = gammaWidth;}
125 void SetPi0Mass(Double_t pi0Mass){fPi0Mass = pi0Mass;}
126 void SetPi0Width(Double_t pi0Width){fPi0Width = pi0Width;}
127 void SetEtaMass(Double_t etaMass){fEtaMass = etaMass;}
128 void SetEtaWidth(Double_t etaWidth){fEtaWidth = etaWidth;}
129 void SetMinOpeningAngleGhostCut(Double_t ghostCut){fMinOpeningAngleGhostCut = ghostCut;}
037dc2db 130 void SetV0Reader(AliV0Reader* const reader){fV0Reader=reader; fV0Reader->SetESDtrackCuts(fEsdTrackCuts);}
d7d7e825 131 void SetCalculateBackground(Bool_t bg){fCalculateBackground=bg;}
132 void CalculateBackground();
133 void SetWriteNtuple(Bool_t writeNtuple){fWriteNtuple = writeNtuple;}
134 void FillNtuple();
77ac6f3e 135 Double_t GetMCOpeningAngle(const TParticle* const daughter0,const TParticle* const daughter1) const;
d7d7e825 136 void CheckV0Efficiency();
332f1f44 137 void SetDeltaAODFileName(TString fn) { fKFDeltaAODFileName = fn; };
63477d82 138 void SetCreateAOD(Bool_t doAod) { fKFCreateAOD = doAod; };
139 TString GetDeltaAODFileName() const { return fKFDeltaAODFileName; };
d7d7e825 140 //////////////////Chi_c Analysis////////////////////////////
77ac6f3e 141 void GetPID(const AliESDtrack *track, Stat_t &pid, Stat_t &weight);
142 double GetSigmaToVertex(const AliESDtrack* t);
6c84d371 143 void ElectronBackground(TString hBg, TClonesArray e);
144 void FillAngle(TString histoName,TClonesArray const tlVeNeg, TClonesArray const tlVePos);
145 void FillElectronInvMass(TString histoName, TClonesArray const negativeElectron, TClonesArray const positiveElectron);
146 void FillGammaElectronInvMass(TString histoMass,TString histoDiff, TClonesArray const fKFGammas, TClonesArray const tlVeNeg,TClonesArray const tlVePos);
147 void CleanWithAngleCuts(TClonesArray const negativeElectrons, TClonesArray const positiveElectrons, TClonesArray const gammas);
148 TClonesArray GetTLorentzVector(TClonesArray* esdTrack);
d7d7e825 149 void ProcessGammaElectronsForChicAnalysis();
150 ///////////////////////////////////////////////////////////////
1e7846f4 151
152 void SetDoCF(Bool_t flag){fDoCF = flag;}
5ce758b0 153
154 void SetUseChargedTracksMultiplicityForBG(Bool_t flag){fUseTrackMultiplicityForBG = flag;}
155
156 void SetMoveParticleAccordingToVertex(Bool_t flag){fMoveParticleAccordingToVertex = flag;}
157
77ac6f3e 158 void MoveParticleAccordingToVertex(AliKFParticle * particle,const AliGammaConversionBGHandler::GammaConversionVertex *vertex);
5ce758b0 159
2e2da371 160 void SetApplyChi2Cut(Bool_t flag){fApplyChi2Cut = flag;}
161
111d75df 162 void SetDoRotation(Bool_t flag){fDoRotation = flag;}
163
77ac6f3e 164 void SetPMDegreesBG(Int_t deg){fNDegreesPMBackground=deg;}
111d75df 165
77ac6f3e 166 void SetNumberOfRotationsBG(Int_t nRot){fNRandomEventsForBG=nRot;}
111d75df 167
168 void RotateKFParticle(AliKFParticle * kfParticle,Double_t angle);
169
170 void SetCheckBGProbability(Bool_t flag){fCheckBGProbability = flag;}
171
2f426a53 172 void SetRemovePileUp(Bool_t removePileUp) { fRemovePileUp = removePileUp; }
173
18a1e325 174 void SetSelectV0AND(Bool_t selectV0AND) { fSelectV0AND = selectV0AND; }
6746e1e1 175 void SetUseMultiplicity(Int_t useMultiplicity) {fUseMultiplicity=useMultiplicity;}
176 void SetUseMultiplicityBin(Int_t useMultiplicityBin) {fUseMultiplicityBin=useMultiplicityBin;}
cc5a88a2 177 void SetUseHBTMultiplicity(Int_t useHBTMultiplicity) {fUseHBTMultiplicity=useHBTMultiplicity;}
178 void SetUseHBTMultiplicityBin(Int_t useHBTMultiplicityBin) {fUseHBTMultiplicityBin=useHBTMultiplicityBin;}
179
6746e1e1 180 Int_t CalculateMultiplicityBin();
64f4118c 181 void SetUseCentrality(Int_t useCentrality) {fUseCentrality=useCentrality;}
182 void SetUseCentralityBin(Int_t useCentralityBin) {fUseCentralityBin=useCentralityBin;}
183
184
185
186
d7d7e825 187 private:
188 AliAnalysisTaskGammaConversion(const AliAnalysisTaskGammaConversion&); // Not implemented
189 AliAnalysisTaskGammaConversion& operator=(const AliAnalysisTaskGammaConversion&); // Not implemented
04bf4381 190
a0b94e5c 191
4a6157dc 192 // for CF
193 enum{
194 kStepGenerated = 0,
195 kStepReconstructable = 1,
ebcfaa7e 196 kStepGetOnFly = 2,
197 kStepLikeSign = 3,
198 kStepTPCRefit = 4,
199 kStepKinks = 5,
77ac6f3e 200 kStepdEdxElectronSelection = 6,
201 kStepdEdxPpionRejection = 7,
ebcfaa7e 202 kStepNContributors = 8,
203 kStepTPCPID = 9,
204 kStepR = 10,
205 kStepLine = 11,
206 kStepZ = 12,
48682642 207 kStepMinClsTPC = 13,
208 kStepSinglePt = 14,
209 kStepNDF = 15,
210 kStepChi2 = 16,
211 kStepEta = 17,
212 kStepPt = 18,
213 kStepTrueGamma = 19
4a6157dc 214 };
26923b22 215
d7d7e825 216 AliV0Reader* fV0Reader; // The V0 reader object
a0b94e5c 217
d7d7e825 218 AliStack * fStack; // pointer to the MC particle stack
a0b94e5c 219 AliMCEventHandler *fMCTruth; // for CF pointer to MCTruth
4a6157dc 220 AliMCEvent *fGCMCEvent; // for CF pointer to the MC Event
d7d7e825 221 AliESDEvent* fESDEvent; //pointer to the ESDEvent
a0b94e5c 222 TList * fOutputContainer; // Histogram container
223 AliCFManager *fCFManager; // for CF
224 // AliCFContainer *container; // for CF
d7d7e825 225
a0b94e5c 226
227
d7d7e825 228 AliGammaConversionHistograms *fHistograms; // Pointer to the histogram handling class
b5832f95 229 Bool_t fTriggerCINT1B; //Flag to select trigger CINT1B
d7d7e825 230 Bool_t fDoMCTruth; // Flag to switch on/off MC truth
6c84d371 231 Bool_t fDoNeutralMeson; // flag
6272370b 232 Bool_t fDoOmegaMeson; // flag
6c84d371 233 Bool_t fDoJet; // flag
234 Bool_t fDoChic; // flag
9c1cb6f7 235 Bool_t fRecalculateV0ForGamma;//flag
a0b94e5c 236
6c84d371 237 TClonesArray * fKFReconstructedGammasTClone; //! transient
6272370b 238 TClonesArray * fKFReconstructedPi0sTClone; //! transient
9c1cb6f7 239 TClonesArray * fKFRecalculatedGammasTClone; //! transient
6c84d371 240 TClonesArray * fCurrentEventPosElectronTClone; //! transient
241 TClonesArray * fCurrentEventNegElectronTClone; //! transient
242 TClonesArray * fKFReconstructedGammasCutTClone; //! transient
243 TClonesArray * fPreviousEventTLVNegElectronTClone; //! transient
244 TClonesArray * fPreviousEventTLVPosElectronTClone; //! transient
a0b94e5c 245
6c84d371 246 // vector<AliKFParticle> fKFReconstructedGammas; // vector containing all reconstructed gammas
6272370b 247
9c1cb6f7 248 // AliESDpid * fESDpid; // esd pid
6272370b 249
250
d7d7e825 251 ///////Chi_c Analysis///////////////////////////
6c84d371 252 // vector<AliESDtrack*> fCurrentEventPosElectron; // comment here
253 // vector<AliESDtrack*> fCurrentEventNegElectron; // comment here
254 // vector<AliKFParticle> fKFReconstructedGammasCut; // comment here
255 // vector<TLorentzVector> fPreviousEventTLVNegElectron; // comment here
256 // vector<TLorentzVector> fPreviousEventTLVPosElectron; // comment here
d7d7e825 257 //////////////////////////////////////////////////
a0b94e5c 258
d7d7e825 259 //mass defines
260 Double_t fElectronMass; //electron mass
261 Double_t fGammaMass; //gamma mass
262 Double_t fPi0Mass; //pi0mass
263 Double_t fEtaMass; //eta mass
a0b94e5c 264
d7d7e825 265 // width defines
266 Double_t fGammaWidth; //gamma width cut
267 Double_t fPi0Width; // pi0 width cut
268 Double_t fEtaWidth; // eta width cut
a0b94e5c 269
d7d7e825 270 Double_t fMinOpeningAngleGhostCut; // minimum angle cut
a0b94e5c 271
d7d7e825 272 AliESDtrackCuts* fEsdTrackCuts; // Object containing the parameters of the esd track cuts
a0b94e5c 273
d7d7e825 274 Bool_t fCalculateBackground; //flag to set backgrount calculation on/off
275 Bool_t fWriteNtuple; // flag to set if writing to ntuple on/off
276 TNtuple *fGammaNtuple; // Ntuple for gamma values
277 TNtuple *fNeutralMesonNtuple;// NTuple for mesons
a0b94e5c 278
d7d7e825 279 Int_t fTotalNumberOfAddedNtupleEntries; // number of added ntuple entries
a0b94e5c 280
6c84d371 281 TClonesArray* fChargedParticles; //! transient
282 vector<Int_t> fChargedParticlesId; //! transient
a0b94e5c 283
6c84d371 284 Double_t fGammaPtHighest; //! transient
285 Double_t fMinPtForGammaJet; //! transient
286 Double_t fMinIsoConeSize; //! transient
287 Double_t fMinPtIsoCone; //! transient
288 Double_t fMinPtGamChargedCorr; //! transient
289 Double_t fMinPtJetCone; //! transient
290 Int_t fLeadingChargedIndex; //! transient
1e7846f4 291 Double_t fLowPtMapping; //! transient
292 Double_t fHighPtMapping; //! transient
293 Bool_t fDoCF; //! transient
a0b94e5c 294
04bf4381 295 TClonesArray * fAODGamma; //TClonesArray for gammas to put in AOD
2eedd4ed 296 //TClonesArray * fAODPi0; //TTClonesArray for Pi0s to put in AOD
297 //TClonesArray * fAODOmega; //TTClonesArray for omegas to put in AOD
d7d7e825 298 TString fAODBranchName; // New AOD branch name
63477d82 299 Bool_t fKFCreateAOD; //Create the AOD tclones? (regardless if storing or not)
6441e967 300
d765d400 301 Bool_t fKFForceAOD; //Set the Analysis Manager FillAOD variable to true every event
332f1f44 302 TString fKFDeltaAODFileName; //! File name for delta AOD (if any)
037dc2db 303 Bool_t fDoNeutralMesonV0MCCheck; //flag
77ac6f3e 304 Bool_t fUseTrackMultiplicityForBG; //flag
305 Bool_t fMoveParticleAccordingToVertex; //flag
306 Bool_t fApplyChi2Cut; //flag
307 Int_t fNRandomEventsForBG; //number of random events to use in rotation method
308 Int_t fNDegreesPMBackground; // number of degree window to rotate particles for rotation method
309 Bool_t fDoRotation; //flag
310 Bool_t fCheckBGProbability; //flag
2eedd4ed 311// vector<Int_t>fKFReconstructedGammasV0Index; // index of the reconstructed v0s
2f426a53 312 Bool_t fRemovePileUp; // Remove Pile Up
18a1e325 313 Bool_t fSelectV0AND; // Select V0AND
314 AliTriggerAnalysis *fTriggerAnalysis; //! Trigger Analysis for Normalisation
6746e1e1 315 Int_t fMultiplicity;
316 Int_t fUseMultiplicity;
317 Int_t fUseMultiplicityBin;
cc5a88a2 318 Int_t fUseHBTMultiplicity;
319 Int_t fUseHBTMultiplicityBin;
64f4118c 320 Int_t fUseCentrality;
321 Int_t fUseCentralityBin;
2ea0dd4a 322 TRandom3 fRandom;
2eedd4ed 323 ClassDef(AliAnalysisTaskGammaConversion, 20); // Analysis task for gamma conversions
d7d7e825 324};
a0b94e5c 325
d7d7e825 326#endif //ALIANALYSISTASKGAMMA_H