CMS 3D CMS Logo

SeedingRegionByL1.cc
Go to the documentation of this file.
1 /*
2  Author: Swagata Mukherjee
3 
4  Date: Feb 2021
5 
6  TICL is currently seeded by tracks, or just globally.
7  Here, adding option to seed TICL by L1 e/gamma objects (L1 TkEm).
8  This is expected to be useful for CPU timing at the HLT.
9 */
10 
11 #include "SeedingRegionByL1.h"
12 
13 #include <algorithm>
14 #include <set>
15 #include <vector>
16 
18 
20  : SeedingRegionAlgoBase(conf, sumes),
21  l1TkEmsToken_(sumes.consumes<std::vector<l1t::TkEm>>(conf.getParameter<edm::InputTag>("l1TkEmColl"))),
22  algoVerbosity_(conf.getParameter<int>("algo_verbosity")),
23  minPt_(conf.getParameter<double>("minPt")),
24  minAbsEta_(conf.getParameter<double>("minAbsEta")),
25  maxAbsEta_(conf.getParameter<double>("maxAbsEta")),
26  endcapScalings_(conf.getParameter<std::vector<double>>("endcapScalings")),
27  quality_(conf.getParameter<int>("quality")) {}
28 
30  const edm::EventSetup &es,
31  std::vector<TICLSeedingRegion> &result) {
32  auto l1TrkEms = ev.getHandle(l1TkEmsToken_);
33  edm::ProductID l1tkemsId = l1TrkEms.id();
34 
35  for (size_t indx = 0; indx < (*l1TrkEms).size(); indx++) {
36  const auto &l1TrkEm = (*l1TrkEms)[indx];
37  double offlinePt = this->tkEmOfflineEt(l1TrkEm.pt());
38  if ((offlinePt < minPt_) || (std::abs(l1TrkEm.eta()) < minAbsEta_) || (std::abs(l1TrkEm.eta()) > maxAbsEta_) ||
39  (l1TrkEm.EGRef()->hwQual() != quality_)) {
40  continue;
41  }
42 
43  int iSide = int(l1TrkEm.eta() > 0);
44  result.emplace_back(GlobalPoint(l1TrkEm.p4().X(), l1TrkEm.p4().Y(), l1TrkEm.p4().Z()),
45  GlobalVector(l1TrkEm.px(), l1TrkEm.py(), l1TrkEm.pz()),
46  iSide,
47  indx,
48  l1tkemsId);
49  }
50 
51  std::sort(result.begin(), result.end(), [](const TICLSeedingRegion &a, const TICLSeedingRegion &b) {
52  return a.directionAtOrigin.perp2() > b.directionAtOrigin.perp2();
53  });
54 }
55 
57  return (endcapScalings_.at(0) + et * endcapScalings_.at(1) + et * et * endcapScalings_.at(2));
58 }
59 
61  desc.add<edm::InputTag>("l1TkEmColl", edm::InputTag("L1TkPhotonsHGC", "EG"));
62  desc.add<double>("minPt", 10);
63  desc.add<double>("minAbsEta", 1.479);
64  desc.add<double>("maxAbsEta", 4.0);
65  desc.add<std::vector<double>>("endcapScalings", {3.17445, 1.13219, 0.0});
66  desc.add<int>("quality", 5);
68 }
MessageLogger.h
ticl::SeedingRegionByL1::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: SeedingRegionByL1.cc:60
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ticl::SeedingRegionAlgoBase
Definition: SeedingRegionAlgoBase.h:22
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
ticl::SeedingRegionByL1::makeRegions
void makeRegions(const edm::Event &ev, const edm::EventSetup &es, std::vector< TICLSeedingRegion > &result) override
Definition: SeedingRegionByL1.cc:29
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
b
double b
Definition: hdecay.h:118
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
l1t
delete x;
Definition: CaloConfig.h:22
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
createfilelist.int
int
Definition: createfilelist.py:10
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
edm::EventSetup
Definition: EventSetup.h:58
ticl::SeedingRegionByL1::SeedingRegionByL1
SeedingRegionByL1(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
Definition: SeedingRegionByL1.cc:19
TICLSeedingRegion
Definition: TICLSeedingRegion.h:14
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
ticl::SeedingRegionAlgoBase::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: SeedingRegionAlgoBase.h:34
SeedingRegionByL1.h
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
ticl::SeedingRegionByL1::tkEmOfflineEt
double tkEmOfflineEt(double et) const
Definition: SeedingRegionByL1.cc:56
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
edm::ProductID
Definition: ProductID.h:27
edm::ProductID::id
ProductIndex id() const
Definition: ProductID.h:35