10 #include <TGeoManager.h>
35 std::ifstream is(mediaMapFileName);
38 if (!is.is_open())
return 0;
44 buffer.ReadLine(is, kTRUE);
48 if (buffer.BeginsWith(
"#") || buffer.IsNull())
51 if (buffer.BeginsWith(
"color"))
54 char color[128], medium[128];
56 sscanf(buffer.Data(),
"%s %f %f %f %s",
color, rgb + 0, rgb + 1, rgb + 2, medium);
60 if (fMediaMap->find(key) != fMediaMap->end())
return -1;
66 (*fMediaMap)[key] = mptr;
101 mediaMapFileName = TString(getenv(
"VMCWORKDIR")) +
fMediaName;
114 std::ifstream is(mediaMapFileName);
119 "\033[5m\033[31m Ambiguity: both single medium (%s) "
120 "and media file with this name (%s) exist! \033[0m",
127 "\033[5m\033[31m Failed to import media map file (%s)! \033[0m",
128 mediaMapFileName.Data());
143 TGeoMedium *gmedium = gGeoManager->GetMedium(medium);
144 if (gmedium)
return gmedium;
152 if (!fmedium)
return 0;
157 assert(gGeoManager->GetMedium(medium));
161 return gGeoManager->GetMedium(medium);