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

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

Definition at line 19 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.

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