#include <HcalSimpleReconstructor.h>
Public Member Functions | |
virtual void | beginRun (edm::Run &r, edm::EventSetup const &es) |
virtual void | endRun (edm::Run &r, edm::EventSetup const &es) |
HcalSimpleReconstructor (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
virtual | ~HcalSimpleReconstructor () |
Private Member Functions | |
template<class DIGICOLL , class RECHITCOLL > | |
void | process (edm::Event &e, const edm::EventSetup &c) |
Private Attributes | |
DetId::Detector | det_ |
bool | dropZSmarkedPassed_ |
int | firstSample_ |
edm::InputTag | inputLabel_ |
HcalRecoParams * | paramTS |
HcalSimpleRecAlgo | reco_ |
int | samplesToAdd_ |
int | subdet_ |
HcalOtherSubdetector | subdetOther_ |
bool | tsFromDB_ |
Definition at line 22 of file HcalSimpleReconstructor.h.
HcalSimpleReconstructor::HcalSimpleReconstructor | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 16 of file HcalSimpleReconstructor.cc.
References gather_cfg::cout, edm::ParameterSet::getParameter(), HcalBarrel, HcalForward, HcalOuter, and subdet_.
: reco_(conf.getParameter<bool>("correctForTimeslew"), conf.getParameter<bool>("correctForPhaseContainment"),conf.getParameter<double>("correctionPhaseNS")), det_(DetId::Hcal), inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")), dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")), firstSample_(conf.getParameter<int>("firstSample")), samplesToAdd_(conf.getParameter<int>("samplesToAdd")), tsFromDB_(conf.getParameter<bool>("tsFromDB")) { std::string subd=conf.getParameter<std::string>("Subdetector"); if (!strcasecmp(subd.c_str(),"HBHE")) { subdet_=HcalBarrel; produces<HBHERecHitCollection>(); } else if (!strcasecmp(subd.c_str(),"HO")) { subdet_=HcalOuter; produces<HORecHitCollection>(); } else if (!strcasecmp(subd.c_str(),"HF")) { subdet_=HcalForward; produces<HFRecHitCollection>(); } else { std::cout << "HcalSimpleReconstructor is not associated with a specific subdetector!" << std::endl; } }
HcalSimpleReconstructor::~HcalSimpleReconstructor | ( | ) | [virtual] |
Definition at line 43 of file HcalSimpleReconstructor.cc.
{ }
void HcalSimpleReconstructor::beginRun | ( | edm::Run & | r, |
edm::EventSetup const & | es | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 45 of file HcalSimpleReconstructor.cc.
References HcalSimpleRecAlgo::beginRun(), edm::EventSetup::get(), AlCaHLTBitMon_ParallelJobs::p, paramTS, edm::ESHandle< T >::product(), reco_, and tsFromDB_.
{ if(tsFromDB_) { edm::ESHandle<HcalRecoParams> p; es.get<HcalRecoParamsRcd>().get(p); paramTS = new HcalRecoParams(*p.product()); } reco_.beginRun(es); }
void HcalSimpleReconstructor::endRun | ( | edm::Run & | r, |
edm::EventSetup const & | es | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 54 of file HcalSimpleReconstructor.cc.
References HcalSimpleRecAlgo::endRun(), paramTS, reco_, and tsFromDB_.
void HcalSimpleReconstructor::process | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [private] |
Definition at line 64 of file HcalSimpleReconstructor.cc.
References dropZSmarkedPassed_, first, HcalRecoParam::firstSample(), firstSample_, edm::EventSetup::get(), edm::Event::getByLabel(), HcalCondObjectContainer< Item >::getValues(), i, inputLabel_, edm::EventBase::isRealData(), paramTS, edm::Event::put(), DetId::rawId(), reco_, HcalSimpleRecAlgo::reconstruct(), HcalRecoParam::samplesToAdd(), samplesToAdd_, HcalSimpleRecAlgo::setForData(), and tsFromDB_.
{ // get conditions edm::ESHandle<HcalDbService> conditions; eventSetup.get<HcalDbRecord>().get(conditions); const HcalQIEShape* shape = conditions->getHcalShape (); // this one is generic // HACK related to HB- corrections if(e.isRealData()) reco_.setForData(); edm::Handle<DIGICOLL> digi; e.getByLabel(inputLabel_,digi); // create empty output std::auto_ptr<RECHITCOLL> rec(new RECHITCOLL); rec->reserve(digi->size()); // run the algorithm int first = firstSample_; int toadd = samplesToAdd_; typename DIGICOLL::const_iterator i; for (i=digi->begin(); i!=digi->end(); i++) { HcalDetId cell = i->id(); DetId detcell=(DetId)cell; // rof 27.03.09: drop ZS marked and passed digis: if (dropZSmarkedPassed_) if (i->zsMarkAndPass()) continue; const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell); const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell); HcalCoderDb coder (*channelCoder, *shape); //>>> firstSample & samplesToAdd if(tsFromDB_) { const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId()); first = param_ts->firstSample(); toadd = param_ts->samplesToAdd(); } rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations)); } // return result e.put(rec); }
void HcalSimpleReconstructor::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 110 of file HcalSimpleReconstructor.cc.
References det_, alignCSCRings::e, DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, edm::EventBase::isRealData(), reco_, HcalSimpleRecAlgo::setForData(), subdet_, and subdetOther_.
{ // HACK related to HB- corrections if(e.isRealData()) reco_.setForData(); if (det_==DetId::Hcal) { if (subdet_==HcalBarrel || subdet_==HcalEndcap) { process<HBHEDigiCollection, HBHERecHitCollection>(e, eventSetup); } else if (subdet_==HcalForward) { process<HFDigiCollection, HFRecHitCollection>(e, eventSetup); } else if (subdet_==HcalOuter) { process<HODigiCollection, HORecHitCollection>(e, eventSetup); } else if (subdet_==HcalOther && subdetOther_==HcalCalibration) { process<HcalCalibDigiCollection, HcalCalibRecHitCollection>(e, eventSetup); } } }
DetId::Detector HcalSimpleReconstructor::det_ [private] |
Definition at line 32 of file HcalSimpleReconstructor.h.
Referenced by produce().
bool HcalSimpleReconstructor::dropZSmarkedPassed_ [private] |
Definition at line 37 of file HcalSimpleReconstructor.h.
Referenced by process().
int HcalSimpleReconstructor::firstSample_ [private] |
Definition at line 41 of file HcalSimpleReconstructor.h.
Referenced by process().
Definition at line 35 of file HcalSimpleReconstructor.h.
Referenced by process().
HcalRecoParams* HcalSimpleReconstructor::paramTS [private] |
Definition at line 45 of file HcalSimpleReconstructor.h.
Referenced by beginRun(), endRun(), and process().
Definition at line 31 of file HcalSimpleReconstructor.h.
Referenced by beginRun(), endRun(), process(), and produce().
int HcalSimpleReconstructor::samplesToAdd_ [private] |
Definition at line 42 of file HcalSimpleReconstructor.h.
Referenced by process().
int HcalSimpleReconstructor::subdet_ [private] |
Definition at line 33 of file HcalSimpleReconstructor.h.
Referenced by HcalSimpleReconstructor(), and produce().
Definition at line 34 of file HcalSimpleReconstructor.h.
Referenced by produce().
bool HcalSimpleReconstructor::tsFromDB_ [private] |
Definition at line 43 of file HcalSimpleReconstructor.h.
Referenced by beginRun(), endRun(), and process().