Open kreczko opened 7 years ago
Currently we are reading the vertex collection once per jet. While CMSSW is smart about caching such access, it is a bad code example. These two lines should move into the produce method
produce
edm::Handle < std::vector<reco::Vertex> > primaryVertices; iEvent.getByToken(vtxInputTag_, primaryVertices);
and the current fillVertexVariables method should take the vertex handle (const reference) instead of iEvent as paramter.
fillVertexVariables
iEvent
Currently we are reading the vertex collection once per jet. While CMSSW is smart about caching such access, it is a bad code example. These two lines should move into the
produce
methodand the current
fillVertexVariables
method should take the vertex handle (const reference) instead ofiEvent
as paramter.