CMS 3D CMS Logo

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 222 of file DDPartSelection.cc.

References full, DDI::Singleton< I >::instance(), dumpparser::parse(), createfilelist::parser, and mps_fire::result.

Referenced by DDI::Specific::createPartSelections(), and DDPartSelection::DDPartSelection().

223 {
224  static SpecParParser parser;
226  bool result = parse(sel.c_str(), parser).full;
227  if (!result) {
228  edm::LogError("DDPartSelection") << "DDTokenize2() error in parsing of " << sel << std::endl;
229  }
230 }
static value_type & instance()
Definition: GenABIO.cc:180
def parse(path, config)
Definition: dumpparser.py:13
std::ostream & operator<< ( std::ostream &  ,
const DDPartSelection  
)

Definition at line 232 of file DDPartSelection.cc.

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

Referenced by DDPartSelection::DDPartSelection().

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

Definition at line 257 of file DDPartSelection.cc.

References findQualityFiles::v.

258 {
259  std::vector<DDPartSelection>::const_iterator it(v.begin()), ed(v.end());
260  for (; it != (ed-1); ++it) {
261  os << *it << std::endl;
262  }
263  if ( it != ed ) {
264  ++it;
265  os << *it;
266  }
267  return os;
268 }