1 #ifndef HcalSimAlgos_HcalSignalGenerator_h 2 #define HcalSimAlgos_HcalSignalGenerator_h 27 class ModuleCallingContext;
30 template<
class Traits>
50 theParameterMap->setDbService(theConditions.product());
56 theEventPrincipal = eventPrincipal;
58 theParameterMap->setDbService(theConditions.product());
64 theNoiseSignals.clear();
66 const COLLECTION * digis = 0;
70 if( theEvent->getByToken(tok_, pDigis) ) {
72 LogTrace(
"HcalSignalGenerator") <<
"total # digis for " << theInputTag <<
" " << digis->
size();
76 throw cms::Exception(
"HcalSignalGenerator") <<
"Cannot find input data " << theInputTag;
79 else if(theEventPrincipal)
81 std::shared_ptr<edm::Wrapper<COLLECTION>
const> digisPTR =
82 edm::getProductByTag<COLLECTION>(*theEventPrincipal, theInputTag, mcc );
84 digis = digisPTR->product();
89 throw cms::Exception(
"HcalSignalGenerator") <<
"No Event or EventPrincipal was set";
102 if((it == digis->
begin()) && theElectronicsSim)
104 int startingCapId = (*it)[0].capid();
105 theElectronicsSim->setStartingCapId(startingCapId);
109 theNoiseSignals.push_back(samplesInPE(*it));
119 for(
int id = 0;
id<digi.
size();
id++) {
120 if(digi[
id].
adc() > 0) ++DigiSum;
138 bool overflow =
false;
141 for(
int isample=0; isample<digi.
size(); ++isample) {
142 if(digi[isample].er()) overflow =
true;
147 const HcalQIECoder* channelCoder = theConditions->getHcalCoder (cell);
148 const HcalQIEShape* channelShape = theConditions->getHcalShape (cell);
150 coder.
adc2fC(digi, result);
153 for(
int isample=0; isample<digi.
size(); ++isample) {
154 if(!digi[isample].er()) result[isample] =
float(digi[isample].
adc())/Traits::PreMixFactor;
159 for(
int isample=0; isample<digi.
size(); ++isample) {
160 result[isample] =
float(digi[isample].
adc())/Traits::PreMixFactor;
int adc(sample_type sample)
get the ADC sample (12 bits)
virtual ~HcalSignalGenerator()
edm::ESHandle< HcalDbService > theConditions
CaloSamples samplesInPE(const DIGI &digi)
HcalSignalGenerator< HcalQIE10DigitizerTraits > QIE10SignalGenerator
HcalSignalGenerator< HcalQIE11DigitizerTraits > QIE11SignalGenerator
int size() const
total number of samples in the digi
std::vector< HBHEDataFrame >::const_iterator const_iterator
bool validDigi(const DIGI &digi)
std::tuple< unsigned int, int, int, DigiType, int, int, int, float > Digi
const edm::EventPrincipal * theEventPrincipal
void initializeEvent(const edm::Event *event, const edm::EventSetup *eventSetup)
virtual void fill(edm::ModuleCallingContext const *mcc)
virtual void fillNoiseSignals(CLHEP::HepRandomEngine *) override
void initializeEvent(const edm::EventPrincipal *eventPrincipal, const edm::EventSetup *eventSetup)
some users use EventPrincipals, not Events. We support both
const edm::Event * theEvent
these fields are set in initializeEvent()
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
HcalSignalGenerator< HFDigitizerTraits > HFSignalGenerator
void setPresamples(int pre)
set presample information
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) ...
const_iterator end() const
virtual void fillNoiseSignals() override
T const * product() const
Traits::DigiCollection COLLECTION
HcalSignalGenerator(const edm::InputTag &inputTag, const edm::EDGetTokenT< COLLECTION > &t)
HcalSignalGenerator< HODigitizerTraits > HOSignalGenerator
edm::InputTag theInputTag
these come from the ParameterSet
HcalSignalGenerator< ZDCDigitizerTraits > ZDCSignalGenerator
HcalSignalGenerator< HBHEDigitizerTraits > HBHESignalGenerator
const HcalDetId & id() const
virtual void fillDigis(const COLLECTION *digis)
edm::EDGetTokenT< COLLECTION > tok_
const_iterator begin() const