10 #include "TClonesArray.h"
20 if (0 != theInstance)
return theInstance;
22 FairRootManager* ioman = FairRootManager::Instance();
24 if (0 == ioman)
return 0;
35 , fLastStationNumber(0) {
36 Int_t nofChildren = gGeoManager->GetTopNode()->GetNdaughters();
38 for (Int_t
i = 0;
i < nofChildren; ++
i) {
39 TGeoNode* child = gGeoManager->GetTopNode()->GetDaughter(
i);
40 TString childName(child->GetName());
41 cout <<
"Have detecting system: " << childName.Data() << endl;
44 fNavigator = gGeoManager->GetCurrentNavigator();
95 list<TGeoNode*>& results) {
96 Int_t nofChildren = node->GetNdaughters();
98 for (Int_t
i = 0;
i < nofChildren; ++
i) {
99 TGeoNode* child = node->GetDaughter(
i);
100 TString childName(child->GetName());
102 if (childName.Contains(name, TString::kIgnoreCase))
103 results.push_back(child);
140 list<const char*>::const_iterator stationPath,
141 list<const char*>::const_iterator stationPathEnd,
142 const std::list<const char*>& geoPath,
144 if (stationPath == stationPathEnd) {
151 Double_t left = 10000;
152 Double_t right = -10000;
153 Double_t top = -10000;
154 Double_t bottom = 10000;
155 Double_t front = 10000;
156 Double_t back = -10000;
210 const char* name = *stationPath++;
211 list<TGeoNode*> subNodes;
214 for (list<TGeoNode*>::iterator
i = subNodes.begin();
i != subNodes.end();
218 stationType, *
i, hitReader, stationPath, stationPathEnd, geoPath);
226 list<const char*>::const_iterator geoPath,
227 list<const char*>::const_iterator geoPathEnd,
234 if (geoPath == geoPathEnd)
235 HandleActive(node, left, right, top, bottom, front, back);
237 const char* name = *geoPath++;
238 list<TGeoNode*> subNodes;
241 for (list<TGeoNode*>::iterator
i = subNodes.begin();
i != subNodes.end();
245 *
i, geoPath, geoPathEnd, left, right, top, bottom, front, back);
258 TGeoBBox* pBox =
static_cast<TGeoBBox*
>(node->GetVolume()->GetShape());
261 for (
int i = -1;
i <= 1;
i += 2) {
262 for (
int j = -1; j <= 1; j += 2) {
263 for (
int k = -1; k <= 1; k += 2) {
264 Double_t localCoords[3] = {
265 i * pBox->GetDX(), j * pBox->GetDY(), k * pBox->GetDZ()};
266 Double_t globalCoords[3];
267 gGeoManager->LocalToMaster(localCoords, globalCoords);
269 if (left > globalCoords[0]) left = globalCoords[0];
271 if (right < globalCoords[0]) right = globalCoords[0];
273 if (bottom > globalCoords[1]) bottom = globalCoords[1];
275 if (top < globalCoords[1]) top = globalCoords[1];
277 if (front > globalCoords[2]) front = globalCoords[2];
279 if (back < globalCoords[2]) back = globalCoords[2];
286 list<const char*> stationPath = {
"sts",
"Station"};
287 list<const char*> geoPath = {
"Ladder",
"HalfLadder",
"Module",
"Sensor"};
288 gGeoManager->cd(
"/cave_1");
290 const char* readerName =
293 gGeoManager->GetCurrentNode(),
299 - firstStationNumber);
303 list<const char*> stationPath = {
"rich"};
304 list<const char*> geoPath = {
305 "rich_smallprototype",
"Box",
"Gas",
"PmtContainer",
"Pmt",
"pmt_pixel"};
306 gGeoManager->cd(
"/cave_1");
307 const char* readerName =
310 gGeoManager->GetCurrentNode(),
318 list<const char*> stationPath = {
"much",
"station",
"muchstation",
"layer"};
319 list<const char*> geoPath = {
"active"};
320 gGeoManager->cd(
"/cave_1");
322 const char* readerName =
325 gGeoManager->GetCurrentNode(),
331 - firstStationNumber);
335 list<const char*> stationPath = {
"trd",
"layer"};
336 list<const char*> geoPath = {
"module",
"gas"};
337 gGeoManager->cd(
"/cave_1");
339 const char* readerName =
342 gGeoManager->GetCurrentNode(),
348 - firstStationNumber);
352 list<const char*> stationPath = {
"tof"};
353 list<const char*> geoPath = {
"module",
"gas_box",
"counter"};
354 gGeoManager->cd(
"/cave_1");
355 const char* readerName =
358 gGeoManager->GetCurrentNode(),
367 gGeoManager->cd(
"/cave_1");
368 list<TGeoNode*> pipeNodes;
369 FindGeoChild(gGeoManager->GetCurrentNode(),
"pipe", pipeNodes);
371 for (list<TGeoNode*>::iterator
i = pipeNodes.begin();
i != pipeNodes.end();
373 TGeoNode* pipeNode = *
i;
375 list<TGeoNode*> pipeVacNodes;
378 for (list<TGeoNode*>::iterator j = pipeVacNodes.begin();
379 j != pipeVacNodes.end();
381 TGeoNode* pipeVacNode = *j;
383 list<TGeoNode*> targetNodes;
386 for (list<TGeoNode*>::iterator k = targetNodes.begin();
387 k != targetNodes.end();
389 TGeoNode* targetNode = *k;
391 Double_t localCoords[3] = {0, 0, 0};
392 Double_t globalCoords[3];
393 gGeoManager->LocalToMaster(localCoords, globalCoords);
397 TGeoBBox* targetBox =
398 static_cast<TGeoBBox*
>(targetNode->GetVolume()->GetShape());
399 targetBox->ComputeBBox();
412 list<const char*> stsTest = {
413 "sts",
"station",
"ladder",
"halfladder",
"module",
"sensor"};
414 list<TGeoNode*> stsTestResults;
429 list<TGeoNode*>& results,
430 TGeoNode* rootNode) {
432 rootNode = gGeoManager->GetTopNode();
433 gGeoManager->CdTop();
436 results.push_back(rootNode);
438 for (list<const char*>::const_iterator
i = nodePath.begin();
441 const char* name = *
i;
442 list<TGeoNode*> work;
444 for (list<TGeoNode*>::iterator j = results.begin(); j != results.end();
451 results.splice(results.begin(), work);