#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_ |
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::getUntrackedParameter(), runFrontEndFormatError, runZS, 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")) { runZS = ps.getUntrackedParameter<bool>("RunZS", false); runFrontEndFormatError = ps.getUntrackedParameter<bool>("FrontEndFormatError", false); produces<HcalTrigPrimDigiCollection>(); theAlgo.setPeakFinderAlgorithm(ps.getUntrackedParameter<int>("PeakFinderAlgorithm", 2)); }
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 48 of file HcalTrigPrimDigiProducer.cc.
References edm::EventSetup::get(), edm::Event::getByLabel(), edm::Event::getByType(), CaloTPGTranscoder::HcalTPG, inputLabel_, 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.
{ edm::Handle<HBHEDigiCollection> hbheDigis; edm::Handle<HFDigiCollection> hfDigis; e.getByLabel(inputLabel_[0],hbheDigis); e.getByLabel(inputLabel_[1],hfDigis); // 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(); // Step B: Create empty output std::auto_ptr<HcalTrigPrimDigiCollection> result(new HcalTrigPrimDigiCollection()); // Step C: Invoke the algorithm, passing in inputs and getting back outputs. theAlgo.run(inputCoder.product(),outTranscoder->getHcalCompressor().get(), *hbheDigis, *hfDigis, *result, 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> fedraw; e.getByType(fedraw); if (fedraw.isValid() && emap != 0) theAlgo.runFEFormatError(fedraw.product(), emap, *result); } if (runZS) theAlgo.runZS(*result); // edm::LogInfo("HcalTrigPrimDigiProducer") << "HcalTrigPrims: " << result->size(); // Step D: Put outputs into event e.put(result); outTranscoder->releaseSetup(); }
std::vector<edm::InputTag> HcalTrigPrimDigiProducer::inputLabel_ [private] |
Definition at line 22 of file HcalTrigPrimDigiProducer.h.
Referenced by produce().
bool HcalTrigPrimDigiProducer::runFrontEndFormatError [private] |
Definition at line 23 of file HcalTrigPrimDigiProducer.h.
Referenced by HcalTrigPrimDigiProducer(), and produce().
bool HcalTrigPrimDigiProducer::runZS [private] |
Definition at line 24 of file HcalTrigPrimDigiProducer.h.
Referenced by HcalTrigPrimDigiProducer(), and produce().
Definition at line 21 of file HcalTrigPrimDigiProducer.h.
Referenced by HcalTrigPrimDigiProducer(), and produce().