6 if (iConfig.
existsAs<std::vector<edm::ParameterSet>>(
"regions")) {
9 std::vector<double>
etaBoundaries = preg.getParameter<std::vector<double>>(
"etaBoundaries");
10 unsigned int phiSlices = preg.getParameter<uint32_t>(
"phiSlices");
11 float etaExtra = preg.getParameter<
double>(
"etaExtra");
12 float phiExtra = preg.getParameter<
double>(
"phiExtra");
14 unsigned int ncalomax = 0, nemcalomax = 0, ntrackmax = 0, nmuonmax = 0, npfmax = 0, npuppimax = 0;
15 if (preg.existsAs<uint32_t>(
"caloNMax"))
16 ncalomax = preg.getParameter<uint32_t>(
"caloNMax");
17 if (preg.existsAs<uint32_t>(
"emcaloNMax"))
18 nemcalomax = preg.getParameter<uint32_t>(
"emcaloNMax");
19 if (preg.existsAs<uint32_t>(
"trackNMax"))
20 ntrackmax = preg.getParameter<uint32_t>(
"trackNMax");
21 if (preg.existsAs<uint32_t>(
"muonNMax"))
22 nmuonmax = preg.getParameter<uint32_t>(
"muonNMax");
23 if (preg.existsAs<uint32_t>(
"pfNMax"))
24 npfmax = preg.getParameter<uint32_t>(
"pfNMax");
25 if (preg.existsAs<uint32_t>(
"puppiNMax"))
26 npuppimax = preg.getParameter<uint32_t>(
"puppiNMax");
58 "Unsupported value for trackRegionMode: " +
trackRegionMode +
" (allowed are 'atVertex', 'atCalo', 'any')");
61 unsigned int ncalomax = 0, nemcalomax = 0, ntrackmax = 0, nmuonmax = 0, npfmax = 0, npuppimax = 0;
94 inside =
r.contains(
t.eta(),
t.phi());
97 inside =
r.contains(
t.caloEta(),
t.caloPhi());
100 inside =
r.contains(
t.eta(),
t.phi()) ||
r.contains(
t.caloEta(),
t.caloPhi());
105 prop.fillInput(
t.pt(),
r.localEta(
t.eta()),
r.localPhi(
t.phi()),
t.charge(),
t.vertex().Z(),
t.quality(), &
t);
106 prop.fillPropagated(
t.pt(),
109 r.localEta(
t.caloEta()),
110 r.localPhi(
t.caloPhi()),
114 prop.
hwChi2 = round(
t.chi2() * 10);
115 r.track.push_back(prop);
128 if (
r.contains(
mu.eta(),
mu.phi())) {
130 prop.fill(
mu.pt(),
r.localEta(
mu.eta()),
r.localPhi(
mu.phi()),
mu.charge(),
mu.hwQual(), &
mu);
131 r.muon.push_back(prop);
140 if (
r.contains(
mu.eta(),
mu.phi())) {
142 prop.fill(
mu.pt(),
r.localEta(
mu.eta()),
r.localPhi(
mu.phi()),
mu.charge(),
mu.hwQual());
143 r.muon.push_back(prop);
157 if (
r.contains(
p.eta(),
p.phi())) {
159 calo.fill(
p.pt(),
p.emEt(),
p.ptError(),
r.localEta(
p.eta()),
r.localPhi(
p.phi()),
p.isEM(), 0, &
p);
160 r.calo.push_back(
calo);
173 if (
r.contains(
p.eta(),
p.phi())) {
175 calo.fill(
p.pt(),
p.emEt(),
p.ptError(),
r.localEta(
p.eta()),
r.localPhi(
p.phi()),
p.isEM(), 0, &
p);
176 r.emcalo.push_back(
calo);
186 auto ret = std::make_unique<l1t::PFCandidateCollection>();
192 inside =
r.fiducialLocal(
p.floatVtxEta(),
p.floatVtxPhi());
195 inside =
r.fiducialLocal(
p.floatEta(),
p.floatPhi());
198 inside =
r.fiducialLocal(
p.floatVtxEta(),
p.floatVtxPhi());
203 if (
p.floatPt() >
ptMin) {
205 p.floatPt(),
r.globalEta(
p.floatVtxEta()),
r.globalPhi(
p.floatVtxPhi()), 0.13
f);
208 ret->back().setStatus(
p.hwStatus);
212 throw cms::Exception(
"CorruptData") <<
"Invalid cluster pointer in PF candidate id " <<
p.hwId <<
" pt " 213 << p4.pt() <<
" eta " << p4.eta() <<
" phi " << p4.phi();
215 ret->back().setPFCluster(
match->second);
220 throw cms::Exception(
"CorruptData") <<
"Invalid track pointer in PF candidate id " <<
p.hwId <<
" pt " 221 << p4.pt() <<
" eta " << p4.eta() <<
" phi " << p4.phi();
223 ret->back().setPFTrack(
match->second);
228 throw cms::Exception(
"CorruptData") <<
"Invalid muon pointer in PF candidate id " <<
p.hwId <<
" pt " 229 << p4.pt() <<
" eta " << p4.eta() <<
" phi " << p4.phi();
240 auto ret = std::make_unique<l1t::PFCandidateCollection>();
243 if (!
r.fiducialLocal(
p.floatEta(),
p.floatPhi()))
245 if (
p.floatPt() >
ptMin) {
249 ret->emplace_back(
kind, 0, p4);
254 <<
"Invalid cluster pointer in cluster pt " << p4.pt() <<
" eta " << p4.eta() <<
" phi " << p4.phi();
256 ret->back().setPFCluster(
match->second);
265 auto ret = std::make_unique<l1t::PFCandidateCollection>();
273 inside =
r.fiducialLocal(
p.floatVtxEta(),
p.floatVtxPhi());
276 inside =
r.fiducialLocal(
p.floatEta(),
p.floatPhi());
279 inside =
r.fiducialLocal(
p.floatVtxEta(),
p.floatVtxPhi());
284 if (
p.floatPt() >
ptMin) {
286 p.floatVtxPt(),
r.globalEta(
p.floatVtxEta()),
r.globalPhi(
p.floatVtxPhi()), 0.13
f);
288 ret->emplace_back(
kind,
p.intCharge(), p4);
294 <<
"Invalid track pointer in PF track pt " << p4.pt() <<
" eta " << p4.eta() <<
" phi " << p4.phi();
296 ret->back().setPFTrack(
match->second);
305 unsigned ntot = 0, nmax = 0;
311 return std::make_pair(
ntot, nmax);
315 auto v = std::make_unique<std::vector<unsigned>>();
324 unsigned ntot = 0, nmax = 0;
330 return std::make_pair(
ntot, nmax);
334 auto v = std::make_unique<std::vector<unsigned>>();
bool useRelativeRegionalCoordinates_
std::unique_ptr< l1t::PFCandidateCollection > fetchCalo(float ptMin=0.01, bool emcalo=false) const
T getParameter(std::string const &) const
void addMuon(const l1t::Muon &t)
std::unordered_map< const l1t::PFTrack *, l1t::PFTrackRef > trackRefMap_
std::unique_ptr< std::vector< unsigned > > vecOutput(int type, bool puppi) const
ret
prodAgent to be discontinued
enum l1tpf_impl::RegionMapper::TrackAssoMode trackRegionMode_
RegionMapper(const edm::ParameterSet &)
std::unordered_map< const l1t::PFCluster *, l1t::PFClusterRef > clusterRefMap_
std::unique_ptr< l1t::PFCandidateCollection > fetchTracks(float ptMin=0.01, bool fromPV=false) const
std::pair< unsigned, unsigned > totAndMaxOutput(int type, bool puppi) const
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
void addTrack(const l1t::PFTrack &t)
math::XYZPoint Point
point in the space
std::vector< Region > regions_
void addCalo(const l1t::PFCluster &t)
std::pair< unsigned, unsigned > totAndMaxInput(int type) const
std::unordered_map< const l1t::Muon *, l1t::PFCandidate::MuonRef > muonRefMap_
std::unique_ptr< std::vector< unsigned > > vecInput(int type) const
void addEmCalo(const l1t::PFCluster &t)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::unique_ptr< l1t::PFCandidateCollection > fetch(bool puppi=true, float ptMin=0.01) const