CMS 3D CMS Logo

Public Member Functions | Private Attributes

JetSignalVertexCompatibility Class Reference

#include <JetSignalVertexCompatibility.h>

Inheritance diagram for JetSignalVertexCompatibility:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 JetSignalVertexCompatibility (const edm::ParameterSet &params)
virtual void produce (edm::Event &event, const edm::EventSetup &es)
 ~JetSignalVertexCompatibility ()

Private Attributes

reco::JetSignalVertexCompatibilityAlgo algo
const edm::InputTag jetTracksAssocLabel
const edm::InputTag primaryVerticesLabel

Detailed Description

Definition at line 12 of file JetSignalVertexCompatibility.h.


Constructor & Destructor Documentation

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.

{
}

Member Function Documentation

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);
}

Member Data Documentation

Definition at line 20 of file JetSignalVertexCompatibility.h.

Referenced by produce().

Definition at line 22 of file JetSignalVertexCompatibility.h.

Referenced by produce().

Definition at line 23 of file JetSignalVertexCompatibility.h.

Referenced by produce().