CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 (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 134 of file TrackerDetIdSelector.h.

Member Typedef Documentation

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

Definition at line 141 of file TrackerDetIdSelector.h.

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

Definition at line 142 of file TrackerDetIdSelector.h.

Constructor & Destructor Documentation

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

Definition at line 145 of file TrackerDetIdSelector.h.

145  :
146  _detId(detId),
147  _trackerTopology(trackerTopology)
148  {
149  }
const TrackerTopology & _trackerTopology

Member Function Documentation

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

Definition at line 347 of file TrackerDetIdSelector.h.

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

Referenced by TrackingRecHitProducer::setupDetIdPipes().

348 {
349  std::string::const_iterator begin = selectionStr.cbegin();
350  std::string::const_iterator end = selectionStr.cend();
351 
352 
354  ExpressionAST exprAST;
355 
356  bool success = boost::spirit::qi::phrase_parse(begin,end, grammar, boost::spirit::ascii::space, exprAST);
357  if (begin!=end)
358  {
359  throw cms::Exception("FastSimulation/TrackingRecHitProducer/TrackerDetIdSelector",
360  "parsing selection '"+selectionStr+"' failed at "+std::string(selectionStr.cbegin(), begin)+"^^^"+std::string(begin, end));
361  }
362  if (!success)
363  {
364  throw cms::Exception("FastSimulation/TrackingRecHitProducer/TrackerDetIdSelector","parsing selection '"+selectionStr+"' failed.");
365  }
366  /* Comment out for debugging
367  WalkAST walker(_detId,_trackerTopology);
368  walker(exprAST);
369  std::cout<<std::endl;
370  */
371  return exprAST.evaluate(_detId,_trackerTopology);
372 
373 }
const TrackerTopology & _trackerTopology
int evaluate(const DetId &detId, const TrackerTopology &trackerTopology) const
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30

Member Data Documentation

const DetId& TrackerDetIdSelector::_detId
private

Definition at line 137 of file TrackerDetIdSelector.h.

Referenced by passSelection().

const TrackerTopology& TrackerDetIdSelector::_trackerTopology
private

Definition at line 138 of file TrackerDetIdSelector.h.

Referenced by passSelection().

const TrackerDetIdSelector::StringFunctionMap TrackerDetIdSelector::functionTable
static

Definition at line 143 of file TrackerDetIdSelector.h.

Referenced by Accessor::operator()().