40 #define init_param(type, varname) varname(ps.getParameter<type>(#varname))
69 bool* fromFakeSet)
const;
133 mutable std::vector<std::pair<double, unsigned> >
zAssoc;
170 produces<reco::PFCandidateCollection>();
183 auto pOutput = std::make_unique<reco::PFCandidateCollection>();
196 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPFPileupCleaner:"
197 " could not find fake vertices"
202 for (
unsigned i = 0;
i < ncand; ++
i) {
207 bool fromFakeSet =
false;
227 const double eta = candptr->p4().Eta();
236 pOutput->push_back(
cand);
237 pOutput->back().setSourceCandidatePtr(candptr);
245 const unsigned shift = static_cast<unsigned>(
ptype);
251 const unsigned shift = static_cast<unsigned>(
ptype);
253 const unsigned mask = (1
U <<
shift);
266 bool* fromFakeSet)
const {
267 typedef reco::VertexCollection::const_iterator IV;
270 *fromFakeSet =
false;
274 unsigned nFoundVertex = 0;
279 double bestweight = 0.0;
280 for (IV iv =
vertices->begin(); iv != vertend; ++iv, ++
index)
285 IT trackend(
vtx.tracks_end());
286 for (
IT iTrack =
vtx.tracks_begin(); iTrack != trackend; ++iTrack) {
291 if (baseRef == trackBaseRef) {
293 const double w =
vtx.trackWeight(baseRef);
294 if (
w > bestweight) {
304 if (nFoundVertex > 0) {
305 if (nFoundVertex != 1)
306 edm::LogWarning(
"TrackOnTwoVertex") <<
"a track is shared by at least two vertices. "
307 <<
"Used to be an assert";
312 const double ztrack =
pfcand.vertex().z();
315 const IV fakeEnd(fakeVertices->end());
317 for (IV iv = fakeVertices->begin(); iv != fakeEnd; ++iv, ++
index)
333 const double ztrack =
pfcand.vertex().z();
334 bool foundVertex =
false;
340 for (IV iv =
vertices->begin(); iv != vertend; ++iv, ++
index)
342 zAssoc.push_back(std::pair<double, unsigned>(iv->z(),
index));
343 const unsigned numRealVertices =
index;
348 const IV fakeEnd(fakeVertices->end());
349 for (IV iv = fakeVertices->begin(); iv != fakeEnd; ++iv, ++
index)
351 zAssoc.push_back(std::pair<double, unsigned>(iv->z(),
index));
357 std::pair<double, unsigned> tPair(ztrack, UINT_MAX);
364 unsigned ich[2] = {0
U, 0
U};
367 ich[0] = iAbove - 1
U;
369 if (iAbove <
zAssoc.size())
373 double dzmin = 1.0e100;
374 unsigned bestVertexNum = UINT_MAX;
375 for (
unsigned icheck = 0; icheck < nch; ++icheck) {
376 const unsigned zAssocIndex = ich[icheck];
377 const unsigned vertexNum =
zAssoc[zAssocIndex].second;
380 bestVertexNum = vertexNum;
387 bestVertexNum = vertexNum;
391 foundVertex = bestVertexNum < UINT_MAX;
393 iVertex = bestVertexNum;
394 if (iVertex >= numRealVertices) {
396 iVertex -= numRealVertices;
403 double dzmin = 1.0e100;
405 for (IV iv =
vertices->begin(); iv != vertend; ++iv, ++
index)
416 const IV fakeEnd(fakeVertices->end());
418 for (IV iv = fakeVertices->begin(); iv != fakeEnd; ++iv, ++
index)