#include <JetSignalVertexCompatibility.h>
Public Member Functions | |
JetSignalVertexCompatibility (const edm::ParameterSet ¶ms) | |
virtual void | produce (edm::Event &event, const edm::EventSetup &es) |
~JetSignalVertexCompatibility () | |
Private Attributes | |
reco::JetSignalVertexCompatibilityAlgo | algo |
const edm::InputTag | jetTracksAssocLabel |
const edm::InputTag | primaryVerticesLabel |
Definition at line 12 of file JetSignalVertexCompatibility.h.
JetSignalVertexCompatibility::JetSignalVertexCompatibility | ( | const edm::ParameterSet & | params | ) |
Definition at line 25 of file JetSignalVertexCompatibility.cc.
: algo(params.getParameter<double>("cut"), params.getParameter<double>("temperature")), jetTracksAssocLabel(params.getParameter<edm::InputTag>("jetTracksAssoc")), primaryVerticesLabel(params.getParameter<edm::InputTag>("primaryVertices")) { produces<JetFloatAssociation::Container>(); }
JetSignalVertexCompatibility::~JetSignalVertexCompatibility | ( | ) |
Definition at line 35 of file JetSignalVertexCompatibility.cc.
{ }
void JetSignalVertexCompatibility::produce | ( | edm::Event & | event, |
const edm::EventSetup & | es | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 39 of file JetSignalVertexCompatibility.cc.
References algo, reco::JetSignalVertexCompatibilityAlgo::compatibility(), edm::EventSetup::get(), jetTracksAssocLabel, primaryVerticesLabel, edm::ESHandle< T >::product(), reco::JetSignalVertexCompatibilityAlgo::resetEvent(), query::result, and testEve_cfg::tracks.
{ edm::ESHandle<TransientTrackBuilder> trackBuilder; es.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder); algo.resetEvent(trackBuilder.product()); edm::Handle<JetTracksAssociationCollection> jetTracksAssoc; event.getByLabel(jetTracksAssocLabel, jetTracksAssoc); edm::Handle<VertexCollection> primaryVertices; event.getByLabel(primaryVerticesLabel, primaryVertices); std::auto_ptr<JetFloatAssociation::Container> result( new JetFloatAssociation::Container(jetTracksAssoc->keyProduct())); for(JetTracksAssociationCollection::const_iterator iter = jetTracksAssoc->begin(); iter != jetTracksAssoc->end(); ++iter) { if (primaryVertices->empty()) (*result)[iter->first] = -1.; const TrackRefVector &tracks = iter->second; std::vector<float> compatibility = algo.compatibility(*primaryVertices, tracks); // the first vertex is the presumed signal vertex (*result)[iter->first] = compatibility[0]; } algo.resetEvent(0); event.put(result); }
Definition at line 20 of file JetSignalVertexCompatibility.h.
Referenced by produce().
const edm::InputTag JetSignalVertexCompatibility::jetTracksAssocLabel [private] |
Definition at line 22 of file JetSignalVertexCompatibility.h.
Referenced by produce().
const edm::InputTag JetSignalVertexCompatibility::primaryVerticesLabel [private] |
Definition at line 23 of file JetSignalVertexCompatibility.h.
Referenced by produce().