/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 00011 #ifndef ESIDEALFECTOOL_H 00012 #define ESIDEALFECTOOL_H 1 00013 00014 #include "ElecSim/IEsFrontEndTool.h" 00015 #include "GaudiAlg/GaudiTool.h" 00016 #include "DataSvc/ICableSvc.h" 00017 #include "DataSvc/ISimDataSvc.h" 00018 #include "Event/ElecPulseCollection.h" 00019 00020 #include "GaudiKernel/RndmGenerators.h" 00021 00022 namespace DayaBay{ 00023 class ElecPulseCollection; 00024 class ElecCrate; 00025 class ElecRpcPulse; 00026 class ElecFecChannel; 00027 } 00028 00029 class EsIdealFecTool : public GaudiTool , virtual public IEsFrontEndTool 00030 { 00031 private: 00032 typedef std::map<DayaBay::FecChannelId, 00033 std::map<DayaBay::FecChannelId, 00034 std::vector<DayaBay::ElecRpcPulse*> > > PulseMap; 00035 public: 00036 00037 EsIdealFecTool(const std::string& type, 00038 const std::string& name, 00039 const IInterface* parent); 00040 00041 virtual ~EsIdealFecTool(); 00042 00043 virtual StatusCode generateSignals(DayaBay::ElecPulseCollection*, 00044 DayaBay::ElecCrate*); 00045 virtual StatusCode initialize(); 00046 virtual StatusCode finalize(); 00047 00048 private: 00049 StatusCode mapPulsesByChannel( 00050 const DayaBay::ElecPulseCollection::PulseContainer& pulses, 00051 PulseMap& pulseMap); 00052 StatusCode generateOneChannel(std::vector<DayaBay::ElecRpcPulse*>&, 00053 DayaBay::ElecFecChannel&, 00054 double clockOffset, 00055 const ServiceMode&); 00056 StatusCode addChannelNoise(const DayaBay::FecChannelId&, 00057 DayaBay::ElecFecChannel&, 00058 double simTime, 00059 const ServiceMode&); 00060 int getNoiseHits(double mean, int max); 00061 00062 private: 00063 // Property CableSvcName - Name of the cable service 00064 std::string m_cableSvcName; 00065 // Property CableSvcName - Service name for electronics sim properties 00066 std::string m_simDataSvcName; 00067 // CableSvc 00068 ICableSvc *m_cableSvc; 00069 // CableSvc 00070 ISimDataSvc *m_simDataSvc; 00071 00072 // Random generators 00073 Rndm::Numbers m_uni; 00074 00075 // Simulation Frequency (in Hz) 00076 double m_simFrequency; 00077 // Noise rate per strip 00078 double m_idealNoise; 00079 //RPC Efficiency 00080 double m_idealEff; 00081 // Signal delay inside the electronics, this allows for synchronization with other detectors 00082 double m_elecDelay; 00083 // Signal stretch after crossing threshold level. 00084 double m_elecStretch; 00085 00086 }; 00087 00088 #endif // ESIDEALFECTOOL_H