// $Id: EusoElectronics.hh,v 1.35 2005/10/31 16:01:05 pesce Exp $ // /***************************************************************************** * ESAF: Euso Simulation and Analysis Framework * * * * Id: EusoElectronics * * Package: Electronics * * Coordinator: Marco.Pallavicini * * * *****************************************************************************/ #ifndef __EUSOELECTRONICS_HH__ #define __EUSOELECTRONICS_HH__ #include #include #include #include #include "EEvent.hh" #include "EsafConfigurable.hh" #include "EsafMsgSource.hh" class ElementaryCell; class FrontEndChip; class Interpolate; class MacroCell; class Photomultiplier; class Telemetry; 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(); virtual void BuildBackgroundChipDist(); virtual bool Destroy(); // destroy the object tree. Returns false on error. virtual bool Simulate( Double_t, Double_t ); // simulate one event. PMTs must have been filled with Photons // return false on error // start and stop time are given also virtual inline Telemetry* Data() {return fTelemetry;} // return simulation result virtual void Reset(); // reset. You must call Reset() between two events. virtual void Dump(ostream& = cout); // dump (for debugging purposes) // mapping inline Int_t NumOfCh() const { return fNumOfChannelUniqueId; } // returns the number of channels inline Int_t NumPmt() const { return fPmts.size(); } // returnd the number of pmts inline Int_t NumElemCell() const { return fElementaryCells.size(); } // return number of macrocells inline Int_t NumCell() const { return fMacrocells.size(); } // return number of macrocells // returns macrocell from index MacroCell* Cell(UInt_t); MacroCell* CellId(const ChannelUniqueId& chid); // returns macrocell from channel unique id ElementaryCell* ElemCell(UInt_t); // return elementarycell from index Photomultiplier* Pmt(UInt_t); // returns photomultiplier from id Photomultiplier* PmtId(ChannelUniqueId chid); // returns photomultiplier from channel_unique_id void ElectronicsMap(MacroCell**,Photomultiplier**,Int_t& pmtchan, ChannelUniqueId chid); // returns all mapping from ChannelUniqueId inline void EnableSimulation( Bool_t enable=kTRUE) { fSimulateElectronics = enable; } // disable/enable simulation of Pmts signals inline Bool_t GetSimulationStatus() const { return fSimulateElectronics; } // return simulation status inline Int_t GetNumPmtSignals() const { return fNumPmtSignals; } // return total number of pmt signals detected inline Int_t GetLowSignalCellThreshold() const { return fLowSignalCellThreshold; } // return minimum number of pmt signals needed for simulating the macrocells Double_t GetDetectorScaleFactor() const { return fDetectorScaleFactor; } // returns the detector size scale factor void SetDetectorScaleFactor( Double_t scale ) { fDetectorScaleFactor = scale; } // sets the detector size scale factor private: Double_t NightGlowRate( const TVector3& pos, const TVector3& norm, Double_t pxsize, Double_t pde ) const; Double_t NightGlowRate( const Photomultiplier* ) const; // nightglow rate as function of the location on the FS Double_t NightGlowRate( const FrontEndChip* ) 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 Int_t fNumPmtSignals; // total number of pmt signals detected // in all focal surface Int_t fLowSignalCellThreshold; // minimum number of signals per MC to run // macrocell simulation Bool_t fAddRandomGtuPhase; // if true add a random phase to the gtu counter // in special modes Double_t fDetectorScaleFactor; // detector size scale factor 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; // distribution of nightglow over the focal surface EsafConfigClass(Electronics,EusoElectronics) ClassDef(EusoElectronics,0) }; #endif /* __EUSOELECTRONICS_HH__ */