]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliAnalysisTaskDisplacedElectrons.h
Update of the HFE package
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliAnalysisTaskDisplacedElectrons.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 // Analysis task: 
17 // study displaced electrons from beauty and charm 
18 // with cut on impact parameters in various pT bins
19 // 
20 //
21 // Authors:
22 //  Hongyan Yang <hongyan@physi.uni-heidelberg.de>
23 //  Carlo Bombonati <Carlo.Bombonati@cern.ch>
24 // 
25
26
27
28 #ifndef ALIANALYSISTASKDISPLACEDELECTRONS_H
29 #define ALIANALYSISTASKDISPLACEDELECTRONS_H
30
31 #ifndef ALIANALYSISTASKSE_H
32 #include "AliAnalysisTaskSE.h"
33 #endif
34
35 #ifndef ROOT_THnSparse
36 #include <THnSparse.h>
37 #endif
38
39 class TH1I; 
40 class TH1F;
41 class TList;
42 class AliLog;
43
44 class AliCFManager;
45 class AliESDEvent;
46 class AliESDtrackCuts;
47 class AliMCEvent;
48 class AliVParticle;
49
50 class AliStack;
51
52 class AliHFEpid;
53 class AliHFEcuts;
54 class AliHFEdisplacedElectrons;
55
56 class AliAnalysisTaskDisplacedElectrons : public AliAnalysisTaskSE{
57  public:
58
59   typedef enum{
60     kPostProcess = 0,
61     kDisplacedElectrons = 1, 
62     kCorrection = 2,
63     kDePidQA = 3
64   }Switches_t;
65
66   enum{
67     kHasMCdata = BIT(19),
68     kAODanalysis = BIT(20)
69   };
70   
71   AliAnalysisTaskDisplacedElectrons();
72   AliAnalysisTaskDisplacedElectrons(const char * name);
73   AliAnalysisTaskDisplacedElectrons(const AliAnalysisTaskDisplacedElectrons &ref);
74   AliAnalysisTaskDisplacedElectrons& operator=(const AliAnalysisTaskDisplacedElectrons &ref);
75   virtual ~AliAnalysisTaskDisplacedElectrons();
76   
77   virtual void UserCreateOutputObjects();
78   virtual void UserExec(Option_t *);
79   //  virtual void ConnectInputData(Option_t *);
80   virtual void Terminate(Option_t *);
81
82   void PrintStatus() const;
83   
84   Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fDePlugins, plug); };
85   void SwitchOnPlugin(Int_t plug);
86
87   void SetHFECuts(AliHFEcuts * const cuts) { fDeCuts = cuts; };
88   void SetNclustersITS(Int_t nITSclusters){fNminITSCluster = nITSclusters;};
89   void SetMinPrimVtxContrib(Int_t nPrimVtxContrib){fNminPrimVtxContrib = nPrimVtxContrib;};
90   void SetPIDdetectors(Char_t * const detectors){ fDePIDdetectors = detectors; };
91   void SetPIDStrategy(UInt_t strategy) { fDePIDstrategy = strategy; };
92   void SetDBLevel(UInt_t debugLevel) { fDeDebugLevel = debugLevel; };
93   void AddPIDdetector(TString detector); 
94  
95   Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
96   Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
97   Bool_t HasMCData() const { return TestBit(kHasMCdata); }
98   void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
99   
100   void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
101   void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
102
103   void ProcessMC();
104   void ProcessESD();
105   void ProcessData();
106   
107
108   
109  private:
110   
111   class LabelContainer{
112   public:
113     LabelContainer(Int_t capacity);
114     ~LabelContainer() {delete[] fContainer; };
115     
116     Bool_t Append(Int_t label);
117     Bool_t Find(Int_t Label) const;
118     Int_t Next();
119     void ResetIterator(){ fCurrent = fBegin; }
120     
121   private:
122     LabelContainer(const LabelContainer &);
123     LabelContainer &operator=(const LabelContainer &);
124     Int_t *fContainer;    // the Container for the labels
125     Int_t *fBegin;        // Pointer to the first entry
126     Int_t *fEnd;          // Pointer to the end of the container
127     Int_t *fLast;         // Pointer to the last entry
128     Int_t *fCurrent;      // Current entry to mimic an iterator
129   };
130     
131   void MakeParticleContainer();
132   void MakeEventContainer();
133
134   UInt_t fDeDebugLevel;                  // debug level
135   Int_t fNminITSCluster;                 // number of clusters in ITS
136   Int_t fNminPrimVtxContrib;             // number of ncontributor in ITS for prim vtx
137   TString fDePIDdetectors;                // Detectors for Particle Identification
138   UInt_t fDePIDstrategy;                  // PID Strategy
139
140   UShort_t fDePlugins;                    // Enabled Plugins    
141
142   AliHFEcuts *fDeCuts;                    // Cut Collection
143   AliESDpid *fDeDefaultPID;               //! ESD PID method
144   AliHFEpid *fDePID;                      //! PID method
145   AliCFManager *fDeCFM;                   //! Correction Framework Manager
146   AliHFEdisplacedElectrons *fDisplacedElectrons;        //! HFE displaced Electrons pointer 
147   
148                                                
149   TH1I *fDeNEvents;                       //! counter for the number of Events
150   TH1F *fElectronsMcPt;                   //! pt distribution of MC electrons (mcpid)
151   TH1F *fElectronsEsdPt;                  //! pt distribution of ESD electrons (hfepid)
152   TH1F *fElectronsDataPt;                  //! pt distribution of DATA electrons (hfepid)
153   TList *fDeCorrection;                   //! Container for correction  Outpu  
154   TList *fDeQA;                          //! container for the PID qa 
155   TList *fHistDisplacedElectrons;                      //! list of outputs
156  
157   ClassDef(AliAnalysisTaskDisplacedElectrons, 1);      // The DisplacedElectrons Analysis Task
158 };
159 #endif
160