CMS 3D CMS Logo

Classes | Namespaces | Functions

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/DetectorDescription/Core/src/DDPartSelection.cc File Reference

#include "DetectorDescription/Base/interface/Singleton.h"
#include "DetectorDescription/Core/interface/DDPartSelection.h"
#include "DetectorDescription/Base/interface/DDdebug.h"
#include "DetectorDescription/Core/interface/DDSplit.h"
#include "boost/spirit/include/classic.hpp"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <map>
#include <DetectorDescription/Base/interface/Singleton.icc>

Go to the source code of this file.

Classes

struct  DDCopyNoFtor
struct  DDIsChildFtor
struct  DDNameFtor
struct  DDNameSpaceFtor
struct  DDSelLevelCollector
struct  DDSelLevelFtor
struct  SpecParParser::definition< ScannerT >
struct  SpecParParser

Namespaces

namespace  boost
namespace  boost::spirit
namespace  boost::spirit::classic

Functions

void DDTokenize2 (const std::string &sel, std::vector< DDPartSelRegExpLevel > &path)
void noNameSpace (char const *, char const *)
std::ostream & operator<< (std::ostream &o, const DDPartSelection &p)
std::ostream & operator<< (std::ostream &os, const std::vector< DDPartSelection > &v)

Function Documentation

void DDTokenize2 ( const std::string &  sel,
std::vector< DDPartSelRegExpLevel > &  path 
)

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().

{
  static SpecParParser parser;
  DDI::Singleton<DDSelLevelCollector>::instance().path(&path);
  bool result = parse(sel.c_str(), parser).full;
  if (!result) {
    edm::LogError("DDPartSelection") << "DDTokenize2() error in parsing of " << sel << std::endl;
  }
}
void noNameSpace ( char const *  ,
char const *   
)
std::ostream& operator<< ( std::ostream &  o,
const DDPartSelection p 
)

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_.

{
  DDPartSelection::const_iterator it(p.begin()), ed(p.end());
  for (; it != ed; ++it) {
    const DDPartSelectionLevel lv  =*it;
    switch (lv.selectionType_) {
    case ddanylogp:
      o << "//" << lv.lp_.ddname();
      break;
    case ddanyposp:
      o << "//" << lv.lp_.ddname() << '[' << lv.copyno_ << ']';
      break;
    case ddchildlogp:
      o << "/" << lv.lp_.ddname();
      break;
    case ddchildposp:
      o << "/" << lv.lp_.ddname() << '[' << lv.copyno_ << ']';
      break;
    default:
      o << "{Syntax ERROR}";
    }
  }
  return o;
}
std::ostream& operator<< ( std::ostream &  os,
const std::vector< DDPartSelection > &  v 
)

Definition at line 262 of file DDPartSelection.cc.

References v.

{
  std::vector<DDPartSelection>::const_iterator it(v.begin()), ed(v.end());
  for (; it != (ed-1); ++it) {
    os << *it << std::endl;
  }
  if ( it != ed ) {
    ++it;
    os << *it;
  }
  return os;
}