CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
DDCompactView Class Reference

Compact representation of the geometrical detector hierarchy. More...

#include <DDCompactView.h>

Public Types

using Graph = math::Graph< DDLogicalPart, DDPosData * >
 
using GraphWalker = math::GraphWalker< DDLogicalPart, DDPosData * >
 

Public Member Functions

 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 Graphgraph () const
 Provides read-only access to the data structure of the compact-view. More...
 
void lockdown ()
 
void position (const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
 
void position (const DDLogicalPart &self, const DDLogicalPart &parent, int copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
 
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 &)
 
GraphWalker walker () const
 
const DDPosDataworldPosition () const
 The absolute position of the world. More...
 
 ~DDCompactView ()
 

Private Attributes

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

Detailed Description

Compact representation of the geometrical detector hierarchy.

Navigation through the compact view of the detector ...

Updated: Michael Case [ MEC ] 2010-02-11 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 83 of file DDCompactView.h.

Member Typedef Documentation

Definition at line 86 of file DDCompactView.h.

Definition at line 87 of file DDCompactView.h.

Constructor & Destructor Documentation

DDCompactView::DDCompactView ( )
explicit

Creates a compact-view.

Definition at line 114 of file DDCompactView.cc.

115  : rep_(new DDCompactViewImpl),
117 { }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
std::unique_ptr< DDPosData > worldpos_
std::unique_ptr< 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 )),
40 {
41  // 2010-01-27 I am leaving this here so that we are sure the global stores
42  // are open when a new DDCompactView is being made. Eventually I want to
43  // get rid of the need for this somehow? think about it...
44  DDMaterial::StoreT::instance().setReadOnly(false);
45  DDSolid::StoreT::instance().setReadOnly(false);
46  DDLogicalPart::StoreT::instance().setReadOnly(false);
47  DDSpecifics::StoreT::instance().setReadOnly(false);
48  DDRotation::StoreT::instance().setReadOnly(false);
49 }
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
static value_type & instance()
std::unique_ptr< DDPosData > worldpos_
std::unique_ptr< DDCompactViewImpl > rep_
DDCompactView::~DDCompactView ( )

Definition at line 51 of file DDCompactView.cc.

52 {}

Member Function Documentation

const DDCompactView::Graph & 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 59 of file DDCompactView.cc.

References rep_.

Referenced by OutputMagneticFieldDDToDDL::beginRun(), OutputDDToDDL::beginRun(), DDG4Builder::BuildGeometry(), TGeoFromDddService::createManager(), DDCheckAll(), DDCheckConnect(), ddstats(), GeometryInfoDump::dumpInfo(), DDErrorDetection::lp_cpv(), DDCompareCPV::operator()(), and PrintGeomSummary::update().

60 {
61  return rep_->graph();
62 }
std::unique_ptr< DDCompactViewImpl > rep_
void DDCompactView::lockdown ( )

Definition at line 119 of file DDCompactView.cc.

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

Referenced by CompareDDCompactViews::beginRun().

119  {
120  // at this point we should have a valid store of DDObjects and we will move these
121  // to the local storage area using swaps with the existing Singleton<Store...>'s
122  // 2010-01-27 memory patch
128 
129  // 2010-01-27 memory patch
130  // not sure this will stay, but for now we want to explicitely lock the global stores.
131  // lock the global stores.
132  DDMaterial::StoreT::instance().setReadOnly(false);
133  DDSolid::StoreT::instance().setReadOnly(false);
134  DDLogicalPart::StoreT::instance().setReadOnly(false);
135  DDSpecifics::StoreT::instance().setReadOnly(false);
136  DDRotation::StoreT::instance().setReadOnly(false);
137 
138 }
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,
const std::string &  copyno,
const DDTranslation trans,
const DDRotation rot,
const DDDivision div = 0 
)

Definition at line 80 of file DDCompactView.cc.

