Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:24

0001 #ifndef DDPartSelection_h
0002 #define DDPartSelection_h
0003 
0004 #include <vector>
0005 #include <string>
0006 #include <iostream>
0007 #include "DetectorDescription/Core/interface/DDLogicalPart.h"
0008 
0009 class DDLogicalPart;
0010 
0011 enum ddselection_type {
0012   ddunknown,    //   ->    (should never appear!)
0013   ddanynode,    //   ->    //*
0014   ddanychild,   //   ->    /*
0015   ddanylogp,    //   ->    //NameOfLogicalPart
0016   ddanyposp,    //   ->    //NameOfLogicalPart[copyno]
0017   ddchildlogp,  //   ->    /NameOfLogicalPart
0018   ddchildposp   //   ->    /NameOfLogicalPart[copyno]
0019 };
0020 
0021 struct DDPartSelRegExpLevel {
0022   DDPartSelRegExpLevel(const std::string &ns, const std::string &nm, int cpn, ddselection_type t, bool isRegex = false)
0023       : ns_(ns), nm_(nm), copyno_(cpn), selectionType_(t), isRegex_(isRegex) {}
0024   std::string ns_, nm_;
0025   int copyno_;
0026   ddselection_type selectionType_;
0027   bool isRegex_;
0028 };
0029 
0030 struct DDPartSelectionLevel {
0031   DDPartSelectionLevel(const DDLogicalPart &, int, ddselection_type);
0032   DDLogicalPart lp_;
0033   int copyno_;
0034   ddselection_type selectionType_;
0035 };
0036 
0037 class DDPartSelection : public std::vector<DDPartSelectionLevel> {
0038 public:
0039   DDPartSelection() : std::vector<DDPartSelectionLevel>() {}
0040 };
0041 
0042 std::ostream &operator<<(std::ostream &, const DDPartSelection &);
0043 std::ostream &operator<<(std::ostream &, const std::vector<DDPartSelection> &);
0044 
0045 void DDTokenize2(const std::string &selectionString, std::vector<DDPartSelRegExpLevel> &result);
0046 std::ostream &operator<<(std::ostream &, const DDPartSelection &);
0047 
0048 #endif