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