#include <HcalSignalGenerator.h>
Public Types | |
typedef HCALDIGITIZERTRAITS::DigiCollection | COLLECTION |
typedef HCALDIGITIZERTRAITS::Digi | DIGI |
Public Member Functions | |
virtual void | fill () |
HcalSignalGenerator (const edm::InputTag &inputTag) | |
void | initializeEvent (const edm::EventPrincipal *eventPrincipal, const edm::EventSetup *eventSetup) |
some users use EventPrincipals, not Events. We support both | |
void | initializeEvent (const edm::Event *event, const edm::EventSetup *eventSetup) |
virtual | ~HcalSignalGenerator () |
Private Member Functions | |
CaloSamples | samplesInPE (const DIGI &digi) |
Private Attributes | |
edm::ESHandle< HcalDbService > | theConditions |
const edm::Event * | theEvent |
these fields are set in initializeEvent() | |
const edm::EventPrincipal * | theEventPrincipal |
edm::InputTag | theInputTag |
these come from the ParameterSet | |
const HcalQIEShape * | theShape |
Converts digis back into analog signals, to be used as noise
Definition at line 24 of file HcalSignalGenerator.h.
typedef HCALDIGITIZERTRAITS::DigiCollection HcalSignalGenerator< HCALDIGITIZERTRAITS >::COLLECTION |
Definition at line 28 of file HcalSignalGenerator.h.
typedef HCALDIGITIZERTRAITS::Digi HcalSignalGenerator< HCALDIGITIZERTRAITS >::DIGI |
Definition at line 27 of file HcalSignalGenerator.h.
HcalSignalGenerator< HCALDIGITIZERTRAITS >::HcalSignalGenerator | ( | const edm::InputTag & | inputTag | ) | [inline] |
Definition at line 30 of file HcalSignalGenerator.h.
: HcalBaseSignalGenerator(), theEvent(0), theEventPrincipal(0), theShape(0), theInputTag(inputTag) {}
virtual HcalSignalGenerator< HCALDIGITIZERTRAITS >::~HcalSignalGenerator | ( | ) | [inline, virtual] |
Definition at line 33 of file HcalSignalGenerator.h.
{}
virtual void HcalSignalGenerator< HCALDIGITIZERTRAITS >::fill | ( | void | ) | [inline, virtual] |
Definition at line 52 of file HcalSignalGenerator.h.
Referenced by edm::DataMixingHcalDigiWorkerProd::addHcalPileups().
{ theNoiseSignals.clear(); edm::Handle<COLLECTION> pDigis; const COLLECTION * digis = 0; // try accessing by whatever is set, Event or EventPrincipal if(theEvent) { if( theEvent->getByLabel(theInputTag, pDigis) ) { digis = pDigis.product(); // get a ptr to the product LogTrace("HcalSignalGenerator") << "total # digis for " << theInputTag << " " << digis->size(); } else { throw cms::Exception("HcalSignalGenerator") << "Cannot find input data " << theInputTag; } } else if(theEventPrincipal) { boost::shared_ptr<edm::Wrapper<COLLECTION> const> digisPTR = edm::getProductByTag<COLLECTION>(*theEventPrincipal, theInputTag ); if(digisPTR) { digis = digisPTR->product(); } } else { throw cms::Exception("HcalSignalGenerator") << "No Event or EventPrincipal was set"; } if (digis) { // loop over digis, adding these to the existing maps for(typename COLLECTION::const_iterator it = digis->begin(); it != digis->end(); ++it) { // for the first signal, set the starting cap id if((it == digis->begin()) && theElectronicsSim) { int startingCapId = (*it)[0].capid(); theElectronicsSim->setStartingCapId(startingCapId); theParameterMap->setFrameSize(it->id(), it->size()); } theNoiseSignals.push_back(samplesInPE(*it)); } } }
void HcalSignalGenerator< HCALDIGITIZERTRAITS >::initializeEvent | ( | const edm::EventPrincipal * | eventPrincipal, |
const edm::EventSetup * | eventSetup | ||
) | [inline] |
some users use EventPrincipals, not Events. We support both
Definition at line 44 of file HcalSignalGenerator.h.
{ theEventPrincipal = eventPrincipal; eventSetup->get<HcalDbRecord>().get(theConditions); theShape = theConditions->getHcalShape (); // this one is generic theParameterMap->setDbService(theConditions.product()); }
void HcalSignalGenerator< HCALDIGITIZERTRAITS >::initializeEvent | ( | const edm::Event * | event, |
const edm::EventSetup * | eventSetup | ||
) | [inline] |
Definition at line 35 of file HcalSignalGenerator.h.
Referenced by edm::DataMixingHcalDigiWorkerProd::addHcalPileups().
{ theEvent = event; eventSetup->get<HcalDbRecord>().get(theConditions); theShape = theConditions->getHcalShape (); // this one is generic theParameterMap->setDbService(theConditions.product()); }
CaloSamples HcalSignalGenerator< HCALDIGITIZERTRAITS >::samplesInPE | ( | const DIGI & | digi | ) | [inline, private] |
Definition at line 103 of file HcalSignalGenerator.h.
Referenced by HcalSignalGenerator< HBHEDigitizerTraits >::fill().
{ // calibration, for future reference: (same block for all Hcal types) HcalDetId cell = digi.id(); // const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell); const HcalQIECoder* channelCoder = theConditions->getHcalCoder (cell); HcalCoderDb coder (*channelCoder, *theShape); CaloSamples result; coder.adc2fC(digi, result); fC2pe(result); return result; }
edm::ESHandle<HcalDbService> HcalSignalGenerator< HCALDIGITIZERTRAITS >::theConditions [private] |
Definition at line 120 of file HcalSignalGenerator.h.
Referenced by HcalSignalGenerator< HBHEDigitizerTraits >::initializeEvent(), and HcalSignalGenerator< HBHEDigitizerTraits >::samplesInPE().
const edm::Event* HcalSignalGenerator< HCALDIGITIZERTRAITS >::theEvent [private] |
these fields are set in initializeEvent()
Definition at line 118 of file HcalSignalGenerator.h.
Referenced by HcalSignalGenerator< HBHEDigitizerTraits >::fill(), and HcalSignalGenerator< HBHEDigitizerTraits >::initializeEvent().
const edm::EventPrincipal* HcalSignalGenerator< HCALDIGITIZERTRAITS >::theEventPrincipal [private] |
Definition at line 119 of file HcalSignalGenerator.h.
Referenced by HcalSignalGenerator< HBHEDigitizerTraits >::fill(), and HcalSignalGenerator< HBHEDigitizerTraits >::initializeEvent().
edm::InputTag HcalSignalGenerator< HCALDIGITIZERTRAITS >::theInputTag [private] |
these come from the ParameterSet
Definition at line 123 of file HcalSignalGenerator.h.
Referenced by HcalSignalGenerator< HBHEDigitizerTraits >::fill().
const HcalQIEShape* HcalSignalGenerator< HCALDIGITIZERTRAITS >::theShape [private] |
Definition at line 121 of file HcalSignalGenerator.h.
Referenced by HcalSignalGenerator< HBHEDigitizerTraits >::initializeEvent(), and HcalSignalGenerator< HBHEDigitizerTraits >::samplesInPE().