1 #ifndef HcalSimAlgos_HcalSignalGenerator_h
2 #define HcalSimAlgos_HcalSignalGenerator_h
25 class ModuleCallingContext;
28 template<
class HCALDIGITIZERTRAITS>
32 typedef typename HCALDIGITIZERTRAITS::Digi
DIGI;
33 typedef typename HCALDIGITIZERTRAITS::DigiCollection
COLLECTION;
79 std::shared_ptr<edm::Wrapper<COLLECTION>
const> digisPTR =
82 digis = digisPTR->product();
87 throw cms::Exception(
"HcalSignalGenerator") <<
"No Event or EventPrincipal was set";
95 it != digis->
end(); ++it)
100 int startingCapId = (*it)[0].capid();
120 for(
int id = 0;
id<digi.
size();
id++) {
121 if(digi[
id].
adc() > 0) ++DigiSum;
146 bool overflow =
false;
149 for(
int isample=0; isample<digi.
size(); ++isample) {
150 if(digi[isample].er()) overflow =
true;
158 coder.
adc2fC(digi, result);
161 for(
int isample=0; isample<digi.
size(); ++isample) {
162 if(!digi[isample].er()) result[isample] =
float(digi[isample].
adc())/10.;
167 for(
int isample=0; isample<digi.
size(); ++isample) {
168 result[isample] = float(digi[isample].
adc())/10.;
int adc(sample_type sample)
get the ADC sample (12 bits)
edm::InputTag theInputTag
these come from the ParameterSet
void setStartingCapId(int startingCapId)
HcalSignalGenerator(const edm::InputTag &inputTag, const edm::EDGetTokenT< COLLECTION > &t)
void fC2pe(CaloSamples &samples) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
HCALDIGITIZERTRAITS::Digi DIGI
int size() const
total number of samples in the digi
std::vector< HBHEDataFrame >::const_iterator const_iterator
HCALDIGITIZERTRAITS::DigiCollection COLLECTION
virtual void fillNoiseSignals(CLHEP::HepRandomEngine *) override
const edm::Event * theEvent
these fields are set in initializeEvent()
CaloSamples samplesInPE(const DIGI &digi)
void initializeEvent(const edm::EventPrincipal *eventPrincipal, const edm::EventSetup *eventSetup)
some users use EventPrincipals, not Events. We support both
edm::ESHandle< HcalDbService > theConditions
std::vector< CaloSamples > theNoiseSignals
virtual void fill(edm::ModuleCallingContext const *mcc)
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
const edm::EventPrincipal * theEventPrincipal
HcalSignalGenerator< HFDigitizerTraits > HFSignalGenerator
HcalSimParameterMap * theParameterMap
void setPresamples(int pre)
set presample information
edm::EDGetTokenT< COLLECTION > tok_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware) ...
HcalElectronicsSim * theElectronicsSim
virtual ~HcalSignalGenerator()
const_iterator end() const
T const * product() const
T const * product() const
HcalSignalGenerator< HODigitizerTraits > HOSignalGenerator
HcalSignalGenerator< ZDCDigitizerTraits > ZDCSignalGenerator
virtual void fillNoiseSignals() override
HcalSignalGenerator< HBHEDigitizerTraits > HBHESignalGenerator
const HcalDetId & id() const
bool validDigi(const DIGI &digi)
void initializeEvent(const edm::Event *event, const edm::EventSetup *eventSetup)
void setDbService(const HcalDbService *service)
const_iterator begin() const