Skip to content

Instantly share code, notes, and snippets.

@velicanu
Created September 3, 2015 05:22
Show Gist options
  • Save velicanu/52d61757452429191af9 to your computer and use it in GitHub Desktop.
Save velicanu/52d61757452429191af9 to your computer and use it in GitHub Desktop.
// NEW
edm::EDGetTokenT<vector<reco::Vertex> > vtxCollection_;
ggHiNtuplizer::ggHiNtuplizer(const edm::ParameterSet& ps)
{
vtxCollection_ = consumes<vector<reco::Vertex> > (ps.getParameter<edm::InputTag>("VtxLabel"));
}
void ggHiNtuplizer::analyze(const edm::Event& e, const edm::EventSetup& es)
{
edm::Handle<vector<reco::Vertex> > vtxHandle;
e.getByToken(vtxCollection_, vtxHandle);
}
// OLD
edm::InputTag vtxTag_;
HiInclusiveJetAnalyzer::HiInclusiveJetAnalyzer(const edm::ParameterSet& iConfig) :
geo(0)
{
vtxTag_ = iConfig.getUntrackedParameter<edm::InputTag>("vtxTag",edm::InputTag("hiSelectedVertex"));
}
HiInclusiveJetAnalyzer::analyze(const Event& iEvent,
const EventSetup& iSetup) {
edm::Handle<vector<reco::Vertex> >vertex;
iEvent.getByLabel(vtxTag_, vertex);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment