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::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 Member Functions

template<class DIGICOLL , class RECHITCOLL >
void process (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_
 
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)
 
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

Date:
2011/09/02 22:54:20
Revision:
1.7
Author
J. Mans - Minnesota
Date:
2011/05/20 17:17:30
Revision:
1.3
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:121
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 54 of file HcalSimpleReconstructor.cc.

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

54  {
55  if(tsFromDB_ && paramTS) {
56  delete paramTS;
57  paramTS = 0;
58  reco_.endRun();
59  }
60 }
template<class DIGICOLL , class RECHITCOLL >
void HcalSimpleReconstructor::process ( edm::Event e,
const edm::EventSetup c 
)
private

Definition at line 64 of file HcalSimpleReconstructor.cc.

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

Referenced by ConfigBuilder.ConfigBuilder.PrintAllModules::leave().

65 {
66  // get conditions
68  eventSetup.get<HcalDbRecord>().get(conditions);
69  const HcalQIEShape* shape = conditions->getHcalShape (); // this one is generic
70 
71  // HACK related to HB- corrections
72  if(e.isRealData()) reco_.setForData();
73 
75 
76  e.getByLabel(inputLabel_,digi);
77 
78  // create empty output
79  std::auto_ptr<RECHITCOLL> rec(new RECHITCOLL);
80  rec->reserve(digi->size());
81  // run the algorithm
82  int first = firstSample_;
83  int toadd = samplesToAdd_;
84  typename DIGICOLL::const_iterator i;
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  rec->push_back(reco_.reconstruct(*i,first,toadd,coder,calibrations));
103 
104  }
105  // return result
106  e.put(rec);
107 }
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
bool isRealData() const
Definition: EventBase.h:60
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:85
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:356
Definition: DetId.h:20
const Item * getValues(DetId fId) const
void HcalSimpleReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 110 of file HcalSimpleReconstructor.cc.

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

111 {
112  // HACK related to HB- corrections
113  if(e.isRealData()) reco_.setForData();
114 
115 
116  if (det_==DetId::Hcal) {
118  process<HBHEDigiCollection, HBHERecHitCollection>(e, eventSetup);
119  } else if (subdet_==HcalForward) {
120  process<HFDigiCollection, HFRecHitCollection>(e, eventSetup);
121  } else if (subdet_==HcalOuter) {
122  process<HODigiCollection, HORecHitCollection>(e, eventSetup);
123  } else if (subdet_==HcalOther && subdetOther_==HcalCalibration) {
124  process<HcalCalibDigiCollection, HcalCalibRecHitCollection>(e, eventSetup);
125  }
126  }
127 }
bool isRealData() const
Definition: EventBase.h:60
HcalOtherSubdetector subdetOther_

Member Data Documentation

DetId::Detector HcalSimpleReconstructor::det_
private

Definition at line 32 of file HcalSimpleReconstructor.h.

Referenced by produce().

bool HcalSimpleReconstructor::dropZSmarkedPassed_
private

Definition at line 37 of file HcalSimpleReconstructor.h.

Referenced by process().

int HcalSimpleReconstructor::firstSample_
private

Definition at line 41 of file HcalSimpleReconstructor.h.

Referenced by process().

edm::InputTag HcalSimpleReconstructor::inputLabel_
private

Definition at line 35 of file HcalSimpleReconstructor.h.

Referenced by process().

HcalRecoParams* HcalSimpleReconstructor::paramTS
private

Definition at line 45 of file HcalSimpleReconstructor.h.

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

HcalSimpleRecAlgo HcalSimpleReconstructor::reco_
private

Definition at line 31 of file HcalSimpleReconstructor.h.

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

int HcalSimpleReconstructor::samplesToAdd_
private

Definition at line 42 of file HcalSimpleReconstructor.h.

Referenced by process().

int HcalSimpleReconstructor::subdet_
private

Definition at line 33 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor(), and produce().

HcalOtherSubdetector HcalSimpleReconstructor::subdetOther_
private

Definition at line 34 of file HcalSimpleReconstructor.h.

Referenced by produce().

bool HcalSimpleReconstructor::tsFromDB_
private

Definition at line 43 of file HcalSimpleReconstructor.h.

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