CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Attributes | Private Attributes
DDCompactView Class Reference

type of data representation of DDCompactView More...

#include <DDCompactView.h>

Public Types

typedef ::graph< DDLogicalPart,
DDPosData * > 
graph_type
 not used More...
 
typedef std::vector
< DDLogicalPart
logchild_type
 container-type of children of a given node in the compact-view More...
 
typedef std::pair
< DDLogicalPart, DDPosData * > 
pos_type
 pair ... More...
 
typedef std::vector< std::pair
< DDLogicalPart, DDPosData * > > 
poschildren_type
 container-type of pairs of children nodes and their relative position data of a given node in the compact-view More...
 
typedef graphwalker
< DDLogicalPart, DDPosData * > 
walker_type
 not used More...
 

Public Member Functions

void algoPosPart (const DDLogicalPart &self, const DDLogicalPart &parent, DDAlgo &algo)
 positioning... More...
 
 DDCompactView ()
 Creates a compact-view. More...
 
 DDCompactView (const DDLogicalPart &rootnodedata)
 EXPERIMENTAL! Creates a compact-view using a different root of the geometrical hierarchy More...
 
const graph_typegraph () const
 Provides read-only access to the data structure of the compact-view. More...
 
void lockdown ()
 
void position (const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
 
void position (const DDLogicalPart &self, const DDLogicalPart &parent, int copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
 
const DDLogicalPartroot () const
 returns the DDLogicalPart representing the root of the geometrical hierarchy More...
 
void setRoot (const DDLogicalPart &root)
 don't use : interface not stable .... More...
 
void swap (DDCompactView &)
 
walker_type walker () const
 dont't use ! Proper implementation missing ... More...
 
double weight (const DDLogicalPart &p) const
 Prototype version of calculating the weight of a detector component. More...
 
graph_typewriteableGraph ()
 
 ~DDCompactView ()
 

Protected Attributes

DDCompactViewImplrep_
 

Private Attributes

DDI::Store< DDName,
DDI::LogicalPart * > 
lpStore_
 
DDI::Store< DDName,
DDI::Material * > 
matStore_
 
DDI::Store< DDName,
DDRotationMatrix * > 
rotStore_
 
DDI::Store< DDName, DDI::Solid * > solidStore_
 
DDI::Store< DDName,
DDI::Specific * > 
specStore_
 

Detailed Description

type of data representation of DDCompactView

Navigation through the compact view of the detector ...

Updated: Michael Case [ MEC ] 2010-02-11Compact representation of the geometrical detector hierarchy A DDCompactView represents the detector as an acyclic directed multigraph. The nodes are instances of DDLogicalPart while the edges are pointers to DDPosData. Edges are directed from parent-node to child-node. Edges represented by DDPosData are the relative translation and rotation accompanied by a copy-number of the child-node towards the parent-node.

One node is explicitly marked as the root node. It is the DDLogicalPart which defines the base coordinate system for the detector. All subdetectors are directly or inderectly positioned inside the root-node.

Example:

The figureshows a compact-view graph consisting of 16 DDLogicalParts interconnected by 20 edges represented by pointers to DDPosData.

compact-view.gif

The compact-view also serves as base for calculating nodes in the expanded view. Paths through the compact-view can be viewed as nodes in the expanded-view (expansion of an acyclic directed multigraph into a tree). In the figure there are 5 different paths from CMS to Module2 (e.g. CMS-Pos1->Ecal-Pos4->EEndcap-Pos21->Module2) thus there will be 5 nodes of Module2 in the expanded view.

MEC: There has been a re-purposing of the DDCompactView to not only hold the representation described above (in detail this is the DDCompactViewImpl) but also own the memory of the stores refered to by the graph.

DDCompactView now owns the DDMaterial, DDSpecific, DDLogicalPart, DDRotation, DDSolid and etc. Removal of the global one-and-only stores, methods and details such as DDRoot will mean that all of these will be accessed via the DDCompactView.

Definition at line 77 of file DDCompactView.h.

Member Typedef Documentation

not used

type of representation of the compact-view (acyclic directed multigraph) Nodes are instances of DDLogicalPart, edges are pointers to instances of DDPosData

Definition at line 99 of file DDCompactView.h.

container-type of children of a given node in the compact-view

Definition at line 82 of file DDCompactView.h.

pair ...

Definition at line 88 of file DDCompactView.h.

typedef std::vector< std::pair<DDLogicalPart,DDPosData*> > DDCompactView::poschildren_type

container-type of pairs of children nodes and their relative position data of a given node in the compact-view

Definition at line 85 of file DDCompactView.h.

not used

Definition at line 92 of file DDCompactView.h.

Constructor & Destructor Documentation

DDCompactView::DDCompactView ( )
explicit

Creates a compact-view.

Definition at line 171 of file DDCompactView.cc.

171 : rep_(new DDCompactViewImpl) { }
DDCompactViewImpl * rep_
DDCompactView::DDCompactView ( const DDLogicalPart rootnodedata)
explicit

EXPERIMENTAL! Creates a compact-view using a different root of the geometrical hierarchy

Compact-views can be created only after an appropriate geometrical hierarchy has been defined using DDpos().

Further it is assumed that the DDLogicalPart defining the root of the geometrical hierarchy has been defined using DDRootDef - singleton. It will be extracted from this singleton using DDRootDef::instance().root()!

The first time this constructor gets called, the internal graph representation is build up. Subsequent calls will return immidiately providing access to the already built up compact-view representation.

Currently the only usefull methods are DDCompactView::graph(), DDCompactView::root() !

Definition at line 37 of file DDCompactView.cc.

References DDI::Singleton< I >::instance().

38  : rep_(new DDCompactViewImpl(rootnodedata))
39 {
40  // 2010-01-27 I am leaving this here so that we are sure the global stores
41  // are open when a new DDCompactView is being made. Eventually I want to
42  // get rid of the need for this somehow? think about it...
43  DDMaterial::StoreT::instance().setReadOnly(false);
44  DDSolid::StoreT::instance().setReadOnly(false);
45  DDLogicalPart::StoreT::instance().setReadOnly(false);
46  DDSpecifics::StoreT::instance().setReadOnly(false);
47  DDRotation::StoreT::instance().setReadOnly(false);
48 }
DDCompactViewImpl * rep_
static value_type & instance()
DDCompactView::~DDCompactView ( )

Definition at line 50 of file DDCompactView.cc.

References rep_.

51 {
52  if (rep_ != 0) {
53  delete rep_;
54  }
55 }
DDCompactViewImpl * rep_

Member Function Documentation

void DDCompactView::algoPosPart ( const DDLogicalPart self,
const DDLogicalPart parent,
DDAlgo algo 
)

positioning...

Definition at line 107 of file DDCompactView.cc.

References DDanonymousRot(), alignCSCRings::e, edm::hlt::Exception, DDAlgo::go(), SurfaceOrientation::inner, DDAlgo::label(), LogDebug, DDName::name(), DDBase< N, C >::name(), DDAlgo::next(), DDName::ns(), position(), DDBase< N, C >::rep(), DDAlgo::rotation(), and DDAlgo::translation().

Referenced by DDLAlgoPosPart::processElement().

110  {
111  static int cnt_=0;
112  ++cnt_;
113  if (algo.rep().numRegistered() == 0) {
114  std::string e;
115  e = "DDalgoPosPart: algorithmic positioning\n";
116  e += "\t[" + algo.name().ns()
117  + ":"
118  + algo.name().name()
119  + "] is not defined!\n";
120  throw cms::Exception("DDException") << e;
121  }
122 
123  LogDebug ("AlgoPos") << "DDCompactView, algo=" << std::endl << algo << std::endl;
124  int inner=0;
125  do {
126  ++inner;
127  DDRotationMatrix * rmp = new DDRotationMatrix(algo.rotation());
128  DDRotation anonymRot = DDanonymousRot(rmp);
129  DDTranslation tr(algo.translation());
130  position(self, parent, algo.label(), tr, anonymRot);
131  algo.next();
132  }
133  while(algo.go());
134 
135 }
#define LogDebug(id)
const DDI::rep_traits< N, C >::reference rep() const
Definition: DDBase.h:89
void next()
Definition: DDAlgo.cc:102
const N & name() const
Definition: DDBase.h:82
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:101
bool go() const
Definition: DDAlgo.cc:108
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDRotation DDanonymousRot(DDRotationMatrix *rot)
Defines a anonymous rotation or rotation-reflection matrix.
Definition: DDRotation.cc:197
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDRotationMatrix rotation()
Definition: DDAlgo.cc:81
std::string label() const
Definition: DDAlgo.cc:94
DDTranslation translation()
Definition: DDAlgo.cc:75
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
const DDCompactView::graph_type & DDCompactView::graph ( ) const

Provides read-only access to the data structure of the compact-view.

The compact-view is kept in an acyclic directed multigraph represented by an instance of class Graph<DDLogicalPart, DDPosData*). Graph provides methods for navigating its content.

Definition at line 62 of file DDCompactView.cc.

References DDCompactViewImpl::graph(), and rep_.

Referenced by SolidsForOnline::beginRun(), DDG4Builder::BuildGeometry(), DDCheckAll(), DDCheckConnect(), ddstats(), GeometryInfoDump::dumpInfo(), hierarchy(), DDErrorDetection::lp_cpv(), DDCompareCPV::operator()(), DDStreamer::pos_read(), and DDStreamer::pos_write().

63 {
64  return rep_->graph();
65 }
DDCompactViewImpl * rep_
const GraphNav & graph() const
void DDCompactView::lockdown ( )

Definition at line 173 of file DDCompactView.cc.

References DDI::Singleton< I >::instance(), lpStore_, matStore_, rotStore_, solidStore_, and specStore_.

173  {
174  // at this point we should have a valid store of DDObjects and we will move these
175  // to the local storage area using swaps with the existing Singleton<Store...>'s
176  // 2010-01-27 memory patch
182 
183  // 2010-01-27 memory patch
184  // not sure this will stay, but for now we want to explicitely lock the global stores.
185  // lock the global stores.
186  DDMaterial::StoreT::instance().setReadOnly(false);
187  DDSolid::StoreT::instance().setReadOnly(false);
188  DDLogicalPart::StoreT::instance().setReadOnly(false);
189  DDSpecifics::StoreT::instance().setReadOnly(false);
190  DDRotation::StoreT::instance().setReadOnly(false);
191 
192 }
static value_type & instance()
DDI::Store< DDName, DDI::Specific * > specStore_
DDI::Store< DDName, DDI::Solid * > solidStore_
DDI::Store< DDName, DDRotationMatrix * > rotStore_
DDI::Store< DDName, DDI::LogicalPart * > lpStore_
DDI::Store< DDName, DDI::Material * > matStore_
void DDCompactView::position ( const DDLogicalPart self,
const DDLogicalPart parent,
std::string  copyno,
const DDTranslation trans,
const DDRotation rot,
const DDDivision div = NULL 
)

Definition at line 137 of file DDCompactView.cc.

Referenced by algoPosPart(), DDHCalBarrelAlgo::constructGeneralVolume(), DDHCalEndcapAlgo::constructGeneralVolume(), DDHCalBarrelAlgo::constructInsideDetectors(), DDHCalBarrelAlgo::constructInsideLayers(), DDHCalEndcapAlgo::constructInsideModule(), DDHCalEndcapAlgo::constructInsideModule0(), DDHCalBarrelAlgo::constructInsideSector(), DDHCalEndcapAlgo::constructInsideSector(), DDHCalBarrelAlgo::constructMidLayer(), DDHCalEndcapAlgo::constructScintLayer(), DDHCalBarrelAlgo::constructSideLayer(), DDEcalPreshowerAlgo::doLadders(), DDEcalPreshowerAlgoTB::doLayers(), DDEcalPreshowerAlgo::doLayers(), DDTECModuleAlgo::doPos(), DDEcalPreshowerAlgoTB::doSens(), DDEcalPreshowerAlgo::doSens(), DDEcalPreshowerAlgoTB::doWedges(), DDEcalEndcapAlgo::EECreateSC(), DDEcalEndcapAlgo::EEPositionCRs(), DDLinear::execute(), DDAngular::execute(), DDTIDModulePosAlgo::execute(), DDHCalForwardAlgo::execute(), DDTrackerXYZPosAlgo::execute(), DDHCalTBCableAlgo::execute(), DDHCalTBZposAlgo::execute(), DDHCalTestBeamAlgo::execute(), DDHCalXtalAlgo::execute(), DDHCalAngular::execute(), DDTIBLayerAlgo_MTCC::execute(), DDTIBRadCableAlgo_MTCC::execute(), DDPixBarLayerAlgo::execute(), DDTrackerZPosAlgo::execute(), DDTOBAxCableAlgo::execute(), DDTECOptoHybAlgo::execute(), DDTrackerLinear::execute(), DDTIBLayerAlgo::execute(), DDTrackerLinearXY::execute(), DDTIDModuleAlgo::execute(), DDTECCoolAlgo::execute(), DDTOBRadCableAlgo::execute(), DDTOBRodAlgo::execute(), DDTrackerPhiAlgo::execute(), DDTECAxialCableAlgo::execute(), DDHCalLinearXY::execute(), DDTrackerAngular::execute(), DDTECPhiAlgo::execute(), DDTIDAxialCableAlgo::execute(), DDHCalFibreBundle::execute(), DDTECPhiAltAlgo::execute(), DDTECModuleAlgo::execute(), DDTIDRingAlgo::execute(), DDTrackerPhiAltAlgo::execute(), DDEcalAPDAlgo::execute(), DDTBH4Algo::execute(), DDDividedGeometryObject::execute(), DDEcalBarrelAlgo::execute(), DDEcalBarrelNewAlgo::execute(), DDEcalEndcapAlgo::execute(), DDPixFwdBlades::execute(), DDStreamer::pos_read(), DDLPosPart::processElement(), regressionTest_first(), DDEcalBarrelAlgo::web(), and DDEcalBarrelNewAlgo::web().

143 {
144  int cpno = atoi(copyno.c_str());
145  position(self,parent,cpno,trans,rot, div);
146 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
void DDCompactView::position ( const DDLogicalPart self,
const DDLogicalPart parent,
int  copyno,
const DDTranslation trans,
const DDRotation rot,
const DDDivision div = NULL 
)

Definition at line 148 of file DDCompactView.cc.

References DDCompactViewImpl::position(), and rep_.

154 {
155  rep_->position( self, parent, copyno, trans, rot, div );
156 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, int copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div)
DDCompactViewImpl * rep_
const DDLogicalPart & DDCompactView::root ( ) const

returns the DDLogicalPart representing the root of the geometrical hierarchy

Definition at line 72 of file DDCompactView.cc.

References rep_, and DDCompactViewImpl::root().

Referenced by DDG4Builder::BuildGeometry(), and DDCheckConnect().

73 {
74  return rep_->root();
75 }
DDCompactViewImpl * rep_
const DDLogicalPart & root() const
void DDCompactView::setRoot ( const DDLogicalPart root)

don't use : interface not stable ....

Definition at line 162 of file DDCompactView.cc.

References rep_, and DDCompactViewImpl::setRoot().

Referenced by DDLSAX2ConfigHandler::startElement().

163 {
164  rep_->setRoot(root);
165 }
DDCompactViewImpl * rep_
void setRoot(const DDLogicalPart &root)
void DDCompactView::swap ( DDCompactView repToSwap)

Definition at line 167 of file DDCompactView.cc.

References rep_, and DDCompactViewImpl::swap().

167  {
168  rep_->swap ( *(repToSwap.rep_) );
169 }
DDCompactViewImpl * rep_
void swap(DDCompactViewImpl &)
DDCompactView::walker_type DDCompactView::walker ( ) const

dont't use ! Proper implementation missing ...

Definition at line 78 of file DDCompactView.cc.

References rep_, and DDCompactViewImpl::walker().

Referenced by DDCheckConnect().

79 {
80  return rep_->walker();
81 }
graphwalker< DDLogicalPart, DDPosData * > walker() const
DDCompactViewImpl * rep_
double DDCompactView::weight ( const DDLogicalPart p) const

Prototype version of calculating the weight of a detector component.

Example:

// Fetch a compact-view
// Fetch the part you want to weigh
DDLogicalPart tracker(DDName("Tracker","tracker.xml"));
// Weigh it
edm::LogInfo ("DDCompactView") << "Tracker weight = "
<< view.weight(tracker) / kg
<< " kg" << std::endl;

The weight of all children is calculated as well.

Definition at line 102 of file DDCompactView.cc.

References rep_, and DDCompactViewImpl::weight().

Referenced by generateHtml().

103 {
104  return rep_->weight(p);
105 }
DDCompactViewImpl * rep_
double weight(const DDLogicalPart &) const
DDCompactView::graph_type & DDCompactView::writeableGraph ( )

Definition at line 67 of file DDCompactView.cc.

References DDCompactViewImpl::graph(), and rep_.

68 {
69  return const_cast<graph_type&>(rep_->graph());
70 }
DDCompactViewImpl * rep_
::graph< DDLogicalPart, DDPosData * > graph_type
not used
Definition: DDCompactView.h:99
const GraphNav & graph() const

Member Data Documentation

DDI::Store<DDName, DDI::LogicalPart*> DDCompactView::lpStore_
private

Definition at line 166 of file DDCompactView.h.

Referenced by lockdown().

DDI::Store<DDName, DDI::Material*> DDCompactView::matStore_
private

Definition at line 164 of file DDCompactView.h.

Referenced by lockdown().

DDCompactViewImpl* DDCompactView::rep_
protected
DDI::Store<DDName, DDRotationMatrix*> DDCompactView::rotStore_
private

Definition at line 168 of file DDCompactView.h.

Referenced by lockdown().

DDI::Store<DDName, DDI::Solid*> DDCompactView::solidStore_
private

Definition at line 165 of file DDCompactView.h.

Referenced by lockdown().

DDI::Store<DDName, DDI::Specific*> DDCompactView::specStore_
private

Definition at line 167 of file DDCompactView.h.

Referenced by lockdown().