R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BDetector.cxx
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3
* Copyright (C) 2019-2025 Members of R3B Collaboration *
4
* *
5
* This software is distributed under the terms of the *
6
* GNU General Public Licence (GPL) version 3, *
7
* copied verbatim in the file "LICENSE". *
8
* *
9
* In applying this license GSI does not waive the privileges and immunities *
10
* granted to it by virtue of its status as an Intergovernmental Organization *
11
* or submit itself to any jurisdiction. *
12
******************************************************************************/
13
14
#include "
R3BDetector.h
"
15
#include "
R3BLogger.h
"
16
#include <TGeoManager.h>
17
18
R3BDetector::R3BDetector
()
19
: FairDetector()
20
,
fCutE
(1e-3)
21
{
22
}
23
24
R3BDetector::R3BDetector
(
const
TString& name,
const
Int_t detId)
25
: FairDetector(name, kTRUE, detId)
26
,
fCutE
(1e-3)
27
{
28
SetVerboseLevel(1);
29
}
30
31
R3BDetector::R3BDetector
(
const
TString& name,
32
const
Int_t detId,
33
const
TString& geoFile,
34
const
TGeoTranslation& trans,
35
const
TGeoRotation& rot)
36
:
R3BDetector
(name, detId, geoFile, { trans, rot })
37
{
38
}
39
40
R3BDetector::R3BDetector
(
const
TString& name,
const
Int_t detId,
const
TString& geoFile,
const
TGeoCombiTrans& combi)
41
: FairDetector(name, kTRUE, detId)
42
,
fCutE
(1e-3)
43
,
fCombiTrans
(combi)
44
{
45
SetVerboseLevel(1);
46
SetGeometryFileName(geoFile);
47
}
48
49
void
R3BDetector::ConstructGeometry
()
50
{
51
if
(!GetGeometryFileName().EndsWith(
".root"
))
52
{
53
R3BLOG
(fatal, GetName() <<
" (which is a "
<< ClassName() <<
") geometry file is not specified"
);
54
}
55
ConstructRootGeometry
();
56
}
57
58
void
R3BDetector::ConstructRootGeometry
(TGeoMatrix*)
59
{
60
R3BLOG
(info,
61
"Constructing "
<< GetName() <<
" (which is a "
<< ClassName() <<
") geometry from ROOT file "
62
<< GetGeometryFileName() <<
" ..."
);
63
FairModule::ConstructRootGeometry();
64
65
if
(!
fCombiTrans
.IsIdentity())
66
{
67
auto
n = gGeoManager->GetTopNode()->GetDaughter(gGeoManager->GetTopNode()->GetNdaughters() - 1);
68
(
dynamic_cast<
TGeoNodeMatrix*
>
(n))->SetMatrix(
fCombiTrans
.MakeClone());
69
}
70
}
71
72
ClassImp
(
R3BDetector
)
R3BDetector.h
R3BLogger.h
R3BLOG
#define R3BLOG(severity, x)
Definition
R3BLogger.h:35
ClassImp
ClassImp(R3B::Neuland::Cal2HitPar)
R3BDetector
Definition
R3BDetector.h:21
R3BDetector::R3BDetector
R3BDetector()
Definition
R3BDetector.cxx:18
R3BDetector::fCombiTrans
TGeoCombiTrans fCombiTrans
Definition
R3BDetector.h:56
R3BDetector::ConstructGeometry
void ConstructGeometry() override
Construct geometry from root files.
Definition
R3BDetector.cxx:49
R3BDetector::fCutE
Double_t fCutE
Definition
R3BDetector.h:57
R3BDetector::ConstructRootGeometry
void ConstructRootGeometry(TGeoMatrix *geo=nullptr) override
Definition
R3BDetector.cxx:58
r3bbase
R3BDetector.cxx
Generated by
1.13.2