diff --git a/Scintillator/ScintDetDescr/VetoGeoModel/src/VetoDetectorFactory.cxx b/Scintillator/ScintDetDescr/VetoGeoModel/src/VetoDetectorFactory.cxx index f48c2a0137e2f433919dc7231aa88eeabbb3d2ea..bba7334b06b9646c0c22c67ce166560623ba0d8c 100644 --- a/Scintillator/ScintDetDescr/VetoGeoModel/src/VetoDetectorFactory.cxx +++ b/Scintillator/ScintDetDescr/VetoGeoModel/src/VetoDetectorFactory.cxx @@ -147,12 +147,12 @@ void VetoDetectorFactory::create(GeoPhysVol *world) GeoTrf::Transform3D vetoTransform = vetoGeneral->partTransform("Veto"); std::string stationA_Label = "StationA"; - // std::string stationB_Label = "StationB"; + std::string stationB_Label = "StationB"; // std::string absorberA_Label = "AbsorberA"; // std::string absorberB_Label = "AbsorberB"; bool stationA_Present = vetoGeneral->partPresent(stationA_Label); - // bool stationB_Present = vetoGeneral->partPresent(stationB_Label); + bool stationB_Present = vetoGeneral->partPresent(stationB_Label); // bool absorberA_Present = vetoGeneral->partPresent(absorberA_Label); // bool absorberB_Present = vetoGeneral->partPresent(absorberB_Label); @@ -182,6 +182,32 @@ void VetoDetectorFactory::create(GeoPhysVol *world) m_detectorManager->addAlignableTransform(3, id.getPlateId(), stationA_Transform, stationA_PV); } + // + // Station B + // + if (stationB_Present) + { + msg(MSG::DEBUG) << "Building the Veto Station B." << endmsg; + m_detectorManager->numerology().addStation(1); + + // Create the station + VetoStation stationB("VetoStationB", m_detectorManager, m_geometryManager, m_materials); + VetoIdentifier id{m_geometryManager->athenaComps()->getIdHelper()}; + id.setStation(1); + GeoVPhysVol* stationB_PV = stationB.build(id); + GeoAlignableTransform* stationB_Transform = new GeoAlignableTransform(vetoTransform * vetoGeneral->partTransform(stationB_Label)); + + GeoNameTag* topLevelNameTag = new GeoNameTag("Veto"); + scint->add(topLevelNameTag); + scint->add(new GeoIdentifierTag(0)); + scint->add(stationB_Transform); + scint->add(stationB_PV); + m_detectorManager->addTreeTop(stationB_PV); + + // Store alignable transform + m_detectorManager->addAlignableTransform(3, id.getPlateId(), stationB_Transform, stationB_PV); + } + // // // // The Barrel // //