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());
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
T getParameter(std::string const &) const
edm::EDGetTokenT< EcalRecHitCollection > recHitsToken_
#define DEFINE_FWK_MODULE(type)
bool checkFlags(const std::vector< int > &flagsvec) const
check if one of the flags in a set is true
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
producer
std::vector< int > flagsexclEB_
edm::InputTag recHitsLabel_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > sevLvToken_
T const * product() const
std::string interestingDetIdCollection_
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
EgammaIsoDetIdCollectionProducer(const edm::ParameterSet &)
ctor
std::vector< int > flagsexclEE_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
T perp() const
Magnitude of transverse component.
std::vector< T1 > T1Collection
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
std::vector< int > severitiesexclEE_
std::vector< int > severitiesexclEB_
const DetId & detid() const
edm::InputTag emObjectLabel_
edm::EDGetTokenT< T1Collection > emObjectToken_
bool checkFlag(int flag) const
check if the flag is true