CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 8 of file CastorElectronicsSim.cc.

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

Definition at line 11 of file CastorElectronicsSim.cc.

11 {}

Member Function Documentation

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 }
tuple result
Definition: mps_fire.py:311
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(), CaloSamples::id(), CaloSamples::size(), theAmplifier, theCoderFactory, and theStartingCapId.

14  {
15  result.setSize(frame.size());
16  theAmplifier->amplify(frame, engine);
17  theCoderFactory->coder(frame.id())->fC2adc(frame, result, theStartingCapId);
18 }
std::unique_ptr< CastorCoder > coder(const DetId &detId) const
user gets control of the pointer
tuple result
Definition: mps_fire.py:311
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 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

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().