CMS 3D CMS Logo

Functions
DDExpandedViewDump.cc File Reference
#include <cstdlib>
#include <iostream>
#include <memory>
#include <set>
#include <string>
#include <utility>
#include "DetectorDescription/Core/interface/DDRotationMatrix.h"
#include "DetectorDescription/Core/interface/DDTranslation.h"
#include "DetectorDescription/Core/interface/DDExpandedNode.h"
#include "DetectorDescription/Core/interface/DDExpandedView.h"
#include "DetectorDescription/Core/interface/DDLogicalPart.h"
#include "DetectorDescription/Core/interface/DDName.h"
#include "DetectorDescription/Core/interface/DDPosData.h"
#include "DetectorDescription/Core/interface/DDTransform.h"

Go to the source code of this file.

Functions

void DDExpandedViewDump (ostream &os, DDExpandedView &ex, size_t skip, size_t sto)
 

Function Documentation

◆ DDExpandedViewDump()

void DDExpandedViewDump ( ostream &  os,
DDExpandedView ex,
size_t  skip,
size_t  sto 
)

Definition at line 19 of file DDExpandedViewDump.cc.

19  {
20  typedef set<string>::iterator s_iter;
21  set<string> result;
22  bool go(true);
23  int count(0);
24  bool dotrans(true);
25  if (std::getenv("DDNOTRANS"))
26  dotrans = false;
27  ++skip;
28  while (go) {
29  if ((count % 5000) == 0)
30  cout << count << ' ' << flush;
31  if (sto > 0)
32  if ((count % sto) == 0)
33  break;
34  ++count;
35  if ((count % skip) == 0) {
36  stringstream s;
37  s.setf(ios_base::fixed, ios_base::floatfield);
38  s.precision(2);
39  s << ex.logicalPart().name() << ' ' << ex.copyno() << ' ' << ex.geoHistory()
40  << " r=" << ex.geoHistory().back().posdata()->ddrot().name() << "\n";
42  {
43  double v[9];
44  rm.GetComponents(v, v + 9);
45  s << "R=(";
46  s << v[0] << ' ' << v[1] << ' ' << v[2] << endl;
47  s << v[3] << ' ' << v[4] << ' ' << v[5] << endl;
48  s << v[6] << ' ' << v[7] << ' ' << v[7] << endl;
49  }
50  rm = ex.geoHistory().back().posdata()->rotation();
51  {
52  double v[9];
53  rm.GetComponents(v, v + 9);
54  s << "r=(";
55  s << v[0] << ' ' << v[1] << ' ' << v[2] << endl;
56  s << v[3] << ' ' << v[4] << ' ' << v[5] << endl;
57  s << v[6] << ' ' << v[7] << ' ' << v[7] << endl;
58  }
59  if (dotrans) {
60  s << "T=(" << ex.translation().x() << ',' << ex.translation().y() << ',' << ex.translation().z() << ") ";
61  }
62  pair<s_iter, bool> ins = result.insert(s.str());
63  if (!ins.second) {
64  cout << "DDExpandedViewDump:ERROR: duplicated=" << s.str() << endl;
65  }
66  }
67  go = ex.next();
68  }
69  s_iter it(result.begin()), ed(result.end());
70  for (; it != ed; ++it) {
71  os << *it << endl;
72  }
73 }

References DDExpandedView::copyno(), submitPVResolutionJobs::count, gather_cfg::cout, alignBH_cfg::fixed, DDExpandedView::geoHistory(), cuy::ins, DDExpandedView::logicalPart(), DDBase< N, C >::name(), DDExpandedView::next(), mps_fire::result, submit::rm, DDExpandedView::rotation(), alignCSCRings::s, optionsL1T::skip, DDExpandedView::translation(), and findQualityFiles::v.

alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
DDExpandedView::rotation
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
Definition: DDExpandedView.cc:48
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DDExpandedView::next
bool next()
set current node to the next node in the expanded tree
Definition: DDExpandedView.cc:175
findQualityFiles.v
v
Definition: findQualityFiles.py:179
DDExpandedView::copyno
int copyno() const
Copy number associated with the current node.
Definition: DDExpandedView.cc:54
optionsL1T.skip
skip
Definition: optionsL1T.py:30
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DDBase::name
const N & name() const
Definition: DDBase.h:59
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
submit.rm
rm
Definition: submit.py:77
cuy.ins
ins
Definition: cuy.py:314
DDExpandedView::geoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
Definition: DDExpandedView.cc:50
DDRotationMatrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Definition: DDRotationMatrix.h:8
DDExpandedView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
Definition: DDExpandedView.cc:42
mps_fire.result
result
Definition: mps_fire.py:311
DDExpandedView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDExpandedView.cc:46