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 TrajectoryStateOnSurface &, SeedingHitSet::ConstRecHitPointer hit) const override
 
bool compatible (const SeedingHitSet &hits, const GlobalTrajectoryParameters &helixStateAtVertex, const FastHelix &helix) 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.

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

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 }
def create(alignables, pedeDump, additionalData, outputFile, config)
std::vector< std::unique_ptr< SeedComparitor > > comparitors_
#define get

◆ ~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.

References comparitors_, hfClusterShapes_cfi::hits, isAnd_, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

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 }
std::vector< std::unique_ptr< SeedComparitor > > comparitors_

◆ compatible() [2/3]

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

Implements SeedComparitor.

Definition at line 59 of file CombinedSeedComparitor.cc.

References comparitors_, isAnd_, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

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 }
std::vector< std::unique_ptr< SeedComparitor > > comparitors_

◆ compatible() [3/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.

References comparitors_, hfClusterShapes_cfi::hits, isAnd_, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

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 }
std::vector< std::unique_ptr< SeedComparitor > > comparitors_

◆ init()

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

Implements SeedComparitor.

Definition at line 44 of file CombinedSeedComparitor.cc.

References comparitors_, makeMEIFBenchmarkPlots::ev, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

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

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().