CbmRoot
Loading...
Searching...
No Matches
CbmCave.cxx
Go to the documentation of this file.
1/* Copyright (C) 2006-2012 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Denis Bertini [committer], Mohammad Al-Turany, Florian Uhlig */
4
5/* Generated by Together */
6
7#include "CbmCave.h"
8
9#include "CbmGeoCave.h"
10#include "CbmGeoPassivePar.h"
11
12#include "FairGeoInterface.h"
13#include "FairGeoLoader.h"
14#include "FairGeoNode.h"
15#include "FairRun.h"
16#include "FairRuntimeDb.h"
17
18#include "TList.h"
19#include "TObjArray.h"
20
22{
23 FairGeoLoader* loader = FairGeoLoader::Instance();
24 FairGeoInterface* GeoInterface = loader->getGeoInterface();
25 CbmGeoCave* MGeo = new CbmGeoCave();
26 MGeo->setGeomFile(GetGeometryFileName());
27 GeoInterface->addGeoModule(MGeo);
28 Bool_t rc = GeoInterface->readSet(MGeo);
29 if (rc) MGeo->create(loader->getGeoBuilder());
30
31 TList* volList = MGeo->getListOfVolumes();
32 // store geo parameter
33 FairRun* fRun = FairRun::Instance();
34 FairRuntimeDb* rtdb = FairRun::Instance()->GetRuntimeDb();
35 CbmGeoPassivePar* par = (CbmGeoPassivePar*) (rtdb->getContainer("CbmGeoPassivePar"));
36 TObjArray* fSensNodes = par->GetGeoSensitiveNodes();
37 TObjArray* fPassNodes = par->GetGeoPassiveNodes();
38
39 TListIter iter(volList);
40 FairGeoNode* node = NULL;
41 FairGeoVolume* aVol = NULL;
42
43 while ((node = (FairGeoNode*) iter.Next())) {
44 aVol = dynamic_cast<FairGeoVolume*>(node);
45 if (node->isSensitive()) { fSensNodes->AddLast(aVol); }
46 else {
47 fPassNodes->AddLast(aVol);
48 }
49 }
50 par->setChanged();
51 par->setInputVersion(fRun->GetRunId(), 1);
52}
53CbmCave::CbmCave() : FairModule(), world() {}
54
56CbmCave::CbmCave(const char* name, const char* Title) : FairModule(name, Title), world()
57{
58 world[0] = 0;
59 world[1] = 0;
60 world[2] = 0;
61}
ClassImp(CbmCave) void CbmCave
Definition CbmCave.cxx:21
CbmCave()
Definition CbmCave.cxx:53
virtual void ConstructGeometry()
Double_t world[3]
Definition CbmCave.h:20
virtual ~CbmCave()
Definition CbmCave.cxx:55
TObjArray * GetGeoPassiveNodes()
TObjArray * GetGeoSensitiveNodes()