]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliAnalysisTaskHFE.h
207410e17b491aacd6276e8bad8e76e5024b3b43
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliAnalysisTaskHFE.h
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 **************************************************************************/
15 //
16 // Task for Heavy Flavour Electron Analysis
17 // Fills a single-inclusive electron pt-spectrum
18 // For further information see implementation file
19 //
20 #ifndef ALIANALYSISTASKHFE_H
21 #define ALIANALYSISTASKHFE_H
22
23 #ifndef ALIANALYSISTASKSE_H
24 #include "AliAnalysisTaskSE.h"
25 #endif
26
27 #ifndef ROOT_THnSparse
28 #include <THnSparse.h>
29 #endif
30
31 class AliHFEpid;
32 class AliHFEcuts;
33 class AliHFEmcQA;
34 class AliHFEsecVtx;
35 class AliHFEelecbackground;
36 class AliHFEcollection;
37 class AliCFManager;
38 class AliVEvent;
39 class AliMCEvent;
40 class AliVParticle;
41 class TH1I; 
42 class TList;
43
44 class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
45   public:
46     enum{
47       kPIDqa = 0,
48       kMCqa =1 
49     };
50     enum{
51       kPriVtx = 0,
52       kSecVtx = 1,
53       kIsElecBackGround = 2,
54       kPostProcess = 3
55     };
56     AliAnalysisTaskHFE();
57     AliAnalysisTaskHFE(const char * name);
58     AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
59     AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
60     virtual ~AliAnalysisTaskHFE();
61
62     virtual void UserCreateOutputObjects();
63     virtual void UserExec(Option_t *);
64     virtual void Terminate(Option_t *);
65
66     Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
67     Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
68     Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
69     Bool_t HasMCData() const { return TestBit(kHasMCdata); }
70     Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
71     Int_t IsSignalElectron(AliVParticle *fTrack) const;
72     void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
73     void SetHFEElecBackGround(AliHFEelecbackground * const elecBackGround) { fElecBackGround = elecBackGround; };
74     void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
75     void SwitchOnPlugin(Int_t plug);
76     void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
77     void SetPIDdetectors(Char_t * const detectors){ fPIDdetectors = detectors; }
78     void SetPIDStrategy(UInt_t strategy) { fPIDstrategy = strategy; }
79     void AddPIDdetector(TString detector);
80     void SetTPCBetheBlochParameters(Double_t *pars);
81     void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
82     void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
83     void PrintStatus() const;
84  
85   private:
86     enum{
87       kHasMCdata = BIT(19),
88       kAODanalysis = BIT(20)
89     };
90     class LabelContainer{
91       public:
92         LabelContainer(Int_t capacity);
93         ~LabelContainer() {delete[] fContainer; };
94
95         Bool_t Append(Int_t label);
96         Bool_t Find(Int_t Label) const;
97         Int_t Next();
98         void ResetIterator(){ fCurrent = fBegin; }
99
100       private:
101         LabelContainer(const LabelContainer &);
102         LabelContainer &operator=(const LabelContainer &);
103         Int_t *fContainer;    // the Container for the labels
104         Int_t *fBegin;        // Pointer to the first entry
105         Int_t *fEnd;          // Pointer to the end of the container
106         Int_t *fLast;         // Pointer to the last entry
107         Int_t *fCurrent;      // Current entry to mimic an iterator
108     };
109     void MakeParticleContainer();
110     void MakeEventContainer();
111     void ProcessMC();
112     void ProcessESD();
113     void ProcessAOD();
114     Bool_t ProcessMCtrack(AliVParticle *track);
115     Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track, Double_t *container, Bool_t signal, Bool_t alreadyseen);
116     
117     ULong_t fQAlevel;                     // QA level
118     TString fPIDdetectors;                // Detectors for Particle Identification
119     UInt_t fPIDstrategy;                  // PID Strategy
120     Double_t fTPCBetheBlochParameters[5]; // TPC Bethe-Bloch Parameters
121     UShort_t fPlugins;                    // Enabled Plugins
122     AliCFManager *fCFM;                   //! Correction Framework Manager
123     TList *fCorrelation;                  //! response matrix for unfolding  
124     THnSparseF *fPIDperformance;          //! info on contamination and yield of electron spectra
125     THnSparseF *fSignalToBackgroundMC;    //! Signal To Background Studies on pure MC information
126     AliHFEpid *fPID;                      //! PID
127     AliHFEcuts *fCuts;                    // Cut Collection
128     AliHFEsecVtx *fSecVtx;                //! Secondary Vertex Analysis
129     AliHFEelecbackground *fElecBackGround;//! Background analysis
130     AliHFEmcQA *fMCQA;                    //! MC QA
131     TH1I *fNEvents;                       //! counter for the number of Events
132     TH1I *fNElectronTracksEvent;          //! Number of Electron candidates after PID decision per Event
133     TList *fQA;                           //! QA histos for the cuts
134     TList *fOutput;                       //! Container for Task Output
135     TList *fHistMCQA;                     //! Output container for MC QA histograms 
136     TList *fHistSECVTX;                   //! Output container for sec. vertexing results
137     TList *fHistELECBACKGROUND;           //! Output container for electron background analysis
138 //    AliHFEcollection *fQAcoll;            //! collection class for basic QA histograms
139
140     ClassDef(AliAnalysisTaskHFE, 1)       // The electron Analysis Task
141 };
142 #endif
143