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

virtual void beginRun (edm::Run &r, edm::EventSetup const &es)
 
virtual void endRun (edm::Run &r, edm::EventSetup const &es)
 
 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_
 
int firstSample_
 
edm::InputTag inputLabel_
 
HcalRecoParamsparamTS
 
HcalSimpleRecAlgo reco_
 
int samplesToAdd_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 
bool tsFromDB_
 

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:
2011/02/22 20:44:52
Revision:
1.4
Author
J. Mans - Minnesota
Date:
2010/01/21 14:37:40
Revision:
1.1
Author
E. Garcia - CSU Based on HcalSimpleReconstructor.h by J. Mans

Definition at line 22 of file HcalSimpleReconstructor.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file HcalSimpleReconstructor.cc.

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

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

Definition at line 43 of file HcalSimpleReconstructor.cc.

43 { }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 53 of file HcalSimpleReconstructor.cc.

References paramTS.

53  {
54  if (paramTS) delete paramTS;
55 }
void HcalSimpleReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 60 of file HcalSimpleReconstructor.cc.

References det_, dropZSmarkedPassed_, first, HcalRecoParam::firstSample(), firstSample_, edm::EventSetup::get(), edm::Event::getByLabel(), HcalCondObjectContainer< Item >::getValues(), DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, i, HcalSimpleRecAlgo::initPulseCorr(), inputLabel_, edm::EventBase::isRealData(), paramTS, edm::Event::put(), DetId::rawId(), reco_, HcalSimpleRecAlgo::reconstruct(), HcalRecoParam::samplesToAdd(), samplesToAdd_, HcalSimpleRecAlgo::setForData(), subdet_, subdetOther_, and tsFromDB_.

