CMS 3D CMS Logo

Classes | Enumerations | Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DetectorDescription/Core/interface/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.

                      { ddunknown,   //   ->    (should never appear!)
                        ddanynode,   //   ->    //*
                        ddanychild,  //   ->    /*
                        ddanylogp,   //   ->    //NameOfLogicalPart
                        ddanyposp,   //   ->    //NameOfLogicalPart[copyno]
                        ddchildlogp, //   ->    /NameOfLogicalPart
                        ddchildposp  //   ->    /NameOfLogicalPart[copyno]
                       };

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

{
  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;
  }
}
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_.

{
  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 &  ,
const std::vector< DDPartSelection > &   
)

Definition at line 262 of file DDPartSelection.cc.

References findQualityFiles::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;
}