CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes | Friends
DDScope Class Reference

defines subtrees in the expanded-view More...

#include <DDScope.h>

Public Types

typedef std::vector< DDGeoHistoryscope_type
 

Public Member Functions

bool addScope (const DDGeoHistory &s)
 Adds a scope. No new scope will be added if s is already contained in one of the subtrees. More...
 
 DDScope (void)
 empty scope More...
 
 DDScope (const DDGeoHistory &, int depth=0)
 scope with a single subtree More...
 
int depth (void) const
 return the depth to wich the subtrees are restricted More...
 
const scope_typescope (void) const
 returns the scope container More...
 
void setDepth (int)
 subtrees of the scope are only transversed down to the given level More...
 
 ~DDScope (void)
 

Protected Attributes

DDScopeClassification classify_
 
int depth_
 
scope_type subtrees_
 

Friends

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

Detailed Description

defines subtrees in the expanded-view

One scope is defined by a set of DDGeoHistory.

Definition at line 27 of file DDScope.h.

Member Typedef Documentation

typedef std::vector<DDGeoHistory> DDScope::scope_type

Definition at line 31 of file DDScope.h.

Constructor & Destructor Documentation

DDScope::DDScope ( void  )

empty scope

Definition at line 29 of file DDScope.cc.

29 : depth_(0) {}
int depth_
Definition: DDScope.h:59
DDScope::DDScope ( const DDGeoHistory h,
int  depth = 0 
)

scope with a single subtree

Definition at line 31 of file DDScope.cc.

References subtrees_.

31 : depth_(depth) { subtrees_.emplace_back(h); }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
scope_type subtrees_
Definition: DDScope.h:57
int depth(void) const
return the depth to wich the subtrees are restricted
Definition: DDScope.cc:83
int depth_
Definition: DDScope.h:59
DDScope::~DDScope ( void  )

Definition at line 33 of file DDScope.cc.

33 {}

Member Function Documentation

bool DDScope::addScope ( const DDGeoHistory s)

Adds a scope. No new scope will be added if s is already contained in one of the subtrees.

returns true, if scope has changed, else false.

Definition at line 35 of file DDScope.cc.

References classify_, different_branch, mps_fire::result, subtree, subtrees_, and supertree.

35  {
36  bool result = false;
37  scope_type::iterator it = subtrees_.begin();
38  scope_type buf;
39  int supertreeCount = 0;
40  bool diffBranch = false;
41  bool subTree = false;
42 
43  for (; it != subtrees_.end(); ++it) {
44  dd_scope_class classification = classify_(h, *it);
45  switch (classification) {
46  case different_branch:
47  buf.emplace_back(*it);
48  diffBranch = true;
49  break;
50 
51  case subtree:
52  buf.emplace_back(*it);
53  subTree = true;
54  break;
55 
56  case supertree:
57  ++supertreeCount;
58  if (supertreeCount == 1)
59  buf.emplace_back(h);
60  break;
61 
62  default:
63  break;
64  }
65  }
66 
67  if (diffBranch) {
68  if (subTree == false) {
69  buf.emplace_back(h);
70  }
71  }
72 
73  if (subtrees_.empty())
74  subtrees_.emplace_back(h);
75  else
76  subtrees_ = buf;
77 
78  return result;
79 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
scope_type subtrees_
Definition: DDScope.h:57
dd_scope_class
Definition: DDScope.h:9
DDScopeClassification classify_
Definition: DDScope.h:58
std::vector< DDGeoHistory > scope_type
Definition: DDScope.h:31
Definition: DDScope.h:9
int DDScope::depth ( void  ) const

return the depth to wich the subtrees are restricted

Definition at line 83 of file DDScope.cc.

References depth_.

83 { return depth_; }
int depth_
Definition: DDScope.h:59
const DDScope::scope_type & DDScope::scope ( void  ) const

returns the scope container

Definition at line 85 of file DDScope.cc.

References subtrees_.

85 { return subtrees_; }
scope_type subtrees_
Definition: DDScope.h:57
void DDScope::setDepth ( int  d)

subtrees of the scope are only transversed down to the given level

Definition at line 81 of file DDScope.cc.

References ztail::d, and depth_.

81 { depth_ = d; }
d
Definition: ztail.py:151
int depth_
Definition: DDScope.h:59

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const DDScope scope 
)
friend

Definition at line 87 of file DDScope.cc.

87  {
88  DDScope::scope_type::const_iterator it = scope.subtrees_.begin();
89  for (; it != scope.subtrees_.end(); ++it) {
90  os << *it << std::endl;
91  }
92  return os;
93 }
scope_type subtrees_
Definition: DDScope.h:57

Member Data Documentation

DDScopeClassification DDScope::classify_
protected

Definition at line 58 of file DDScope.h.

Referenced by addScope().

int DDScope::depth_
protected

Definition at line 59 of file DDScope.h.

Referenced by depth(), and setDepth().

scope_type DDScope::subtrees_
protected

Definition at line 57 of file DDScope.h.

Referenced by addScope(), DDScope(), operator<<(), and scope().