17 : reco_(conf.getParameter<bool>(
"correctForTimeslew"),
18 conf.getParameter<bool>(
"correctForPhaseContainment"),
19 conf.getParameter<double>(
"correctionPhaseNS"),
22 inputLabel_(conf.getParameter<edm::
InputTag>(
"digiLabel")),
23 dropZSmarkedPassed_(conf.getParameter<bool>(
"dropZSmarkedPassed")),
24 firstSample_(conf.getParameter<int>(
"firstSample")),
25 samplesToAdd_(conf.getParameter<int>(
"samplesToAdd")),
26 tsFromDB_(conf.getParameter<bool>(
"tsFromDB")) {
33 if (!strcasecmp(subd.c_str(),
"HO")) {
35 produces<HORecHitCollection>();
36 }
else if (!strcasecmp(subd.c_str(),
"HF")) {
38 produces<HFRecHitCollection>();
40 std::cout <<
"HcalSimpleReconstructor is not associated with a specific subdetector!" << std::endl;
45 htopoToken_ = esConsumes<HcalTopology, HcalRecNumberingRecord, edm::Transition::BeginRun>();
46 paramsToken_ = esConsumes<HcalRecoParams, HcalRecoParamsRcd, edm::Transition::BeginRun>();
57 paramTS_ = std::make_unique<HcalRecoParams>(
p);
65 template <
class DIGICOLL,
class RECHITCOLL>
76 auto rec = std::make_unique<RECHITCOLL>();
77 rec->reserve(digi->size());
81 typename DIGICOLL::const_iterator
i;
82 for (i = digi->begin(); i != digi->end(); i++) {
87 if (i->zsMarkAndPass())
110 process<HFDigiCollection, HFRecHitCollection>(
e, eventSetup,
tok_hf_);
112 process<HODigiCollection, HORecHitCollection>(
e, eventSetup,
tok_ho_);
114 process<HcalCalibDigiCollection, HcalCalibRecHitCollection>(
e, eventSetup,
tok_calib_);
122 descHO.
add<
double>(
"correctionPhaseNS", 13.0);
124 descHO.
add<
bool>(
"tsFromDB",
true);
125 descHO.
add<
int>(
"samplesToAdd", 4);
127 descHO.
add<
bool>(
"correctForTimeslew",
true);
128 descHO.
add<
bool>(
"dropZSmarkedPassed",
true);
129 descHO.
add<
bool>(
"correctForPhaseContainment",
true);
130 descHO.
add<
int>(
"firstSample", 4);
131 descriptions.
add(
"hosimplereco", descHO);
135 descHF.
add<
double>(
"correctionPhaseNS", 0.0);
137 descHF.
add<
bool>(
"tsFromDB",
true);
138 descHF.
add<
int>(
"samplesToAdd", 2);
140 descHF.
add<
bool>(
"correctForTimeslew",
false);
141 descHF.
add<
bool>(
"dropZSmarkedPassed",
true);
142 descHF.
add<
bool>(
"correctForPhaseContainment",
false);
143 descHF.
add<
int>(
"firstSample", 4);
144 descriptions.
add(
"hfsimplereco", descHF);
edm::InputTag inputLabel_
~HcalSimpleReconstructor() override
constexpr unsigned int samplesToAdd() const
std::unique_ptr< HcalRecoParams > paramTS_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::ESGetToken< HcalRecoParams, HcalRecoParamsRcd > paramsToken_
HcalSimpleReconstructor(const edm::ParameterSet &ps)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void beginRun(edm::EventSetup const &es)
constexpr uint32_t rawId() const
get the raw id
void process(edm::Event &e, const edm::EventSetup &c, const edm::EDGetTokenT< DIGICOLL > &tok)
bool getData(T &iHolder) const
HcalOtherSubdetector subdetOther_
void produce(edm::Event &e, const edm::EventSetup &c) final
void beginRun(edm::Run const &r, edm::EventSetup const &es) final
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > htopoToken_
HFRecHit reconstruct(const HFDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
edm::ESGetToken< HcalDbService, HcalDbRecord > conditionsToken_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< HFDigiCollection > tok_hf_
edm::EDGetTokenT< HODigiCollection > tok_ho_
T getParameter(std::string const &) const
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
void endRun(edm::Run const &r, edm::EventSetup const &es) final
constexpr unsigned int firstSample() const