6 #include <FairLogger.h>
8 #include <TGenericClassInfo.h>
9 #include <TGeoManager.h>
11 #include <TObjArray.h>
23 LOG(debug) <<
"Constructor of CbmTrdParSetGeo";
25 LOG(debug) <<
"Constructor of CbmTrdParSetGeo --- finished";
34 TGeoNode* topNode = gGeoManager->GetTopNode();
35 TObjArray* nodes = topNode->GetNodes();
37 LOG(fatal) <<
"CbmTrdParSetGeo::Init: nodes is null!";
41 for (Int_t iNode = 0; iNode < nodes->GetEntriesFast(); iNode++) {
42 TGeoNode* node =
static_cast<TGeoNode*
>(nodes->At(iNode));
43 if (!TString(node->GetName()).Contains(
"trd", TString::kIgnoreCase))
45 TGeoNode* station = node;
47 TObjArray* layers = station->GetNodes();
48 for (Int_t iLayer = 0; iLayer < layers->GetEntriesFast(); iLayer++) {
49 TGeoNode* layer =
static_cast<TGeoNode*
>(layers->At(iLayer));
50 if (!TString(layer->GetName()).Contains(
"layer", TString::kIgnoreCase))
53 TObjArray* modules = layer->GetNodes();
54 for (Int_t iModule = 0; iModule < modules->GetEntriesFast(); iModule++) {
55 TGeoNode* module =
static_cast<TGeoNode*
>(modules->At(iModule));
56 TObjArray* parts = module->GetNodes();
57 for (Int_t iPart = 0; iPart < parts->GetEntriesFast(); iPart++) {
58 TGeoNode* part =
static_cast<TGeoNode*
>(parts->At(iPart));
59 if (!TString(part->GetName()).Contains(
"gas", TString::kIgnoreCase))
66 TString path = TString(
"/") + topNode->GetName() +
"/"
67 + station->GetName() +
"/" + layer->GetName() +
"/"
68 + module->GetName() +
"/" + part->GetName();
70 LOG(debug) <<
"Adding detector with path " << path.Data();
72 gGeoManager->cd(path.Data());
85 std::map<Int_t, CbmTrdParMod*>::const_iterator imod =
fModuleMap.begin();
89 printf(
"Module %4d [%p]:\n", imod->first, (
void*) mod);
90 printf(
" %s[%s]\n", mod->GetName(), mod->
GetPath());
93 printf(
" X[%.2f] Y[%.2f] Z[%.2f] DX[%.2f] DY[%.2f] DZ[%.2f]\n",