#include <iostream>
#include <sstream>
#include <cstdlib>
#include <set>
#include <algorithm>
#include <string>
#include "DetectorDescription/RegressionTest/interface/DDExpandedViewDump.h"
#include "DetectorDescription/Core/interface/DDExpandedView.h"
Go to the source code of this file.
Namespaces | |
namespace | std |
Functions | |
void | DDExpandedViewDump (ostream &os, DDExpandedView &ex, size_t skip, size_t sto) |
void DDExpandedViewDump | ( | ostream & | os, | |
DDExpandedView & | ex, | |||
size_t | skip, | |||
size_t | sto | |||
) |
Definition at line 11 of file DDExpandedViewDump.cc.
References DDExpandedView::copyno(), count, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), flush(), DDExpandedView::geoHistory(), it, DDExpandedView::logicalPart(), DDBase< N, C >::name(), DDExpandedView::next(), HLT_VtxMuL3::result, DDExpandedView::rotation(), s, DDExpandedView::translation(), and v.
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 }