CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HcalSimpleReconstructor Class Reference

#include <HcalSimpleReconstructor.h>

Inheritance diagram for HcalSimpleReconstructor:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (edm::Run const &r, edm::EventSetup const &es) final
 
void endRun (edm::Run const &r, edm::EventSetup const &es) final
 
 HcalSimpleReconstructor (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &c) final
 
 ~HcalSimpleReconstructor () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

DetId::Detector det_
 
bool dropZSmarkedPassed_
 
int firstSample_
 
edm::InputTag inputLabel_
 
HcalRecoParamsparamTS
 
HcalSimpleRecAlgo reco_
 
int samplesToAdd_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 
HcalTopologytheTopology
 
edm::EDGetTokenT< HcalCalibDigiCollectiontok_calib_
 
edm::EDGetTokenT< HFDigiCollectiontok_hf_
 
edm::EDGetTokenT< HODigiCollectiontok_ho_
 
bool tsFromDB_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Author
J. Mans - Minnesota


Author
E. Garcia - CSU Based on HcalSimpleReconstructor.h by J. Mans

Definition at line 26 of file HcalSimpleReconstructor.h.

Constructor & Destructor Documentation

◆ HcalSimpleReconstructor()

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

Definition at line 16 of file HcalSimpleReconstructor.cc.

17  : reco_(conf.getParameter<bool>("correctForTimeslew"),
18  conf.getParameter<bool>("correctForPhaseContainment"),
19  conf.getParameter<double>("correctionPhaseNS")),
21  inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")),
22  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")),
23  firstSample_(conf.getParameter<int>("firstSample")),
24  samplesToAdd_(conf.getParameter<int>("samplesToAdd")),
25  tsFromDB_(conf.getParameter<bool>("tsFromDB")),
26  paramTS(nullptr),
27  theTopology(nullptr) {
28  // register for data access
29  tok_hf_ = consumes<HFDigiCollection>(inputLabel_);
30  tok_ho_ = consumes<HODigiCollection>(inputLabel_);
31  tok_calib_ = consumes<HcalCalibDigiCollection>(inputLabel_);
32 
33  std::string subd = conf.getParameter<std::string>("Subdetector");
34  if (!strcasecmp(subd.c_str(), "HO")) {
36  produces<HORecHitCollection>();
37  } else if (!strcasecmp(subd.c_str(), "HF")) {
39  produces<HFRecHitCollection>();
40  } else {
41  std::cout << "HcalSimpleReconstructor is not associated with a specific subdetector!" << std::endl;
42  }
43 }

References gather_cfg::cout, edm::ParameterSet::getParameter(), HcalForward, HcalOuter, inputLabel_, AlCaHLTBitMon_QueryRunRegistry::string, subdet_, tok_calib_, tok_hf_, and tok_ho_.

◆ ~HcalSimpleReconstructor()

HcalSimpleReconstructor::~HcalSimpleReconstructor ( )
override

Definition at line 45 of file HcalSimpleReconstructor.cc.

45  {
46  delete paramTS;
47  delete theTopology;
48 }

References paramTS, and theTopology.

Member Function Documentation

◆ beginRun()

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

◆ endRun()

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

Definition at line 64 of file HcalSimpleReconstructor.cc.

64  {
65  if (tsFromDB_ && paramTS) {
66  delete paramTS;
67  paramTS = nullptr;
68  reco_.endRun();
69  }
70 }

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

◆ fillDescriptions()

void HcalSimpleReconstructor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 127 of file HcalSimpleReconstructor.cc.

