#include <HcalTrigPrimDigiProducer.h>
Public Member Functions | |
HcalTrigPrimDigiProducer (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
virtual | ~HcalTrigPrimDigiProducer () |
Private Attributes | |
std::vector< edm::InputTag > | inputLabel_ |
input tags for HCAL digis | |
edm::InputTag | inputTagFEDRaw_ |
input tag for FEDRawDataCollection | |
bool | runFrontEndFormatError_ |
bool | runZS_ |
HcalTriggerPrimitiveAlgo | theAlgo_ |
Definition at line 10 of file HcalTrigPrimDigiProducer.h.
HcalTrigPrimDigiProducer::HcalTrigPrimDigiProducer | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 27 of file HcalTrigPrimDigiProducer.cc.
References edm::ParameterSet::getParameter(), HcalTriggerPrimitiveAlgo::setPeakFinderAlgorithm(), and theAlgo_.
: theAlgo_(ps.getParameter<bool>("peakFilter"), ps.getParameter<std::vector<double> >("weights"), ps.getParameter<int>("latency"), ps.getParameter<uint32_t>("FG_threshold"), ps.getParameter<uint32_t>("ZS_threshold"), ps.getParameter<int>("numberOfSamples"), ps.getParameter<int>("numberOfPresamples"), ps.getParameter<uint32_t>("MinSignalThreshold"), ps.getParameter<uint32_t>("PMTNoiseThreshold") ), inputLabel_(ps.getParameter<std::vector<edm::InputTag> >("inputLabel")), inputTagFEDRaw_(ps.getParameter<edm::InputTag> ("InputTagFEDRaw")), runZS_(ps.getParameter<bool>("RunZS")), runFrontEndFormatError_(ps.getParameter<bool>("FrontEndFormatError")) { produces<HcalTrigPrimDigiCollection>(); theAlgo_.setPeakFinderAlgorithm(ps.getParameter<int>("PeakFinderAlgorithm")); }
virtual HcalTrigPrimDigiProducer::~HcalTrigPrimDigiProducer | ( | ) | [inline, virtual] |
Definition at line 15 of file HcalTrigPrimDigiProducer.h.
{}
void HcalTrigPrimDigiProducer::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Produces the EDM products,
Implements edm::EDProducer.
Definition at line 49 of file HcalTrigPrimDigiProducer.cc.
References edm::EventSetup::get(), edm::Event::getByLabel(), CaloTPGTranscoder::HcalTPG, inputLabel_, inputTagFEDRaw_, edm::HandleBase::isValid(), edm::ESHandle< T >::product(), edm::Handle< T >::product(), edm::Event::put(), query::result, HcalTriggerPrimitiveAlgo::run(), HcalTriggerPrimitiveAlgo::runFEFormatError(), runFrontEndFormatError_, HcalTriggerPrimitiveAlgo::runZS(), runZS_, and theAlgo_.
{ // Step A: get the conditions, for the decoding edm::ESHandle<HcalTPGCoder> inputCoder; eventSetup.get<HcalTPGRecord>().get(inputCoder); edm::ESHandle<CaloTPGTranscoder> outTranscoder; eventSetup.get<CaloTPGRecord>().get(outTranscoder); outTranscoder->setup(eventSetup,CaloTPGTranscoder::HcalTPG); edm::ESHandle<HcalLutMetadata> lutMetadata; eventSetup.get<HcalLutMetadataRcd>().get(lutMetadata); float rctlsb = lutMetadata->getRctLsb(); edm::ESHandle<HcalTrigTowerGeometry> pG; eventSetup.get<CaloGeometryRecord>().get(pG); // Step B: Create empty output std::auto_ptr<HcalTrigPrimDigiCollection> result(new HcalTrigPrimDigiCollection()); edm::Handle<HBHEDigiCollection> hbheDigis; edm::Handle<HFDigiCollection> hfDigis; iEvent.getByLabel(inputLabel_[0],hbheDigis); iEvent.getByLabel(inputLabel_[1],hfDigis); // protect here against missing input collections // there is no protection in HcalTriggerPrimitiveAlgo if (!hbheDigis.isValid()) { edm::LogInfo("HcalTrigPrimDigiProducer") << "\nWarning: HBHEDigiCollection with input tag " << inputLabel_[0] << "\nrequested in configuration, but not found in the event." << "\nQuit returning empty product." << std::endl; // put empty HcalTrigPrimDigiCollection in the event iEvent.put(result); outTranscoder->releaseSetup(); return; } if (!hfDigis.isValid()) { edm::LogInfo("HcalTrigPrimDigiProducer") << "\nWarning: HFDigiCollection with input tag " << inputLabel_[1] << "\nrequested in configuration, but not found in the event." << "\nQuit returning empty product." << std::endl; // put empty HcalTrigPrimDigiCollection in the event iEvent.put(result); outTranscoder->releaseSetup(); return; } // Step C: Invoke the algorithm, passing in inputs and getting back outputs. theAlgo_.run(inputCoder.product(),outTranscoder->getHcalCompressor().get(), *hbheDigis, *hfDigis, *result, &(*pG), rctlsb); // Step C.1: Run FE Format Error / ZS for real data. if (runFrontEndFormatError_) { edm::ESHandle < HcalDbService > pSetup; eventSetup.get<HcalDbRecord> ().get(pSetup); const HcalElectronicsMap *emap = pSetup->getHcalMapping(); edm::Handle < FEDRawDataCollection > fedHandle; iEvent.getByLabel(inputTagFEDRaw_, fedHandle); if (fedHandle.isValid() && emap != 0) { theAlgo_.runFEFormatError(fedHandle.product(), emap, *result); } else { edm::LogInfo("HcalTrigPrimDigiProducer") << "\nWarning: FEDRawDataCollection with input tag " << inputTagFEDRaw_ << "\nrequested in configuration, but not found in the event." << "\nQuit returning empty product." << std::endl; // produce empty HcalTrigPrimDigiCollection and put it in the event std::auto_ptr < HcalTrigPrimDigiCollection > emptyResult( new HcalTrigPrimDigiCollection()); iEvent.put(emptyResult); outTranscoder->releaseSetup(); return; } } if (runZS_) theAlgo_.runZS(*result); // edm::LogInfo("HcalTrigPrimDigiProducer") << "HcalTrigPrims: " << result->size(); // Step D: Put outputs into event iEvent.put(result); outTranscoder->releaseSetup(); }
std::vector<edm::InputTag> HcalTrigPrimDigiProducer::inputLabel_ [private] |
input tags for HCAL digis
Definition at line 25 of file HcalTrigPrimDigiProducer.h.
Referenced by produce().
input tag for FEDRawDataCollection
Definition at line 28 of file HcalTrigPrimDigiProducer.h.
Referenced by produce().
bool HcalTrigPrimDigiProducer::runFrontEndFormatError_ [private] |
Definition at line 32 of file HcalTrigPrimDigiProducer.h.
Referenced by produce().
bool HcalTrigPrimDigiProducer::runZS_ [private] |
Definition at line 30 of file HcalTrigPrimDigiProducer.h.
Referenced by produce().
Definition at line 22 of file HcalTrigPrimDigiProducer.h.
Referenced by HcalTrigPrimDigiProducer(), and produce().