R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BNeutronWindowAndSomeAir.cxx
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3
* Copyright (C) 2020-2026 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 "
R3BNeutronWindowAndSomeAir.h
"
15
16
#include <FairGeoBuilder.h>
17
#include <FairGeoInterface.h>
18
#include <FairGeoLoader.h>
19
#include <FairGeoMedia.h>
20
#include <FairLogger.h>
21
22
#include <TGeoManager.h>
23
#include <TGeoMedium.h>
24
25
R3BNeutronWindowAndSomeAir::R3BNeutronWindowAndSomeAir
(
double
xstart,
double
xstop)
26
: FairModule(
"NeutronWindowAndSomeAir"
,
"NeutronWindowAndSomeAir"
, false)
27
,
fStart
(xstart)
28
,
fStop
(xstop)
29
{
30
}
31
32
void
R3BNeutronWindowAndSomeAir::ConstructRootGeometry
(TGeoMatrix*)
33
{
34
if
(gGeoManager ==
nullptr
)
35
{
36
LOG(fatal) << __FUNCTION__ <<
": No gGeoManager"
;
37
}
38
39
auto
volSomeAir = gGeoManager->MakeBox(
"SomeAir"
,
FindMaterial
(
"Air"
), 125, 125, (
fStop
-
fStart
) / 2.);
40
gGeoManager->GetTopVolume()->AddNode(volSomeAir, 1,
new
TGeoTranslation(0, 0,
fStart
+ (
fStop
-
fStart
) / 2.));
41
auto
volWindow = gGeoManager->MakeTube(
"NeutronWindow"
,
FindMaterial
(
"Steel"
), 0, 70, 0.2);
42
gGeoManager->GetTopVolume()->AddNode(volWindow, 1,
new
TGeoTranslation(0, 0,
fStart
- 0.2));
43
}
44
45
// TODO: Simulation crashes without this. It should not be necessary to do this?!
46
TGeoMedium*
R3BNeutronWindowAndSomeAir::FindMaterial
(
const
std::string& mat)
const
47
{
48
auto
geoLoad = FairGeoLoader::Instance();
49
auto
geoFace = geoLoad->getGeoInterface();
50
auto
geoBuild = geoLoad->getGeoBuilder();
51
auto
geoMedia = geoFace->getMedia();
52
53
auto
fairMedium = geoMedia->getMedium(mat.c_str());
54
if
(!fairMedium)
55
{
56
LOG(fatal) << __FUNCTION__ <<
": FairGeoMedium "
<< mat <<
" not found"
;
57
}
58
geoBuild->createMedium(fairMedium);
59
60
auto
med = gGeoManager->GetMedium(mat.c_str());
61
if
(!med)
62
{
63
LOG(fatal) << __FUNCTION__ <<
": TGeoMedium "
<< mat <<
" not found"
;
64
}
65
return
med;
66
}
67
68
ClassImp
(
R3BNeutronWindowAndSomeAir
)
ClassImp
ClassImp(R3B::Neuland::Cal2HitPar)
R3BNeutronWindowAndSomeAir.h
R3BNeutronWindowAndSomeAir
Definition
R3BNeutronWindowAndSomeAir.h:28
R3BNeutronWindowAndSomeAir::fStart
double fStart
Definition
R3BNeutronWindowAndSomeAir.h:38
R3BNeutronWindowAndSomeAir::fStop
double fStop
Definition
R3BNeutronWindowAndSomeAir.h:39
R3BNeutronWindowAndSomeAir::ConstructRootGeometry
void ConstructRootGeometry(TGeoMatrix *_=nullptr) override
Definition
R3BNeutronWindowAndSomeAir.cxx:32
R3BNeutronWindowAndSomeAir::FindMaterial
TGeoMedium * FindMaterial(const std::string &mat) const
Definition
R3BNeutronWindowAndSomeAir.cxx:46
R3BNeutronWindowAndSomeAir::R3BNeutronWindowAndSomeAir
R3BNeutronWindowAndSomeAir(double start=700, double stop=1300)
Definition
R3BNeutronWindowAndSomeAir.cxx:25
passive
R3BNeutronWindowAndSomeAir.cxx
Generated by
1.18.0