CMS 3D CMS Logo

Public Member Functions | Private Attributes

CastorSimpleReconstructor Class Reference

#include <CastorSimpleReconstructor.h>

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

List of all members.

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_

Detailed Description

Definition at line 14 of file CastorSimpleReconstructor.h.


Constructor & Destructor Documentation

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

Definition at line 19 of file CastorSimpleReconstructor.cc.

References DetId::Calo, det_, edm::ParameterSet::getParameter(), subdet_, and HcalCastorDetId::SubdetectorId.

                                                                               :
  reco_(conf.getParameter<int>("firstSample"),conf.getParameter<int>("samplesToAdd"),conf.getParameter<bool>("correctForTimeslew"),
        conf.getParameter<bool>("correctForPhaseContainment"),conf.getParameter<double>("correctionPhaseNS")),
  det_(DetId::Hcal),
  inputLabel_(conf.getParameter<edm::InputTag>("digiLabel"))    
{
  std::string subd=conf.getParameter<std::string>("Subdetector");
  if (!strcasecmp(subd.c_str(),"CASTOR")) {
    det_=DetId::Calo;
    subdet_=HcalCastorDetId::SubdetectorId;
    produces<CastorRecHitCollection>();
  } else {
    edm::LogWarning("CastorSimpleReconstructor") << "CastorSimpleReconstructor is not associated with CASTOR subdetector!" << std::endl;
  }       
  
}
CastorSimpleReconstructor::~CastorSimpleReconstructor ( ) [virtual]

Definition at line 36 of file CastorSimpleReconstructor.cc.

                                                      {
}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 39 of file CastorSimpleReconstructor.cc.

References DetId::Calo, det_, edm::EventSetup::get(), edm::Event::getByLabel(), i, inputLabel_, edm::Event::put(), reco_, CastorSimpleRecAlgo::reconstruct(), edm::Event::run(), ExpressReco_HICollisions_FallBack::runNumber, subdet_, and HcalCastorDetId::SubdetectorId.

{
  // get conditions
  edm::ESHandle<CastorDbService> conditions;
  eventSetup.get<CastorDbRecord>().get(conditions);
  const CastorQIEShape* shape = conditions->getCastorShape (); // this one is generic
  
  // some hard coding for 2009 data
  // get event number 
  int runNumber = e.run();
  if (runNumber < 129456) { CastorSimpleRecAlgo usedRecAlgo2009(1,4,false,false,0.0); reco_ = usedRecAlgo2009;}
  
  CastorCalibrations calibrations;
  
//  if (det_==DetId::Hcal) {
     if (det_==DetId::Calo && subdet_==HcalCastorDetId::SubdetectorId) {
    edm::Handle<CastorDigiCollection> digi;
    e.getByLabel(inputLabel_,digi);
    
    // create empty output
    std::auto_ptr<CastorRecHitCollection> rec(new CastorRecHitCollection);
    // run the algorithm
    CastorDigiCollection::const_iterator i;
    for (i=digi->begin(); i!=digi->end(); i++) {
      HcalCastorDetId cell = i->id();     
 const CastorCalibrations& calibrations=conditions->getCastorCalibrations(cell);


//conditions->makeCastorCalibration (cell, &calibrations);

      const CastorQIECoder* channelCoder = conditions->getCastorCoder (cell);
      CastorCoderDb coder (*channelCoder, *shape);
      rec->push_back(reco_.reconstruct(*i,coder,calibrations));
    }
    // return result
    e.put(rec);     
//     }
  }
}

Member Data Documentation

Definition at line 21 of file CastorSimpleReconstructor.h.

Referenced by CastorSimpleReconstructor(), and produce().

Definition at line 24 of file CastorSimpleReconstructor.h.

Referenced by produce().

Definition at line 20 of file CastorSimpleReconstructor.h.

Referenced by produce().

Definition at line 22 of file CastorSimpleReconstructor.h.

Referenced by CastorSimpleReconstructor(), and produce().