CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

pat::helper::BaseIsolator Class Reference

#include <BaseIsolator.h>

Inheritance diagram for pat::helper::BaseIsolator:
pat::helper::IsoDepositIsolator pat::helper::SimpleIsolator

List of all members.

Public Types

typedef edm::ValueMap< float > Isolation

Public Member Functions

 BaseIsolator ()
 BaseIsolator (const edm::ParameterSet &conf, bool withCut)
virtual void beginEvent (const edm::Event &event, const edm::EventSetup &eventSetup)=0
virtual std::string description () const =0
virtual void endEvent ()=0
template<typename AnyRef >
float getValue (const AnyRef &ref) const
 Returns the associated isolation value given any sort of ref.
void print (std::ostream &out) const
template<typename AnyRef >
bool test (const AnyRef &ref) const
 Tests if the value associated to this item is strictly below the cut.
virtual ~BaseIsolator ()

Protected Member Functions

virtual float getValue (const edm::ProductID &id, size_t index) const =0

Protected Attributes

float cut_
uint64_t fail_
edm::InputTag input_
uint64_t try_

Detailed Description

Definition at line 9 of file BaseIsolator.h.


Member Typedef Documentation

Reimplemented in pat::helper::IsoDepositIsolator.

Definition at line 11 of file BaseIsolator.h.


Constructor & Destructor Documentation

pat::helper::BaseIsolator::BaseIsolator ( ) [inline]

Definition at line 12 of file BaseIsolator.h.

{}
BaseIsolator::BaseIsolator ( const edm::ParameterSet conf,
bool  withCut 
)

Definition at line 7 of file BaseIsolator.cc.

                                                                    :
    input_(conf.getParameter<edm::InputTag>("src")),
    cut_(withCut ? conf.getParameter<double>("cut") : -2.0),
    try_(0), fail_(0)
{
}
virtual pat::helper::BaseIsolator::~BaseIsolator ( ) [inline, virtual]

Definition at line 14 of file BaseIsolator.h.

{}

Member Function Documentation

virtual void pat::helper::BaseIsolator::beginEvent ( const edm::Event event,
const edm::EventSetup eventSetup 
) [pure virtual]
virtual std::string pat::helper::BaseIsolator::description ( ) const [pure virtual]
virtual void pat::helper::BaseIsolator::endEvent ( ) [pure virtual]
template<typename AnyRef >
float pat::helper::BaseIsolator::getValue ( const AnyRef &  ref) const [inline]

Returns the associated isolation value given any sort of ref.

Definition at line 25 of file BaseIsolator.h.

Referenced by test().

                                                                          {
            return getValue(ref.id(), ref.key());
        }
virtual float pat::helper::BaseIsolator::getValue ( const edm::ProductID id,
size_t  index 
) const [protected, pure virtual]
void BaseIsolator::print ( std::ostream &  out) const

Definition at line 15 of file BaseIsolator.cc.

References cut_, description(), fail_, and try_.

Referenced by operator<<().

                                         {
    using namespace std;
    out << description() << " < " << cut_ << ": try " << try_ << ", fail " << fail_;
}
template<typename AnyRef >
bool pat::helper::BaseIsolator::test ( const AnyRef &  ref) const [inline]

Tests if the value associated to this item is strictly below the cut.

Definition at line 19 of file BaseIsolator.h.

References cut_, fail_, getValue(), convertSQLiteXML::ok, and try_.

                                                                     { 
            bool ok = (getValue(ref.id(), ref.key()) < cut_);
            try_++; if (!ok) fail_++;
            return ok;
        }

Member Data Documentation

Definition at line 34 of file BaseIsolator.h.

Referenced by print(), and test().

uint64_t pat::helper::BaseIsolator::fail_ [mutable, protected]

Definition at line 35 of file BaseIsolator.h.

Referenced by print(), and test().

uint64_t pat::helper::BaseIsolator::try_ [mutable, protected]

Definition at line 35 of file BaseIsolator.h.

Referenced by print(), and test().