CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual bool compatible (const SeedingHitSet &hits, const TrackingRegion &region) const
 
virtual bool compatible (const TrajectorySeed &seed) const
 
virtual bool compatible (const TrajectoryStateOnSurface &, const TransientTrackingRecHit::ConstRecHitPointer &hit) 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 void init (const edm::EventSetup &es)
 
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)

Definition at line 31 of file CombinedSeedComparitor.cc.

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

32 {
33  std::string mode = cfg.getParameter<std::string>("mode");
34  if (mode == "and") isAnd_ = true;
35  else if (mode == "or") isAnd_ = false;
36  else throw cms::Exception("Configuration", "Parameter 'mode' of CombinedSeedComparitor must be either 'and' or 'or'\n");
37 
38  typedef std::vector<edm::ParameterSet> VPSet;
39  VPSet psets = cfg.getParameter<VPSet>("comparitors");
40  for (VPSet::const_iterator it = psets.begin(), ed = psets.end(); it != ed; ++it) {
41  std::string name = it->getParameter<std::string>("ComponentName");
42  comparitors_.push_back(SeedComparitorFactory::get()->create(name, *it));
43  }
44 }
T getParameter(std::string const &) const
boost::ptr_vector< SeedComparitor > comparitors_
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:56
CombinedSeedComparitor::~CombinedSeedComparitor ( )
virtual

Definition at line 46 of file CombinedSeedComparitor.cc.

47 {
48 }

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_.

60 {
61  typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
62  for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
63  bool pass = it->compatible(hits, region);
64  if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
65  }
66  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
67 }
boost::ptr_vector< SeedComparitor > comparitors_
bool CombinedSeedComparitor::compatible ( const TrajectorySeed seed) const
virtual

Implements SeedComparitor.

Definition at line 70 of file CombinedSeedComparitor.cc.

References comparitors_, and isAnd_.

71 {
72  typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
73  for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
74  bool pass = it->compatible(seed);
75  if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
76  }
77  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
78 }
boost::ptr_vector< SeedComparitor > comparitors_
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_.

83 {
84  typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
85  for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
86  bool pass = it->compatible(tsos, hit);
87  if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
88  }
89  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
90 }
boost::ptr_vector< SeedComparitor > comparitors_
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_.

97 {
98  typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
99  for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
100  bool pass = it->compatible(hits, helixStateAtVertex, helix, region);
101  if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
102  }
103  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
104 }
boost::ptr_vector< SeedComparitor > comparitors_
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_.

110 {
111  typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
112  for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
113  bool pass = it->compatible(hits, straightLineStateAtVertex, region);
114  if (isAnd_ != pass) return pass; // break on failures if doing an AND, and on successes if doing an OR
115  }
116  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
117 }
boost::ptr_vector< SeedComparitor > comparitors_
void CombinedSeedComparitor::init ( const edm::EventSetup es)
virtual

Implements SeedComparitor.

Definition at line 51 of file CombinedSeedComparitor.cc.

References comparitors_.

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

Member Data Documentation

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

Definition at line 26 of file CombinedSeedComparitor.cc.

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

bool CombinedSeedComparitor::isAnd_
private

Definition at line 27 of file CombinedSeedComparitor.cc.

Referenced by CombinedSeedComparitor(), and compatible().