]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/CaloTrackCorrBase/AliCaloTrackReader.h
80f142ecd3b0ce72a6024899dd90d2eb00d941da
[u/mrichter/AliRoot.git] / PWG / CaloTrackCorrBase / AliCaloTrackReader.h
1 #ifndef ALICALOTRACKREADER_H
2 #define ALICALOTRACKREADER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice     */
5
6 //_________________________________________________________________________
7 // Base class for reading data: MonteCarlo, ESD or AOD, of PHOS EMCAL and 
8 // Central Barrel Tracking detectors.
9 // Not all MC particles/tracks/clusters are kept, some kinematical restrictions are done.
10 // Mother class of : AliCaloTrackESDReader: Fills ESD data in 3 TObjArrays (PHOS, EMCAL, CTS)
11 //                 : AliCaloTrackMCReader : Fills Kinematics data in 3 TObjArrays (PHOS, EMCAL, CTS)
12 //                 : AliCaloTrackAODReader: Fills AOD data in 3 TObjArrays (PHOS, EMCAL, CTS)   
13 // -- Author: Gustavo Conesa (INFN-LNF)
14 //////////////////////////////////////////////////////////////////////////////
15
16 // --- ROOT system ---
17 #include <TObject.h> 
18 #include <TString.h>
19 class TObjArray ; 
20 class TTree ;
21 class TArrayI ;
22
23 //--- ANALYSIS system ---
24 #include "AliVEvent.h"
25 class AliVCaloCells;
26 class AliStack; 
27 class AliHeader; 
28 class AliGenEventHeader; 
29 class AliAODEvent;
30 class AliMCEvent;
31 class AliMixedEvent;
32 class AliAODMCHeader;
33 class AliESDtrackCuts;
34 class AliCentrality;
35 class AliTriggerAnalysis;
36 class AliEventplane;
37 class AliVCluster;
38
39 // --- CaloTrackCorr / EMCAL ---
40 #include "AliFiducialCut.h"
41 class AliEMCALRecoUtils;
42 class AliCalorimeterUtils;
43
44 class AliCaloTrackReader : public TObject {
45
46 public: 
47   
48   AliCaloTrackReader() ;          // ctor
49   virtual ~AliCaloTrackReader() ; // virtual dtor
50   
51   //--------------------------------
52   // General methods
53   //--------------------------------
54
55   virtual void    Init();
56     
57   virtual void    InitParameters();
58   
59   virtual void    Print(const Option_t * opt) const;
60   
61   virtual void    ResetLists();
62
63   virtual Int_t   GetDebug()                         const { return fDebug                 ; }
64   virtual void    SetDebug(Int_t d)                        { fDebug = d                    ; }
65   
66   enum inputDataType {kESD, kAOD, kMC};
67   virtual Int_t   GetDataType()                      const { return fDataType              ; }
68   virtual void    SetDataType(Int_t data )                 { fDataType = data              ; }
69
70   virtual Int_t   GetEventNumber()                   const { return fEventNumber           ; }
71         
72   TString         GetTaskName()                      const { return fTaskName              ; }
73   void            SetTaskName(TString name)                { fTaskName = name              ; }
74     
75   //---------------------------------------
76   //Input/output event setters and getters
77   //---------------------------------------
78   virtual void    SetInputEvent(AliVEvent* const input) ;
79   virtual void    SetOutputEvent(AliAODEvent* const aod)   { fOutputEvent = aod            ; }
80   virtual void    SetMC(AliMCEvent* const mc)              { fMC          = mc             ; }
81   virtual void    SetInputOutputMCEvent(AliVEvent* /*esd*/, AliAODEvent* /*aod*/, AliMCEvent* /*mc*/) { ; }
82   
83   // Delta AODs
84   virtual TList * GetAODBranchList()                 const { return fAODBranchList         ; }
85   void            SetDeltaAODFileName(TString name )       { fDeltaAODFileName = name      ; }
86   TString         GetDeltaAODFileName()              const { return fDeltaAODFileName      ; }
87   void            SwitchOnWriteDeltaAOD()                  { fWriteOutputDeltaAOD = kTRUE  ; }
88   void            SwitchOffWriteDeltaAOD()                 { fWriteOutputDeltaAOD = kFALSE ; }
89   Bool_t          WriteDeltaAODToFile()              const { return fWriteOutputDeltaAOD   ; } 
90   
91   //------------------------------------------------------------
92   //Clusters/Tracks arrays filtering/filling methods and switchs 
93   //------------------------------------------------------------
94   
95   //Minimum pt setters and getters 
96   Float_t          GetEMCALPtMin()                   const { return fEMCALPtMin            ; }
97   Float_t          GetPHOSPtMin()                    const { return fPHOSPtMin             ; }
98   Float_t          GetCTSPtMin()                     const { return fCTSPtMin              ; }
99   Float_t          GetEMCALPtMax()                   const { return fEMCALPtMax            ; }
100   Float_t          GetPHOSPtMax()                    const { return fPHOSPtMax             ; }
101   Float_t          GetCTSPtMax()                     const { return fCTSPtMax              ; }
102   
103   void             SetEMCALPtMin(Float_t  pt)              { fEMCALPtMin = pt              ; }
104   void             SetPHOSPtMin (Float_t  pt)              { fPHOSPtMin  = pt              ; }
105   void             SetCTSPtMin  (Float_t  pt)              { fCTSPtMin   = pt              ; }  
106   
107   void             SetEMCALPtMax(Float_t  pt)              { fEMCALPtMax = pt              ; }
108   void             SetPHOSPtMax (Float_t  pt)              { fPHOSPtMax  = pt              ; }
109   void             SetCTSPtMax  (Float_t  pt)              { fCTSPtMax   = pt              ; }  
110    
111   Float_t          GetEMCALEMin()                    const { return GetEMCALPtMin()        ; }
112   Float_t          GetPHOSEMin()                     const { return GetPHOSPtMin()         ; }
113   Float_t          GetEMCALEMax()                    const { return GetEMCALPtMax()        ; }
114   Float_t          GetPHOSEMax()                     const { return GetPHOSPtMax()         ; }
115   
116   void             SetEMCALEMin (Float_t  e)               { SetEMCALPtMin(e)              ; }
117   void             SetPHOSEMin  (Float_t  e)               { SetPHOSPtMin (e)              ; }
118   void             SetEMCALEMax (Float_t  e)               { SetEMCALPtMax(e)              ; }
119   void             SetPHOSEMax  (Float_t  e)               { SetPHOSPtMax (e)              ; }
120   
121   //Time cut
122   
123   Double_t         GetEMCALTimeCutMin()              const { return fEMCALTimeCutMin       ; }
124   Double_t         GetEMCALTimeCutMax()              const { return fEMCALTimeCutMax       ; }  
125
126   Bool_t           IsInTimeWindow(const Double_t tof, const Float_t energy)  const ;
127   
128   void             SetEMCALTimeCut(Double_t a, Double_t b) { fEMCALTimeCutMin = a ; 
129                                                              fEMCALTimeCutMax = b          ; } // ns
130   
131   void             SetEMCALParametrizedMinTimeCut(Int_t i, Float_t par) { fEMCALParamTimeCutMin[i] = par ; } 
132   void             SetEMCALParametrizedMaxTimeCut(Int_t i, Float_t par) { fEMCALParamTimeCutMax[i] = par ; } 
133   
134   void             SwitchOnUseParametrizedTimeCut()        { fUseParamTimeCut = kTRUE      ; }
135   void             SwitchOffUseParametrizedTimeCut()       { fUseParamTimeCut = kFALSE     ; }
136
137   // Fidutial cuts  
138   virtual AliFiducialCut * GetFiducialCut()                { 
139                     if(!fFiducialCut) fFiducialCut = new AliFiducialCut(); 
140                     return  fFiducialCut                                                   ; }
141   virtual void     SetFiducialCut(AliFiducialCut * const fc) { fFiducialCut = fc           ; }
142   virtual Bool_t   IsFiducialCutOn()                 const { return fCheckFidCut           ; }
143   virtual void     SwitchOnFiducialCut()                   { fCheckFidCut = kTRUE          ; 
144                                                              fFiducialCut = new AliFiducialCut() ; }
145   virtual void     SwitchOffFiducialCut()                  { fCheckFidCut = kFALSE         ; }
146   
147   // Cluster origin
148   Bool_t           IsEMCALCluster(AliVCluster *clus) const;
149   Bool_t           IsPHOSCluster (AliVCluster *clus) const;
150   //Patch for cluster origin for Old AODs implementation
151   void             SwitchOnOldAODs()                       { fOldAOD = kTRUE               ; }
152   void             SwitchOffOldAODs()                      { fOldAOD = kFALSE              ; }
153   
154   // Cluster/track/cells switchs
155   Bool_t           IsCTSSwitchedOn()                 const { return fFillCTS               ; }
156   void             SwitchOnCTS()                           { fFillCTS = kTRUE              ; }
157   void             SwitchOffCTS()                          { fFillCTS = kFALSE             ; }
158
159   Bool_t           IsEMCALSwitchedOn()               const { return fFillEMCAL             ; }
160   void             SwitchOnEMCAL()                         { fFillEMCAL = kTRUE            ; }
161   void             SwitchOffEMCAL()                        { fFillEMCAL = kFALSE           ; }
162
163   Bool_t           IsPHOSSwitchedOn()                const { return fFillPHOS              ; }
164   void             SwitchOnPHOS()                          { fFillPHOS = kTRUE             ; }
165   void             SwitchOffPHOS()                         { fFillPHOS = kFALSE            ; }
166
167   Bool_t           IsEMCALCellsSwitchedOn()          const { return fFillEMCALCells        ; }
168   void             SwitchOnEMCALCells()                    { fFillEMCALCells = kTRUE       ; }
169   void             SwitchOffEMCALCells()                   { fFillEMCALCells = kFALSE      ; }
170
171   Bool_t           IsPHOSCellsSwitchedOn()           const { return fFillPHOSCells         ; }
172   void             SwitchOnPHOSCells()                     { fFillPHOSCells = kTRUE        ; }
173   void             SwitchOffPHOSCells()                    { fFillPHOSCells = kFALSE       ; }
174
175   Bool_t           AreClustersRecalculated()         const { return fRecalculateClusters   ; }
176   void             SwitchOnClusterRecalculation()          { fRecalculateClusters = kTRUE  ; }
177   void             SwitchOffClusterRecalculation()         { fRecalculateClusters = kFALSE ; }  
178   
179   Bool_t           IsEmbeddedClusterSelectionOn()    const { return fSelectEmbeddedClusters   ; }
180   void             SwitchOnEmbeddedClustersSelection()     { fSelectEmbeddedClusters = kTRUE  ; }
181   void             SwitchOffEmbeddedClustersSelection()    { fSelectEmbeddedClusters = kFALSE ; }
182   
183   // Filling/ filtering / detector information access methods
184   virtual Bool_t   FillInputEvent(const Int_t iEntry, const char *currentFileName)  ;
185   virtual void     FillInputCTS() ;
186   virtual void     FillInputEMCAL() ;
187   virtual void     FillInputEMCALAlgorithm(AliVCluster * clus, const Int_t iclus) ;
188   virtual void     FillInputPHOS() ;
189   virtual void     FillInputEMCALCells() ;
190   virtual void     FillInputPHOSCells() ;
191   virtual void     FillInputVZERO() ;  
192   
193   Int_t            GetV0Signal(Int_t i)              const { return fV0ADC[i]               ; }
194   Int_t            GetV0Multiplicity(Int_t i)        const { return fV0Mul[i]               ; }
195   
196   void             SetEMCALClusterListName(TString &name)  { fEMCALClustersListName = name  ; }
197   TString          GetEMCALClusterListName()         const { return fEMCALClustersListName  ; }
198
199   // Arrayes with clusters/track/cells access method
200   virtual TObjArray*     GetCTSTracks()              const { return fCTSTracks              ; }
201   virtual TObjArray*     GetEMCALClusters()          const { return fEMCALClusters          ; }
202   virtual TObjArray*     GetPHOSClusters()           const { return fPHOSClusters           ; }
203   virtual AliVCaloCells* GetEMCALCells()             const { return fEMCALCells             ; }
204   virtual AliVCaloCells* GetPHOSCells()              const { return fPHOSCells              ; }
205    
206   //-------------------------------------
207   // Event/track selection methods
208   //-------------------------------------
209   
210   void             AcceptFastClusterEvents()               { fAcceptFastCluster     = kTRUE  ; } 
211   void             RejectFastClusterEvents()               { fAcceptFastCluster     = kFALSE ; }  
212   Bool_t           IsFastClusterAccepted()           const { return fAcceptFastCluster       ; }   
213   
214   void             SwitchOnLEDEventsRemoval()              { fRemoveLEDEvents       = kTRUE  ; }
215   void             SwitchOffLEDEventsRemoval()             { fRemoveLEDEvents       = kFALSE ; } 
216   Bool_t           IsLEDEventRemoved()               const { return fRemoveLEDEvents         ; }   
217
218   void             SetFiredTriggerClassName(TString name ) { fFiredTriggerClassName = name   ; }
219   TString          GetFiredTriggerClassName()        const { return fFiredTriggerClassName   ; }
220   TString          GetFiredTriggerClasses() ;               
221   
222   UInt_t           GetEventTriggerMask()             const { return fEventTriggerMask        ; }
223   void             SetEventTriggerMaks(UInt_t evtTrig = AliVEvent::kAny) 
224                                                            { fEventTriggerMask = evtTrig     ; }
225
226   UInt_t           GetMixEventTriggerMask()             const { return fMixEventTriggerMask  ; }
227   void             SetMixEventTriggerMaks(UInt_t evtTrig = AliVEvent::kAnyINT) 
228                                                            { fMixEventTriggerMask = evtTrig  ; }
229   
230   
231   Bool_t           IsEventTriggerAtSEOn()            const { return fEventTriggerAtSE        ; }
232   void             SwitchOnEventTriggerAtSE()              { fEventTriggerAtSE      = kTRUE  ; }
233   void             SwitchOffEventTriggerAtSE()             { fEventTriggerAtSE      = kFALSE ; }
234   
235   void             SwitchOnEventSelection()                { fDoEventSelection      = kTRUE  ; }
236   void             SwitchOffEventSelection()               { fDoEventSelection      = kFALSE ; }
237   Bool_t           IsEventSelectionDone()            const { return fDoEventSelection        ; } 
238   
239   void             SwitchOnV0ANDSelection()                { fDoV0ANDEventSelection = kTRUE  ; }
240   void             SwitchOffV0ANDSelection()               { fDoV0ANDEventSelection = kFALSE ; }
241   Bool_t           IsV0ANDEventSelectionDone()       const { return fDoV0ANDEventSelection   ; } 
242
243   void             SwitchOnPrimaryVertexSelection()        { fUseEventsWithPrimaryVertex = kTRUE  ; }
244   void             SwitchOffPrimaryVertexSelection()       { fUseEventsWithPrimaryVertex = kFALSE ; }
245   Bool_t           IsPrimaryVertexSelectionDone()    const { return fUseEventsWithPrimaryVertex   ; } 
246   
247   Bool_t           IsPileUpFromSPD()               const ;
248   Bool_t           IsPileUpFromEMCal()             const ;
249   Bool_t           IsPileUpFromSPDAndEMCal()       const ;
250   Bool_t           IsPileUpFromSPDOrEMCal()        const ;
251   Bool_t           IsPileUpFromSPDAndNotEMCal()    const ;
252   Bool_t           IsPileUpFromEMCalAndNotSPD()    const ;
253   Bool_t           IsPileUpFromNotSPDAndNotEMCal() const ;
254
255   void             SetPileUpParamForSPD  (Int_t i, Double_t param)
256                                                            { fPileUpParamSPD[i]  = param ; }
257   void             SetPileUpParamForEMCal(Int_t param)     { fNPileUpClustersCut = param ; }
258   
259   Int_t            GetNPileUpClusters()                    { return  fNPileUpClusters    ; }
260   Int_t            GetNNonPileUpClusters()                 { return  fNNonPileUpClusters ; }
261
262   // Track selection
263   ULong_t          GetTrackStatus()                  const { return fTrackStatus       ; }
264   void             SetTrackStatus(ULong_t bit)             { fTrackStatus = bit        ; }              
265
266   ULong_t          GetTrackFilterMask()              const {return fTrackFilterMask    ; }
267   void             SetTrackFilterMask(ULong_t bit)         { fTrackFilterMask = bit    ; }              
268   
269   AliESDtrackCuts* GetTrackCuts()                    const { return fESDtrackCuts      ; }
270   void             SetTrackCuts(AliESDtrackCuts * cuts)    ;
271
272   void             SwitchOnConstrainTrackToVertex()        { fConstrainTrack = kTRUE   ; } 
273   void             SwitchOffConstrainTrackToVertex()       { fConstrainTrack = kFALSE  ; }      
274   
275   void             SwitchOnAODHybridTrackSelection()       { fSelectHybridTracks = kTRUE  ; } 
276   void             SwitchOffAODHybridTrackSelection()      { fSelectHybridTracks = kFALSE ; }      
277   
278   Int_t            GetTrackMultiplicity()            const { return fTrackMult         ; }
279   Float_t          GetTrackMultiplicityEtaCut()      const { return fTrackMultEtaCut   ; }
280   void             SetTrackMultiplicityEtaCut(Float_t eta) { fTrackMultEtaCut = eta    ; }              
281   
282   // Calorimeter specific and patches
283   void             AnalyzeOnlyLED()                        { fAnaLED = kTRUE           ; }
284   void             AnalyzeOnlyPhysics()                    { fAnaLED = kFALSE          ; }
285   
286   void             SwitchOnCaloFilterPatch()               { fCaloFilterPatch = kTRUE  ; 
287                                                              fFillCTS = kFALSE         ; }
288   void             SwitchOffCaloFilterPatch()              { fCaloFilterPatch = kFALSE ; }
289   Bool_t           IsCaloFilterPatchOn()             const { 
290                     if(fDataType == kAOD) { return fCaloFilterPatch ; } 
291                     else                  { return kFALSE           ; }                  }
292         
293   //-------------------------------
294   //Vertex methods
295   //-------------------------------
296   virtual void      GetVertex(Double_t v[3])         const ;
297   virtual Double_t* GetVertex(const Int_t evtIndex)  const { return fVertex[evtIndex]            ; }
298   virtual void      GetVertex(Double_t vertex[3],    const Int_t evtIndex) const ;
299   virtual void      FillVertexArray();
300   virtual Bool_t    CheckForPrimaryVertex();
301   virtual Float_t   GetZvertexCut()                  const { return fZvtxCut                     ; } //cut on vertex position  
302   virtual void      SetZvertexCut(Float_t zcut=10.)        { fZvtxCut=zcut                       ; } //cut on vertex position
303
304   //--------------------------
305   // Centrality / Event Plane
306   //--------------------------
307   virtual AliCentrality* GetCentrality()             const { if(fDataType!=kMC) return fInputEvent->GetCentrality() ; 
308                                                              else               return 0x0       ; } 
309   virtual void     SetCentralityClass(TString name)        { fCentralityClass   = name           ; }
310   virtual void     SetCentralityOpt(Int_t opt)             { fCentralityOpt     = opt            ; }
311   virtual TString  GetCentralityClass()              const { return fCentralityClass             ; }
312   virtual Int_t    GetCentralityOpt()                const { return fCentralityOpt               ; }
313   virtual Int_t    GetEventCentrality()              const ;
314   virtual void     SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
315                                                            { fCentralityBin[0]=min; fCentralityBin[1]=max;  
316                                                              if(min>=0 && max > 0) fCentralityOpt = 100 ; }
317   virtual Float_t  GetCentralityBin(Int_t i)         const { if(i < 0 || i > 1) return 0 ; 
318                                                              else return fCentralityBin[i]              ; }
319   
320   virtual AliEventplane* GetEventPlane()             const { if(fDataType!=kMC) return fInputEvent->GetEventplane() ;
321                                                              else               return 0x0       ; }  
322   virtual Double_t       GetEventPlaneAngle()        const ;          
323   virtual void           SetEventPlaneMethod(TString m)    { fEventPlaneMethod = m               ; }
324   virtual TString        GetEventPlaneMethod()       const { return fEventPlaneMethod            ; }
325
326   //--------------------
327   // Mixing
328   //--------------------
329
330   Int_t   GetLastCaloMixedEvent()                    const { return fLastMixedCaloEvent          ; }
331   Int_t   GetLastTracksMixedEvent ()                 const { return fLastMixedTracksEvent        ; }
332   
333   TList * GetListWithMixedEventsForCalo  (Int_t bi)  const { if(fListMixedCaloEvents)   return fListMixedCaloEvents[bi]     ; else return 0 ; }
334   TList * GetListWithMixedEventsForTracks(Int_t bi)  const { if(fListMixedTracksEvents) return fListMixedTracksEvents [bi]  ; else return 0 ; }  
335    
336   Bool_t  ListWithMixedEventsForCaloExists()         const { if(fListMixedCaloEvents) return kTRUE  ;
337                                                              else                     return kFALSE ; }
338
339   Bool_t  ListWithMixedEventsForTracksExists()       const { if(fListMixedTracksEvents) return kTRUE  ;
340                                                              else                       return kFALSE ; }
341   
342   void    SetLastCaloMixedEvent  (Int_t e)                 { fLastMixedCaloEvent    = e          ; }
343   void    SetLastTracksMixedEvent(Int_t e)                 { fLastMixedTracksEvent  = e          ; }
344   
345   void    SetListWithMixedEventsForCalo (TList ** l)       { 
346             if(fListMixedCaloEvents) printf("AliCaloTrackReader::SetListWithMixedEventsForCalo() - Track Mixing event list already set, nothing done\n");
347             else                        fListMixedCaloEvents    = l ; }
348   
349   void    SetListWithMixedEventsForTracks(TList ** l)      { 
350             if(fListMixedTracksEvents)  printf("AliCaloTrackReader::SetListWithMixedEventsForTracks() - Calorimeter Mixing event list already set, nothing done\n");
351             else                        fListMixedTracksEvents  = l ; }
352   
353   //-------------------------------------
354   // Other methods
355   //-------------------------------------
356   AliCalorimeterUtils * GetCaloUtils()               const { return fCaloUtils                   ; }
357   void             SetCaloUtils(AliCalorimeterUtils * caloutils)  { fCaloUtils = caloutils       ; }  
358   
359   virtual Double_t GetBField()                       const { return fInputEvent->GetMagneticField()  ; } 
360   
361   void    SetImportGeometryFromFile(Bool_t import, 
362                                     TString path = "")     { 
363                                                              fImportGeometryFromFile = import    ; 
364                                                              fImportGeometryFilePath = path      ; }      
365   
366   //------------------------------------------------
367   // MC analysis specific methods
368   //-------------------------------------------------
369   
370   //Kinematics and galice.root available 
371   virtual AliStack*          GetStack()              const ;
372   virtual AliHeader*         GetHeader()             const ;
373   virtual AliGenEventHeader* GetGenEventHeader()     const ;
374   
375   //Filtered kinematics in AOD  
376   virtual TClonesArray*     GetAODMCParticles(Int_t input = 0) const ;
377   virtual AliAODMCHeader*   GetAODMCHeader()         const ;
378         
379   virtual AliVEvent*        GetInputEvent()          const { return fInputEvent            ; }
380   virtual AliVEvent*        GetOriginalInputEvent()  const { return 0x0                    ; }
381   virtual AliAODEvent*      GetOutputEvent()         const { return fOutputEvent           ; }
382   virtual AliMCEvent*       GetMC()                  const { return fMC                    ; }
383   virtual AliMixedEvent*    GetMixedEvent()          const { return fMixedEvent            ; }
384   virtual Int_t             GetNMixedEvent()         const { return fNMixedEvent           ; } 
385   
386   void             SwitchOnStack()                         { fReadStack          = kTRUE   ; }
387   void             SwitchOffStack()                        { fReadStack          = kFALSE  ; }
388   void             SwitchOnAODMCParticles()                { fReadAODMCParticles = kTRUE   ; }
389   void             SwitchOffAODMCParticles()               { fReadAODMCParticles = kFALSE  ; }
390   Bool_t           ReadStack()                       const { return fReadStack             ; }
391   Bool_t           ReadAODMCParticles()              const { return fReadAODMCParticles    ; }
392         
393   //Select generated events, depending on comparison of pT hard and jets.
394   virtual Bool_t   ComparePtHardAndJetPt() ;
395   virtual Bool_t   IsPtHardAndJetPtComparisonSet()       const { return  fComparePtHardAndJetPt   ; }
396   virtual void     SetPtHardAndJetPtComparison(Bool_t compare) { fComparePtHardAndJetPt = compare ; }   
397   virtual Float_t  GetPtHardAndJetFactor()               const { return  fPtHardAndJetPtFactor    ; }
398   virtual void     SetPtHardAndJetPtFactor(Float_t factor)     { fPtHardAndJetPtFactor = factor   ; }           
399   
400   virtual Bool_t   ComparePtHardAndClusterPt() ;
401   virtual Bool_t   IsPtHardAndClusterPtComparisonSet()       const { return  fComparePtHardAndClusterPt   ; }
402   virtual void     SetPtHardAndClusterPtComparison(Bool_t compare) { fComparePtHardAndClusterPt = compare ; }   
403   virtual Float_t  GetPtHardAndClusterFactor()               const { return  fPtHardAndClusterPtFactor    ; }
404   virtual void     SetPtHardAndClusterPtFactor(Float_t factor)     { fPtHardAndClusterPtFactor = factor   ; }           
405   
406   
407   //MC reader methods, declared there to allow compilation, they are only used in the MC reader:
408   
409   virtual void AddNeutralParticlesArray(TArrayI & /*array*/) { ; }  
410   virtual void AddChargedParticlesArray(TArrayI & /*array*/) { ; } 
411   virtual void AddStatusArray(TArrayI & /*array*/)           { ; }
412   
413   virtual void SwitchOnPi0Decay()                            { ; } 
414   virtual void SwitchOffPi0Decay()                           { ; } 
415   virtual void SwitchOnStatusSelection()                     { ; }
416   virtual void SwitchOffStatusSelection()                    { ; }
417   virtual void SwitchOnOverlapCheck()                        { ; }
418   virtual void SwitchOffOverlapCheck()                       { ; }
419   virtual void SwitchOnOnlyGeneratorParticles()              { ; }
420   virtual void SwitchOffOnlyGeneratorParticles()             { ; }
421
422   virtual void SetEMCALOverlapAngle(Float_t /*angle*/)       { ; }
423   virtual void SetPHOSOverlapAngle(Float_t /*angle*/)        { ; }
424
425   
426  protected:
427   Int_t            fEventNumber;            // Event number
428   Int_t            fDataType ;              // Select MC:Kinematics, Data:ESD/AOD, MCData:Both
429   Int_t            fDebug;                  // Debugging level
430   AliFiducialCut * fFiducialCut;            //! Acceptance cuts
431   Bool_t           fCheckFidCut ;           // Do analysis for clusters in defined region         
432
433   Bool_t           fComparePtHardAndJetPt;  // In MonteCarlo, jet events, reject fake events with wrong jet energy.
434   Float_t          fPtHardAndJetPtFactor;   // Factor between ptHard and jet pT to reject/accept event.
435
436   Bool_t           fComparePtHardAndClusterPt;  // In MonteCarlo, jet events, reject events with too large cluster energy
437   Float_t          fPtHardAndClusterPtFactor;   // Factor between ptHard and cluster pT to reject/accept event.
438   
439   Float_t          fCTSPtMin;               // pT Threshold on charged particles 
440   Float_t          fEMCALPtMin;             // pT Threshold on emcal clusters
441   Float_t          fPHOSPtMin;              // pT Threshold on phos clusters
442   Float_t          fCTSPtMax;               // pT Threshold on charged particles 
443   Float_t          fEMCALPtMax;             // pT Threshold on emcal clusters
444   Float_t          fPHOSPtMax;              // pT Threshold on phos clusters
445   Double_t         fEMCALTimeCutMin;        // Remove clusters/cells with time smaller than this value, in ns
446   Double_t         fEMCALTimeCutMax;        // Remove clusters/cells with time larger than this value, in ns
447   Float_t          fEMCALParamTimeCutMin[4];// Remove clusters/cells with time smaller than parametrized value, in ns
448   Double_t         fEMCALParamTimeCutMax[4];// Remove clusters/cells with time larger than parametrized value, in ns
449   Bool_t           fUseParamTimeCut;        // Use simple or parametrized time cut
450   
451   TList          * fAODBranchList ;         //-> List with AOD branches created and needed in analysis  
452   TObjArray      * fCTSTracks ;             //-> temporal array with tracks
453   TObjArray      * fEMCALClusters ;         //-> temporal array with EMCAL CaloClusters
454   TObjArray      * fPHOSClusters ;          //-> temporal array with PHOS  CaloClusters
455   AliVCaloCells  * fEMCALCells ;            //! temporal array with EMCAL CaloCells
456   AliVCaloCells  * fPHOSCells ;             //! temporal array with PHOS  CaloCells
457
458   AliVEvent      * fInputEvent;             //! pointer to esd or aod input
459   AliAODEvent    * fOutputEvent;            //! pointer to aod output
460   AliMCEvent     * fMC;                     //! Monte Carlo Event Handler  
461
462   Bool_t           fFillCTS;                // use data from CTS
463   Bool_t           fFillEMCAL;              // use data from EMCAL
464   Bool_t           fFillPHOS;               // use data from PHOS
465   Bool_t           fFillEMCALCells;         // use data from EMCAL
466   Bool_t           fFillPHOSCells;          // use data from PHOS
467   Bool_t           fRecalculateClusters;    // Correct clusters, recalculate them if recalibration parameters is given
468   Bool_t           fSelectEmbeddedClusters; // Use only simulated clusters that come from embedding.
469   
470   ULong_t          fTrackStatus        ;    // Track selection bit, select tracks refitted in TPC, ITS ...
471   ULong_t          fTrackFilterMask    ;    // Track selection bit, for AODs (any difference with track status?)
472   AliESDtrackCuts *fESDtrackCuts       ;    // Track cut 
473   Bool_t           fConstrainTrack     ;    // Constrain Track to vertex
474   Bool_t           fSelectHybridTracks ;    // Select CTS tracks of type hybrid (only for AODs)
475   Int_t            fTrackMult          ;    // Track multiplicity
476   Float_t          fTrackMultEtaCut    ;    // Track multiplicity eta cut
477   Bool_t           fReadStack          ;    // Access kine information from stack
478   Bool_t                 fReadAODMCParticles ;    // Access kine information from filtered AOD MC particles
479         
480   TString          fDeltaAODFileName   ;    // Delta AOD file name
481   TString          fFiredTriggerClassName;  // Name of trigger event type used to do the analysis
482
483   UInt_t           fEventTriggerMask ;      // select this triggerered event
484   UInt_t           fMixEventTriggerMask ;   // select this triggerered event for mixing, tipically kMB or kAnyINT
485   Bool_t           fEventTriggerAtSE;       // select triggered event at SE base task or here
486   
487   Bool_t           fAnaLED;                 // Analyze LED data only.
488
489   TString          fTaskName;               // Name of task that executes the analysis
490         
491   AliCalorimeterUtils * fCaloUtils ;        //  Pointer to CalorimeterUtils
492
493   AliMixedEvent  * fMixedEvent  ;           //! mixed event object. This class is not the owner
494   Int_t            fNMixedEvent ;           // number of events in mixed event buffer
495   Double_t      ** fVertex      ;           //! vertex array 3 dim for each mixed event buffer
496   
497   TList **         fListMixedTracksEvents ; //! Container for tracks stored for different events, used in case of own mixing, set in analysis class
498   TList **         fListMixedCaloEvents;    //! Container for photon stored for different events, used in case of own mixing, set in analysis class
499   Int_t            fLastMixedTracksEvent  ; //  Temporary container with the last event added to the mixing list for tracks
500   Int_t            fLastMixedCaloEvent ;    //  Temporary container with the last event added to the mixing list for photons
501   
502   Bool_t           fWriteOutputDeltaAOD;    // Write the created delta AOD objects into file  
503         Bool_t           fOldAOD;                 // Old AODs, before revision 4.20
504   
505   Int_t            fV0ADC[2]    ;           // Integrated V0 signal
506   Int_t            fV0Mul[2]    ;           // Integrated V0 Multiplicity
507
508   Bool_t           fCaloFilterPatch;        // CaloFilter patch
509   TString          fEMCALClustersListName;  // Alternative list of clusters produced elsewhere and not from InputEvent
510   
511   // Event selection
512   Float_t          fZvtxCut ;                      // Cut on vertex position
513   Bool_t           fAcceptFastCluster;           // Accept events from fast cluster, exclude these events for LHC11a
514   Bool_t           fRemoveLEDEvents;             // Remove events where LED was wrongly firing - EMCAL LHC11a
515   Bool_t           fDoEventSelection;            // Select events depending on V0, pileup, vertex well reconstructed, at least 1 track ...
516   Bool_t           fDoV0ANDEventSelection;       // Select events depending on V0, fDoEventSelection should be on
517   Bool_t           fUseEventsWithPrimaryVertex ; // Select events with primary vertex
518   AliTriggerAnalysis* fTriggerAnalysis;          // Access to trigger selection algorithm for V0AND calculation
519   Double_t         fPileUpParamSPD[5];           // Parameters to pass to method IsPileupFromSPD: Int_t minContributors,
520                                                  // Double_t minZdist, 
521                                                  // Double_t nSigmaZdist, 
522                                                  // Double_t nSigmaDiamXY, 
523                                                  // Double_t nSigmaDiamZ)
524   // Pile-up in EMCal
525   Int_t            fNPileUpClusters;             // Number of clusters with time avobe 20 ns
526   Int_t            fNNonPileUpClusters;          // Number of clusters with time below 20 ns
527   Int_t            fNPileUpClustersCut;          // Cut to select event as pile-up
528
529   //Centrality/Event plane
530   TString          fCentralityClass;        // Name of selected centrality class     
531   Int_t            fCentralityOpt;          // Option for the returned value of the centrality, possible options 5, 10, 100
532   Int_t            fCentralityBin[2];       // Minimum and maximum value of the centrality for the analysis
533   TString          fEventPlaneMethod;       // Name of event plane method, by default "Q"
534   
535   Bool_t           fImportGeometryFromFile; // Import geometry settings in geometry.root file
536   TString          fImportGeometryFilePath; // path fo geometry.root file
537
538   
539   AliCaloTrackReader(              const AliCaloTrackReader & r) ; // cpy ctor
540   AliCaloTrackReader & operator = (const AliCaloTrackReader & r) ; // cpy assignment
541   
542   ClassDef(AliCaloTrackReader,46)
543   
544 } ;
545
546
547 #endif //ALICALOTRACKREADER_H
548
549
550