CMS 3D CMS Logo

Public Member Functions | Private Attributes

ZdcSimpleReconstructor Class Reference

#include <ZdcSimpleReconstructor.h>

Inheritance diagram for ZdcSimpleReconstructor:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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_
ZdcSimpleRecAlgo reco_
int subdet_
HcalOtherSubdetector subdetOther_

Detailed Description

Definition at line 21 of file ZdcSimpleReconstructor.h.


Constructor & Destructor Documentation

ZdcSimpleReconstructor::ZdcSimpleReconstructor ( const edm::ParameterSet ps) [explicit]

Definition at line 18 of file ZdcSimpleReconstructor.cc.

References DetId::Calo, gather_cfg::cout, det_, edm::ParameterSet::getParameter(), HcalCalibration, HcalOther, subdet_, HcalZDCDetId::SubdetectorId, and subdetOther_.

                                                                         :
  reco_(conf.getParameter<int>("firstSample"),conf.getParameter<int>("samplesToAdd"),conf.getParameter<bool>("correctForTimeslew"),
        conf.getParameter<bool>("correctForPhaseContainment"),conf.getParameter<double>("correctionPhaseNS"),
        conf.getParameter<int>("recoMethod")),
  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.

                                                {
}

Member Function Documentation

void ZdcSimpleReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDProducer.

Definition at line 44 of file ZdcSimpleReconstructor.cc.

References DetId::Calo, det_, dropZSmarkedPassed_, edm::EventSetup::get(), edm::Event::getByLabel(), i, inputLabel_, edm::Event::put(), reco_, ZdcSimpleRecAlgo::reconstruct(), subdet_, and HcalZDCDetId::SubdetectorId.

{
  // get conditions
  edm::ESHandle<HcalDbService> conditions;
  eventSetup.get<HcalDbRecord>().get(conditions);
  const HcalQIEShape* shape = conditions->getHcalShape (); // this one is generic
  
  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
    ZDCDigiCollection::const_iterator i;
    for (i=digi->begin(); i!=digi->end(); i++) {
      HcalZDCDetId cell = i->id();        
        // 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);
      rec->push_back(reco_.reconstruct(*i,coder,calibrations));
    }
    // return result
    e.put(rec);     
  }
}

Member Data Documentation

Definition at line 28 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

Definition at line 33 of file ZdcSimpleReconstructor.h.

Referenced by produce().

Definition at line 31 of file ZdcSimpleReconstructor.h.

Referenced by produce().

Definition at line 27 of file ZdcSimpleReconstructor.h.

Referenced by produce().

Definition at line 29 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

Definition at line 30 of file ZdcSimpleReconstructor.h.

Referenced by ZdcSimpleReconstructor().