]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/CaloTrackCorrBase/AliCaloTrackReader.h
24df3f4534565ceafbc936bad2375b00a5cde36a
[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 //jets
45 class AliAODJetEventBackground;
46
47 class AliCaloTrackReader : public TObject {
48
49 public: 
50   
51   AliCaloTrackReader() ;          // ctor
52   virtual ~AliCaloTrackReader() ; // virtual dtor
53   
54   //--------------------------------
55   // General methods
56   //--------------------------------
57
58   virtual void    Init();
59     
60   virtual void    InitParameters();
61   
62   virtual void    Print(const Option_t * opt) const;
63   
64   virtual void    ResetLists();
65
66   virtual Int_t   GetDebug()                         const { return fDebug                 ; }
67   virtual void    SetDebug(Int_t d)                        { fDebug = d                    ; }
68   
69   enum inputDataType {kESD, kAOD, kMC};
70   virtual Int_t   GetDataType()                      const { return fDataType              ; }
71   virtual void    SetDataType(Int_t data )                 { fDataType = data              ; }
72
73   virtual Int_t   GetEventNumber()                   const { return fEventNumber           ; }
74         
75   TString         GetTaskName()                      const { return fTaskName              ; }
76   void            SetTaskName(TString name)                { fTaskName = name              ; }
77     
78   //---------------------------------------
79   // Input/output event setters and getters
80   //---------------------------------------
81   
82   virtual void    SetInputEvent(AliVEvent* input) ;
83   virtual void    SetOutputEvent(AliAODEvent*  aod)        { fOutputEvent = aod            ; }
84   virtual void    SetMC(AliMCEvent* const mc)              { fMC          = mc             ; }
85   virtual void    SetInputOutputMCEvent(AliVEvent* /*esd*/, AliAODEvent* /*aod*/, AliMCEvent* /*mc*/) { ; }
86   
87   // Delta AODs
88   
89   virtual TList * GetAODBranchList()                 const { return fAODBranchList         ; }
90   void            SetDeltaAODFileName(TString name )       { fDeltaAODFileName = name      ; }
91   TString         GetDeltaAODFileName()              const { return fDeltaAODFileName      ; }
92   void            SwitchOnWriteDeltaAOD()                  { fWriteOutputDeltaAOD = kTRUE  ; }
93   void            SwitchOffWriteDeltaAOD()                 { fWriteOutputDeltaAOD = kFALSE ; }
94   Bool_t          WriteDeltaAODToFile()              const { return fWriteOutputDeltaAOD   ; } 
95   
96   //------------------------------------------------------------
97   // Clusters/Tracks arrays filtering/filling methods and switchs 
98   //------------------------------------------------------------
99   
100   // Minimum pt setters and getters
101   
102   Float_t          GetEMCALPtMin()                   const { return fEMCALPtMin            ; }
103   Float_t          GetPHOSPtMin()                    const { return fPHOSPtMin             ; }
104   Float_t          GetCTSPtMin()                     const { return fCTSPtMin              ; }
105   Float_t          GetEMCALPtMax()                   const { return fEMCALPtMax            ; }
106   Float_t          GetPHOSPtMax()                    const { return fPHOSPtMax             ; }
107   Float_t          GetCTSPtMax()                     const { return fCTSPtMax              ; }
108   
109   void             SetEMCALPtMin(Float_t  pt)              { fEMCALPtMin = pt              ; }
110   void             SetPHOSPtMin (Float_t  pt)              { fPHOSPtMin  = pt              ; }
111   void             SetCTSPtMin  (Float_t  pt)              { fCTSPtMin   = pt              ; }  
112   
113   void             SetEMCALPtMax(Float_t  pt)              { fEMCALPtMax = pt              ; }
114   void             SetPHOSPtMax (Float_t  pt)              { fPHOSPtMax  = pt              ; }
115   void             SetCTSPtMax  (Float_t  pt)              { fCTSPtMax   = pt              ; }  
116    
117   Float_t          GetEMCALEMin()                    const { return GetEMCALPtMin()        ; }
118   Float_t          GetPHOSEMin()                     const { return GetPHOSPtMin()         ; }
119   Float_t          GetEMCALEMax()                    const { return GetEMCALPtMax()        ; }
120   Float_t          GetPHOSEMax()                     const { return GetPHOSPtMax()         ; }
121   
122   void             SetEMCALEMin (Float_t  e)               { SetEMCALPtMin(e)              ; }
123   void             SetPHOSEMin  (Float_t  e)               { SetPHOSPtMin (e)              ; }
124   void             SetEMCALEMax (Float_t  e)               { SetEMCALPtMax(e)              ; }
125   void             SetPHOSEMax  (Float_t  e)               { SetPHOSPtMax (e)              ; }
126   
127   // Track DCA cut
128   
129   Bool_t           AcceptDCA(Float_t pt, Float_t dca);
130   Double_t         GetTrackDCACut(Int_t i)           const { if(i >= 0 && i < 3 ) return fTrackDCACut[i] ;
131                                                              else return -999              ; }
132   
133   void             SetTrackDCACut(Int_t i, Float_t cut)    { if(i >= 0 && i < 3 )
134                                                              fTrackDCACut[i] = cut         ; }
135   
136   void             SwitchOnUseTrackDCACut()                { fUseTrackDCACut = kTRUE       ; }
137   void             SwitchOffUseTrackDCACut()               { fUseTrackDCACut = kFALSE      ; }
138   Bool_t           IsDCACutOn()                      const { return fUseTrackDCACut        ; }
139   
140   // Time cut
141   
142   Double_t         GetTrackTimeCutMin()              const { return fTrackTimeCutMin       ; }
143   Double_t         GetTrackTimeCutMax()              const { return fTrackTimeCutMax       ; }
144   
145   void             SetTrackTimeCut(Double_t a, Double_t b) { fTrackTimeCutMin = a ;
146                                                              fTrackTimeCutMax = b          ; } // ns
147   
148   void             SwitchOnUseTrackTimeCut()               { fUseTrackTimeCut = kTRUE      ;  fAccessTrackTOF  = kTRUE ; }
149   void             SwitchOffUseTrackTimeCut()              { fUseTrackTimeCut = kFALSE     ; }
150
151   void             SwitchOnAccessTrackTimeCut()            { fAccessTrackTOF  = kTRUE      ; }
152   void             SwitchOffAccessTrackTimeCut()           { fAccessTrackTOF  = kFALSE     ; }
153   Bool_t           IsAccessToTrackTimeOn()           const { return fAccessTrackTOF        ; }
154
155   
156   Double_t         GetEMCALTimeCutMin()              const { return fEMCALTimeCutMin       ; }
157   Double_t         GetEMCALTimeCutMax()              const { return fEMCALTimeCutMax       ; }  
158
159   Bool_t           IsInTimeWindow(Double_t tof, Float_t energy)  const ;
160   
161   void             SetEMCALTimeCut(Double_t a, Double_t b) { fEMCALTimeCutMin = a ; 
162                                                              fEMCALTimeCutMax = b          ; } // ns
163   
164   void             SetEMCALParametrizedMinTimeCut(Int_t i, Float_t par) { fEMCALParamTimeCutMin[i] = par ; } 
165   void             SetEMCALParametrizedMaxTimeCut(Int_t i, Float_t par) { fEMCALParamTimeCutMax[i] = par ; } 
166   
167   void             SwitchOnUseEMCALTimeCut()               { fUseEMCALTimeCut = kTRUE      ; }
168   void             SwitchOffUseEMCALTimeCut()              { fUseEMCALTimeCut = kFALSE     ; }
169   
170   void             SwitchOnUseParametrizedTimeCut()        { fUseParamTimeCut = kTRUE      ; }
171   void             SwitchOffUseParametrizedTimeCut()       { fUseParamTimeCut = kFALSE     ; }
172
173   // Fidutial cuts
174   
175   virtual AliFiducialCut * GetFiducialCut()                { 
176                     if(!fFiducialCut) fFiducialCut = new AliFiducialCut(); 
177                     return  fFiducialCut                                                   ; }
178   virtual void     SetFiducialCut(AliFiducialCut * fc)     { fFiducialCut = fc           ; }
179   virtual Bool_t   IsFiducialCutOn()                 const { return fCheckFidCut           ; }
180   virtual void     SwitchOnFiducialCut()                   { fCheckFidCut = kTRUE          ; 
181                                                              fFiducialCut = new AliFiducialCut() ; }
182   virtual void     SwitchOffFiducialCut()                  { fCheckFidCut = kFALSE         ; }
183   
184   // Cluster origin
185   
186   Bool_t           IsEMCALCluster(AliVCluster *clus) const;
187   Bool_t           IsPHOSCluster (AliVCluster *clus) const;
188   
189   // Patch for cluster origin for Old AODs implementation
190   
191   void             SwitchOnOldAODs()                       { fOldAOD = kTRUE               ; }
192   void             SwitchOffOldAODs()                      { fOldAOD = kFALSE              ; }
193   
194   // Cluster/track/cells switchs
195   
196   Bool_t           IsCTSSwitchedOn()                 const { return fFillCTS               ; }
197   void             SwitchOnCTS()                           { fFillCTS = kTRUE              ; }
198   void             SwitchOffCTS()                          { fFillCTS = kFALSE             ; }
199
200   Bool_t           IsEMCALSwitchedOn()               const { return fFillEMCAL             ; }
201   void             SwitchOnEMCAL()                         { fFillEMCAL = kTRUE            ; }
202   void             SwitchOffEMCAL()                        { fFillEMCAL = kFALSE           ; }
203
204   Bool_t           IsPHOSSwitchedOn()                const { return fFillPHOS              ; }
205   void             SwitchOnPHOS()                          { fFillPHOS = kTRUE             ; }
206   void             SwitchOffPHOS()                         { fFillPHOS = kFALSE            ; }
207
208   Bool_t           IsEMCALCellsSwitchedOn()          const { return fFillEMCALCells        ; }
209   void             SwitchOnEMCALCells()                    { fFillEMCALCells = kTRUE       ; }
210   void             SwitchOffEMCALCells()                   { fFillEMCALCells = kFALSE      ; }
211
212   Bool_t           IsPHOSCellsSwitchedOn()           const { return fFillPHOSCells         ; }
213   void             SwitchOnPHOSCells()                     { fFillPHOSCells = kTRUE        ; }
214   void             SwitchOffPHOSCells()                    { fFillPHOSCells = kFALSE       ; }
215
216   Bool_t           AreClustersRecalculated()         const { return fRecalculateClusters   ; }
217   void             SwitchOnClusterRecalculation()          { fRecalculateClusters = kTRUE  ; }
218   void             SwitchOffClusterRecalculation()         { fRecalculateClusters = kFALSE ; }  
219
220   void             SwitchOnClusterELinearityCorrection()   { fCorrectELinearity = kTRUE    ; }
221   void             SwitchOffClusterELinearityCorrection()  { fCorrectELinearity = kFALSE   ; }
222
223   Bool_t           IsEmbeddedClusterSelectionOn()    const { return fSelectEmbeddedClusters   ; }
224   void             SwitchOnEmbeddedClustersSelection()     { fSelectEmbeddedClusters = kTRUE  ; }
225   void             SwitchOffEmbeddedClustersSelection()    { fSelectEmbeddedClusters = kFALSE ; }
226   
227   // Filling/ filtering / detector information access methods
228   
229   virtual Bool_t   FillInputEvent(Int_t iEntry, const char *currentFileName)  ;
230   virtual void     FillInputCTS() ;
231   virtual void     FillInputEMCAL() ;
232   virtual void     FillInputEMCALAlgorithm(AliVCluster * clus, Int_t iclus) ;
233   virtual void     FillInputPHOS() ;
234   virtual void     FillInputEMCALCells() ;
235   virtual void     FillInputPHOSCells() ;
236   virtual void     FillInputVZERO() ;  
237   
238   Int_t            GetV0Signal(Int_t i)              const { return fV0ADC[i]               ; }
239   Int_t            GetV0Multiplicity(Int_t i)        const { return fV0Mul[i]               ; }
240   
241   void             SetEMCALClusterListName(TString &name)  { fEMCALClustersListName = name  ; }
242   TString          GetEMCALClusterListName()         const { return fEMCALClustersListName  ; }
243
244   // Arrays with clusters/track/cells access method
245   
246   virtual TObjArray*     GetCTSTracks()              const { return fCTSTracks              ; }
247   virtual TObjArray*     GetEMCALClusters()          const { return fEMCALClusters          ; }
248   virtual TObjArray*     GetPHOSClusters()           const { return fPHOSClusters           ; }
249   virtual AliVCaloCells* GetEMCALCells()             const { return fEMCALCells             ; }
250   virtual AliVCaloCells* GetPHOSCells()              const { return fPHOSCells              ; }
251   
252   //-------------------------------------
253   // Event/track selection methods
254   //-------------------------------------
255   
256   void             AcceptFastClusterEvents()               { fAcceptFastCluster     = kTRUE  ; } 
257   void             RejectFastClusterEvents()               { fAcceptFastCluster     = kFALSE ; }  
258   Bool_t           IsFastClusterAccepted()           const { return fAcceptFastCluster       ; }   
259   
260   Bool_t           AcceptEventWithTriggerBit();
261   Bool_t           RejectEventWithTriggerBit();
262   void             SetAcceptEventsWithBit(UInt_t bit)      { Int_t n = fAcceptEventsWithBit.GetSize();
263                                                              fAcceptEventsWithBit.Set(n+1);
264                                                              fAcceptEventsWithBit.AddAt(bit,n) ; }
265   
266   void             SetRejectEventsWithBit(UInt_t bit)      { Int_t n = fRejectEventsWithBit.GetSize();
267                                                              fRejectEventsWithBit.Set(n+1);
268                                                              fRejectEventsWithBit.AddAt(bit,n) ; }
269
270   void             SwitchOnLEDEventsRemoval()              { fRemoveLEDEvents       = kTRUE  ; }
271   void             SwitchOffLEDEventsRemoval()             { fRemoveLEDEvents       = kFALSE ; }
272   Bool_t           IsLEDEventRemoved()               const { return fRemoveLEDEvents         ; }   
273   Bool_t           RejectLEDEvents();
274   
275   void             SetFiredTriggerClassName(TString name ) { fFiredTriggerClassName = name   ; }
276   TString          GetFiredTriggerClassName()        const { return fFiredTriggerClassName   ; }
277   TString          GetFiredTriggerClasses()          const { return GetInputEvent()->GetFiredTriggerClasses() ; }
278   
279   UInt_t           GetEventTriggerMask()             const { return fEventTriggerMask        ; }
280   void             SetEventTriggerMask(UInt_t evtTrig = AliVEvent::kAny) 
281                                                            { fEventTriggerMask = evtTrig     ; }
282         Bool_t           IsEventTriggerAtSEOn()            const { return fEventTriggerAtSE        ; }
283   void             SwitchOnEventTriggerAtSE()              { fEventTriggerAtSE      = kTRUE  ; }
284   void             SwitchOffEventTriggerAtSE()             { fEventTriggerAtSE      = kFALSE ; }
285                 
286         
287   TArrayI          GetTriggerPatches(Int_t tmin, Int_t tmax);
288   void             MatchTriggerCluster(TArrayI patches);
289
290   Bool_t           CheckEventTriggers();
291   
292   Bool_t           IsExoticEvent()                   const { return fIsExoticEvent           ; }
293   Bool_t           IsBadCellTriggerEvent()           const { return fIsBadCellEvent          ; }
294   Bool_t           IsBadMaxCellTriggerEvent()        const { return fIsBadMaxCellEvent       ; }
295   Bool_t           IsTriggerMatched()                const { return fIsTriggerMatch          ; }
296   Bool_t           IsTriggerMatchedOpenCuts(Int_t i) const { return fIsTriggerMatchOpenCut[i]; }
297   
298   Int_t            GetTriggerClusterBC()             const { return fTriggerClusterBC        ; }
299   Int_t            GetTriggerClusterIndex()          const { return fTriggerClusterIndex     ; }
300   Int_t            GetTriggerClusterId()             const { return fTriggerClusterId        ; }
301   
302   Float_t          GetEventTriggerL0Threshold()      const { return fTriggerL0EventThreshold ; }
303   void             SetEventTriggerL0Threshold(Float_t tr)  { fTriggerL0EventThreshold   = tr ; }
304   Float_t          GetEventTriggerL1Threshold()      const { return fTriggerL1EventThreshold ; }
305   void             SetEventTriggerL1Threshold(Float_t tr)  { fTriggerL1EventThreshold   = tr ; fTriggerL1EventThresholdFix = kTRUE; }
306
307   void             SetEventTriggerL1Bit(Int_t ega, Int_t eje) { fBitEGA   = ega ; fBitEJE = eje; }
308   
309   void             SetTriggerPatchTimeWindow(Int_t min, Int_t max) { fTriggerPatchTimeWindow[0] = min ;
310                                                                      fTriggerPatchTimeWindow[1] = max ; }
311   
312   Bool_t           AreBadTriggerEventsRemoved()      const { return fRemoveBadTriggerEvents     ; }
313   void             SwitchOffBadTriggerEventsRemoval()      { fRemoveBadTriggerEvents   = kFALSE ; }
314   void             SwitchOnBadTriggerEventsRemoval()       { fRemoveBadTriggerEvents   = kTRUE  ; }
315
316   Bool_t           AreUnMatchedTriggerEventsRemoved()const { return fRemoveUnMatchedTriggers    ; }
317   void             SwitchOffUnMatchedTriggerEventsRemoval(){ fRemoveUnMatchedTriggers  = kFALSE ; }
318   void             SwitchOnUnMatchedTriggerEventsRemoval() { fRemoveUnMatchedTriggers  = kTRUE  ; }
319   
320   Bool_t           IsTriggerPatchMatchedToCluster()  const { return fTriggerPatchClusterMatch   ; }
321   void             SwitchOffTriggerPatchMatching()         { fTriggerPatchClusterMatch = kFALSE ; }
322   void             SwitchOnTriggerPatchMatching()          { fTriggerPatchClusterMatch = kTRUE  ; }
323   
324   Bool_t           IsTriggerClusterTimeRecal()       const { return fTriggerClusterTimeRecal    ; }
325   void             SwitchOnTriggerClusterTimeRecal ()      { fTriggerClusterTimeRecal  = kTRUE  ; }
326   void             SwitchOffTriggerClusterTimeRecal()      { fTriggerClusterTimeRecal  = kFALSE ; }
327   
328   UInt_t           GetMixEventTriggerMask()             const { return fMixEventTriggerMask  ; }
329   void             SetMixEventTriggerMask(UInt_t evtTrig = AliVEvent::kAnyINT) 
330                                                            { fMixEventTriggerMask = evtTrig  ; }
331         void             SetEventTriggerBit();
332         Bool_t           IsEventMinimumBias()              const { return fEventTrigMinBias        ; }
333         Bool_t           IsEventCentral()                  const { return fEventTrigCentral        ; }
334         Bool_t           IsEventSemiCentral()              const { return fEventTrigSemiCentral    ; }
335         Bool_t           IsEventEMCALL0()                  const { return fEventTrigEMCALL0        ; }
336         Bool_t           IsEventEMCALL1Gamma1()            const { return fEventTrigEMCALL1Gamma1  ; }
337         Bool_t           IsEventEMCALL1Gamma2()            const { return fEventTrigEMCALL1Gamma2  ; }
338         Bool_t           IsEventEMCALL1Jet1()              const { return fEventTrigEMCALL1Jet1    ; }
339         Bool_t           IsEventEMCALL1Jet2()              const { return fEventTrigEMCALL1Jet2    ; }
340         Bool_t           IsEventEMCALL1Gamma()             const { return (fEventTrigEMCALL1Gamma1 || fEventTrigEMCALL1Gamma2) ; }
341   Bool_t           IsEventEMCALL1Jet()               const { return (fEventTrigEMCALL1Jet1   || fEventTrigEMCALL1Jet2  ) ; }
342         Bool_t           IsEventEMCALL1()                  const { return (IsEventEMCALL1Gamma()   || IsEventEMCALL1Jet()    ) ; }
343         
344   void             SwitchOnEMCALEventRejectionWith2Thresholds()  { fRejectEMCalTriggerEventsWith2Tresholds = kTRUE  ; }
345   void             SwitchOffEMCALEventRejectionWith2Thresholds() { fRejectEMCalTriggerEventsWith2Tresholds = kFALSE ; }
346         
347   void             SwitchOnPileUpEventRejection()          { fDoPileUpEventRejection= kTRUE  ; }
348   void             SwitchOffPileUpEventRejection()         { fDoPileUpEventRejection= kFALSE ; }
349   Bool_t           IsPileUpEventRejectionDone()      const { return fDoPileUpEventRejection  ; }
350   
351   void             SwitchOnV0ANDSelection()                { fDoV0ANDEventSelection = kTRUE  ; }
352   void             SwitchOffV0ANDSelection()               { fDoV0ANDEventSelection = kFALSE ; }
353   Bool_t           IsV0ANDEventSelectionDone()       const { return fDoV0ANDEventSelection   ; } 
354
355   void             SwitchOnVertexBCEventSelection()        { fDoVertexBCEventSelection = kTRUE  ; }
356   void             SwitchOffVertexBCEventSelection()       { fDoVertexBCEventSelection = kFALSE ; }
357   Bool_t           IsVertexBCEventSelectionDone()    const { return fDoVertexBCEventSelection   ; }
358   
359   void             SwitchOnPrimaryVertexSelection()        { fUseEventsWithPrimaryVertex = kTRUE  ; }
360   void             SwitchOffPrimaryVertexSelection()       { fUseEventsWithPrimaryVertex = kFALSE ; }
361   Bool_t           IsPrimaryVertexSelectionDone()    const { return fUseEventsWithPrimaryVertex   ; } 
362   
363   void             SwitchOnRejectNoTrackEvents()           { fDoRejectNoTrackEvents = kTRUE  ; }
364   void             SwitchOffRejectNoTrackEvents()          { fDoRejectNoTrackEvents = kFALSE ; }
365   Bool_t           IsEventWithNoTrackRejectionDone() const { return fDoRejectNoTrackEvents   ; }
366   
367
368   // Time Stamp
369   
370   Double_t         GetRunTimeStampMin()              const { return fTimeStampRunMin         ; }
371   Double_t         GetRunTimeStampMax()              const { return fTimeStampRunMax         ; }
372   
373   void             SetRunTimeStamp(Double_t a, Double_t b) { fTimeStampRunMin = a            ;
374                                                              fTimeStampRunMax = b            ; } // seconds
375   
376   Float_t          GetEventTimeStampFractionMin()    const { return fTimeStampEventFracMin   ; }
377   Float_t          GetEventTimeStampFractionMax()    const { return fTimeStampEventFracMax   ; }
378   
379   void             SetEventTimeStampFraction(Float_t a, Float_t b) { fTimeStampEventFracMin = a ;
380                                                                      fTimeStampEventFracMax = b ; }
381   
382   void             SwitchOnSelectEventTimeStamp()          { fTimeStampEventSelect = kTRUE   ; }
383   void             SwitchOffSelectEventTimeStamp()         { fTimeStampEventSelect = kFALSE  ; }
384   
385   Bool_t           IsSelectEventTimeStampOn()              {return  fTimeStampEventSelect    ; }
386   
387   Bool_t           IsPileUpFromSPD()               const ;
388   Bool_t           IsPileUpFromEMCal()             const ;
389   Bool_t           IsPileUpFromSPDAndEMCal()       const ;
390   Bool_t           IsPileUpFromSPDOrEMCal()        const ;
391   Bool_t           IsPileUpFromSPDAndNotEMCal()    const ;
392   Bool_t           IsPileUpFromEMCalAndNotSPD()    const ;
393   Bool_t           IsPileUpFromNotSPDAndNotEMCal() const ;
394
395   void             SetPileUpParamForSPD  (Int_t i, Double_t param)
396                                                            { fPileUpParamSPD[i]  = param  ; }
397   void             SetPileUpParamForEMCal(Int_t param)     { fNPileUpClustersCut = param  ; }
398   
399   Int_t            GetNPileUpClusters()                    { return  fNPileUpClusters     ; }
400   Int_t            GetNNonPileUpClusters()                 { return  fNNonPileUpClusters  ; }
401   
402   Int_t            GetEMCalEventBC(Int_t bc)     const     { if(bc >=0 && bc < 19) return  fEMCalBCEvent   [bc] ; else return 0 ; }
403   Int_t            GetTrackEventBC(Int_t bc)     const     { if(bc >=0 && bc < 19) return  fTrackBCEvent   [bc] ; else return 0 ; }
404   Int_t            GetEMCalEventBCcut(Int_t bc)  const     { if(bc >=0 && bc < 19) return  fEMCalBCEventCut[bc] ; else return 0 ; }
405   Int_t            GetTrackEventBCcut(Int_t bc)  const     { if(bc >=0 && bc < 19) return  fTrackBCEventCut[bc] ; else return 0 ; }
406
407   void             SetEMCalEventBC(Int_t bc)               { if(bc >=0 && bc < 19) fEMCalBCEvent   [bc] = 1 ; }
408   void             SetTrackEventBC(Int_t bc)               { if(bc >=0 && bc < 19) fTrackBCEvent   [bc] = 1 ; }
409   void             SetEMCalEventBCcut(Int_t bc)            { if(bc >=0 && bc < 19) fEMCalBCEventCut[bc] = 1 ; }
410   void             SetTrackEventBCcut(Int_t bc)            { if(bc >=0 && bc < 19) fTrackBCEventCut[bc] = 1 ; }
411
412   Int_t            GetVertexBC(const AliVVertex * vtx);
413   Int_t            GetVertexBC()                  const    { return fVertexBC              ; }
414   void             SwitchOnRecalculateVertexBC()           { fRecalculateVertexBC = kTRUE  ; fAccessTrackTOF  = kTRUE ; }
415   void             SwitchOffRecalculateVertexBC()          { fRecalculateVertexBC = kFALSE ; }
416   
417   // Track selection
418   
419   ULong_t          GetTrackStatus()                  const { return fTrackStatus          ; }
420   void             SetTrackStatus(ULong_t bit)             { fTrackStatus = bit           ; }           
421
422   ULong_t          GetTrackFilterMask()              const { return fTrackFilterMask       ; }
423   void             SetTrackFilterMask(ULong_t bit)         { fTrackFilterMask = bit       ; }
424   
425   ULong_t          GetTrackFilterMaskComplementary() const { return fTrackFilterMaskComplementary       ; }
426   void             SetTrackFilterMaskComplementary(ULong_t bit) {   fTrackFilterMaskComplementary = bit ; }
427   
428   AliESDtrackCuts* GetTrackCuts()                    const { return fESDtrackCuts         ; }
429   void             SetTrackCuts(AliESDtrackCuts * cuts)    ;
430
431   AliESDtrackCuts* GetTrackComplementaryCuts()       const { return fESDtrackComplementaryCuts ; }
432   void             SetTrackComplementaryCuts(AliESDtrackCuts * cuts)  ;
433
434   
435   void             SwitchOnConstrainTrackToVertex()        { fConstrainTrack     = kTRUE  ; } 
436   void             SwitchOffConstrainTrackToVertex()       { fConstrainTrack     = kFALSE ; }
437   
438   void             SwitchOnAODHybridTrackSelection()       { fSelectHybridTracks = kTRUE  ; } 
439   void             SwitchOffAODHybridTrackSelection()      { fSelectHybridTracks = kFALSE ; }      
440
441   void             SwitchOnAODPrimaryTrackSelection()      { fSelectPrimaryTracks = kTRUE  ; }
442   void             SwitchOffAODPrimaryTrackSelection()     { fSelectPrimaryTracks = kFALSE ; }
443   
444   void             SwitchOnTrackHitSPDSelection()          { fSelectSPDHitTracks = kTRUE  ; }
445   void             SwitchOffTrackHitSPDSelection()         { fSelectSPDHitTracks = kFALSE ; }
446
447   void             SwitchOnAODTrackSharedClusterSelection() { fSelectFractionTPCSharedClusters = kTRUE  ; }
448   void             SwitchOffAODTrackSharedClusterSelection(){ fSelectFractionTPCSharedClusters = kFALSE ; }
449
450   void             SetTPCSharedClusterFraction(Float_t fr) { fCutTPCSharedClustersFraction = fr   ; }
451   Float_t          GetTPCSharedClusterFraction() const     { return fCutTPCSharedClustersFraction ; }
452   
453   Int_t            GetTrackMultiplicity()            const { return fTrackMult            ; }
454   Float_t          GetTrackMultiplicityEtaCut()      const { return fTrackMultEtaCut      ; }
455   void             SetTrackMultiplicityEtaCut(Float_t eta) { fTrackMultEtaCut = eta       ; }           
456   
457   // Calorimeter specific and patches
458   void             AnalyzeOnlyLED()                        { fAnaLED             = kTRUE  ; }
459   void             AnalyzeOnlyPhysics()                    { fAnaLED             = kFALSE ; }
460   
461   //-------------------------------
462   // Vertex methods
463   //-------------------------------
464
465   virtual void      GetVertex(Double_t v[3])         const ;
466   virtual Double_t* GetVertex(Int_t evtIndex)        const { return fVertex[evtIndex]            ; }
467   virtual void      GetVertex(Double_t vertex[3],    const Int_t evtIndex) const ;
468   virtual void      FillVertexArray();
469   virtual Bool_t    CheckForPrimaryVertex();
470   virtual Float_t   GetZvertexCut()                  const { return fZvtxCut                     ; } //cut on vertex position  
471   virtual void      SetZvertexCut(Float_t zcut=10.)        { fZvtxCut=zcut                       ; } //cut on vertex position
472
473   //--------------------------
474   // Centrality / Event Plane
475   //--------------------------
476
477   virtual AliCentrality* GetCentrality()             const { if(fDataType!=kMC) return fInputEvent->GetCentrality() ;
478                                                              else               return 0x0       ; } 
479   virtual void     SetCentralityClass(TString name)        { fCentralityClass   = name           ; }
480   virtual void     SetCentralityOpt(Int_t opt)             { fCentralityOpt     = opt            ; }
481   virtual TString  GetCentralityClass()              const { return fCentralityClass             ; }
482   virtual Int_t    GetCentralityOpt()                const { return fCentralityOpt               ; }
483   virtual Int_t    GetEventCentrality()              const ;
484   virtual void     SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
485                                                            { fCentralityBin[0]=min; fCentralityBin[1]=max;  
486                                                              if(min>=0 && max > 0) fCentralityOpt = 100 ; }
487   virtual Float_t  GetCentralityBin(Int_t i)         const { if(i < 0 || i > 1) return 0 ; 
488                                                              else return fCentralityBin[i]              ; }
489   
490   virtual AliEventplane* GetEventPlane()             const { if(fDataType!=kMC) return fInputEvent->GetEventplane() ;
491                                                              else               return 0x0       ; }  
492   virtual Double_t       GetEventPlaneAngle()        const ;          
493   virtual void           SetEventPlaneMethod(TString m)    { fEventPlaneMethod = m               ; }
494   virtual TString        GetEventPlaneMethod()       const { return fEventPlaneMethod            ; }
495
496   //--------------------
497   // Mixing
498   //--------------------
499
500   Int_t   GetLastCaloMixedEvent()                    const { return fLastMixedCaloEvent          ; }
501   Int_t   GetLastTracksMixedEvent ()                 const { return fLastMixedTracksEvent        ; }
502   
503   TList * GetListWithMixedEventsForCalo  (Int_t bi)  const { if(fListMixedCaloEvents)   return fListMixedCaloEvents[bi]     ; else return 0 ; }
504   TList * GetListWithMixedEventsForTracks(Int_t bi)  const { if(fListMixedTracksEvents) return fListMixedTracksEvents [bi]  ; else return 0 ; }  
505    
506   Bool_t  ListWithMixedEventsForCaloExists()         const { if(fListMixedCaloEvents) return kTRUE  ;
507                                                              else                     return kFALSE ; }
508
509   Bool_t  ListWithMixedEventsForTracksExists()       const { if(fListMixedTracksEvents) return kTRUE  ;
510                                                              else                       return kFALSE ; }
511   
512   void    SetLastCaloMixedEvent  (Int_t e)                 { fLastMixedCaloEvent    = e          ; }
513   void    SetLastTracksMixedEvent(Int_t e)                 { fLastMixedTracksEvent  = e          ; }
514   
515   void    SetListWithMixedEventsForCalo (TList ** l)       { 
516             if(fListMixedCaloEvents) printf("AliCaloTrackReader::SetListWithMixedEventsForCalo() - Track Mixing event list already set, nothing done\n");
517             else                        fListMixedCaloEvents    = l ; }
518   
519   void    SetListWithMixedEventsForTracks(TList ** l)      { 
520             if(fListMixedTracksEvents)  printf("AliCaloTrackReader::SetListWithMixedEventsForTracks() - Calorimeter Mixing event list already set, nothing done\n");
521             else                        fListMixedTracksEvents  = l ; }
522   
523   //-------------------------------------
524   // Other methods
525   //-------------------------------------
526   
527   AliCalorimeterUtils * GetCaloUtils()               const { return fCaloUtils                   ; }
528   void             SetCaloUtils(AliCalorimeterUtils * caloutils)  { fCaloUtils = caloutils       ; }  
529   
530   virtual Double_t GetBField()                       const { return fInputEvent->GetMagneticField()  ; } 
531   
532   //------------------------------------------------
533   // MC analysis specific methods
534   //-------------------------------------------------
535   
536   // Kinematics and galice.root available
537   
538   virtual AliStack*          GetStack()              const ;
539   virtual AliHeader*         GetHeader()             const ;
540   virtual AliGenEventHeader* GetGenEventHeader()     const ;
541   
542   // Filtered kinematics in AOD
543   
544   virtual TClonesArray*     GetAODMCParticles()      const ;
545   virtual AliAODMCHeader*   GetAODMCHeader   ()      const ;
546   
547   virtual AliVEvent*        GetInputEvent()          const { return fInputEvent            ; }
548   virtual AliVEvent*        GetOriginalInputEvent()  const { return 0x0                    ; }
549   virtual AliAODEvent*      GetOutputEvent()         const { return fOutputEvent           ; }
550   virtual AliMCEvent*       GetMC()                  const { return fMC                    ; }
551   virtual AliMixedEvent*    GetMixedEvent()          const { return fMixedEvent            ; }
552   virtual Int_t             GetNMixedEvent()         const { return fNMixedEvent           ; } 
553   
554   void             SwitchOnStack()                         { fReadStack          = kTRUE   ; }
555   void             SwitchOffStack()                        { fReadStack          = kFALSE  ; }
556   void             SwitchOnAODMCParticles()                { fReadAODMCParticles = kTRUE   ; }
557   void             SwitchOffAODMCParticles()               { fReadAODMCParticles = kFALSE  ; }
558   Bool_t           ReadStack()                       const { return fReadStack             ; }
559   Bool_t           ReadAODMCParticles()              const { return fReadAODMCParticles    ; }
560         
561   void             RemapMCLabelForAODs(Int_t &label);
562   
563   // Select generated events, depending on comparison of pT hard and jets
564     
565   virtual Bool_t   ComparePtHardAndJetPt() ;
566   virtual Bool_t   IsPtHardAndJetPtComparisonSet()       const { return  fComparePtHardAndJetPt   ; }
567   virtual void     SetPtHardAndJetPtComparison(Bool_t compare) { fComparePtHardAndJetPt = compare ; }   
568   virtual Float_t  GetPtHardAndJetFactor()               const { return  fPtHardAndJetPtFactor    ; }
569   virtual void     SetPtHardAndJetPtFactor(Float_t factor)     { fPtHardAndJetPtFactor = factor   ; }           
570   
571   virtual Bool_t   ComparePtHardAndClusterPt() ;
572   virtual Bool_t   IsPtHardAndClusterPtComparisonSet()       const { return  fComparePtHardAndClusterPt   ; }
573   virtual void     SetPtHardAndClusterPtComparison(Bool_t compare) { fComparePtHardAndClusterPt = compare ; }   
574   virtual Float_t  GetPtHardAndClusterFactor()               const { return  fPtHardAndClusterPtFactor    ; }
575   virtual void     SetPtHardAndClusterPtFactor(Float_t factor)     { fPtHardAndClusterPtFactor = factor   ; }           
576   
577   virtual Bool_t   IsHIJINGLabel(Int_t label);
578   void             SetGeneratorMinMaxParticles();
579   void             SwitchOnAcceptOnlyHIJINGLabels()          { fAcceptOnlyHIJINGLabels = kTRUE  ; }
580   void             SwitchOffAcceptOnlyHIJINGLabels()         { fAcceptOnlyHIJINGLabels = kFALSE ; }
581   Bool_t           AcceptOnlyHIJINGLabels()            const { return fAcceptOnlyHIJINGLabels   ; }
582   
583   // MC reader methods, declared there to allow compilation, they are only used in the MC reader
584   
585   virtual void AddNeutralParticlesArray(TArrayI & /*array*/) { ; }  
586   virtual void AddChargedParticlesArray(TArrayI & /*array*/) { ; } 
587   virtual void AddStatusArray(TArrayI & /*array*/)           { ; }
588   
589   virtual void SwitchOnPi0Decay()                            { ; } 
590   virtual void SwitchOffPi0Decay()                           { ; } 
591   virtual void SwitchOnStatusSelection()                     { ; }
592   virtual void SwitchOffStatusSelection()                    { ; }
593   virtual void SwitchOnOverlapCheck()                        { ; }
594   virtual void SwitchOffOverlapCheck()                       { ; }
595   virtual void SwitchOnOnlyGeneratorParticles()              { ; }
596   virtual void SwitchOffOnlyGeneratorParticles()             { ; }
597
598   virtual void SetEMCALOverlapAngle(Float_t /*angle*/)       { ; }
599   virtual void SetPHOSOverlapAngle(Float_t /*angle*/)        { ; }
600
601   //-------------
602   // Jets
603   //-------------
604   Bool_t       IsNonStandardJetsSwitchedOn()           const { return fFillInputNonStandardJetBranch   ; }
605   void         SwitchOnNonStandardJets()                     { fFillInputNonStandardJetBranch = kTRUE  ; }
606   void         SwitchOffNonStandardJets()                    { fFillInputNonStandardJetBranch = kFALSE ; }
607   
608   Bool_t       IsBackgroundJetsSwitchedOn()           const { return fFillInputBackgroundJetBranch   ; }
609   void         SwitchOnBackgroundJets()                     { fFillInputBackgroundJetBranch = kTRUE  ; }
610   void         SwitchOffBackgroundJets()                    { fFillInputBackgroundJetBranch = kFALSE ; }
611
612   virtual void FillInputNonStandardJets() ;
613   virtual TClonesArray* GetNonStandardJets()            const { return fNonStandardJets                 ; }
614   virtual void SetInputNonStandardJetBranchName(TString name) { fInputNonStandardJetBranchName   = name ; }
615   virtual TString GetInputNonStandardJetBranchName()          { return fInputNonStandardJetBranchName   ; }
616   
617   virtual void FillInputBackgroundJets() ;
618   virtual AliAODJetEventBackground* GetBackgroundJets() const { return fBackgroundJets                 ; }
619   virtual void SetInputBackgroundJetBranchName(TString name) { fInputBackgroundJetBranchName   = name ; }
620   virtual TString GetInputBackgroundJetBranchName()          { return fInputBackgroundJetBranchName   ; }
621
622  protected:
623   Int_t            fEventNumber;               // Event number
624   Int_t            fDataType ;                 // Select MC:Kinematics, Data:ESD/AOD, MCData:Both
625   Int_t            fDebug;                     // Debugging level
626   AliFiducialCut * fFiducialCut;               // Acceptance cuts
627   Bool_t           fCheckFidCut ;              // Do analysis for clusters in defined region         
628
629   Bool_t           fComparePtHardAndJetPt;     // In MonteCarlo, jet events, reject fake events with wrong jet energy.
630   Float_t          fPtHardAndJetPtFactor;      // Factor between ptHard and jet pT to reject/accept event.
631
632   Bool_t           fComparePtHardAndClusterPt; // In MonteCarlo, jet events, reject events with too large cluster energy
633   Float_t          fPtHardAndClusterPtFactor;  // Factor between ptHard and cluster pT to reject/accept event.
634   
635   Float_t          fCTSPtMin;                  // pT Threshold on charged particles 
636   Float_t          fEMCALPtMin;                // pT Threshold on emcal clusters
637   Float_t          fPHOSPtMin;                 // pT Threshold on phos clusters
638   Float_t          fCTSPtMax;                  // pT Threshold on charged particles 
639   Float_t          fEMCALPtMax;                // pT Threshold on emcal clusters
640   Float_t          fPHOSPtMax;                 // pT Threshold on phos clusters
641   Bool_t           fUseEMCALTimeCut;           // Do time cut selection
642   Bool_t           fUseParamTimeCut;           // Use simple or parametrized time cut
643   Bool_t           fUseTrackTimeCut;           // Do time cut selection
644   Bool_t           fAccessTrackTOF;            // Access the track TOF, in case of problems when accessing GetTOFBunchCrossing
645   Double_t         fEMCALTimeCutMin;           // Remove clusters/cells with time smaller than this value, in ns
646   Double_t         fEMCALTimeCutMax;           // Remove clusters/cells with time larger than this value, in ns
647   Float_t          fEMCALParamTimeCutMin[4];   // Remove clusters/cells with time smaller than parametrized value, in ns
648   Double_t         fEMCALParamTimeCutMax[4];   // Remove clusters/cells with time larger than parametrized value, in ns
649   Double_t         fTrackTimeCutMin;           // Remove tracks with time smaller than this value, in ns
650   Double_t         fTrackTimeCutMax;           // Remove tracks with time larger than this value, in ns
651   Bool_t           fUseTrackDCACut;            // Do DCA selection
652   Double_t         fTrackDCACut[3];            // Remove tracks with DCA larger than cut, parameters of function stored here
653
654   TList          * fAODBranchList ;            //-> List with AOD branches created and needed in analysis
655   TObjArray      * fCTSTracks ;                //-> temporal array with tracks
656   TObjArray      * fEMCALClusters ;            //-> temporal array with EMCAL CaloClusters
657   TObjArray      * fPHOSClusters ;             //-> temporal array with PHOS  CaloClusters
658   AliVCaloCells  * fEMCALCells ;               //! temporal array with EMCAL CaloCells
659   AliVCaloCells  * fPHOSCells ;                //! temporal array with PHOS  CaloCells
660
661   AliVEvent      * fInputEvent;                //! pointer to esd or aod input
662   AliAODEvent    * fOutputEvent;               //! pointer to aod output
663   AliMCEvent     * fMC;                        //! Monte Carlo Event Handler  
664
665   Bool_t           fFillCTS;                   // use data from CTS
666   Bool_t           fFillEMCAL;                 // use data from EMCAL
667   Bool_t           fFillPHOS;                  // use data from PHOS
668   Bool_t           fFillEMCALCells;            // use data from EMCAL
669   Bool_t           fFillPHOSCells;             // use data from PHOS
670   Bool_t           fRecalculateClusters;       // Correct clusters, recalculate them if recalibration parameters is given
671   Bool_t           fCorrectELinearity;         // Correct cluster linearity, always on
672   Bool_t           fSelectEmbeddedClusters;    // Use only simulated clusters that come from embedding.
673   
674   ULong_t          fTrackStatus        ;       // Track selection bit, select tracks refitted in TPC, ITS ...
675   ULong_t          fTrackFilterMask    ;       // Track selection bit, for AODs (any difference with track status?)
676   ULong_t          fTrackFilterMaskComplementary;       // Complementary Track selection bit, for AODs in case hybrid option selected
677   AliESDtrackCuts *fESDtrackCuts       ;       // Track cut
678   AliESDtrackCuts *fESDtrackComplementaryCuts; // Track cut, complementary cuts for hybrids
679   Bool_t           fConstrainTrack     ;       // Constrain Track to vertex
680   Bool_t           fSelectHybridTracks ;       // Select CTS tracks of type hybrid (only for AODs)
681   Bool_t           fSelectPrimaryTracks ;      // Select CTS tracks of type hybrid (only for AODs)
682   Bool_t           fSelectSPDHitTracks ;       // Ensure that track hits SPD layers
683   Bool_t           fSelectFractionTPCSharedClusters; // Accept only TPC tracks with over a given fraction of shared clusters
684   Float_t          fCutTPCSharedClustersFraction;    // Fraction of TPC shared clusters to be accepted.
685   Int_t            fTrackMult          ;       // Track multiplicity
686   Float_t          fTrackMultEtaCut    ;       // Track multiplicity eta cut
687   Bool_t           fReadStack          ;       // Access kine information from stack
688   Bool_t                 fReadAODMCParticles ;       // Access kine information from filtered AOD MC particles
689         
690   TString          fDeltaAODFileName   ;       // Delta AOD file name
691   TString          fFiredTriggerClassName;     // Name of trigger event type used to do the analysis
692
693         // Trigger bit
694   UInt_t           fEventTriggerMask ;         // select this triggerered event
695   UInt_t           fMixEventTriggerMask ;      // select this triggerered event for mixing, tipically kMB or kAnyINT
696   Bool_t           fEventTriggerAtSE;          // select triggered event at SE base task or here
697   
698         Bool_t           fEventTrigMinBias ;         // Event is min bias on its name, it should correspond to AliVEvent::kMB, AliVEvent::kAnyInt
699         Bool_t           fEventTrigCentral ;         // Event is AliVEvent::kCentral on its name,  it should correspond to PbPb
700         Bool_t           fEventTrigSemiCentral ;     // Event is AliVEvent::kSemiCentral on its name,  it should correspond to PbPb 
701         Bool_t           fEventTrigEMCALL0 ;         // Event is EMCal L0 on its name, it should correspond to AliVEvent::kEMC7, AliVEvent::kEMC1
702         Bool_t           fEventTrigEMCALL1Gamma1 ;   // Event is L1-Gamma, threshold 1 on its name,  it should correspond kEMCEGA
703         Bool_t           fEventTrigEMCALL1Gamma2 ;   // Event is L1-Gamma, threshold 2 on its name,  it should correspond kEMCEGA  
704         Bool_t           fEventTrigEMCALL1Jet1 ;     // Event is L1-Gamma, threshold 1 on its name,  it should correspond kEMCEGA
705         Bool_t           fEventTrigEMCALL1Jet2 ;     // Event is L1-Gamma, threshold 2 on its name,  it should correspond kEMCEGA  
706         
707         Int_t            fBitEGA;                    // Trigger bit on VCaloTrigger for EGA
708         Int_t            fBitEJE;                    // Trigger bit on VCaloTrigger for EJE
709         
710   Bool_t           fAnaLED;                    // Analyze LED data only.
711
712   TString          fTaskName;                  // Name of task that executes the analysis
713         
714   AliCalorimeterUtils * fCaloUtils ;           //  Pointer to CalorimeterUtils
715
716   AliMixedEvent  * fMixedEvent  ;              //! mixed event object. This class is not the owner
717   Int_t            fNMixedEvent ;              // number of events in mixed event buffer
718   Double_t      ** fVertex      ;              //! vertex array 3 dim for each mixed event buffer
719   
720   TList **         fListMixedTracksEvents ;    //! Container for tracks stored for different events, used in case of own mixing, set in analysis class
721   TList **         fListMixedCaloEvents;       //! Container for photon stored for different events, used in case of own mixing, set in analysis class
722   Int_t            fLastMixedTracksEvent  ;    //  Temporary container with the last event added to the mixing list for tracks
723   Int_t            fLastMixedCaloEvent ;       //  Temporary container with the last event added to the mixing list for photons
724   
725   Bool_t           fWriteOutputDeltaAOD;       // Write the created delta AOD objects into file  
726         Bool_t           fOldAOD;                    // Old AODs, before revision 4.20
727   
728   Int_t            fV0ADC[2]    ;              // Integrated V0 signal
729   Int_t            fV0Mul[2]    ;              // Integrated V0 Multiplicity
730
731   TString          fEMCALClustersListName;     // Alternative list of clusters produced elsewhere and not from InputEvent
732   
733   // Event selection
734   Float_t          fZvtxCut ;                      // Cut on vertex position
735   Bool_t           fAcceptFastCluster;           // Accept events from fast cluster, exclude these events for LHC11a
736   Bool_t           fRemoveLEDEvents;             // Remove events where LED was wrongly firing - EMCAL LHC11a
737   
738   Bool_t           fRemoveBadTriggerEvents;      // Remove triggered events because trigger was exotic, bad, or out of BC
739   Bool_t           fTriggerPatchClusterMatch;    // Search for the trigger patch and check if associated cluster was the trigger
740   Int_t            fTriggerPatchTimeWindow[2];   // Trigger patch selection window
741   
742   Float_t          fTriggerL0EventThreshold;     // L0 Threshold to look for triggered events, set outside
743   Float_t          fTriggerL1EventThreshold;     // L1 Threshold to look for triggered events, set in data
744   Bool_t           fTriggerL1EventThresholdFix;  // L1 Threshold is fix and set outside
745   
746   Int_t            fTriggerClusterBC;            // Event triggered by a cluster in BC -5 0 to 5
747   Int_t            fTriggerClusterIndex;         // Index in clusters array of trigger cluster
748   Int_t            fTriggerClusterId;            // Id of trigger cluster (cluster->GetID())
749   Bool_t           fIsExoticEvent;               // Exotic trigger event flag
750   Bool_t           fIsBadCellEvent;              // Bad cell triggered event flag, any cell in cluster is bad
751   Bool_t           fIsBadMaxCellEvent;           // Bad cell triggered event flag, only max energy cell is bad
752   Bool_t           fIsTriggerMatch;              // Could match the event to a trigger patch?
753   Bool_t           fIsTriggerMatchOpenCut[3];    // Could not match the event to a trigger patch?, retry opening cuts
754   Bool_t           fTriggerClusterTimeRecal;     // In case cluster already calibrated, do not try to recalibrate even if recalib on in RecoUtils.
755   Bool_t           fRemoveUnMatchedTriggers;     // Analyze events where trigger patch and cluster where found or not
756   
757   
758   Bool_t           fDoPileUpEventRejection;      // Select pile-up events by SPD
759   Bool_t           fDoV0ANDEventSelection;       // Select events depending on V0AND
760   Bool_t           fDoVertexBCEventSelection;    // Select events with vertex on BC=0 or -100
761   Bool_t           fDoRejectNoTrackEvents;       // Reject events with no selected tracks in event
762   Bool_t           fUseEventsWithPrimaryVertex ; // Select events with primary vertex
763   //AliTriggerAnalysis* fTriggerAnalysis;          // Access to trigger selection algorithm for V0AND calculation
764   
765   Bool_t           fTimeStampEventSelect;        // Select events within a fraction of data taking time
766   Float_t          fTimeStampEventFracMin;       // Minimum value of time stamp fraction event
767   Float_t          fTimeStampEventFracMax;       // Maximum value of time stamp fraction event
768   Double_t         fTimeStampRunMin;             // Minimum value of time stamp in run
769   Double_t         fTimeStampRunMax;             // Maximum value of time stamp in run
770   
771   Double_t         fPileUpParamSPD[5];           // Parameters to pass to method IsPileupFromSPD: Int_t minContributors,
772                                                  // Double_t minZdist, 
773                                                  // Double_t nSigmaZdist, 
774                                                  // Double_t nSigmaDiamXY, 
775                                                  // Double_t nSigmaDiamZ)
776   
777   // Pile-up in EMCal
778   Int_t            fNPileUpClusters;             // Number of clusters with time avobe 20 ns
779   Int_t            fNNonPileUpClusters;          // Number of clusters with time below 20 ns
780   Int_t            fNPileUpClustersCut;          // Cut to select event as pile-up
781   Int_t            fEMCalBCEvent[19];            // Fill one entry per event if there is a cluster in a given BC
782   Int_t            fEMCalBCEventCut[19];         // Fill one entry per event if there is a cluster in a given BC, depend on cluster E, acceptance cut
783   Int_t            fTrackBCEvent[19];            // Fill one entry per event if there is a track in a given BC
784   Int_t            fTrackBCEventCut[19];         // Fill one entry per event if there is a track in a given BC, depend on track pT, acceptance cut
785   Int_t            fVertexBC;                    // Vertex BC
786   Bool_t           fRecalculateVertexBC;         // Recalculate vertex BC from tracks pointing to vertex
787   
788   //Centrality/Event plane
789   TString          fCentralityClass;            // Name of selected centrality class     
790   Int_t            fCentralityOpt;              // Option for the returned value of the centrality, possible options 5, 10, 100
791   Int_t            fCentralityBin[2];           // Minimum and maximum value of the centrality for the analysis
792   TString          fEventPlaneMethod;           // Name of event plane method, by default "Q"
793
794   Bool_t           fAcceptOnlyHIJINGLabels;     // Select clusters or tracks that where generated by HIJING, reject other generators in case of cocktail
795   Int_t            fNMCProducedMin;             // In case of cocktail, select particles in the list with label from this value
796   Int_t            fNMCProducedMax;             // In case of cocktail, select particles in the list with label up to this value
797   
798   // jets
799   Bool_t           fFillInputNonStandardJetBranch;  // Flag to use data from non standard jets
800   TClonesArray *   fNonStandardJets;                //! temporal array with jets
801   TString          fInputNonStandardJetBranchName;  // Name of non standard jet branch
802   Bool_t           fFillInputBackgroundJetBranch;   // Flag to use data from background jets
803   AliAODJetEventBackground * fBackgroundJets;       //! background jets
804   TString          fInputBackgroundJetBranchName;   // Name of background jet branch
805
806   TArrayI          fAcceptEventsWithBit;           // Accept events if trigger bit is on
807   TArrayI          fRejectEventsWithBit;           // Reject events if trigger bit is on
808
809   Bool_t           fRejectEMCalTriggerEventsWith2Tresholds; // Reject events EG2 also triggered by EG1 or EJ2 also triggered by EJ1
810   
811   AliCaloTrackReader(              const AliCaloTrackReader & r) ; // cpy ctor
812   AliCaloTrackReader & operator = (const AliCaloTrackReader & r) ; // cpy assignment
813   
814   ClassDef(AliCaloTrackReader,67)
815   
816 } ;
817
818
819 #endif //ALICALOTRACKREADER_H
820
821
822