![]() |
![]() |
#include <RecoLocalCalo/CastorReco/plugins/CastorSimpleReconstructor.h>
Public Member Functions | |
CastorSimpleReconstructor (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
virtual | ~CastorSimpleReconstructor () |
Private Attributes | |
DetId::Detector | det_ |
edm::InputTag | inputLabel_ |
CastorSimpleRecAlgo | reco_ |
int | subdet_ |
Definition at line 14 of file CastorSimpleReconstructor.h.
CastorSimpleReconstructor::CastorSimpleReconstructor | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 18 of file CastorSimpleReconstructor.cc.
References DetId::Calo, GenMuonPlsPt100GeV_cfg::cout, det_, lat::endl(), edm::ParameterSet::getParameter(), subdet_, and HcalCastorDetId::SubdetectorId.
00018 : 00019 reco_(conf.getParameter<int>("firstSample"),conf.getParameter<int>("samplesToAdd"),conf.getParameter<bool>("correctForTimeslew"), 00020 conf.getParameter<bool>("correctForPhaseContainment"),conf.getParameter<double>("correctionPhaseNS")), 00021 det_(DetId::Hcal), 00022 inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")) 00023 { 00024 std::string subd=conf.getParameter<std::string>("Subdetector"); 00025 if (!strcasecmp(subd.c_str(),"CASTOR")) { 00026 det_=DetId::Calo; 00027 subdet_=HcalCastorDetId::SubdetectorId; 00028 produces<CastorRecHitCollection>(); 00029 } else { 00030 std::cout << "CastorSimpleReconstructor is not associated with CASTOR subdetector!" << std::endl; 00031 } 00032 00033 }
CastorSimpleReconstructor::~CastorSimpleReconstructor | ( | ) | [virtual] |
void CastorSimpleReconstructor::produce | ( | edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 38 of file CastorSimpleReconstructor.cc.
References DetId::Calo, det_, edm::EventSetup::get(), edm::Event::getByLabel(), DetId::Hcal, i, inputLabel_, edm::Event::put(), reco_, CastorSimpleRecAlgo::reconstruct(), subdet_, and HcalCastorDetId::SubdetectorId.
00039 { 00040 // get conditions 00041 edm::ESHandle<CastorDbService> conditions; 00042 eventSetup.get<CastorDbRecord>().get(conditions); 00043 const CastorQIEShape* shape = conditions->getCastorShape (); // this one is generic 00044 00045 CastorCalibrations calibrations; 00046 00047 if (det_==DetId::Hcal) { 00048 if (det_==DetId::Calo && subdet_==HcalCastorDetId::SubdetectorId) { 00049 edm::Handle<CastorDigiCollection> digi; 00050 e.getByLabel(inputLabel_,digi); 00051 00052 // create empty output 00053 std::auto_ptr<CastorRecHitCollection> rec(new CastorRecHitCollection); 00054 // run the algorithm 00055 CastorDigiCollection::const_iterator i; 00056 for (i=digi->begin(); i!=digi->end(); i++) { 00057 HcalCastorDetId cell = i->id(); 00058 // const CastorCalibrations& calibrations=conditions->getCastorCalibrations(cell); 00059 00060 00061 conditions->makeCastorCalibration (cell, &calibrations); 00062 00063 const CastorQIECoder* channelCoder = conditions->getCastorCoder (cell); 00064 CastorCoderDb coder (*channelCoder, *shape); 00065 rec->push_back(reco_.reconstruct(*i,coder,calibrations)); 00066 } 00067 // return result 00068 e.put(rec); 00069 } 00070 } 00071 }
Definition at line 21 of file CastorSimpleReconstructor.h.
Referenced by CastorSimpleReconstructor(), and produce().
int CastorSimpleReconstructor::subdet_ [private] |
Definition at line 22 of file CastorSimpleReconstructor.h.
Referenced by CastorSimpleReconstructor(), and produce().