200 if (
fIsSimulation) { LOG(fatal) <<
"This method is not supported in simulation mode"; }
202 gGeoManager->cd(path.Data());
206 LOG(debug2) <<
"this volume is " << name;
208 Double_t local[3] = {0., 0., 0.};
209 gGeoManager->LocalToMaster(local,
fGlobal);
211 if (path.Contains(
"-S0-") || path.Contains(
"_S0_"))
213 else if (path.Contains(
"-S1-") || path.Contains(
"_S1_"))
215 else if (path.Contains(
"-S2-") || path.Contains(
"_S2_"))
217 else if (path.Contains(
"-S3-") || path.Contains(
"_S3_"))
220 LOG(fatal) <<
"couldn't find Station in volume name, something seems fishy ";
222 LOG(debug) <<
"I am in path: " << path;
223 LOG(debug) <<
"I am: " << name;
225 LOG(debug) <<
"I am at X: " <<
fGlobal[0];
226 LOG(debug) <<
"I am at Y: " <<
fGlobal[1];
227 LOG(debug) <<
"I am at Z: " <<
fGlobal[2];
232 Double_t fGlobalMax[3];
233 gGeoManager->LocalToMaster(local, fGlobalMax);
238 Double_t fGlobalMin[3];
239 gGeoManager->LocalToMaster(local, fGlobalMin);
241 if (fGlobalMax[0] > fGlobalMin[0]) {
249 if (fGlobalMax[1] > fGlobalMin[1]) {
272 LOG(debug) <<
"Trying to find mother.";
274 TString pipeName =
"pipe";
278 TObjArray* nodes = gGeoManager->GetTopNode()->GetNodes();
280 for (
Int_t iNode = 0; iNode < nodes->GetEntriesFast(); iNode++) {
281 TGeoNode* node = (TGeoNode*) nodes->At(iNode);
282 if (TString(node->GetName()).Contains(pipeName, TString::ECaseCompare::kIgnoreCase)) {
283 motherName = node->GetName();
284 LOG(debug) <<
" monther name: " << motherName;
285 fMother = Form(
"cave_1/%s/pipevac1_0", motherName.Data());
286 LOG(debug) <<
"MvdGeoHandler checking existance of mother: " <<
fMother;
287 if (gGeoManager->CheckPath(
fMother)) fail = kFALSE;
294 LOG(debug) <<
"Check for MVD outside of pipe";
295 for (
Int_t iNode = 0; iNode < nodes->GetEntriesFast(); iNode++) {
296 TGeoNode* node = (TGeoNode*) nodes->At(iNode);
297 if (TString(node->GetName()).Contains(
"mvd", TString::ECaseCompare::kIgnoreCase)) {
298 motherName = node->GetName();
300 LOG(debug) <<
"MvdGeoHandler found Mother: " <<
fMother;
301 LOG(warn) <<
"Mvd found outside of pipe";
309 if (fail) LOG(fatal) <<
"MVD Geometry included, but pipe not found please check your setup";
374 TString quadrantName;
377 gGeoManager->cd(path.Data());
379 sensorName = gGeoManager->GetMother(1)->GetName();
380 sensorName.Remove(0, 7);
381 Int_t sensorNumber = sensorName.Atoi();
383 quadrantName = gGeoManager->GetMother(2)->GetName();
384 stationName = quadrantName(10);
385 quadrantName.Remove(0, 12);
386 Int_t quadNumber = quadrantName.Atoi();
387 Int_t stationNumber = stationName.Atoi();
389 id = 1000 * stationNumber + 100 * quadNumber + sensorNumber;
417 LOG(error) <<
"Using old Geometry files within the new Digitizer is not supported, "
418 <<
"please use CbmMvdDigitizeL if you want to use this Geometry";
422 if (!
fDetector) LOG(fatal) <<
"GeometryHandler couldn't find a valid Detector";
425 for (
Int_t StatNr = 0; StatNr < 4; StatNr++) {
429 fStationName = Form(
"/MVDo%iohoFPCoextoHSoS_1", StatNr);
430 for (
Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
433 fQuadrantName = Form(
"/St%iQ%iohoFPCoext_1", StatNr, QuadNr);
434 for (
Int_t Layer = 0; Layer < 2; Layer++) {
436 for (
Int_t SensNr = 0; SensNr < 50; SensNr++) {
437 fSensorHolding = Form(
"/MVD-S%i-Q%i-L%i-C%02i-P0oPartAss_1", StatNr, QuadNr, Layer, SensNr);
438 fSensorName = Form(
"MVD-S%i-Q%i-L%i-C%02i-P0", StatNr, QuadNr, Layer, SensNr);
441 for (
Int_t SegmentNr = 0; SegmentNr < 50; SegmentNr++) {
442 fSectorName = Form(
"/S%iQ%iS%i_1", StatNr, QuadNr, SegmentNr);
445 LOG(debug) <<
"looking for " <<
fnodeName;
462 if (!
fDetector) LOG(fatal) <<
"GeometryHandler couldn't find a valid Detector";
466 for (
Int_t StatNr = 0; StatNr < 4; StatNr++) {
469 for (
Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
471 for (
Int_t SensNr = 0; SensNr < 50; SensNr++) {
475 LOG(debug1) <<
"looking for " <<
fnodeName;
490 <<
" and added to MVD Detector";
501 if (!
fDetector) LOG(fatal) <<
"GeometryHandler couldn't find a valid Detector";
503 for (
Int_t StatNr = 0; StatNr < 2; StatNr++) {
506 for (
Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
508 for (
Int_t SensNr = 0; SensNr < 50; SensNr++) {
512 LOG(debug1) <<
"looking for " <<
fnodeName;
526 <<
" and added to MVD Detector";
536 LOG(debug) <<
"Fill v25a";
538 if (!
fDetector) LOG(fatal) <<
"GeometryHandler couldn't find a valid Detector";
540 for (
Int_t StatNr = 0; StatNr < 2; StatNr++) {
543 for (
Int_t QuadNr = 0; QuadNr < 1; QuadNr++) {
545 for (
Int_t SensNr = 0; SensNr < 1; SensNr++) {
568 if (!
fDetector) LOG(fatal) <<
"GeometryHandler couldn't find a valid mCBM Detector";
571 for (
Int_t StatNr = 0; StatNr < 2; StatNr++) {
575 for (
Int_t Layer = 0; Layer < 2; Layer++) {
576 for (
Int_t SensNr = 0; SensNr < 50; SensNr++) {
577 fQuadrantName = Form(
"/MVD-S%i-Q0-L%i-C%02i_1", StatNr, Layer, SensNr);
578 fSensorHolding = Form(
"/MVD-S%i-Q0-L%i-C%02i-P0oPartAss_1", StatNr, Layer, SensNr);
579 fSensorName = Form(
"MVD-S%i-Q0-L%i-C%02i-P0", StatNr, Layer, SensNr);
597 LOG(error) <<
"Tried to load an unsupported MVD Geometry";
627 for (
Int_t StatNr = 0; StatNr < 4; StatNr++) {
630 fStationName = Form(
"/MVDo%iohoFPCoextoHSoS_1", StatNr);
631 for (
Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
634 fQuadrantName = Form(
"/St%iQ%iohoFPCoext_1", StatNr, QuadNr);
635 for (
Int_t Layer = 0; Layer < 2; Layer++) {
636 for (
Int_t SensNr = 0; SensNr < 50; SensNr++) {
637 fSensorHolding = Form(
"/MVD-S%i-Q%i-L%i-C%02i-P0oPartAss_1", StatNr, QuadNr, Layer, SensNr);
638 fSensorName = Form(
"MVD-S%i-Q%i-L%i-C%02i-P0", StatNr, QuadNr, Layer, SensNr);
641 for (
Int_t SegmentNr = 0; SegmentNr < 50; SegmentNr++) {
642 fSectorName = Form(
"/S%iQ%iS%i_1", StatNr, QuadNr, SegmentNr);
659 for (
Int_t StatNr = 0; StatNr < 4; StatNr++) {
661 for (
Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
663 for (
Int_t SensNr = 0; SensNr < 50; SensNr++) {
667 LOG(debug) <<
"looking for " <<
fnodeName;
672 LOG(debug) <<
"found " <<
fnodeName <<
" number: " << iStation <<
" ID: " <<
fVolId
673 <<
" and added to station map";
676 LOG(debug) <<
"Map now size: " <<
fStationMap.size();
687 for (
Int_t StatNr = 0; StatNr < 2; StatNr++) {
689 for (
Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
691 for (
Int_t SensNr = 0; SensNr < 50; SensNr++) {
695 LOG(debug) <<
"looking for " <<
fnodeName;
700 LOG(debug) <<
"found " <<
fnodeName <<
" number: " << iStation <<
" ID: " <<
fVolId
701 <<
" and added to station map";
704 LOG(debug) <<
"Map now size: " <<
fStationMap.size();
713 LOG(info) <<
"Filling v25a mcbm";
717 for (
Int_t StatNr = 0; StatNr < 2; StatNr++) {
719 for (
Int_t QuadNr = 0; QuadNr < 1; QuadNr++) {
721 for (
Int_t SensNr = 0; SensNr < 1; SensNr++) {
737 LOG(debug) <<
"MVD v25a mcbm station filled";
743 TString volName = Form(
"mvdstation%02i", iStation);
744 volId = gGeoManager->GetUID(volName);
749 }
while (volId > -1);
753 for (
Int_t StatNr = 0; StatNr < 2; StatNr++) {
755 for (
Int_t Layer = 0; Layer < 2; Layer++) {
756 for (
Int_t SensNr = 0; SensNr < 50; SensNr++) {
757 fQuadrantName = Form(
"/MVD-S%i-Q0-L%i-C%02i_1", StatNr, Layer, SensNr);
758 fSensorHolding = Form(
"/MVD-S%i-Q0-L%i-C%02i-P0oPartAss_1", StatNr, Layer, SensNr);
759 fSensorName = Form(
"MVD-S%i-Q0-L%i-C%02i-P0", StatNr, Layer, SensNr);
775 LOG(error) <<
"You tried to use an unsuported Geometry";