]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliAnalysisTaskDisplacedElectrons.h
1750e170b725d205ddd1dcc4e69b266ce9bfcbbd
[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
22 #ifndef ALIANALYSISTASKDISPLACEDELECTRONS_H
23 #define ALIANALYSISTASKDISPLACEDELECTRONS_H
24
25 #ifndef ALIANALYSISTASKSE_H
26 #include "AliAnalysisTaskSE.h"
27 #endif
28
29 #ifndef ROOT_THnSparse
30 #include <THnSparse.h>
31 #endif
32
33 class TH1I; 
34 class TH1F;
35 class TList;
36 class AliLog;
37
38 class AliCFManager;
39 class AliESDEvent;
40 class AliESDtrackCuts;
41 class AliMCEvent;
42 class AliVParticle;
43
44 class AliStack;
45
46 class AliHFEpid;
47 class AliHFEcuts;
48 class AliHFEdisplacedElectrons;
49
50 class AliAnalysisTaskDisplacedElectrons : public AliAnalysisTaskSE{
51  public:
52
53   typedef enum{
54     kPostProcess = 0,
55     kDisplacedElectrons = 1, 
56     kCorrection = 2
57   }Switches_t;
58
59   enum{
60     kHasMCdata = BIT(19),
61     kAODanalysis = BIT(20)
62   };
63   
64   AliAnalysisTaskDisplacedElectrons();
65   AliAnalysisTaskDisplacedElectrons(const char * name);
66   AliAnalysisTaskDisplacedElectrons(const AliAnalysisTaskDisplacedElectrons &ref);
67   AliAnalysisTaskDisplacedElectrons& operator=(const AliAnalysisTaskDisplacedElectrons &ref);
68   virtual ~AliAnalysisTaskDisplacedElectrons();
69   
70   virtual void UserCreateOutputObjects();
71   virtual void UserExec(Option_t *);
72   //  virtual void ConnectInputData(Option_t *);
73   virtual void Terminate(Option_t *);
74
75   void PrintStatus() const;
76   
77   Bool_t GetPlugin(Int_t plug) const { return TESTBIT(fPlugins, plug); };
78   void SwitchOnPlugin(Int_t plug);
79
80   void SetHFECuts(AliHFEcuts * const cuts) { fCuts = cuts; };
81   
82   void SetPIDdetectors(Char_t * const detectors){ fPIDdetectors = detectors; };
83   void SetPIDStrategy(UInt_t strategy) { fPIDstrategy = strategy; };
84   void SetDBLevel(UInt_t debugLevel) { fDebugLevel = debugLevel; };
85   void AddPIDdetector(TString detector); 
86  
87   Bool_t HasMCData() const { return TestBit(kHasMCdata); };
88   void SetHasMCData(Bool_t hasMC = kTRUE) { SetBit(kHasMCdata, hasMC); };
89   
90   
91  private:
92   
93   class LabelContainer{
94   public:
95     LabelContainer(Int_t capacity);
96     ~LabelContainer() {delete[] fContainer; };
97     
98     Bool_t Append(Int_t label);
99     Bool_t Find(Int_t Label) const;
100     Int_t Next();
101     void ResetIterator(){ fCurrent = fBegin; }
102     
103   private:
104     LabelContainer(const LabelContainer &);
105     LabelContainer &operator=(const LabelContainer &);
106     Int_t *fContainer;    // the Container for the labels
107     Int_t *fBegin;        // Pointer to the first entry
108     Int_t *fEnd;          // Pointer to the end of the container
109     Int_t *fLast;         // Pointer to the last entry
110     Int_t *fCurrent;      // Current entry to mimic an iterator
111   };
112     
113   void MakeParticleContainer();
114   void MakeEventContainer();
115
116   UInt_t fDebugLevel;                   // debug level
117   
118   TString fPIDdetectors;                // Detectors for Particle Identification
119   UInt_t fPIDstrategy;                  // PID Strategy
120   
121
122   UShort_t fPlugins;                    // Enabled Plugins                                    
123   AliESDEvent *fESD;                    //! The ESD Event
124   AliMCEvent *fMC;                      //! The MC Event
125
126   AliHFEcuts *fCuts;                    // Cut Collection
127   AliHFEpid *fPID;                      // PID method
128   AliCFManager *fCFM;                   //! Correction Framework Manager
129                                                
130   TH1I *fNEvents;                       //! counter for the number of Events
131   TH1F *fElectronsPt;                       //! pt distribution of electrons (hfepid)
132   TList *fOutput;                       //! Container for this Task Output
133   TList *fCorrection;                       //! Container for correction  Output
134   AliHFEdisplacedElectrons *fDisplacedElectrons;        //! HFE displaced Electrons pointer 
135   TList *fHistDisplacedElectrons;                      //! list of outputs
136  
137   ClassDef(AliAnalysisTaskDisplacedElectrons, 1);      // The DisplacedElectrons Analysis Task
138 };
139 #endif
140