Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
20class TGeoRegionCut : public TNamed {
21protected:
22 Double_t fCut{0.}; // Cut value
23
24public:
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
36class TGeoRegion : public TNamed {
37protected:
38 TObjArray fVolumes; // list of volumes in this region
39 TObjArray fCuts; // list of cuts for the region
40
41public:
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
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:337
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
TGeoRegionCut(const char *name, Double_t cut)
Definition TGeoRegion.h:26
Double_t GetCut() const
Definition TGeoRegion.h:30
virtual ~TGeoRegionCut()
Definition TGeoRegion.h:28
Double_t fCut
Definition TGeoRegion.h:22
void SetCut(Double_t cut)
Definition TGeoRegion.h:31
Regions are groups of volumes having a common set of user tracking cuts.
Definition TGeoRegion.h:36
TGeoRegionCut * GetCut(int i) const
Definition TGeoRegion.h:58
TGeoRegion & operator=(const TGeoRegion &other)
Assignment operator.
TObjArray fVolumes
Definition TGeoRegion.h:38
TGeoRegion(const char *name, const char *title="")
Definition TGeoRegion.h:43
void AddCut(const char *name, Double_t cut)
Add cut to the region.
TObjArray fCuts
Definition TGeoRegion.h:39
int GetNvolumes() const
Definition TGeoRegion.h:51
virtual ~TGeoRegion()
Region destructor.
TGeoVolume * GetVolume(int i) const
Definition TGeoRegion.h:52
virtual void Print(Option_t *option="") const
Print region info.
void AddVolume(TGeoVolume *vol)
Definition TGeoRegion.h:49
int GetNcuts() const
Definition TGeoRegion.h:57
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:49
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
An array of TObjects.
Definition TObjArray.h:31
Int_t GetEntriesFast() const
Definition TObjArray.h:58
TObject * At(Int_t idx) const override
Definition TObjArray.h:164
void Add(TObject *obj) override
Definition TObjArray.h:68