CMS 3D CMS Logo

Functions
detgeomdescbuilder Namespace Reference

Functions

void buildDetGeomDescDescendants (DDFilteredView &fv, DetGeomDesc *geoInfoParent)
 
std::unique_ptr< DetGeomDescbuildDetGeomDescFromCompactView (const cms::DDCompactView &myCompactView)
 
std::unique_ptr< DetGeomDescbuildDetGeomDescFromCompactView (const DDCompactView &myCompactView)
 

Function Documentation

◆ buildDetGeomDescDescendants()

void detgeomdescbuilder::buildDetGeomDescDescendants ( DDFilteredView fv,
DetGeomDesc geoInfoParent 
)

Definition at line 29 of file DetGeomDescBuilder.cc.

29  {
30  // Leaf
31  if (!fv.firstChild())
32  return;
33 
34  do {
35  // Create node, and add it to the geoInfoParent's list.
36  DetGeomDesc* child = new DetGeomDesc(fv);
37  geoInfo->addComponent(child);
38 
39  // Recursion
41  } while (fv.nextSibling());
42 
43  fv.parent();
44 }

References DetGeomDesc::addComponent(), DDFilteredView::firstChild(), DDFilteredView::nextSibling(), and DDFilteredView::parent().

Referenced by buildDetGeomDescFromCompactView().

◆ buildDetGeomDescFromCompactView() [1/2]

std::unique_ptr< DetGeomDesc > detgeomdescbuilder::buildDetGeomDescFromCompactView ( const cms::DDCompactView myCompactView)

Definition at line 49 of file DetGeomDescBuilder.cc.

50  {
51  // create DDFilteredView (no filter!!)
52  const cms::DDDetector* mySystem = myCompactView.detector();
53  const dd4hep::Volume& worldVolume = mySystem->worldVolume();
54  cms::DDFilteredView fv(mySystem, worldVolume);
55  if (fv.next(0) == false) {
56  edm::LogError("PPSGeometryESProducer") << "Filtered view is empty. Cannot build.";
57  }
58 
59  // Geo info: root node.
60  auto geoInfoRoot = std::make_unique<DetGeomDesc>(fv);
61 
62  // Construct the tree of children geo info (DetGeomDesc).
63  do {
64  // Create node, and add it to the geoInfoRoot's list.
65  DetGeomDesc* child = new DetGeomDesc(fv);
66  geoInfoRoot->addComponent(child);
67  } while (fv.next(0));
68 
69  edm::LogInfo("PPSGeometryESProducer") << "Successfully built geometry, it has " << (geoInfoRoot->components()).size()
70  << " DetGeomDesc nodes.";
71 
72  return geoInfoRoot;
73 }

References cms::DDCompactView::detector(), cms::DDFilteredView::next(), findQualityFiles::size, and cms::DDDetector::worldVolume().

◆ buildDetGeomDescFromCompactView() [2/2]

std::unique_ptr< DetGeomDesc > detgeomdescbuilder::buildDetGeomDescFromCompactView ( const DDCompactView myCompactView)

Definition at line 9 of file DetGeomDescBuilder.cc.

9  {
10  // Create DDFilteredView (no filter!!)
12  DDFilteredView fv(myCompactView, filter);
13 
14  // Geo info: root node.
15  auto geoInfoRoot = std::make_unique<DetGeomDesc>(fv);
16 
17  // Construct the tree of children geo info (DetGeomDesc).
19 
20  edm::LogInfo("PPSGeometryESProducer") << "Successfully built geometry.";
21 
22  return geoInfoRoot;
23 }

References buildDetGeomDescDescendants(), and ALCARECOTkAlBeamHalo_cff::filter.

Referenced by PPSGeometryBuilder::analyze(), and CTPPSGeometryESModule::produceIdealGD().

edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
cms::DDFilteredView
Definition: DDFilteredView.h:70
DDFilteredView::parent
bool parent()
set the current node to the parent node ...
Definition: DDFilteredView.cc:161
detgeomdescbuilder::buildDetGeomDescDescendants
void buildDetGeomDescDescendants(DDFilteredView &fv, DetGeomDesc *geoInfoParent)
Definition: DetGeomDescBuilder.cc:29
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
DDFilteredView::nextSibling
bool nextSibling()
set the current node to the next sibling ...
Definition: DDFilteredView.cc:124
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
cms::Volume
dd4hep::Volume Volume
Definition: DDFilteredView.h:47
cms::DDDetector::worldVolume
dd4hep::Volume worldVolume() const
Handle to the world volume containing everything.
Definition: DDDetector.cc:40
DetGeomDesc
Definition: DetGeomDesc.h:49
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DDPassAllFilter
A DDFilter that always returns true.
Definition: DDFilter.h:26
cms::DDDetector
Definition: DDDetector.h:12
DDFilteredView
Definition: DDFilteredView.h:20
child
Definition: simpleInheritance.h:11
cms::DDCompactView::detector
const cms::DDDetector * detector() const
Definition: DDCompactView.h:34
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443