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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run const &r, edm::EventSetup const &es) overridefinal
 
virtual void endRun (edm::Run const &r, edm::EventSetup const &es) overridefinal
 
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 &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 21 of file ZdcSimpleReconstructor.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file ZdcSimpleReconstructor.cc.

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

16  :
17  reco_(conf.getParameter<bool>("correctForTimeslew"),
18  conf.getParameter<bool>("correctForPhaseContainment"),conf.getParameter<double>("correctionPhaseNS"),
19  conf.getParameter<int>("recoMethod"),
20  conf.getParameter<int>("lowGainOffset"),
21  conf.getParameter<double>("lowGainFrac")),
23  inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")),
24  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed"))
25 {
26  std::string subd=conf.getParameter<std::string>("Subdetector");
27  if (!strcasecmp(subd.c_str(),"ZDC")) {
30  produces<ZDCRecHitCollection>();
31  } else if (!strcasecmp(subd.c_str(),"CALIB")) {
34  produces<HcalCalibRecHitCollection>();
35  } else {
36  std::cout << "ZdcSimpleReconstructor is not associated with a specific subdetector!" << std::endl;
37  }
38 
39 }
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 41 of file ZdcSimpleReconstructor.cc.

41  {
42 }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 50 of file ZdcSimpleReconstructor.cc.

References myobject.

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

Implements edm::EDProducer.

Definition at line 53 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.

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