]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/hfe/AliAnalysisTaskHFE.h
Update of the hfe package
[u/mrichter/AliRoot.git] / PWG3 / 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
3a72645a 31class AliHFEcontainer;
32class AliHFEcollection;
809a4336 33class AliHFEcuts;
8c1c76e9 34class AliHFEextraCuts;
3a72645a 35class AliHFEelecbackground;
259c3296 36class AliHFEmcQA;
3a72645a 37class AliHFEpid;
38class AliHFEpidQAmanager;
259c3296 39class AliHFEsecVtx;
3a72645a 40class AliHFEsignalCuts;
41class AliHFEvarManager;
42class AliHFEtaggedTrackAnalysis;
809a4336 43class AliCFManager;
809a4336 44class AliMCEvent;
8c1c76e9 45class AliOADBContainer;
46class AliVEvent;
722347d8 47class AliVParticle;
69ac0e6f 48class AliTriggerAnalysis;
809a4336 49class TH1I;
50class TList;
8c1c76e9 51class TTreeSRedirector;
809a4336 52
d2af20c5 53class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
dbe3abbe 54 public:
9bcfd1ab 55 enum{
56 kPIDqa = 0,
57 kMCqa =1
58 };
59 enum{
60 kPriVtx = 0,
61 kSecVtx = 1,
62 kIsElecBackGround = 2,
3a72645a 63 kPostProcess = 3,
64 kDEstep = 4,
65 kTaggedTrackAnalysis = 5
9bcfd1ab 66 };
faee3b18 67 enum CreationProcess_t{
68 kSignalCharm = 0,
69 kSignalBeauty = 1,
70 kGammaConv = 2,
71 kOther = 3
72 };
fd6b8522 73 enum{
74 kBgPtBins = 44,
8c1c76e9 75 kElecBgSpecies = 6,
76 kCentBins = 11,
77 kBgLevels = 3
fd6b8522 78 };
79
dbe3abbe 80 AliAnalysisTaskHFE();
0792aa82 81 AliAnalysisTaskHFE(const char * name);
dbe3abbe 82 AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
83 AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
faee3b18 84 virtual void Copy(TObject &o) const;
75d81601 85 virtual ~AliAnalysisTaskHFE();
809a4336 86
d2af20c5 87 virtual void UserCreateOutputObjects();
88 virtual void UserExec(Option_t *);
dbe3abbe 89 virtual void Terminate(Option_t *);
809a4336 90
faee3b18 91 virtual Bool_t IsEventInBinZero();
92
75d81601 93 Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
9bcfd1ab 94 Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
95 Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
722347d8 96 Bool_t HasMCData() const { return TestBit(kHasMCdata); }
c2690925 97 Bool_t IsPbPb() const { return TestBit(kBeamType); }
9bcfd1ab 98 Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
3a72645a 99
100 // Get Components for configuration
101 AliHFEvarManager *GetVarManager() const { return fVarManager; }
bf892a6a 102 AliHFEpidQAmanager *GetPIDQAManager() const { return fPIDqa; }
3a72645a 103 AliHFEpid *GetPID() const { return fPID; }
104
722347d8 105 void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
3a72645a 106 void SetTaggedTrackCuts(AliHFEcuts * const cuts) { fTaggedTrackCuts = cuts; }
6555e2ad 107 void SetCleanTaggedTrack(Bool_t clean) { fCleanTaggedTrack = clean; };
e3ae862b 108 void SetVariablesTRDTaggedTrack(Bool_t variablesTRD) { fVariablesTRDTaggedTrack = variablesTRD; };
e3fc062d 109 void SetHFECutsPreselect(AliHFEcuts * const cuts) { fCutspreselect = cuts; };
70da6c5a 110 void SetHFEElecBackGround(AliHFEelecbackground * const elecBackGround) { fElecBackGround = elecBackGround; };
75d81601 111 void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
9bcfd1ab 112 void SwitchOnPlugin(Int_t plug);
722347d8 113 void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
3a72645a 114 void SetFillSignalOnly(Bool_t signalOnly) { fFillSignalOnly = signalOnly; }
8c1c76e9 115
e156c3bb 116 void SetFillNoCuts(Bool_t fillNoCuts) { fFillNoCuts = fillNoCuts; }
3a72645a 117 void SetRemovePileUp(Bool_t removePileUp) { fRemovePileUp = removePileUp; }
e3fc062d 118 void SetPIDPreselect(AliHFEpid * const cuts) { fPIDpreselect = cuts; };
9bcfd1ab 119 void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
120 void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
c2690925 121 void SetPbPbAnalysis(Bool_t isPbPb = kFALSE) { SetBit(kBeamType, isPbPb); };
8c1c76e9 122 void SetPPMultiBinAnalysis(Bool_t isppMultiBin) { fisppMultiBin = isppMultiBin; };
123 void SetNonHFEsystematics(Bool_t isSystematics) {fisNonHFEsystematics = isSystematics; };
fd6b8522 124 void SetRejectKinkMother(Bool_t rejectKinkMother = kFALSE) { fRejectKinkMother = rejectKinkMother; };
8c1c76e9 125 void SetBackGroundFactorsFunction(const TF1 * const backGroundFactorsFunction, Int_t centralitybin=0){
126 fkBackGroundFactorArray[centralitybin]=backGroundFactorsFunction;
127 fBackGroundFactorApply=kTRUE;
128 SetBit(kBackgroundInitialized);
129 };
130 void SetDebugStreaming(UChar_t debugLevel = 1) { fDebugLevel = debugLevel; }
131 void SetBackgroundFactorsFromOADB(AliOADBContainer *cont) { fHadronBackgroundOADB = cont; fBackGroundFactorApply = kTRUE; }
132 void SetElecBackGroundFactors(Int_t iPt, Int_t iType, Int_t iCent, Int_t iError, Double_t elecBackGroundFactor) {fElecBackgroundFactor[iError][iCent][iType][iPt] = elecBackGroundFactor; };
fd6b8522 133 void SetBinLimits(Int_t iPt, Double_t momentum){fBinLimit[iPt] = momentum;};
50685501 134 void PrintStatus() const;
c2690925 135 Bool_t ReadCentrality();
3a72645a 136 void RejectionPileUpVertexRangeEventCut();
8c1c76e9 137 void SelectSpecialTrigger(const Char_t *trgclust, Int_t runMin = 0, Int_t runMax = 999999999);
138
dbe3abbe 139 private:
50685501 140 enum{
9bcfd1ab 141 kHasMCdata = BIT(19),
c2690925 142 kAODanalysis = BIT(20),
8c1c76e9 143 kBeamType = BIT(21),
144 kBackgroundInitialized = BIT(22)
50685501 145 };
78ea5ef4 146
faee3b18 147 Bool_t FillProductionVertex(const AliVParticle * const track) const;
809a4336 148 void MakeParticleContainer();
70da6c5a 149 void MakeEventContainer();
3a72645a 150 void InitPIDperformanceQA();
6555e2ad 151 void InitContaminationQA();
8c1c76e9 152 void InitHistoITScluster();
153 Bool_t InitializeHadronBackground(Int_t run);
154 const Char_t *GetSpecialTrigger(Int_t run);
9bcfd1ab 155 void ProcessMC();
156 void ProcessESD();
157 void ProcessAOD();
e156c3bb 158 Int_t GetITSMultiplicity(AliVEvent *ev);
e3fc062d 159 Bool_t PreSelectTrack(AliESDtrack *track) const;
9bcfd1ab 160 Bool_t ProcessMCtrack(AliVParticle *track);
3a72645a 161 Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track);
75d81601 162 ULong_t fQAlevel; // QA level
9bcfd1ab 163 UShort_t fPlugins; // Enabled Plugins
3a72645a 164 Bool_t fFillSignalOnly; // Fill container only with MC Signal Tracks
e156c3bb 165 Bool_t fFillNoCuts; // Fill container before any cut
8c1c76e9 166 Bool_t fBackGroundFactorApply; // Apply Background Function Subtraction, MF: To be removed when transition to OADB container is finished
3a72645a 167 Bool_t fRemovePileUp; // Remove Pile Up
168 Bool_t fIdentifiedAsPileUp; // Identified as pile-up
169 Bool_t fIdentifiedAsOutInz; // Out Of Range in z
170 Bool_t fPassTheEventCut; // Pass The Event Cut
fd6b8522 171 Bool_t fRejectKinkMother; // Reject Kink Mother
8c1c76e9 172 Bool_t fisppMultiBin; // pp Multiplicity Bin analysis
173 Bool_t fisNonHFEsystematics; // Non-HFE background systematics analysis
174 AliOADBContainer *fSpecialTrigger; // Special trigger selection
e156c3bb 175 Int_t fCentralityF; // Centrality
c2690925 176 Float_t fContributors; // Contributors
177 Double_t fWeightBackGround; // weight background function
178 Double_t fVz; // z position of the primary vertex
8c1c76e9 179 AliOADBContainer *fHadronBackgroundOADB; // OADB Container for hadron contamination
180 const TF1 *fkBackGroundFactorArray[12]; // Array of BackGround factors for each centrality bin, bin0 = min bias
181 Double_t fElecBackgroundFactor[kBgLevels][kCentBins][kElecBgSpecies][kBgPtBins]; // Electron background factors
fd6b8522 182 Double_t fBinLimit[kBgPtBins+1]; // Electron pt bin edges
3a72645a 183 AliHFEcontainer *fContainer; //! The HFE container
184 AliHFEvarManager *fVarManager; // The var manager as the backbone of the analysis
185 AliHFEsignalCuts *fSignalCuts; //! MC true signal (electron coming from certain source)
dbe3abbe 186 AliCFManager *fCFM; //! Correction Framework Manager
69ac0e6f 187 AliTriggerAnalysis *fTriggerAnalysis; //! Trigger Analysis for Normalisation
3a72645a 188 AliHFEpid *fPID; // PID
bf892a6a 189 AliHFEpidQAmanager *fPIDqa; // PID QA
e3fc062d 190 AliHFEpid *fPIDpreselect; // PID oject for pre-selected tracks (without QA)
722347d8 191 AliHFEcuts *fCuts; // Cut Collection
3a72645a 192 AliHFEcuts *fTaggedTrackCuts; // Cut Collection for V0 tagged tracks
6555e2ad 193 Bool_t fCleanTaggedTrack; // Loose cleaning of the V0 tagged tracks electron
e3ae862b 194 Bool_t fVariablesTRDTaggedTrack; // Take the variables at the TRD for the V0 tagged tracks electron
e3fc062d 195 AliHFEcuts *fCutspreselect; // Cut Collection for pre-selected tracks
259c3296 196 AliHFEsecVtx *fSecVtx; //! Secondary Vertex Analysis
9bcfd1ab 197 AliHFEelecbackground *fElecBackGround;//! Background analysis
dbe3abbe 198 AliHFEmcQA *fMCQA; //! MC QA
3a72645a 199 AliHFEtaggedTrackAnalysis *fTaggedTrackAnalysis; //!Analyse V0-tagged tracks
8c1c76e9 200 AliHFEextraCuts *fExtraCuts; //! temporary implementation for IP QA
3a72645a 201
202 //-----------QA and output---------------
dbe3abbe 203 TList *fQA; //! QA histos for the cuts
259c3296 204 TList *fOutput; //! Container for Task Output
205 TList *fHistMCQA; //! Output container for MC QA histograms
206 TList *fHistSECVTX; //! Output container for sec. vertexing results
9bcfd1ab 207 TList *fHistELECBACKGROUND; //! Output container for electron background analysis
69ac0e6f 208 AliHFEcollection *fQACollection; //! Tasks own QA collection
3a72645a 209 //---------------------------------------
809a4336 210
8c1c76e9 211 // Debug streaming
212 UChar_t fDebugLevel; // Debug level
213 TTreeSRedirector *fTreeStream; //! TreeStream
214
faee3b18 215 ClassDef(AliAnalysisTaskHFE, 2) // The electron Analysis Task
809a4336 216};
217#endif
dbe3abbe 218