BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
CbmStsSetup.cxx
Go to the documentation of this file.
1
/** @file CbmStsSetup.cxx
2
** @author Volker Friese <v.friese@gsi.de>
3
** @date 27.05.2013
4
**/
5
6
#include "
setup/CbmStsSetup.h
"
7
8
#include "
TGeoManager.h
"
9
#include "
TGeoPhysicalNode.h
"
10
11
// ----- Initialisation of static singleton pointer ----------------------
12
CbmStsSetup
*
CbmStsSetup::fgInstance
= NULL;
13
// ---------------------------------------------------------------------------
14
15
// ----- Level names -----------------------------------------------------
16
const
TString
CbmStsSetup::fgkLevelName
[] = {
"sts"
,
"station"
,
"ladder"
,
"halfladder"
,
17
"module"
,
"sensor"
,
"side"
,
"channel"
};
18
// ---------------------------------------------------------------------------
19
20
// ----- Constructor -----------------------------------------------------
21
CbmStsSetup::CbmStsSetup
()
22
:
CbmStsElement
(
"STS Setup"
,
"system"
,
kStsSystem
)
23
{}
24
// ---------------------------------------------------------------------------
25
26
// ----- Intialisation from TGeoManager ----------------------------------
27
Bool_t
CbmStsSetup::Init
(
TGeoManager
* geo)
28
{
29
30
// --- Catch non-existence of GeoManager
31
if
(!geo) {
32
LOG(fatal) <<
"fName: no TGeoManager!"
;
33
return
kFALSE
;
34
}
35
36
// --- Get cave (top node)
37
LOG(info) <<
fName
<<
": "
<<
" Reading geometry from TGeoManager "
<< geo->
GetName
();
38
geo->
CdTop
();
39
TGeoNode
* cave = geo->
GetCurrentNode
();
40
LOG(info) <<
"Top node: "
<< cave->
GetName
();
41
42
// --- Get top STS node
43
TGeoNode
* sts = NULL;
44
for
(
Int_t
iNode = 0; iNode < cave->
GetNdaughters
(); iNode++) {
45
TString
name = cave->
GetDaughter
(iNode)->
GetName
();
46
if
(name.
Contains
(
"STS"
,
TString::kIgnoreCase
)) {
47
sts = cave->
GetDaughter
(iNode);
48
geo->
CdDown
(iNode);
49
LOG(info) <<
fName
<<
": found STS node "
<< sts->
GetName
();
50
break
;
51
}
52
}
53
if
(!sts) {
54
LOG(error) <<
fName
<<
": No top STS node found in geometry!"
;
55
return
kFALSE
;
56
}
57
58
// --- Create physical node for sts
59
TString
path = cave->
GetName
();
60
path = path +
"/"
+ sts->
GetName
();
61
LOG(info) <<
"Path to STS is "
<< path;
62
fNode
=
new
TGeoPhysicalNode
(path);
63
LOG(info) <<
"PN name "
<<
fNode
->GetName();
64
65
// --- Initialise daughter elements
66
InitDaughters
();
67
68
return
kTRUE
;
69
}
70
// ---------------------------------------------------------------------------
71
72
// ----- Instance --------------------------------------------------------
73
CbmStsSetup
*
CbmStsSetup::Instance
()
74
{
75
if
(!
fgInstance
)
76
fgInstance
=
new
CbmStsSetup
();
77
return
fgInstance
;
78
}
79
// ---------------------------------------------------------------------------
kStsSystem
@ kStsSystem
System = STS.
Definition
CbmStsAddress.h:21
CbmStsSetup.h
Bool_t
bool Bool_t
Int_t
int Int_t
kFALSE
constexpr Bool_t kFALSE
kTRUE
constexpr Bool_t kTRUE
TGeoManager.h
TGeoPhysicalNode.h
CbmStsElement::fNode
TGeoPhysicalNode * fNode
Pointer to geometry.
Definition
CbmStsElement.h:87
CbmStsElement::CbmStsElement
CbmStsElement()
Default constructor.
Definition
CbmStsElement.cxx:13
CbmStsElement::InitDaughters
void InitDaughters()
Initialise daughters from geometry.
Definition
CbmStsElement.cxx:59
CbmStsSetup
Class representing the top level of the STS setup.
Definition
CbmStsSetup.h:23
CbmStsSetup::fgInstance
static CbmStsSetup * fgInstance
Definition
CbmStsSetup.h:42
CbmStsSetup::CbmStsSetup
CbmStsSetup()
Definition
CbmStsSetup.cxx:21
CbmStsSetup::Init
Bool_t Init(TGeoManager *geo)
Definition
CbmStsSetup.cxx:27
CbmStsSetup::fgkLevelName
static const TString fgkLevelName[kStsNofLevels]
Definition
CbmStsSetup.h:16
CbmStsSetup::Instance
static CbmStsSetup * Instance()
Definition
CbmStsSetup.cxx:73
TGeoManager
TGeoManager::GetCurrentNode
TGeoNode * GetCurrentNode() const
TGeoManager::CdTop
void CdTop()
TGeoManager::CdDown
void CdDown(Int_t index)
TGeoNode
TGeoNode::GetNdaughters
Int_t GetNdaughters() const
TGeoNode::GetDaughter
TGeoNode * GetDaughter(Int_t ind) const
TGeoPhysicalNode
TNamed::GetName
const char * GetName() const override
TNamed::fName
TString fName
TString
TString::kIgnoreCase
kIgnoreCase
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
detectors
sts
setup
CbmStsSetup.cxx
Generated on
for BmnRoot by
1.17.0