]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliAnalysisTaskHFE.h
Update
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliAnalysisTaskHFE.h
CommitLineData
809a4336 1/**************************************************************************
2* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
50685501 15//
16// Task for Heavy Flavour Electron Analysis
17// Fills a single-inclusive electron pt-spectrum
18// For further information see implementation file
19//
c2690925 20#ifndef ALIANALYSISTASKHFE_H
21#define ALIANALYSISTASKHFE_H
22
d2af20c5 23#ifndef ALIANALYSISTASKSE_H
24#include "AliAnalysisTaskSE.h"
dbe3abbe 25#endif
26
c2690925 27#ifndef ROOT_TString
28#include <TString.h>
29#endif
30
96167a04 31#ifndef ROOT_TBits
32#include <TBits.h>
33#endif
34
35class AliAnalysisUtils;
76d0b522 36class AliESDtrackCuts;
3a72645a 37class AliHFEcontainer;
38class AliHFEcollection;
809a4336 39class AliHFEcuts;
8c1c76e9 40class AliHFEextraCuts;
3a72645a 41class AliHFEelecbackground;
76d0b522 42class AliHFENonPhotonicElectron;
259c3296 43class AliHFEmcQA;
3a72645a 44class AliHFEpid;
45class AliHFEpidQAmanager;
259c3296 46class AliHFEsecVtx;
3a72645a 47class AliHFEsignalCuts;
48class AliHFEvarManager;
49class AliHFEtaggedTrackAnalysis;
809a4336 50class AliCFManager;
809a4336 51class AliMCEvent;
8c1c76e9 52class AliOADBContainer;
7ea7b2c4 53class AliAODMCHeader;
8c1c76e9 54class AliVEvent;
722347d8 55class AliVParticle;
69ac0e6f 56class AliTriggerAnalysis;
809a4336 57class TH1I;
58class TList;
7ea7b2c4 59class TClonesArray;
809a4336 60
d2af20c5 61class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
dbe3abbe 62 public:
9bcfd1ab 63 enum{
64 kPIDqa = 0,
65 kMCqa =1
66 };
67 enum{
68 kPriVtx = 0,
69 kSecVtx = 1,
70 kIsElecBackGround = 2,
3a72645a 71 kPostProcess = 3,
72 kDEstep = 4,
76d0b522 73 kTaggedTrackAnalysis = 5,
74 kNonPhotonicElectron = 6
9bcfd1ab 75 };
faee3b18 76 enum CreationProcess_t{
77 kSignalCharm = 0,
78 kSignalBeauty = 1,
79 kGammaConv = 2,
80 kOther = 3
81 };
fd6b8522 82 enum{
83 kBgPtBins = 44,
8c1c76e9 84 kElecBgSpecies = 6,
85 kCentBins = 11,
86 kBgLevels = 3
fd6b8522 87 };
96167a04 88 typedef enum{
89 kpp = 0,
90 kpPb = 1,
91 kPbPb = 2
92 } ECollisionSystem_t;
fd6b8522 93
dbe3abbe 94 AliAnalysisTaskHFE();
0792aa82 95 AliAnalysisTaskHFE(const char * name);
dbe3abbe 96 AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
97 AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
faee3b18 98 virtual void Copy(TObject &o) const;
75d81601 99 virtual ~AliAnalysisTaskHFE();
809a4336 100
d2af20c5 101 virtual void UserCreateOutputObjects();
102 virtual void UserExec(Option_t *);
dbe3abbe 103 virtual void Terminate(Option_t *);
809a4336 104
faee3b18 105 virtual Bool_t IsEventInBinZero();
106
75d81601 107 Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
9bcfd1ab 108 Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
109 Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
722347d8 110 Bool_t HasMCData() const { return TestBit(kHasMCdata); }
96167a04 111 Bool_t Ispp() const { return fCollisionSystem.TestBitNumber(kpp); }
112 Bool_t IsPbPb() const { return fCollisionSystem.TestBitNumber(kPbPb); }
113 Bool_t IspPb() const { return fCollisionSystem.TestBitNumber(kpPb); }
114 Bool_t IsHeavyIon() const { return IsPbPb() || IspPb(); }
9bcfd1ab 115 Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
3a72645a 116
117 // Get Components for configuration
118 AliHFEvarManager *GetVarManager() const { return fVarManager; }
bf892a6a 119 AliHFEpidQAmanager *GetPIDQAManager() const { return fPIDqa; }
3a72645a 120 AliHFEpid *GetPID() const { return fPID; }
76d0b522 121 AliHFENonPhotonicElectron *GetHFEBackgroundSubtraction() const { return fBackgroundSubtraction; }
3a72645a 122
722347d8 123 void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
3a72645a 124 void SetTaggedTrackCuts(AliHFEcuts * const cuts) { fTaggedTrackCuts = cuts; }
6555e2ad 125 void SetCleanTaggedTrack(Bool_t clean) { fCleanTaggedTrack = clean; };
e3ae862b 126 void SetVariablesTRDTaggedTrack(Bool_t variablesTRD) { fVariablesTRDTaggedTrack = variablesTRD; };
76d0b522 127 void SetHFECutsPreselect(AliESDtrackCuts * const cuts) { fCutspreselect = cuts; };
70da6c5a 128 void SetHFEElecBackGround(AliHFEelecbackground * const elecBackGround) { fElecBackGround = elecBackGround; };
76d0b522 129 void SetHFEBackgroundSubtraction(AliHFENonPhotonicElectron * const backgroundSubtraction) { fBackgroundSubtraction = backgroundSubtraction; };
75d81601 130 void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
9bcfd1ab 131 void SwitchOnPlugin(Int_t plug);
722347d8 132 void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
3a72645a 133 void SetFillSignalOnly(Bool_t signalOnly) { fFillSignalOnly = signalOnly; }
8c1c76e9 134
e156c3bb 135 void SetFillNoCuts(Bool_t fillNoCuts) { fFillNoCuts = fillNoCuts; }
a86a8fda 136 void SetApplyCutAOD(Bool_t applyCutAOD) { fApplyCutAOD = applyCutAOD; }
3a72645a 137 void SetRemovePileUp(Bool_t removePileUp) { fRemovePileUp = removePileUp; }
96167a04 138 void SetRemoveFirstEventInChunk() {fRemoveFirstEvent = kTRUE;}
e3fc062d 139 void SetPIDPreselect(AliHFEpid * const cuts) { fPIDpreselect = cuts; };
9bcfd1ab 140 void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
141 void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
96167a04 142 void SetCollisionSystem(ECollisionSystem_t system){
143 fCollisionSystem.Clear();
144 fCollisionSystem.SetBitNumber(system, kTRUE);
145 }
146 void SetppAnalysis(){
147 fCollisionSystem.SetBitNumber(kpPb, kFALSE);
148 fCollisionSystem.SetBitNumber(kPbPb, kFALSE);
149 fCollisionSystem.SetBitNumber(kpp, kTRUE);
150 }
151 void SetpPbAnalysis() {
152 fCollisionSystem.SetBitNumber(kpp, kFALSE);
153 fCollisionSystem.SetBitNumber(kPbPb, kFALSE);
154 fCollisionSystem.SetBitNumber(kpPb, kTRUE);
155 }
156 void SetPbPbAnalysis() {
157 fCollisionSystem.SetBitNumber(kpp, kFALSE);
158 fCollisionSystem.SetBitNumber(kpPb, kFALSE);
159 fCollisionSystem.SetBitNumber(kPbPb, kTRUE);
160 };
11ff28c5 161 void SetPbPbUserCentralityLimit(Bool_t isPbPbUserBinning = kFALSE){fPbPbUserCentralityBinning = isPbPbUserBinning; };
162 void SetPbPbUserCentralityArray(Int_t icentr, Float_t valuecentr) {fCentralityLimits[icentr] = valuecentr;};
8c1c76e9 163 void SetPPMultiBinAnalysis(Bool_t isppMultiBin) { fisppMultiBin = isppMultiBin; };
164 void SetNonHFEsystematics(Bool_t isSystematics) {fisNonHFEsystematics = isSystematics; };
fd6b8522 165 void SetRejectKinkMother(Bool_t rejectKinkMother = kFALSE) { fRejectKinkMother = rejectKinkMother; };
8c1c76e9 166 void SetBackGroundFactorsFunction(const TF1 * const backGroundFactorsFunction, Int_t centralitybin=0){
167 fkBackGroundFactorArray[centralitybin]=backGroundFactorsFunction;
168 fBackGroundFactorApply=kTRUE;
169 SetBit(kBackgroundInitialized);
170 };
8c1c76e9 171 void SetElecBackGroundFactors(Int_t iPt, Int_t iType, Int_t iCent, Int_t iError, Double_t elecBackGroundFactor) {fElecBackgroundFactor[iError][iCent][iType][iPt] = elecBackGroundFactor; };
fd6b8522 172 void SetBinLimits(Int_t iPt, Double_t momentum){fBinLimit[iPt] = momentum;};
50685501 173 void PrintStatus() const;
c2690925 174 Bool_t ReadCentrality();
3a72645a 175 void RejectionPileUpVertexRangeEventCut();
8c1c76e9 176 void SelectSpecialTrigger(const Char_t *trgclust, Int_t runMin = 0, Int_t runMax = 999999999);
a8ef1999 177 void SetDebugStreaming() {SetBit(kTreeStream);};
8c1c76e9 178
dbe3abbe 179 private:
50685501 180 enum{
9bcfd1ab 181 kHasMCdata = BIT(19),
c2690925 182 kAODanalysis = BIT(20),
96167a04 183 kBackgroundInitialized = BIT(21),
184 kTreeStream = BIT(22)
50685501 185 };
78ea5ef4 186
faee3b18 187 Bool_t FillProductionVertex(const AliVParticle * const track) const;
809a4336 188 void MakeParticleContainer();
70da6c5a 189 void MakeEventContainer();
8c1c76e9 190 void InitHistoITScluster();
96167a04 191 void InitContaminationQA();
8c1c76e9 192 const Char_t *GetSpecialTrigger(Int_t run);
9bcfd1ab 193 void ProcessMC();
194 void ProcessESD();
195 void ProcessAOD();
e156c3bb 196 Int_t GetITSMultiplicity(AliVEvent *ev);
e3fc062d 197 Bool_t PreSelectTrack(AliESDtrack *track) const;
9bcfd1ab 198 Bool_t ProcessMCtrack(AliVParticle *track);
3a72645a 199 Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track);
7ea7b2c4 200 AliAODMCHeader *fAODMCHeader; // ! MC info AOD
201 TClonesArray *fAODArrayMCInfo; // ! MC info particle AOD
75d81601 202 ULong_t fQAlevel; // QA level
9bcfd1ab 203 UShort_t fPlugins; // Enabled Plugins
96167a04 204 TBits fCollisionSystem; // Collision System;
3a72645a 205 Bool_t fFillSignalOnly; // Fill container only with MC Signal Tracks
e156c3bb 206 Bool_t fFillNoCuts; // Fill container before any cut
11ff28c5 207 Bool_t fApplyCutAOD; // Apply the analysis cut for AOD tracks
8c1c76e9 208 Bool_t fBackGroundFactorApply; // Apply Background Function Subtraction, MF: To be removed when transition to OADB container is finished
3a72645a 209 Bool_t fRemovePileUp; // Remove Pile Up
210 Bool_t fIdentifiedAsPileUp; // Identified as pile-up
211 Bool_t fIdentifiedAsOutInz; // Out Of Range in z
212 Bool_t fPassTheEventCut; // Pass The Event Cut
fd6b8522 213 Bool_t fRejectKinkMother; // Reject Kink Mother
8c1c76e9 214 Bool_t fisppMultiBin; // pp Multiplicity Bin analysis
11ff28c5 215 Bool_t fPbPbUserCentralityBinning; // PbPb user centrality binning
96167a04 216 Bool_t fRemoveFirstEvent; // Remove first event from chunk
11ff28c5 217 Bool_t fisNonHFEsystematics; // Non-HFE background systematics analysis
8c1c76e9 218 AliOADBContainer *fSpecialTrigger; // Special trigger selection
11ff28c5 219 Int_t fCentralityF; // Centrality bin
220 Float_t fCentralityPercent; // Centrality percentile
c2690925 221 Float_t fContributors; // Contributors
222 Double_t fWeightBackGround; // weight background function
223 Double_t fVz; // z position of the primary vertex
8c1c76e9 224 const TF1 *fkBackGroundFactorArray[12]; // Array of BackGround factors for each centrality bin, bin0 = min bias
225 Double_t fElecBackgroundFactor[kBgLevels][kCentBins][kElecBgSpecies][kBgPtBins]; // Electron background factors
fd6b8522 226 Double_t fBinLimit[kBgPtBins+1]; // Electron pt bin edges
11ff28c5 227 Float_t fCentralityLimits[12]; // Limits for centrality bins
3a72645a 228 AliHFEcontainer *fContainer; //! The HFE container
229 AliHFEvarManager *fVarManager; // The var manager as the backbone of the analysis
230 AliHFEsignalCuts *fSignalCuts; //! MC true signal (electron coming from certain source)
dbe3abbe 231 AliCFManager *fCFM; //! Correction Framework Manager
69ac0e6f 232 AliTriggerAnalysis *fTriggerAnalysis; //! Trigger Analysis for Normalisation
3a72645a 233 AliHFEpid *fPID; // PID
bf892a6a 234 AliHFEpidQAmanager *fPIDqa; // PID QA
e3fc062d 235 AliHFEpid *fPIDpreselect; // PID oject for pre-selected tracks (without QA)
722347d8 236 AliHFEcuts *fCuts; // Cut Collection
3a72645a 237 AliHFEcuts *fTaggedTrackCuts; // Cut Collection for V0 tagged tracks
6555e2ad 238 Bool_t fCleanTaggedTrack; // Loose cleaning of the V0 tagged tracks electron
e3ae862b 239 Bool_t fVariablesTRDTaggedTrack; // Take the variables at the TRD for the V0 tagged tracks electron
96167a04 240 AliAnalysisUtils *fAnalysisUtils; // Utility object to remove the first event of a chunk from the analysis
76d0b522 241 AliESDtrackCuts *fCutspreselect; // Cut Collection for pre-selected tracks
259c3296 242 AliHFEsecVtx *fSecVtx; //! Secondary Vertex Analysis
9bcfd1ab 243 AliHFEelecbackground *fElecBackGround;//! Background analysis
dbe3abbe 244 AliHFEmcQA *fMCQA; //! MC QA
3a72645a 245 AliHFEtaggedTrackAnalysis *fTaggedTrackAnalysis; //!Analyse V0-tagged tracks
8c1c76e9 246 AliHFEextraCuts *fExtraCuts; //! temporary implementation for IP QA
76d0b522 247 AliHFENonPhotonicElectron *fBackgroundSubtraction; // Background subtraction
3a72645a 248
249 //-----------QA and output---------------
dbe3abbe 250 TList *fQA; //! QA histos for the cuts
259c3296 251 TList *fOutput; //! Container for Task Output
252 TList *fHistMCQA; //! Output container for MC QA histograms
253 TList *fHistSECVTX; //! Output container for sec. vertexing results
9bcfd1ab 254 TList *fHistELECBACKGROUND; //! Output container for electron background analysis
69ac0e6f 255 AliHFEcollection *fQACollection; //! Tasks own QA collection
3a72645a 256 //---------------------------------------
809a4336 257
faee3b18 258 ClassDef(AliAnalysisTaskHFE, 2) // The electron Analysis Task
809a4336 259};
260#endif
dbe3abbe 261