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
HcalElectronicsSim Class Reference

#include <HcalElectronicsSim.h>

Public Member Functions

void analogToDigital (CaloSamples &linearFrame, HBHEDataFrame &result)
 
void analogToDigital (CaloSamples &linearFrame, HODataFrame &result)
 
void analogToDigital (CaloSamples &linearFrame, HFDataFrame &result)
 
void analogToDigital (CaloSamples &linearFrame, ZDCDataFrame &result)
 
 HcalElectronicsSim (HcalAmplifier *amplifier, const HcalCoderFactory *coderFactory)
 
void newEvent ()
 
void setRandomEngine (CLHEP::HepRandomEngine &engine)
 
void setStartingCapId (int startingCapId)
 
 ~HcalElectronicsSim ()
 

Private Member Functions

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

Private Attributes

HcalAmplifiertheAmplifier
 
const HcalCoderFactorytheCoderFactory
 
CLHEP::RandFlat * theRandFlat
 
int theStartingCapId
 
bool theStartingCapIdIsRandom
 

Detailed Description

Definition at line 19 of file HcalElectronicsSim.h.

Constructor & Destructor Documentation

HcalElectronicsSim::HcalElectronicsSim ( HcalAmplifier amplifier,
const HcalCoderFactory coderFactory 
)

Definition at line 12 of file HcalElectronicsSim.cc.

13  : theAmplifier(amplifier),
14  theCoderFactory(coderFactory),
15  theRandFlat(0),
18 {
19 }
HcalAmplifier * theAmplifier
const HcalCoderFactory * theCoderFactory
CLHEP::RandFlat * theRandFlat
HcalElectronicsSim::~HcalElectronicsSim ( )

Definition at line 22 of file HcalElectronicsSim.cc.

References theRandFlat.

23 {
24  delete theRandFlat;
25 }
CLHEP::RandFlat * theRandFlat

Member Function Documentation

void HcalElectronicsSim::analogToDigital ( CaloSamples linearFrame,
HBHEDataFrame result 
)

Definition at line 43 of file HcalElectronicsSim.cc.

References query::result.

43  {
44  convert<HBHEDataFrame>(lf, result);
45 }
tuple result
Definition: query.py:137
void HcalElectronicsSim::analogToDigital ( CaloSamples linearFrame,
HODataFrame result 
)

Definition at line 48 of file HcalElectronicsSim.cc.

References query::result.

48  {
49  convert<HODataFrame>(lf, result);
50 }
tuple result
Definition: query.py:137
void HcalElectronicsSim::analogToDigital ( CaloSamples linearFrame,
HFDataFrame result 
)

Definition at line 53 of file HcalElectronicsSim.cc.

References query::result.

53  {
54  convert<HFDataFrame>(lf, result);
55 }
tuple result
Definition: query.py:137
void HcalElectronicsSim::analogToDigital ( CaloSamples linearFrame,
ZDCDataFrame result 
)

Definition at line 57 of file HcalElectronicsSim.cc.

References query::result.

57  {
58  convert<ZDCDataFrame>(lf, result);
59 }
tuple result
Definition: query.py:137
template<class Digi >
void HcalElectronicsSim::convert ( CaloSamples frame,
Digi &  result 
)
private

Definition at line 36 of file HcalElectronicsSim.cc.

References HcalAmplifier::amplify(), HcalCoderFactory::coder(), CaloSamples::id(), CaloSamples::size(), theAmplifier, theCoderFactory, and theStartingCapId.

36  {
37  result.setSize(frame.size());
38  theAmplifier->amplify(frame);
39  theCoderFactory->coder(frame.id())->fC2adc(frame, result, theStartingCapId);
40 }
HcalAmplifier * theAmplifier
tuple result
Definition: query.py:137
const HcalCoderFactory * theCoderFactory
int size() const
get the size
Definition: CaloSamples.h:24
virtual void amplify(CaloSamples &linearFrame) const
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
std::auto_ptr< HcalCoder > coder(const DetId &detId) const
user gets control of the pointer
void HcalElectronicsSim::newEvent ( )

Things that need to be initialized every event sets starting CapID randomly

Definition at line 62 of file HcalElectronicsSim.cc.

References HcalAmplifier::setStartingCapId(), theAmplifier, theRandFlat, theStartingCapId, and theStartingCapIdIsRandom.

62  {
63  // pick a new starting Capacitor ID
65  {
66  theStartingCapId = theRandFlat->fireInt(4);
68  }
69 }
HcalAmplifier * theAmplifier
void setStartingCapId(int capId)
Definition: HcalAmplifier.h:38
CLHEP::RandFlat * theRandFlat
void HcalElectronicsSim::setRandomEngine ( CLHEP::HepRandomEngine &  engine)

Definition at line 28 of file HcalElectronicsSim.cc.

References HcalAmplifier::setRandomEngine(), theAmplifier, and theRandFlat.

29 {
30  theRandFlat = new CLHEP::RandFlat(engine);
32 }
HcalAmplifier * theAmplifier
void setRandomEngine(CLHEP::HepRandomEngine &engine)
CLHEP::RandFlat * theRandFlat
void HcalElectronicsSim::setStartingCapId ( int  startingCapId)

Definition at line 72 of file HcalElectronicsSim.cc.

References HcalAmplifier::setStartingCapId(), theAmplifier, theStartingCapId, and theStartingCapIdIsRandom.

Referenced by HcalSignalGenerator< HBHEDigitizerTraits >::fill().

73 {
74  theStartingCapId = startingCapId;
76  // turns off random capIDs forever for this instance
78 }
HcalAmplifier * theAmplifier
void setStartingCapId(int capId)
Definition: HcalAmplifier.h:38

Member Data Documentation

HcalAmplifier* HcalElectronicsSim::theAmplifier
private

Definition at line 40 of file HcalElectronicsSim.h.

Referenced by convert(), newEvent(), setRandomEngine(), and setStartingCapId().

const HcalCoderFactory* HcalElectronicsSim::theCoderFactory
private

Definition at line 41 of file HcalElectronicsSim.h.

Referenced by convert().

CLHEP::RandFlat* HcalElectronicsSim::theRandFlat
private

Definition at line 42 of file HcalElectronicsSim.h.

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

int HcalElectronicsSim::theStartingCapId
private

Definition at line 44 of file HcalElectronicsSim.h.

Referenced by convert(), newEvent(), and setStartingCapId().

bool HcalElectronicsSim::theStartingCapIdIsRandom
private

Definition at line 45 of file HcalElectronicsSim.h.

Referenced by newEvent(), and setStartingCapId().