CMS 3D CMS Logo

DDExpandedViewDump.cc

Go to the documentation of this file.
00001 namespace std { } using namespace std;
00002 #include <iostream>
00003 #include <sstream>
00004 #include <cstdlib>
00005 #include <set>
00006 #include <algorithm>
00007 #include <string>
00008 #include "DetectorDescription/RegressionTest/interface/DDExpandedViewDump.h"
00009 #include "DetectorDescription/Core/interface/DDExpandedView.h"
00010 
00011 void DDExpandedViewDump(ostream & os, DDExpandedView & ex, size_t skip, size_t sto)
00012 {
00013   typedef set<string>::iterator s_iter;
00014   set<string> result;
00015   bool go(true);
00016   int  count(0);
00017   bool dotrans(true);
00018   if (getenv("DDNOTRANS")) dotrans=false;
00019   ++skip;
00020   while(go) {
00021     if ((count % 5000)==0) cout << count << ' ' << flush;
00022     if (sto > 0) if ((count % sto)==0) break;
00023     ++count;
00024     if((count % skip) ==0){
00025       stringstream s;
00026       s.setf(ios_base::fixed,ios_base::floatfield);
00027       s.precision(2);
00028       s << ex.logicalPart().name() << ' '
00029         << ex.copyno() << ' ' 
00030         << ex.geoHistory() << " r="
00031         << ex.geoHistory().back().posdata()->rot_.name() << "\n"; 
00032       DDRotationMatrix rm = ex.rotation();
00033       {
00034         double v[9]; rm.GetComponents(v,v+9);
00035         s << "R=(";
00036         s << v[0] << ' ' << v[1] << ' ' << v[2] << endl;
00037         s << v[3] << ' ' << v[4] << ' ' << v[5] << endl;
00038         s << v[6] << ' ' << v[7] << ' ' << v[7] << endl;
00039       }
00040       rm = ex.geoHistory().back().posdata()->rotation();
00041       {
00042         double v[9]; rm.GetComponents(v,v+9);
00043         s << "r=(";
00044         s << v[0] << ' ' << v[1] << ' ' << v[2] << endl;
00045         s << v[3] << ' ' << v[4] << ' ' << v[5] << endl;
00046         s << v[6] << ' ' << v[7] << ' ' << v[7] << endl;
00047       }
00048       if (dotrans) {
00049         s << "T=("
00050           << ex.translation().x() << ','
00051           << ex.translation().y() << ','
00052           << ex.translation().z() << ") "
00053           ;
00054       }      
00055       pair<s_iter,bool> ins = result.insert(s.str());
00056       if(!ins.second) {
00057         cout << "DDExpandedViewDump:ERROR: duplicated=" << s.str() << endl;
00058       } 
00059     }
00060     go = ex.next();
00061   }
00062   s_iter it(result.begin()), ed(result.end());
00063   for(;it != ed;++it) {
00064     os << *it << endl;
00065   }
00066 }

Generated on Tue Jun 9 17:32:28 2009 for CMSSW by  doxygen 1.5.4