1 #ifndef HcalSimAlgos_HcalSignalGenerator_h
2 #define HcalSimAlgos_HcalSignalGenerator_h
26 class ModuleCallingContext;
29 template <
class Traits>
32 typedef typename Traits::Digi
DIGI;
72 std::shared_ptr<edm::Wrapper<COLLECTION>
const> digisPTR =
75 digis = digisPTR->product();
78 throw cms::Exception(
"HcalSignalGenerator") <<
"No Event or EventPrincipal was set";
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())
138 coder.
adc2fC(digi, result);
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;
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
void fC2pe(CaloSamples &samples) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< T >::const_iterator const_iterator
bool validDigi(const DIGI &digi)
constexpr const HcalDetId & id() const
void fillNoiseSignals(CLHEP::HepRandomEngine *) override
const edm::EventPrincipal * theEventPrincipal
~HcalSignalGenerator() override
bool getData(T &iHolder) const
virtual void fill(edm::ModuleCallingContext const *mcc)
std::vector< CaloSamples > theNoiseSignals
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
constexpr int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware) ...
const edm::Event * theEvent
these fields are set in initializeEvent()
HcalSignalGenerator< HFDigitizerTraits > HFSignalGenerator
HcalSimParameterMap * theParameterMap
void setPresamples(int pre)
set presample information
HcalElectronicsSim * theElectronicsSim
constexpr int size() const
total number of samples in the digi
const_iterator end() const
void fillNoiseSignals() override
T const * product() const
Traits::DigiCollection COLLECTION
HcalSignalGenerator(const edm::InputTag &inputTag, const edm::EDGetTokenT< COLLECTION > &t)
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
HcalSignalGenerator< HODigitizerTraits > HOSignalGenerator
edm::InputTag theInputTag
these come from the ParameterSet
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
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
HcalSignalGenerator< ZDCDigitizerTraits > ZDCSignalGenerator
HcalSignalGenerator< HBHEDigitizerTraits > HBHESignalGenerator
virtual void fillDigis(const COLLECTION *digis)
edm::EDGetTokenT< COLLECTION > tok_
void setDbService(const HcalDbService *service)
const_iterator begin() const
uint16_t *__restrict__ uint16_t const *__restrict__ adc
const HcalDbService * theConditions