40 #define init_param(type, varname) varname(ps.getParameter<type>(#varname))
68 bool* fromFakeSet)
const;
132 mutable std::vector<std::pair<double, unsigned> >
zAssoc;
169 produces<reco::PFCandidateCollection>();
182 auto pOutput = std::make_unique<reco::PFCandidateCollection>();
195 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPFPileupCleaner:"
196 " could not find fake vertices"
201 for (
unsigned i = 0;
i < ncand; ++
i) {
206 bool fromFakeSet =
false;
226 const double eta = candptr->p4().Eta();
235 pOutput->push_back(
cand);
236 pOutput->back().setSourceCandidatePtr(candptr);
244 const unsigned shift = static_cast<unsigned>(
ptype);
250 const unsigned shift = static_cast<unsigned>(
ptype);
252 const unsigned mask = (1
U <<
shift);
265 bool* fromFakeSet)
const {
266 typedef reco::VertexCollection::const_iterator IV;
269 *fromFakeSet =
false;
273 unsigned nFoundVertex = 0;
278 double bestweight = 0.0;
284 IT trackend(
vtx.tracks_end());
285 for (
IT iTrack =
vtx.tracks_begin(); iTrack != trackend; ++iTrack) {
290 if (baseRef == trackBaseRef) {
292 const double w =
vtx.trackWeight(baseRef);
293 if (
w > bestweight) {
303 if (nFoundVertex > 0) {
304 if (nFoundVertex != 1)
305 edm::LogWarning(
"TrackOnTwoVertex") <<
"a track is shared by at least two vertices. "
306 <<
"Used to be an assert";
311 const double ztrack =
pfcand.vertex().z();
314 const IV fakeEnd(fakeVertices->end());
316 for (IV
iv = fakeVertices->begin();
iv != fakeEnd; ++
iv, ++
index)
332 const double ztrack =
pfcand.vertex().z();
333 bool foundVertex =
false;
341 zAssoc.push_back(std::pair<double, unsigned>(
iv->z(),
index));
342 const unsigned numRealVertices =
index;
347 const IV fakeEnd(fakeVertices->end());
348 for (IV
iv = fakeVertices->begin();
iv != fakeEnd; ++
iv, ++
index)
350 zAssoc.push_back(std::pair<double, unsigned>(
iv->z(),
index));
356 std::pair<double, unsigned> tPair(ztrack, UINT_MAX);
363 unsigned ich[2] = {0
U, 0
U};
366 ich[0] = iAbove - 1
U;
368 if (iAbove <
zAssoc.size())
372 double dzmin = 1.0e100;
373 unsigned bestVertexNum = UINT_MAX;
374 for (
unsigned icheck = 0; icheck < nch; ++icheck) {
375 const unsigned zAssocIndex = ich[icheck];
376 const unsigned vertexNum =
zAssoc[zAssocIndex].second;
379 bestVertexNum = vertexNum;
386 bestVertexNum = vertexNum;
390 foundVertex = bestVertexNum < UINT_MAX;
392 iVertex = bestVertexNum;
393 if (iVertex >= numRealVertices) {
395 iVertex -= numRealVertices;
402 double dzmin = 1.0e100;
415 const IV fakeEnd(fakeVertices->end());
417 for (IV
iv = fakeVertices->begin();
iv != fakeEnd; ++
iv, ++
index)