2D Centrality files
[u/mrichter/AliRoot.git] / JETAN / AliJetReader.h
1 #ifndef ALIJETREADER_H
2 #define ALIJETREADER_H
3  
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6  
7 // Jet reader base class
8 // manages the reading of input for jet algorithms
9 // Authors: jgcn@mda.cinvestav.mx
10 //          Magali Estienne <magali.estienne@subatech.in2p3.fr>  
11
12 #include <TObject.h>
13 #include <TChain.h>
14 #include <TArrayI.h>
15
16 class TTree;
17 class TChain;
18 class TTask;
19 class TClonesArray;
20 class TRefArray;
21 class AliJetReaderHeader;
22 class AliESDEvent;
23 class AliHeader;
24 class AliJetUnitArray;
25 class AliJetHadronCorrection;
26 class AliJet;
27 class AliJetFillUnitArray;
28
29 class AliJetReader : public TObject 
30 {
31  public: 
32   AliJetReader();
33   virtual ~AliJetReader();
34
35   // Getters
36   virtual TClonesArray*       GetMomentumArray()     const {return fMomentumArray;}
37   virtual TRefArray*          GetReferences()        const {return 0;}   
38   virtual TClonesArray        *GetUnitArray() const {return fUnitArray;}  
39   virtual AliJetReaderHeader* GetReaderHeader()      const {return fReaderHeader;}
40   virtual AliHeader           *GetAliHeader() const  {return fAliHeader;}
41   virtual Int_t               GetSignalFlag(Int_t i) const {return fSignalFlag[i];}
42   virtual Int_t               GetCutFlag(Int_t i)    const {return fCutFlag[i];}
43   virtual Int_t               GetArrayInitialised()  const {return fArrayInitialised;}
44   virtual Int_t               GetNumCandidate()      const {return fNumCandidate;} 
45   virtual Int_t               GetNumCandidateCut()   const {return fNumCandidateCut;}
46   
47   // Setters
48   virtual Bool_t FillMomentumArray() {return kTRUE;}
49   virtual Bool_t ReadEventLoader(Int_t) {return kTRUE;}
50   virtual void   InitUnitArray() {}
51   virtual void   InitParameters() {}
52   virtual void   CreateTasks(TChain* /*tree*/) {}
53   virtual Bool_t ExecTasks(Bool_t /*procid*/, TRefArray* /*refArray*/) {return kFALSE;}
54   // Correction of hadronic energy 
55   virtual void   SetHadronCorrector(AliJetHadronCorrection*) {;} 
56   virtual void   SetApplyMIPCorrection(Bool_t /*val*/){;}
57   virtual void   SetApplyFractionHadronicCorrection(Bool_t /*val*/){;}
58   virtual void   SetFractionHadronicCorrection(Double_t /*val*/){;}
59   virtual void   SetApplyElectronCorrection(Int_t /*flag*/) {;}
60   virtual void   SetReaderHeader(AliJetReaderHeader* header) 
61   {fReaderHeader = header;}
62   virtual void   SetESD(AliESDEvent* esd) { fESD = esd;}
63
64   // Others
65   virtual void   OpenInputFiles() {}
66   virtual void   SetInputEvent(const TObject* /*esd*/, const TObject* /*aod*/, const TObject* /*mc*/) {;}
67   virtual void   ConnectTree(TTree* /*tree*/, TObject* /*data*/) {}
68   virtual Bool_t GetGenJets(AliJet* /*genJets*/) {return kFALSE;}
69   
70   void ClearArray();
71  
72  protected:
73   AliJetReader(const AliJetReader& rJetReader);
74   AliJetReader& operator = (const AliJetReader& rhsr);
75
76   TChain                          *fChain;                 // chain for reconstructed tracks
77   TChain                          *fTree;                  // tree for reconstructed tracks
78   TClonesArray                    *fMomentumArray;         // array of particle momenta
79   TClonesArray                    *fArrayMC;               //! array of mc particles
80   TTask                           *fFillUnitArray;         //! task list for filling the UnitArray
81   AliESDEvent                     *fESD;                   // pointer to esd
82   AliJetReaderHeader              *fReaderHeader;          // pointer to header
83   AliHeader                       *fAliHeader;             // AliHeader
84   TArrayI                          fSignalFlag;            // to flag if a particle comes from pythia or
85                                                            // from the underlying event
86   TArrayI                          fCutFlag;               // to flag if a particle passed the pt cut or not
87   TClonesArray                    *fUnitArray;             // array of digit position and energy 
88   Bool_t                           fArrayInitialised;      // To check that array of units is initialised  
89   AliJetFillUnitArray             *fFillUAFromTracks;      // For charged particle task
90   AliJetFillUnitArray             *fFillUAFromEMCalDigits; // For neutral particle task
91   Int_t                            fNumCandidate;          // Number of entries different from zero in unitarray
92   Int_t                            fNumCandidateCut;       // Number of entries different from zero in unitarray
93                                                            // which pass pt cut
94   AliJetHadronCorrection          *fHadronCorrector;       //! Pointer to hadronic correction 
95   Int_t                            fHCorrection;           //  Hadron correction flag 
96   Int_t                            fECorrection;           //  Electron correction flag 
97   Bool_t                           fEFlag;                 //  Electron correction flag 
98
99
100   ClassDef(AliJetReader,1)
101 };
102  
103 #endif