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)
 
bool compatible (const SeedingHitSet &hits) const override
 
bool compatible (const SeedingHitSet &hits, const GlobalTrajectoryParameters &helixStateAtVertex, const FastHelix &helix) const override
 
bool compatible (const TrajectoryStateOnSurface &, SeedingHitSet::ConstRecHitPointer hit) const override
 
void init (const edm::Event &ev, const edm::EventSetup &es) override
 
 ~CombinedSeedComparitor () override
 
- 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::CombinedSeedComparitor ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)

Definition at line 24 of file CombinedSeedComparitor.cc.

24  {
25  std::string mode = cfg.getParameter<std::string>("mode");
26  if (mode == "and")
27  isAnd_ = true;
28  else if (mode == "or")
29  isAnd_ = false;
30  else
31  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 }

References looper::cfg, comparitors_, beamerCreator::create(), Exception, get, isAnd_, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, and HistogramManager_cfi::VPSet().

◆ ~CombinedSeedComparitor()

CombinedSeedComparitor::~CombinedSeedComparitor ( )
override

Definition at line 41 of file CombinedSeedComparitor.cc.

41 {}

Member Function Documentation

◆ compatible() [1/3]

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

Implements SeedComparitor.

Definition at line 50 of file CombinedSeedComparitor.cc.

50  {
51  typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
52  for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
53  bool pass = it->compatible(hits);
54  if (isAnd_ != pass)
55  return pass; // break on failures if doing an AND, and on successes if doing an OR
56  }
57  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
58 }

References comparitors_, hfClusterShapes_cfi::hits, and isAnd_.

◆ compatible() [2/3]

bool CombinedSeedComparitor::compatible ( const SeedingHitSet hits,
const GlobalTrajectoryParameters helixStateAtVertex,
const FastHelix helix 
) const
overridevirtual

Implements SeedComparitor.

Definition at line 71 of file CombinedSeedComparitor.cc.

73  {
74  typedef boost::ptr_vector<SeedComparitor>::const_iterator ITC;
75  for (ITC it = comparitors_.begin(), ed = comparitors_.end(); it != ed; ++it) {
76  bool pass = it->compatible(hits, helixStateAtVertex, helix);
77  if (isAnd_ != pass)
78  return pass; // break on failures if doing an AND, and on successes if doing an OR
79  }
80  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
81 }

References comparitors_, hfClusterShapes_cfi::hits, and isAnd_.

◆ compatible() [3/3]

bool CombinedSeedComparitor::compatible ( const TrajectoryStateOnSurface tsos,
SeedingHitSet::ConstRecHitPointer  hit 
) const
overridevirtual

Implements SeedComparitor.

Definition at line 60 of file CombinedSeedComparitor.cc.

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

References comparitors_, and isAnd_.

◆ init()

void CombinedSeedComparitor::init ( const edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

Implements SeedComparitor.

Definition at line 43 of file CombinedSeedComparitor.cc.

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

References comparitors_, and ev.

Member Data Documentation

◆ comparitors_

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

Definition at line 20 of file CombinedSeedComparitor.cc.

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

◆ isAnd_

bool CombinedSeedComparitor::isAnd_
private

Definition at line 21 of file CombinedSeedComparitor.cc.

Referenced by CombinedSeedComparitor(), and compatible().

hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
get
#define get
CombinedSeedComparitor::comparitors_
boost::ptr_vector< SeedComparitor > comparitors_
Definition: CombinedSeedComparitor.cc:20
looper.cfg
cfg
Definition: looper.py:297
CombinedSeedComparitor::isAnd_
bool isAnd_
Definition: CombinedSeedComparitor.cc:21
HistogramManager_cfi.VPSet
def VPSet(*args)
Definition: HistogramManager_cfi.py:401
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
hit
Definition: SiStripHitEffFromCalibTree.cc:88