Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GeoMedium.cxx

Go to the documentation of this file.
00001 
00002 //
00003 // GeoMedium
00004 //
00005 // GeoMedium IsA TGeoMedium with additional data members to store medium
00006 // specific cut and process flags.
00007 //
00008 // Author:  S. Kasahara 01/2008
00010 
00011 #include "MessageService/MsgService.h"
00012 #include "Util/UtilMCFlag.h"
00013 using namespace UtilMCFlag;
00014 #include "GeoGeometry/GeoMedium.h"
00015 
00016 ClassImp(GeoMedium)
00017 
00018 CVSID("$Id: GeoMedium.cxx,v 1.2 2008/01/09 07:00:05 schubert Exp $");
00019 
00020 //_____________________________________________________________________________
00021 GeoMedium::GeoMedium(const char* medname, Int_t medId, Int_t matId,
00022                      Int_t isvol, Geo::ESwimMethod ifield, Double_t fieldm, 
00023                      Double_t tmaxfd, Double_t stemax, Double_t deemax,
00024                      Double_t epsil, Double_t stmin) : 
00025   TGeoMedium(medname,medId,matId,isvol,ifield,fieldm,tmaxfd,stemax,
00026              deemax,epsil,stmin) {
00027   // Normal constructor. 
00028 
00029   MSG("Geo",Msg::kVerbose) << "GeoMedium normal ctor @ " << this
00030                            << " for " << medname << "." << endl;
00031 
00032 }
00033 
00034 //_____________________________________________________________________________
00035 GeoMedium::GeoMedium(const char* medname, Int_t medId, const TGeoMaterial* mat,
00036                      Double_t *params) : TGeoMedium(medname,medId,mat,params) {
00037   // Normal constructor. 
00038 
00039   MSG("Geo",Msg::kVerbose) << "GeoMedium normal ctor @ " << this
00040                            << " for " << medname << endl;
00041 
00042 }
00043 
00044 //_____________________________________________________________________________
00045 GeoMedium::GeoMedium() {
00046   // Default constructor. 
00047 
00048   MSG("Geo",Msg::kVerbose) << "GeoMedium default ctor @ " << this << endl;
00049 
00050 }
00051 
00052 //_____________________________________________________________________________
00053 GeoMedium::~GeoMedium() {
00054   // Destructor. 
00055 
00056   MSG("Geo",Msg::kVerbose) << "GeoMedium destructor @ " << this << endl;
00057 
00058 }
00059 
00060 //_____________________________________________________________________________
00061 void GeoMedium::PrintHeader(Option_t* /* option */) {
00062   // Static method to Print media table header.
00063 
00064     cout << setiosflags(ios::left) << setfill(' ') 
00065          << "Medium specific physics process & cut flags are listed after "
00066          << "medium definition if appropriate." << endl;  
00067     cout << setiosflags(ios::left) << setw(27) << "Medium" 
00068          << setw(19)  << "Material" 
00069          << setw(6)   << "isvol"
00070          << setw(5)   << "ifld"
00071          << setw(5)   << "fldm"
00072          << setw(7)   << "tmaxfd"
00073          << setw(7)   << "stemax"
00074          << setw(7)   << "deemax"
00075          << setw(6)   << "epsil"
00076          << setw(6)   << "stmin"
00077          << endl;
00078     cout << setiosflags(ios::left) 
00079          << setfill('-') <<  setw(6) << "-" << setfill(' ') << setw(21) << " "
00080          << setfill('-') <<  setw(8) << "-" << setfill(' ') << setw(11) << " "
00081          << setfill('-') <<  setw(5) << "-" << setfill(' ') << setw(1) << " "
00082          << setfill('-') <<  setw(4) << "-" << setfill(' ') << setw(1) << " "
00083          << setfill('-') <<  setw(4) << "-" << setfill(' ') << setw(1) << " "
00084          << setfill('-') <<  setw(6) << "-" << setfill(' ') << setw(1) << " "
00085          << setfill('-') <<  setw(6) << "-" << setfill(' ') << setw(1) << " "
00086          << setfill('-') <<  setw(6) << "-" << setfill(' ') << setw(1) << " "
00087          << setfill('-') <<  setw(5) << "-" << setfill(' ') << setw(1) << " "
00088          << setfill('-') <<  setw(5) << "-" << setfill(' ') << setw(1) << " "
00089          << endl;
00090   
00091 }
00092 
00093   
00094 //_____________________________________________________________________________
00095 void GeoMedium::Print(Option_t* /* option */) const {
00096   // Print medium.
00097 
00098   cout << setiosflags(ios::left) << setw(27) << GetName() 
00099        << setw(19) << GetMaterial()->GetName() 
00100        << setw(6)  << GetParam(0) // isvol
00101        << setw(5)  << GetParam(1) // ifield
00102        << setw(5)  << GetParam(2) // fieldm
00103        << setw(7)  << GetParam(3) // tmaxfd
00104        << setw(7)  << GetParam(4) // stemax
00105        << setw(7)  << GetParam(5) // deemax
00106        << setw(6)  << GetParam(6) // epsil
00107        << setw(6)  << GetParam(7); // stmin
00108   
00109   Int_t nflag = 0;
00110   const ProcessMap& processmap = GetProcessMap();
00111   for ( ProcessMapConstItr citr  = processmap.begin(); 
00112                            citr != processmap.end(); citr++ ) {
00113     if ( nflag%6 == 0 && nflag != 0 ) cout << "\n" << setw(95) << " ";
00114     cout << setw(5) << UtilMCFlag::AsString(citr->first) 
00115          << setw(2) << citr->second;
00116     nflag++;
00117   }
00118 
00119   const CutMap& cutmap = GetCutMap();
00120   for ( CutMapConstItr citr = cutmap.begin(); citr != cutmap.end(); citr++ ) {
00121     if ( nflag%3 == 0 && nflag !=0 ) cout << "\n" << setw(95) << " ";
00122     cout << setw(7) << UtilMCFlag::AsString(citr->first) 
00123          << setw(7) << citr->second;
00124     nflag++;
00125   }
00126   cout << endl;
00127   
00128 }
00129 
00130 //_____________________________________________________________________________
00131 Double_t GeoMedium::GetCut(UtilMCFlag::ECut cutflg) const {
00132   // Get medium specific cut value corresponding to cutflg.  
00133   // Return -1 if not in map.
00134   
00135   CutMapConstItr citr = fCutMap.find(cutflg);
00136   if ( citr != fCutMap.end() ) return citr -> second;
00137   else return -1;
00138   
00139 }
00140 
00141 //_____________________________________________________________________________
00142 Int_t GeoMedium::GetProcess(UtilMCFlag::EProcess processflg) const {
00143   // Get medium specific process value corresponding to processflg.
00144   // Return -1 if not in map. 
00145   
00146   ProcessMapConstItr citr = fProcessMap.find(processflg);
00147   if ( citr != fProcessMap.end() ) return citr -> second;
00148   else return -1;
00149 
00150 }
00151 
00152 //_____________________________________________________________________________
00153 Double_t GeoMedium::GetTracking(UtilMCFlag::ETracking trackingflg) const {
00154   // Get medium specific tracking value corresponding to trackingflg.
00155   // Return -1 if unknown.
00156 
00157   if ( trackingflg == UtilMCFlag::kUnknownTracking ) {
00158     MSG("Geo",Msg::kWarning) 
00159        << "GeoMedium::GetTracking called with trackingflg "
00160        << UtilMCFlag::AsString(trackingflg) << "." << endl;
00161     return -1;
00162   }
00163   
00164   return GetParam(trackingflg);
00165 
00166 }
00167 
00168 //_____________________________________________________________________________
00169 void GeoMedium::SetTracking(UtilMCFlag::ETracking trackingflg, 
00170                             Double_t tracking) {
00171   // Set tracking value associated with trackingflg
00172 
00173   if ( trackingflg == UtilMCFlag::kUnknownTracking ) {
00174     MSG("Geo",Msg::kWarning)
00175       << "GeoMedium::SetTracking called with trackingflg "
00176       << UtilMCFlag::AsString(trackingflg) << "." << endl;
00177     return;
00178   }
00179   if ( GetParam(trackingflg) != tracking ) {
00180     MSG("Geo",Msg::kDebug)
00181       << "Medium tracking parameter " << UtilMCFlag::AsString(trackingflg) 
00182       << " set to " << tracking << " for medium " << GetName()
00183       << " overriding existing " << GetParam(trackingflg) << "." << endl;    
00184   }
00185   
00186   SetParam(trackingflg,tracking);
00187   
00188 }
00189 
00190 
00191 

Generated on Mon Feb 15 11:06:45 2010 for loon by  doxygen 1.3.9.1