00001
00002
00003
00004
00005
00006
00007
00008
00010
00011 #include <cassert>
00012
00013 #include <TGeoManager.h>
00014 #include <TList.h>
00015
00016 #include "Util/UtilString.h"
00017 #include "Util/UtilMCFlag.h"
00018 using namespace UtilMCFlag;
00019 #include "Conventions/MinosMaterial.h"
00020 #include "GeoGeometry/GeoMediumMap.h"
00021 #include "MessageService/MsgService.h"
00022 #include "UgliGeometry/UgliLoanPool.h"
00023 #include "GeoGeometry/GeoGeometry.h"
00024 #include "GeoGeometry/GeoMedium.h"
00025 #include "Registry/Registry.h"
00026
00027 ClassImp(GeoMediumMap)
00028
00029 CVSID("$Id: GeoMediumMap.cxx,v 1.13 2009/09/30 16:49:27 schubert Exp $");
00030
00031
00032 GeoMediumMap::GeoMediumMap(GeoGeometry* geo,const VldContext& vldc) :
00033 fGeoGeometry(geo),fVldContext(vldc) {
00034
00035
00036 MSG("Geo",Msg::kDebug) << "GeoMediumMap normal ctor @ " << this
00037 << " w/vldc " << vldc << " fGeoGeometry "
00038 << fGeoGeometry << endl;
00039
00040 UpdateGlobalManager();
00041
00042 BuildMediums();
00043 BuildMediumMap();
00044
00045 }
00046
00047
00048 void GeoMediumMap::UpdateGlobalManager() const {
00049
00050 if ( fGeoGeometry ) fGeoGeometry -> UpdateGlobalManager();
00051 else gGeoManager = 0;
00052
00053 }
00054
00055
00056 GeoMedium* GeoMediumMap::GetMedium(Geo::EDetComponent detcomp) const {
00057
00058
00059 MediumMapConstItr citr = fMediumMap.find(detcomp);
00060 if ( citr == fMediumMap.end() ) {
00061 MSG("Geo",Msg::kWarning) << "GeoMediumMap::GetMedium unable to find "
00062 << "medium for detcomponent "
00063 << Geo::AsString(detcomp) << "." << endl;
00064 return (GeoMedium*)0;
00065 }
00066
00067 return const_cast<GeoMedium*>(citr->second);
00068
00069 }
00070
00071
00072 Geo::EFldStrength GeoMediumMap::GetFldStrength(Geo::EDetComponent detcomp)
00073 const {
00074
00075
00076 FldStrengthMapConstItr citr = fFldStrengthMap.find(detcomp);
00077 if ( citr == fFldStrengthMap.end() ) {
00078 MSG("Geo",Msg::kWarning) << "GeoMediumMap::GetFldStrength unable to find "
00079 << "field strength for detcomponent "
00080 << Geo::AsString(detcomp) << "." << endl;
00081 return Geo::kUnknownFldStrength;
00082 }
00083
00084 return citr->second;
00085
00086 }
00087
00088
00089 void GeoMediumMap::BuildMediums() {
00090
00091
00092 UpdateGlobalManager();
00093
00094 MSG("Geo",Msg::kDebug) << "GeoMediumMap::BuildMediums " << endl;
00095 assert(gGeoManager);
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 Float_t fieldM_iron = 20.;
00120 Float_t fieldM = 6.;
00121
00122
00123 Int_t isSens = 1;
00124 Int_t isNotSens = 0;
00125
00126
00127 Int_t medId = 1;
00128 Int_t matId = 1;
00129
00130
00131
00132
00133 TGeoMaterial *mat1 = new TGeoMaterial("ALUMINIUM",26.98, 13, 2.7);
00134 mat1->SetUniqueID(matId);
00135 medId = CreateMediumsforMaterial("ALUM",medId,matId,isNotSens,fieldM);
00136
00137 medId++;
00138 matId++;
00139
00140
00141
00142
00143 TGeoMaterial *mat2 = new TGeoMaterial("IRON",55.85, 26, 7.87);
00144 mat2->SetUniqueID(matId);
00145 medId = CreateMediumsforMaterial("IRON",medId, matId,isNotSens,fieldM_iron);
00146
00147 medId++;
00148 matId++;
00149
00150
00151
00152 TGeoMixture *mat3 = new TGeoMixture("AIR",2,0.1205000E-02);
00153 mat3->SetUniqueID(matId);
00154 mat3->DefineElement(0,14.01,7,0.7);
00155 mat3->DefineElement(1,16.00,8,0.3);
00156 medId = CreateMediumsforMaterial("AIR",medId, matId,isNotSens,fieldM);
00157
00158 medId++;
00159 matId++;
00160
00161
00162
00163
00164 TGeoMixture *mat4 = new TGeoMixture("CONCRETE",6, 2.5);
00165 mat4->SetUniqueID(matId);
00166 mat4->DefineElement(0,16,8,0.53);
00167 mat4->DefineElement(1,28.09,14,0.33);
00168 mat4->DefineElement(2,40.078,20,0.6300000E-01);
00169 mat4->DefineElement(3,22.99,11,0.1500000E-01);
00170 mat4->DefineElement(4,55.85,26,0.2000000E-01);
00171 mat4->DefineElement(5,26.98,13,0.4200000E-01);
00172 medId = CreateMediumsforMaterial("CONCRETE",medId, matId,isNotSens,fieldM);
00173
00174 medId++;
00175 matId++;
00176
00177
00178
00179
00180
00181 TGeoMixture *mat5 = new TGeoMixture("ROCK",6, 2.5);
00182 mat5->SetUniqueID(matId);
00183 mat5->DefineElement(0,16,8,0.53);
00184 mat5->DefineElement(1,28.09,14,0.33);
00185 mat5->DefineElement(2,40.078,20,0.6300000E-01);
00186 mat5->DefineElement(3,22.99,11,0.1500000E-01);
00187 mat5->DefineElement(4,55.85,26,0.2000000E-01);
00188 mat5->DefineElement(5,26.98,13,0.4200000E-01);
00189 medId = CreateMediumsforMaterial("ROCK",medId, matId,isNotSens,fieldM);
00190
00191 medId++;
00192 matId++;
00193
00194
00195
00196
00197
00198 TGeoMixture *mat6 = new TGeoMixture("PSTYRENE SCINT",2, 1.0457);
00199 mat6->SetUniqueID(matId);
00200 mat6->DefineElement(0,1.00794,1,0.7742105E-01);
00201 mat6->DefineElement(1,12.011,6,0.9225789);
00202
00203 medId = CreateMediumsforMaterial("PSTYRENE SCINT",medId,matId,isSens,
00204 fieldM);
00205
00206 medId++;
00207 matId++;
00208
00209
00210
00211
00212
00213
00214 TGeoMixture *mat7 = new TGeoMixture("COEX TIO2 PSTYRENE",4, 1.0457);
00215 mat7->SetUniqueID(matId);
00216 mat7->DefineElement(0,1.00794,1,0.6967895E-01);
00217 mat7->DefineElement(1,12.011,6,0.8303211);
00218 mat7->DefineElement(2,47.93,22,0.5996587E-01);
00219 mat7->DefineElement(3,15.9994,8,0.4003413E-01);
00220
00221 medId = CreateMediumsforMaterial("COEX TIO2 PSTYRENE",medId,matId,
00222 isNotSens,fieldM);
00223
00224 medId++;
00225 matId++;
00226
00227
00228
00229 TGeoMixture *mat8 = new TGeoMixture("FARCOIL",5, 2.34881 );
00230 mat8->SetUniqueID(matId);
00231 mat8->DefineElement(0,1.00794,1,0.1281415E-01);
00232 mat8->DefineElement(1,12.0107,6,0.6021570E-01);
00233 mat8->DefineElement(2,14.00674,7,0.1974151E-03);
00234 mat8->DefineElement(3,15.9994,8,0.2134690E-01);
00235 mat8->DefineElement(4,63.546,29,0.9054258);
00236 medId = CreateMediumsforMaterial("FARCOIL",medId, matId,isNotSens,fieldM);
00237
00238 medId++;
00239 matId++;
00240
00241
00242
00243
00244
00245 TGeoMixture *mat9 = new TGeoMixture("DOLOMITE",5, 2.850000 );
00246 mat9->SetUniqueID(matId);
00247 mat9->DefineElement(0,40.078,20,0.2161123);
00248 mat9->DefineElement(1,24.305,12,0.1310597);
00249 mat9->DefineElement(2,12.011,6,0.1295336);
00250 mat9->DefineElement(3,15.9994,8,0.5226618);
00251 mat9->DefineElement(4,1.0079,1,0.6326329E-03);
00252 medId = CreateMediumsforMaterial("DOLOMITE",medId, matId,isNotSens,fieldM);
00253
00254 medId++;
00255 matId++;
00256
00257
00258
00259
00260
00261 Double_t densFEPL = 7.847;
00262 if ( fVldContext.GetDetector() == Detector::kCalDet ) densFEPL = 7.85;
00263 TGeoMixture *mat10 = new TGeoMixture("FEPL",17, densFEPL);
00264 mat10->SetUniqueID(matId);
00265 mat10->DefineElement(0,54,26,0.5556792E-01);
00266 mat10->DefineElement(1,56,26,0.9046049);
00267 mat10->DefineElement(2,57,26,0.2126433E-01);
00268 mat10->DefineElement(3,58,26,0.2879539E-02);
00269 mat10->DefineElement(4,54.94,25,0.1016047E-01);
00270 mat10->DefineElement(5,28.09,14,0.2917362E-02);
00271 mat10->DefineElement(6,12.01,6,0.1810777E-02);
00272 mat10->DefineElement(7,58.7,28,0.2112573E-03);
00273 mat10->DefineElement(8,52,24,0.1810777E-03);
00274 mat10->DefineElement(9,30.97,15,0.1508981E-03);
00275 mat10->DefineElement(10,32.06,16,0.8047896E-04);
00276 mat10->DefineElement(11,63.55,29,0.7041910E-04);
00277 mat10->DefineElement(12,26.98,13,0.3017961E-04);
00278 mat10->DefineElement(13,14.01,7,0.3017961E-04);
00279 mat10->DefineElement(14,118.69,50,0.2011974E-04);
00280 mat10->DefineElement(15,47.9,22,0.1005987E-04);
00281 mat10->DefineElement(16,50.94,23,0.1005987E-04);
00282 medId = CreateMediumsforMaterial("FEPL",medId, matId,isNotSens,fieldM_iron);
00283
00284 medId++;
00285 matId++;
00286
00287
00288
00289 MinosMaterial::StdMaterial_t matWater=MinosMaterial::eWater;
00290 TGeoMixture* mat11 = new TGeoMixture("WATER",2,
00291 MinosMaterial::Density(matWater) );
00292 mat11 -> SetUniqueID(matId);
00293 mat11 -> DefineElement(0,1.00794,1,0.1118984);
00294 mat11 -> DefineElement(1,15.9994,8,0.8881017);
00295 medId = CreateMediumsforMaterial("WATER",medId,matId,isNotSens,fieldM);
00296
00297 medId++;
00298 matId++;
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308 TGeoMixture *mat12 = new TGeoMixture("GREENSTONE",13, 2.760);
00309 mat12->SetUniqueID(matId);
00310 mat12->DefineElement( 0,15.999, 8,0.4586);
00311 mat12->DefineElement( 1,28.086,14,0.2370);
00312 mat12->DefineElement( 2,55.845,26,0.0856);
00313 mat12->DefineElement( 3,26.982,13,0.0797);
00314 mat12->DefineElement( 4,40.078,20,0.0641);
00315 mat12->DefineElement( 5,24.305,12,0.0395);
00316 mat12->DefineElement( 6,22.990,11,0.0190);
00317 mat12->DefineElement( 7,47.867,22,0.0064);
00318 mat12->DefineElement( 8,39.098,19,0.0034);
00319 mat12->DefineElement( 9, 1.008, 1,0.0026);
00320 mat12->DefineElement(10,12.011, 6,0.0020);
00321 mat12->DefineElement(11,54.938,25,0.0015);
00322 mat12->DefineElement(12,30.974,15,0.0006);
00323 medId = CreateMediumsforMaterial("GREENSTONE",medId,matId,isNotSens,fieldM);
00324
00325 medId++;
00326 matId++;
00327
00328
00329
00330
00331
00332
00333
00334
00335 TGeoMixture *mat13 = new TGeoMixture("NEARBEDROCK",5, 2.43);
00336 mat13->SetUniqueID(matId);
00337 mat13->DefineElement( 0,15.999, 8,0.550);
00338 mat13->DefineElement( 1,40.078,20,0.200);
00339 mat13->DefineElement( 2,24.305,12,0.121);
00340 mat13->DefineElement( 3,12.011, 6,0.120);
00341 mat13->DefineElement( 4, 1.008, 1,0.009);
00342 medId = CreateMediumsforMaterial("NEARBEDROCK",medId,matId,isNotSens,
00343 fieldM);
00344
00345 medId++;
00346 matId++;
00347
00348
00349
00350
00351
00352
00353
00354 TGeoMaterial *mat14 = new TGeoMaterial("LEAD",207.2,82,11.35);
00355 mat14->SetUniqueID(matId);
00356 medId = CreateMediumsforMaterial("LEAD",medId, matId,isNotSens,fieldM);
00357
00358 medId++;
00359 matId++;
00360
00361
00362
00363
00364
00365
00366 Int_t nmed = medId - 1;
00367 TList* medList = gGeoManager -> GetListOfMedia();
00368 for ( int imed = 0; imed < nmed; imed++ ) {
00369 GeoMedium* medium = dynamic_cast<GeoMedium*>(medList->At(imed));
00370 std::string medName = medium->GetName();
00371 Int_t npos = medName.find("_B");
00372 std::string medBaseName = medName.substr(0,npos);
00373 std::string medSwimName
00374 = medBaseName+"_SWIM"+medName.substr(npos,medName.length()-npos);
00375
00376
00377 TGeoMaterial* material = medium -> GetMaterial();
00378 Double_t param[20];
00379 for ( int ipar = 0; ipar < 20; ipar++ ) {
00380 param[ipar] = medium -> GetParam(ipar);
00381 }
00382 param[6] = 0.01;
00383 GeoMedium* swimMed= new GeoMedium(medSwimName.c_str(),medId++,material,
00384 param);
00385
00386 for ( EProcess ip = EProcess(0); ip < kNProcess; ip = EProcess(ip+1) ) {
00387 if ( ip == kLOSS ) swimMed -> SetProcess(kLOSS,4);
00388 else swimMed -> SetProcess(ip,0);
00389 }
00390 for ( ECut ic = ECut(0); ic < kNCut; ic = ECut(ic+1) ) {
00391 if ( ic == kTOFMAX ) continue;
00392 if ( ic == kCUTMUO ) swimMed -> SetCut(kCUTMUO,0.0001);
00393 else swimMed -> SetCut(ic,1000.);
00394 }
00395 ConfigureMedium(swimMed);
00396 }
00397
00398
00399 return;
00400
00401 }
00402
00403
00404 void GeoMediumMap::Print(Option_t* ) const {
00405
00406
00407
00408 MediumMapConstItr citr;
00409 cout << setiosflags(ios::left)
00410 << setw(15) << "DetComponent"
00411 << setw(30) << "Medium"
00412 << setw(15) << "FldStrength"
00413 << setw(15) << "SwimMethod"
00414 << endl;
00415 cout << setiosflags(ios::left)
00416 << setfill('-') << setw(12) << "-"
00417 << setfill(' ') << setw(3) << " "
00418 << setfill('-') << setw(6) << "-"
00419 << setfill(' ') << setw(24) << " "
00420 << setfill('-') << setw(11) << "-"
00421 << setfill(' ') << setw(4) << " "
00422 << setfill('-') << setw(10) << "-"
00423 << setfill(' ') << setw(5) << " "
00424 << endl;
00425
00426 for (citr = fMediumMap.begin(); citr != fMediumMap.end(); citr++ ) {
00427 Geo::EFldStrength fldstrength = GetFldStrength(citr->first);
00428 Geo::ESwimMethod swimmethod = GetSwimMethod(fldstrength);
00429
00430 cout << setiosflags(ios::left) << setfill(' ')
00431 << setw(15) << Geo::AsString(citr->first)
00432 << setw(30) << citr->second->GetName()
00433 << setw(15) << Geo::AsString(fldstrength)
00434 << setw(15) << Geo::AsString(swimmethod)
00435 << endl;
00436 }
00437
00438 }
00439
00440
00441 int GeoMediumMap::CreateMediumsforMaterial(std::string medbasename,
00442 int medId, int matId, int isVol, float fieldM) {
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476 Float_t tMaxFd = -1.;
00477 Float_t steMax = -1.;
00478 Float_t deeMax = -1.;
00479 Float_t stMin = -1.;
00480
00481 Float_t epsil = +0.0001;
00482 Float_t field_epsil = +0.01;
00483
00484
00485 std::string medname;
00486 GeoMedium* med = 0;
00487
00488 medname = medbasename + "_B" +UtilString::ToString<int>(Geo::kNoFieldSwim);
00489 med = new GeoMedium(medname.c_str(),medId,matId,isVol, Geo::kNoFieldSwim,
00490 fieldM,tMaxFd,steMax,deeMax,epsil,stMin);
00491 ConfigureMedium(med);
00492
00493 medId++;
00494
00495
00496 medname = medbasename + "_B" + UtilString::ToString<int>(Geo::kRungeKutta);
00497 med = new GeoMedium(medname.c_str(),medId,matId,isVol,Geo::kRungeKutta,
00498 fieldM,tMaxFd,steMax,deeMax,field_epsil,stMin);
00499 ConfigureMedium(med);
00500
00501 medId++;
00502
00503
00504 medname = medbasename + "_B" + UtilString::ToString<int>(Geo::kStepHelix);
00505 med = new GeoMedium(medname.c_str(),medId,matId,isVol,Geo::kStepHelix,
00506 fieldM,tMaxFd,steMax,deeMax,field_epsil,stMin);
00507 ConfigureMedium(med);
00508
00509 return medId;
00510
00511 }
00512
00513
00514 void GeoMediumMap::ConfigureMedium(GeoMedium* med) {
00515
00516
00517
00518 std::string medName[2];
00519
00520 medName[1] = med->GetName();
00521 medName[0] = medName[1].substr(0,medName[1].find("_B"));
00522
00523
00524
00525 for ( int i = 0; i < 2; i++ ) {
00526
00527
00528 Registry medConfig
00529 = UgliLoanPool::Instance()->GetMediumRegistry(medName[i].c_str());
00530
00531 Registry::RegistryKey keyItr(&medConfig);
00532 while ( const char* newKey = keyItr() ) {
00533 Double_t tmpd;
00534 medConfig.Get(newKey,tmpd);
00535 UtilMCFlag::EProcess process = UtilMCFlag::GetProcess(newKey);
00536 if ( process != UtilMCFlag::kUnknownProcess )
00537 med -> SetProcess(process,(int)tmpd);
00538 else {
00539 UtilMCFlag::ECut cut = UtilMCFlag::GetCut(newKey);
00540 if ( cut != UtilMCFlag::kUnknownCut ) med -> SetCut(cut,tmpd);
00541 else {
00542 UtilMCFlag::ETracking trk = UtilMCFlag::GetTracking(newKey);
00543 if ( trk != UtilMCFlag::kUnknownTracking )
00544 med -> SetTracking(trk,tmpd);
00545 else {
00546 MSG("Geo",Msg::kWarning) << "Unknown medium config key "
00547 << newKey << " for medium "
00548 << med->GetName() << ". Ignored!"
00549 << endl;
00550 }
00551 }
00552 }
00553 }
00554 }
00555
00556 }
00557
00558
00559 void GeoMediumMap::BuildSwimMethodMap() {
00560
00561
00562
00563 fSwimMethodMap[Geo::kNoField] = Geo::kNoFieldSwim;
00564 fSwimMethodMap[Geo::kLowField] = Geo::kNoFieldSwim;
00565 fSwimMethodMap[Geo::kHighField] = Geo::kRungeKutta;
00566
00567
00568 const Registry& r = UgliLoanPool::Instance()->GetConfig();
00569 Int_t tmpi;
00570 if ( r.Get("SwimMethodLowField",tmpi) ) {
00571 Geo::ESwimMethod swimmethod = (Geo::ESwimMethod)tmpi;
00572 if ( swimmethod != fSwimMethodMap[Geo::kLowField] ) {
00573 MSG("Geo",Msg::kInfo) << "SwimMethod for components w/field strength "
00574 << Geo::AsString(Geo::kLowField) << " set to "
00575 << Geo::AsString(swimmethod)
00576 << " overriding default "
00577 << Geo::AsString(fSwimMethodMap[Geo::kLowField])
00578 << "." << endl;
00579 fSwimMethodMap[Geo::kLowField] = swimmethod;
00580 }
00581 }
00582
00583 if ( r.Get("SwimMethodHighField",tmpi) ) {
00584 Geo::ESwimMethod swimmethod = (Geo::ESwimMethod)tmpi;
00585 if ( swimmethod != fSwimMethodMap[Geo::kHighField] ) {
00586 MSG("Geo",Msg::kInfo) << "SwimMethod for components w/field strength "
00587 << Geo::AsString(Geo::kHighField) << " set to "
00588 << Geo::AsString(swimmethod)
00589 << " overriding default "
00590 << Geo::AsString(fSwimMethodMap[Geo::kHighField])
00591 << "." << endl;
00592 fSwimMethodMap[Geo::kHighField] = swimmethod;
00593 }
00594 }
00595
00596 }
00597
00598
00599 bool GeoMediumMap::BuildMediumMap() {
00600
00601
00602 bool isOkay = true;
00603 Detector::Detector_t dettype = fVldContext.GetDetector();
00604
00605
00606 BuildSwimMethodMap();
00607
00608 switch( dettype ) {
00609
00610 case Detector::kFar:
00611
00612 BuildFarMediumMap();
00613 break;
00614
00615 case Detector::kNear:
00616
00617 BuildNearMediumMap();
00618 break;
00619
00620 case Detector::kCalDet:
00621
00622 BuildCalMediumMap();
00623 break;
00624
00625 default:
00626
00627 BuildDefMediumMap();
00628 break;
00629
00630 }
00631
00632 return isOkay;
00633
00634 }
00635
00636
00637 void GeoMediumMap::BuildFarMediumMap() {
00638
00639
00640
00641 SetMedium(Geo::kMars, "GREENSTONE", Geo::kNoField);
00642 SetMedium(Geo::kLinr, "GREENSTONE", Geo::kNoField);
00643 SetMedium(Geo::kHall, "AIR", Geo::kNoField);
00644 SetMedium(Geo::kRCCoil, "FARCOIL", Geo::kNoField);
00645 SetMedium(Geo::kRCAir, "AIR", Geo::kNoField);
00646 SetMedium(Geo::kVSStpScint, "PSTYRENE SCINT", Geo::kNoField);
00647 SetMedium(Geo::kVSStpTiO2, "COEX TIO2 PSTYRENE", Geo::kNoField);
00648 SetMedium(Geo::kVSMdlAlSkin,"ALUM", Geo::kNoField);
00649 SetMedium(Geo::kVSMdlAir, "AIR", Geo::kNoField);
00650 SetMedium(Geo::kVSPlnScint, "AIR", Geo::kNoField);
00651 SetMedium(Geo::kSoLo, "LEAD", Geo::kNoField);
00652
00653
00654
00655 SetMedium(Geo::kStpScint, "PSTYRENE SCINT", Geo::kLowField);
00656 SetMedium(Geo::kStpTiO2, "COEX TIO2 PSTYRENE",Geo::kLowField);
00657 SetMedium(Geo::kMdlAlSkin, "ALUM", Geo::kLowField);
00658 SetMedium(Geo::kMdlAir, "AIR", Geo::kLowField);
00659 SetMedium(Geo::kPlnScint, "AIR", Geo::kLowField);
00660 SetMedium(Geo::kPlnAirGap, "AIR", Geo::kLowField);
00661
00662
00663
00664 SetMedium(Geo::kPlnSteel, "FEPL", Geo::kHighField);
00665 SetMedium(Geo::kCRGapCoil, "FARCOIL", Geo::kHighField);
00666 SetMedium(Geo::kCRGapThroat,"AIR", Geo::kHighField);
00667 SetMedium(Geo::kCRGapFlange,"IRON", Geo::kHighField);
00668 SetMedium(Geo::kCRGapBypass,"AIR", Geo::kHighField);
00669 SetMedium(Geo::kCRStlCoil, "FARCOIL", Geo::kHighField);
00670 SetMedium(Geo::kCRStlThroat,"AIR", Geo::kHighField);
00671 SetMedium(Geo::kCRStlNeck, "IRON", Geo::kHighField);
00672 SetMedium(Geo::kCRStlHole, "AIR", Geo::kHighField);
00673 SetMedium(Geo::kCRStlDetail,"FEPL", Geo::kHighField);
00674 SetMedium(Geo::kCRSctCoil, "FARCOIL", Geo::kHighField);
00675 SetMedium(Geo::kCRSctThroat,"AIR", Geo::kHighField);
00676 SetMedium(Geo::kCRSctFlange,"IRON", Geo::kHighField);
00677 SetMedium(Geo::kCRSctBypass,"AIR", Geo::kHighField);
00678
00679 }
00680
00681
00682 void GeoMediumMap::BuildNearMediumMap() {
00683
00684
00685
00686 SetMedium(Geo::kMars, "NEARBEDROCK", Geo::kNoField);
00687 SetMedium(Geo::kLinr, "NEARBEDROCK", Geo::kNoField);
00688 SetMedium(Geo::kHall, "AIR", Geo::kNoField);
00689 SetMedium(Geo::kRCCoil, "ALUM", Geo::kNoField);
00690 SetMedium(Geo::kRCAir, "AIR", Geo::kNoField);
00691 SetMedium(Geo::kRCShaft, "IRON", Geo::kNoField);
00692
00693
00694
00695 SetMedium(Geo::kStpScint, "PSTYRENE SCINT", Geo::kLowField);
00696 SetMedium(Geo::kStpTiO2, "COEX TIO2 PSTYRENE",Geo::kLowField);
00697 SetMedium(Geo::kMdlAlSkin, "ALUM", Geo::kLowField);
00698 SetMedium(Geo::kMdlAir, "AIR", Geo::kLowField);
00699 SetMedium(Geo::kPlnScint, "AIR", Geo::kLowField);
00700 SetMedium(Geo::kPlnAirGap, "AIR", Geo::kLowField);
00701
00702
00703
00704 SetMedium(Geo::kPlnSteel, "FEPL", Geo::kHighField);
00705 SetMedium(Geo::kCRGapWater, "WATER", Geo::kHighField);
00706 SetMedium(Geo::kCRGapCoil, "ALUM", Geo::kHighField);
00707 SetMedium(Geo::kCRGapThroat,"AIR", Geo::kHighField);
00708 SetMedium(Geo::kCRGapFlange,"IRON", Geo::kHighField);
00709 SetMedium(Geo::kCRGapBypass,"AIR", Geo::kHighField);
00710 SetMedium(Geo::kCRStlWater, "WATER", Geo::kHighField);
00711 SetMedium(Geo::kCRStlCoil, "ALUM", Geo::kHighField);
00712 SetMedium(Geo::kCRStlThroat,"AIR", Geo::kHighField);
00713 SetMedium(Geo::kCRStlNeck, "IRON", Geo::kHighField);
00714 SetMedium(Geo::kCRStlHole, "AIR", Geo::kHighField);
00715 SetMedium(Geo::kCRStlDetail,"FEPL", Geo::kHighField);
00716 SetMedium(Geo::kCRSctWater, "WATER", Geo::kHighField);
00717 SetMedium(Geo::kCRSctCoil, "ALUM", Geo::kHighField);
00718 SetMedium(Geo::kCRSctThroat,"AIR", Geo::kHighField);
00719 SetMedium(Geo::kCRSctFlange,"IRON", Geo::kHighField);
00720 SetMedium(Geo::kCRSctBypass,"AIR", Geo::kHighField);
00721
00722 }
00723
00724
00725 void GeoMediumMap::BuildCalMediumMap() {
00726
00727
00728
00729 SetMedium(Geo::kMars, "ROCK", Geo::kNoField);
00730 SetMedium(Geo::kLinr, "CONCRETE", Geo::kNoField);
00731 SetMedium(Geo::kHall, "AIR", Geo::kNoField);
00732 SetMedium(Geo::kVSStpScint, "PSTYRENE SCINT", Geo::kNoField);
00733 SetMedium(Geo::kVSStpTiO2, "COEX TIO2 PSTYRENE", Geo::kNoField);
00734 SetMedium(Geo::kVSMdlAlSkin,"ALUM", Geo::kNoField);
00735 SetMedium(Geo::kVSMdlAir, "AIR", Geo::kNoField);
00736 SetMedium(Geo::kVSPlnScint, "AIR", Geo::kNoField);
00737 SetMedium(Geo::kStpScint, "PSTYRENE SCINT", Geo::kNoField);
00738 SetMedium(Geo::kStpTiO2, "COEX TIO2 PSTYRENE", Geo::kNoField);
00739 SetMedium(Geo::kMdlAlSkin, "ALUM", Geo::kNoField);
00740 SetMedium(Geo::kMdlAir, "AIR", Geo::kNoField);
00741 SetMedium(Geo::kPlnScint, "AIR", Geo::kNoField);
00742 SetMedium(Geo::kPlnAirGap, "AIR", Geo::kNoField);
00743 SetMedium(Geo::kPlnSteel, "FEPL", Geo::kNoField);
00744
00745 }
00746
00747
00748 void GeoMediumMap::BuildDefMediumMap() {
00749
00750
00751
00752
00753 SetMedium(Geo::kMars, "ROCK", Geo::kNoField);
00754 SetMedium(Geo::kLinr, "CONCRETE", Geo::kNoField);
00755 SetMedium(Geo::kHall, "AIR", Geo::kNoField);
00756
00757 }
00758
00759
00760 void GeoMediumMap::SetMedium(Geo::EDetComponent detcomp,
00761 std::string medbasename,
00762 Geo::EFldStrength fldstrength) {
00763
00764
00765
00766 Geo::ESwimMethod swimmethod = GetSwimMethod(fldstrength);
00767
00768 std::string usermedname = UgliLoanPool::Instance()->GetMedium(detcomp);
00769 if (!usermedname.empty()) {
00770 MSG("Geo",Msg::kInfo) << "Medium for component "
00771 << Geo::AsString(detcomp) << " set to "
00772 << usermedname.c_str() << " overriding default "
00773 << medbasename.c_str() << "." << endl;
00774 medbasename = usermedname;
00775 }
00776
00777 std::string medname = medbasename + "_B"
00778 + UtilString::ToString<int>(swimmethod);
00779 GeoMedium* medium
00780 = dynamic_cast<GeoMedium*>(gGeoManager->GetMedium(medname.c_str()));
00781 if ( !medium ) {
00782 MSG("Geo",Msg::kError) << "GeoMediumMap::SetMedium failed to find "
00783 << "medium of name " << medname.c_str()
00784 << "\nfor component " << Geo::AsString(detcomp)
00785 << ". Abort." << endl;
00786 abort();
00787 }
00788
00789 fMediumMap[detcomp] = medium;
00790 fFldStrengthMap[detcomp] = fldstrength;
00791
00792 }