CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Accessor Class Reference

#include <TrackerDetIdSelector.h>

Inheritance diagram for Accessor:

Public Member Functions

 Accessor (const DetId &detId, const TrackerTopology &trackerTopology)
 
int operator() (Nil i) const
 
int operator() (const int &i) const
 
int operator() (const std::string &s) const
 
int operator() (const ExpressionAST &ast) const
 
int operator() (const BinaryOP &binaryOP) const
 
int operator() (const UnaryOP &unaryOP) const
 

Private Attributes

const DetId_detId
 
const TrackerTopology_trackerTopology
 

Detailed Description

Definition at line 154 of file TrackerDetIdSelector.h.

Constructor & Destructor Documentation

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

Definition at line 161 of file TrackerDetIdSelector.h.

161  :
162  _detId(detId),
163  _trackerTopology(trackerTopology)
164  {
165  }
const DetId & _detId
const TrackerTopology & _trackerTopology

Member Function Documentation

int Accessor::operator() ( Nil  i) const
inline

Definition at line 167 of file TrackerDetIdSelector.h.

References Exception.

168  {
169  throw cms::Exception("FastSimulation/TrackingRecHitProducer/TrackerDetIdSelector","while evaluating a DetId selection a symbol was not set");
170  }
int Accessor::operator() ( const int &  i) const
inline

Definition at line 171 of file TrackerDetIdSelector.h.

References mps_fire::i.

172  {
173  return i;
174  }
int Accessor::operator() ( const std::string &  s) const
inline

Definition at line 175 of file TrackerDetIdSelector.h.

References Exception, TrackerDetIdSelector::functionTable, mps_check::msg, AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

176  {
177  TrackerDetIdSelector::StringFunctionMap::const_iterator it = TrackerDetIdSelector::functionTable.find(s);
178  int value = 0;
179  if (it != TrackerDetIdSelector::functionTable.cend())
180  {
181  value = (it->second)(_trackerTopology,_detId);
182  //std::cout<<"attr="<<s<<", value="<<value<<std::endl;
183  }
184  else
185  {
186  //std::cout<<"attr="<<s<<" unknown"<<std::endl;
187  std::string msg = "error while parsing DetId selection: named identifier '"+s+"' not known. Possible values are: ";
189  {
190  msg+=pair.first+",";
191  }
192  throw cms::Exception("FastSimulation/TrackingRecHitProducer/TrackerDetIdSelector",msg);
193  }
194  return value;
195  }
static const StringFunctionMap functionTable
const DetId & _detId
Definition: value.py:1
tuple msg
Definition: mps_check.py:278
const TrackerTopology & _trackerTopology
int Accessor::operator() ( const ExpressionAST ast) const
inline

Definition at line 196 of file TrackerDetIdSelector.h.

References ExpressionAST::evaluate().

197  {
198  return ast.evaluate(_detId,_trackerTopology);
199  }
const DetId & _detId
int evaluate(const DetId &detId, const TrackerTopology &trackerTopology) const
const TrackerTopology & _trackerTopology
int Accessor::operator() ( const BinaryOP binaryOP) const
inline

Definition at line 200 of file TrackerDetIdSelector.h.

References BinaryOP::evaluate().

201  {
202  return binaryOP.evaluate(_detId,_trackerTopology);
203  }
const DetId & _detId
int evaluate(const DetId &detId, const TrackerTopology &trackerTopology) const
const TrackerTopology & _trackerTopology
int Accessor::operator() ( const UnaryOP unaryOP) const
inline

Definition at line 204 of file TrackerDetIdSelector.h.

References UnaryOP::evaluate().

205  {
206  return unaryOP.evaluate(_detId,_trackerTopology);
207  }
const DetId & _detId
const TrackerTopology & _trackerTopology
int evaluate(const DetId &detId, const TrackerTopology &trackerTopology) const

Member Data Documentation

const DetId& Accessor::_detId
private

Definition at line 158 of file TrackerDetIdSelector.h.

const TrackerTopology& Accessor::_trackerTopology
private

Definition at line 159 of file TrackerDetIdSelector.h.