CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes
WalkAST Struct Reference

#include <TrackerDetIdSelector.h>

Public Types

typedef void result_type
 

Public Member Functions

void operator() () const
 
void operator() (int n) const
 
void operator() (std::string str) const
 
void operator() (ExpressionAST const &ast) const
 
void operator() (BinaryOP const &expr) const
 
void operator() (UnaryOP const &expr) const
 
 WalkAST (const DetId &detId, const TrackerTopology &trackerTopology)
 

Public Attributes

Accessor _acc
 

Detailed Description

Definition at line 170 of file TrackerDetIdSelector.h.

Member Typedef Documentation

◆ result_type

typedef void WalkAST::result_type

Definition at line 175 of file TrackerDetIdSelector.h.

Constructor & Destructor Documentation

◆ WalkAST()

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

Definition at line 173 of file TrackerDetIdSelector.h.

173 : _acc(detId, trackerTopology) {}

Member Function Documentation

◆ operator()() [1/6]

void WalkAST::operator() ( ) const
inline

Definition at line 177 of file TrackerDetIdSelector.h.

177 {}

◆ operator()() [2/6]

void WalkAST::operator() ( int  n) const
inline

Definition at line 178 of file TrackerDetIdSelector.h.

References _acc, gather_cfg::cout, and dqmiodumpmetadata::n.

178  {
179  std::cout << n;
180  std::cout << " [" << _acc(n) << "] ";
181  }

◆ operator()() [3/6]

void WalkAST::operator() ( std::string  str) const
inline

Definition at line 182 of file TrackerDetIdSelector.h.

References _acc, gather_cfg::cout, and str.

182  {
183  std::cout << str;
184  std::cout << " [" << _acc(str) << "] ";
185  }
#define str(s)

◆ operator()() [4/6]

void WalkAST::operator() ( ExpressionAST const &  ast) const
inline

Definition at line 186 of file TrackerDetIdSelector.h.

References _acc, gather_cfg::cout, and ExpressionAST::expr.

186  {
187  boost::apply_visitor(*this, ast.expr);
188  std::cout << " [=" << _acc(ast) << "] ";
189  }

◆ operator()() [5/6]

void WalkAST::operator() ( BinaryOP const &  expr) const
inline

Definition at line 191 of file TrackerDetIdSelector.h.

References BinaryOP::AND, gather_cfg::cout, BinaryOP::EQUAL, ExpressionAST::expr, BinaryOP::GREATER, BinaryOP::GREATER_EQUAL, BinaryOP::left, BinaryOP::LESS, BinaryOP::LESS_EQUAL, BinaryOP::NOT_EQUAL, BinaryOP::op, BinaryOP::OR, and BinaryOP::right.

191  {
192  std::cout << "(";
193  boost::apply_visitor(*this, expr.left.expr);
194  switch (expr.op) {
196  std::cout << " > ";
197  break;
199  std::cout << " >= ";
200  break;
201  case BinaryOP::OP::EQUAL:
202  std::cout << " == ";
203  break;
205  std::cout << " <= ";
206  break;
207  case BinaryOP::OP::LESS:
208  std::cout << " < ";
209  break;
211  std::cout << " != ";
212  break;
213  case BinaryOP::OP::AND:
214  std::cout << " && ";
215  break;
216  case BinaryOP::OP::OR:
217  std::cout << " || ";
218  break;
219  }
220  boost::apply_visitor(*this, expr.right.expr);
221  std::cout << ')';
222  }

◆ operator()() [6/6]

void WalkAST::operator() ( UnaryOP const &  expr) const
inline

Definition at line 224 of file TrackerDetIdSelector.h.

References gather_cfg::cout, ExpressionAST::expr, UnaryOP::NEG, UnaryOP::op, and UnaryOP::subject.

224  {
225  switch (expr.op) {
226  case UnaryOP::OP::NEG:
227  std::cout << " !(";
228  break;
229  }
230  boost::apply_visitor(*this, expr.subject.expr);
231  std::cout << ')';
232  }

Member Data Documentation

◆ _acc

Accessor WalkAST::_acc

Definition at line 171 of file TrackerDetIdSelector.h.

Referenced by operator()().