BmnRoot
Loading...
Searching...
No Matches
FairCave.cxx
Go to the documentation of this file.
1/********************************************************************************
2 * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3 * *
4 * This software is distributed under the terms of the *
5 * GNU Lesser General Public Licence (LGPL) version 3, *
6 * copied verbatim in the file "LICENSE" *
7 ********************************************************************************/
8/* Generated by Together */
9#include "FairCave.h"
10
11#include "FairGeoCave.h" // for FairGeoCave
12#include "FairGeoInterface.h" // for FairGeoInterface
13#include "FairGeoLoader.h" // for FairGeoLoader
14#include "FairGeoNode.h" // for FairGeoNode
15#include "FairGeoPassivePar.h" // for FairGeoPassivePar
16#include "FairGeoVolume.h" // for FairGeoVolume
17#include "FairRun.h" // for FairRun
18#include "FairRuntimeDb.h" // for FairRuntimeDb
19
20#include <TList.h> // for TListIter, TList (ptr only)
21#include <TObjArray.h> // for TObjArray
22#include <TString.h> // for TString
23
25{
26 FairGeoLoader* loader = FairGeoLoader::Instance();
27 FairGeoInterface* GeoInterface = loader->getGeoInterface();
28 FairGeoCave* MGeo = new FairGeoCave();
29 MGeo->setGeomFile(GetGeometryFileName());
30 GeoInterface->addGeoModule(MGeo);
31 Bool_t rc = GeoInterface->readSet(MGeo);
32 if (rc) {
33 MGeo->create(loader->getGeoBuilder());
34 }
35
36 TList* volList = MGeo->getListOfVolumes();
37 // store geo parameter
38 FairRun* fRun = FairRun::Instance();
39 FairRuntimeDb* rtdb = FairRun::Instance()->GetRuntimeDb();
40 FairGeoPassivePar* par = static_cast<FairGeoPassivePar*>(rtdb->getContainer("FairGeoPassivePar"));
41 TObjArray* fSensNodes = par->GetGeoSensitiveNodes();
42 TObjArray* fPassNodes = par->GetGeoPassiveNodes();
43
44 TListIter iter(volList);
45 FairGeoNode* node = nullptr;
46 FairGeoVolume* aVol = nullptr;
47
48 while ((node = static_cast<FairGeoNode*>(iter.Next()))) {
49 aVol = dynamic_cast<FairGeoVolume*>(node);
50 if (node->isSensitive()) {
51 fSensNodes->AddLast(aVol);
52 } else {
53 fPassNodes->AddLast(aVol);
54 }
55 }
56 par->setChanged();
57 par->setInputVersion(fRun->GetRunId(), 1);
58}
59
61 : FairModule(rhs)
62{
63 world[0] = rhs.world[0];
64 world[1] = rhs.world[1];
65 world[2] = rhs.world[2];
66}
67
69
71
72FairCave::FairCave(const char* name, const char* Title)
73 : FairModule(name, Title)
74{
75 world[0] = 0;
76 world[1] = 0;
77 world[2] = 0;
78}
79
80FairModule* FairCave::CloneModule() const { return new FairCave(*this); }
virtual ~FairCave()
Definition FairCave.cxx:70
virtual void ConstructGeometry()
Definition FairCave.cxx:24
virtual FairModule * CloneModule() const
Definition FairCave.cxx:80
TObjArray * GetGeoSensitiveNodes()
TObjArray * GetGeoPassiveNodes()