CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Attributes | Private Attributes

DDCompactView Class Reference

type of data representation of DDCompactView More...

#include <DDCompactView.h>

List of all members.

Public Types

typedef ::graph< DDLogicalPart,
DDPosData * > 
graph_type
 not used
typedef std::vector
< DDLogicalPart
logchild_type
 container-type of children of a given node in the compact-view
typedef std::pair
< DDLogicalPart, DDPosData * > 
pos_type
 pair ...
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
typedef graphwalker
< DDLogicalPart, DDPosData * > 
walker_type
 not used

Public Member Functions

void algoPosPart (const DDLogicalPart &self, const DDLogicalPart &parent, DDAlgo &algo)
 positioning...
 DDCompactView (const DDLogicalPart &rootnodedata)
 EXPERIMENTAL! Creates a compact-view using a different root of the geometrical hierarchy
 DDCompactView ()
 Creates a compact-view.
const graph_typegraph () const
 Provides read-only access to the data structure of the compact-view.
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
void setRoot (const DDLogicalPart &root)
 don't use : interface not stable ....
void swap (DDCompactView &)
walker_type walker () const
 dont't use ! Proper implementation missing ...
double weight (const DDLogicalPart &p) const
 Prototype version of calculating the weight of a detector component.
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-11 Compact 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 81 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 103 of file DDCompactView.h.

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

Definition at line 86 of file DDCompactView.h.

pair ...

Definition at line 92 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 89 of file DDCompactView.h.

not used

Definition at line 96 of file DDCompactView.h.


Constructor & Destructor Documentation

DDCompactView::DDCompactView ( ) [explicit]

Creates a compact-view.

Definition at line 175 of file DDCompactView.cc.

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 41 of file DDCompactView.cc.

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

  : rep_(new DDCompactViewImpl(rootnodedata))
{
  // 2010-01-27 I am leaving this here so that we are sure the global stores
  // are open when a new DDCompactView is being made.  Eventually I want to
  // get rid of the need for this somehow? think about it...
  DDMaterial::StoreT::instance().setReadOnly(false);
  DDSolid::StoreT::instance().setReadOnly(false);
  DDLogicalPart::StoreT::instance().setReadOnly(false);
  DDSpecifics::StoreT::instance().setReadOnly(false);
  DDRotation::StoreT::instance().setReadOnly(false);
}
DDCompactView::~DDCompactView ( )

Definition at line 54 of file DDCompactView.cc.

References rep_.

{  
  if (rep_ != 0) {
    delete rep_;
  }
}

Member Function Documentation

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

positioning...

Definition at line 111 of file DDCompactView.cc.

References DDanonymousRot(), ExpressReco_HICollisions_FallBack::e, 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().

                                  {
  static int cnt_=0;
  ++cnt_;
  if (algo.rep().numRegistered() == 0) {
    std::string e;
    e = "DDalgoPosPart: algorithmic positioning\n";
    e += "\t[" + algo.name().ns() 
               + ":" 
               + algo.name().name() 
               + "] is not defined!\n";
    throw DDException(e);
  }
  
  LogDebug ("AlgoPos")  << "DDCompactView, algo=" << std::endl << algo << std::endl;
  int inner=0;
  do { 
    ++inner;
    DDRotationMatrix * rmp = new DDRotationMatrix(algo.rotation());
    DDRotation anonymRot = DDanonymousRot(rmp);
    DDTranslation tr(algo.translation());
    position(self, parent, algo.label(), tr, anonymRot); 
    algo.next();
  } 
  while(algo.go());

}
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 66 of file DDCompactView.cc.

References DDCompactViewImpl::graph(), and rep_.

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

{ 
  return rep_->graph(); 
}
void DDCompactView::lockdown ( )

Definition at line 177 of file DDCompactView.cc.

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

                             {
  // at this point we should have a valid store of DDObjects and we will move these
  // to the local storage area using swaps with the existing Singleton<Store...>'s
  // 2010-01-27 memory patch
  DDMaterial::StoreT::instance().swap(matStore_);
  DDSolid::StoreT::instance().swap(solidStore_);
  DDLogicalPart::StoreT::instance().swap(lpStore_);
  DDSpecifics::StoreT::instance().swap(specStore_);
  DDRotation::StoreT::instance().swap(rotStore_);

  // 2010-01-27 memory patch
  // not sure this will stay, but for now we want to explicitely lock the global stores.
  // lock the global stores.
  DDMaterial::StoreT::instance().setReadOnly(false);
  DDSolid::StoreT::instance().setReadOnly(false);
  DDLogicalPart::StoreT::instance().setReadOnly(false);
  DDSpecifics::StoreT::instance().setReadOnly(false);
  DDRotation::StoreT::instance().setReadOnly(false);

}
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 141 of file DDCompactView.cc.

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

{
  int cpno = atoi(copyno.c_str());
  position(self,parent,cpno,trans,rot, div);
}
void DDCompactView::position ( const DDLogicalPart self,
const DDLogicalPart parent,
int  copyno,
const DDTranslation trans,
const DDRotation rot,
const DDDivision div = NULL 
)

Definition at line 152 of file DDCompactView.cc.

References DDCompactViewImpl::position(), and rep_.

{
  rep_->position( self, parent, copyno, trans, rot, div );
}
const DDLogicalPart & DDCompactView::root ( ) const

returns the DDLogicalPart representing the root of the geometrical hierarchy

Definition at line 76 of file DDCompactView.cc.

References rep_, and DDCompactViewImpl::root().

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

{ 
  return rep_->root(); 
} 
void DDCompactView::setRoot ( const DDLogicalPart root)

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

Definition at line 166 of file DDCompactView.cc.

References rep_, and DDCompactViewImpl::setRoot().

Referenced by DDLSAX2ConfigHandler::startElement().

{
  rep_->setRoot(root);
}  
void DDCompactView::swap ( DDCompactView repToSwap)

Definition at line 171 of file DDCompactView.cc.

References rep_, and DDCompactViewImpl::swap().

                                                   {
  rep_->swap ( *(repToSwap.rep_) );
}
DDCompactView::walker_type DDCompactView::walker ( ) const

dont't use ! Proper implementation missing ...

Definition at line 82 of file DDCompactView.cc.

References rep_, and DDCompactViewImpl::walker().

Referenced by DDCheckConnect().

{
  return rep_->walker();
}
double DDCompactView::weight ( const DDLogicalPart p) const

Prototype version of calculating the weight of a detector component.

Example:

      // Fetch a compact-view
      DDCompactView 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 106 of file DDCompactView.cc.

References rep_, and DDCompactViewImpl::weight().

Referenced by generateHtml().

{
  return rep_->weight(p);
}  
DDCompactView::graph_type & DDCompactView::writeableGraph ( )

Definition at line 71 of file DDCompactView.cc.

References DDCompactViewImpl::graph(), and rep_.

{
  return const_cast<graph_type&>(rep_->graph());
}

Member Data Documentation

Definition at line 170 of file DDCompactView.h.

Referenced by lockdown().

Definition at line 168 of file DDCompactView.h.

Referenced by lockdown().

Definition at line 172 of file DDCompactView.h.

Referenced by lockdown().

Definition at line 169 of file DDCompactView.h.

Referenced by lockdown().

Definition at line 171 of file DDCompactView.h.

Referenced by lockdown().