CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Enumerations | Functions
DDPartSelection.h File Reference
#include <vector>
#include <string>
#include <iostream>
#include "DetectorDescription/Core/interface/DDLogicalPart.h"

Go to the source code of this file.

Classes

class  DDPartSelection
 
struct  DDPartSelectionLevel
 
struct  DDPartSelRegExpLevel
 

Enumerations

enum  ddselection_type {
  ddunknown, ddanynode, ddanychild, ddanylogp,
  ddanyposp, ddchildlogp, ddchildposp
}
 

Functions

void DDTokenize2 (const std::string &selectionString, std::vector< DDPartSelRegExpLevel > &result)
 
std::ostream & operator<< (std::ostream &, const DDPartSelection &)
 
std::ostream & operator<< (std::ostream &, const std::vector< DDPartSelection > &)
 

Enumeration Type Documentation

Enumerator
ddunknown 
ddanynode 
ddanychild 
ddanylogp 
ddanyposp 
ddchildlogp 
ddchildposp 

Definition at line 11 of file DDPartSelection.h.

11  { ddunknown, // -> (should never appear!)
12  ddanynode, // -> //*
13  ddanychild, // -> /*
14  ddanylogp, // -> //NameOfLogicalPart
15  ddanyposp, // -> //NameOfLogicalPart[copyno]
16  ddchildlogp, // -> /NameOfLogicalPart
17  ddchildposp // -> /NameOfLogicalPart[copyno]
18  };

Function Documentation

void DDTokenize2 ( const std::string &  selectionString,
std::vector< DDPartSelRegExpLevel > &  result 
)

Definition at line 227 of file DDPartSelection.cc.

References full, DDI::Singleton< I >::instance(), triggerExpression::parse(), geometryXMLtoCSV::parser, and query::result.

Referenced by DDI::Specific::createPartSelections().

228 {
229  static SpecParParser parser;
231  bool result = parse(sel.c_str(), parser).full;
232  if (!result) {
233  edm::LogError("DDPartSelection") << "DDTokenize2() error in parsing of " << sel << std::endl;
234  }
235 }
Evaluator * parse(const T &text)
static value_type & instance()
tuple path
else: Piece not in the list, fine.
tuple result
Definition: query.py:137
Definition: GenABIO.cc:180
std::ostream & operator<< ( std::ostream &  ,
const DDPartSelection  
)

Definition at line 237 of file DDPartSelection.cc.

References DDPartSelectionLevel::copyno_, ddanylogp, ddanyposp, ddchildlogp, ddchildposp, DDBase< N, C >::ddname(), DDPartSelectionLevel::lp_, python.connectstrParser::o, and DDPartSelectionLevel::selectionType_.

238 {
239  DDPartSelection::const_iterator it(p.begin()), ed(p.end());
240  for (; it != ed; ++it) {
241  const DDPartSelectionLevel lv =*it;
242  switch (lv.selectionType_) {
243  case ddanylogp:
244  o << "//" << lv.lp_.ddname();
245  break;
246  case ddanyposp:
247  o << "//" << lv.lp_.ddname() << '[' << lv.copyno_ << ']';
248  break;
249  case ddchildlogp:
250  o << "/" << lv.lp_.ddname();
251  break;
252  case ddchildposp:
253  o << "/" << lv.lp_.ddname() << '[' << lv.copyno_ << ']';
254  break;
255  default:
256  o << "{Syntax ERROR}";
257  }
258  }
259  return o;
260 }
ddselection_type selectionType_
const N & ddname() const
Definition: DDBase.h:80
std::ostream& operator<< ( std::ostream &  ,
const std::vector< DDPartSelection > &   
)

Definition at line 262 of file DDPartSelection.cc.

References findQualityFiles::v.

263 {
264  std::vector<DDPartSelection>::const_iterator it(v.begin()), ed(v.end());
265  for (; it != (ed-1); ++it) {
266  os << *it << std::endl;
267  }
268  if ( it != ed ) {
269  ++it;
270  os << *it;
271  }
272  return os;
273 }