CMS 3D CMS Logo

CastorElectronicsSim.cc
Go to the documentation of this file.
5 
6 #include "CLHEP/Random/RandFlat.h"
7 
9  : theAmplifier(amplifier), theCoderFactory(coderFactory), theStartingCapId(0) {}
10 
12 
13 template <class Digi>
14 void CastorElectronicsSim::convert(CaloSamples &frame, Digi &result, CLHEP::HepRandomEngine *engine) {
15  result.setSize(frame.size());
16  theAmplifier->amplify(frame, engine);
18 }
19 
20 void CastorElectronicsSim::analogToDigital(CLHEP::HepRandomEngine *engine, CaloSamples &lf, CastorDataFrame &result) {
21  convert<CastorDataFrame>(lf, result, engine);
22 }
23 
24 void CastorElectronicsSim::newEvent(CLHEP::HepRandomEngine *engine) {
25  // pick a new starting Capacitor ID
26  theStartingCapId = CLHEP::RandFlat::shootInt(engine, 4);
28 }
void convert(CaloSamples &frame, Digi &result, CLHEP::HepRandomEngine *)
CastorElectronicsSim(CastorAmplifier *amplifier, const CastorCoderFactory *coderFactory)
virtual void amplify(CaloSamples &linearFrame, CLHEP::HepRandomEngine *) const
std::unique_ptr< CastorCoder > coder(const DetId &detId) const
user gets control of the pointer
const CastorCoderFactory * theCoderFactory
CastorAmplifier * theAmplifier
void analogToDigital(CLHEP::HepRandomEngine *, CaloSamples &linearFrame, CastorDataFrame &result)
void newEvent(CLHEP::HepRandomEngine *)
Things that need to be initialized every event.
void setStartingCapId(int capId)