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::CastorElectronicsSim ( CastorAmplifier amplifier,
const CastorCoderFactory coderFactory 
)

Definition at line 8 of file CastorElectronicsSim.cc.

9  : theAmplifier(amplifier), theCoderFactory(coderFactory), theStartingCapId(0) {}
const CastorCoderFactory * theCoderFactory
CastorAmplifier * theAmplifier

◆ ~CastorElectronicsSim()

CastorElectronicsSim::~CastorElectronicsSim ( )

Definition at line 11 of file CastorElectronicsSim.cc.

11 {}

Member Function Documentation

◆ analogToDigital()

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

Definition at line 20 of file CastorElectronicsSim.cc.

References mps_fire::result.

20  {
21  convert<CastorDataFrame>(lf, result, engine);
22 }

◆ convert()

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

Definition at line 14 of file CastorElectronicsSim.cc.

References CastorAmplifier::amplify(), CastorCoderFactory::coder(), mps_fire::result, theAmplifier, theCoderFactory, and theStartingCapId.

14  {
15  result.setSize(frame.size());
16  theAmplifier->amplify(frame, engine);
18 }
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

◆ newEvent()

void CastorElectronicsSim::newEvent ( CLHEP::HepRandomEngine *  engine)

Things that need to be initialized every event.

Definition at line 24 of file CastorElectronicsSim.cc.

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

24  {
25  // pick a new starting Capacitor ID
26  theStartingCapId = CLHEP::RandFlat::shootInt(engine, 4);
28 }
CastorAmplifier * theAmplifier
void setStartingCapId(int capId)

Member Data Documentation

◆ theAmplifier

CastorAmplifier* CastorElectronicsSim::theAmplifier
private

Definition at line 33 of file CastorElectronicsSim.h.

Referenced by convert(), and newEvent().

◆ theCoderFactory

const CastorCoderFactory* CastorElectronicsSim::theCoderFactory
private

Definition at line 34 of file CastorElectronicsSim.h.

Referenced by convert().

◆ theStartingCapId

int CastorElectronicsSim::theStartingCapId
private

Definition at line 36 of file CastorElectronicsSim.h.

Referenced by convert(), and newEvent().