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

std::vector< std::unique_ptr< SeedComparitor > > comparitors_
 
bool isAnd_
 

Detailed Description

Definition at line 9 of file CombinedSeedComparitor.cc.

Constructor & Destructor Documentation

◆ CombinedSeedComparitor()

CombinedSeedComparitor::CombinedSeedComparitor ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)

Definition at line 25 of file CombinedSeedComparitor.cc.

25  {
26  std::string mode = cfg.getParameter<std::string>("mode");
27  if (mode == "and")
28  isAnd_ = true;
29  else if (mode == "or")
30  isAnd_ = false;
31  else
32  throw cms::Exception("Configuration", "Parameter 'mode' of CombinedSeedComparitor must be either 'and' or 'or'\n");
33 
34  typedef std::vector<edm::ParameterSet> VPSet;
35  VPSet psets = cfg.getParameter<VPSet>("comparitors");
36  for (VPSet::const_iterator it = psets.begin(), ed = psets.end(); it != ed; ++it) {
37  std::string name = it->getParameter<std::string>("ComponentName");
38  comparitors_.emplace_back(SeedComparitorFactory::get()->create(name, *it, iC));
39  }
40 }

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 42 of file CombinedSeedComparitor.cc.

42 {}

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  for (const auto &it : comparitors_) {
52  bool pass = it->compatible(hits);
53  if (isAnd_ != pass)
54  return pass; // break on failures if doing an AND, and on successes if doing an OR
55  }
56  return isAnd_; // if we arrive here, we have no successes for OR, and no failures for AND
57 }

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 69 of file CombinedSeedComparitor.cc.

71  {
72  for (const auto &it : comparitors_) {
73  bool pass = it->compatible(hits, helixStateAtVertex, helix);
74  if (isAnd_ != pass)
75  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 }

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 59 of file CombinedSeedComparitor.cc.

60  {
61  for (const auto &it : comparitors_) {
62  bool pass = it->compatible(tsos, hit);
63  if (isAnd_ != pass)
64  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 }

References comparitors_, and isAnd_.

◆ init()

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

Implements SeedComparitor.

Definition at line 44 of file CombinedSeedComparitor.cc.

44  {
45  for (const auto &it : comparitors_) {
46  it->init(ev, es);
47  }
48 }

References comparitors_, and ev.

Member Data Documentation

◆ comparitors_

std::vector<std::unique_ptr<SeedComparitor> > CombinedSeedComparitor::comparitors_
private

Definition at line 21 of file CombinedSeedComparitor.cc.

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

◆ isAnd_

bool CombinedSeedComparitor::isAnd_
private

Definition at line 22 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
CombinedSeedComparitor::comparitors_
std::vector< std::unique_ptr< SeedComparitor > > comparitors_
Definition: CombinedSeedComparitor.cc:21
get
#define get
looper.cfg
cfg
Definition: looper.py:297
CombinedSeedComparitor::isAnd_
bool isAnd_
Definition: CombinedSeedComparitor.cc:22
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