53 std::vector<RectangularEtaPhiRegion>&,
57 template <
typename T1>
68 :
minEt_(para.getParameter<double>(
"minEt")),
69 maxEt_(para.getParameter<double>(
"maxEt")),
72 token_(consumesColl.consumes<T1>(para.getParameter<
edm::
InputTag>(
"inputColl"))) {}
75 template <
typename T2>
76 static typename T2::const_iterator
beginIt(
const T2& coll) {
79 template <
typename T2>
80 static typename T2::const_iterator
endIt(
const T2& coll) {
83 template <
typename T2>
87 template <
typename T2>
93 template <
typename RecHitType>
117 template <
typename RecHitType>
120 para.
getParameter<std::vector<edm::ParameterSet>>(
"l1InputRegions");
123 l1RegionData_.emplace_back(createL1RegionData(
126 consumesCollector()));
128 recHitLabels_ = para.
getParameter<std::vector<edm::InputTag>>(
"recHitLabels");
129 productLabels_ = para.
getParameter<std::vector<std::string>>(
"productLabels");
131 for (
unsigned int collNr = 0; collNr < recHitLabels_.size(); collNr++) {
132 recHitTokens_.push_back(consumes<RecHitCollectionType>(recHitLabels_[collNr]));
133 produces<RecHitCollectionType>(productLabels_[collNr]);
136 template <
typename RecHitType>
139 std::vector<std::string> productTags;
140 productTags.push_back(
"EcalRegionalRecHitsEB");
141 productTags.push_back(
"EcalRegionalRecHitsEE");
142 desc.
add<std::vector<std::string>>(
"productLabels", productTags);
154 emIsoPSet.
addParameter<
double>(
"regionEtaMargin", 0.14);
162 emNonIsoPSet.
addParameter<
double>(
"regionEtaMargin", 0.14);
163 emNonIsoPSet.
addParameter<
double>(
"regionPhiMargin", 0.4);
181 jetPSet.addParameter<
double>(
"minEt", 200);
182 jetPSet.addParameter<
double>(
"maxEt", 999);
183 jetPSet.addParameter<
double>(
"regionEtaMargin", 0.4);
184 jetPSet.addParameter<
double>(
"regionPhiMargin", 0.5);
190 l1InputRegionDesc.
add<
double>(
"minEt");
191 l1InputRegionDesc.
add<
double>(
"maxEt");
192 l1InputRegionDesc.
add<
double>(
"regionEtaMargin");
193 l1InputRegionDesc.
add<
double>(
"regionPhiMargin");
200 template <
typename RecHitType>
210 std::vector<RectangularEtaPhiRegion>
regions;
211 std::for_each(l1RegionData_.begin(),
217 for (
size_t recHitCollNr = 0; recHitCollNr < recHitTokens_.size(); recHitCollNr++) {
219 event.getByToken(recHitTokens_[recHitCollNr],
recHits);
223 <<
" named " << recHitLabels_[recHitCollNr].encode() << std::endl;
227 auto filteredRecHits = std::make_unique<RecHitCollectionType>();
235 if (
region.inRegion(this_cell->etaPos(), this_cell->phiPos())) {
236 filteredRecHits->push_back(
recHit);
244 event.put(
std::move(filteredRecHits), productLabels_[recHitCollNr]);
248 template <
typename RecHitType>
251 if (
type ==
"L1EmParticle") {
253 }
else if (
type ==
"L1JetParticle") {
255 }
else if (
type ==
"L1MuonParticle") {
257 }
else if (
type ==
"EGamma") {
259 }
else if (
type ==
"Jet") {
261 }
else if (
type ==
"Muon") {
263 }
else if (
type ==
"Tau") {
269 <<
" is not recognised, this means the rec-hit you think you are keeping may not be and you should fix this "
270 "error as it can lead to hard to find efficiency loses"
275 template <
typename L1CollType>
277 std::vector<RectangularEtaPhiRegion>&
regions,
280 event.getByToken(token_, l1Cands);
282 for (
auto l1CandIt = beginIt(*l1Cands); l1CandIt != endIt(*l1Cands); ++l1CandIt) {
283 if (l1CandIt->et() >= minEt_ && l1CandIt->et() < maxEt_) {
284 double etaLow = l1CandIt->eta() - regionEtaMargin_;
285 double etaHigh = l1CandIt->eta() + regionEtaMargin_;
286 double phiLow = l1CandIt->phi() - regionPhiMargin_;
287 double phiHigh = l1CandIt->phi() + regionPhiMargin_;
296 std::vector<RectangularEtaPhiRegion>&
regions,
299 event.getByToken(token_, l1Cands);
301 for (
const auto& l1Cand : *l1Cands) {
302 if (l1Cand.et() >= minEt_ && l1Cand.et() < maxEt_) {
304 int etaIndex = l1Cand.gctJetCand()->etaIndex();
305 int phiIndex = l1Cand.gctJetCand()->phiIndex();
313 etaLow -= regionEtaMargin_;
314 etaHigh += regionEtaMargin_;
315 phiLow -= regionPhiMargin_;
316 phiHigh += regionPhiMargin_;
325 std::vector<RectangularEtaPhiRegion>&
regions,
328 event.getByToken(token_, l1Cands);
330 for (
const auto& l1Cand : *l1Cands) {
331 if (l1Cand.et() >= minEt_ && l1Cand.et() < maxEt_) {
333 int etaIndex = l1Cand.gctEmCand()->etaIndex();
334 int phiIndex = l1Cand.gctEmCand()->phiIndex();
342 etaLow -= regionEtaMargin_;
343 etaHigh += regionEtaMargin_;
344 phiLow -= regionPhiMargin_;
345 phiHigh += regionPhiMargin_;