CMS 3D CMS Logo

Functions
detgeomdescbuilder Namespace Reference

Functions

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

Function Documentation

◆ buildDetGeomDescDescendants()

void detgeomdescbuilder::buildDetGeomDescDescendants ( DDFilteredView fv,
DetGeomDesc geoInfoParent,
const bool  isRun2 
)

Definition at line 31 of file DetGeomDescBuilder.cc.

31  {
32  // Leaf
33  if (!fv.firstChild())
34  return;
35 
36  do {
37  // Create node
38  DetGeomDesc* child = new DetGeomDesc(fv, isRun2);
39 
40  // legacy Run2 z sign fix for diamond detectors
41  const auto& detId = child->geographicalID();
42  if (isRun2 && detId.subdetId() == CTPPSDetId::sdTimingDiamond)
43  child->invertZSign();
44 
45  // add the to the geoInfoParent's list.
46  geoInfo->addComponent(child);
47 
48  // Recursion
50  } while (fv.nextSibling());
51 
52  fv.parent();
53 }

References DetGeomDesc::addComponent(), DDFilteredView::firstChild(), geometryPPS_CMSxz_fromDD_2016_cfi::isRun2, DDFilteredView::nextSibling(), DDFilteredView::parent(), and CTPPSDetId::sdTimingDiamond.

Referenced by buildDetGeomDescFromCompactView().

◆ buildDetGeomDescFromCompactView() [1/2]

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

Definition at line 58 of file DetGeomDescBuilder.cc.

59  {
60  // create DDFilteredView (no filter!!)
61  const cms::DDDetector* mySystem = myCompactView.detector();
62  const dd4hep::Volume& worldVolume = mySystem->worldVolume();
63  cms::DDFilteredView fv(mySystem, worldVolume);
64  if (fv.next(0) == false) {
65  edm::LogError("PPSGeometryESProducer") << "Filtered view is empty. Cannot build.";
66  }
67 
68  // Geo info: root node.
69  auto geoInfoRoot = std::make_unique<DetGeomDesc>(fv, isRun2);
70 
71  // Construct the tree of children geo info (DetGeomDesc).
72  do {
73  // Create node
74  DetGeomDesc* child = new DetGeomDesc(fv, isRun2);
75 
76  // legacy Run2 z sign fix for diamond detectors
77  const auto& detId = child->geographicalID();
78  if (isRun2 && detId.subdetId() == CTPPSDetId::sdTimingDiamond)
79  child->invertZSign();
80 
81  // add the node to the geoInfoRoot's list.
82  geoInfoRoot->addComponent(child);
83  } while (fv.next(0));
84 
85  edm::LogInfo("PPSGeometryESProducer") << "Successfully built geometry, it has " << (geoInfoRoot->components()).size()
86  << " DetGeomDesc nodes.";
87 
88  return geoInfoRoot;
89 }

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

◆ buildDetGeomDescFromCompactView() [2/2]

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

Definition at line 10 of file DetGeomDescBuilder.cc.

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

References buildDetGeomDescDescendants(), ALCARECOTkAlBeamHalo_cff::filter, and geometryPPS_CMSxz_fromDD_2016_cfi::isRun2.

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

detgeomdescbuilder::buildDetGeomDescDescendants
void buildDetGeomDescDescendants(DDFilteredView &fv, DetGeomDesc *geoInfoParent, const bool isRun2)
Definition: DetGeomDescBuilder.cc:31
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
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
CTPPSDetId::sdTimingDiamond
Definition: CTPPSDetId.h:44
DDFilteredView::nextSibling
bool nextSibling()
set the current node to the next sibling ...
Definition: DDFilteredView.cc:124
geometryPPS_CMSxz_fromDD_2016_cfi.isRun2
isRun2
Definition: geometryPPS_CMSxz_fromDD_2016_cfi.py:14
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:48
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