diff --git a/core/detectors/mvd/tools/CbmMvdGeoHandler.cxx b/core/detectors/mvd/tools/CbmMvdGeoHandler.cxx index db64de1ab0c9cc0067dd657049f2f961c81babfc..775d98d362a5bb3fd44af3836318aa0e8b226d55 100644 --- a/core/detectors/mvd/tools/CbmMvdGeoHandler.cxx +++ b/core/detectors/mvd/tools/CbmMvdGeoHandler.cxx @@ -105,6 +105,7 @@ void CbmMvdGeoHandler::Init(Bool_t isSimulation) case FourStation: case FourStationShift: fStationPar->Init(4); break; case ThreeStation: fStationPar->Init(3); break; + case TwoStation: fStationPar->Init(2); break; case MiniCbm: fStationPar->Init(2); break; default: fStationPar->Init(0); } @@ -191,7 +192,7 @@ Int_t CbmMvdGeoHandler::GetStation(const TString& path) //-------------------------------------------------------------------------- void CbmMvdGeoHandler::NavigateTo(const TString& path) { - // LOG(info) << "path : " << path.Data(); + //LOG(info) << "path : " << path.Data(); if (fIsSimulation) { LOG(fatal) << "This method is not supported in simulation mode"; } else { gGeoManager->cd(path.Data()); @@ -333,8 +334,13 @@ void CbmMvdGeoHandler::GetGeometryTyp() fDetectorName = "/MVDomCBMorotated_0"; fGeoTyp = MiniCbm; } + else if (gGeoManager->CheckPath(fMother + "/TwoStation_0")) { + LOG(info) << "Found two station scripted MVD configuration"; + fDetectorName = "/TwoStation_0"; + fGeoTyp = TwoStation; + } else if (gGeoManager->CheckPath(fMother + "/MVDscripted_0")) { - LOG(debug) << "Found scripted MVD configuration"; + LOG(info) << "Found scripted MVD configuration"; fDetectorName = "/MVDscripted_0"; fGeoTyp = scripted; } @@ -438,6 +444,7 @@ void CbmMvdGeoHandler::FillDetector() fSensorName = "sensorActive"; if (!fDetector) LOG(fatal) << "GeometryHandler couldn't find a valid Detector"; + Int_t iStation = 0; for (Int_t StatNr = 0; StatNr < 4; StatNr++) { fStationNumber = StatNr; @@ -472,6 +479,43 @@ void CbmMvdGeoHandler::FillDetector() } } + else if (fGeoTyp == TwoStation) { + fSensorName = "sensorActive"; + if (!fDetector) LOG(fatal) << "GeometryHandler couldn't find a valid Detector"; + Int_t iStation = 0; + for (Int_t StatNr = 0; StatNr < 2; StatNr++) { + fStationNumber = StatNr; + fStationName = Form("/station_S%d_1", StatNr); + for (Int_t QuadNr = 0; QuadNr < 4; QuadNr++) { + fQuadrantName = Form("/quadrant_S%d_%d", StatNr, QuadNr); + for (Int_t SensNr = 0; SensNr < 50; SensNr++) { + fSensorHolding = Form("/sensor_%d", SensNr); + fnodeName = + fMother + fDetectorName + fStationName + fQuadrantName + fSensorHolding + "/" + fSensorName + "_1"; + LOG(debug1) << "looking for " << fnodeName; + Bool_t nodeFound = gGeoManager->CheckPath(fnodeName.Data()); + if (nodeFound) { + gGeoManager->cd(fnodeName); + fVolId = GetIDfromPath(fnodeName); + + if (fSensorTyp == CbmMvdSensorTyp::MIMOSIS) + fDetector->AddSensor(fSensorName, fSensorName, fnodeName, new CbmMvdMimosis, iStation, fVolId, 0.0, + StatNr); + else + fDetector->AddSensor(fSensorName, fSensorName, fnodeName, new CbmMvdMimosa26AHR, iStation, fVolId, 0.0, + StatNr); + iStation++; + FillParameter(); + LOG(debug1) << "found " << fSensorHolding + "/" + fSensorName << " number: " << fVolId + << " and added to MVD Detector"; + } + else + break; + } + } + } + } + else if (fGeoTyp == MiniCbm) { @@ -591,6 +635,34 @@ void CbmMvdGeoHandler::FillStationMap() } } } + else if (fGeoTyp == TwoStation) { + fSensorName = "sensorActive"; + Int_t iStation = 0; + for (Int_t StatNr = 0; StatNr < 2; StatNr++) { + fStationName = Form("/station_S%d_1", StatNr); + for (Int_t QuadNr = 0; QuadNr < 4; QuadNr++) { + fQuadrantName = Form("/quadrant_S%d_%d", StatNr, QuadNr); + for (Int_t SensNr = 0; SensNr < 50; SensNr++) { + fSensorHolding = Form("/sensor_%d", SensNr); + fnodeName = + fMother + fDetectorName + fStationName + fQuadrantName + fSensorHolding + "/" + fSensorName + "_1"; + LOG(debug) << "looking for " << fnodeName; + Bool_t nodeFound = gGeoManager->CheckPath(fnodeName.Data()); + if (nodeFound) { + gGeoManager->cd(fnodeName); + fVolId = GetIDfromPath(fnodeName); + LOG(debug) << "found " << fnodeName << " number: " << iStation << " ID: " << fVolId + << " and added to station map"; + fStationMap[fVolId] = iStation; + iStation++; + LOG(debug) << "Map now size: " << fStationMap.size(); + } + else + break; + } + } + } + } else if (fGeoTyp == Default) { Int_t iStation = 1; Int_t volId = -1; diff --git a/external/InstallGeometry.cmake b/external/InstallGeometry.cmake index a769b5a76185de3e1c4495f3c96b945b0ea665c7..581025be79eeffb6092f3f13ad1e29caf2655ce8 100644 --- a/external/InstallGeometry.cmake +++ b/external/InstallGeometry.cmake @@ -1,4 +1,4 @@ -set(GEOMETRY_VERSION 4489953e3400c49528036b6c509dec80edc3f00f) +set(GEOMETRY_VERSION 6ce5fd03c7d8cde2fa83ae72bff4d51916508c85) set(GEOMETRY_SRC_URL "https://git.cbm.gsi.de/CbmSoft/cbmroot_geometry.git") download_project_if_needed(PROJECT Geometry_source