00001
00002
00003
00004
00005
00006
00007
00008
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
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
00038
00039 MSG("Geo",Msg::kVerbose) << "GeoMedium normal ctor @ " << this
00040 << " for " << medname << endl;
00041
00042 }
00043
00044
00045 GeoMedium::GeoMedium() {
00046
00047
00048 MSG("Geo",Msg::kVerbose) << "GeoMedium default ctor @ " << this << endl;
00049
00050 }
00051
00052
00053 GeoMedium::~GeoMedium() {
00054
00055
00056 MSG("Geo",Msg::kVerbose) << "GeoMedium destructor @ " << this << endl;
00057
00058 }
00059
00060
00061 void GeoMedium::PrintHeader(Option_t* ) {
00062
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* ) const {
00096
00097
00098 cout << setiosflags(ios::left) << setw(27) << GetName()
00099 << setw(19) << GetMaterial()->GetName()
00100 << setw(6) << GetParam(0)
00101 << setw(5) << GetParam(1)
00102 << setw(5) << GetParam(2)
00103 << setw(7) << GetParam(3)
00104 << setw(7) << GetParam(4)
00105 << setw(7) << GetParam(5)
00106 << setw(6) << GetParam(6)
00107 << setw(6) << GetParam(7);
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
00133
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
00144
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
00155
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
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