67 emObjectToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"emObjectLabel"))},
70 recHitsLabel_(iConfig.getParameter<
edm::InputTag>(
"recHitsLabel")),
71 emObjectLabel_(iConfig.getParameter<
edm::InputTag>(
"emObjectLabel")),
72 energyCut_(iConfig.getParameter<
double>(
"energyCut")),
73 etCut_(iConfig.getParameter<
double>(
"etCut")),
74 etCandCut_(iConfig.getParameter<
double>(
"etCandCut")),
75 outerRadius_(iConfig.getParameter<
double>(
"outerRadius")),
76 innerRadius_(iConfig.getParameter<
double>(
"innerRadius")),
77 interestingDetIdCollection_(iConfig.getParameter<
std::string>(
"interestingDetIdCollection")) {
78 auto const& flagnamesEB = iConfig.getParameter<std::vector<std::string>>(
"RecHitFlagToBeExcludedEB");
79 auto const& flagnamesEE = iConfig.getParameter<std::vector<std::string>>(
"RecHitFlagToBeExcludedEE");
81 flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
82 flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
84 auto const& severitynamesEB = iConfig.getParameter<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEB");
86 severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
88 auto const& severitynamesEE = iConfig.getParameter<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEE");
90 severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
93 produces<DetIdCollection>(interestingDetIdCollection_);
104 auto const& emObjects =
iEvent.get(emObjectToken_);
105 auto const& ecalRecHits =
iEvent.get(recHitsToken_);
113 std::unique_ptr<CaloDualConeSelector<EcalRecHit>> doubleConeSel_ =
nullptr;
114 if (recHitsLabel_.instance() ==
"EcalRecHitsEB") {
116 std::make_unique<CaloDualConeSelector<EcalRecHit>>(innerRadius_, outerRadius_, &*pG,
DetId::Ecal,
EcalBarrel);
117 }
else if (recHitsLabel_.instance() ==
"EcalRecHitsEE") {
119 std::make_unique<CaloDualConeSelector<EcalRecHit>>(innerRadius_, outerRadius_, &*pG,
DetId::Ecal,
EcalEndcap);
123 auto detIdCollection = std::make_unique<DetIdCollection>();
125 if (doubleConeSel_) {
126 for (
auto const& emObj : emObjects) {
128 if (emObj.et() < etCandCut_)
131 GlobalPoint pclu(emObj.caloPosition().x(), emObj.caloPosition().y(), emObj.caloPosition().z());
132 doubleConeSel_->selectCallback(pclu, ecalRecHits, [&](
const EcalRecHit& recIt) {
133 if (recIt.
energy() < energyCut_)
148 auto sit =
std::find(severitiesexclEB_.begin(), severitiesexclEB_.end(), severityFlag);
149 if (sit != severitiesexclEB_.end())
152 auto sit =
std::find(severitiesexclEE_.begin(), severitiesexclEE_.end(), severityFlag);
153 if (sit != severitiesexclEE_.end())
173 if (
std::find(detIdCollection->begin(), detIdCollection->end(), recIt.
detid()) == detIdCollection->end())
174 detIdCollection->push_back(recIt.
detid());