CMS 3D CMS Logo

DDMaterial.cc File Reference

#include "DetectorDescription/Base/interface/DDdebug.h"
#include "CLHEP/Units/SystemOfUnits.h"
#include "DetectorDescription/Core/interface/DDMaterial.h"
#include "DetectorDescription/Core/src/Material.h"
#include "DetectorDescription/Base/interface/DDException.h"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const DDMaterial &mat)


Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const DDMaterial mat 
)

Definition at line 132 of file DDMaterial.cc.

References DDMaterial::a(), DDMaterial::constituent(), DDMaterial::density(), lat::endl(), f, g, i, level, DDBase< N, C >::name(), DDMaterial::noOfConstituents(), s, and DDMaterial::z().

00133 { 
00134   static int level=0;
00135   ++level; 
00136   if (mat) {
00137     os << '[' << mat.name() <<']' << " z=" << mat.z() 
00138                      << " a=" << mat.a()/g*mole << "*g/mole" 
00139                      << " d=" << mat.density()/g*cm3 << "*g/cm3";
00140     std::string s(2*level,' ');              
00141     for (int i=0; i<mat.noOfConstituents(); ++i) {
00142        DDMaterial::FractionV::value_type f = mat.constituent(i);
00143        os << std::endl << s << i+1 << " : fm=" << f.second 
00144                   << " : " << f.first;
00145     }                
00146     //--level;
00147   } 
00148   else
00149     os << "* material not declared * ";  
00150   --level;   
00151   return os;
00152 }


Generated on Tue Jun 9 17:52:36 2009 for CMSSW by  doxygen 1.5.4