11 for(
unsigned i=0;
i<pfCandidates.size();
i++ ) {
30 std::cout<<
"VTX "<<
i<<
" "<< *(pfCandidates[
i])<<std::endl;
34 std::cout<<
"PU "<<
i<<
" "<< *(pfCandidates[
i])<<std::endl;
45 auto const & track = pfcand.
trackRef();
48 unsigned int nFoundVertex = 0;
50 for(
auto const & vtx : vertices) {
51 float w = vtx.trackWeight(track);
63 edm::LogWarning(
"TrackOnTwoVertex")<<
"a track is shared by at least two verteces. Used to be an assert";
72 double ztrack = pfcand.
vertex().z();
73 bool foundVertex =
false;
75 for(
auto iv=vertices.begin(); iv!=vertices.end(); ++iv, ++
index) {
77 double dz = fabs(ztrack - iv->z());
std::vector< Vertex > VertexCollection
collection of Vertex objects
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
reco::TrackRef trackRef() const
PFCollection pfCandidatesFromVtx_
virtual const Point & vertex() const
vertex position (overwritten by PF...)
PFCollection pfCandidatesFromPU_
int chargedHadronVertex(const reco::VertexCollection &vertices, const reco::PFCandidate &pfcand) const
bool checkClosestZVertex_
use the closest z vertex if a track is not in a vertex
std::vector< edm::FwdPtr< reco::PFCandidate > > PFCollection
Particle reconstructed by the particle flow algorithm.
void process(const PFCollection &pfCandidates, const reco::VertexCollection &vertices)
virtual ParticleType particleId() const