CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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, DetIdFunction
StringFunctionMap
 

Public Member Functions

bool passSelection (const 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 118 of file TrackerDetIdSelector.h.

Member Typedef Documentation

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

Definition at line 124 of file TrackerDetIdSelector.h.

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

Definition at line 125 of file TrackerDetIdSelector.h.

Constructor & Destructor Documentation

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

Definition at line 128 of file TrackerDetIdSelector.h.

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

Member Function Documentation

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

Definition at line 160 of file TrackerDetIdSelector.cc.

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

Referenced by TrackingRecHitProducer::setupDetIdPipes().

160  {
161  std::string::const_iterator begin = selectionStr.cbegin();
162  std::string::const_iterator end = selectionStr.cend();
163 
165  ExpressionAST exprAST;
166 
167  bool success = boost::spirit::qi::phrase_parse(begin, end, grammar, boost::spirit::ascii::space, exprAST);
168  if (begin != end) {
169  throw cms::Exception("FastSimulation/TrackingRecHitProducer/TrackerDetIdSelector",
170  "parsing selection '" + selectionStr + "' failed at " +
171  std::string(selectionStr.cbegin(), begin) + "^^^" + std::string(begin, end));
172  }
173  if (!success) {
174  throw cms::Exception("FastSimulation/TrackingRecHitProducer/TrackerDetIdSelector",
175  "parsing selection '" + selectionStr + "' failed.");
176  }
177  /* Comment out for debugging
178  WalkAST walker(_detId,_trackerTopology);
179  walker(exprAST);
180  std::cout<<std::endl;
181  */
182  return exprAST.evaluate(_detId, _trackerTopology);
183 }
const TrackerTopology & _trackerTopology
int evaluate(const DetId &detId, const TrackerTopology &trackerTopology) const
string end
Definition: dataset.py:937

Member Data Documentation

const DetId& TrackerDetIdSelector::_detId
private

Definition at line 120 of file TrackerDetIdSelector.h.

Referenced by passSelection().

const TrackerTopology& TrackerDetIdSelector::_trackerTopology
private

Definition at line 121 of file TrackerDetIdSelector.h.

Referenced by passSelection().

const TrackerDetIdSelector::StringFunctionMap TrackerDetIdSelector::functionTable
static

Definition at line 126 of file TrackerDetIdSelector.h.

Referenced by Accessor::operator()().