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 Member Functions | Private Attributes
HcalSimpleReconstructor Class Reference

#include <HcalSimpleReconstructor.h>

Inheritance diagram for HcalSimpleReconstructor:
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
 
 HcalSimpleReconstructor (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c) overridefinal
 
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 &)
 
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 Member Functions

template<class DIGICOLL , class RECHITCOLL >
void process (edm::Event &e, const edm::EventSetup &c)
 
void processUpgrade (edm::Event &e, const edm::EventSetup &c)
 

Private Attributes

DetId::Detector det_
 
bool dropZSmarkedPassed_
 
int firstSample_
 
edm::InputTag inputLabel_
 
HcalRecoParamsparamTS
 
HcalSimpleRecAlgo reco_
 
int samplesToAdd_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 
HcalTopologytheTopology
 
bool tsFromDB_
 
bool upgradeHBHE_
 
bool upgradeHF_
 

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

Date:
2013/04/26 15:50:15
Revision:
1.10
Author
J. Mans - Minnesota
Date:
2013/02/28 08:28:56
Revision:
1.4
Author
E. Garcia - CSU Based on HcalSimpleReconstructor.h by J. Mans

Definition at line 24 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, AlCaHLTBitMon_QueryRunRegistry::string, subdet_, upgradeHBHE_, and upgradeHF_.

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  upgradeHBHE_(false),
26  upgradeHF_(false),
27  paramTS(0),
28  theTopology(0)
29 {
30 
31  std::string subd=conf.getParameter<std::string>("Subdetector");
32  if(!strcasecmp(subd.c_str(),"upgradeHBHE")) {
33  upgradeHBHE_ = true;
34  produces<HBHERecHitCollection>();
35  }
36  else if (!strcasecmp(subd.c_str(),"upgradeHF")) {
37  upgradeHF_ = true;
38  produces<HFRecHitCollection>();
39  }
40  else if (!strcasecmp(subd.c_str(),"HO")) {
42  produces<HORecHitCollection>();
43  }
44  else if (!strcasecmp(subd.c_str(),"HBHE")) {
45  if( !upgradeHBHE_) {
47  produces<HBHERecHitCollection>();
48  }
49  }
50  else if (!strcasecmp(subd.c_str(),"HF")) {
51  if( !upgradeHF_) {
53  produces<HFRecHitCollection>();
54  }
55  }
56  else {
57  std::cout << "HcalSimpleReconstructor is not associated with a specific subdetector!" << std::endl;
58  }
59 
60 }
tuple conf
Definition: dbtoconf.py:185
tuple cout
Definition: gather_cfg.py:121
HcalSimpleReconstructor::~HcalSimpleReconstructor ( )
virtual

Definition at line 62 of file HcalSimpleReconstructor.cc.

References paramTS, and theTopology.

62  {
63  delete paramTS;
64  delete theTopology;
65 }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 67 of file HcalSimpleReconstructor.cc.

References HcalSimpleRecAlgo::beginRun(), edm::EventSetup::get(), AlCaHLTBitMon_ParallelJobs::p, paramTS, edm::ESHandle< class >::product(), reco_, HcalCondObjectContainerBase::setTopo(), theTopology, and tsFromDB_.

67  {
68  if(tsFromDB_) {
70  es.get<HcalRecoParamsRcd>().get(p);
71  paramTS = new HcalRecoParams(*p.product());
72 
74  es.get<IdealGeometryRecord>().get(htopo);
75  theTopology=new HcalTopology(*htopo);
77 
78  }
79  reco_.beginRun(es);
80 }
void beginRun(edm::EventSetup const &es)
void setTopo(const HcalTopology *topo) const
T const * product() const
Definition: ESHandle.h:62
void HcalSimpleReconstructor::endRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
finaloverridevirtual

Reimplemented from edm::EDProducer.

Definition at line 82 of file HcalSimpleReconstructor.cc.

References HcalSimpleRecAlgo::endRun(), paramTS, reco_, and tsFromDB_.

82  {
83  if(tsFromDB_ && paramTS) {
84  delete paramTS;
85  paramTS = 0;
86  reco_.endRun();
87  }
88 }
template<class DIGICOLL , class RECHITCOLL >
void HcalSimpleReconstructor::process ( edm::Event e,
const edm::EventSetup c 
)
private

Definition at line 92 of file HcalSimpleReconstructor.cc.

