Logo ROOT  
Reference Guide
TGeoRegion.h
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 18/10/17
3 /*************************************************************************
4  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_TGeoRegion
12 #define ROOT_TGeoRegion
13 
14 #include "TNamed.h"
15 
16 #include "TObjArray.h"
17 
18 #include "TGeoVolume.h"
19 
20 class TGeoRegionCut : public TNamed {
21 protected:
22  Double_t fCut{0.}; // Cut value
23 
24 public:
26  TGeoRegionCut(const char *name, Double_t cut) : TNamed(name, ""), fCut(cut) {}
27 
28  virtual ~TGeoRegionCut() {}
29 
30  Double_t GetCut() const { return fCut; }
31  void SetCut(Double_t cut) { fCut = cut; }
32 
33  ClassDef(TGeoRegionCut, 1) // A region cut
34 };
35 
36 class TGeoRegion : public TNamed {
37 protected:
38  TObjArray fVolumes; // list of volumes in this region
39  TObjArray fCuts; // list of cuts for the region
40 
41 public:
43  TGeoRegion(const char *name, const char *title = "") : TNamed(name, title) {}
44  TGeoRegion(const TGeoRegion &other);
45  TGeoRegion &operator=(const TGeoRegion &other);
46  virtual ~TGeoRegion();
47 
48  // Volume accessors
49  void AddVolume(TGeoVolume *vol) { fVolumes.Add(vol); }
50  bool AddVolume(const char *name);
51  int GetNvolumes() const { return fVolumes.GetEntriesFast(); }
52  TGeoVolume *GetVolume(int i) const { return (TGeoVolume *)fVolumes.At(i); }
53 
54  // Cuts accessors
55  void AddCut(const char *name, Double_t cut);
56  void AddCut(const TGeoRegionCut &regioncut);
57  int GetNcuts() const { return fCuts.GetEntriesFast(); }
58  TGeoRegionCut *GetCut(int i) const { return (TGeoRegionCut *)fCuts.At(i); }
59 
60  virtual void Print(Option_t *option = "") const; // *MENU*
61 
62  ClassDef(TGeoRegion, 1) // Region wrapper class
63 };
64 
65 #endif
TGeoRegionCut::TGeoRegionCut
TGeoRegionCut(const char *name, Double_t cut)
Definition: TGeoRegion.h:26
TObjArray
An array of TObjects.
Definition: TObjArray.h:37
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGeoRegion::TGeoRegion
TGeoRegion(const char *name, const char *title="")
Definition: TGeoRegion.h:43
TGeoRegionCut::SetCut
void SetCut(Double_t cut)
Definition: TGeoRegion.h:31
TNamed.h
TGeoVolume.h
TGeoRegionCut::GetCut
Double_t GetCut() const
Definition: TGeoRegion.h:30
TGeoRegion::fVolumes
TObjArray fVolumes
Definition: TGeoRegion.h:38
TObjArray::At
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
TGeoRegion::GetVolume
TGeoVolume * GetVolume(int i) const
Definition: TGeoRegion.h:52
TGeoRegion::Print
virtual void Print(Option_t *option="") const
Print region info.
Definition: TGeoRegion.cxx:89
TObjArray::Add
void Add(TObject *obj)
Definition: TObjArray.h:74
TGeoRegion::AddVolume
void AddVolume(TGeoVolume *vol)
Definition: TGeoRegion.h:49
TGeoRegion::~TGeoRegion
virtual ~TGeoRegion()
Region destructor.
Definition: TGeoRegion.cxx:34
TGeoRegion::AddCut
void AddCut(const char *name, Double_t cut)
Add cut to the region.
Definition: TGeoRegion.cxx:75
TGeoRegionCut::TGeoRegionCut
TGeoRegionCut()
Definition: TGeoRegion.h:25
TObjArray::GetEntriesFast
Int_t GetEntriesFast() const
Definition: TObjArray.h:64
TGeoRegion::TGeoRegion
TGeoRegion()
Definition: TGeoRegion.h:42
TGeoRegion::operator=
TGeoRegion & operator=(const TGeoRegion &other)
Assignment operator.
Definition: TGeoRegion.cxx:49
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TGeoRegion::fCuts
TObjArray fCuts
Definition: TGeoRegion.h:39
TGeoRegion::GetCut
TGeoRegionCut * GetCut(int i) const
Definition: TGeoRegion.h:58
TGeoRegion
Regions are groups of volumes having a common set of user tracking cuts.
Definition: TGeoRegion.h:36
Double_t
double Double_t
Definition: RtypesCore.h:59
TObjArray.h
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TGeoRegionCut::~TGeoRegionCut
virtual ~TGeoRegionCut()
Definition: TGeoRegion.h:28
TGeoRegionCut
Definition: TGeoRegion.h:20
TGeoRegionCut::fCut
Double_t fCut
Definition: TGeoRegion.h:22
TGeoRegion::GetNvolumes
int GetNvolumes() const
Definition: TGeoRegion.h:51
TGeoVolume
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:49
TGeoRegion::GetNcuts
int GetNcuts() const
Definition: TGeoRegion.h:57