CMS 3D CMS Logo

Public Member Functions | Private Attributes

CombinedSeedComparitor Class Reference

Inheritance diagram for CombinedSeedComparitor:
SeedComparitor

List of all members.

Public Member Functions

 CombinedSeedComparitor (const edm::ParameterSet &cfg)
virtual bool compatible (const SeedingHitSet &hits, const TrackingRegion &region) const
virtual bool compatible (const SeedingHitSet &hits, const GlobalTrajectoryParameters &helixStateAtVertex, const FastHelix &helix, const TrackingRegion &region) const
virtual bool compatible (const SeedingHitSet &hits, const GlobalTrajectoryParameters &straightLineStateAtVertex, const TrackingRegion &region) const
virtual bool compatible (const TrajectorySeed &seed) const
virtual bool compatible (const TrajectoryStateOnSurface &, const TransientTrackingRecHit::ConstRecHitPointer &hit) const
virtual void init (const edm::EventSetup &es)
virtual ~CombinedSeedComparitor ()

Private Attributes

boost::ptr_vector< SeedComparitorcomparitors_
bool isAnd_

Detailed Description

Definition at line 8 of file CombinedSeedComparitor.cc.


Constructor & Destructor Documentation

CombinedSeedComparitor::CombinedSeedComparitor ( const edm::ParameterSet cfg)

Definition at line 31 of file CombinedSeedComparitor.cc.

References comparitors_, SurfaceDeformationFactory::create(), Exception, reco::get(), edm::ParameterSet::getParameter(), isAnd_, mode, and mergeVDriftHistosByStation::name.

{
    std::string mode = cfg.getParameter<std::string>("mode");
    if (mode == "and") isAnd_ = true;
    else if (mode == "or") isAnd_ = false;
    else throw cms::Exception("Configuration", "Parameter 'mode' of CombinedSeedComparitor must be either 'and' or 'or'\n");

    typedef std::vector<edm::ParameterSet> VPSet;
    VPSet psets = cfg.getParameter<VPSet>("comparitors");
    for (VPSet::const_iterator it = psets.begin(), ed = psets.end(); it != ed; ++it) {
        std::string name = it->getParameter<std::string>("ComponentName");
        comparitors_.push_back(SeedComparitorFactory::get()->create(name, *it));
    }
}
CombinedSeedComparitor::~CombinedSeedComparitor ( ) [virtual]

Definition at line 46 of file CombinedSeedComparitor.cc.

{
}

Member Function Documentation

bool CombinedSeedComparitor::compatible ( const SeedingHitSet hits,
const TrackingRegion region 
) const [virtual]

Implements SeedComparitor.

Definition at line 59 of file CombinedSeedComparitor.cc.

References comparitors_, and isAnd_.

{
    typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
    for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
        bool pass = it->compatible(hits, region);
        if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
    }
    return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
}
bool CombinedSeedComparitor::compatible ( const SeedingHitSet hits,
const GlobalTrajectoryParameters straightLineStateAtVertex,
const TrackingRegion region 
) const [virtual]

Implements SeedComparitor.

Definition at line 107 of file CombinedSeedComparitor.cc.

References comparitors_, and isAnd_.

{
    typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
    for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
        bool pass = it->compatible(hits, straightLineStateAtVertex, region);
        if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
    }
    return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
}
bool CombinedSeedComparitor::compatible ( const SeedingHitSet hits,
const GlobalTrajectoryParameters helixStateAtVertex,
const FastHelix helix,
const TrackingRegion region 
) const [virtual]

Implements SeedComparitor.

Definition at line 93 of file CombinedSeedComparitor.cc.

References comparitors_, and isAnd_.

{
    typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
    for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
        bool pass = it->compatible(hits, helixStateAtVertex, helix, region);
        if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
    }
    return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
}
bool CombinedSeedComparitor::compatible ( const TrajectoryStateOnSurface tsos,
const TransientTrackingRecHit::ConstRecHitPointer hit 
) const [virtual]

Implements SeedComparitor.

Definition at line 81 of file CombinedSeedComparitor.cc.

References comparitors_, and isAnd_.

{
    typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
    for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
        bool pass = it->compatible(tsos, hit);
        if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
    }
    return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
}
bool CombinedSeedComparitor::compatible ( const TrajectorySeed seed) const [virtual]

Implements SeedComparitor.

Definition at line 70 of file CombinedSeedComparitor.cc.

References comparitors_, and isAnd_.

{
    typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
    for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
        bool pass = it->compatible(seed);
        if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
    }
    return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
}
void CombinedSeedComparitor::init ( const edm::EventSetup es) [virtual]

Implements SeedComparitor.

Definition at line 51 of file CombinedSeedComparitor.cc.

References comparitors_.

                                                    {
    typedef boost::ptr_vector<SeedComparitor>::iterator ITC;
    for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
        it->init(es);
    }
}

Member Data Documentation

Definition at line 26 of file CombinedSeedComparitor.cc.

Referenced by CombinedSeedComparitor(), compatible(), and init().

Definition at line 27 of file CombinedSeedComparitor.cc.

Referenced by CombinedSeedComparitor(), and compatible().