9 #include "CLHEP/Random/RandFlat.h"
13 : theAmplifier(amplifier),
14 theCoderFactory(coderFactory),
16 theStartingCapIdIsRandom(
true),
17 PreMixDigis(PreMixing)
33 result.setSize(frame.
size());
40 convert<HBHEDataFrame>(lf,
result, engine);
42 for(
int isample = 0; isample !=lf.size(); ++isample) {
43 uint16_t theADC = round(10.0*lf[isample]);
44 unsigned capId = result[isample].capid();
47 uint16_t keepADC = result[isample].adc();
49 result.setSample(isample,
HcalQIESample(keepADC, capId, 0, 0,
true,
true) );
52 result.setSample(isample,
HcalQIESample(theADC, capId, 0, 0) );
61 convert<HODataFrame>(lf,
result, engine);
63 for(
int isample = 0; isample !=lf.size(); ++isample) {
64 uint16_t theADC = round(10.0*lf[isample]);
65 unsigned capId = result[isample].capid();
68 uint16_t keepADC = result[isample].adc();
70 result.setSample(isample,
HcalQIESample(keepADC, capId, 0, 0,
true,
true) );
73 result.setSample(isample,
HcalQIESample(theADC, capId, 0, 0) );
82 convert<HFDataFrame>(lf,
result, engine);
84 for(
int isample = 0; isample !=lf.size(); ++isample) {
85 uint16_t theADC = round(10.0*lf[isample]);
86 unsigned capId = result[isample].capid();
89 uint16_t keepADC = result[isample].adc();
91 result.setSample(isample,
HcalQIESample(keepADC, capId, 0, 0,
true,
true) );
94 result.setSample(isample,
HcalQIESample(theADC, capId, 0, 0) );
102 convert<ZDCDataFrame>(lf,
result, engine);
104 for(
int isample = 0; isample !=lf.size(); ++isample) {
105 uint16_t theADC = round(10.0*lf[isample]);
106 unsigned capId = result[isample].capid();
109 uint16_t keepADC = result[isample].adc();
111 result.setSample(isample,
HcalQIESample(keepADC, capId, 0, 0,
true,
true) );
114 result.setSample(isample,
HcalQIESample(theADC, capId, 0, 0) );
124 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