28 ClassImp(TGeoOpticalSurface)
29 ClassImp(TGeoSkinSurface)
30 ClassImp(TGeoBorderSurface)
33 TGeoOpticalSurface::TGeoOpticalSurface(const
char *name, ESurfaceModel model, ESurfaceFinish finish,
34 ESurfaceType type, Double_t value)
35 : TNamed(name, ""), fType(type), fModel(model), fFinish(finish), fValue(value)
38 fProperties.SetOwner();
39 if (model == kMglisur) {
42 }
else if (model == kMunified || model == kMLUT || model == kMdichroic || model == kMDAVIS) {
46 Fatal(
"TGeoOpticalSurface::TGeoOpticalSurface()",
"Constructor called with INVALID model.");
51 TGeoOpticalSurface::ESurfaceType TGeoOpticalSurface::StringToType(
const char *name)
56 if ((stype ==
"dielectric_metal") || (stype ==
"0")) {
57 type = kTdielectric_metal;
58 }
else if ((stype ==
"dielectric_dielectric") || (stype ==
"1")) {
59 type = kTdielectric_dielectric;
60 }
else if ((stype ==
"dielectric_LUT") || (stype ==
"2")) {
61 type = kTdielectric_LUT;
62 }
else if ((stype ==
"dielectric_dichroic") || (stype ==
"3")) {
63 type = kTdielectric_dichroic;
64 }
else if ((stype ==
"firsov") || (stype ==
"4")) {
73 const char *TGeoOpticalSurface::TypeToString(ESurfaceType type)
77 case kTdielectric_metal:
return "dielectric_metal";
78 case kTdielectric_dielectric:
return "dielectric_dielectric";
79 case kTdielectric_LUT:
return "dielectric_LUT";
80 case kTdielectric_dichroic:
return "dielectric_dichroic";
81 case kTfirsov:
return "firsov";
82 case kTx_ray:
return "x_ray";
83 case kTdielectric_LUTDAVIS:;
86 return "unhandled surface type";
90 TGeoOpticalSurface::ESurfaceModel TGeoOpticalSurface::StringToModel(
const char *name)
96 if ((smodel ==
"glisur") || (smodel ==
"0")) {
98 }
else if ((smodel ==
"unified") || (smodel ==
"1")) {
100 }
else if ((smodel ==
"LUT") || (smodel ==
"2")) {
109 const char *TGeoOpticalSurface::ModelToString(ESurfaceModel model)
113 case kMglisur:
return "glisur";
114 case kMunified:
return "unified";
115 case kMLUT:
return "LUT";
116 case kMdichroic:
return "dichoic";
120 return "unhandled model type";
124 TGeoOpticalSurface::ESurfaceFinish TGeoOpticalSurface::StringToFinish(
const char *name)
127 TString sfinish(name);
128 ESurfaceFinish finish;
129 if ((sfinish ==
"polished") || (sfinish ==
"0")) {
131 }
else if ((sfinish ==
"polishedfrontpainted") || (sfinish ==
"1")) {
132 finish = kFpolishedfrontpainted;
133 }
else if ((sfinish ==
"polishedbackpainted") || (sfinish ==
"2")) {
134 finish = kFpolishedbackpainted;
135 }
else if ((sfinish ==
"ground") || (sfinish ==
"3")) {
137 }
else if ((sfinish ==
"groundfrontpainted") || (sfinish ==
"4")) {
138 finish = kFgroundfrontpainted;
139 }
else if ((sfinish ==
"groundbackpainted") || (sfinish ==
"5")) {
140 finish = kFgroundbackpainted;
141 }
else if ((sfinish ==
"polishedlumirrorair") || (sfinish ==
"6")) {
142 finish = kFpolishedlumirrorair;
143 }
else if ((sfinish ==
"polishedlumirrorglue") || (sfinish ==
"7")) {
144 finish = kFpolishedlumirrorglue;
145 }
else if ((sfinish ==
"polishedair") || (sfinish ==
"8")) {
146 finish = kFpolishedair;
147 }
else if ((sfinish ==
"polishedteflonair") || (sfinish ==
"9")) {
148 finish = kFpolishedteflonair;
149 }
else if ((sfinish ==
"polishedtioair") || (sfinish ==
"10")) {
150 finish = kFpolishedtioair;
151 }
else if ((sfinish ==
"polishedtyvekair") || (sfinish ==
"11")) {
152 finish = kFpolishedtyvekair;
153 }
else if ((sfinish ==
"polishedvm2000air") || (sfinish ==
"12")) {
154 finish = kFpolishedvm2000air;
155 }
else if ((sfinish ==
"polishedvm2000glue") || (sfinish ==
"13")) {
156 finish = kFpolishedvm2000glue;
157 }
else if ((sfinish ==
"etchedlumirrorair") || (sfinish ==
"14")) {
158 finish = kFetchedlumirrorair;
159 }
else if ((sfinish ==
"etchedlumirrorglue") || (sfinish ==
"15")) {
160 finish = kFetchedlumirrorglue;
161 }
else if ((sfinish ==
"etchedair") || (sfinish ==
"16")) {
162 finish = kFetchedair;
163 }
else if ((sfinish ==
"etchedteflonair") || (sfinish ==
"17")) {
164 finish = kFetchedteflonair;
165 }
else if ((sfinish ==
"etchedtioair") || (sfinish ==
"18")) {
166 finish = kFetchedtioair;
167 }
else if ((sfinish ==
"etchedtyvekair") || (sfinish ==
"19")) {
168 finish = kFetchedtyvekair;
169 }
else if ((sfinish ==
"etchedvm2000air") || (sfinish ==
"20")) {
170 finish = kFetchedvm2000air;
171 }
else if ((sfinish ==
"etchedvm2000glue") || (sfinish ==
"21")) {
172 finish = kFetchedvm2000glue;
173 }
else if ((sfinish ==
"groundlumirrorair") || (sfinish ==
"22")) {
174 finish = kFgroundlumirrorair;
175 }
else if ((sfinish ==
"groundlumirrorglue") || (sfinish ==
"23")) {
176 finish = kFgroundlumirrorglue;
177 }
else if ((sfinish ==
"groundair") || (sfinish ==
"24")) {
178 finish = kFgroundair;
179 }
else if ((sfinish ==
"groundteflonair") || (sfinish ==
"25")) {
180 finish = kFgroundteflonair;
181 }
else if ((sfinish ==
"groundtioair") || (sfinish ==
"26")) {
182 finish = kFgroundtioair;
183 }
else if ((sfinish ==
"groundtyvekair") || (sfinish ==
"27")) {
184 finish = kFgroundtyvekair;
185 }
else if ((sfinish ==
"groundvm2000air") || (sfinish ==
"28")) {
186 finish = kFgroundvm2000air;
188 finish = kFgroundvm2000glue;
195 const char *TGeoOpticalSurface::FinishToString(ESurfaceFinish finish)
198 case kFpolished:
return "polished";
199 case kFpolishedfrontpainted:
return "polishedfrontpainted";
200 case kFpolishedbackpainted:
return "polishedbackpainted";
202 case kFground:
return "ground";
203 case kFgroundfrontpainted:
return "groundfrontpainted";
204 case kFgroundbackpainted:
return "groundbackpainted";
206 case kFpolishedlumirrorair:
return "polishedlumirrorair";
207 case kFpolishedlumirrorglue:
return "polishedlumirrorglue";
208 case kFpolishedair:
return "polishedair";
209 case kFpolishedteflonair:
return "polishedteflonair";
210 case kFpolishedtioair:
return "polishedtioair";
211 case kFpolishedtyvekair:
return "polishedtyvekair";
212 case kFpolishedvm2000air:
return "polishedvm2000air";
213 case kFpolishedvm2000glue:
return "polishedvm2000glue";
215 case kFetchedlumirrorair:
return "etchedlumirrorair";
216 case kFetchedlumirrorglue:
return "etchedlumirrorglue";
217 case kFetchedair:
return "etchedair";
218 case kFetchedteflonair:
return "etchedteflonair";
219 case kFetchedtioair:
return "etchedtioair";
220 case kFetchedtyvekair:
return "etchedtyvekair";
221 case kFetchedvm2000air:
return "etchedvm2000air";
222 case kFetchedvm2000glue:
return "etchedvm2000glue";
224 case kFgroundlumirrorair:
return "groundlumirrorair";
225 case kFgroundlumirrorglue:
return "groundlumirrorglue";
226 case kFgroundair:
return "groundair";
227 case kFgroundteflonair:
return "groundteflonair";
228 case kFgroundtioair:
return "groundtioair";
229 case kFgroundtyvekair:
return "groundtyvekair";
230 case kFgroundvm2000air:
return "groundvm2000air";
231 case kFgroundvm2000glue:
return "groundvm2000glue";
233 case kFRoughTeflon_LUT:
235 case kFRoughESRGrease_LUT:
237 case kFPolishedTeflon_LUT:
238 case kFPolishedESR_LUT:
239 case kFPolishedESRGrease_LUT:
240 case kFDetector_LUT:;
243 return "unhandled model finish";
247 const char *TGeoOpticalSurface::GetPropertyRef(
const char *property)
250 TNamed *prop = (TNamed *)fProperties.FindObject(property);
251 return (prop) ? prop->GetTitle() :
nullptr;
255 TGDMLMatrix *TGeoOpticalSurface::GetProperty(
const char *property)
const
258 TNamed *prop = (TNamed*)fProperties.FindObject(property);
259 if ( !prop )
return nullptr;
260 return gGeoManager->GetGDMLMatrix(prop->GetTitle());
264 TGDMLMatrix *TGeoOpticalSurface::GetProperty(Int_t i)
const
267 TNamed *prop = (TNamed*)fProperties.At(i);
268 if ( !prop )
return nullptr;
269 return gGeoManager->GetGDMLMatrix(prop->GetTitle());
273 bool TGeoOpticalSurface::AddProperty(
const char *property,
const char *ref)
275 fProperties.SetOwner();
276 if (GetPropertyRef(property)) {
277 Error(
"AddProperty",
"Property %s already added to optical surface %s", property, GetName());
280 fProperties.Add(
new TNamed(property, ref));
285 void TGeoOpticalSurface::Print(Option_t *)
const
288 printf(
"*** opticalsurface: %s type: %s model: %s finish: %s value = %g\n", GetName(),
289 TGeoOpticalSurface::TypeToString(fType), TGeoOpticalSurface::ModelToString(fModel),
290 TGeoOpticalSurface::FinishToString(fFinish), fValue);
291 if (fProperties.GetSize()) {
292 TIter next(&fProperties);
294 while ((property = (TNamed *)next()))
295 printf(
" property: %s ref: %s\n", property->GetName(),
property->GetTitle());
300 void TGeoSkinSurface::Print(Option_t *)
const
304 Error(
"Print",
"Skin surface %s: volume not set", GetName());
307 printf(
"*** skinsurface: %s surfaceproperty: %s volumeref: %s \n", GetName(), GetTitle(), fVolume->GetName());
311 void TGeoBorderSurface::Print(Option_t *)
const
314 if (!fNode1 || !fNode2) {
315 Error(
"Print",
"Border surface %s: nodes not set", GetName());
318 printf(
"*** bordersurface: %s surfaceproperty: %s physvolref: %s %s \n", GetName(), GetTitle(),
319 fNode1->GetName(), fNode2->GetName());