10 #include "CLHEP/Random/RandFlat.h"
14 : theAmplifier(amplifier),
15 theCoderFactory(coderFactory),
17 theStartingCapIdIsRandom(
true),
18 PreMixDigis(PreMixing)
34 result.setSize(frame.
size());
41 convert<HBHEDataFrame>(lf,
result, engine);
43 for(
int isample = 0; isample !=lf.size(); ++isample) {
44 uint16_t theADC = round(10.0*lf[isample]);
45 unsigned capId = result[isample].capid();
48 uint16_t keepADC = result[isample].adc();
50 result.setSample(isample,
HcalQIESample(keepADC, capId, 0, 0,
true,
true) );
53 result.setSample(isample,
HcalQIESample(theADC, capId, 0, 0) );
62 convert<HODataFrame>(lf,
result, engine);
64 for(
int isample = 0; isample !=lf.size(); ++isample) {
65 uint16_t theADC = round(10.0*lf[isample]);
66 unsigned capId = result[isample].capid();
69 uint16_t keepADC = result[isample].adc();
71 result.setSample(isample,
HcalQIESample(keepADC, capId, 0, 0,
true,
true) );
74 result.setSample(isample,
HcalQIESample(theADC, capId, 0, 0) );
83 convert<HFDataFrame>(lf,
result, engine);
85 for(
int isample = 0; isample !=lf.size(); ++isample) {
86 uint16_t theADC = round(10.0*lf[isample]);
87 unsigned capId = result[isample].capid();
90 uint16_t keepADC = result[isample].adc();
92 result.setSample(isample,
HcalQIESample(keepADC, capId, 0, 0,
true,
true) );
95 result.setSample(isample,
HcalQIESample(theADC, capId, 0, 0) );
103 convert<ZDCDataFrame>(lf,
result, engine);
105 for(
int isample = 0; isample !=lf.size(); ++isample) {
106 uint16_t theADC = round(10.0*lf[isample]);
107 unsigned capId = result[isample].capid();
110 uint16_t keepADC = result[isample].adc();
112 result.setSample(isample,
HcalQIESample(keepADC, capId, 0, 0,
true,
true) );
115 result.setSample(isample,
HcalQIESample(theADC, capId, 0, 0) );
125 convert<HcalUpgradeDataFrame>(lf,
result, engine);
HcalAmplifier * theAmplifier
void setStartingCapId(int startingCapId)
void analogToDigital(CLHEP::HepRandomEngine *, CaloSamples &linearFrame, HBHEDataFrame &result)
void setStartingCapId(int capId)
void setDbService(const HcalDbService *service)
void newEvent(CLHEP::HepRandomEngine *)
HcalElectronicsSim(HcalAmplifier *amplifier, const HcalCoderFactory *coderFactory, bool PreMix)
void convert(CaloSamples &frame, Digi &result, CLHEP::HepRandomEngine *)
const HcalCoderFactory * theCoderFactory
bool theStartingCapIdIsRandom
virtual void amplify(CaloSamples &linearFrame, CLHEP::HepRandomEngine *) const
int size() const
get the size
void timing(const CaloSamples &lf, HcalUpgradeDataFrame &digi, CLHEP::HepRandomEngine *) const
adds timing information to the digi
DetId id() const
get the (generic) id
void setDbService(const HcalDbService *service)
the Producer will probably update this every event
std::auto_ptr< HcalCoder > coder(const DetId &detId) const
user gets control of the pointer