CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
CastorElectronicsSim Class Reference

#include <CastorElectronicsSim.h>

Public Member Functions

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

Private Member Functions

template<class Digi >
void convert (CaloSamples &frame, Digi &result)
 

Private Attributes

CastorAmplifiertheAmplifier
 
const CastorCoderFactorytheCoderFactory
 
CLHEP::RandFlat * theRandFlat
 
int theStartingCapId
 

Detailed Description

Definition at line 16 of file CastorElectronicsSim.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file CastorElectronicsSim.cc.

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

Definition at line 18 of file CastorElectronicsSim.cc.

References theRandFlat.

19 {
20  delete theRandFlat;
21 }
CLHEP::RandFlat * theRandFlat

Member Function Documentation

void CastorElectronicsSim::analogToDigital ( CaloSamples linearFrame,
CastorDataFrame result 
)

Definition at line 37 of file CastorElectronicsSim.cc.

References query::result.

37  {
38  convert<CastorDataFrame>(lf, result);
39 }
tuple result
Definition: query.py:137
template<class Digi >
void CastorElectronicsSim::convert ( CaloSamples frame,
Digi &  result 
)
private

Definition at line 31 of file CastorElectronicsSim.cc.

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

31  {
32  result.setSize(frame.size());
33  theAmplifier->amplify(frame);
34  theCoderFactory->coder(frame.id())->fC2adc(frame, result, theStartingCapId);
35 }
std::auto_ptr< CastorCoder > coder(const DetId &detId) const
user gets control of the pointer
tuple result
Definition: query.py:137
virtual void amplify(CaloSamples &linearFrame) 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 ( )

Things that need to be initialized every event.

Definition at line 41 of file CastorElectronicsSim.cc.

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

41  {
42  // pick a new starting Capacitor ID
43  theStartingCapId = theRandFlat->fireInt(4);
45 }
CastorAmplifier * theAmplifier
CLHEP::RandFlat * theRandFlat
void setStartingCapId(int capId)
void CastorElectronicsSim::setRandomEngine ( CLHEP::HepRandomEngine &  engine)

Definition at line 24 of file CastorElectronicsSim.cc.

References theRandFlat.

Referenced by CastorDigiProducer::CastorDigiProducer().

25 {
26  theRandFlat = new CLHEP::RandFlat(engine);
27 }
CLHEP::RandFlat * theRandFlat

Member Data Documentation

CastorAmplifier* CastorElectronicsSim::theAmplifier
private

Definition at line 32 of file CastorElectronicsSim.h.

Referenced by convert(), and newEvent().

const CastorCoderFactory* CastorElectronicsSim::theCoderFactory
private

Definition at line 33 of file CastorElectronicsSim.h.

Referenced by convert().

CLHEP::RandFlat* CastorElectronicsSim::theRandFlat
private

Definition at line 34 of file CastorElectronicsSim.h.

Referenced by newEvent(), setRandomEngine(), and ~CastorElectronicsSim().

int CastorElectronicsSim::theStartingCapId
private

Definition at line 36 of file CastorElectronicsSim.h.

Referenced by convert(), and newEvent().