CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
TrackerDetIdSelector Class Reference

#include <TrackerDetIdSelector.h>

Public Types

typedef std::function< int(const TrackerTopology &trackerTopology, const DetId &)> DetIdFunction
 
typedef std::unordered_map< std::string, DetIdFunctionStringFunctionMap
 

Public Member Functions

bool passSelection (std::string selectionStr) const
 
 TrackerDetIdSelector (const DetId &detId, const TrackerTopology &trackerTopology)
 

Static Public Attributes

const static StringFunctionMap functionTable
 

Private Attributes

const DetId_detId
 
const TrackerTopology_trackerTopology
 

Detailed Description

Definition at line 100 of file TrackerDetIdSelector.h.

Member Typedef Documentation

◆ DetIdFunction

typedef std::function<int(const TrackerTopology& trackerTopology, const DetId&)> TrackerDetIdSelector::DetIdFunction

Definition at line 106 of file TrackerDetIdSelector.h.

◆ StringFunctionMap

typedef std::unordered_map<std::string, DetIdFunction> TrackerDetIdSelector::StringFunctionMap

Definition at line 107 of file TrackerDetIdSelector.h.

Constructor & Destructor Documentation

◆ TrackerDetIdSelector()

TrackerDetIdSelector::TrackerDetIdSelector ( const DetId detId,
const TrackerTopology trackerTopology 
)
inline

Definition at line 110 of file TrackerDetIdSelector.h.

111  : _detId(detId), _trackerTopology(trackerTopology) {}

Member Function Documentation

◆ passSelection()

bool TrackerDetIdSelector::passSelection ( std::string  selectionStr) const

Definition at line 255 of file TrackerDetIdSelector.h.

255  {
256  std::string::const_iterator begin = selectionStr.cbegin();
257  std::string::const_iterator end = selectionStr.cend();
258 
260  ExpressionAST exprAST;
261 
262  bool success = boost::spirit::qi::phrase_parse(begin, end, grammar, boost::spirit::ascii::space, exprAST);
263  if (begin != end) {
264  throw cms::Exception("FastSimulation/TrackingRecHitProducer/TrackerDetIdSelector",
265  "parsing selection '" + selectionStr + "' failed at " +
266  std::string(selectionStr.cbegin(), begin) + "^^^" + std::string(begin, end));
267  }
268  if (!success) {
269  throw cms::Exception("FastSimulation/TrackingRecHitProducer/TrackerDetIdSelector",
270  "parsing selection '" + selectionStr + "' failed.");
271  }
272  /* Comment out for debugging
273  WalkAST walker(_detId,_trackerTopology);
274  walker(exprAST);
275  std::cout<<std::endl;
276  */
277  return exprAST.evaluate(_detId, _trackerTopology);
278 }

References _detId, _trackerTopology, begin, end, ExpressionAST::evaluate(), Exception, trigObjTnPSource_cfi::selectionStr, AlCaHLTBitMon_QueryRunRegistry::string, and summarizeEdmComparisonLogfiles::success.

Referenced by TrackingRecHitProducer::setupDetIdPipes().

Member Data Documentation

◆ _detId

const DetId& TrackerDetIdSelector::_detId
private

Definition at line 102 of file TrackerDetIdSelector.h.

Referenced by passSelection().

◆ _trackerTopology

const TrackerTopology& TrackerDetIdSelector::_trackerTopology
private

Definition at line 103 of file TrackerDetIdSelector.h.

Referenced by passSelection().

◆ functionTable

const TrackerDetIdSelector::StringFunctionMap TrackerDetIdSelector::functionTable
static

Definition at line 108 of file TrackerDetIdSelector.h.

Referenced by Accessor::operator()().

ExpressionAST
Definition: TrackerDetIdSelector.h:26
ExpressionAST::evaluate
int evaluate(const DetId &detId, const TrackerTopology &trackerTopology) const
Definition: TrackerDetIdSelector.h:280
TrackerDetIdSelector::_trackerTopology
const TrackerTopology & _trackerTopology
Definition: TrackerDetIdSelector.h:103
trigObjTnPSource_cfi.selectionStr
selectionStr
Definition: trigObjTnPSource_cfi.py:69
end
#define end
Definition: vmac.h:39
summarizeEdmComparisonLogfiles.success
success
Definition: summarizeEdmComparisonLogfiles.py:115
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Exception
Definition: hltDiff.cc:246
TrackerDetIdSelectorGrammar
Definition: TrackerDetIdSelector.h:218
TrackerDetIdSelector::_detId
const DetId & _detId
Definition: TrackerDetIdSelector.h:102
begin
#define begin
Definition: vmac.h:32