CMS 3D CMS Logo

DDScope Class Reference

defines subtrees in the expanded-view More...

#include <DetectorDescription/Core/interface/DDScope.h>

List of all members.

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.
 DDScope (const DDGeoHistory &, int depth=0)
 scope with a single subtree
 DDScope ()
 empty scope
int depth () const
 return the depth to wich the subtrees are restricted
const scope_typescope () const
 returns the scope container
void setDepth (int)
 subtrees of the scope are only transversed down to the given level
 ~DDScope ()

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 26 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 (  ) 

empty scope

Definition at line 37 of file DDScope.cc.

00037 { }

DDScope::DDScope ( const DDGeoHistory h,
int  depth = 0 
)

scope with a single subtree

Definition at line 40 of file DDScope.cc.

References subtrees_.

00041  : depth_(depth)
00042 {
00043   subtrees_.push_back(h);
00044 }

DDScope::~DDScope (  ) 

Definition at line 47 of file DDScope.cc.

00048 { }


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 51 of file DDScope.cc.

References classify_, different_branch, it, HLT_VtxMuL3::result, subtree, subtrees_, and supertree.

00052 {
00053    bool result = false;
00054    //DCOUT('S',"DDScope::addScope()" << h);
00055    scope_type::iterator it = subtrees_.begin();
00056    scope_type buf;
00057    int supertreeCount = 0;
00058    bool diffBranch = false;
00059    bool subTree = false;
00060    //DDGeoHistory::size_type pos = subtree_.size();
00061    
00062    for(; it != subtrees_.end(); ++it) {
00063      dd_scope_class classification = classify_(h,*it);
00064      switch (classification) {
00065      
00066      case different_branch:
00067        buf.push_back(*it);
00068        diffBranch=true;
00069        //buf.push_back(h);
00070        //DCOUT('S',"  ->different_branch");
00071        break;
00072      
00073      case subtree:
00074        buf.push_back(*it);
00075        subTree = true;
00076        //DCOUT('S',"  ->subtree");
00077        break;
00078      
00079      case supertree:
00080        //buf.push_back(h);   
00081        ++supertreeCount;
00082        if (supertreeCount==1)
00083          buf.push_back(h);
00084        //DCOUT('S',"  ->supertree");
00085        break;
00086        
00087      default:
00088       ;  
00089      }
00090    }
00091    
00092    if (diffBranch) {
00093      if (subTree==false) {
00094        buf.push_back(h);
00095      }  
00096    }
00097    
00098    if (!subtrees_.size()) 
00099      subtrees_.push_back(h);
00100    else  
00101      subtrees_ = buf;
00102    
00103    //DCOUT('S',"DDScope.size()=" << subtrees_.size() );  
00104    return result;
00105 }

int DDScope::depth (  )  const

return the depth to wich the subtrees are restricted

Definition at line 114 of file DDScope.cc.

References depth_.

Referenced by DDQuery::exec().

00115 {
00116   return depth_;
00117 }

const DDScope::scope_type & DDScope::scope (  )  const

returns the scope container

Definition at line 120 of file DDScope.cc.

References subtrees_.

Referenced by DDQuery::exec().

00121 {
00122    return subtrees_;
00123 }

void DDScope::setDepth ( int  d  ) 

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

Definition at line 108 of file DDScope.cc.

References depth_.

00109 {
00110   depth_ = d;
00111 }


Friends And Related Function Documentation

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

Definition at line 125 of file DDScope.cc.

00126 {
00127    DDScope::scope_type::const_iterator it = scope.subtrees_.begin();
00128    for (; it!=scope.subtrees_.end(); ++ it) {
00129      os << *it << std::endl;
00130    }
00131    return os;
00132 }


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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:12 2009 for CMSSW by  doxygen 1.5.4