7 #include "FairGeoInterface.h"
8 #include "FairGeoLoader.h"
9 #include "FairGeoNode.h"
11 #include "FairRuntimeDb.h"
16 #include "TObjArray.h"
19 #include "TGeoManager.h"
26 : FairModule(name, title), fCombiTrans(), fVolumeName(
"") {}
31 TString fileName = GetGeometryFileName();
32 if (fileName.EndsWith(
".root")) {
34 LOG(info) <<
"Importing Platform geometry from ROOT file "
38 LOG(info) <<
"Constructing Platform geometry from ROOT file "
40 FairModule::ConstructRootGeometry();
42 }
else if (fileName.EndsWith(
".geo")) {
43 LOG(info) <<
"Constructing PLATFORM from ASCII file "
47 LOG(fatal) <<
"Geometry format of PLATFORM file " << fileName.Data()
52 FairGeoLoader* loader = FairGeoLoader::Instance();
53 FairGeoInterface* GeoInterface = loader->getGeoInterface();
55 MGeo->setGeomFile(GetGeometryFileName());
56 GeoInterface->addGeoModule(MGeo);
57 Bool_t rc = GeoInterface->readSet(MGeo);
58 if (rc) MGeo->create(loader->getGeoBuilder());
60 TList* volList = MGeo->getListOfVolumes();
62 FairRun* fRun = FairRun::Instance();
63 FairRuntimeDb* rtdb = FairRun::Instance()->GetRuntimeDb();
69 TListIter iter(volList);
70 FairGeoNode* node = NULL;
71 FairGeoVolume* aVol = NULL;
73 while ((node = (FairGeoNode*) iter.Next())) {
74 aVol =
dynamic_cast<FairGeoVolume*
>(node);
75 if (node->isSensitive()) {
76 fSensNodes->AddLast(aVol);
78 fPassNodes->AddLast(aVol);
81 ProcessNodes(volList);
83 par->setInputVersion(fRun->GetRunId(), 1);