46 std::unique_ptr<EcalRecHitWorkerBaseClass>
worker_;
65 recoverEBIsolatedChannels_(ps.getParameter<
bool>(
"recoverEBIsolatedChannels")),
66 recoverEEIsolatedChannels_(ps.getParameter<
bool>(
"recoverEEIsolatedChannels")),
67 recoverEBVFE_(ps.getParameter<
bool>(
"recoverEBVFE")),
68 recoverEEVFE_(ps.getParameter<
bool>(
"recoverEEVFE")),
69 recoverEBFE_(ps.getParameter<
bool>(
"recoverEBFE")),
70 recoverEEFE_(ps.getParameter<
bool>(
"recoverEEFE")),
71 killDeadChannels_(ps.getParameter<
bool>(
"killDeadChannels")),
114 cleaningAlgo_ = std::make_unique<EcalCleaningAlgo>(cleaningPs);
123 auto ebRecHits = std::make_unique<EBRecHitCollection>();
124 auto eeRecHits = std::make_unique<EERecHitCollection>();
136 LogDebug(
"EcalRecHitDebug") <<
"total # EB uncalibrated rechits: " << ebUncalibRecHits.size();
139 for (
const auto& uncalibRecHit : ebUncalibRecHits) {
140 worker_->run(evt, uncalibRecHit, *ebRecHits);
147 LogDebug(
"EcalRecHitDebug") <<
"total # EE uncalibrated rechits: " << eeUncalibRecHits.size();
150 for (
const auto& uncalibRecHit : eeUncalibRecHits) {
151 worker_->run(evt, uncalibRecHit, *eeRecHits);
163 for (
const auto& detId : detIds) {
167 if (chit != chStatus.end()) {
168 chStatusCode = *chit;
170 edm::LogError(
"EcalRecHitProducerError") <<
"No channel status found for xtal " << detId.rawId()
171 <<
"! something wrong with EcalChannelStatus in your DB? ";
192 for (
const auto& detId : detIds) {
196 if (chit != chStatus.end()) {
197 chStatusCode = *chit;
199 edm::LogError(
"EcalRecHitProducerError") <<
"No channel status found for xtal " << detId.rawId()
200 <<
"! something wrong with EcalChannelStatus in your DB? ";
220 for (
const auto&
ttId : ttIds) {
222 int ieta = ((
ttId.ietaAbs() - 1) * 5 + 1) *
ttId.zside();
223 int iphi = ((
ttId.iphi() - 1) * 5 + 11) % 360;
235 for (
const auto& scId : scIds) {
261 LogInfo(
"EcalRecHitInfo") <<
"total # EB calibrated rechits: " << ebRecHits->size();
262 LogInfo(
"EcalRecHitInfo") <<
"total # EE calibrated rechits: " << eeRecHits->size();
270 desc.add<
bool>(
"recoverEEVFE",
false);
272 desc.add<
bool>(
"recoverEBIsolatedChannels",
false);
273 desc.add<
bool>(
"recoverEBVFE",
false);
274 desc.add<
bool>(
"laserCorrection",
true);
275 desc.add<
double>(
"EBLaserMIN", 0.5);
276 desc.add<
bool>(
"killDeadChannels",
true);
278 std::vector<int> temp1;
282 temp1.push_back(142);
283 desc.add<std::vector<int>>(
"dbStatusToBeExcludedEB", temp1);
286 edm::InputTag(
"ecalMultiFitUncalibRecHit",
"EcalUncalibRecHitsEE"));
288 std::vector<int> temp1;
292 temp1.push_back(142);
293 desc.add<std::vector<int>>(
"dbStatusToBeExcludedEE", temp1);
295 desc.add<
double>(
"EELaserMIN", 0.5);
299 psd0.
add<
double>(
"e6e2thresh", 0.04);
300 psd0.
add<
double>(
"tightenCrack_e6e2_double", 3);
301 psd0.
add<
double>(
"e4e1Threshold_endcap", 0.3);
302 psd0.
add<
double>(
"tightenCrack_e4e1_single", 3);
303 psd0.
add<
double>(
"tightenCrack_e1_double", 2);
304 psd0.
add<
double>(
"cThreshold_barrel", 4);
305 psd0.
add<
double>(
"e4e1Threshold_barrel", 0.08);
306 psd0.
add<
double>(
"tightenCrack_e1_single", 2);
307 psd0.
add<
double>(
"e4e1_b_barrel", -0.024);
308 psd0.
add<
double>(
"e4e1_a_barrel", 0.04);
309 psd0.
add<
double>(
"ignoreOutOfTimeThresh", 1000000000.0);
310 psd0.
add<
double>(
"cThreshold_endcap", 15);
311 psd0.
add<
double>(
"e4e1_b_endcap", -0.0125);
312 psd0.
add<
double>(
"e4e1_a_endcap", 0.02);
313 psd0.
add<
double>(
"cThreshold_double", 10);
316 desc.add<
double>(
"logWarningEtThreshold_EE_FE", 50);
318 desc.add<
bool>(
"recoverEBFE",
true);
321 desc.add<
double>(
"singleChannelRecoveryThreshold", 8);
322 desc.add<
double>(
"sum8ChannelRecoveryThreshold", 0.);
324 edm::FileInPath(
"RecoLocalCalo/EcalDeadChannelRecoveryAlgos/data/BDTWeights/" 325 "bdtgAllRH_8GT700MeV_noCracks_ZskimData2017_v1.xml"));
327 edm::FileInPath(
"RecoLocalCalo/EcalDeadChannelRecoveryAlgos/data/BDTWeights/" 328 "bdtgAllRH_8GT700MeV_onlyCracks_ZskimData2017_v1.xml"));
330 std::vector<std::string> temp1;
332 temp1.push_back(
"kNoisy");
333 temp1.push_back(
"kNNoisy");
334 temp1.push_back(
"kFixedG6");
335 temp1.push_back(
"kFixedG1");
336 temp1.push_back(
"kFixedG0");
337 temp1.push_back(
"kNonRespondingIsolated");
338 temp1.push_back(
"kDeadVFE");
339 temp1.push_back(
"kDeadFE");
340 temp1.push_back(
"kNoDataNoTP");
341 desc.add<std::vector<std::string>>(
"ChannelStatusToBeExcluded", temp1);
345 desc.add<
bool>(
"recoverEEFE",
true);
346 desc.add<
std::string>(
"singleChannelRecoveryMethod",
"NeuralNetworks");
347 desc.add<
double>(
"EBLaserMAX", 3.0);
351 std::vector<std::string> temp2;
353 temp2.push_back(
"kOk");
354 temp2.push_back(
"kDAC");
355 temp2.push_back(
"kNoLaser");
356 temp2.push_back(
"kNoisy");
357 psd0.
add<std::vector<std::string>>(
"kGood", temp2);
360 std::vector<std::string> temp2;
362 temp2.push_back(
"kFixedG0");
363 temp2.push_back(
"kNonRespondingIsolated");
364 temp2.push_back(
"kDeadVFE");
365 psd0.
add<std::vector<std::string>>(
"kNeighboursRecovered", temp2);
368 std::vector<std::string> temp2;
370 temp2.push_back(
"kNoDataNoTP");
371 psd0.
add<std::vector<std::string>>(
"kDead", temp2);
374 std::vector<std::string> temp2;
376 temp2.push_back(
"kNNoisy");
377 temp2.push_back(
"kFixedG6");
378 temp2.push_back(
"kFixedG1");
379 psd0.
add<std::vector<std::string>>(
"kNoisy", temp2);
382 std::vector<std::string> temp2;
384 temp2.push_back(
"kDeadFE");
385 psd0.
add<std::vector<std::string>>(
"kTowerRecovered", temp2);
390 edm::InputTag(
"ecalMultiFitUncalibRecHit",
"EcalUncalibRecHitsEB"));
393 desc.add<
double>(
"EELaserMAX", 8.0);
394 desc.add<
double>(
"logWarningEtThreshold_EB_FE", 50);
395 desc.add<
bool>(
"recoverEEIsolatedChannels",
false);
396 desc.add<
bool>(
"skipTimeCalib",
false);
397 descriptions.
add(
"ecalRecHit",
desc);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const bool killDeadChannels_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void reserve(SetDescriptionEntries::size_type n)
bool get(ProductID const &oid, Handle< PROD > &result) const
std::unique_ptr< EcalCleaningAlgo > cleaningAlgo_
Log< level::Error, false > LogError
~EcalRecHitProducer() override
EcalRecHitProducer(const edm::ParameterSet &ps)
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
const edm::EDPutTokenT< EBRecHitCollection > ebRecHitToken_
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > ecalChannelStatusToken_
const bool recoverEBIsolatedChannels_
#define DEFINE_FWK_MODULE(type)
bool getData(T &iHolder) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< EEUncalibratedRecHitCollection > eeUncalibRecHitToken_
const edm::EDPutTokenT< EERecHitCollection > eeRecHitToken_
static const int ETAPHIMODE
const bool recoverEEIsolatedChannels_
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ebUncalibRecHitToken_
Log< level::Info, false > LogInfo
edm::EDGetTokenT< std::set< EBDetId > > ebDetIdToBeRecoveredToken_
std::unique_ptr< EcalRecHitWorkerBaseClass > workerRecover_
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
std::vector< Item >::const_iterator const_iterator
edm::EDGetTokenT< std::set< EcalScDetId > > eeFEToBeRecoveredToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Code getStatusCode() const
return decoded status
void produce(edm::Event &evt, const edm::EventSetup &es) override
std::unique_ptr< EcalRecHitWorkerBaseClass > worker_
edm::EDGetTokenT< std::set< EEDetId > > eeDetIdToBeRecoveredToken_
edm::EDGetTokenT< std::set< EcalTrigTowerDetId > > ebFEToBeRecoveredToken_