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