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
HcalSimpleReconstructor Class Reference

#include <HcalSimpleReconstructor.h>

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

Public Member Functions

 HcalSimpleReconstructor (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~HcalSimpleReconstructor ()
 
- 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_
 
HcalSimpleRecAlgo 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)
 
- 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

Date:
2007/07/25 20:28:42
Revision:
1.2
Author
J. Mans - Minnesota
Date:
2010/01/18 00:00:66
Revision:
1.6
Author
E. Garcia - CSU Based on HcalSimpleReconstructor.h by J. Mans

Definition at line 21 of file HcalSimpleReconstructor.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file HcalSimpleReconstructor.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), HcalBarrel, HcalForward, HcalOuter, and subdet_.

18  :
19  reco_(conf.getParameter<int>("firstSample"),conf.getParameter<int>("samplesToAdd"),conf.getParameter<bool>("correctForTimeslew"),
20  conf.getParameter<bool>("correctForPhaseContainment"),conf.getParameter<double>("correctionPhaseNS")),
22  inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")),
23  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed"))
24 {
25  std::string subd=conf.getParameter<std::string>("Subdetector");
26  if (!strcasecmp(subd.c_str(),"HBHE")) {
28  produces<HBHERecHitCollection>();
29  } else if (!strcasecmp(subd.c_str(),"HO")) {
31  produces<HORecHitCollection>();
32  } else if (!strcasecmp(subd.c_str(),"HF")) {
34  produces<HFRecHitCollection>();
35  } else {
36  std::cout << "HcalSimpleReconstructor is not associated with a specific subdetector!" << std::endl;
37  }
38 
39 }
tuple conf
Definition: dbtoconf.py:185
tuple cout
Definition: gather_cfg.py:41
HcalSimpleReconstructor::~HcalSimpleReconstructor ( )
virtual

Definition at line 41 of file HcalSimpleReconstructor.cc.

41  {
42 }

Member Function Documentation

void HcalSimpleReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 44 of file HcalSimpleReconstructor.cc.

References det_, dropZSmarkedPassed_, edm::EventSetup::get(), edm::Event::getByLabel(), DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, i, inputLabel_, edm::Event::put(), reco_, HcalSimpleRecAlgo::reconstruct(), subdet_, and subdetOther_.

45 {
46  // get conditions
48  eventSetup.get<HcalDbRecord>().get(conditions);
49  const HcalQIEShape* shape = conditions->getHcalShape (); // this one is generic
50 
51 
52  if (det_==DetId::Hcal) {
55 
56  e.getByLabel(inputLabel_,digi);
57 
58  // create empty output
59  std::auto_ptr<HBHERecHitCollection> rec(new HBHERecHitCollection);
60  rec->reserve(digi->size());
61  // run the algorithm
63  for (i=digi->begin(); i!=digi->end(); i++) {
64  HcalDetId cell = i->id();
65  // rof 27.03.09: drop ZS marked and passed digis:
67  if (i->zsMarkAndPass()) continue;
68 
69  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
70  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
71  HcalCoderDb coder (*channelCoder, *shape);
72  rec->push_back(reco_.reconstruct(*i,coder,calibrations));
73  }
74  // return result
75  e.put(rec);
76  } else if (subdet_==HcalOuter) {
78  e.getByLabel(inputLabel_,digi);
79 
80  // create empty output
81  std::auto_ptr<HORecHitCollection> rec(new HORecHitCollection);
82  rec->reserve(digi->size());
83  // run the algorithm
85  for (i=digi->begin(); i!=digi->end(); i++) {
86  HcalDetId cell = i->id();
87  // rof 27.03.09: drop ZS marked and passed digis:
89  if (i->zsMarkAndPass()) continue;
90 
91  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
92  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
93  HcalCoderDb coder (*channelCoder, *shape);
94  rec->push_back(reco_.reconstruct(*i,coder,calibrations));
95  }
96  // return result
97  e.put(rec);
98  } else if (subdet_==HcalForward) {
100  e.getByLabel(inputLabel_,digi);
101 
102  // create empty output
103  std::auto_ptr<HFRecHitCollection> rec(new HFRecHitCollection);
104  rec->reserve(digi->size());
105  // run the algorithm
107  for (i=digi->begin(); i!=digi->end(); i++) {
108  HcalDetId cell = i->id();
109  // rof 27.03.09: drop ZS marked and passed digis:
111  if (i->zsMarkAndPass()) continue;
112 
113  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
114  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
115  HcalCoderDb coder (*channelCoder, *shape);
116  rec->push_back(reco_.reconstruct(*i,coder,calibrations));
117  }
118  // return result
119  e.put(rec);
120  } else if (subdet_==HcalOther && subdetOther_==HcalCalibration) {
122  e.getByLabel(inputLabel_,digi);
123 
124  // create empty output
125  std::auto_ptr<HcalCalibRecHitCollection> rec(new HcalCalibRecHitCollection);
126  rec->reserve(digi->size());
127  // run the algorithm
129  for (i=digi->begin(); i!=digi->end(); i++) {
130  HcalCalibDetId cell = i->id();
131  // rof 27.03.09: drop ZS marked and passed digis:
133  if (i->zsMarkAndPass()) continue;
134 
135  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
136  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
137  HcalCoderDb coder (*channelCoder, *shape);
138  rec->push_back(reco_.reconstruct(*i,coder,calibrations));
139  }
140  // return result
141  e.put(rec);
142  }
143  }
144 }
int i
Definition: DBlmapReader.cc:9
std::vector< T >::const_iterator const_iterator
HcalOtherSubdetector subdetOther_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
HBHERecHit reconstruct(const HBHEDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calibs) const

Member Data Documentation

DetId::Detector HcalSimpleReconstructor::det_
private

Definition at line 28 of file HcalSimpleReconstructor.h.

Referenced by produce().

bool HcalSimpleReconstructor::dropZSmarkedPassed_
private

Definition at line 33 of file HcalSimpleReconstructor.h.

Referenced by produce().

edm::InputTag HcalSimpleReconstructor::inputLabel_
private

Definition at line 31 of file HcalSimpleReconstructor.h.

Referenced by produce().

HcalSimpleRecAlgo HcalSimpleReconstructor::reco_
private

Definition at line 27 of file HcalSimpleReconstructor.h.

Referenced by produce().

int HcalSimpleReconstructor::subdet_
private

Definition at line 29 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor(), and produce().

HcalOtherSubdetector HcalSimpleReconstructor::subdetOther_
private

Definition at line 30 of file HcalSimpleReconstructor.h.

Referenced by produce().