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"
27 #ifndef ROOT_THnSparse
28 #include <THnSparse.h>
35 class AliHFEelecbackground;
36 class AliHFEcollection;
46 class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
55 kIsElecBackGround = 2,
58 enum CreationProcess_t{
65 AliAnalysisTaskHFE(const char * name);
66 AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
67 AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
68 virtual void Copy(TObject &o) const;
69 virtual ~AliAnalysisTaskHFE();
71 virtual void UserCreateOutputObjects();
72 virtual void UserExec(Option_t *);
73 virtual void Terminate(Option_t *);
75 virtual Bool_t IsEventInBinZero();
77 Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
78 Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
79 Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
80 Bool_t HasMCData() const { return TestBit(kHasMCdata); }
81 Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
82 void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
83 void SetHFEElecBackGround(AliHFEelecbackground * const elecBackGround) { fElecBackGround = elecBackGround; };
84 void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
85 void SwitchOnPlugin(Int_t plug);
86 void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
87 void SetPIDdetectors(Char_t * const detectors){ fPIDdetectors = detectors; }
88 void SetPIDStrategy(UInt_t strategy) { fPIDstrategy = strategy; }
89 void AddPIDdetector(TString detector);
90 void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
91 void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
92 void SetWeightFactors(TH3D * const weightFactors);
93 void SetWeightFactorsFunction(TF1 * const weightFactorsFunction);
94 void PrintStatus() const;
99 kAODanalysis = BIT(20)
101 class LabelContainer{
103 LabelContainer(Int_t capacity);
104 ~LabelContainer() {delete[] fContainer; };
106 Bool_t Append(Int_t label);
107 Bool_t Find(Int_t Label) const;
109 void ResetIterator(){ fCurrent = fBegin; }
112 LabelContainer(const LabelContainer &);
113 LabelContainer &operator=(const LabelContainer &);
114 Int_t *fContainer; // the Container for the labels
115 Int_t *fBegin; // Pointer to the first entry
116 Int_t *fEnd; // Pointer to the end of the container
117 Int_t *fLast; // Pointer to the last entry
118 Int_t *fCurrent; // Current entry to mimic an iterator
121 Bool_t IsGammaElectron(const AliVParticle * const track) const;
122 Int_t IsSignalElectron(const AliVParticle * const track) const;
123 Bool_t FillProductionVertex(const AliVParticle * const track) const;
124 Double_t FindWeight(Double_t pt, Double_t eta, Double_t phi) const;
125 void MakeParticleContainer();
126 void MakeEventContainer();
130 Bool_t ProcessMCtrack(AliVParticle *track);
131 Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track, Double_t *container, Bool_t signal, Bool_t alreadyseen,Double_t weight);
133 ULong_t fQAlevel; // QA level
134 TString fPIDdetectors; // Detectors for Particle Identification
135 UInt_t fPIDstrategy; // PID Strategy
136 Double_t fTPCBetheBlochParameters[5]; // TPC Bethe-Bloch Parameters
137 UShort_t fPlugins; // Enabled Plugins
138 Bool_t fWeighting; // Weighting or not for the efficiency maps
139 TH3D *fWeightFactors; // Weight factors
140 TF1 *fWeightFactorsFunction; // Weight factors
141 AliCFManager *fCFM; //! Correction Framework Manager
142 AliCFContainer * fHadronicBackground; //! Container for hadronic Background
143 TList *fCorrelation; //! response matrix for unfolding
144 THnSparseF *fPIDperformance; //! info on contamination and yield of electron spectra
145 THnSparseF *fSignalToBackgroundMC; //! Signal To Background Studies on pure MC information
146 AliHFEpid *fPID; //! PID
147 AliHFEcuts *fCuts; // Cut Collection
148 AliHFEsecVtx *fSecVtx; //! Secondary Vertex Analysis
149 AliHFEelecbackground *fElecBackGround;//! Background analysis
150 AliHFEmcQA *fMCQA; //! MC QA
151 TH1I *fNEvents; //! counter for the number of Events
152 TH1I *fNElectronTracksEvent; //! Number of Electron candidates after PID decision per Event
153 TList *fQA; //! QA histos for the cuts
154 TList *fOutput; //! Container for Task Output
155 TList *fHistMCQA; //! Output container for MC QA histograms
156 TList *fHistSECVTX; //! Output container for sec. vertexing results
157 TList *fHistELECBACKGROUND; //! Output container for electron background analysis
158 // AliHFEcollection *fQAcoll; //! collection class for basic QA histograms
160 ClassDef(AliAnalysisTaskHFE, 2) // The electron Analysis Task