CbmRoot
CbmStsElement.h
Go to the documentation of this file.
1 
6 #ifndef CBMSTSELEMENT_H
7 #define CBMSTSELEMENT_H 1
8 
9 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
10 #include <RtypesCore.h> // for Int_t, Option_t
11 
12 #include <TNamed.h> // for TNamed
13 #include <TString.h> // for TString
14 
15 #include <vector> // for vector
16 
17 #include "CbmStsAddress.h" // for EStsElementLevel, GetElementId
18 
19 class TGeoPhysicalNode;
20 
32 class CbmStsElement : public TNamed {
33 
34 public:
36  CbmStsElement();
37 
38 
45  CbmStsElement(Int_t address,
46  Int_t level,
47  TGeoPhysicalNode* node = nullptr,
48  CbmStsElement* mother = nullptr);
49 
50 
52  virtual ~CbmStsElement() {};
53 
54 
59  static TString ConstructName(Int_t address, EStsElementLevel level);
60 
61 
65  Int_t GetAddress() const { return fAddress; }
66 
67 
71  CbmStsElement* GetDaughter(Int_t index) const;
72 
73 
77  Int_t GetIndex() const {
79  }
80 
81 
85  EStsElementLevel GetLevel() const { return fLevel; }
86 
87 
89  CbmStsElement* GetMother() const { return fMother; }
90 
91 
95  Int_t GetNofDaughters() const { return fDaughters.size(); }
96 
97 
103  Int_t GetNofElements(Int_t level) const;
104 
105 
106  TGeoPhysicalNode* GetPnode() const { return fNode; }
107 
108 
110  virtual void InitDaughters();
111 
112 
116  void SetMother(CbmStsElement* mother) { fMother = mother; }
117 
118 
120  virtual void Print(Option_t* opt = "") const;
121 
122 
123 protected:
124  Int_t fAddress;
126  TGeoPhysicalNode* fNode;
127  std::vector<CbmStsElement*> fDaughters;
129 
130 
132  void ConstructName();
133 
134 
139  void SetLevel(Int_t level);
140 
141 
142 private:
143  // --- Disable copy constructor and assignment operator
144  CbmStsElement(const CbmStsElement&) = delete;
146 
147 
149 };
150 
151 #endif /* CBMSTSELEMENT_H */
CbmStsElement::fDaughters
std::vector< CbmStsElement * > fDaughters
Array of daughters.
Definition: CbmStsElement.h:127
CbmStsElement::GetAddress
Int_t GetAddress() const
Definition: CbmStsElement.h:65
CbmStsElement::SetMother
void SetMother(CbmStsElement *mother)
Definition: CbmStsElement.h:116
CbmStsElement::fMother
CbmStsElement * fMother
Mother element.
Definition: CbmStsElement.h:128
CbmStsElement::GetIndex
Int_t GetIndex() const
Definition: CbmStsElement.h:77
CbmStsElement::GetPnode
TGeoPhysicalNode * GetPnode() const
Definition: CbmStsElement.h:106
CbmStsElement::CbmStsElement
CbmStsElement(const CbmStsElement &)=delete
CbmStsElement::Print
virtual void Print(Option_t *opt="") const
Definition: CbmStsElement.cxx:198
CbmStsElement::GetNofElements
Int_t GetNofElements(Int_t level) const
Definition: CbmStsElement.cxx:128
CbmStsElement::ConstructName
void ConstructName()
Definition: CbmStsElement.cxx:54
CbmStsAddress::GetElementId
UInt_t GetElementId(Int_t address, Int_t level)
Get the index of an element.
Definition: CbmStsAddress.cxx:180
CbmStsElement::~CbmStsElement
virtual ~CbmStsElement()
Definition: CbmStsElement.h:52
EStsElementLevel
EStsElementLevel
Definition: CbmStsAddress.h:16
CbmStsElement::GetDaughter
CbmStsElement * GetDaughter(Int_t index) const
Definition: CbmStsElement.cxx:120
CbmStsElement::GetNofDaughters
Int_t GetNofDaughters() const
Definition: CbmStsElement.h:95
CbmStsElement::GetLevel
EStsElementLevel GetLevel() const
Definition: CbmStsElement.h:85
CbmStsAddress.h
CbmStsElement::CbmStsElement
CbmStsElement()
Definition: CbmStsElement.cxx:26
CbmStsElement::InitDaughters
virtual void InitDaughters()
Definition: CbmStsElement.cxx:145
CbmStsElement::GetMother
CbmStsElement * GetMother() const
Definition: CbmStsElement.h:89
CbmStsElement
Class representing an element of the STS setup.
Definition: CbmStsElement.h:32
CbmStsElement::fAddress
Int_t fAddress
Unique element address.
Definition: CbmStsElement.h:124
CbmStsElement::fLevel
EStsElementLevel fLevel
Level in hierarchy.
Definition: CbmStsElement.h:125
CbmStsElement::fNode
TGeoPhysicalNode * fNode
Pointer to geometry.
Definition: CbmStsElement.h:126
CbmStsElement::ClassDef
ClassDef(CbmStsElement, 2)
CbmStsElement::operator=
CbmStsElement & operator=(const CbmStsElement &)=delete
CbmStsElement::SetLevel
void SetLevel(Int_t level)
Definition: CbmStsElement.cxx:211