CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ZdcSimpleReconstructor Class Reference

#include <ZdcSimpleReconstructor.h>

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

Public Member Functions

virtual void beginRun (edm::Run &r, edm::EventSetup const &es)
 
virtual void endRun (edm::Run &r, edm::EventSetup const &es)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
 ZdcSimpleReconstructor (const edm::ParameterSet &ps)
 
virtual ~ZdcSimpleReconstructor ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

DetId::Detector det_
 
bool dropZSmarkedPassed_
 
edm::InputTag inputLabel_
 
HcalLongRecoParamsmyobject
 
ZdcSimpleRecAlgo reco_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 21 of file ZdcSimpleReconstructor.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file ZdcSimpleReconstructor.cc.

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

17  :
18  reco_(conf.getParameter<bool>("correctForTimeslew"),
19  conf.getParameter<bool>("correctForPhaseContainment"),conf.getParameter<double>("correctionPhaseNS"),
20  conf.getParameter<int>("recoMethod"),
21  conf.getParameter<int>("lowGainOffset"),
22  conf.getParameter<double>("lowGainFrac")),
24  inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")),
25  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed"))
26 {
27  std::string subd=conf.getParameter<std::string>("Subdetector");
28  if (!strcasecmp(subd.c_str(),"ZDC")) {
31  produces<ZDCRecHitCollection>();
32  } else if (!strcasecmp(subd.c_str(),"CALIB")) {
35  produces<HcalCalibRecHitCollection>();
36  } else {
37  std::cout << "ZdcSimpleReconstructor is not associated with a specific subdetector!" << std::endl;
38  }
39 
40 }
HcalOtherSubdetector subdetOther_
tuple conf
Definition: dbtoconf.py:185
static const int SubdetectorId
Definition: HcalZDCDetId.h:22
tuple cout
Definition: gather_cfg.py:121
ZdcSimpleReconstructor::~ZdcSimpleReconstructor ( )
virtual

Definition at line 42 of file ZdcSimpleReconstructor.cc.

42  {
43 }

Member Function Documentation

void ZdcSimpleReconstructor::beginRun ( edm::Run r,
edm::EventSetup const &  es 
)
virtual
void ZdcSimpleReconstructor::endRun ( edm::Run r,
edm::EventSetup const &  es 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 51 of file ZdcSimpleReconstructor.cc.

References myobject.

51  {
52  if (myobject) delete myobject;
53 }
HcalLongRecoParams * myobject
void ZdcSimpleReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 54 of file ZdcSimpleReconstructor.cc.

References DetId::Calo, det_, dropZSmarkedPassed_, edm::EventSetup::get(), edm::Event::getByLabel(), HcalCondObjectContainer< Item >::getValues(), i, ZdcSimpleRecAlgo::initPulseCorr(), inputLabel_, myobject, HcalLongRecoParam::noiseTS(), edm::Event::put(), reco_, ZdcSimpleRecAlgo::reconstruct(), HcalLongRecoParam::signalTS(), subdet_, and HcalZDCDetId::SubdetectorId.

55 {
56  // get conditions
58  eventSetup.get<HcalDbRecord>().get(conditions);
59  const HcalQIEShape* shape = conditions->getHcalShape (); // this one is generic
60  // define vectors to pass noiseTS and signalTS
61  std::vector<unsigned int> mySignalTS;
62  std::vector<unsigned int> myNoiseTS;
63 
66  e.getByLabel(inputLabel_,digi);
67 
68  // create empty output
69  std::auto_ptr<ZDCRecHitCollection> rec(new ZDCRecHitCollection);
70  rec->reserve(digi->size());
71  // run the algorithm
72  unsigned int toaddMem = 0;
73 
75  for (i=digi->begin(); i!=digi->end(); i++) {
76  HcalZDCDetId cell = i->id();
77  DetId detcell=(DetId)cell;
78  // rof 27.03.09: drop ZS marked and passed digis:
80  if (i->zsMarkAndPass()) continue;
81 
82 // get db values for signalTSs and noiseTSs
83  const HcalLongRecoParam* myParams = myobject->getValues(detcell);
84  mySignalTS.clear();
85  myNoiseTS.clear();
86  mySignalTS = myParams->signalTS();
87  myNoiseTS = myParams->noiseTS();
88 // warning: the PulseCorrection is not used by ZDC. If it gets a non-contingious set of
89 // signal TS, it may not work properly. Assume contiguous here....
90  unsigned int toadd = mySignalTS.size();
91  if(toaddMem != toadd) {
92  reco_.initPulseCorr(toadd);
93  toaddMem = toadd;
94  }
95  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
96  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
97  HcalCoderDb coder (*channelCoder, *shape);
98  rec->push_back(reco_.reconstruct(*i,myNoiseTS,mySignalTS,coder,calibrations));
99  }
100  // return result
101  e.put(rec);
102  }
103 }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned int > signalTS() const
HcalLongRecoParams * myobject
std::vector< T >::const_iterator const_iterator
ZDCRecHit reconstruct(const ZDCDataFrame &digi, const std::vector< unsigned int > &myNoiseTS, const std::vector< unsigned int > &mySignalTS, const HcalCoder &coder, const HcalCalibrations &calibs) const
void initPulseCorr(int toadd)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
Definition: DetId.h:20
static const int SubdetectorId
Definition: HcalZDCDetId.h:22
std::vector< unsigned int > noiseTS() const
const Item * getValues(DetId fId) const

Member Data Documentation

DetId::Detector ZdcSimpleReconstructor::det_
private

Definition at line 30 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

bool ZdcSimpleReconstructor::dropZSmarkedPassed_
private

Definition at line 35 of file ZdcSimpleReconstructor.h.

Referenced by produce().

edm::InputTag ZdcSimpleReconstructor::inputLabel_
private

Definition at line 33 of file ZdcSimpleReconstructor.h.

Referenced by produce().

HcalLongRecoParams* ZdcSimpleReconstructor::myobject
private

Definition at line 37 of file ZdcSimpleReconstructor.h.

Referenced by beginRun(), endRun(), and produce().

ZdcSimpleRecAlgo ZdcSimpleReconstructor::reco_
private

Definition at line 29 of file ZdcSimpleReconstructor.h.

Referenced by produce().

int ZdcSimpleReconstructor::subdet_
private

Definition at line 31 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

HcalOtherSubdetector ZdcSimpleReconstructor::subdetOther_
private

Definition at line 32 of file ZdcSimpleReconstructor.h.

Referenced by ZdcSimpleReconstructor().