#include <RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.h>
Public Member Functions | |
HcalSimpleReconstructor (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
virtual | ~HcalSimpleReconstructor () |
Private Attributes | |
DetId::Detector | det_ |
edm::InputTag | inputLabel_ |
HcalSimpleRecAlgo | reco_ |
int | subdet_ |
HcalOtherSubdetector | subdetOther_ |
Definition at line 21 of file HcalSimpleReconstructor.h.
HcalSimpleReconstructor::HcalSimpleReconstructor | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 18 of file HcalSimpleReconstructor.cc.
References DetId::Calo, GenMuonPlsPt100GeV_cfg::cout, det_, lat::endl(), edm::ParameterSet::getParameter(), HcalBarrel, HcalCalibration, HcalForward, HcalOther, HcalOuter, subdet_, HcalZDCDetId::SubdetectorId, and subdetOther_.
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(),"HBHE")) { 00026 subdet_=HcalBarrel; 00027 produces<HBHERecHitCollection>(); 00028 } else if (!strcasecmp(subd.c_str(),"HO")) { 00029 subdet_=HcalOuter; 00030 produces<HORecHitCollection>(); 00031 } else if (!strcasecmp(subd.c_str(),"HF")) { 00032 subdet_=HcalForward; 00033 produces<HFRecHitCollection>(); 00034 } else if (!strcasecmp(subd.c_str(),"ZDC")) { 00035 det_=DetId::Calo; 00036 subdet_=HcalZDCDetId::SubdetectorId; 00037 produces<ZDCRecHitCollection>(); 00038 } else if (!strcasecmp(subd.c_str(),"CALIB")) { 00039 subdet_=HcalOther; 00040 subdetOther_=HcalCalibration; 00041 produces<HcalCalibRecHitCollection>(); 00042 } else { 00043 std::cout << "HcalSimpleReconstructor is not associated with a specific subdetector!" << std::endl; 00044 } 00045 00046 }
HcalSimpleReconstructor::~HcalSimpleReconstructor | ( | ) | [virtual] |
void HcalSimpleReconstructor::produce | ( | edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 51 of file HcalSimpleReconstructor.cc.
References DetId::Calo, det_, edm::EventSetup::get(), edm::Event::getByLabel(), DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, i, inputLabel_, edm::Event::put(), reco_, HcalSimpleRecAlgo::reconstruct(), subdet_, HcalZDCDetId::SubdetectorId, and subdetOther_.
00052 { 00053 // get conditions 00054 edm::ESHandle<HcalDbService> conditions; 00055 eventSetup.get<HcalDbRecord>().get(conditions); 00056 const HcalQIEShape* shape = conditions->getHcalShape (); // this one is generic 00057 00058 00059 if (det_==DetId::Hcal) { 00060 if (subdet_==HcalBarrel || subdet_==HcalEndcap) { 00061 edm::Handle<HBHEDigiCollection> digi; 00062 00063 e.getByLabel(inputLabel_,digi); 00064 00065 // create empty output 00066 std::auto_ptr<HBHERecHitCollection> rec(new HBHERecHitCollection); 00067 rec->reserve(digi->size()); 00068 // run the algorithm 00069 HBHEDigiCollection::const_iterator i; 00070 for (i=digi->begin(); i!=digi->end(); i++) { 00071 HcalDetId cell = i->id(); 00072 const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell); 00073 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell); 00074 HcalCoderDb coder (*channelCoder, *shape); 00075 rec->push_back(reco_.reconstruct(*i,coder,calibrations)); 00076 } 00077 // return result 00078 e.put(rec); 00079 } else if (subdet_==HcalOuter) { 00080 edm::Handle<HODigiCollection> digi; 00081 e.getByLabel(inputLabel_,digi); 00082 00083 // create empty output 00084 std::auto_ptr<HORecHitCollection> rec(new HORecHitCollection); 00085 rec->reserve(digi->size()); 00086 // run the algorithm 00087 HODigiCollection::const_iterator i; 00088 for (i=digi->begin(); i!=digi->end(); i++) { 00089 HcalDetId cell = i->id(); 00090 const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell); 00091 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell); 00092 HcalCoderDb coder (*channelCoder, *shape); 00093 rec->push_back(reco_.reconstruct(*i,coder,calibrations)); 00094 } 00095 // return result 00096 e.put(rec); 00097 } else if (subdet_==HcalForward) { 00098 edm::Handle<HFDigiCollection> digi; 00099 e.getByLabel(inputLabel_,digi); 00100 00101 // create empty output 00102 std::auto_ptr<HFRecHitCollection> rec(new HFRecHitCollection); 00103 rec->reserve(digi->size()); 00104 // run the algorithm 00105 HFDigiCollection::const_iterator i; 00106 for (i=digi->begin(); i!=digi->end(); i++) { 00107 HcalDetId cell = i->id(); 00108 const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell); 00109 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell); 00110 HcalCoderDb coder (*channelCoder, *shape); 00111 rec->push_back(reco_.reconstruct(*i,coder,calibrations)); 00112 } 00113 // return result 00114 e.put(rec); 00115 } else if (subdet_==HcalOther && subdetOther_==HcalCalibration) { 00116 edm::Handle<HcalCalibDigiCollection> digi; 00117 e.getByLabel(inputLabel_,digi); 00118 00119 // create empty output 00120 std::auto_ptr<HcalCalibRecHitCollection> rec(new HcalCalibRecHitCollection); 00121 rec->reserve(digi->size()); 00122 // run the algorithm 00123 HcalCalibDigiCollection::const_iterator i; 00124 for (i=digi->begin(); i!=digi->end(); i++) { 00125 HcalCalibDetId cell = i->id(); 00126 const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell); 00127 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell); 00128 HcalCoderDb coder (*channelCoder, *shape); 00129 rec->push_back(reco_.reconstruct(*i,coder,calibrations)); 00130 } 00131 // return result 00132 e.put(rec); 00133 } 00134 } else if (det_==DetId::Calo && subdet_==HcalZDCDetId::SubdetectorId) { 00135 edm::Handle<ZDCDigiCollection> digi; 00136 e.getByLabel(inputLabel_,digi); 00137 00138 // create empty output 00139 std::auto_ptr<ZDCRecHitCollection> rec(new ZDCRecHitCollection); 00140 rec->reserve(digi->size()); 00141 // run the algorithm 00142 ZDCDigiCollection::const_iterator i; 00143 for (i=digi->begin(); i!=digi->end(); i++) { 00144 HcalZDCDetId cell = i->id(); 00145 const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell); 00146 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell); 00147 HcalCoderDb coder (*channelCoder, *shape); 00148 rec->push_back(reco_.reconstruct(*i,coder,calibrations)); 00149 } 00150 // return result 00151 e.put(rec); 00152 } 00153 }
DetId::Detector HcalSimpleReconstructor::det_ [private] |
Definition at line 28 of file HcalSimpleReconstructor.h.
Referenced by HcalSimpleReconstructor(), and produce().
int HcalSimpleReconstructor::subdet_ [private] |
Definition at line 29 of file HcalSimpleReconstructor.h.
Referenced by HcalSimpleReconstructor(), and produce().
Definition at line 30 of file HcalSimpleReconstructor.h.
Referenced by HcalSimpleReconstructor(), and produce().