CMS 3D CMS Logo

CastorSimpleReconstructor Class Reference

#include <RecoLocalCalo/CastorReco/plugins/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 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]

Definition at line 35 of file CastorSimpleReconstructor.cc.

00035                                                       {
00036 }


Member Function Documentation

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 }


Member Data Documentation

DetId::Detector CastorSimpleReconstructor::det_ [private]

Definition at line 21 of file CastorSimpleReconstructor.h.

Referenced by CastorSimpleReconstructor(), and produce().

edm::InputTag CastorSimpleReconstructor::inputLabel_ [private]

Definition at line 24 of file CastorSimpleReconstructor.h.

Referenced by produce().

CastorSimpleRecAlgo CastorSimpleReconstructor::reco_ [private]

Definition at line 20 of file CastorSimpleReconstructor.h.

Referenced by produce().

int CastorSimpleReconstructor::subdet_ [private]

Definition at line 22 of file CastorSimpleReconstructor.h.

Referenced by CastorSimpleReconstructor(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:15 2009 for CMSSW by  doxygen 1.5.4