CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CastorElectronicsSim Class Reference

#include <CastorElectronicsSim.h>

Public Member Functions

void analogToDigital (CLHEP::HepRandomEngine *, CaloSamples &linearFrame, CastorDataFrame &result)
 
 CastorElectronicsSim (CastorAmplifier *amplifier, const CastorCoderFactory *coderFactory)
 
void newEvent (CLHEP::HepRandomEngine *)
 Things that need to be initialized every event. More...
 
 ~CastorElectronicsSim ()
 

Private Member Functions

template<class Digi >
void convert (CaloSamples &frame, Digi &result, CLHEP::HepRandomEngine *)
 

Private Attributes

CastorAmplifiertheAmplifier
 
const CastorCoderFactorytheCoderFactory
 
int theStartingCapId
 

Detailed Description

Definition at line 19 of file CastorElectronicsSim.h.

Constructor & Destructor Documentation

CastorElectronicsSim::CastorElectronicsSim ( CastorAmplifier amplifier,
const CastorCoderFactory coderFactory 
)

Definition at line 10 of file CastorElectronicsSim.cc.

11  : theAmplifier(amplifier),
12  theCoderFactory(coderFactory),
14 {
15 }
const CastorCoderFactory * theCoderFactory
CastorAmplifier * theAmplifier
CastorElectronicsSim::~CastorElectronicsSim ( )

Definition at line 18 of file CastorElectronicsSim.cc.

19 {
20 }

Member Function Documentation

void CastorElectronicsSim::analogToDigital ( CLHEP::HepRandomEngine *  engine,
CaloSamples linearFrame,
CastorDataFrame result 
)

Definition at line 29 of file CastorElectronicsSim.cc.

References mps_fire::result.

29  {
30  convert<CastorDataFrame>(lf, result, engine);
31 }
template<class Digi >
void CastorElectronicsSim::convert ( CaloSamples frame,
Digi &  result,
CLHEP::HepRandomEngine *  engine 
)
private

Definition at line 23 of file CastorElectronicsSim.cc.

References CastorAmplifier::amplify(), CastorCoderFactory::coder(), CaloSamples::id(), CaloSamples::size(), theAmplifier, theCoderFactory, and theStartingCapId.

23  {
24  result.setSize(frame.size());
25  theAmplifier->amplify(frame, engine);
26  theCoderFactory->coder(frame.id())->fC2adc(frame, result, theStartingCapId);
27 }
std::unique_ptr< CastorCoder > coder(const DetId &detId) const
user gets control of the pointer
virtual void amplify(CaloSamples &linearFrame, CLHEP::HepRandomEngine *) const
const CastorCoderFactory * theCoderFactory
CastorAmplifier * theAmplifier
int size() const
get the size
Definition: CaloSamples.h:24
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
void CastorElectronicsSim::newEvent ( CLHEP::HepRandomEngine *  engine)

Things that need to be initialized every event.

Definition at line 33 of file CastorElectronicsSim.cc.

References CastorAmplifier::setStartingCapId(), theAmplifier, and theStartingCapId.

33  {
34  // pick a new starting Capacitor ID
35  theStartingCapId = CLHEP::RandFlat::shootInt(engine, 4);
37 }
CastorAmplifier * theAmplifier
void setStartingCapId(int capId)

Member Data Documentation

CastorAmplifier* CastorElectronicsSim::theAmplifier
private

Definition at line 33 of file CastorElectronicsSim.h.

Referenced by convert(), and newEvent().

const CastorCoderFactory* CastorElectronicsSim::theCoderFactory
private

Definition at line 34 of file CastorElectronicsSim.h.

Referenced by convert().

int CastorElectronicsSim::theStartingCapId
private

Definition at line 36 of file CastorElectronicsSim.h.

Referenced by convert(), and newEvent().