Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 716 Bytes

DEV_NOTES.md

File metadata and controls

18 lines (14 loc) · 716 Bytes

Developement Notes

getByLabel() => getByToken()

getByToken is a lot more rigid than getByLabel, where it requires an EDGetToken created from a call to consumes(). The call to consumes() requires that the product Type be known. This method is faster than getByLabel and guarantees that you've registered to request the data. getByToken is also multithread enabled unlike getByLabel.

.h
const edm::EDGetTokenT<std::vector<pat::Muon>> inputTag;

.cc (Initialiser)
inputTag(consumes<std::vector<pat::Muon>>(iConfig.getParameter<edm::InputTag>("InputTag"))),			

.cc (call)
edm::Handle < std::vector<pat::Muon> > muons;
iEvent.getByToken(inputTag, muons);