CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CombinedSeedComparitor Class Reference
Inheritance diagram for CombinedSeedComparitor:
SeedComparitor

Public Member Functions

 CombinedSeedComparitor (const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
 
virtual bool compatible (const SeedingHitSet &hits) const override
 
virtual bool compatible (const TrajectoryStateOnSurface &, SeedingHitSet::ConstRecHitPointer hit) const override
 
virtual bool compatible (const SeedingHitSet &hits, const GlobalTrajectoryParameters &helixStateAtVertex, const FastHelix &helix) const override
 
virtual void init (const edm::Event &ev, const edm::EventSetup &es) override
 
virtual ~CombinedSeedComparitor ()
 
- Public Member Functions inherited from SeedComparitor
virtual ~SeedComparitor ()
 

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,
edm::ConsumesCollector iC 
)

Definition at line 26 of file CombinedSeedComparitor.cc.

References comparitors_, beamerCreator::create(), Exception, reco::get(), edm::ParameterSet::getParameter(), isAnd_, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, dataset::name, AlCaHLTBitMon_QueryRunRegistry::string, and HistogramManager_cfi::VPSet().

27 {
29  if (mode == "and") isAnd_ = true;
30  else if (mode == "or") isAnd_ = false;
31  else throw cms::Exception("Configuration", "Parameter 'mode' of CombinedSeedComparitor must be either 'and' or 'or'\n");
32 
33  typedef std::vector<edm::ParameterSet> VPSet;
34  VPSet psets = cfg.getParameter<VPSet>("comparitors");
35  for (VPSet::const_iterator it = psets.begin(), ed = psets.end(); it != ed; ++it) {
36  std::string name = it->getParameter<std::string>("ComponentName");
37  comparitors_.push_back(SeedComparitorFactory::get()->create(name, *it, iC));
38  }
39 }
T getParameter(std::string const &) const
def create(alignables, pedeDump, additionalData, outputFile, config)
boost::ptr_vector< SeedComparitor > comparitors_
T get(const Candidate &c)
Definition: component.h:55
CombinedSeedComparitor::~CombinedSeedComparitor ( )
virtual

Definition at line 41 of file CombinedSeedComparitor.cc.

42 {
43 }

Member Function Documentation

bool CombinedSeedComparitor::compatible ( const SeedingHitSet hits) const
overridevirtual

Implements SeedComparitor.

Definition at line 54 of file CombinedSeedComparitor.cc.

References comparitors_, and isAnd_.

55 {
56  typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
57  for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
58  bool pass = it->compatible(hits);
59  if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
60  }
61  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
62 }
boost::ptr_vector< SeedComparitor > comparitors_
bool CombinedSeedComparitor::compatible ( const TrajectoryStateOnSurface tsos,
SeedingHitSet::ConstRecHitPointer  hit 
) const
overridevirtual

Implements SeedComparitor.

Definition at line 65 of file CombinedSeedComparitor.cc.

References comparitors_, and isAnd_.

67 {
68  typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
69  for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
70  bool pass = it->compatible(tsos, hit);
71  if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
72  }
73  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
74 }
boost::ptr_vector< SeedComparitor > comparitors_
bool CombinedSeedComparitor::compatible ( const SeedingHitSet hits,
const GlobalTrajectoryParameters helixStateAtVertex,
const FastHelix helix 
) const
overridevirtual

Implements SeedComparitor.

Definition at line 77 of file CombinedSeedComparitor.cc.

References comparitors_, DEFINE_EDM_PLUGIN, and isAnd_.

80 {
81  typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
82  for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
83  bool pass = it->compatible(hits, helixStateAtVertex, helix);
84  if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
85  }
86  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
87 }
boost::ptr_vector< SeedComparitor > comparitors_
void CombinedSeedComparitor::init ( const edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

Implements SeedComparitor.

Definition at line 46 of file CombinedSeedComparitor.cc.

References comparitors_.

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

Member Data Documentation

boost::ptr_vector<SeedComparitor> CombinedSeedComparitor::comparitors_
private

Definition at line 21 of file CombinedSeedComparitor.cc.

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

bool CombinedSeedComparitor::isAnd_
private

Definition at line 22 of file CombinedSeedComparitor.cc.

Referenced by CombinedSeedComparitor(), and compatible().