Referenced by DDHCalBarrelAlgo::constructGeneralVolume(), DDHCalEndcapAlgo::constructGeneralVolume(), DDHCalBarrelAlgo::constructInsideDetectors(), DDHCalBarrelAlgo::constructInsideLayers(), DDHCalEndcapModuleAlgo::constructInsideModule(), DDHCalEndcapAlgo::constructInsideModule(), DDHCalEndcapModuleAlgo::constructInsideModule0(), DDHCalEndcapAlgo::constructInsideModule0(), DDHCalBarrelAlgo::constructInsideSector(), DDHCalEndcapAlgo::constructInsideSector(), DDAHcalModuleAlgo::constructLayers(), DDHGCalModule::constructLayers(), DDHGCalModuleAlgo::constructLayers(), DDHGCalTBModule::constructLayers(), DDHGCalEEAlgo::constructLayers(), DDHGCalHEAlgo::constructLayers(), DDHCalBarrelAlgo::constructMidLayer(), DDHCalEndcapModuleAlgo::constructScintLayer(), DDHCalEndcapAlgo::constructScintLayer(), DDHCalBarrelAlgo::constructSideLayer(), DDHGCalNoTaperEndcap::createQuarter(), DDEcalPreshowerAlgo::doLadders(), DDEcalPreshowerAlgoTB::doLayers(), DDEcalPreshowerAlgo::doLayers(), DDTECModuleAlgo::doPos(), DDEcalPreshowerAlgoTB::doSens(), DDEcalPreshowerAlgo::doSens(), DDEcalPreshowerAlgoTB::doWedges(), DDEcalEndcapAlgo::EECreateSC(), DDEcalEndcapAlgo::EEPositionCRs(), DDHGCalCell::execute(), DDHGCalWafer8::execute(), DDTIDModulePosAlgo::execute(), DDTOBRodAlgo::execute(), DDTIBRadCableAlgo_MTCC::execute(), DDGEMAngular::execute(), DDPixBarLayerAlgo::execute(), DDTIBLayerAlgo_MTCC::execute(), DDTrackerLinear::execute(), DDPixBarLayerUpgradeAlgo::execute(), DDMuonAngular::execute(), DDBHMAngular::execute(), DDHCalAngular::execute(), DDTECCoolAlgo::execute(), DDTIBLayerAlgo::execute(), DDTrackerXYZPosAlgo::execute(), DDHGCalWaferAlgo::execute(), DDTrackerZPosAlgo::execute(), DDPixFwdDiskAlgo::execute(), DDTIDModuleAlgo::execute(), DDTrackerLinearXY::execute(), DDHGCalWafer::execute(), DDTECOptoHybAlgo::execute(), DDPixPhase1FwdDiskAlgo::execute(), DDHCalForwardAlgo::execute(), DDHCalTBCableAlgo::execute(), DDHCalTBZposAlgo::execute(), DDHCalTestBeamAlgo::execute(), DDTOBRadCableAlgo::execute(), DDHCalXtalAlgo::execute(), DDTOBAxCableAlgo::execute(), DDHCalFibreBundle::execute(), DDTECPhiAlgo::execute(), DDTrackerAngular::execute(), DDTECPhiAltAlgo::execute(), DDHCalLinearXY::execute(), DDTrackerPhiAlgo::execute(), DDTrackerPhiAltAlgo::execute(), DDTIDAxialCableAlgo::execute(), DDTrackerAngularV1::execute(), DDTECAxialCableAlgo::execute(), DDTIDRingAlgo::execute(), DDTECModuleAlgo::execute(), DDLinear::execute(), DDCutTubsFromPoints::execute(), DDAngular::execute(), DDTBH4Algo::execute(), DDEcalAPDAlgo::execute(), DDDividedGeometryObject::execute(), DDEcalBarrelAlgo::execute(), DDEcalBarrelNewAlgo::execute(), DDEcalEndcapAlgo::execute(), DDTrackerRingAlgo::execute(), DDPixFwdBlades::execute(), DDHGCalHEAlgo::positionMix(), DDAHcalModuleAlgo::positionSensitive(), DDHGCalTBModule::positionSensitive(), DDHGCalModule::positionSensitive(), DDHGCalModuleAlgo::positionSensitive(), DDHGCalEEAlgo::positionSensitive(), DDHGCalHEAlgo::positionSensitive(), DDLPosPart::processElement(), regressionTest_first(), DDEcalBarrelAlgo::web(), and DDEcalBarrelNewAlgo::web().

86 {
87  int cpno = atoi(copyno.c_str());
88  position(self,parent,cpno,trans,rot, div);
89 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void DDCompactView::position ( const DDLogicalPart self,
const DDLogicalPart parent,
int  copyno,
const DDTranslation trans,
const DDRotation rot,
const DDDivision div = 0 
)

Definition at line 91 of file DDCompactView.cc.

References rep_.

97 {
98  rep_->position( self, parent, copyno, trans, rot, div );
99 }
std::unique_ptr< DDCompactViewImpl > rep_
const DDLogicalPart & DDCompactView::root ( ) const

returns the DDLogicalPart representing the root of the geometrical hierarchy

Definition at line 70 of file DDCompactView.cc.

References rep_.

Referenced by DDG4Builder::BuildGeometry(), TGeoFromDddService::createManager(), DDCheckConnect(), TGeoMgrFromDdd::produce(), and CocoaAnalyzer::ReadXMLFile().

71 {
72  return rep_->root();
73 }
std::unique_ptr< DDCompactViewImpl > rep_
void DDCompactView::setRoot ( const DDLogicalPart root)

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

Definition at line 105 of file DDCompactView.cc.

References rep_.

Referenced by DDLSAX2ConfigHandler::startElement().

106 {
107  rep_->setRoot(root);
108 }
std::unique_ptr< DDCompactViewImpl > rep_
void DDCompactView::swap ( DDCompactView repToSwap)

Definition at line 110 of file DDCompactView.cc.

References rep_.

110  {
111  rep_->swap ( *(repToSwap.rep_) );
112 }
std::unique_ptr< DDCompactViewImpl > rep_
DDCompactView::GraphWalker DDCompactView::walker ( ) const

Definition at line 65 of file DDCompactView.cc.

References rep_.

Referenced by TGeoMgrFromDdd::produce().

66 {
67  return rep_->walker();
68 }
std::unique_ptr< DDCompactViewImpl > rep_
const DDPosData * DDCompactView::worldPosition ( ) const

The absolute position of the world.

Definition at line 75 of file DDCompactView.cc.

References worldpos_.

76 {
77  return worldpos_.get();
78 }
std::unique_ptr< DDPosData > worldpos_

Member Data Documentation

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

Definition at line 141 of file DDCompactView.h.

Referenced by lockdown().

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

Definition at line 139 of file DDCompactView.h.

Referenced by lockdown().

std::unique_ptr<DDCompactViewImpl> DDCompactView::rep_
private

Definition at line 136 of file DDCompactView.h.

Referenced by graph(), position(), root(), setRoot(), swap(), and walker().

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

Definition at line 143 of file DDCompactView.h.

Referenced by lockdown().

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

Definition at line 140 of file DDCompactView.h.

Referenced by lockdown().

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

Definition at line 142 of file DDCompactView.h.

Referenced by lockdown().

std::unique_ptr<DDPosData> DDCompactView::worldpos_
private

Definition at line 137 of file DDCompactView.h.

Referenced by worldPosition().