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

◆ ddselection_type

Enumerator
ddunknown 
ddanynode 
ddanychild 
ddanylogp 
ddanyposp 
ddchildlogp 
ddchildposp 

Definition at line 11 of file DDPartSelection.h.

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

Function Documentation

◆ DDTokenize2()

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

Definition at line 174 of file DDPartSelection.cc.

References full, DDI::Singleton< I >::instance(), parse(), writedatasetfile::parser, EnsembleCalibrationLA_cfg::path, mps_fire::result, and EgammaValidation_Wenu_cff::sel.

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

174  {
175  static SpecParParser parser;
177  bool result = parse(sel.c_str(), parser).full;
178  if (!result) {
179  edm::LogError("DDPartSelection") << "DDTokenize2() error in parsing of " << sel << std::endl;
180  }
181 }
vector< string > parse(string line, const string &delimiter)
Log< level::Error, false > LogError
static value_type & instance()
Definition: GenABIO.cc:168

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream &  ,
const DDPartSelection  
)

Definition at line 183 of file DDPartSelection.cc.

References DDPartSelectionLevel::copyno_, ddanylogp, ddanyposp, ddchildlogp, ddchildposp, DDBase< N, C >::ddname(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, DDPartSelectionLevel::lp_, EcalTangentSkim_cfg::o, AlCaHLTBitMon_ParallelJobs::p, and DDPartSelectionLevel::selectionType_.

183  {
184  DDPartSelection::const_iterator it(p.begin()), ed(p.end());
185  for (; it != ed; ++it) {
186  const DDPartSelectionLevel& lv = *it;
187  switch (lv.selectionType_) {
188  case ddanylogp:
189  o << "//" << lv.lp_.ddname();
190  break;
191  case ddanyposp:
192  o << "//" << lv.lp_.ddname() << '[' << lv.copyno_ << ']';
193  break;
194  case ddchildlogp:
195  o << "/" << lv.lp_.ddname();
196  break;
197  case ddchildposp:
198  o << "/" << lv.lp_.ddname() << '[' << lv.copyno_ << ']';
199  break;
200  default:
201  o << "{Syntax ERROR}";
202  }
203  }
204  return o;
205 }
ddselection_type selectionType_
const N & ddname() const
Definition: DDBase.h:60

◆ operator<<() [2/2]

std::ostream& operator<< ( std::ostream &  ,
const std::vector< DDPartSelection > &   
)

Definition at line 207 of file DDPartSelection.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, l1tGTMenu_BTagSeeds_cff::os, and findQualityFiles::v.

207  {
208  std::vector<DDPartSelection>::const_iterator it(v.begin()), ed(v.end());
209  for (; it != (ed - 1); ++it) {
210  os << *it << std::endl;
211  }
212  if (it != ed) {
213  ++it;
214  os << *it;
215  }
216  return os;
217 }