#include <DetectorDescription/OfflineDBLoader/interface/GeometryInfoDump.h>
Public Member Functions | |
void | dumpInfo (bool dumpHistory, bool dumpSpecs, bool dumpPosInfo, const DDCompactView &cpv) |
GeometryInfoDump () | |
~GeometryInfoDump () |
Definition at line 3 of file GeometryInfoDump.h.
GeometryInfoDump::GeometryInfoDump | ( | ) |
GeometryInfoDump::~GeometryInfoDump | ( | ) |
void GeometryInfoDump::dumpInfo | ( | bool | dumpHistory, | |
bool | dumpSpecs, | |||
bool | dumpPosInfo, | |||
const DDCompactView & | cpv | |||
) |
Definition at line 23 of file GeometryInfoDump.cc.
References DDBase< DDName, DDI::Specific * >::begin(), GenMuonPlsPt100GeV_cfg::cout, dump(), DDBase< DDName, DDI::Specific * >::end(), lat::endl(), DDExpandedView::geoHistory(), DDExpandedView::logicalPart(), DDExpandedView::navPos(), DDExpandedView::next(), DDExpandedView::rotation(), DDExpandedView::translation(), x, y, and z.
00024 { 00025 00026 DDExpandedView epv(cpv); 00027 std::cout << "Top Most LogicalPart =" << epv.logicalPart() << std::endl; 00028 if ( dumpHistory || dumpPosInfo) { 00029 if ( dumpPosInfo ) { 00030 std::cout << "After the GeoHistory in the output file dumpGeoHistoryOnRead you will see x, y, z, r11, r12, r13, r21, r22, r23, r31, r32, r33" << std::endl; 00031 } 00032 typedef DDExpandedView::nav_type nav_type; 00033 typedef std::map<nav_type,int> id_type; 00034 id_type idMap; 00035 int id=0; 00036 std::ofstream dump("dumpGeoHistory"); 00037 do { 00038 nav_type pos = epv.navPos(); 00039 idMap[pos]=id; 00040 dump << id << " - " << epv.geoHistory(); 00041 DD3Vector x, y, z; 00042 epv.rotation().GetComponents(x,y,z); 00043 if ( dumpPosInfo ) { 00044 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.translation().x(); 00045 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.translation().y(); 00046 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.translation().z(); 00047 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().thetaX()/deg; 00048 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().phiX()/deg; 00049 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().thetaY()/deg; 00050 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().phiY()/deg; 00051 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().thetaZ()/deg; 00052 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().phiZ()/deg; 00053 00054 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().xx(); 00055 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().xy(); 00056 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().xz(); 00057 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().yx(); 00058 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().yy(); 00059 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().yz(); 00060 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().zx(); 00061 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().zy(); 00062 // dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << epv.rotation().zz(); 00063 00064 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.X(); 00065 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.X(); 00066 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.X(); 00067 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Y(); 00068 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Y(); 00069 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Y(); 00070 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Z(); 00071 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Z(); 00072 dump << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Z(); 00073 } 00074 dump << std::endl;; 00075 ++id; 00076 } while (epv.next()); 00077 dump.close(); 00078 } 00079 if ( dumpSpecs ) { 00080 DDSpecifics::iterator<DDSpecifics> spit(DDSpecifics::begin()), spend(DDSpecifics::end()); 00081 // ======= For each DDSpecific... 00082 std::ofstream dump("dumpSpecs"); 00083 for (; spit != spend; ++spit) { 00084 if ( !spit->isDefined().second ) continue; 00085 const DDSpecifics & sp = *spit; 00086 dump << sp << std::endl; 00087 } 00088 dump.close(); 00089 } 00090 }