CMS 3D CMS Logo

Namespaces | Functions
DDExpandedViewDump.cc File Reference
#include <cstdlib>
#include <iostream>
#include <memory>
#include <set>
#include <string>
#include <utility>
#include "DetectorDescription/Base/interface/DDRotationMatrix.h"
#include "DetectorDescription/Base/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.

Namespaces

 std
 

Functions

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

Function Documentation

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

Definition at line 18 of file DDExpandedViewDump.cc.

References DDExpandedView::copyno(), KineDebug3::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, createPayload::skip, DDExpandedView::translation(), and findQualityFiles::v.

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 (getenv("DDNOTRANS")) dotrans=false;
26  ++skip;
27  while(go) {
28  if ((count % 5000)==0) cout << count << ' ' << flush;
29  if (sto > 0) if ((count % sto)==0) break;
30  ++count;
31  if((count % skip) ==0){
32  stringstream s;
33  s.setf(ios_base::fixed,ios_base::floatfield);
34  s.precision(2);
35  s << ex.logicalPart().name() << ' '
36  << ex.copyno() << ' '
37  << ex.geoHistory() << " r="
38  << ex.geoHistory().back().posdata()->rot_.name() << "\n";
40  {
41  double v[9]; rm.GetComponents(v,v+9);
42  s << "R=(";
43  s << v[0] << ' ' << v[1] << ' ' << v[2] << endl;
44  s << v[3] << ' ' << v[4] << ' ' << v[5] << endl;
45  s << v[6] << ' ' << v[7] << ' ' << v[7] << endl;
46  }
47  rm = ex.geoHistory().back().posdata()->rotation();
48  {
49  double v[9]; rm.GetComponents(v,v+9);
50  s << "r=(";
51  s << v[0] << ' ' << v[1] << ' ' << v[2] << endl;
52  s << v[3] << ' ' << v[4] << ' ' << v[5] << endl;
53  s << v[6] << ' ' << v[7] << ' ' << v[7] << endl;
54  }
55  if (dotrans) {
56  s << "T=("
57  << ex.translation().x() << ','
58  << ex.translation().y() << ','
59  << ex.translation().z() << ") "
60  ;
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 }
bool next()
set current node to the next node in the expanded tree
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
const N & name() const
Definition: DDBase.h:78
ins
Definition: cuy.py:312
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
const DDTranslation & translation() const
The absolute translation of the current node.
int copyno() const
Copy number associated with the current node.
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
rm
Definition: submit.py:76
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.