1 #ifndef HcalSimAlgos_HcalSignalGenerator_h 2 #define HcalSimAlgos_HcalSignalGenerator_h 26 class ModuleCallingContext;
29 template <
class Traits>
67 LogTrace(
"HcalSignalGenerator") <<
"total # digis for " <<
theInputTag <<
" " << digis->size();
72 std::shared_ptr<edm::Wrapper<COLLECTION>
const> digisPTR =
75 digis = digisPTR->product();
78 throw cms::Exception(
"HcalSignalGenerator") <<
"No Event or EventPrincipal was set";
88 for (
typename COLLECTION::const_iterator
it = digis->begin();
it != digis->end(); ++
it) {
91 int startingCapId = (*it)[0].capid();
106 for (
int id = 0;
id < digi.size();
id++) {
107 if (digi[
id].
adc() > 0)
110 return (DigiSum > 0);
125 bool overflow =
false;
128 for (
int isample = 0; isample < digi.size(); ++isample) {
129 if (digi[isample].er())
141 for (
int isample = 0; isample < digi.size(); ++isample) {
142 if (!digi[isample].er())
143 result[isample] =
float(digi[isample].
adc()) / Traits::PreMixFactor;
147 for (
int isample = 0; isample < digi.size(); ++isample) {
148 result[isample] =
float(digi[isample].
adc()) / Traits::PreMixFactor;
150 result.setPresamples(digi.presamples());
void initializeEvent(const edm::Event *event, const edm::EventSetup *eventSetup, const edm::ESGetToken< HcalDbService, HcalDbRecord > &tok)
CaloSamples samplesInPE(const DIGI &digi)
void setStartingCapId(int startingCapId)
HcalSignalGenerator< HcalQIE10DigitizerTraits > QIE10SignalGenerator
HcalSignalGenerator< HcalQIE11DigitizerTraits > QIE11SignalGenerator
T const * product() const
bool validDigi(const DIGI &digi)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void fillNoiseSignals(CLHEP::HepRandomEngine *) override
const edm::EventPrincipal * theEventPrincipal
~HcalSignalGenerator() override
virtual void fill(edm::ModuleCallingContext const *mcc)
std::vector< CaloSamples > theNoiseSignals
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
const edm::Event * theEvent
these fields are set in initializeEvent()
HcalSignalGenerator< HFDigitizerTraits > HFSignalGenerator
HcalSimParameterMap * theParameterMap
HcalElectronicsSim * theElectronicsSim
void fillNoiseSignals() override
Traits::DigiCollection COLLECTION
HcalSignalGenerator(const edm::InputTag &inputTag, const edm::EDGetTokenT< COLLECTION > &t)
HcalSignalGenerator< HODigitizerTraits > HOSignalGenerator
edm::InputTag theInputTag
these come from the ParameterSet
void initializeEvent(const edm::EventPrincipal *eventPrincipal, const edm::EventSetup *eventSetup, const edm::ESGetToken< HcalDbService, HcalDbRecord > &tok)
some users use EventPrincipals, not Events. We support both
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
HcalSignalGenerator< ZDCDigitizerTraits > ZDCSignalGenerator
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
HcalSignalGenerator< HBHEDigitizerTraits > HBHESignalGenerator
virtual void fillDigis(const COLLECTION *digis)
void fC2pe(CaloSamples &samples) const
edm::EDGetTokenT< COLLECTION > tok_
void setDbService(const HcalDbService *service)
uint16_t *__restrict__ uint16_t const *__restrict__ adc
const HcalDbService * theConditions