First update for AOD compatibility (distributions and efficiency), still missing...
[u/mrichter/AliRoot.git] / PWGCF / EBYE / NetParticle / AliAnalysisNetParticleEffCont.h
1 //-*- Mode: C++ -*-
2
3 #ifndef ALIANALYSISNETPARTICLEEFFCONT_H
4 #define ALIANALYSISNETPARTICLEEFFCONT_H
5
6 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7  * See cxx source for full Copyright notice                               */
8  
9 // Efficiency and Contaminations for NetParticle Distributions
10 // Authors: Jochen Thaeder <jochen@thaeder.de>
11
12 #include "THnSparse.h"
13
14 #include "AliAnalysisNetParticleHelper.h"
15
16 class AliESDEvent;
17 class AliESDInputHandler;
18 class AliAODInputHandler;
19 class AliMCEvent;
20
21 class AliAnalysisNetParticleEffCont : public TNamed {
22
23  public:
24
25   /*
26    * ---------------------------------------------------------------------------------
27    *                            Constructor / Destructor
28    * ---------------------------------------------------------------------------------
29    */
30
31   AliAnalysisNetParticleEffCont();
32   virtual ~AliAnalysisNetParticleEffCont();
33   
34   /*
35    * ---------------------------------------------------------------------------------
36    *                                 Public Methods
37    * ---------------------------------------------------------------------------------
38    */
39
40   /** Initialize */
41   void Initialize(AliESDtrackCuts *cuts, AliAnalysisNetParticleHelper* helper, Int_t trackCutBit);
42
43   /** Setup Event */
44   Int_t SetupEvent(AliESDInputHandler *esdHandler, AliMCEvent *mcEvent); 
45   Int_t SetupEvent(AliAODInputHandler *esdHandler); // MC particles are stored in AOD
46
47   /** Reset Event */
48   void ResetEvent();
49
50   /** Process Event */
51   void Process();
52
53   /*
54    * ---------------------------------------------------------------------------------
55    *                                    Getter
56    * ---------------------------------------------------------------------------------
57    */
58
59   /** Get Ptr to efficiency THnSparse */
60   THnSparseF* GetHnEff()  {return fHnEff;}
61
62   /** Get Ptr to contaminiation THnSparse */
63   THnSparseF* GetHnCont() {return fHnCont;}
64
65   ///////////////////////////////////////////////////////////////////////////////////
66
67  private:
68
69   AliAnalysisNetParticleEffCont(const AliAnalysisNetParticleEffCont&); // not implemented
70   AliAnalysisNetParticleEffCont& operator=(const AliAnalysisNetParticleEffCont&); // not implemented
71
72
73   /*
74    * ---------------------------------------------------------------------------------
75    *                                Methods - private
76    * ---------------------------------------------------------------------------------
77    */
78
79   /** Create the efficiency / contamination THnSparseF */
80   void CreateHistograms();
81
82   /** Fill MC labels */
83   void FillMCLabels(); 
84   void FillMCLabelsAOD();  
85
86   /** Fill efficiency THnSparse */
87   void FillMCEffHist();
88   void FillMCEffHistAOD();
89
90   /** Check if particle is contamination */
91   void CheckContTrack(Int_t label, Float_t sign, Int_t idxTrack);
92   void CheckContTrackAOD(Int_t label, Float_t sign, Int_t idxTrack);
93       
94   /*
95    * ---------------------------------------------------------------------------------
96    *                             Members - private
97    * ---------------------------------------------------------------------------------
98    */
99
100   AliAnalysisNetParticleHelper *fHelper;      //! Ptr to helper class
101
102   // -----------------------------------------------------------------------
103
104   Int_t               fPdgCode;               // PDG code of particle to be found 
105
106   // --- ESD only ----------------------------------------------------------
107
108   AliESDEvent        *fESD;                   //! ESD object
109   AliESDtrackCuts    *fESDTrackCuts;          //! ESD cuts  
110
111   // --- AOD only ----------------------------------------------------------
112
113   AliAODEvent        *fAOD;                   //! AOD object
114   TClonesArray       *fArrayMC;               //! array of MC particles
115
116   // -----------------------------------------------------------------------
117
118   Float_t             fCentralityBin;         //  Centrality of current event  
119   Int_t               fNTracks;               //  N Tracks in the current event
120   
121   Int_t               fAODtrackCutBit;        //  Track filter bit for AOD tracks
122
123   // --- MC only -----------------------------------------------------------
124
125   AliStack           *fStack;                 //! Ptr to stack
126   AliMCEvent         *fMCEvent;               //! Ptr to MC event
127
128   Int_t             **fLabelsRec;             //! 2x nTracks large array with labels for MC particles
129
130   // -----------------------------------------------------------------------
131
132   THnSparseF         *fHnEff;                 //  THnSparseF efficiency 
133   THnSparseF         *fHnCont;                //  THnSparseF contamination
134
135   // -----------------------------------------------------------------------
136
137   ClassDef(AliAnalysisNetParticleEffCont, 1);
138 };
139
140 #endif