]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliAnalysisTaskHFE.h
Added pass1 and pass2 directories
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliAnalysisTaskHFE.h
1 #ifndef ALIANALYSISTASKHFE_H
2 #define ALIANALYSISTASKHFE_H
3
4 /**************************************************************************
5 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 *                                                                        *
7 * Author: The ALICE Off-line Project.                                    *
8 * Contributors are mentioned in the code where appropriate.              *
9 *                                                                        *
10 * Permission to use, copy, modify and distribute this software and its   *
11 * documentation strictly for non-commercial purposes is hereby granted   *
12 * without fee, provided that the above copyright notice appears in all   *
13 * copies and that both the copyright notice and this permission notice   *
14 * appear in the supporting documentation. The authors make no claims     *
15 * about the suitability of this software for any purpose. It is          *
16 * provided "as is" without express or implied warranty.                  *
17 **************************************************************************/
18
19 /* $Id$ */ 
20
21 //
22 // Task for Heavy Flavour Electron Analysis
23 // Fills a single-inclusive electron pt-spectrum
24 // For further information see implementation file
25 //
26 #ifndef ALIANALYSISTASKSE_H
27 #include "AliAnalysisTaskSE.h"
28 #endif
29
30 class AliHFEcontainer;
31 class AliHFEcollection;
32 class AliHFEcuts;
33 class AliHFEelecbackground;
34 class AliHFEmcQA;
35 class AliHFEpid;
36 class AliHFEpidQAmanager;
37 class AliHFEsecVtx;
38 class AliHFEsignalCuts;
39 class AliHFEvarManager;
40 class AliHFEtaggedTrackAnalysis;
41 class AliCFManager;
42 class AliVEvent;
43 class AliMCEvent;
44 class AliVParticle;
45 class AliTriggerAnalysis;
46 class TH1I; 
47 class TList;
48
49 class AliAnalysisTaskHFE : public AliAnalysisTaskSE{
50   public:
51     enum{
52       kPIDqa = 0,
53       kMCqa =1 
54     };
55     enum{
56       kPriVtx = 0,
57       kSecVtx = 1,
58       kIsElecBackGround = 2,
59       kPostProcess = 3,
60       kDEstep = 4,
61       kTaggedTrackAnalysis = 5
62     };
63     enum CreationProcess_t{
64       kSignalCharm = 0,
65       kSignalBeauty = 1,
66       kGammaConv = 2,
67       kOther = 3
68     };
69     AliAnalysisTaskHFE();
70     AliAnalysisTaskHFE(const char * name);
71     AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
72     AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
73     virtual void Copy(TObject &o) const;
74     virtual ~AliAnalysisTaskHFE();
75
76     virtual void UserCreateOutputObjects();
77     virtual void UserExec(Option_t *);
78     virtual void Terminate(Option_t *);
79
80     virtual Bool_t IsEventInBinZero();
81
82     Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
83     Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
84     Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
85     Bool_t HasMCData() const { return TestBit(kHasMCdata); }
86     Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
87
88     // Get Components for configuration
89     AliHFEvarManager *GetVarManager() const { return fVarManager; }
90     AliHFEpidQAmanager *GetPIDQAManager() const { return fPIDqa; }
91     AliHFEpid *GetPID() const { return fPID; }
92
93     void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
94     void SetTaggedTrackCuts(AliHFEcuts * const cuts) { fTaggedTrackCuts = cuts; }
95     void SetCleanTaggedTrack(Bool_t clean) { fCleanTaggedTrack = clean; };
96     void SetVariablesTRDTaggedTrack(Bool_t variablesTRD) { fVariablesTRDTaggedTrack = variablesTRD; };
97     void SetHFECutsPreselect(AliHFEcuts * const cuts) { fCutspreselect = cuts; };
98     void SetHFEElecBackGround(AliHFEelecbackground * const elecBackGround) { fElecBackGround = elecBackGround; };
99     void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
100     void SwitchOnPlugin(Int_t plug);
101     void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
102     void SetFillSignalOnly(Bool_t signalOnly) { fFillSignalOnly = signalOnly; }
103     void SetRemovePileUp(Bool_t removePileUp) { fRemovePileUp = removePileUp; }
104     void SetPIDPreselect(AliHFEpid * const cuts) { fPIDpreselect = cuts; };
105     void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
106     void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
107     void SetBackGroundFactorsFunction(TF1 * const backGroundFactorsFunction) { fBackGroundFactorsFunction = backGroundFactorsFunction; };
108     void PrintStatus() const;
109     void ReadCentrality();
110     void RejectionPileUpVertexRangeEventCut();  
111  
112   private:
113     enum{
114       kHasMCdata = BIT(19),
115       kAODanalysis = BIT(20)
116     };
117
118     Bool_t FillProductionVertex(const AliVParticle * const track) const;
119     void MakeParticleContainer();
120     void MakeEventContainer();
121     void InitPIDperformanceQA();
122     void InitContaminationQA();
123     void ProcessMC();
124     void ProcessESD();
125     void ProcessAOD();
126     Bool_t PreSelectTrack(AliESDtrack *track) const;
127     Bool_t ProcessMCtrack(AliVParticle *track);
128     Bool_t ProcessCutStep(Int_t cutStep, AliVParticle *track);
129     ULong_t fQAlevel;                     // QA level
130     UShort_t fPlugins;                    // Enabled Plugins
131     Bool_t fFillSignalOnly;               // Fill container only with MC Signal Tracks
132     Bool_t fRemovePileUp;                 // Remove Pile Up
133     Bool_t fIdentifiedAsPileUp;           // Identified as pile-up
134     Bool_t fIdentifiedAsOutInz;           // Out Of Range in z
135     Bool_t fPassTheEventCut;              // Pass The Event Cut
136     Float_t fCentralityF;                 // Centrality
137     TF1  *fBackGroundFactorsFunction;     // BackGround factors
138     AliHFEcontainer *fContainer;          //! The HFE container
139     AliHFEvarManager *fVarManager;        // The var manager as the backbone of the analysis
140     AliHFEsignalCuts *fSignalCuts;        //! MC true signal (electron coming from certain source) 
141     AliCFManager *fCFM;                   //! Correction Framework Manager
142     AliTriggerAnalysis *fTriggerAnalysis; //! Trigger Analysis for Normalisation
143     AliHFEpid *fPID;                      // PID
144     AliHFEpidQAmanager *fPIDqa;           // PID QA
145     AliHFEpid *fPIDpreselect;             // PID oject for pre-selected tracks (without QA)
146     AliHFEcuts *fCuts;                    // Cut Collection
147     AliHFEcuts *fTaggedTrackCuts;         // Cut Collection for V0 tagged tracks
148     Bool_t fCleanTaggedTrack;             // Loose cleaning of the V0 tagged tracks electron
149     Bool_t fVariablesTRDTaggedTrack;      // Take the variables at the TRD for the V0 tagged tracks electron
150     AliHFEcuts *fCutspreselect;           // Cut Collection for pre-selected tracks
151     AliHFEsecVtx *fSecVtx;                //! Secondary Vertex Analysis
152     AliHFEelecbackground *fElecBackGround;//! Background analysis
153     AliHFEmcQA *fMCQA;                    //! MC QA
154     AliHFEtaggedTrackAnalysis *fTaggedTrackAnalysis;     //!Analyse V0-tagged tracks
155
156     //-----------QA and output---------------
157     TList *fQA;                           //! QA histos for the cuts
158     TList *fOutput;                       //! Container for Task Output
159     TList *fHistMCQA;                     //! Output container for MC QA histograms 
160     TList *fHistSECVTX;                   //! Output container for sec. vertexing results
161     TList *fHistELECBACKGROUND;           //! Output container for electron background analysis
162     AliHFEcollection *fQACollection;      //! Tasks own QA collection
163     //---------------------------------------
164
165     ClassDef(AliAnalysisTaskHFE, 2)       // The electron Analysis Task
166 };
167 #endif
168