1 #ifndef EcalSimAlgos_EcalSignalGenerator_h 2 #define EcalSimAlgos_EcalSignalGenerator_h 42 class ModuleCallingContext;
45 template<
class ECALDIGITIZERTRAITS>
50 typedef typename ECALDIGITIZERTRAITS::DigiCollection
COLLECTION;
58 theInputTag(inputTag),
62 theDefaultGains[2] = defaultRatios->
gain6Over1() ;
63 theDefaultGains[1] = theDefaultGains[2]*(defaultRatios->
gain12Over6()) ;
64 m_EBs25notCont = EBs25notCont;
65 m_EEs25notCont = EEs25notCont;
66 m_peToABarrel = peToABarrel;
67 m_peToAEndcap = peToAEndcap;
80 ical = pIcal.product();
85 m_maxEneEB = (agc->getEBValue())*theDefaultGains[1]*MAXADC*m_EBs25notCont ;
86 m_maxEneEE = (agc->getEEValue())*theDefaultGains[1]*MAXADC*m_EEs25notCont ;
93 esgain = hesgain.product() ;
94 esmips = hesMIPs.product() ;
95 esMipToGeV = hesMIPToGeV.product() ;
96 if( 1.1 > esgain->getESGain() ) ESgain = 1;
98 if( ESgain ==1 ) ESMIPToGeV = esMipToGeV->getESValueLow();
99 else ESMIPToGeV = esMipToGeV->getESValueHigh();
105 theEventPrincipal = eventPrincipal;
109 ical = pIcal.product();
112 agc = pAgc.product();
113 m_maxEneEB = (agc->getEBValue())*theDefaultGains[1]*MAXADC*m_EBs25notCont ;
114 m_maxEneEE = (agc->getEEValue())*theDefaultGains[1]*MAXADC*m_EEs25notCont ;
121 esgain = hesgain.product() ;
122 esmips = hesMIPs.product() ;
123 esMipToGeV = hesMIPToGeV.product() ;
124 if( 1.1 > esgain->getESGain() ) ESgain = 1;
126 if( ESgain ==1 ) ESMIPToGeV = esMipToGeV->getESValueLow();
127 else ESMIPToGeV = esMipToGeV->getESValueHigh();
133 theNoiseSignals.clear();
135 const COLLECTION * digis = 0;
139 if( theEvent->getByToken(tok_, pDigis) ) {
144 throw cms::Exception(
"EcalSignalGenerator") <<
"Cannot find input data " << theInputTag;
147 else if(theEventPrincipal)
149 std::shared_ptr<edm::Wrapper<COLLECTION>
const> digisPTR =
150 edm::getProductByTag<COLLECTION>(*theEventPrincipal, theInputTag, mcc );
152 digis = digisPTR->product();
157 throw cms::Exception(
"EcalSignalGenerator") <<
"No Event or EventPrincipal was set";
164 it != digis->
end(); ++it)
168 theNoiseSignals.push_back(samplesInPE(*it));
180 for(
int id = 0;
id<digi.
size();
id++) {
181 if(digi[
id].
adc() > 0) ++DigiSum;
193 ADCGAINSWITCH = 4079 ,
200 std::vector<float> gainRatios(4);
259 double theDefaultGains[NGAINS];
int adc(sample_type sample)
get the ADC sample (12 bits)
const edm::Event * theEvent
these fields are set in initializeEvent()
EcalSignalGenerator< EBDigitizerTraits > EBSignalGenerator
ECALDIGITIZERTRAITS::DigiCollection COLLECTION
edm::ESHandle< ESMIPToGeVConstant > hesMIPToGeV
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
virtual void fillNoiseSignals() override
virtual void fill(edm::ModuleCallingContext const *mcc)
const std::vector< float > GetGainRatios(const DetId &detid)
edm::EDGetTokenT< COLLECTION > tok_
const_iterator begin() const
virtual ~EcalSignalGenerator()
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
void initializeEvent(const edm::Event *event, const edm::EventSetup *eventSetup)
const EcalADCToGeVConstant * agc
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 subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void initializeEvent(const edm::EventPrincipal *eventPrincipal, const edm::EventSetup *eventSetup)
some users use EventPrincipals, not Events. We support both
EcalSignalGenerator< ESDigitizerTraits > ESSignalGenerator
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
virtual void fillNoiseSignals(CLHEP::HepRandomEngine *) override
const ESIntercalibConstants * esmips
const ESMIPToGeVConstant * esMipToGeV