R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BCave.cxx
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) 2009 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3
* Copyright (C) 2009-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 "
R3BCave.h
"
15
#include "
R3BGeoCave.h
"
16
#include "
R3BGeoPassivePar.h
"
17
18
#include <FairGeoInterface.h>
19
#include <FairGeoLoader.h>
20
#include <FairGeoNode.h>
21
#include <FairGeoRootBuilder.h>
22
#include <FairGeoVolume.h>
23
#include <FairRun.h>
24
#include <FairRuntimeDb.h>
25
26
#include <TList.h>
27
#include <TObjArray.h>
28
#include <algorithm>
29
#include <stddef.h>
30
31
R3BCave::R3BCave
()
32
: FairModule()
33
{
34
}
35
36
R3BCave::R3BCave
(
const
char
* name,
const
char
* Title)
37
: FairModule(name, Title)
38
{
39
}
40
41
R3BCave::R3BCave
(
const
R3BCave
& right)
42
: FairModule(right)
43
{
44
std::copy(std::begin(right.world), std::end(right.world),
world
);
45
}
46
47
void
R3BCave::ConstructGeometry
()
48
{
49
auto
* loader = FairGeoLoader::Instance();
50
auto
* GeoInterface = loader->getGeoInterface();
51
auto
* MGeo =
new
R3BGeoCave
();
52
MGeo->setGeomFile(GetGeometryFileName());
53
GeoInterface->addGeoModule(MGeo);
54
auto
rc = GeoInterface->readSet(MGeo);
55
if
(rc)
56
{
57
MGeo->create(loader->getGeoBuilder());
58
}
59
60
auto
* volList = MGeo->getListOfVolumes();
61
// store geo parameter
62
63
auto
* fRun = FairRun::Instance();
64
auto
* rtdb = FairRun::Instance()->GetRuntimeDb();
65
66
auto
* par =
dynamic_cast<
R3BGeoPassivePar
*
>
(rtdb->getContainer(
"R3BGeoPassivePar"
));
67
auto
* fSensNodes = par->
GetGeoSensitiveNodes
();
68
auto
* fPassNodes = par->GetGeoPassiveNodes();
69
70
TListIter iter(volList);
71
FairGeoNode* node =
nullptr
;
72
FairGeoVolume* aVol =
nullptr
;
73
74
while
((node =
dynamic_cast<
FairGeoNode*
>
(iter.Next())))
75
{
76
aVol =
dynamic_cast<
FairGeoVolume*
>
(node);
77
if
(node->isSensitive())
78
{
79
fSensNodes->AddLast(aVol);
80
}
81
else
82
{
83
fPassNodes->AddLast(aVol);
84
}
85
}
86
par->setChanged();
87
par->setInputVersion(fRun->GetRunId(), 1);
88
}
89
90
FairModule*
R3BCave::CloneModule
()
const
{
return
new
R3BCave
(*
this
); }
91
92
ClassImp
(
R3BCave
)
R3BCave.h
R3BGeoCave.h
R3BGeoPassivePar.h
ClassImp
ClassImp(R3B::Neuland::Cal2HitPar)
R3BCave
Definition
R3BCave.h:22
R3BCave::ConstructGeometry
virtual void ConstructGeometry()
Definition
R3BCave.cxx:47
R3BCave::R3BCave
R3BCave()
Definition
R3BCave.cxx:31
R3BCave::CloneModule
virtual FairModule * CloneModule() const
Definition
R3BCave.cxx:90
R3BCave::world
double world[3]
Definition
R3BCave.h:34
R3BGeoCave::R3BGeoCave
R3BGeoCave()
Definition
R3BGeoCave.cxx:29
R3BGeoPassivePar
Definition
R3BGeoPassivePar.h:19
R3BGeoPassivePar::GetGeoSensitiveNodes
TObjArray * GetGeoSensitiveNodes()
Definition
R3BGeoPassivePar.h:36
passive
R3BCave.cxx
Generated by
1.18.0