00001 #ifndef DDCore_DDScope_h 00002 #define DDCore_DDScope_h 00003 00004 #include <vector> 00005 #include "DetectorDescription/Core/interface/DDExpandedNode.h" 00006 00007 enum dd_scope_class { different_branch, subtree, supertree, delete_action }; 00008 00010 00017 struct DDScopeClassification 00018 { 00019 dd_scope_class operator()(const DDGeoHistory & ,const DDGeoHistory &) const; 00020 }; 00021 00023 00026 class DDScope 00027 { 00028 friend std::ostream & operator<<(std::ostream &, const DDScope &); 00029 00030 public: 00031 typedef std::vector<DDGeoHistory> scope_type; 00032 00034 DDScope(); 00035 00037 DDScope(const DDGeoHistory &, int depth=0); 00038 00039 ~DDScope(); 00040 00042 00045 bool addScope(const DDGeoHistory & s); 00046 00048 void setDepth(int); 00049 00051 int depth() const; 00052 00054 const scope_type & scope() const; 00055 00056 protected: 00057 scope_type subtrees_; 00058 DDScopeClassification classify_; 00059 int depth_; 00060 }; 00061 00062 std::ostream & operator<<(std::ostream &, const DDScope &); 00063 00065 00070 /* 00071 struct DDGeoHistoryCompare 00072 { 00073 bool operator()(const DDGeoHistory & left ,const DDGeoHistory & right) const 00074 { 00075 bool result=false; 00076 DDGeoHistory::const_iterator lit = left.begin(); 00077 DDGeoHistory::const_iterator rit = right.begin(); 00078 while(lit != left.end() && rit!=right.end()) { 00079 result |= less_(*lit,*rit); 00080 ++lit; 00081 ++rit; 00082 } 00083 return result; 00084 } 00085 DDExpandedNodeLess less_; 00086 }; 00087 */ 00088 00089 00090 00091 #endif