127  {
128  // horeco
130  descHO.add<double>("correctionPhaseNS", 13.0);
131  descHO.add<edm::InputTag>("digiLabel", edm::InputTag("hcalDigis"));
132  descHO.add<bool>("tsFromDB", true);
133  descHO.add<int>("samplesToAdd", 4);
134  descHO.add<std::string>("Subdetector", "HO");
135  descHO.add<bool>("correctForTimeslew", true);
136  descHO.add<bool>("dropZSmarkedPassed", true);
137  descHO.add<bool>("correctForPhaseContainment", true);
138  descHO.add<int>("firstSample", 4);
139  descriptions.add("hosimplereco", descHO);
140 
141  // hfreco
143  descHF.add<double>("correctionPhaseNS", 0.0);
144  descHF.add<edm::InputTag>("digiLabel", edm::InputTag("hcalDigis"));
145  descHF.add<bool>("tsFromDB", true);
146  descHF.add<int>("samplesToAdd", 2);
147  descHF.add<std::string>("Subdetector", "HF");
148  descHF.add<bool>("correctForTimeslew", false);
149  descHF.add<bool>("dropZSmarkedPassed", true);
150  descHF.add<bool>("correctForPhaseContainment", false);
151  descHF.add<int>("firstSample", 4);
152  descriptions.add("hfsimplereco", descHF);
153 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ process()

template<class DIGICOLL , class RECHITCOLL >
void HcalSimpleReconstructor::process ( edm::Event e,
const edm::EventSetup c,
const edm::EDGetTokenT< DIGICOLL > &  tok 
)
private

Definition at line 73 of file HcalSimpleReconstructor.cc.

75  {
76  // get conditions
78  eventSetup.get<HcalDbRecord>().get(conditions);
79 
81  e.getByToken(tok, digi);
82 
83  // create empty output
84  auto rec = std::make_unique<RECHITCOLL>();
85  rec->reserve(digi->size());
86  // run the algorithm
87  int first = firstSample_;
88  int toadd = samplesToAdd_;
89  typename DIGICOLL::const_iterator i;
90  for (i = digi->begin(); i != digi->end(); i++) {
91  HcalDetId cell = i->id();
92  DetId detcell = (DetId)cell;
93  // rof 27.03.09: drop ZS marked and passed digis:
95  if (i->zsMarkAndPass())
96  continue;
97 
98  const HcalCalibrations& calibrations = conditions->getHcalCalibrations(cell);
99  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
100  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
101  HcalCoderDb coder(*channelCoder, *shape);
102 
103  //>>> firstSample & samplesToAdd
104  if (tsFromDB_) {
105  const HcalRecoParam* param_ts = paramTS->getValues(detcell.rawId());
106  first = param_ts->firstSample();
107  toadd = param_ts->samplesToAdd();
108  }
109  rec->push_back(reco_.reconstruct(*i, first, toadd, coder, calibrations));
110  }
111  // return result
112  e.put(std::move(rec));
113 }

References AlignmentProducer_cff::calibrations, dropZSmarkedPassed_, MillePedeFileConverter_cfg::e, options_cfi::eventSetup, dqmdumpme::first, HcalRecoParam::firstSample(), firstSample_, get, HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), HcalCondObjectContainer< Item >::getValues(), mps_fire::i, eostools::move(), paramTS, DetId::rawId(), reco_, HcalSimpleRecAlgo::reconstruct(), HcalRecoParam::samplesToAdd(), samplesToAdd_, and tsFromDB_.

◆ produce()

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

Definition at line 115 of file HcalSimpleReconstructor.cc.

115  {
116  if (det_ == DetId::Hcal) {
117  if (subdet_ == HcalForward) {
118  process<HFDigiCollection, HFRecHitCollection>(e, eventSetup, tok_hf_);
119  } else if (subdet_ == HcalOuter) {
120  process<HODigiCollection, HORecHitCollection>(e, eventSetup, tok_ho_);
121  } else if (subdet_ == HcalOther && subdetOther_ == HcalCalibration) {
122  process<HcalCalibDigiCollection, HcalCalibRecHitCollection>(e, eventSetup, tok_calib_);
123  }
124  }
125 }

References det_, MillePedeFileConverter_cfg::e, options_cfi::eventSetup, DetId::Hcal, HcalCalibration, HcalForward, HcalOther, HcalOuter, subdet_, subdetOther_, tok_calib_, tok_hf_, and tok_ho_.

Member Data Documentation

◆ det_

DetId::Detector HcalSimpleReconstructor::det_
private

Definition at line 39 of file HcalSimpleReconstructor.h.

Referenced by produce().

◆ dropZSmarkedPassed_

bool HcalSimpleReconstructor::dropZSmarkedPassed_
private

Definition at line 48 of file HcalSimpleReconstructor.h.

Referenced by process().

◆ firstSample_

int HcalSimpleReconstructor::firstSample_
private

Definition at line 52 of file HcalSimpleReconstructor.h.

Referenced by process().

◆ inputLabel_

edm::InputTag HcalSimpleReconstructor::inputLabel_
private

Definition at line 42 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor().

◆ paramTS

HcalRecoParams* HcalSimpleReconstructor::paramTS
private

Definition at line 56 of file HcalSimpleReconstructor.h.

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

◆ reco_

HcalSimpleRecAlgo HcalSimpleReconstructor::reco_
private

Definition at line 38 of file HcalSimpleReconstructor.h.

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

◆ samplesToAdd_

int HcalSimpleReconstructor::samplesToAdd_
private

Definition at line 53 of file HcalSimpleReconstructor.h.

Referenced by process().

◆ subdet_

int HcalSimpleReconstructor::subdet_
private

Definition at line 40 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor(), and produce().

◆ subdetOther_

HcalOtherSubdetector HcalSimpleReconstructor::subdetOther_
private

Definition at line 41 of file HcalSimpleReconstructor.h.

Referenced by produce().

◆ theTopology

HcalTopology* HcalSimpleReconstructor::theTopology
private

Definition at line 57 of file HcalSimpleReconstructor.h.

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

◆ tok_calib_

edm::EDGetTokenT<HcalCalibDigiCollection> HcalSimpleReconstructor::tok_calib_
private

