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