#include <ZdcSimpleReconstructor.h>
Public Member Functions | |
virtual void | beginRun (edm::Run &r, edm::EventSetup const &es) |
virtual void | endRun (edm::Run &r, edm::EventSetup const &es) |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
ZdcSimpleReconstructor (const edm::ParameterSet &ps) | |
virtual | ~ZdcSimpleReconstructor () |
Private Attributes | |
DetId::Detector | det_ |
bool | dropZSmarkedPassed_ |
edm::InputTag | inputLabel_ |
HcalLongRecoParams * | myobject |
ZdcSimpleRecAlgo | reco_ |
int | subdet_ |
HcalOtherSubdetector | subdetOther_ |
Definition at line 21 of file ZdcSimpleReconstructor.h.
ZdcSimpleReconstructor::ZdcSimpleReconstructor | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 16 of file ZdcSimpleReconstructor.cc.
References DetId::Calo, gather_cfg::cout, det_, edm::ParameterSet::getParameter(), HcalCalibration, HcalOther, AlCaHLTBitMon_QueryRunRegistry::string, subdet_, HcalZDCDetId::SubdetectorId, and subdetOther_.
: reco_(conf.getParameter<bool>("correctForTimeslew"), conf.getParameter<bool>("correctForPhaseContainment"),conf.getParameter<double>("correctionPhaseNS"), conf.getParameter<int>("recoMethod"), conf.getParameter<int>("lowGainOffset"), conf.getParameter<double>("lowGainFrac")), det_(DetId::Hcal), inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")), dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")) { std::string subd=conf.getParameter<std::string>("Subdetector"); if (!strcasecmp(subd.c_str(),"ZDC")) { det_=DetId::Calo; subdet_=HcalZDCDetId::SubdetectorId; produces<ZDCRecHitCollection>(); } else if (!strcasecmp(subd.c_str(),"CALIB")) { subdet_=HcalOther; subdetOther_=HcalCalibration; produces<HcalCalibRecHitCollection>(); } else { std::cout << "ZdcSimpleReconstructor is not associated with a specific subdetector!" << std::endl; } }
ZdcSimpleReconstructor::~ZdcSimpleReconstructor | ( | ) | [virtual] |
Definition at line 41 of file ZdcSimpleReconstructor.cc.
{ }
void ZdcSimpleReconstructor::beginRun | ( | edm::Run & | r, |
edm::EventSetup const & | es | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 43 of file ZdcSimpleReconstructor.cc.
References edm::EventSetup::get(), myobject, AlCaHLTBitMon_ParallelJobs::p, and edm::ESHandle< T >::product().
{ edm::ESHandle<HcalLongRecoParams> p; es.get<HcalLongRecoParamsRcd>().get(p); myobject = new HcalLongRecoParams(*p.product()); }
void ZdcSimpleReconstructor::endRun | ( | edm::Run & | r, |
edm::EventSetup const & | es | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 50 of file ZdcSimpleReconstructor.cc.
References myobject.
void ZdcSimpleReconstructor::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 53 of file ZdcSimpleReconstructor.cc.
References DetId::Calo, det_, dropZSmarkedPassed_, edm::EventSetup::get(), edm::Event::getByLabel(), HcalCondObjectContainer< Item >::getValues(), i, ZdcSimpleRecAlgo::initPulseCorr(), inputLabel_, myobject, HcalLongRecoParam::noiseTS(), edm::Event::put(), reco_, ZdcSimpleRecAlgo::reconstruct(), HcalLongRecoParam::signalTS(), subdet_, and HcalZDCDetId::SubdetectorId.
{ // get conditions edm::ESHandle<HcalDbService> conditions; eventSetup.get<HcalDbRecord>().get(conditions); // define vectors to pass noiseTS and signalTS std::vector<unsigned int> mySignalTS; std::vector<unsigned int> myNoiseTS; if (det_==DetId::Calo && subdet_==HcalZDCDetId::SubdetectorId) { edm::Handle<ZDCDigiCollection> digi; e.getByLabel(inputLabel_,digi); // create empty output std::auto_ptr<ZDCRecHitCollection> rec(new ZDCRecHitCollection); rec->reserve(digi->size()); // run the algorithm unsigned int toaddMem = 0; ZDCDigiCollection::const_iterator i; for (i=digi->begin(); i!=digi->end(); i++) { HcalZDCDetId cell = i->id(); DetId detcell=(DetId)cell; // rof 27.03.09: drop ZS marked and passed digis: if (dropZSmarkedPassed_) if (i->zsMarkAndPass()) continue; // get db values for signalTSs and noiseTSs const HcalLongRecoParam* myParams = myobject->getValues(detcell); mySignalTS.clear(); myNoiseTS.clear(); mySignalTS = myParams->signalTS(); myNoiseTS = myParams->noiseTS(); // warning: the PulseCorrection is not used by ZDC. If it gets a non-contingious set of // signal TS, it may not work properly. Assume contiguous here.... unsigned int toadd = mySignalTS.size(); if(toaddMem != toadd) { reco_.initPulseCorr(toadd); toaddMem = toadd; } const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell); const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell); const HcalQIEShape* shape = conditions->getHcalShape (channelCoder); HcalCoderDb coder (*channelCoder, *shape); rec->push_back(reco_.reconstruct(*i,myNoiseTS,mySignalTS,coder,calibrations)); } // return result e.put(rec); } }
DetId::Detector ZdcSimpleReconstructor::det_ [private] |
Definition at line 30 of file ZdcSimpleReconstructor.h.
Referenced by produce(), and ZdcSimpleReconstructor().
bool ZdcSimpleReconstructor::dropZSmarkedPassed_ [private] |
Definition at line 35 of file ZdcSimpleReconstructor.h.
Referenced by produce().
Definition at line 33 of file ZdcSimpleReconstructor.h.
Referenced by produce().
Definition at line 37 of file ZdcSimpleReconstructor.h.
Referenced by beginRun(), endRun(), and produce().
Definition at line 29 of file ZdcSimpleReconstructor.h.
Referenced by produce().
int ZdcSimpleReconstructor::subdet_ [private] |
Definition at line 31 of file ZdcSimpleReconstructor.h.
Referenced by produce(), and ZdcSimpleReconstructor().
Definition at line 32 of file ZdcSimpleReconstructor.h.
Referenced by ZdcSimpleReconstructor().