1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // Task for Heavy Flavour Electron Analysis
17 // Fills a single-inclusive electron pt-spectrum
18 // For further information see implementation file
20 #ifndef ALIANALYSISTASKHFE_H
21 #define ALIANALYSISTASKHFE_H
23 #ifndef ALIANALYSISTASKSE_H
24 #include "AliAnalysisTaskSE.h"
31 class AliHFEcontainer;
32 class AliHFEcollection;
34 class AliHFEextraCuts;
35 class AliHFEelecbackground;
38 class AliHFEpidQAmanager;
40 class AliHFEsignalCuts;
41 class AliHFEvarManager;
42 class AliHFEtaggedTrackAnalysis;
45 class AliOADBContainer;
48 class AliTriggerAnalysis;
52 class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
61 kIsElecBackGround = 2,
64 kTaggedTrackAnalysis = 5
66 enum CreationProcess_t{
80 AliAnalysisTaskHFE(const char * name);
81 AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
82 AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
83 virtual void Copy(TObject &o) const;
84 virtual ~AliAnalysisTaskHFE();
86 virtual void UserCreateOutputObjects();
87 virtual void UserExec(Option_t *);
88 virtual void Terminate(Option_t *);
90 virtual Bool_t IsEventInBinZero();
92 Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
93 Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
94 Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
95 Bool_t HasMCData() const { return TestBit(kHasMCdata); }
96 Bool_t IsPbPb() const { return TestBit(kBeamType); }
97 Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
99 // Get Components for configuration
100 AliHFEvarManager *GetVarManager() const { return fVarManager; }
101 AliHFEpidQAmanager *GetPIDQAManager() const { return fPIDqa; }
102 AliHFEpid *GetPID() const { return fPID; }
104 void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
105 void SetTaggedTrackCuts(AliHFEcuts * const cuts) { fTaggedTrackCuts = cuts; }
106 void SetCleanTaggedTrack(Bool_t clean) { fCleanTaggedTrack = clean; };
107 void SetVariablesTRDTaggedTrack(Bool_t variablesTRD) { fVariablesTRDTaggedTrack = variablesTRD; };
108 void SetHFECutsPreselect(AliHFEcuts * const cuts) { fCutspreselect = cuts; };
109 void SetHFEElecBackGround(AliHFEelecbackground * const elecBackGround) { fElecBackGround = elecBackGround; };
110 void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
111 void SwitchOnPlugin(Int_t plug);
112 void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
113 void SetFillSignalOnly(Bool_t signalOnly) { fFillSignalOnly = signalOnly; }
115 void SetFillNoCuts(Bool_t fillNoCuts) { fFillNoCuts = fillNoCuts; }
116 void SetUseFlagAOD(Bool_t useFlagAOD) { fUseFlagAOD = useFlagAOD; }
117 void SetApplyCutAOD(Bool_t applyCutAOD) { fApplyCutAOD = applyCutAOD; }
118 void SetFlags(ULong_t flags) { fFlags = flags; }
119 void SetRemovePileUp(Bool_t removePileUp) { fRemovePileUp = removePileUp; }
120 void SetPIDPreselect(AliHFEpid * const cuts) { fPIDpreselect = cuts; };
121 void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
122 void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
123 void SetPbPbAnalysis(Bool_t isPbPb = kFALSE) { SetBit(kBeamType, isPbPb); };
124 void SetPbPbUserCentralityLimit(Bool_t isPbPbUserBinning = kFALSE){fPbPbUserCentralityBinning = isPbPbUserBinning; };
125 void SetPbPbUserCentralityArray(Int_t icentr, Float_t valuecentr) {fCentralityLimits[icentr] = valuecentr;};
126 void SetPPMultiBinAnalysis(Bool_t isppMultiBin) { fisppMultiBin = isppMultiBin; };
127 void SetNonHFEsystematics(Bool_t isSystematics) {fisNonHFEsystematics = isSystematics; };
128 void SetRejectKinkMother(Bool_t rejectKinkMother = kFALSE) { fRejectKinkMother = rejectKinkMother; };
129 void SetBackGroundFactorsFunction(const TF1 * const backGroundFactorsFunction, Int_t centralitybin=0){
130 fkBackGroundFactorArray[centralitybin]=backGroundFactorsFunction;
131 fBackGroundFactorApply=kTRUE;
132 SetBit(kBackgroundInitialized);
134 void SetBackgroundFactorsFromOADB(AliOADBContainer *cont) { fHadronBackgroundOADB = cont; fBackGroundFactorApply = kTRUE; }
135 void SetElecBackGroundFactors(Int_t iPt, Int_t iType, Int_t iCent, Int_t iError, Double_t elecBackGroundFactor) {fElecBackgroundFactor[iError][iCent][iType][iPt] = elecBackGroundFactor; };
136 void SetBinLimits(Int_t iPt, Double_t momentum){fBinLimit[iPt] = momentum;};
137 void PrintStatus() const;
138 Bool_t ReadCentrality();
139 void RejectionPileUpVertexRangeEventCut();
140 void SelectSpecialTrigger(const Char_t *trgclust, Int_t runMin = 0, Int_t runMax = 999999999);
141 void SetDebugStreaming() {SetBit(kTreeStream);};
145 kHasMCdata = BIT(19),
146 kAODanalysis = BIT(20),
148 kBackgroundInitialized = BIT(22),
149 kTreeStream = BIT(23)
152 Bool_t FillProductionVertex(const AliVParticle * const track) const;
153 void MakeParticleContainer();
154 void MakeEventContainer();
155 void InitPIDperformanceQA();
156 void InitContaminationQA();
157 void InitHistoITScluster();
158 Bool_t InitializeHadronBackground(Int_t run);
159 const Char_t *GetSpecialTrigger(Int_t run);
163 Int_t GetITSMultiplicity(AliVEvent *ev);
164 Bool_t PreSelectTrack(AliESDtrack *track) const;
165 Bool_t ProcessMCtrack(AliVParticle *track);
166 Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track);
167 ULong_t fQAlevel; // QA level
168 UShort_t fPlugins; // Enabled Plugins
169 Bool_t fFillSignalOnly; // Fill container only with MC Signal Tracks
170 Bool_t fFillNoCuts; // Fill container before any cut
171 Bool_t fUseFlagAOD; // Use the preselected AOD track
172 Bool_t fApplyCutAOD; // Apply the analysis cut for AOD tracks
173 ULong_t fFlags; // reconstruction AOD status flags
174 Bool_t fBackGroundFactorApply; // Apply Background Function Subtraction, MF: To be removed when transition to OADB container is finished
175 Bool_t fRemovePileUp; // Remove Pile Up
176 Bool_t fIdentifiedAsPileUp; // Identified as pile-up
177 Bool_t fIdentifiedAsOutInz; // Out Of Range in z
178 Bool_t fPassTheEventCut; // Pass The Event Cut
179 Bool_t fRejectKinkMother; // Reject Kink Mother
180 Bool_t fisppMultiBin; // pp Multiplicity Bin analysis
181 Bool_t fPbPbUserCentralityBinning; // PbPb user centrality binning
182 Bool_t fisNonHFEsystematics; // Non-HFE background systematics analysis
183 AliOADBContainer *fSpecialTrigger; // Special trigger selection
184 Int_t fCentralityF; // Centrality bin
185 Float_t fCentralityPercent; // Centrality percentile
186 Float_t fContributors; // Contributors
187 Double_t fWeightBackGround; // weight background function
188 Double_t fVz; // z position of the primary vertex
189 AliOADBContainer *fHadronBackgroundOADB; // OADB Container for hadron contamination
190 const TF1 *fkBackGroundFactorArray[12]; // Array of BackGround factors for each centrality bin, bin0 = min bias
191 Double_t fElecBackgroundFactor[kBgLevels][kCentBins][kElecBgSpecies][kBgPtBins]; // Electron background factors
192 Double_t fBinLimit[kBgPtBins+1]; // Electron pt bin edges
193 Float_t fCentralityLimits[12]; // Limits for centrality bins
194 AliHFEcontainer *fContainer; //! The HFE container
195 AliHFEvarManager *fVarManager; // The var manager as the backbone of the analysis
196 AliHFEsignalCuts *fSignalCuts; //! MC true signal (electron coming from certain source)
197 AliCFManager *fCFM; //! Correction Framework Manager
198 AliTriggerAnalysis *fTriggerAnalysis; //! Trigger Analysis for Normalisation
199 AliHFEpid *fPID; // PID
200 AliHFEpidQAmanager *fPIDqa; // PID QA
201 AliHFEpid *fPIDpreselect; // PID oject for pre-selected tracks (without QA)
202 AliHFEcuts *fCuts; // Cut Collection
203 AliHFEcuts *fTaggedTrackCuts; // Cut Collection for V0 tagged tracks
204 Bool_t fCleanTaggedTrack; // Loose cleaning of the V0 tagged tracks electron
205 Bool_t fVariablesTRDTaggedTrack; // Take the variables at the TRD for the V0 tagged tracks electron
206 AliHFEcuts *fCutspreselect; // Cut Collection for pre-selected tracks
207 AliHFEsecVtx *fSecVtx; //! Secondary Vertex Analysis
208 AliHFEelecbackground *fElecBackGround;//! Background analysis
209 AliHFEmcQA *fMCQA; //! MC QA
210 AliHFEtaggedTrackAnalysis *fTaggedTrackAnalysis; //!Analyse V0-tagged tracks
211 AliHFEextraCuts *fExtraCuts; //! temporary implementation for IP QA
213 //-----------QA and output---------------
214 TList *fQA; //! QA histos for the cuts
215 TList *fOutput; //! Container for Task Output
216 TList *fHistMCQA; //! Output container for MC QA histograms
217 TList *fHistSECVTX; //! Output container for sec. vertexing results
218 TList *fHistELECBACKGROUND; //! Output container for electron background analysis
219 AliHFEcollection *fQACollection; //! Tasks own QA collection
220 //---------------------------------------
222 ClassDef(AliAnalysisTaskHFE, 2) // The electron Analysis Task