#include <EcalTBH2TDCRecInfoProducer.h>
Public Member Functions | |
EcalTBH2TDCRecInfoProducer (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &es) |
virtual | ~EcalTBH2TDCRecInfoProducer () |
Private Attributes | |
EcalTBH2TDCRecInfoAlgo * | algo_ |
std::string | rawInfoCollection_ |
std::string | rawInfoProducer_ |
std::string | recInfoCollection_ |
std::string | triggerDataCollection_ |
std::string | triggerDataProducer_ |
Definition at line 15 of file EcalTBH2TDCRecInfoProducer.h.
EcalTBH2TDCRecInfoProducer::EcalTBH2TDCRecInfoProducer | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 13 of file EcalTBH2TDCRecInfoProducer.cc.
References algo_, edm::ParameterSet::getParameter(), runregparse::ranges, rawInfoCollection_, rawInfoProducer_, recInfoCollection_, EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges::runRanges, Ecal2004TBTDCRanges_v1_cff::tdcRanges, EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges::tdcZero, triggerDataCollection_, and triggerDataProducer_.
{ rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection"); rawInfoProducer_ = ps.getParameter<std::string>("rawInfoProducer"); triggerDataCollection_ = ps.getParameter<std::string>("triggerDataCollection"); triggerDataProducer_ = ps.getParameter<std::string>("triggerDataProducer"); recInfoCollection_ = ps.getParameter<std::string>("recInfoCollection"); std::vector<EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges> tdcRanges; typedef std::vector< edm::ParameterSet > Parameters; Parameters ranges=ps.getParameter<Parameters>("tdcZeros"); for(Parameters::iterator itRanges = ranges.begin(); itRanges != ranges.end(); ++itRanges) { EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges aRange; aRange.runRanges.first = itRanges->getParameter<int>("startRun"); aRange.runRanges.second = itRanges->getParameter<int>("endRun"); aRange.tdcZero = itRanges->getParameter< double >("tdcZero"); tdcRanges.push_back(aRange); } produces<EcalTBTDCRecInfo>(recInfoCollection_); algo_ = new EcalTBH2TDCRecInfoAlgo(tdcRanges); }
EcalTBH2TDCRecInfoProducer::~EcalTBH2TDCRecInfoProducer | ( | ) | [virtual] |
Definition at line 40 of file EcalTBH2TDCRecInfoProducer.cc.
References algo_.
void EcalTBH2TDCRecInfoProducer::produce | ( | edm::Event & | e, |
const edm::EventSetup & | es | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 46 of file EcalTBH2TDCRecInfoProducer.cc.
References algo_, edm::Event::getByLabel(), edm::EventBase::id(), edm::HandleBase::isValid(), edm::Handle< T >::product(), edm::Event::put(), rawInfoCollection_, rawInfoProducer_, recInfoCollection_, EcalTBH2TDCRecInfoAlgo::reconstruct(), edm::EventID::run(), inputsource_file_cfi::runNumber, triggerDataCollection_, triggerDataProducer_, and HcalTBTriggerData::wasBeamTrigger().
{ int runNumber = e.id().run(); // Get input edm::Handle<HcalTBTiming> ecalRawTDC; const HcalTBTiming* ecalTDCRawInfo = 0; //evt.getByLabel( digiProducer_, digiCollection_, pDigis); e.getByLabel( rawInfoProducer_, ecalRawTDC); if (ecalRawTDC.isValid()) { ecalTDCRawInfo = ecalRawTDC.product(); } if (! ecalTDCRawInfo ) { edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str() ; return; } // Get input edm::Handle<HcalTBTriggerData> triggerData; const HcalTBTriggerData* h2TriggerData = 0; //evt.getByLabel( digiProducer_, digiCollection_, pDigis); e.getByLabel(triggerDataProducer_, triggerData); if (triggerData.isValid()) { h2TriggerData = triggerData.product(); } if (! h2TriggerData ) { edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << triggerDataCollection_.c_str(); return; } if (!h2TriggerData->wasBeamTrigger()) { std::auto_ptr<EcalTBTDCRecInfo> recInfo(new EcalTBTDCRecInfo(0.5)); e.put(recInfo,recInfoCollection_); } else { std::auto_ptr<EcalTBTDCRecInfo> recInfo(new EcalTBTDCRecInfo(algo_->reconstruct(runNumber,*ecalRawTDC))); e.put(recInfo,recInfoCollection_); } }
Definition at line 31 of file EcalTBH2TDCRecInfoProducer.h.
Referenced by EcalTBH2TDCRecInfoProducer(), produce(), and ~EcalTBH2TDCRecInfoProducer().
std::string EcalTBH2TDCRecInfoProducer::rawInfoCollection_ [private] |
Definition at line 26 of file EcalTBH2TDCRecInfoProducer.h.
Referenced by EcalTBH2TDCRecInfoProducer(), and produce().
std::string EcalTBH2TDCRecInfoProducer::rawInfoProducer_ [private] |
Definition at line 25 of file EcalTBH2TDCRecInfoProducer.h.
Referenced by EcalTBH2TDCRecInfoProducer(), and produce().
std::string EcalTBH2TDCRecInfoProducer::recInfoCollection_ [private] |
Definition at line 29 of file EcalTBH2TDCRecInfoProducer.h.
Referenced by EcalTBH2TDCRecInfoProducer(), and produce().
std::string EcalTBH2TDCRecInfoProducer::triggerDataCollection_ [private] |
Definition at line 28 of file EcalTBH2TDCRecInfoProducer.h.
Referenced by EcalTBH2TDCRecInfoProducer(), and produce().
std::string EcalTBH2TDCRecInfoProducer::triggerDataProducer_ [private] |
Definition at line 27 of file EcalTBH2TDCRecInfoProducer.h.
Referenced by EcalTBH2TDCRecInfoProducer(), and produce().