Protections for coverity: DIVIDE_BY_ZERO
[u/mrichter/AliRoot.git] / JETAN / AliJetReader.h
CommitLineData
99e5fe42 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
99e5fe42 7// Jet reader base class
8// manages the reading of input for jet algorithms
b45b0c92 9// Authors: jgcn@mda.cinvestav.mx
8838ab7a 10// Magali Estienne <magali.estienne@subatech.in2p3.fr>
b45b0c92 11
99e5fe42 12#include <TObject.h>
13#include <TChain.h>
8011d399 14#include <TArrayI.h>
b45b0c92 15
7d0f353c 16class TTree;
ee7de0dd 17class TChain;
8838ab7a 18class TTask;
99e5fe42 19class TClonesArray;
c8f39c57 20class TRefArray;
f445ed00 21class AliEMCALGeometry;
99e5fe42 22class AliJetReaderHeader;
ee7de0dd 23class AliESDEvent;
24class AliHeader;
b45b0c92 25class AliJetUnitArray;
be6e5811 26class AliJetHadronCorrection;
7d0f353c 27class AliJet;
be6e5811 28class AliJetFillUnitArray;
f45e6f72 29class AliOADBContainer;
30
99e5fe42 31
99e5fe42 32class AliJetReader : public TObject
33{
34 public:
35 AliJetReader();
36 virtual ~AliJetReader();
37
38 // Getters
8838ab7a 39 virtual TClonesArray* GetMomentumArray() const {return fMomentumArray;}
40 virtual TRefArray* GetReferences() const {return 0;}
41 virtual TClonesArray *GetUnitArray() const {return fUnitArray;}
ee7de0dd 42 virtual AliJetReaderHeader* GetReaderHeader() const {return fReaderHeader;}
8838ab7a 43 virtual AliHeader *GetAliHeader() const {return fAliHeader;}
ee7de0dd 44 virtual Int_t GetSignalFlag(Int_t i) const {return fSignalFlag[i];}
45 virtual Int_t GetCutFlag(Int_t i) const {return fCutFlag[i];}
46 virtual Int_t GetArrayInitialised() const {return fArrayInitialised;}
47 virtual Int_t GetNumCandidate() const {return fNumCandidate;}
48 virtual Int_t GetNumCandidateCut() const {return fNumCandidateCut;}
7d0f353c 49
99e5fe42 50 // Setters
ae24a5a1 51 virtual Bool_t FillMomentumArray() {return kTRUE;}
8838ab7a 52 virtual Bool_t ReadEventLoader(Int_t) {return kTRUE;}
b45b0c92 53 virtual void InitUnitArray() {}
ee7de0dd 54 virtual void InitParameters() {}
8838ab7a 55 virtual void CreateTasks(TChain* /*tree*/) {}
56 virtual Bool_t ExecTasks(Bool_t /*procid*/, TRefArray* /*refArray*/) {return kFALSE;}
57 // Correction of hadronic energy
be6e5811 58 virtual void SetHadronCorrector(AliJetHadronCorrection*) {;}
59 virtual void SetApplyMIPCorrection(Bool_t /*val*/){;}
60 virtual void SetApplyFractionHadronicCorrection(Bool_t /*val*/){;}
61 virtual void SetFractionHadronicCorrection(Double_t /*val*/){;}
62 virtual void SetApplyElectronCorrection(Int_t /*flag*/) {;}
7d0f353c 63 virtual void SetReaderHeader(AliJetReaderHeader* header)
8838ab7a 64 {fReaderHeader = header;}
ee7de0dd 65 virtual void SetESD(AliESDEvent* esd) { fESD = esd;}
ee7de0dd 66
7d0f353c 67 // Others
68 virtual void OpenInputFiles() {}
f5c22dad 69 virtual void SetInputEvent(const TObject* /*esd*/, const TObject* /*aod*/, const TObject* /*mc*/) {;}
f3f3617d 70 virtual void ConnectTree(TTree* /*tree*/, TObject* /*data*/) {}
7d0f353c 71 virtual Bool_t GetGenJets(AliJet* /*genJets*/) {return kFALSE;}
72
99e5fe42 73 void ClearArray();
f45e6f72 74
75 virtual const TString GetJetanOADBPath() {return fJetanOADBpath.Data();}
76 void SetJetanOADBPath(TString name) {fJetanOADBpath = name;}
99e5fe42 77
f45e6f72 78 virtual void SetDebug(Int_t debug = 0) {fDebug = debug;}
79
99e5fe42 80 protected:
1b7d5d7e 81 AliJetReader(const AliJetReader& rJetReader);
82 AliJetReader& operator = (const AliJetReader& rhsr);
f45e6f72 83 Bool_t SetEMCALGeometry();
84
8838ab7a 85
f45e6f72 86 TString fJetanOADBpath; //! path to official OADB, to be set by the task
f445ed00 87 static AliEMCALGeometry *fGeom; //! EMCAL Geometry
8838ab7a 88 TChain *fChain; // chain for reconstructed tracks
89 TChain *fTree; // tree for reconstructed tracks
90 TClonesArray *fMomentumArray; // array of particle momenta
91 TClonesArray *fArrayMC; //! array of mc particles
92 TTask *fFillUnitArray; //! task list for filling the UnitArray
93 AliESDEvent *fESD; // pointer to esd
94 AliJetReaderHeader *fReaderHeader; // pointer to header
95 AliHeader *fAliHeader; // AliHeader
96 TArrayI fSignalFlag; // to flag if a particle comes from pythia or
97 // from the underlying event
98 TArrayI fCutFlag; // to flag if a particle passed the pt cut or not
99 TClonesArray *fUnitArray; // array of digit position and energy
8838ab7a 100 Bool_t fArrayInitialised; // To check that array of units is initialised
be6e5811 101 AliJetFillUnitArray *fFillUAFromTracks; // For charged particle task
102 AliJetFillUnitArray *fFillUAFromEMCalDigits; // For neutral particle task
8838ab7a 103 Int_t fNumCandidate; // Number of entries different from zero in unitarray
104 Int_t fNumCandidateCut; // Number of entries different from zero in unitarray
105 // which pass pt cut
be6e5811 106 AliJetHadronCorrection *fHadronCorrector; //! Pointer to hadronic correction
8838ab7a 107 Int_t fHCorrection; // Hadron correction flag
108 Int_t fECorrection; // Electron correction flag
109 Bool_t fEFlag; // Electron correction flag
f45e6f72 110 Int_t fDebug; //! Debug option
8838ab7a 111
99e5fe42 112 ClassDef(AliJetReader,1)
113};
114
115#endif