Definition at line 46 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor(), and produce().

◆ tok_hf_

edm::EDGetTokenT<HFDigiCollection> HcalSimpleReconstructor::tok_hf_
private

Definition at line 44 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor(), and produce().

◆ tok_ho_

edm::EDGetTokenT<HODigiCollection> HcalSimpleReconstructor::tok_ho_
private

Definition at line 45 of file HcalSimpleReconstructor.h.

Referenced by HcalSimpleReconstructor(), and produce().

◆ tsFromDB_

bool HcalSimpleReconstructor::tsFromDB_
private

Definition at line 54 of file HcalSimpleReconstructor.h.

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

HcalOther
Definition: HcalAssistant.h:38
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
HcalSimpleReconstructor::tsFromDB_
bool tsFromDB_
Definition: HcalSimpleReconstructor.h:54
HcalCondObjectContainerBase::setTopo
void setTopo(const HcalTopology *topo)
Definition: HcalCondObjectContainerBase.cc:17
HcalSimpleReconstructor::reco_
HcalSimpleRecAlgo reco_
Definition: HcalSimpleReconstructor.h:38
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HcalTopology
Definition: HcalTopology.h:26
DetId::Hcal
Definition: DetId.h:28
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HcalSimpleReconstructor::paramTS
HcalRecoParams * paramTS
Definition: HcalSimpleReconstructor.h:56
AlignmentProducer_cff.calibrations
calibrations
Definition: AlignmentProducer_cff.py:59
HcalSimpleRecAlgo::beginRun
void beginRun(edm::EventSetup const &es)
Definition: HcalSimpleRecAlgo.cc:31
edm::Handle
Definition: AssociativeIterator.h:50
dqmdumpme.first
first
Definition: dqmdumpme.py:55
HcalCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: HcalCondObjectContainer.h:159
HcalDbService::getHcalShape
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:326
HcalDbService::getHcalCalibrations
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:65
HcalDbService::getHcalCoder
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:319
HcalSimpleReconstructor::subdetOther_
HcalOtherSubdetector subdetOther_
Definition: HcalSimpleReconstructor.h:41
DetId
Definition: DetId.h:17
HcalRecoParam
Definition: HcalRecoParam.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle
Definition: DTSurvey.h:22
HcalSimpleReconstructor::tok_ho_
edm::EDGetTokenT< HODigiCollection > tok_ho_
Definition: HcalSimpleReconstructor.h:45
HcalOuter
Definition: HcalAssistant.h:35
HcalCalibration
Definition: HcalAssistant.h:40
HcalSimpleReconstructor::subdet_
int subdet_
Definition: HcalSimpleReconstructor.h:40
HcalCalibrations
Definition: HcalCalibrations.h:9
HcalRecoParam::samplesToAdd
constexpr unsigned int samplesToAdd() const
Definition: HcalRecoParam.h:32
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
HcalSimpleReconstructor::dropZSmarkedPassed_
bool dropZSmarkedPassed_
Definition: HcalSimpleReconstructor.h:48
HcalSimpleReconstructor::theTopology
HcalTopology * theTopology
Definition: HcalSimpleReconstructor.h:57
HcalDetId
Definition: HcalDetId.h:12
HcalSimpleReconstructor::firstSample_
int firstSample_
Definition: HcalSimpleReconstructor.h:52
get
#define get
HcalQIECoder
Definition: HcalQIECoder.h:20
HcalSimpleReconstructor::samplesToAdd_
int samplesToAdd_
Definition: HcalSimpleReconstructor.h:53
HcalForward
Definition: HcalAssistant.h:36
HcalSimpleReconstructor::tok_hf_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
Definition: HcalSimpleReconstructor.h:44
HcalRecoParam::firstSample
constexpr unsigned int firstSample() const
Definition: HcalRecoParam.h:31
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HcalRecoParams
Definition: HcalRecoParams.h:9
HcalSimpleReconstructor::tok_calib_
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
Definition: HcalSimpleReconstructor.h:46
options_cfi.eventSetup
eventSetup
Definition: options_cfi.py:12
HcalRecoParamsRcd
Definition: HcalRecoParamsRcd.h:6
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalCoderDb
Definition: HcalCoderDb.h:15
HcalSimpleRecAlgo::endRun
void endRun()
Definition: HcalSimpleRecAlgo.cc:39
HcalDbRecord
Definition: HcalDbRecord.h:30
HcalSimpleRecAlgo::reconstruct
HFRecHit reconstruct(const HFDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
Definition: HcalSimpleRecAlgo.cc:378
edm::InputTag
Definition: InputTag.h:15
HcalSimpleReconstructor::det_
DetId::Detector det_
Definition: HcalSimpleReconstructor.h:39
HcalSimpleReconstructor::inputLabel_
edm::InputTag inputLabel_
Definition: HcalSimpleReconstructor.h:42
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37