File indexing completed on 2025-01-18 10:11:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGeoOpticalSurface
0013 #define ROOT_TGeoOpticalSurface
0014
0015 #include <TNamed.h>
0016 #include <TList.h>
0017
0018
0019
0020
0021
0022
0023
0024
0025 class TGDMLMatrix;
0026
0027 class TGeoOpticalSurface : public TNamed {
0028 public:
0029 enum ESurfaceFinish {
0030 kFpolished,
0031 kFpolishedfrontpainted,
0032 kFpolishedbackpainted,
0033
0034 kFground,
0035 kFgroundfrontpainted,
0036 kFgroundbackpainted,
0037
0038 kFpolishedlumirrorair,
0039 kFpolishedlumirrorglue,
0040 kFpolishedair,
0041 kFpolishedteflonair,
0042 kFpolishedtioair,
0043 kFpolishedtyvekair,
0044 kFpolishedvm2000air,
0045 kFpolishedvm2000glue,
0046
0047 kFetchedlumirrorair,
0048 kFetchedlumirrorglue,
0049 kFetchedair,
0050 kFetchedteflonair,
0051 kFetchedtioair,
0052 kFetchedtyvekair,
0053 kFetchedvm2000air,
0054 kFetchedvm2000glue,
0055
0056 kFgroundlumirrorair,
0057 kFgroundlumirrorglue,
0058 kFgroundair,
0059 kFgroundteflonair,
0060 kFgroundtioair,
0061 kFgroundtyvekair,
0062 kFgroundvm2000air,
0063 kFgroundvm2000glue,
0064
0065
0066 kFRough_LUT,
0067 kFRoughTeflon_LUT,
0068 kFRoughESR_LUT,
0069 kFRoughESRGrease_LUT,
0070 kFPolished_LUT,
0071 kFPolishedTeflon_LUT,
0072 kFPolishedESR_LUT,
0073 kFPolishedESRGrease_LUT,
0074 kFDetector_LUT
0075 };
0076
0077 enum ESurfaceModel {
0078 kMglisur,
0079 kMunified,
0080 kMLUT,
0081 kMDAVIS,
0082 kMdichroic
0083 };
0084
0085 enum ESurfaceType {
0086 kTdielectric_metal,
0087 kTdielectric_dielectric,
0088 kTdielectric_LUT,
0089 kTdielectric_LUTDAVIS,
0090 kTdielectric_dichroic,
0091 kTfirsov,
0092 kTx_ray
0093 };
0094
0095 private:
0096 std::string fName = "";
0097 ESurfaceType fType = kTdielectric_metal;
0098 ESurfaceModel fModel = kMglisur;
0099 ESurfaceFinish fFinish = kFpolished;
0100
0101 Double_t fValue = 0.0;
0102 Double_t fSigmaAlpha = 0.0;
0103 Double_t fPolish = 0.0;
0104
0105 TList fProperties;
0106 TList fConstProperties;
0107
0108
0109 TGeoOpticalSurface(const TGeoOpticalSurface &) = delete;
0110 TGeoOpticalSurface &operator=(const TGeoOpticalSurface &) = delete;
0111
0112 public:
0113
0114 TGeoOpticalSurface() {}
0115
0116 TGeoOpticalSurface(const char *name, ESurfaceModel model = kMglisur, ESurfaceFinish finish = kFpolished,
0117 ESurfaceType type = kTdielectric_dielectric, Double_t value = 1.0);
0118
0119 ~TGeoOpticalSurface() override {}
0120
0121
0122 bool AddProperty(const char *property, const char *ref);
0123 bool AddConstProperty(const char *property, const char *ref);
0124 const char *GetPropertyRef(const char *property);
0125 const char *GetPropertyRef(Int_t i) const
0126 {
0127 return (fProperties.At(i) ? fProperties.At(i)->GetTitle() : nullptr);
0128 }
0129 const char *GetConstPropertyRef(const char *property) const;
0130 const char *GetConstPropertyRef(Int_t i) const
0131 {
0132 return (fConstProperties.At(i) ? fConstProperties.At(i)->GetTitle() : nullptr);
0133 }
0134 TList const &GetProperties() const { return fProperties; }
0135 TList const &GetConstProperties() const { return fConstProperties; }
0136 Int_t GetNproperties() const { return fProperties.GetSize(); }
0137 Int_t GetNconstProperties() const { return fConstProperties.GetSize(); }
0138 TGDMLMatrix *GetProperty(const char *name) const;
0139 TGDMLMatrix *GetProperty(Int_t i) const;
0140 Double_t GetConstProperty(const char *property, Bool_t *error = nullptr) const;
0141 Double_t GetConstProperty(Int_t i, Bool_t *error = nullptr) const;
0142 ESurfaceType GetType() const { return fType; }
0143 ESurfaceModel GetModel() const { return fModel; }
0144 ESurfaceFinish GetFinish() const { return fFinish; }
0145 Double_t GetPolish() const { return fPolish; }
0146 Double_t GetValue() const { return fValue; }
0147 Double_t GetSigmaAlpha() const { return fSigmaAlpha; }
0148
0149 void SetType(ESurfaceType type) { fType = type; }
0150 void SetModel(ESurfaceModel model) { fModel = model; }
0151 void SetFinish(ESurfaceFinish finish) { fFinish = finish; }
0152 void SetPolish(Double_t polish) { fPolish = polish; }
0153 void SetValue(Double_t value) { fValue = value; }
0154 void SetSigmaAlpha(Double_t sigmaalpha) { fSigmaAlpha = sigmaalpha; }
0155
0156 void Print(Option_t *option = "") const override;
0157
0158 static ESurfaceType StringToType(const char *type);
0159 static const char *TypeToString(ESurfaceType type);
0160 static ESurfaceModel StringToModel(const char *model);
0161 static const char *ModelToString(ESurfaceModel model);
0162 static ESurfaceFinish StringToFinish(const char *finish);
0163 static const char *FinishToString(ESurfaceFinish finish);
0164
0165 ClassDefOverride(TGeoOpticalSurface, 2)
0166 };
0167
0168
0169
0170
0171
0172
0173
0174
0175 class TGeoVolume;
0176
0177 class TGeoSkinSurface : public TNamed {
0178 private:
0179 TGeoOpticalSurface const *fSurface = nullptr;
0180 TGeoVolume const *fVolume = nullptr;
0181 public:
0182 TGeoSkinSurface() {}
0183 TGeoSkinSurface(const char *name, const char *ref, TGeoOpticalSurface const *surf, TGeoVolume const *vol)
0184 : TNamed(name, ref), fSurface(surf), fVolume(vol)
0185 {
0186 }
0187 ~TGeoSkinSurface() override {}
0188
0189 TGeoOpticalSurface const *GetSurface() const { return fSurface; }
0190 TGeoVolume const *GetVolume() const { return fVolume; }
0191
0192 void Print(Option_t *option = "") const override;
0193
0194 ClassDefOverride(TGeoSkinSurface, 1)
0195 };
0196
0197
0198
0199
0200
0201
0202
0203
0204 class TGeoNode;
0205
0206 class TGeoBorderSurface : public TNamed {
0207 private:
0208 TGeoOpticalSurface const *fSurface = nullptr;
0209 TGeoNode const *fNode1 = nullptr;
0210 TGeoNode const *fNode2 = nullptr;
0211 public:
0212 TGeoBorderSurface() {}
0213 TGeoBorderSurface(const char *name, const char *ref, TGeoOpticalSurface const *surf, TGeoNode const *node1,
0214 TGeoNode const *node2)
0215 : TNamed(name, ref), fSurface(surf), fNode1(node1), fNode2(node2)
0216 {
0217 }
0218 ~TGeoBorderSurface() override {}
0219
0220 TGeoOpticalSurface const *GetSurface() const { return fSurface; }
0221 TGeoNode const *GetNode1() const { return fNode1; }
0222 TGeoNode const *GetNode2() const { return fNode2; }
0223
0224 void Print(Option_t *option = "") const override;
0225
0226 ClassDefOverride(TGeoBorderSurface, 1)
0227 };
0228
0229 #endif