Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGeoRegion.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/geom:$Id$
0002 // Author: Andrei Gheata   18/10/17
0003 /*************************************************************************
0004  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 #ifndef ROOT_TGeoRegion
0012 #define ROOT_TGeoRegion
0013 
0014 #include "TNamed.h"
0015 
0016 #include "TObjArray.h"
0017 
0018 #include "TGeoVolume.h"
0019 
0020 class TGeoRegionCut : public TNamed {
0021 protected:
0022    Double_t fCut{0.}; // Cut value
0023 
0024 public:
0025    TGeoRegionCut() {}
0026    TGeoRegionCut(const char *name, Double_t cut) : TNamed(name, ""), fCut(cut) {}
0027 
0028    ~TGeoRegionCut() override {}
0029 
0030    Double_t GetCut() const { return fCut; }
0031    void SetCut(Double_t cut) { fCut = cut; }
0032 
0033    ClassDefOverride(TGeoRegionCut, 1) // A region cut
0034 };
0035 
0036 class TGeoRegion : public TNamed {
0037 protected:
0038    TObjArray fVolumes; // list of volumes in this region
0039    TObjArray fCuts;    // list of cuts for the region
0040 
0041 public:
0042    TGeoRegion() {}
0043    TGeoRegion(const char *name, const char *title = "") : TNamed(name, title) {}
0044    TGeoRegion(const TGeoRegion &other);
0045    TGeoRegion &operator=(const TGeoRegion &other);
0046    ~TGeoRegion() override;
0047 
0048    // Volume accessors
0049    void AddVolume(TGeoVolume *vol) { fVolumes.Add(vol); }
0050    bool AddVolume(const char *name);
0051    int GetNvolumes() const { return fVolumes.GetEntriesFast(); }
0052    TGeoVolume *GetVolume(int i) const { return (TGeoVolume *)fVolumes.At(i); }
0053 
0054    // Cuts accessors
0055    void AddCut(const char *name, Double_t cut);
0056    void AddCut(const TGeoRegionCut &regioncut);
0057    int GetNcuts() const { return fCuts.GetEntriesFast(); }
0058    TGeoRegionCut *GetCut(int i) const { return (TGeoRegionCut *)fCuts.At(i); }
0059 
0060    void Print(Option_t *option = "") const override; // *MENU*
0061 
0062    ClassDefOverride(TGeoRegion, 1) // Region wrapper class
0063 };
0064 
0065 #endif