37 #define init_param(type, varname) varname (ps.getParameter< type >( #varname ))
131 produces<reco::PFCandidateCollection>();
145 std::auto_ptr<reco::PFCandidateCollection>
155 const unsigned ncand = pfCandidates->size();
156 for (
unsigned i=0;
i<ncand; ++
i)
166 else if (vertexref.
key() == 0)
175 const double eta = candptr->p4().Eta();
176 remove = eta < etaMin || eta >
etaMax;
185 pOutput->push_back(cand);
197 const unsigned shift =
static_cast<unsigned>(ptype);
206 const unsigned shift =
static_cast<unsigned>(ptype);
208 const unsigned mask = (1U <<
shift);
222 typedef reco::VertexCollection::const_iterator IV;
229 unsigned nFoundVertex = 0;
230 double bestweight = 0;
232 const IV vertend(vertices->end());
233 for (IV iv=vertices->begin(); iv!=vertend; ++iv, ++
index)
235 const double ndof = iv->ndof();
242 for (IT iTrack=vtx.
tracks_begin(); iTrack!=trackend; ++iTrack)
248 if (baseRef == trackBaseRef)
263 if (nFoundVertex > 0)
265 if (nFoundVertex != 1)
267 <<
"a track is shared by at least two vertices. "
268 <<
"Used to be an assert";
275 double dzmin = 10000;
276 double ztrack = pfcand.
vertex().z();
277 bool foundVertex =
false;
279 for (IV iv=vertices->begin(); iv!=vertend; ++iv, ++
index)
281 const double ndof = iv->ndof();
284 const double dz = fabs(ztrack - iv->z());
void setRemovalBit(reco::PFCandidate::ParticleType ptype, bool onOff)
ParticleType
particle types
void produce(edm::Event &, const edm::EventSetup &)
trackRef_iterator tracks_end() const
last iterator over tracks
#define DEFINE_FWK_MODULE(type)
void setSourceCandidatePtr(const PFCandidatePtr &ptr)
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
reco::TrackRef trackRef() const
bool isRemovable(reco::PFCandidate::ParticleType ptype) const
bool isNull() const
Checks for null.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
virtual const Point & vertex() const
vertex position
bool reverseRemovalDecision
std::vector< LinkConnSpec >::const_iterator IT
edm::Ref< VertexCollection > VertexRef
persistent reference to a Vertex
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag PFCandidates
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
key_type key() const
Accessor for product key.
#define init_param(type, varname)
Particle reconstructed by the particle flow algorithm.
FFTJetPFPileupCleaner & operator=(const FFTJetPFPileupCleaner &)
std::vector< VertexType > Vertices
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
static unsigned int const shift
reco::VertexRef findSomeVertex(const edm::Handle< reco::VertexCollection > &vertices, const reco::PFCandidate &pfcand) const
trackRef_iterator tracks_begin() const
first iterator over tracks