Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/geom:$Id$
0002 // Author: Rene Brun   26/12/02
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_TGeoMedium
0013 #define ROOT_TGeoMedium
0014 
0015 #include "TGeoMaterial.h"
0016 
0017 ////////////////////////////////////////////////////////////////////////////
0018 //                                                                        //
0019 // TGeoMedium - base class describing tracking media                      //
0020 //                                                                        //
0021 ////////////////////////////////////////////////////////////////////////////
0022 
0023 class TGeoMedium : public TNamed {
0024 public:
0025    enum EGeoMedium { kMedSavePrimitive = BIT(18) };
0026 
0027 protected:
0028    Int_t fId;               // unique Id
0029    Double_t fParams[20];    // parameters
0030    TGeoMaterial *fMaterial; // pointer to material
0031 
0032    // methods
0033    TGeoMedium(const TGeoMedium &);
0034    TGeoMedium &operator=(const TGeoMedium &);
0035 
0036 public:
0037    // constructors
0038    TGeoMedium();
0039    TGeoMedium(const char *name, Int_t numed, const TGeoMaterial *mat, Double_t *params = nullptr);
0040    TGeoMedium(const char *name, Int_t numed, Int_t imat, Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
0041               Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin);
0042    ~TGeoMedium() override;
0043    // methods
0044    virtual Int_t GetByteCount() const { return sizeof(*this); }
0045    Int_t GetId() const { return fId; }
0046    Double_t GetParam(Int_t i) const { return fParams[i]; }
0047    void SetParam(Int_t i, Double_t val) { fParams[i] = val; }
0048    const char *GetPointerName() const;
0049    TGeoMaterial *GetMaterial() const { return fMaterial; }
0050    void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0051    void SetId(Int_t id) { fId = id; }
0052    void SetMaterial(TGeoMaterial *mat) { fMaterial = mat; }
0053    virtual void SetCerenkovProperties(TObject *cerenkov) { fMaterial->SetCerenkovProperties(cerenkov); }
0054    ClassDefOverride(TGeoMedium, 1) // tracking medium
0055 };
0056 
0057 #endif