// ESAF : Euso Simulation and Analysis Framework // $Id: EDetector.hh,v 1.11 2005/03/21 17:13:44 thea Exp $ // M. Pallavicini created Mar, 12 2002 // root Event description in Euso // It contains an event with all possible information // It is the base for all root files (input and output) // At each stage of the program the event is enriched with additional data // #ifndef __EDETECTOR_HH_ #define __EDETECTOR_HH_ #include "TROOT.h" #include "TObject.h" #include "TRef.h" #include "TClonesArray.h" #include "TString.h" #include "EFillable.hh" #include "ERunParameters.hh" #include "EElectronics.hh" class EDetPhoton; class EMacroCellHit; class EMacroCell; class EFee; class EAFee; class ERunParameters; // Event class EDetector : public TObject, public EFillable { public: EDetector(); EDetector(const EDetector&); virtual ~EDetector(); virtual void Copy( TObject& ) const; virtual void Clear( Option_t* =""); inline static EDetector* GetCurrent() { return fgCurrent; } inline static void SetCurrent(EDetector *ev) { fgCurrent=ev; } inline void SetPhotonFillable( Bool_t e = kTRUE ) { fPhotonFillable = e; } inline Bool_t IsPhotonFillable() { return fPhotonFillable; } inline void SetNightGlowFillable( Bool_t e = kTRUE ) { fNightGlowFillable = e; } inline Bool_t IsNightGlowFillable() { return fNightGlowFillable; } inline void SetRunPars( ERunParameters* ); inline ERunParameters* RunPars(); // getters inline const EElectronics& GetElectronics() const {return fElectronics;} inline Int_t GetNumPhotons() {return fNumPhotons; } inline Int_t GetNumCellHits() {return fNumCellHits; } inline Int_t GetNumFee() {return fNumFee; } inline Int_t GetNumAFee() {return fNumAFee; } inline Int_t GetNumCells() {return fNumCells; } inline Float_t GetFirstTime() {return fFirstTime; } inline Float_t GetLastTime() {return fLastTime; } inline Float_t GetFirstGtuTime() {return fFirstTime; } inline EDetPhoton* GetPhoton(Int_t index); inline EMacroCellHit* GetMacroCellHit(Int_t index); inline EFee* GetFee(Int_t index); inline EAFee* GetAFee(Int_t index); inline EMacroCell* GetMacroCell(Int_t index); private: Bool_t fPhotonFillable; // true to enable photon adders Bool_t fNightGlowFillable; // true to enable ng hits adders TRef fRunPars; // pointer to run parameters EElectronics fElectronics; // euso detector electronics status Int_t fNumPhotons; // number of EDetPhoton in fPhotons array Int_t fNumCellHits; // number of EMacroCellHit in fMacroCellHits array Int_t fNumFee; // number of EFee objects in fFee Int_t fNumAFee; // number of EAFee objects in fAFee Int_t fNumCells; // number of EMacroCell objects Float_t fFirstTime; // time of the first photon entering pupil Float_t fLastTime; // time of the last photon entering pupil TClonesArray* fPhotons; //-> all photons entering the pupil with history in detector TClonesArray* fMacroCellHits; //-> macroCell hit data TClonesArray* fFee; //-> front end chip data (digital+full analog if present) TClonesArray* fAFee; //-> analog specific data (last dynode + trigger info if any) TClonesArray* fMacroCell; //-> data for each macroCell with activity static TClonesArray* fgPhotons; static TClonesArray* fgMacroCellHits; static TClonesArray* fgFee; static TClonesArray* fgAFee; static TClonesArray* fgMacroCell; // the following is needed to handle events built with the copy constructor // in this case the TClonesArray are handled differently Bool_t fCopy; inline void SetCopy(Bool_t val = kTRUE ) { fCopy = val; } inline Bool_t IsCopy() const { return fCopy;} void ClearCopy(); static EDetector* fgCurrent; SetEVisitable() ClassDef(EDetector,1) }; inline void EDetector::SetRunPars( ERunParameters* r) { fRunPars = r; } inline ERunParameters* EDetector::RunPars() { return (ERunParameters*)fRunPars.GetObject(); } inline EDetPhoton* EDetector::GetPhoton(Int_t index) { return (EDetPhoton*)((*fPhotons)[index]); } inline EMacroCellHit* EDetector::GetMacroCellHit(Int_t index) { return (EMacroCellHit*)((*fMacroCellHits)[index]); } inline EFee* EDetector::GetFee(Int_t index) { return (EFee*)((*fFee)[index]); } inline EAFee* EDetector::GetAFee(Int_t index) { return (EAFee*)((*fAFee)[index]); } inline EMacroCell* EDetector::GetMacroCell(Int_t index) { return (EMacroCell*)((*fMacroCell)[index]); } #endif /* __EDETECTOR_HH_ */