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

static const StringFunctionMap functionTable
 

Private Attributes

const DetId_detId
 
const TrackerTopology_trackerTopology
 

Detailed Description

Definition at line 100 of file TrackerDetIdSelector.h.

Member Typedef Documentation

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

Definition at line 106 of file TrackerDetIdSelector.h.

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

Definition at line 107 of file TrackerDetIdSelector.h.

Constructor & Destructor Documentation

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

Definition at line 110 of file TrackerDetIdSelector.h.

References trigObjTnPSource_cfi::selectionStr, and AlCaHLTBitMon_QueryRunRegistry::string.

111  : _detId(detId), _trackerTopology(trackerTopology) {}
const TrackerTopology & _trackerTopology

Member Function Documentation

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

Definition at line 255 of file TrackerDetIdSelector.h.

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

Referenced by TrackingRecHitProducer::setupDetIdPipes().

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 }
const TrackerTopology & _trackerTopology
int evaluate(const DetId &detId, const TrackerTopology &trackerTopology) const
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32

Member Data Documentation

const DetId& TrackerDetIdSelector::_detId
private

Definition at line 102 of file TrackerDetIdSelector.h.

const TrackerTopology& TrackerDetIdSelector::_trackerTopology
private

Definition at line 103 of file TrackerDetIdSelector.h.

const TrackerDetIdSelector::StringFunctionMap TrackerDetIdSelector::functionTable
static

Definition at line 108 of file TrackerDetIdSelector.h.

Referenced by Accessor::operator()().