// $Id: EusoElectronics.hh,v 1.30 2005/04/20 12:26:36 thea Exp $ // /***************************************************************************** * ESAF: Euso Simulation and Analysis Framework * * * * Id: EusoElectronics * * Package: Electronics * * Coordinator: Marco.Pallavicini * * * *****************************************************************************/ #ifndef __EUSOELECTRONICS_HH__ #define __EUSOELECTRONICS_HH__ #include #include #include #include "EsafConfigurable.hh" #include "EsafMsgSource.hh" #include "EEvent.hh" class MacroCell; class Photomultiplier; class Telemetry; class ElementaryCell; class Interpolate; typedef Int_t ChannelUniqueId; //////////////////////////////////////////////////////////////////////////////// // // // EusoElectronics // // // // Main Object of the Electronics System // // You must inherit from this if you want to make another version of the // // system. It has three methods: // // Build : Create all internal objects. To be called once. // // Destroy : Destroy all electronics objects. // // Simulate : Simulate one event. PMTs must be fed through the // // FocalSurface. It returns the RawData object // // ResetEvent : Get Ready for next Event // // // //////////////////////////////////////////////////////////////////////////////// class EusoElectronics : public EsafConfigurable, public EsafMsgSource { public: EusoElectronics(); virtual ~EusoElectronics(); // build every object of this version of the electronics // returns false on error virtual bool Build(); // destroy the object tree. Returns false on error. virtual bool Destroy(); // simulate one event. PMTs must have been filled with Photons // return false on error // start and stop time are given also virtual bool Simulate( Double_t, Double_t ); // return simulation result virtual inline Telemetry* Data() {return fTelemetry;} // reset. You must call Reset() between two events. virtual void Reset(); // dump (for debugging purposes) virtual void Dump(ostream& = cout); // mapping // returns the number of channels inline Int_t NumOfCh() const { return fNumOfChannelUniqueId; } // returnd the number of pmts inline Int_t NumPmt() const { return fPmts.size(); } // return number of macrocells inline Int_t NumElemCell() const { return fElementaryCells.size(); } // return number of macrocells inline Int_t NumCell() const { return fMacrocells.size(); } // returns macrocell from index MacroCell* Cell(UInt_t); // returns macrocell from channel unique id MacroCell* CellId(const ChannelUniqueId& chid); // return elementarycell from index ElementaryCell* ElemCell(UInt_t); // returns photomultiplier from id Photomultiplier* Pmt(UInt_t); // returns photomultiplier from channel_unique_id Photomultiplier* PmtId(ChannelUniqueId chid); // returns all mapping from ChannelUniqueId void ElectronicsMap(MacroCell**,Photomultiplier**,Int_t& pmtchan, ChannelUniqueId chid); // disable/enable simulation of Pmts signals inline void EnableSimulation( Bool_t se=kTRUE) { fSimulateElectronics = se; } // return simulation status inline Bool_t GetSimulationStatus() const { return fSimulateElectronics; } private: Double_t NightGlowRate( const Photomultiplier* ) const; // nightglow rate as function of the location on the FS Telemetry* fTelemetry; // object for ground data format vector fMacrocells; // list of macro cells vector fPmts; // list of pmts vector fElementaryCells; // list of elementary cells map fMap; // associate unique id to photomultiplier Int_t fNumOfChannelUniqueId; Bool_t fSimulateElectronics; // disable simulation of the PmtSignal when // in special modes string fNightGlow; // nightglow is added if not none string fNightGlowShape; // profile of the nightglow. Double_t fNightGlowRateOnAxis; // p.e. per pixel per microsec on the optical axis Double_t fNightGlowRadiance; // photon radiance [ph/m^2/sr/ns] Int_t fNightGlowCode; // its value defines in which conditions // the ng is added Interpolate *fNightGlowDist; EsafConfigClass(Electronics,EusoElectronics) ClassDef(EusoElectronics,0) }; #endif /* __EUSOELECTRONICS_HH__ */