CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

VertexClassifierByProxy< Collection > Class Template Reference

Get track history and classification by proxy. More...

#include <VertexClassifierByProxy.h>

Inheritance diagram for VertexClassifierByProxy< Collection >:
VertexClassifier VertexCategories

List of all members.

Public Types

typedef edm::AssociationMap
< edm::OneToMany< Collection,
reco::VertexCollection > > 
Association
 Association type.

Public Member Functions

VertexClassifierByProxy
< Collection > const & 
evaluate (TrackingVertexRef const &vertex)
 Classify the TrackingVertex in categories.
VertexClassifierByProxy
< Collection > const & 
evaluate (edm::Ref< Collection > const &vertex)
 Classify any vertexes in categories.
VertexClassifierByProxy
< Collection > const & 
evaluate (edm::Ref< Collection > const &vertex, std::size_t index)
 Classify any vertexes in categories.
virtual void newEvent (edm::Event const &event, edm::EventSetup const &config)
 Pre-process event information (for accessing reconstraction information).
 VertexClassifierByProxy (edm::ParameterSet const &config)
 Constructor by ParameterSet.

Private Attributes

const edm::InputTag proxy_
edm::Handle< AssociationproxyHandler_

Detailed Description

template<typename Collection>
class VertexClassifierByProxy< Collection >

Get track history and classification by proxy.

Definition at line 11 of file VertexClassifierByProxy.h.


Member Typedef Documentation

template<typename Collection>
typedef edm::AssociationMap<edm::OneToMany<Collection, reco::VertexCollection> > VertexClassifierByProxy< Collection >::Association

Association type.

Definition at line 17 of file VertexClassifierByProxy.h.


Constructor & Destructor Documentation

template<typename Collection>
VertexClassifierByProxy< Collection >::VertexClassifierByProxy ( edm::ParameterSet const &  config) [inline]

Constructor by ParameterSet.

Definition at line 20 of file VertexClassifierByProxy.h.

                                                            : VertexClassifier(config),
            proxy_( config.getUntrackedParameter<edm::InputTag>("vertexProducer") ) {}

Member Function Documentation

template<typename Collection>
VertexClassifierByProxy<Collection> const& VertexClassifierByProxy< Collection >::evaluate ( TrackingVertexRef const &  vertex) [inline]
template<typename Collection>
VertexClassifierByProxy<Collection> const& VertexClassifierByProxy< Collection >::evaluate ( edm::Ref< Collection > const &  vertex) [inline]

Classify any vertexes in categories.

Definition at line 64 of file VertexClassifierByProxy.h.

    {
        const reco::VertexRefVector * vertexes = 0;

        try
        {
            // Get a reference to the vector of associated vertexes
            vertexes = &(proxyHandler_->find(vertex)->val);
        }
        catch (edm::Exception& e)
        {
            // If association fails define the vertex as unknown
            reset();
            unknownVertex();
            return *this;
        }

        // Loop over all the associated vertexes
        for (std::size_t index = 0; index < vertexes->size(); ++index)
        {
            // Copy the last status for all the flags
            Flags flags(flags_);

            // Evaluate the history for a given index
            VertexClassifier::evaluate( vertexes->at(index) );

            // Combine OR the flag information
            for (std::size_t i = 0; i < flags_.size(); ++i)
                flags_[i] = flags_[i] | flags[i];
        }

        return *this;
    }
template<typename Collection>
VertexClassifierByProxy<Collection> const& VertexClassifierByProxy< Collection >::evaluate ( edm::Ref< Collection > const &  vertex,
std::size_t  index 
) [inline]

Classify any vertexes in categories.

Definition at line 40 of file VertexClassifierByProxy.h.

    {
        const reco::VertexRefVector * vertexes = 0;

        try
        {
            // Get a reference to the vector of associated vertexes
            vertexes = &(proxyHandler_->find(vertex)->val);
        }
        catch (edm::Exception& e)
        {
            // If association fails define the vertex as unknown
            reset();
            unknownVertex();
            return *this;
        }

        // Evaluate the history for a given index
        VertexClassifier::evaluate( vertexes->at(index) );

        return *this;
    }
template<typename Collection>
virtual void VertexClassifierByProxy< Collection >::newEvent ( edm::Event const &  event,
edm::EventSetup const &  config 
) [inline, virtual]

Pre-process event information (for accessing reconstraction information).

Reimplemented from VertexClassifier.

Definition at line 24 of file VertexClassifierByProxy.h.

Referenced by recoBSVTagInfoValidationAnalyzer::analyze(), SVTagInfoValidationAnalyzer::analyze(), and VertexClassifierByProxy< reco::SecondaryVertexTagInfoCollection >::newEvent().

    {
        // Get the association part of the proxy to the collection
        event.getByLabel(proxy_, proxyHandler_);
        // Call the previous new event
        VertexClassifier::newEvent(event, config);
    }

Member Data Documentation

template<typename Collection>
const edm::InputTag VertexClassifierByProxy< Collection >::proxy_ [private]
template<typename Collection>
edm::Handle<Association> VertexClassifierByProxy< Collection >::proxyHandler_ [private]