73 std::unique_ptr<AbsHFPhase1Algo>
reco_;
78 std::unique_ptr<HcalHF_S9S1algorithm>
hfS9S1_;
79 std::unique_ptr<HcalHF_S9S1algorithm>
hfS8S1_;
80 std::unique_ptr<HcalHF_PETalgorithm>
hfPET_;
93 : algoConfigClass_(conf.getParameter<std::
string>(
"algoConfigClass")),
94 setNoiseFlags_(conf.getParameter<bool>(
"setNoiseFlags")),
95 runHFStripFilter_(conf.getParameter<bool>(
"runHFStripFilter")),
96 useChannelQualityFromDB_(conf.getParameter<bool>(
"useChannelQualityFromDB")),
97 checkChannelQualityForDepth3and4_(conf.getParameter<bool>(
"checkChannelQualityForDepth3and4")),
101 throw cms::Exception(
"HFPhase1BadConfig") <<
"Invalid HFPhase1Reconstructor algorithm configuration" << std::endl;
103 if (
reco_->isConfigurable()) {
106 <<
"Invalid HBHEPhase1Reconstructor \"algoConfigClass\" parameter value \"" <<
algoConfigClass_ <<
'"'
115 hfS9S1_ = std::make_unique<HcalHF_S9S1algorithm>(psS9S1.
getParameter<std::vector<double> >(
"short_optimumSlope"),
116 psS9S1.
getParameter<std::vector<double> >(
"shortEnergyParams"),
117 psS9S1.
getParameter<std::vector<double> >(
"shortETParams"),
118 psS9S1.
getParameter<std::vector<double> >(
"long_optimumSlope"),
119 psS9S1.
getParameter<std::vector<double> >(
"longEnergyParams"),
120 psS9S1.
getParameter<std::vector<double> >(
"longETParams"),
125 hfS8S1_ = std::make_unique<HcalHF_S9S1algorithm>(psS8S1.getParameter<std::vector<double> >(
"short_optimumSlope"),
126 psS8S1.getParameter<std::vector<double> >(
"shortEnergyParams"),
127 psS8S1.getParameter<std::vector<double> >(
"shortETParams"),
128 psS8S1.getParameter<std::vector<double> >(
"long_optimumSlope"),
129 psS8S1.getParameter<std::vector<double> >(
"longEnergyParams"),
130 psS8S1.getParameter<std::vector<double> >(
"longETParams"),
131 psS8S1.getParameter<
int>(
"HcalAcceptSeverityLevel"),
132 psS8S1.getParameter<
bool>(
"isS8S1"));
135 hfPET_ = std::make_unique<HcalHF_PETalgorithm>(psPET.getParameter<std::vector<double> >(
"short_R"),
136 psPET.getParameter<std::vector<double> >(
"shortEnergyParams"),
137 psPET.getParameter<std::vector<double> >(
"shortETParams"),
138 psPET.getParameter<std::vector<double> >(
"long_R"),
139 psPET.getParameter<std::vector<double> >(
"longEnergyParams"),
140 psPET.getParameter<std::vector<double> >(
"longETParams"),
141 psPET.getParameter<
int>(
"HcalAcceptSeverityLevel"),
142 psPET.getParameter<std::vector<double> >(
"short_R_29"),
143 psPET.getParameter<std::vector<double> >(
"long_R_29"));
156 produces<HFRecHitCollection>();
161 sevToken_ = esConsumes<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd>();
170 if (
reco_->isConfigurable()) {
174 <<
"Failed to configure HFPhase1Reconstructor algorithm from EventSetup" << std::endl;
192 std::unique_ptr<HFRecHitCollection> rec(std::make_unique<HFRecHitCollection>());
193 rec->reserve(preRecHits->size());
200 const bool thisIsSingleAnodePMT =
false;
203 bool taggedBadByDb[2] = {
false,
false};
207 anodeIds[0] = it->id();
209 for (
unsigned i = 0;
i < 2; ++
i) {
211 taggedBadByDb[
i] = mySeverity->dropChannel(mydigistatus->
getValue());
215 const bool b = mySeverity->dropChannel(mydigistatus->
getValue());
216 taggedBadByDb[0] =
b;
217 taggedBadByDb[1] =
b;
223 reco_->reconstruct(*it,
conditions->getHcalCalibrations(it->id()), taggedBadByDb, thisIsSingleAnodePMT);
240 int depth =
i->id().depth();
241 int ieta =
i->id().ieta();
243 if (depth == 2 ||
abs(ieta) == 29)
244 hfPET_->HFSetFlagFromPET(*
i, *rec, myqual, mySeverity);
249 int depth =
i->id().depth();
250 int ieta =
i->id().ieta();
252 if (depth == 2 ||
abs(ieta) == 29)
253 hfS8S1_->HFSetFlagFromS9S1(*
i, *rec, myqual, mySeverity);
258 int depth =
i->id().depth();
259 int ieta =
i->id().ieta();
261 if (depth == 1 &&
abs(ieta) != 29)
262 hfS9S1_->HFSetFlagFromS9S1(*
i, *rec, myqual, mySeverity);
274 #define add_param_set(name) \
275 edm::ParameterSetDescription name; \
276 name.setAllowAnything(); \
277 desc.add<edm::ParameterSetDescription>(#name, name)
285 desc.
add<
bool>(
"setNoiseFlags");
286 desc.
add<
bool>(
"runHFStripFilter",
false);
287 desc.
add<
bool>(
"useChannelQualityFromDB");
288 desc.
add<
bool>(
"checkChannelQualityForDepth3and4");
edm::ESGetToken< HFPhase1PMTParams, HFPhase1PMTParamsRcd > recoConfigToken_
~HFPhase1Reconstructor() override
edm::ESGetToken< HcalDbService, HcalDbRecord > conditionsToken_
constexpr HcalDetId secondAnodeId() const
second PMT anode detId for HF dual channels
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void beginRun(const edm::Run &, const edm::EventSetup &) override
std::string algoConfigClass_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static edm::ParameterSetDescription fillDescription()
#define DEFINE_FWK_MODULE(type)
constexpr uint32_t rawId() const
get the raw id
std::vector< T >::const_iterator const_iterator
bool getData(T &iHolder) const
std::unique_ptr< HcalHF_PETalgorithm > hfPET_
#define add_param_set(name)
void produce(edm::Event &, const edm::EventSetup &) override
std::unique_ptr< HFStripFilter > hfStripFilter_
void addDefault(ParameterSetDescription const &psetDescription)
std::unique_ptr< AbsHcalAlgoData > recoConfig_
std::unique_ptr< AbsHFPhase1Algo > reco_
std::unique_ptr< AbsHFPhase1Algo > parseHFPhase1AlgoDescription(const edm::ParameterSet &ps)
Abs< T >::type abs(const T &t)
static std::unique_ptr< HFStripFilter > parseParameterSet(const edm::ParameterSet &ps)
std::unique_ptr< HcalHF_S9S1algorithm > hfS8S1_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< T >::iterator iterator
bool useChannelQualityFromDB_
bool checkChannelQualityForDepth3and4_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualToken_
HFPhase1Reconstructor(const edm::ParameterSet &)
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > sevToken_
edm::ParameterSetDescription fillDescriptionForParseHFPhase1AlgoDescription()
constexpr HcalDetId id() const
uint32_t getValue() const
edm::EDGetTokenT< HFPreRecHitCollection > tok_PreRecHit_
std::unique_ptr< HcalHF_S9S1algorithm > hfS9S1_