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");
29 float phiCenter = (
iphi + 0.5) * phiWidth -
M_PI;
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) {
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);
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>>();