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)
 
void analogToDigital (CaloSamples &linearFrame, HcalUpgradeDataFrame &result)
 
 HcalElectronicsSim (HcalAmplifier *amplifier, const HcalCoderFactory *coderFactory)
 
void newEvent ()
 
void setDbService (const HcalDbService *service)
 
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
 
HcalTDC theTDC
 

Detailed Description

Definition at line 21 of file HcalElectronicsSim.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file HcalElectronicsSim.cc.

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

Definition at line 23 of file HcalElectronicsSim.cc.

References theRandFlat.

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

Member Function Documentation

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

Definition at line 48 of file HcalElectronicsSim.cc.

References query::result.

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

Definition at line 53 of file HcalElectronicsSim.cc.

References query::result.

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

Definition at line 58 of file HcalElectronicsSim.cc.

References query::result.

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

Definition at line 62 of file HcalElectronicsSim.cc.

References query::result.

62  {
63  convert<ZDCDataFrame>(lf, result);
64 }
tuple result
Definition: query.py:137
void HcalElectronicsSim::analogToDigital ( CaloSamples linearFrame,
HcalUpgradeDataFrame result 
)

Definition at line 67 of file HcalElectronicsSim.cc.

References query::result, theTDC, and HcalTDC::timing().

68  {
69  convert<HcalUpgradeDataFrame>(lf, result);
70 // std::cout << HcalDetId(lf.id()) << ' ' << lf;
71  theTDC.timing(lf, result);
72 }
tuple result
Definition: query.py:137
void timing(const CaloSamples &lf, HcalUpgradeDataFrame &digi) const
adds timing information to the digi
Definition: HcalTDC.cc:16
template<class Digi >
void HcalElectronicsSim::convert ( CaloSamples frame,
Digi &  result 
)
private

Definition at line 41 of file HcalElectronicsSim.cc.

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

41  {
42  result.setSize(frame.size());
43  theAmplifier->amplify(frame);
44  theCoderFactory->coder(frame.id())->fC2adc(frame, result, theStartingCapId);
45 }
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 74 of file HcalElectronicsSim.cc.

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

74  {
75  // pick a new starting Capacitor ID
77  {
78  theStartingCapId = theRandFlat->fireInt(4);
80  }
81 }
HcalAmplifier * theAmplifier
void setStartingCapId(int capId)
Definition: HcalAmplifier.h:42
CLHEP::RandFlat * theRandFlat
void HcalElectronicsSim::setDbService ( const HcalDbService service)

Definition at line 35 of file HcalElectronicsSim.cc.

References HcalTDC::setDbService(), and theTDC.

Referenced by HcalDigitizer::initializeEvent().

35  {
36  // theAmplifier->setDbService(service);
37  theTDC.setDbService(service);
38 }
void setDbService(const HcalDbService *service)
the Producer will probably update this every event
Definition: HcalTDC.cc:136
void HcalElectronicsSim::setRandomEngine ( CLHEP::HepRandomEngine &  engine)

Definition at line 28 of file HcalElectronicsSim.cc.

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

28  {
29  theRandFlat = new CLHEP::RandFlat(engine);
31  theTDC.setRandomEngine(engine);
32 }
HcalAmplifier * theAmplifier
void setRandomEngine(CLHEP::HepRandomEngine &engine)
Definition: HcalTDC.cc:132
void setRandomEngine(CLHEP::HepRandomEngine &engine)
CLHEP::RandFlat * theRandFlat
void HcalElectronicsSim::setStartingCapId ( int  startingCapId)

Definition at line 84 of file HcalElectronicsSim.cc.

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

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

85 {
86  theStartingCapId = startingCapId;
88  // turns off random capIDs forever for this instance
90 }
HcalAmplifier * theAmplifier
void setStartingCapId(int capId)
Definition: HcalAmplifier.h:42

Member Data Documentation

HcalAmplifier* HcalElectronicsSim::theAmplifier
private

Definition at line 43 of file HcalElectronicsSim.h.

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

const HcalCoderFactory* HcalElectronicsSim::theCoderFactory
private

Definition at line 44 of file HcalElectronicsSim.h.

Referenced by convert().

CLHEP::RandFlat* HcalElectronicsSim::theRandFlat
private

Definition at line 46 of file HcalElectronicsSim.h.

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

int HcalElectronicsSim::theStartingCapId
private

Definition at line 48 of file HcalElectronicsSim.h.

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

bool HcalElectronicsSim::theStartingCapIdIsRandom
private

Definition at line 49 of file HcalElectronicsSim.h.

Referenced by newEvent(), and setStartingCapId().

HcalTDC HcalElectronicsSim::theTDC
private

Definition at line 45 of file HcalElectronicsSim.h.

Referenced by analogToDigital(), setDbService(), and setRandomEngine().