61 {
62  // get conditions
64  eventSetup.get<HcalDbRecord>().get(conditions);
65  const HcalQIEShape* shape = conditions->getHcalShape (); // this one is generic
66 
67  // HACK related to HB- corrections
68  if(e.isRealData()) reco_.setForData();
69 
70 
71  if (det_==DetId::Hcal) {
74 
75  e.getByLabel(inputLabel_,digi);
76 
77  // create empty output
78  std::auto_ptr<HBHERecHitCollection> rec(new HBHERecHitCollection);
79  rec->reserve(digi->size());
80  // run the algorithm
81  int toaddMem = 0;
82  int first = firstSample_;
83  int toadd = samplesToAdd_;
85  for (i=digi->begin(); i!=digi->end(); i++) {
86  HcalDetId cell = i->id();
87  DetId detcell=(DetId)cell;
88  // rof 27.03.09: drop ZS marked and passed digis:
90  if (i->zsMarkAndPass()) continue;
91 
92  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
93  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
94  HcalCoderDb coder (*channelCoder, *shape);
95 
96  //>>> firstSample & samplesToAdd
97  if(tsFromDB_) {
98  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
99  first = param_ts->firstSample();
100  toadd = param_ts->samplesToAdd();
101  }
102  if(toaddMem != toadd) {
103  reco_.initPulseCorr(toadd);
104  toaddMem = toadd;
105  }
106 
107  rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations));
108 
109  }
110  // return result
111  e.put(rec);
112  } else if (subdet_==HcalOuter) {
114  e.getByLabel(inputLabel_,digi);
115 
116  // create empty output
117  std::auto_ptr<HORecHitCollection> rec(new HORecHitCollection);
118  rec->reserve(digi->size());
119  // run the algorithm
120  int toaddMem = 0;
121  int first = firstSample_;
122  int toadd = samplesToAdd_;
124  for (i=digi->begin(); i!=digi->end(); i++) {
125  HcalDetId cell = i->id();
126  DetId detcell=(DetId)cell;
127  // rof 27.03.09: drop ZS marked and passed digis:
129  if (i->zsMarkAndPass()) continue;
130 
131  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
132  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
133  HcalCoderDb coder (*channelCoder, *shape);
134 
135 
136  //>>> firstSample & samplesToAdd
137  if(tsFromDB_) {
138  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
139  first = param_ts->firstSample();
140  toadd = param_ts->samplesToAdd();
141  }
142  if(toaddMem != toadd) {
143  reco_.initPulseCorr(toadd);
144  toaddMem = toadd;
145  }
146 
147  rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations));
148  }
149  // return result
150  e.put(rec);
151  } else if (subdet_==HcalForward) {
153  e.getByLabel(inputLabel_,digi);
154 
155  // create empty output
156  std::auto_ptr<HFRecHitCollection> rec(new HFRecHitCollection);
157  rec->reserve(digi->size());
158  // run the algorithm
159  int toaddMem = 0;
160  int first = firstSample_;
161  int toadd = samplesToAdd_;
163  for (i=digi->begin(); i!=digi->end(); i++) {
164  HcalDetId cell = i->id();
165  DetId detcell=(DetId)cell;
166  // rof 27.03.09: drop ZS marked and passed digis:
168  if (i->zsMarkAndPass()) continue;
169 
170  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
171  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
172  HcalCoderDb coder (*channelCoder, *shape);
173 
174  //>>> firstSample & samplesToAdd
175  if(tsFromDB_) {
176  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
177  first = param_ts->firstSample();
178  toadd = param_ts->samplesToAdd();
179  }
180  if(toaddMem != toadd) {
181  reco_.initPulseCorr(toadd);
182  toaddMem = toadd;
183  }
184 
185  rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations));
186  }
187  // return result
188  e.put(rec);
189  } else if (subdet_==HcalOther && subdetOther_==HcalCalibration) {
191  e.getByLabel(inputLabel_,digi);
192 
193  // create empty output
194  std::auto_ptr<HcalCalibRecHitCollection> rec(new HcalCalibRecHitCollection);
195  rec->reserve(digi->size());
196  // run the algorithm
197  int toaddMem = 0;
198  int first = firstSample_;
199  int toadd = samplesToAdd_;
201  for (i=digi->begin(); i!=digi->end(); i++) {
202  HcalCalibDetId cell = i->id();
203  DetId detcell=(DetId)cell;
204  // rof 27.03.09: drop ZS marked and passed digis:
206  if (i->zsMarkAndPass()) continue;
207 
208  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
209  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
210  HcalCoderDb coder (*channelCoder, *shape);
211 
212  //>>> firstSample & samplesToAdd
213  if(tsFromDB_) {
214  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
215  first = param_ts->firstSample();
216  toadd = param_ts->samplesToAdd();
217  }
218  if(toaddMem != toadd) {
219  reco_.initPulseCorr(toadd);
220  toaddMem = toadd;
221  }
222 
223  rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations));
224  }
225  // return result
226  e.put(rec);
227  }
228  }
229 }
unsigned int firstSample() const
Definition: HcalRecoParam.h:21
int i
Definition: DBlmapReader.cc:9
HBHERecHit reconstruct(const HBHEDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
std::vector< T >::const_iterator const_iterator
bool isRealData() const
Definition: EventBase.h:60
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
HcalOtherSubdetector subdetOther_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
void initPulseCorr(int toadd)
unsigned int samplesToAdd() const
Definition: HcalRecoParam.h:22
bool first
Definition: L1TdeRCT.cc:79
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
Definition: DetId.h:20
const Item * getValues(DetId fId) const

Member Data Documentation

DetId::Detector HcalSimpleReconstructor::det_
private

Definition at line 31 of file HcalSimpleReconstructor.h.

Referenced by produce().

bool HcalSimpleReconstructor::dropZSmarkedPassed_
private

Definition at line 36 of file HcalSimpleReconstructor.h.

Referenced by produce().

int HcalSimpleReconstructor::firstSample_
private

Definition at line 40 of file HcalSimpleReconstructor.h.

Referenced by produce().

edm::InputTag HcalSimpleReconstructor::inputLabel_
private

Definition at line 34 of file HcalSimpleReconstructor.h.

Referenced by produce().

HcalRecoParams* HcalSimpleReconstructor::paramTS
private

Definition at line 44 of file HcalSimpleReconstructor.h.

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

HcalSimpleRecAlgo HcalSimpleReconstructor::reco_
private

Definition at line 30 of file HcalSimpleReconstructor.h.

Referenced by produce().

int HcalSimpleReconstructor::samplesToAdd_
private

Definition at line 41 of file HcalSimpleReconstructor.h.

Referenced by produce().

int HcalSimpleReconstructor::subdet_
private

Definition at line 32 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor(), and produce().

HcalOtherSubdetector HcalSimpleReconstructor::subdetOther_
private

Definition at line 33 of file HcalSimpleReconstructor.h.

Referenced by produce().

bool HcalSimpleReconstructor::tsFromDB_
private

Definition at line 42 of file HcalSimpleReconstructor.h.

Referenced by produce().