CbmRoot
Loading...
Searching...
No Matches
CbmStsElement.h
Go to the documentation of this file.
1/* Copyright (C) 2013-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
10#ifndef CBMSTSELEMENT_H
11#define CBMSTSELEMENT_H 1
12
13#include "CbmStsAddress.h" // for EStsElementLevel, GetElementId
14
15#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
16#include <RtypesCore.h> // for Int_t, Option_t
17#include <TNamed.h> // for TNamed
18#include <TString.h> // for TString
19
20#include <vector> // for vector
21
22class TGeoPhysicalNode;
23
35class CbmStsElement : public TNamed {
36
37public:
40
41
48 CbmStsElement(Int_t address, Int_t level, TGeoPhysicalNode* node = nullptr, 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
78
79
83 EStsElementLevel GetLevel() const { return fLevel; }
84
85
87 CbmStsElement* GetMother() const { return fMother; }
88
89
93 Int_t GetNofDaughters() const { return fDaughters.size(); }
94
95
101 Int_t GetNofElements(Int_t level) const;
102
103
104 TGeoPhysicalNode* GetPnode() const { return fNode; }
105
106
108 virtual void InitDaughters();
109
110
114 void SetMother(CbmStsElement* mother) { fMother = mother; }
115
116
118 virtual void Print(Option_t* opt = "") const;
119
120
121protected:
122 Int_t fAddress;
124 TGeoPhysicalNode* fNode;
125 std::vector<CbmStsElement*> fDaughters;
127
128
130 void ConstructName();
131
132
137 void SetLevel(Int_t level);
138
139
140private:
141 // --- Disable copy constructor and assignment operator
142 CbmStsElement(const CbmStsElement&) = delete;
144
145
147};
148
149#endif /* CBMSTSELEMENT_H */
EStsElementLevel
Class representing an element of the STS setup.
std::vector< CbmStsElement * > fDaughters
Array of daughters.
ClassDef(CbmStsElement, 2)
void SetLevel(Int_t level)
void SetMother(CbmStsElement *mother)
CbmStsElement * GetMother() const
Int_t GetAddress() const
TGeoPhysicalNode * fNode
Pointer to geometry.
TGeoPhysicalNode * GetPnode() const
Int_t fAddress
Unique element address.
virtual ~CbmStsElement()
virtual void Print(Option_t *opt="") const
Int_t GetNofDaughters() const
CbmStsElement * fMother
Mother element.
Int_t GetNofElements(Int_t level) const
CbmStsElement(const CbmStsElement &)=delete
EStsElementLevel fLevel
Level in hierarchy.
Int_t GetIndex() const
virtual void InitDaughters()
CbmStsElement * GetDaughter(Int_t index) const
CbmStsElement & operator=(const CbmStsElement &)=delete
EStsElementLevel GetLevel() const
uint32_t GetElementId(int32_t address, int32_t level)
Get the index of an element.