]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliAnalysisTaskHFE.h
Coding rules (Markus)
[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 ALIANALYSISTASK_H
24 #include "AliAnalysisTask.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 AliCFManager;
36 class AliESDEvent;
37 class AliESDtrackCuts;
38 class AliMCEvent;
39 class AliVParticle;
40 class TH1I; 
41 class TList;
42
43 class AliAnalysisTaskHFE : public AliAnalysisTask{
44   public:
45   enum{
46     kPIDqa = 0,
47     kMCqa =1 
48   };
49     AliAnalysisTaskHFE();
50     AliAnalysisTaskHFE(const char * name);
51     AliAnalysisTaskHFE(const AliAnalysisTaskHFE &ref);
52     AliAnalysisTaskHFE& operator=(const AliAnalysisTaskHFE &ref);
53     virtual ~AliAnalysisTaskHFE();
54
55     virtual void ConnectInputData(Option_t *);
56     virtual void CreateOutputObjects();
57     virtual void Exec(Option_t *);
58     virtual void Terminate(Option_t *);
59
60     Bool_t IsQAOn(Int_t qaLevel) const { return TESTBIT(fQAlevel, qaLevel); };
61     Bool_t IsSecVtxOn() const { return TestBit(kIsSecVtxOn); };
62     Bool_t IsPriVtxOn() const { return TestBit(kIsPriVtxOn); };
63     Bool_t IsRunningPostProcess() const { return TestBit(kIsRunningPostProcess); };
64     Bool_t HasMCData() const { return TestBit(kHasMCdata); }
65     Int_t IsSignalElectron(AliVParticle *fTrack) const;
66     void Load(TString filename = "HFEtask.root");
67     void PostProcess();
68     void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
69     void SetQAOn(Int_t qaLevel) { SETBIT(fQAlevel, qaLevel); };
70     void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
71     void SetPriVtxOn(Bool_t option = kTRUE)        { SetBit(kIsPriVtxOn, option); };
72     void SetSecVtxOn(Bool_t option = kTRUE)        { SetBit(kIsSecVtxOn, option); };
73     void SetRunPostProcess(Bool_t option = kTRUE)  { SetBit(kIsRunningPostProcess, option); };
74     void SetPIDdetectors(Char_t * const detectors){ fPIDdetectors = detectors; }
75     void SetPIDStrategy(UInt_t strategy) { fPIDstrategy = strategy; }
76     void AddPIDdetector(Char_t *detector);
77     void PrintStatus() const;
78     Float_t GetRapidity(TParticle *part) const;
79  
80   private:
81     enum{
82       kIsSecVtxOn = BIT(19),
83       kIsPriVtxOn = BIT(20),
84       kIsRunningPostProcess = BIT(21),
85       kHasMCdata = BIT(22)
86     };
87     class LabelContainer{
88       public:
89         LabelContainer(Int_t capacity);
90         ~LabelContainer() {delete[] fContainer; };
91
92         Bool_t Append(Int_t label);
93         Bool_t Find(Int_t Label) const;
94         Int_t Next();
95         void ResetIterator(){ fCurrent = fBegin; }
96
97       private:
98         LabelContainer(const LabelContainer &);
99         LabelContainer &operator=(const LabelContainer &);
100         Int_t *fContainer;    // the Container for the labels
101         Int_t *fBegin;        // Pointer to the first entry
102         Int_t *fEnd;          // Pointer to the end of the container
103         Int_t *fLast;         // Pointer to the last entry
104         Int_t *fCurrent;      // Current entry to mimic an iterator
105     };
106     void MakeParticleContainer();
107     
108     ULong_t fQAlevel;                     // QA level
109     TString fPIDdetectors;                // Detectors for Particle Identification
110     UInt_t fPIDstrategy;                  // PID Strategy
111     AliESDEvent *fESD;                    //! The ESD Event
112     AliMCEvent *fMC;                      //! The MC Event
113     AliCFManager *fCFM;                   //! Correction Framework Manager
114     TList *fCorrelation;                  //! response matrix for unfolding  
115     THnSparseF *fPIDperformance;          //! info on contamination and yield of electron spectra
116     AliHFEpid *fPID;                      //! PID
117     AliHFEcuts *fCuts;                    // Cut Collection
118     AliHFEsecVtx *fSecVtx;                //! Secondary Vertex Analysis
119     AliHFEmcQA *fMCQA;                    //! MC QA
120     TH1I *fNEvents;                       //! counter for the number of Events
121     TH1I *fNElectronTracksEvent;          //! Number of Electron candidates after PID decision per Event
122     TList *fQA;                           //! QA histos for the cuts
123     TList *fOutput;                       //! Container for Task Output
124     TList *fHistMCQA;                     //! Output container for MC QA histograms 
125     TList *fHistSECVTX;                   //! Output container for sec. vertexing results
126
127     ClassDef(AliAnalysisTaskHFE, 1)       // The electron Analysis Task
128 };
129 #endif
130