DDPartSelRegExpLevel

DDPartSelection

DDPartSelectionLevel

ddselection_type

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#ifndef DDPartSelection_h
#define DDPartSelection_h

#include <vector>
#include <string>
#include <iostream>
#include "DetectorDescription/Core/interface/DDLogicalPart.h"

class DDLogicalPart;

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

struct DDPartSelRegExpLevel {
  DDPartSelRegExpLevel(const std::string &ns, const std::string &nm, int cpn, ddselection_type t, bool isRegex = false)
      : ns_(ns), nm_(nm), copyno_(cpn), selectionType_(t), isRegex_(isRegex) {}
  std::string ns_, nm_;
  int copyno_;
  ddselection_type selectionType_;
  bool isRegex_;
};

struct DDPartSelectionLevel {
  DDPartSelectionLevel(const DDLogicalPart &, int, ddselection_type);
  DDLogicalPart lp_;
  int copyno_;
  ddselection_type selectionType_;
};

class DDPartSelection : public std::vector<DDPartSelectionLevel> {
public:
  DDPartSelection() : std::vector<DDPartSelectionLevel>() {}
};

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

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

#endif