BristolTopGroup / NTupleProduction

Software for particle physics to create nTuples from AOD files
Other
2 stars 8 forks source link

JetUserData -> read vertex collection only once per event #286

Open kreczko opened 7 years ago

kreczko commented 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

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.