fix memory leak and funny multiplicity
[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
10// Magali Estienne <magali.estienne@IReS.in2p3.fr>
11
99e5fe42 12#include <TObject.h>
13#include <TChain.h>
8011d399 14#include <TArrayI.h>
b45b0c92 15
7d0f353c 16class TTree;
b45b0c92 17class TTask;
ee7de0dd 18class TChain;
99e5fe42 19class TClonesArray;
c8f39c57 20class TRefArray;
99e5fe42 21class AliJetReaderHeader;
ee7de0dd 22class AliESDEvent;
23class AliHeader;
b45b0c92 24class AliJetUnitArray;
7aec0427 25class AliJetHadronCorrectionv1;
7d0f353c 26class AliJet;
ee7de0dd 27class AliJetFillUnitArrayTracks;
28class AliJetFillUnitArrayEMCalDigits;
99e5fe42 29
99e5fe42 30class AliJetReader : public TObject
31{
32 public:
33 AliJetReader();
34 virtual ~AliJetReader();
35
36 // Getters
ee7de0dd 37 virtual TClonesArray* GetMomentumArray() const {return fMomentumArray;}
38 virtual TRefArray* GetReferences() const {return 0;}
39 virtual TClonesArray *GetUnitArray() const {return fUnitArray;}
40 virtual TRefArray *GetRefArray() const {return fRefArray;}
41 virtual TClonesArray *GetUnitArrayNoCuts() const {return fUnitArrayNoCuts;}
42
43 virtual AliJetReaderHeader* GetReaderHeader() const {return fReaderHeader;}
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;}
b45b0c92 52 virtual void FillUnitArrayFromTPCTracks(Int_t) {} // temporarily not used
53 virtual void FillUnitArrayFromEMCALHits() {} // temporarily not used
54 virtual void FillUnitArrayFromEMCALDigits(Int_t) {} // temporarily not used
55 virtual void FillUnitArrayFromEMCALClusters(Int_t) {} // temporarily not used
56 virtual void InitUnitArray() {}
ee7de0dd 57 virtual void InitParameters() {}
58 virtual void CreateTasks() {}
59 // virtual void ExecTasks(Int_t) {}
60 virtual Bool_t ExecTasks(Int_t) {return kTRUE;}
61 /* // Correction of hadronic energy
62 virtual void SetHadronCorrector(AliEMCALHadronCorrectionv1* corr) {fHadronCorrector = corr;}
63 virtual void SetHadronCorrection(Int_t flag = 1) {fHCorrection = flag;} */
7d0f353c 64 virtual void SetReaderHeader(AliJetReaderHeader* header)
b45b0c92 65 {fReaderHeader = header;}
ee7de0dd 66 virtual void SetESD(AliESDEvent* esd) { fESD = esd;}
67 // virtual Int_t SetNumCandidate(Int_t cand) {fNumCandidate = cand;}
68 // virtual Int_t SetNumCandidateCut(Int_t candcut) {fNumCandidateCut = candcut;}
69
70
7d0f353c 71 // Others
72 virtual void OpenInputFiles() {}
ac088e8a 73 virtual void SetInputEvent(TObject* /*esd*/, TObject* /*aod*/, TObject* /*mc*/) {;}
f3f3617d 74 virtual void ConnectTree(TTree* /*tree*/, TObject* /*data*/) {}
7d0f353c 75 virtual Bool_t GetGenJets(AliJet* /*genJets*/) {return kFALSE;}
76
99e5fe42 77 void ClearArray();
78
79 protected:
1b7d5d7e 80 AliJetReader(const AliJetReader& rJetReader);
81 AliJetReader& operator = (const AliJetReader& rhsr);
ee7de0dd 82 TChain *fChain; // chain for reconstructed tracks
b45b0c92 83 TClonesArray *fMomentumArray; // array of particle momenta
de265230 84 TClonesArray *fArrayMC; //! array of mc particles
85 TTask *fFillUnitArray; //! task list for filling the UnitArray
ee7de0dd 86 AliESDEvent *fESD; // pointer to esd
b45b0c92 87 AliJetReaderHeader *fReaderHeader; // pointer to header
88 TArrayI fSignalFlag; // to flag if a particle comes from pythia or
89 // from the underlying event
90 TArrayI fCutFlag; // to flag if a particle passed the pt cut or not
ee7de0dd 91 TClonesArray *fUnitArray; // array of digit position and energy
ea0b9ac3 92 TRefArray *fRefArray; // ! array of digit position and energy
ee7de0dd 93 TClonesArray *fUnitArrayNoCuts; // array of digit position and energy
b45b0c92 94 Bool_t fArrayInitialised; // To check that array of units is initialised
ee7de0dd 95 AliJetFillUnitArrayTracks *fFillUAFromTracks;
96 AliJetFillUnitArrayEMCalDigits *fFillUAFromEMCalDigits;
97 Int_t fNumCandidate;
98 Int_t fNumCandidateCut;
99e5fe42 99 ClassDef(AliJetReader,1)
100};
101
102#endif