1 #ifndef EcalSimAlgos_EcalSignalGenerator_h 2 #define EcalSimAlgos_EcalSignalGenerator_h 42 class ModuleCallingContext;
45 template <
class ECALDIGITIZERTRAITS>
49 typedef typename ECALDIGITIZERTRAITS::DigiCollection
COLLECTION;
55 const double EBs25notCont,
56 const double EEs25notCont,
57 const double peToABarrel,
58 const double peToAEndcap)
61 theDefaultGains[2] = defaultRatios->
gain6Over1();
62 theDefaultGains[1] = theDefaultGains[2] * (defaultRatios->
gain12Over6());
63 m_EBs25notCont = EBs25notCont;
64 m_EEs25notCont = EEs25notCont;
65 m_peToABarrel = peToABarrel;
66 m_peToAEndcap = peToAEndcap;
76 ical = pIcal.product();
81 m_maxEneEB = (agc->getEBValue()) * theDefaultGains[1] * MAXADC * m_EBs25notCont;
82 m_maxEneEE = (agc->getEEValue()) * theDefaultGains[1] * MAXADC * m_EEs25notCont;
89 esgain = hesgain.product();
90 esmips = hesMIPs.product();
91 esMipToGeV = hesMIPToGeV.product();
92 if (1.1 > esgain->getESGain())
97 ESMIPToGeV = esMipToGeV->getESValueLow();
99 ESMIPToGeV = esMipToGeV->getESValueHigh();
104 theEventPrincipal = eventPrincipal;
108 ical = pIcal.product();
111 agc = pAgc.product();
112 m_maxEneEB = (agc->getEBValue()) * theDefaultGains[1] * MAXADC * m_EBs25notCont;
113 m_maxEneEE = (agc->getEEValue()) * theDefaultGains[1] * MAXADC * m_EEs25notCont;
120 esgain = hesgain.product();
121 esmips = hesMIPs.product();
122 esMipToGeV = hesMIPToGeV.product();
123 if (1.1 > esgain->getESGain())
128 ESMIPToGeV = esMipToGeV->getESValueLow();
130 ESMIPToGeV = esMipToGeV->getESValueHigh();
134 theNoiseSignals.clear();
136 const COLLECTION* digis =
nullptr;
139 if (theEvent->getByToken(tok_, pDigis)) {
142 throw cms::Exception(
"EcalSignalGenerator") <<
"Cannot find input data " << theInputTag;
144 }
else if (theEventPrincipal) {
145 std::shared_ptr<edm::Wrapper<COLLECTION>
const> digisPTR =
146 edm::getProductByTag<COLLECTION>(*theEventPrincipal, theInputTag, mcc);
148 digis = digisPTR->product();
151 throw cms::Exception(
"EcalSignalGenerator") <<
"No Event or EventPrincipal was set";
158 if (validDigi(*it)) {
159 theNoiseSignals.push_back(samplesInPE(*it));
169 for (
int id = 0;
id < digi.
size();
id++) {
170 if (digi[
id].
adc() > 0)
173 return (DigiSum > 0);
184 ADCGAINSWITCH = 4079,
191 std::vector<float> gainRatios(4);
243 double theDefaultGains[NGAINS];
const edm::Event * theEvent
these fields are set in initializeEvent()
~EcalSignalGenerator() override
EcalSignalGenerator< EBDigitizerTraits > EBSignalGenerator
ECALDIGITIZERTRAITS::DigiCollection COLLECTION
edm::ESHandle< ESMIPToGeVConstant > hesMIPToGeV
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
virtual void fill(edm::ModuleCallingContext const *mcc)
void fillNoiseSignals(CLHEP::HepRandomEngine *) override
const std::vector< float > GetGainRatios(const DetId &detid)
edm::EDGetTokenT< COLLECTION > tok_
const_iterator begin() const
double fullScaleEnergy(const DetId &detId) const
std::tuple< unsigned int, int, int, DigiType, int, int, int, float > Digi
edm::ESHandle< ESIntercalibConstants > hesMIPs
edm::ESHandle< ESGain > hesgain
EcalSignalGenerator(const edm::InputTag &inputTag, const edm::EDGetTokenT< COLLECTION > &t, const double EBs25notCont, const double EEs25notCont, const double peToABarrel, const double peToAEndcap)
bool validDigi(const DIGI &digi)
const EcalIntercalibConstantsMC * ical
edm::ESHandle< EcalADCToGeVConstant > pAgc
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void initializeEvent(const edm::Event *event, const edm::EventSetup *eventSetup)
const EcalADCToGeVConstant * agc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
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
void initializeEvent(const edm::EventPrincipal *eventPrincipal, const edm::EventSetup *eventSetup)
some users use EventPrincipals, not Events. We support both
EcalSignalGenerator< ESDigitizerTraits > ESSignalGenerator
void fillNoiseSignals() override
edm::ESHandle< EcalGainRatios > grHandle
const edm::EventPrincipal * theEventPrincipal
T const * product() const
edm::InputTag theInputTag
these come from the ParameterSet
ECALDIGITIZERTRAITS::Digi DIGI
float gain12Over6() const
const_iterator end() const
double peToAConversion(const DetId &detId) const
edm::ESHandle< EcalIntercalibConstantsMC > pIcal
EcalSignalGenerator< EEDigitizerTraits > EESignalGenerator
const ESIntercalibConstants * esmips
const ESMIPToGeVConstant * esMipToGeV