]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/hfe/AliAnalysisTaskHFE.h
Patch for the correction framework
[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//
809a4336 20#ifndef ALIANALYSISTASKHFE_H
21#define ALIANALYSISTASKHFE_H
22
d2af20c5 23#ifndef ALIANALYSISTASKSE_H
24#include "AliAnalysisTaskSE.h"
dbe3abbe 25#endif
26
27#ifndef ROOT_THnSparse
28#include <THnSparse.h>
29#endif
809a4336 30
31class AliHFEpid;
32class AliHFEcuts;
259c3296 33class AliHFEmcQA;
34class AliHFEsecVtx;
9bcfd1ab 35class AliHFEelecbackground;
36class AliHFEcollection;
809a4336 37class AliCFManager;
9bcfd1ab 38class AliVEvent;
809a4336 39class AliMCEvent;
722347d8 40class AliVParticle;
69ac0e6f 41class AliTriggerAnalysis;
809a4336 42class TH1I;
43class TList;
faee3b18 44class TH3D;
45class TF1;
809a4336 46
d2af20c5 47class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
dbe3abbe 48 public:
9bcfd1ab 49 enum{
50 kPIDqa = 0,
51 kMCqa =1
52 };
53 enum{
54 kPriVtx = 0,
55 kSecVtx = 1,
56 kIsElecBackGround = 2,
57 kPostProcess = 3
58 };
faee3b18 59 enum CreationProcess_t{
60 kSignalCharm = 0,
61 kSignalBeauty = 1,
62 kGammaConv = 2,
63 kOther = 3
64 };
dbe3abbe 65 AliAnalysisTaskHFE();
0792aa82 66 AliAnalysisTaskHFE(const char * name);
dbe3abbe 67 AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
68 AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
faee3b18 69 virtual void Copy(TObject &o) const;
75d81601 70 virtual ~AliAnalysisTaskHFE();
809a4336 71
d2af20c5 72 virtual void UserCreateOutputObjects();
73 virtual void UserExec(Option_t *);
dbe3abbe 74 virtual void Terminate(Option_t *);
809a4336 75
faee3b18 76 virtual Bool_t IsEventInBinZero();
77
75d81601 78 Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
9bcfd1ab 79 Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
80 Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
722347d8 81 Bool_t HasMCData() const { return TestBit(kHasMCdata); }
9bcfd1ab 82 Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
722347d8 83 void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
e3fc062d 84 void SetHFECutsPreselect(AliHFEcuts * const cuts) { fCutspreselect = cuts; };
70da6c5a 85 void SetHFEElecBackGround(AliHFEelecbackground * const elecBackGround) { fElecBackGround = elecBackGround; };
75d81601 86 void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
9bcfd1ab 87 void SwitchOnPlugin(Int_t plug);
722347d8 88 void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
50685501 89 void SetPIDdetectors(Char_t * const detectors){ fPIDdetectors = detectors; }
0792aa82 90 void SetPIDStrategy(UInt_t strategy) { fPIDstrategy = strategy; }
e3fc062d 91 void SetPIDPreselect(AliHFEpid * const cuts) { fPIDpreselect = cuts; };
70da6c5a 92 void AddPIDdetector(TString detector);
9bcfd1ab 93 void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
94 void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
faee3b18 95 void SetWeightFactors(TH3D * const weightFactors);
96 void SetWeightFactorsFunction(TF1 * const weightFactorsFunction);
e3fc062d 97 void SetBackGroundFactorsFunction(TF1 * const backGroundFactorsFunction) { fBackGroundFactorsFunction = backGroundFactorsFunction; };
50685501 98 void PrintStatus() const;
dbe3abbe 99
dbe3abbe 100 private:
50685501 101 enum{
9bcfd1ab 102 kHasMCdata = BIT(19),
103 kAODanalysis = BIT(20)
50685501 104 };
78ea5ef4 105 class LabelContainer{
106 public:
107 LabelContainer(Int_t capacity);
108 ~LabelContainer() {delete[] fContainer; };
109
110 Bool_t Append(Int_t label);
50685501 111 Bool_t Find(Int_t Label) const;
78ea5ef4 112 Int_t Next();
113 void ResetIterator(){ fCurrent = fBegin; }
114
115 private:
116 LabelContainer(const LabelContainer &);
117 LabelContainer &operator=(const LabelContainer &);
118 Int_t *fContainer; // the Container for the labels
119 Int_t *fBegin; // Pointer to the first entry
120 Int_t *fEnd; // Pointer to the end of the container
121 Int_t *fLast; // Pointer to the last entry
122 Int_t *fCurrent; // Current entry to mimic an iterator
123 };
faee3b18 124
125 Bool_t IsGammaElectron(const AliVParticle * const track) const;
126 Int_t IsSignalElectron(const AliVParticle * const track) const;
127 Bool_t FillProductionVertex(const AliVParticle * const track) const;
128 Double_t FindWeight(Double_t pt, Double_t eta, Double_t phi) const;
809a4336 129 void MakeParticleContainer();
70da6c5a 130 void MakeEventContainer();
9bcfd1ab 131 void ProcessMC();
132 void ProcessESD();
133 void ProcessAOD();
e3fc062d 134 void FilterTaggedTrack(AliESDtrack *track, Int_t species);
135 Bool_t PreSelectTrack(AliESDtrack *track) const;
9bcfd1ab 136 Bool_t ProcessMCtrack(AliVParticle *track);
faee3b18 137 Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track, Double_t *container, Bool_t signal, Bool_t alreadyseen,Double_t weight);
75d81601 138
139 ULong_t fQAlevel; // QA level
140 TString fPIDdetectors; // Detectors for Particle Identification
0792aa82 141 UInt_t fPIDstrategy; // PID Strategy
70da6c5a 142 Double_t fTPCBetheBlochParameters[5]; // TPC Bethe-Bloch Parameters
9bcfd1ab 143 UShort_t fPlugins; // Enabled Plugins
faee3b18 144 Bool_t fWeighting; // Weighting or not for the efficiency maps
145 TH3D *fWeightFactors; // Weight factors
146 TF1 *fWeightFactorsFunction; // Weight factors
e3fc062d 147 TF1 *fBackGroundFactorsFunction; // BackGround factors
dbe3abbe 148 AliCFManager *fCFM; //! Correction Framework Manager
e3fc062d 149 AliCFManager *fV0CF; //! Correction Framework Manager for V0-tagged tracks
69ac0e6f 150 AliTriggerAnalysis *fTriggerAnalysis; //! Trigger Analysis for Normalisation
faee3b18 151 AliCFContainer * fHadronicBackground; //! Container for hadronic Background
78ea5ef4 152 TList *fCorrelation; //! response matrix for unfolding
153 THnSparseF *fPIDperformance; //! info on contamination and yield of electron spectra
9bcfd1ab 154 THnSparseF *fSignalToBackgroundMC; //! Signal To Background Studies on pure MC information
dbe3abbe 155 AliHFEpid *fPID; //! PID
e3fc062d 156 AliHFEpid *fPIDtagged; // PID oject for tagged tracks (identical clone without QA)
157 AliHFEpid *fPIDpreselect; // PID oject for pre-selected tracks (without QA)
722347d8 158 AliHFEcuts *fCuts; // Cut Collection
e3fc062d 159 AliHFEcuts *fCutsTagged; // Cut Collection for tagged tracks
160 AliHFEcuts *fCutspreselect; // Cut Collection for pre-selected tracks
259c3296 161 AliHFEsecVtx *fSecVtx; //! Secondary Vertex Analysis
9bcfd1ab 162 AliHFEelecbackground *fElecBackGround;//! Background analysis
dbe3abbe 163 AliHFEmcQA *fMCQA; //! MC QA
164 TH1I *fNEvents; //! counter for the number of Events
75d81601 165 TH1I *fNElectronTracksEvent; //! Number of Electron candidates after PID decision per Event
dbe3abbe 166 TList *fQA; //! QA histos for the cuts
259c3296 167 TList *fOutput; //! Container for Task Output
168 TList *fHistMCQA; //! Output container for MC QA histograms
169 TList *fHistSECVTX; //! Output container for sec. vertexing results
9bcfd1ab 170 TList *fHistELECBACKGROUND; //! Output container for electron background analysis
69ac0e6f 171 AliHFEcollection *fQACollection; //! Tasks own QA collection
809a4336 172
faee3b18 173 ClassDef(AliAnalysisTaskHFE, 2) // The electron Analysis Task
809a4336 174};
175#endif
dbe3abbe 176