References dropZSmarkedPassed_, first, HcalRecoParam::firstSample(), firstSample_, edm::EventSetup::get(), edm::Event::getByLabel(), HcalCondObjectContainer< Item >::getValues(), i, inputLabel_, paramTS, edm::Event::put(), DetId::rawId(), reco_, HcalSimpleRecAlgo::reconstruct(), HcalRecoParam::samplesToAdd(), samplesToAdd_, and tsFromDB_.

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare_FASTSIM(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

93 {
94  // get conditions
96  eventSetup.get<HcalDbRecord>().get(conditions);
97 
99  e.getByLabel(inputLabel_,digi);
100 
101  // create empty output
102  std::auto_ptr<RECHITCOLL> rec(new RECHITCOLL);
103  rec->reserve(digi->size());
104  // run the algorithm
105  int first = firstSample_;
106  int toadd = samplesToAdd_;
107  typename DIGICOLL::const_iterator i;
108  for (i=digi->begin(); i!=digi->end(); i++) {
109  HcalDetId cell = i->id();
110  DetId detcell=(DetId)cell;
111  // rof 27.03.09: drop ZS marked and passed digis:
113  if (i->zsMarkAndPass()) continue;
114 
115  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
116  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
117  const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
118  HcalCoderDb coder (*channelCoder, *shape);
119 
120  //>>> firstSample & samplesToAdd
121  if(tsFromDB_) {
122  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
123  first = param_ts->firstSample();
124  toadd = param_ts->samplesToAdd();
125  }
126  rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations));
127  }
128  // return result
129  e.put(rec);
130 }
unsigned int firstSample() const
Definition: HcalRecoParam.h:30
int i
Definition: DBlmapReader.cc:9
HBHERecHit reconstruct(const HBHEDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
const Item * getValues(DetId fId, bool throwOnFail=true) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
unsigned int samplesToAdd() const
Definition: HcalRecoParam.h:31
bool first
Definition: L1TdeRCT.cc:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
Definition: DetId.h:20
void HcalSimpleReconstructor::processUpgrade ( edm::Event e,
const edm::EventSetup c 
)
private

Definition at line 133 of file HcalSimpleReconstructor.cc.

References dropZSmarkedPassed_, first, HcalRecoParam::firstSample(), firstSample_, edm::EventSetup::get(), edm::Event::getByLabel(), HcalCondObjectContainer< Item >::getValues(), i, inputLabel_, paramTS, edm::Event::put(), DetId::rawId(), reco_, HcalSimpleRecAlgo::reconstructHBHEUpgrade(), HcalSimpleRecAlgo::reconstructHFUpgrade(), HcalRecoParam::samplesToAdd(), samplesToAdd_, tsFromDB_, upgradeHBHE_, and upgradeHF_.

Referenced by produce().

134 {
135  // get conditions
136  edm::ESHandle<HcalDbService> conditions;
137  eventSetup.get<HcalDbRecord>().get(conditions);
138 
139  if(upgradeHBHE_){
140 
142  e.getByLabel(inputLabel_, digi);
143 
144  // create empty output
145  std::auto_ptr<HBHERecHitCollection> rec(new HBHERecHitCollection);
146  rec->reserve(digi->size());
147 
148  // run the algorithm
149  int first = firstSample_;
150  int toadd = samplesToAdd_;
152  for (i=digi->begin(); i!=digi->end(); i++) {
153  HcalDetId cell = i->id();
154  DetId detcell=(DetId)cell;
155  // rof 27.03.09: drop ZS marked and passed digis:
157  if (i->zsMarkAndPass()) continue;
158 
159  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
160  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
161  const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
162  HcalCoderDb coder (*channelCoder, *shape);
163 
164  //>>> firstSample & samplesToAdd
165  if(tsFromDB_) {
166  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
167  first = param_ts->firstSample();
168  toadd = param_ts->samplesToAdd();
169  }
170  rec->push_back(reco_.reconstructHBHEUpgrade(*i,first,toadd,coder,calibrations));
171 
172  }
173 
174  e.put(rec); // put results
175  }// End of upgradeHBHE
176 
177  if(upgradeHF_){
178 
180  e.getByLabel(inputLabel_, digi);
181 
182  // create empty output
183  std::auto_ptr<HFRecHitCollection> rec(new HFRecHitCollection);
184  rec->reserve(digi->size());
185 
186  // run the algorithm
187  int first = firstSample_;
188  int toadd = samplesToAdd_;
190  for (i=digi->begin(); i!=digi->end(); i++) {
191  HcalDetId cell = i->id();
192  DetId detcell=(DetId)cell;
193  // rof 27.03.09: drop ZS marked and passed digis:
195  if (i->zsMarkAndPass()) continue;
196 
197  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
198  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
199  const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
200  HcalCoderDb coder (*channelCoder, *shape);
201 
202  //>>> firstSample & samplesToAdd
203  if(tsFromDB_) {
204  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
205  first = param_ts->firstSample();
206  toadd = param_ts->samplesToAdd();
207  }
208  rec->push_back(reco_.reconstructHFUpgrade(*i,first,toadd,coder,calibrations));
209 
210  }
211  e.put(rec); // put results
212  }// End of upgradeHF
213 
214 }
unsigned int firstSample() const
Definition: HcalRecoParam.h:30
int i
Definition: DBlmapReader.cc:9
std::vector< T >::const_iterator const_iterator
const Item * getValues(DetId fId, bool throwOnFail=true) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
HFRecHit reconstructHFUpgrade(const HcalUpgradeDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
unsigned int samplesToAdd() const
Definition: HcalRecoParam.h:31
bool first
Definition: L1TdeRCT.cc:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
Definition: DetId.h:20
HBHERecHit reconstructHBHEUpgrade(const HcalUpgradeDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
void HcalSimpleReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
finaloverridevirtual

Implements edm::EDProducer.

Definition at line 218 of file HcalSimpleReconstructor.cc.

References det_, alignCSCRings::e, DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalOther, HcalOuter, edm::EventBase::isRealData(), processUpgrade(), reco_, HcalSimpleRecAlgo::setForData(), subdet_, subdetOther_, upgradeHBHE_, and upgradeHF_.

219 {
220  // HACK related to HB- corrections
221  if(e.isRealData()) reco_.setForData();
222 
223  // What to produce, better to avoid the same subdet Upgrade and regular
224  // rechits "clashes"
225  if(upgradeHBHE_ || upgradeHF_) {
226  processUpgrade(e, eventSetup);
227  } else if (det_==DetId::Hcal) {
229  process<HBHEDigiCollection, HBHERecHitCollection>(e, eventSetup);
230  } else if (subdet_==HcalForward && !upgradeHF_) {
231  process<HFDigiCollection, HFRecHitCollection>(e, eventSetup);
232  } else if (subdet_==HcalOuter) {
233  process<HODigiCollection, HORecHitCollection>(e, eventSetup);
234  } else if (subdet_==HcalOther && subdetOther_==HcalCalibration) {
235  process<HcalCalibDigiCollection, HcalCalibRecHitCollection>(e, eventSetup);
236  }
237  }
238 }
bool isRealData() const
Definition: EventBase.h:60
HcalOtherSubdetector subdetOther_
void processUpgrade(edm::Event &e, const edm::EventSetup &c)

Member Data Documentation

DetId::Detector HcalSimpleReconstructor::det_
private

Definition at line 35 of file HcalSimpleReconstructor.h.

Referenced by produce().

bool HcalSimpleReconstructor::dropZSmarkedPassed_
private

Definition at line 40 of file HcalSimpleReconstructor.h.

Referenced by process(), and processUpgrade().

int HcalSimpleReconstructor::firstSample_
private

Definition at line 44 of file HcalSimpleReconstructor.h.

Referenced by process(), and processUpgrade().

edm::InputTag HcalSimpleReconstructor::inputLabel_
private

Definition at line 38 of file HcalSimpleReconstructor.h.

Referenced by process(), and processUpgrade().

HcalRecoParams* HcalSimpleReconstructor::paramTS
private
HcalSimpleRecAlgo HcalSimpleReconstructor::reco_
private

Definition at line 34 of file HcalSimpleReconstructor.h.

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

int HcalSimpleReconstructor::samplesToAdd_
private

Definition at line 45 of file HcalSimpleReconstructor.h.

Referenced by process(), and processUpgrade().

int HcalSimpleReconstructor::subdet_
private

Definition at line 36 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor(), and produce().

HcalOtherSubdetector HcalSimpleReconstructor::subdetOther_
private

Definition at line 37 of file HcalSimpleReconstructor.h.

Referenced by produce().

HcalTopology* HcalSimpleReconstructor::theTopology
private

Definition at line 51 of file HcalSimpleReconstructor.h.

Referenced by beginRun(), and ~HcalSimpleReconstructor().

bool HcalSimpleReconstructor::tsFromDB_
private

Definition at line 46 of file HcalSimpleReconstructor.h.

Referenced by beginRun(), endRun(), process(), and processUpgrade().

bool HcalSimpleReconstructor::upgradeHBHE_
private

Definition at line 47 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor(), processUpgrade(), and produce().

bool HcalSimpleReconstructor::upgradeHF_
private

Definition at line 48 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor(), processUpgrade(), and produce().