]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliAnalysisTaskHFE.h
Commit modifications done to take care of the problems
[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 class AliHFEcontainer;
28 class AliHFEcollection;
29 class AliHFEcuts;
30 class AliHFEelecbackground;
31 class AliHFEmcQA;
32 class AliHFEpid;
33 class AliHFEpidQAmanager;
34 class AliHFEsecVtx;
35 class AliHFEsignalCuts;
36 class AliHFEvarManager;
37 class AliHFEtaggedTrackAnalysis;
38 class AliCFManager;
39 class AliVEvent;
40 class AliMCEvent;
41 class AliVParticle;
42 class AliTriggerAnalysis;
43 class TH1I; 
44 class TList;
45
46 class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
47   public:
48     enum{
49       kPIDqa = 0,
50       kMCqa =1 
51     };
52     enum{
53       kPriVtx = 0,
54       kSecVtx = 1,
55       kIsElecBackGround = 2,
56       kPostProcess = 3,
57       kDEstep = 4,
58       kTaggedTrackAnalysis = 5
59     };
60     enum CreationProcess_t{
61       kSignalCharm = 0,
62       kSignalBeauty = 1,
63       kGammaConv = 2,
64       kOther = 3
65     };
66     AliAnalysisTaskHFE();
67     AliAnalysisTaskHFE(const char * name);
68     AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
69     AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
70     virtual void Copy(TObject &o) const;
71     virtual ~AliAnalysisTaskHFE();
72
73     virtual void UserCreateOutputObjects();
74     virtual void UserExec(Option_t *);
75     virtual void Terminate(Option_t *);
76
77     virtual Bool_t IsEventInBinZero();
78
79     Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
80     Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
81     Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
82     Bool_t HasMCData() const { return TestBit(kHasMCdata); }
83     Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
84
85     // Get Components for configuration
86     AliHFEvarManager *GetVarManager() const { return fVarManager; }
87     AliHFEpidQAmanager *GetPIDQAManager() const { return fPIDqa; }
88     AliHFEpid *GetPID() const { return fPID; }
89
90     void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
91     void SetTaggedTrackCuts(AliHFEcuts * const cuts) { fTaggedTrackCuts = cuts; }
92     void SetCleanTaggedTrack(Bool_t clean) { fCleanTaggedTrack = clean; };
93     void SetHFECutsPreselect(AliHFEcuts * const cuts) { fCutspreselect = cuts; };
94     void SetHFEElecBackGround(AliHFEelecbackground * const elecBackGround) { fElecBackGround = elecBackGround; };
95     void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
96     void SwitchOnPlugin(Int_t plug);
97     void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
98     void SetFillSignalOnly(Bool_t signalOnly) { fFillSignalOnly = signalOnly; }
99     void SetRemovePileUp(Bool_t removePileUp) { fRemovePileUp = removePileUp; }
100     void SetPIDPreselect(AliHFEpid * const cuts) { fPIDpreselect = cuts; };
101     void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
102     void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
103     void SetBackGroundFactorsFunction(TF1 * const backGroundFactorsFunction) { fBackGroundFactorsFunction = backGroundFactorsFunction; };
104     void PrintStatus() const;
105     void ReadCentrality();
106     void RejectionPileUpVertexRangeEventCut();  
107  
108   private:
109     enum{
110       kHasMCdata = BIT(19),
111       kAODanalysis = BIT(20)
112     };
113
114     Bool_t FillProductionVertex(const AliVParticle * const track) const;
115     void MakeParticleContainer();
116     void MakeEventContainer();
117     void InitPIDperformanceQA();
118     void InitContaminationQA();
119     void ProcessMC();
120     void ProcessESD();
121     void ProcessAOD();
122     Bool_t PreSelectTrack(AliESDtrack *track) const;
123     Bool_t ProcessMCtrack(AliVParticle *track);
124     Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track);
125     ULong_t fQAlevel;                     // QA level
126     UShort_t fPlugins;                    // Enabled Plugins
127     Bool_t fFillSignalOnly;               // Fill container only with MC Signal Tracks
128     Bool_t fRemovePileUp;                 // Remove Pile Up
129     Bool_t fIdentifiedAsPileUp;           // Identified as pile-up
130     Bool_t fIdentifiedAsOutInz;           // Out Of Range in z
131     Bool_t fPassTheEventCut;              // Pass The Event Cut
132     Float_t fCentralityF;                 // Centrality
133     TF1  *fBackGroundFactorsFunction;     // BackGround factors
134     AliHFEcontainer *fContainer;          //! The HFE container
135     AliHFEvarManager *fVarManager;        // The var manager as the backbone of the analysis
136     AliHFEsignalCuts *fSignalCuts;        //! MC true signal (electron coming from certain source) 
137     AliCFManager *fCFM;                   //! Correction Framework Manager
138     AliTriggerAnalysis *fTriggerAnalysis; //! Trigger Analysis for Normalisation
139     AliHFEpid *fPID;                      // PID
140     AliHFEpidQAmanager *fPIDqa;           // PID QA
141     AliHFEpid *fPIDpreselect;             // PID oject for pre-selected tracks (without QA)
142     AliHFEcuts *fCuts;                    // Cut Collection
143     AliHFEcuts *fTaggedTrackCuts;         // Cut Collection for V0 tagged tracks
144     Bool_t fCleanTaggedTrack;             // Loose cleaning of the V0 tagged tracks electron
145     AliHFEcuts *fCutspreselect;           // Cut Collection for pre-selected tracks
146     AliHFEsecVtx *fSecVtx;                //! Secondary Vertex Analysis
147     AliHFEelecbackground *fElecBackGround;//! Background analysis
148     AliHFEmcQA *fMCQA;                    //! MC QA
149     AliHFEtaggedTrackAnalysis *fTaggedTrackAnalysis;     //!Analyse V0-tagged tracks
150
151     //-----------QA and output---------------
152     TList *fQA;                           //! QA histos for the cuts
153     TList *fOutput;                       //! Container for Task Output
154     TList *fHistMCQA;                     //! Output container for MC QA histograms 
155     TList *fHistSECVTX;                   //! Output container for sec. vertexing results
156     TList *fHistELECBACKGROUND;           //! Output container for electron background analysis
157     AliHFEcollection *fQACollection;      //! Tasks own QA collection
158     //---------------------------------------
159
160     ClassDef(AliAnalysisTaskHFE, 2)       // The electron Analysis Task
161 };
162 #endif
163