Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:53

0001 // @(#)root/geom:$Id$
0002 // Author: Andrei Gheata   05/12/18
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGeoOpticalSurface
0013 #define ROOT_TGeoOpticalSurface
0014 
0015 #include <TNamed.h>
0016 #include <TList.h>
0017 
0018 ////////////////////////////////////////////////////////////////////////////
0019 //                                                                        //
0020 // TGeoOpticalSurface - class describing surface properties for           //
0021 //                      compatibility with Geant4                         //
0022 //                                                                        //
0023 ////////////////////////////////////////////////////////////////////////////
0024 
0025 class TGDMLMatrix;
0026 
0027 class TGeoOpticalSurface : public TNamed {
0028 public:
0029    enum ESurfaceFinish {
0030       kFpolished,             // smooth perfectly polished surface
0031       kFpolishedfrontpainted, // smooth top-layer (front) paint
0032       kFpolishedbackpainted,  // same is 'polished' but with a back-paint
0033 
0034       kFground,             // rough surface
0035       kFgroundfrontpainted, // rough top-layer (front) paint
0036       kFgroundbackpainted,  // same as 'ground' but with a back-paint
0037 
0038       kFpolishedlumirrorair,  // mechanically polished surface, with lumirror
0039       kFpolishedlumirrorglue, // mechanically polished surface, with lumirror & meltmount
0040       kFpolishedair,          // mechanically polished surface
0041       kFpolishedteflonair,    // mechanically polished surface, with teflon
0042       kFpolishedtioair,       // mechanically polished surface, with tio paint
0043       kFpolishedtyvekair,     // mechanically polished surface, with tyvek
0044       kFpolishedvm2000air,    // mechanically polished surface, with esr film
0045       kFpolishedvm2000glue,   // mechanically polished surface, with esr film & meltmount
0046 
0047       kFetchedlumirrorair,  // chemically etched surface, with lumirror
0048       kFetchedlumirrorglue, // chemically etched surface, with lumirror & meltmount
0049       kFetchedair,          // chemically etched surface
0050       kFetchedteflonair,    // chemically etched surface, with teflon
0051       kFetchedtioair,       // chemically etched surface, with tio paint
0052       kFetchedtyvekair,     // chemically etched surface, with tyvek
0053       kFetchedvm2000air,    // chemically etched surface, with esr film
0054       kFetchedvm2000glue,   // chemically etched surface, with esr film & meltmount
0055 
0056       kFgroundlumirrorair,  // rough-cut surface, with lumirror
0057       kFgroundlumirrorglue, // rough-cut surface, with lumirror & meltmount
0058       kFgroundair,          // rough-cut surface
0059       kFgroundteflonair,    // rough-cut surface, with teflon
0060       kFgroundtioair,       // rough-cut surface, with tio paint
0061       kFgroundtyvekair,     // rough-cut surface, with tyvek
0062       kFgroundvm2000air,    // rough-cut surface, with esr film
0063       kFgroundvm2000glue,   // rough-cut surface, with esr film & meltmount
0064 
0065       // for DAVIS model
0066       kFRough_LUT,             // rough surface
0067       kFRoughTeflon_LUT,       // rough surface wrapped in Teflon tape
0068       kFRoughESR_LUT,          // rough surface wrapped with ESR
0069       kFRoughESRGrease_LUT,    // rough surface wrapped with ESR and coupled with opical grease
0070       kFPolished_LUT,          // polished surface
0071       kFPolishedTeflon_LUT,    // polished surface wrapped in Teflon tape
0072       kFPolishedESR_LUT,       // polished surface wrapped with ESR
0073       kFPolishedESRGrease_LUT, // polished surface wrapped with ESR and coupled with opical grease
0074       kFDetector_LUT           // polished surface with optical grease
0075    };
0076 
0077    enum ESurfaceModel {
0078       kMglisur,  // original GEANT3 model
0079       kMunified, // UNIFIED model
0080       kMLUT,     // Look-Up-Table model
0081       kMDAVIS,   // DAVIS model
0082       kMdichroic // dichroic filter
0083    };
0084 
0085    enum ESurfaceType {
0086       kTdielectric_metal,      // dielectric-metal interface
0087       kTdielectric_dielectric, // dielectric-dielectric interface
0088       kTdielectric_LUT,        // dielectric-Look-Up-Table interface
0089       kTdielectric_LUTDAVIS,   // dielectric-Look-Up-Table DAVIS interface
0090       kTdielectric_dichroic,   // dichroic filter interface
0091       kTfirsov,                // for Firsov Process
0092       kTx_ray                  // for x-ray mirror process
0093    };
0094 
0095 private:
0096    std::string fName = "";                  // Surface name
0097    ESurfaceType fType = kTdielectric_metal; // Surface type
0098    ESurfaceModel fModel = kMglisur;         // Surface model
0099    ESurfaceFinish fFinish = kFpolished;     // Surface finish
0100 
0101    Double_t fValue = 0.0;      // The value used to determine sigmaalpha and polish
0102    Double_t fSigmaAlpha = 0.0; // The sigma of micro-facet polar angle
0103    Double_t fPolish = 0.0;     // Polish parameter in glisur model
0104 
0105    TList fProperties;          // List of surface properties
0106    TList fConstProperties;     // user-defined constant properties
0107 
0108    // No copy
0109    TGeoOpticalSurface(const TGeoOpticalSurface &) = delete;
0110    TGeoOpticalSurface &operator=(const TGeoOpticalSurface &) = delete;
0111 
0112 public:
0113    // constructors
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    // Accessors
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) // Class representing an optical surface
0166 };
0167 
0168 ////////////////////////////////////////////////////////////////////////////
0169 //                                                                        //
0170 // TGeoSkinSurface - class describing a surface having optical properties //
0171 //                      surrounding a volume                              //
0172 //                                                                        //
0173 ////////////////////////////////////////////////////////////////////////////
0174 
0175 class TGeoVolume;
0176 
0177 class TGeoSkinSurface : public TNamed {
0178 private:
0179    TGeoOpticalSurface const *fSurface = nullptr; // Referenced optical surface
0180    TGeoVolume const *fVolume = nullptr;          // Referenced volume
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) // A surface with optical properties surrounding a volume
0195 };
0196 
0197 ////////////////////////////////////////////////////////////////////////////
0198 //                                                                        //
0199 // TGeoBorderSurface - class describing a surface having optical          //
0200 //                      properties between 2 touching volumes             //
0201 //                                                                        //
0202 ////////////////////////////////////////////////////////////////////////////
0203 
0204 class TGeoNode;
0205 
0206 class TGeoBorderSurface : public TNamed {
0207 private:
0208    TGeoOpticalSurface const *fSurface = nullptr; // Referenced optical surface
0209    TGeoNode const *fNode1 = nullptr;             // Referenced node 1
0210    TGeoNode const *fNode2 = nullptr;             // Referenced node 2
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) // A surface with optical properties betwqeen 2 touching volumes
0227 };
0228 
0229 #endif // ROOT_TGeoOpticalSurface