Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions src/SHiPGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "UpstreamTagger/UpstreamTaggerFactory.h"

#include <GeoModelKernel/GeoDefinitions.h>
#include <GeoModelKernel/GeoIdentifierTag.h>
#include <GeoModelKernel/GeoNameTag.h>
#include <GeoModelKernel/GeoPhysVol.h>
#include <GeoModelKernel/GeoTransform.h>
Expand All @@ -42,7 +43,8 @@ GeoPhysVol* SHiPGeometryBuilder::build() {
// Note: These are relative to the cave origin
constexpr double cm = GeoModelKernelUnits::cm;
GeoTrf::Transform3D targetTrf = GeoTrf::Translate3D(0.0, -14.45 * cm, 43.25 * cm);
world->add(new GeoNameTag("target_vacuum_box"));
world->add(new GeoNameTag("/SHiP/target"));
world->add(new GeoIdentifierTag(1));
world->add(new GeoTransform(targetTrf));
world->add(target);

Expand All @@ -51,7 +53,8 @@ GeoPhysVol* SHiPGeometryBuilder::build() {
MuonShieldFactory muonShieldFactory(materials);
GeoPhysVol* muonShield = muonShieldFactory.build();
GeoTrf::Transform3D muonShieldTrf = GeoTrf::Translate3D(0.0, 0.0, 16763.3);
world->add(new GeoNameTag("MuonShieldArea"));
world->add(new GeoNameTag("/SHiP/muon_shield"));
world->add(new GeoIdentifierTag(2));
world->add(new GeoTransform(muonShieldTrf));
world->add(muonShield);

Expand All @@ -61,7 +64,8 @@ GeoPhysVol* SHiPGeometryBuilder::build() {
UpstreamTaggerFactory upstreamTaggerFactory(materials);
GeoVPhysVol* upstreamTagger = upstreamTaggerFactory.build(&ubtManager);
GeoTrf::Transform3D upstreamTaggerTrf = GeoTrf::Translate3D(0.0, 0.0, 32.72 * 1000.0);
world->add(new GeoNameTag("Upstream_Tagger"));
world->add(new GeoNameTag("/SHiP/upstream_tagger"));
world->add(new GeoIdentifierTag(3));
world->add(new GeoTransform(upstreamTaggerTrf));
world->add(upstreamTagger);

Expand All @@ -71,7 +75,8 @@ GeoPhysVol* SHiPGeometryBuilder::build() {
GeoPhysVol* decayVolume = decayVolumeFactory.build();
GeoTrf::Transform3D decayVolumeTrf =
GeoTrf::Translate3D(0.0, 0.0, 58.12 * 1000.0); // Convert m to mm
world->add(new GeoNameTag("DecayVolume"));
world->add(new GeoNameTag("/SHiP/decay_volume"));
world->add(new GeoIdentifierTag(4));
world->add(new GeoTransform(decayVolumeTrf));
world->add(decayVolume);

Expand All @@ -84,7 +89,8 @@ GeoPhysVol* SHiPGeometryBuilder::build() {
constexpr double trackersCentreZ =
(84.07 + 95.07) / 2.0 * 1000.0; // Average of station 1 and 4 centres
GeoTrf::Transform3D trackersTrf = GeoTrf::Translate3D(0.0, 0.0, trackersCentreZ);
world->add(new GeoNameTag("TrackersContainer"));
world->add(new GeoNameTag("/SHiP/trackers"));
world->add(new GeoIdentifierTag(5));
world->add(new GeoTransform(trackersTrf));
world->add(trackers);

Expand All @@ -94,7 +100,8 @@ GeoPhysVol* SHiPGeometryBuilder::build() {
GeoPhysVol* magnet = magnetFactory.build();
GeoTrf::Transform3D magnetTrf =
GeoTrf::Translate3D(0.0, 0.0, 89.57 * 1000.0); // Convert m to mm
world->add(new GeoNameTag("Magnet"));
world->add(new GeoNameTag("/SHiP/magnet"));
world->add(new GeoIdentifierTag(6));
world->add(new GeoTransform(magnetTrf));
world->add(magnet);

Expand All @@ -104,7 +111,8 @@ GeoPhysVol* SHiPGeometryBuilder::build() {
GeoPhysVol* timingDetector = timingDetectorFactory.build();
GeoTrf::Transform3D timingDetectorTrf =
GeoTrf::Translate3D(0.0, 0.0, 95.902 * 1000.0); // Convert m to mm
world->add(new GeoNameTag("TimingDetector"));
world->add(new GeoNameTag("/SHiP/timing_detector"));
world->add(new GeoIdentifierTag(7));
world->add(new GeoTransform(timingDetectorTrf));
world->add(timingDetector);

Expand All @@ -114,7 +122,8 @@ GeoPhysVol* SHiPGeometryBuilder::build() {
GeoPhysVol* calorimeter = calorimeterFactory.build();
GeoTrf::Transform3D calorimeterTrf =
GeoTrf::Translate3D(0.0, 0.0, 98.32 * 1000.0); // Convert m to mm
world->add(new GeoNameTag("CalorimeterContainer"));
world->add(new GeoNameTag("/SHiP/calorimeter"));
world->add(new GeoIdentifierTag(8));
world->add(new GeoTransform(calorimeterTrf));
world->add(calorimeter);

Expand Down
18 changes: 11 additions & 7 deletions subsystems/Calorimeter/src/CalorimeterFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <GeoModelKernel/GeoBox.h>
#include <GeoModelKernel/GeoDefinitions.h>
#include <GeoModelKernel/GeoIdentifierTag.h>
#include <GeoModelKernel/GeoLogVol.h>
#include <GeoModelKernel/GeoNameTag.h>
#include <GeoModelKernel/GeoPhysVol.h>
Expand All @@ -21,42 +22,45 @@ GeoPhysVol* CalorimeterFactory::build() {

// Create container volume that spans all calorimeter components
auto* containerBox = new GeoBox(s_containerHalfX, s_containerHalfY, s_containerHalfZ);
auto* containerLog = new GeoLogVol("CalorimeterContainer", containerBox, air);
auto* containerLog = new GeoLogVol("/SHiP/calorimeter", containerBox, air);
auto* containerPhys = new GeoPhysVol(containerLog);

// Create and place ECAL front
auto* ecalFrontBox = new GeoBox(s_ecalFrontHalfX, s_ecalFrontHalfY, s_ecalFrontHalfZ);
auto* ecalFrontLog = new GeoLogVol("ECAL_front", ecalFrontBox, air);
auto* ecalFrontLog = new GeoLogVol("/SHiP/calorimeter/ecal_front", ecalFrontBox, air);
auto* ecalFrontPhys = new GeoPhysVol(ecalFrontLog);

double ecalFrontRelativeZ = s_ecalFrontZ - s_containerCentreZ;
GeoTrf::Transform3D ecalFrontTrf = GeoTrf::Translate3D(0.0, 0.0, ecalFrontRelativeZ);

containerPhys->add(new GeoNameTag("ECAL_front"));
containerPhys->add(new GeoNameTag("/SHiP/calorimeter/ecal_front"));
containerPhys->add(new GeoIdentifierTag(0));
containerPhys->add(new GeoTransform(ecalFrontTrf));
containerPhys->add(ecalFrontPhys);

// Create and place ECAL back
auto* ecalBackBox = new GeoBox(s_ecalBackHalfX, s_ecalBackHalfY, s_ecalBackHalfZ);
auto* ecalBackLog = new GeoLogVol("ECAL_back", ecalBackBox, air);
auto* ecalBackLog = new GeoLogVol("/SHiP/calorimeter/ecal_back", ecalBackBox, air);
auto* ecalBackPhys = new GeoPhysVol(ecalBackLog);

double ecalBackRelativeZ = s_ecalBackZ - s_containerCentreZ;
GeoTrf::Transform3D ecalBackTrf = GeoTrf::Translate3D(0.0, 0.0, ecalBackRelativeZ);

containerPhys->add(new GeoNameTag("ECAL_back"));
containerPhys->add(new GeoNameTag("/SHiP/calorimeter/ecal_back"));
containerPhys->add(new GeoIdentifierTag(1));
containerPhys->add(new GeoTransform(ecalBackTrf));
containerPhys->add(ecalBackPhys);

// Create and place HCAL
auto* hcalBox = new GeoBox(s_hcalHalfX, s_hcalHalfY, s_hcalHalfZ);
auto* hcalLog = new GeoLogVol("HCAL", hcalBox, air);
auto* hcalLog = new GeoLogVol("/SHiP/calorimeter/hcal", hcalBox, air);
auto* hcalPhys = new GeoPhysVol(hcalLog);

double hcalRelativeZ = s_hcalZ - s_containerCentreZ;
GeoTrf::Transform3D hcalTrf = GeoTrf::Translate3D(0.0, 0.0, hcalRelativeZ);

containerPhys->add(new GeoNameTag("HCAL"));
containerPhys->add(new GeoNameTag("/SHiP/calorimeter/hcal"));
containerPhys->add(new GeoIdentifierTag(2));
containerPhys->add(new GeoTransform(hcalTrf));
containerPhys->add(hcalPhys);

Expand Down
6 changes: 4 additions & 2 deletions subsystems/Cavern/src/CavernFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <GeoModelKernel/GeoBox.h>
#include <GeoModelKernel/GeoDefinitions.h>
#include <GeoModelKernel/GeoIdentifierTag.h>
#include <GeoModelKernel/GeoLogVol.h>
#include <GeoModelKernel/GeoMaterial.h>
#include <GeoModelKernel/GeoNameTag.h>
Expand Down Expand Up @@ -66,12 +67,13 @@ GeoPhysVol* CavernFactory::build() {
const GeoShape* cavernShape = &(shape4->subtract((*targetPit) << targetPitTrf));

// Create cavern logical and physical volumes
auto* cavernLog = new GeoLogVol("Cavern", cavernShape, concrete);
auto* cavernLog = new GeoLogVol("/SHiP/cavern", cavernShape, concrete);
m_cavern = new GeoPhysVol(cavernLog);

// Place cavern in world with name tag
GeoTrf::Transform3D cavernTrf = GeoTrf::Translate3D(0.0, 0.0, s_cavernPosZ);
m_world->add(new GeoNameTag("Cavern"));
m_world->add(new GeoNameTag("/SHiP/cavern"));
m_world->add(new GeoIdentifierTag(0));
m_world->add(new GeoTransform(cavernTrf));
m_world->add(m_cavern);

Expand Down
8 changes: 5 additions & 3 deletions subsystems/DecayVolume/src/DecayVolumeFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <GeoModelKernel/GeoBox.h>
#include <GeoModelKernel/GeoDefinitions.h>
#include <GeoModelKernel/GeoIdentifierTag.h>
#include <GeoModelKernel/GeoLogVol.h>
#include <GeoModelKernel/GeoNameTag.h>
#include <GeoModelKernel/GeoPhysVol.h>
Expand All @@ -22,16 +23,17 @@ GeoPhysVol* DecayVolumeFactory::build() {

// Outer aluminium vessel
auto* outerBox = new GeoBox(s_halfX, s_halfY, s_halfZ);
auto* outerLog = new GeoLogVol("DecayVolume", outerBox, aluminium);
auto* outerLog = new GeoLogVol("/SHiP/decay_volume", outerBox, aluminium);
auto* outerPhys = new GeoPhysVol(outerLog);

// Inner helium atmosphere
auto* innerBox = new GeoBox(s_innerHalfX, s_innerHalfY, s_innerHalfZ);
auto* innerLog = new GeoLogVol("DecayVacuum", innerBox, helium);
auto* innerLog = new GeoLogVol("/SHiP/decay_volume/vacuum", innerBox, helium);
auto* innerPhys = new GeoPhysVol(innerLog);

// Place inner at centre of outer
outerPhys->add(new GeoNameTag("DecayVacuum"));
outerPhys->add(new GeoNameTag("/SHiP/decay_volume/vacuum"));
outerPhys->add(new GeoIdentifierTag(0));
outerPhys->add(new GeoTransform(GeoTrf::TranslateZ3D(0.0)));
outerPhys->add(innerPhys);

Expand Down
48 changes: 29 additions & 19 deletions subsystems/Magnet/src/MagnetFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <GeoModelKernel/GeoBox.h>
#include <GeoModelKernel/GeoDefinitions.h>
#include <GeoModelKernel/GeoIdentifierTag.h>
#include <GeoModelKernel/GeoLogVol.h>
#include <GeoModelKernel/GeoNameTag.h>
#include <GeoModelKernel/GeoPhysVol.h>
Expand All @@ -22,57 +23,66 @@ GeoPhysVol* MagnetFactory::build() {

// Create container
auto* containerBox = new GeoBox(s_containerHalfX, s_containerHalfY, s_containerHalfZ);
auto* containerLog = new GeoLogVol("SHiPMagnet", containerBox, air);
auto* containerLog = new GeoLogVol("/SHiP/magnet", containerBox, air);
auto* containerPhys = new GeoPhysVol(containerLog);

// Create and place yoke
auto* yoke = createYoke();
containerPhys->add(new GeoNameTag("magyoke"));
containerPhys->add(new GeoNameTag("/SHiP/magnet/yoke"));
containerPhys->add(new GeoIdentifierTag(0));
containerPhys->add(new GeoTransform(GeoTrf::Transform3D::Identity()));
containerPhys->add(yoke);

// Create and place coils
auto* coil1 = createCoil("MCoil1");
containerPhys->add(new GeoNameTag("MCoil1"));
auto* coil1 = createCoil("/SHiP/magnet/coil_1");
containerPhys->add(new GeoNameTag("/SHiP/magnet/coil_1"));
containerPhys->add(new GeoIdentifierTag(1));
containerPhys->add(new GeoTransform(GeoTrf::Translate3D(s_coilXOffset, s_coilYOffset, 0.0)));
containerPhys->add(coil1);

auto* coil2 = createCoil("MCoil2");
containerPhys->add(new GeoNameTag("MCoil2"));
auto* coil2 = createCoil("/SHiP/magnet/coil_2");
containerPhys->add(new GeoNameTag("/SHiP/magnet/coil_2"));
containerPhys->add(new GeoIdentifierTag(2));
containerPhys->add(new GeoTransform(GeoTrf::Translate3D(-s_coilXOffset, s_coilYOffset, 0.0)));
containerPhys->add(coil2);

auto* coil3 = createCoil("MCoil3");
containerPhys->add(new GeoNameTag("MCoil3"));
auto* coil3 = createCoil("/SHiP/magnet/coil_3");
containerPhys->add(new GeoNameTag("/SHiP/magnet/coil_3"));
containerPhys->add(new GeoIdentifierTag(3));
containerPhys->add(new GeoTransform(GeoTrf::Translate3D(s_coilXOffset, -s_coilYOffset, 0.0)));
containerPhys->add(coil3);

auto* coil4 = createCoil("MCoil4");
containerPhys->add(new GeoNameTag("MCoil4"));
auto* coil4 = createCoil("/SHiP/magnet/coil_4");
containerPhys->add(new GeoNameTag("/SHiP/magnet/coil_4"));
containerPhys->add(new GeoIdentifierTag(4));
containerPhys->add(new GeoTransform(GeoTrf::Translate3D(-s_coilXOffset, -s_coilYOffset, 0.0)));
containerPhys->add(coil4);

// Create and place vertical connectors
auto* cv1 = createVerticalConnector("CV_1");
containerPhys->add(new GeoNameTag("CV_1"));
auto* cv1 = createVerticalConnector("/SHiP/magnet/connector_1");
containerPhys->add(new GeoNameTag("/SHiP/magnet/connector_1"));
containerPhys->add(new GeoIdentifierTag(5));
containerPhys->add(
new GeoTransform(GeoTrf::Translate3D(s_connectorXOffset, 0.0, -s_connectorZOffset)));
containerPhys->add(cv1);

auto* cv2 = createVerticalConnector("CV_2");
containerPhys->add(new GeoNameTag("CV_2"));
auto* cv2 = createVerticalConnector("/SHiP/magnet/connector_2");
containerPhys->add(new GeoNameTag("/SHiP/magnet/connector_2"));
containerPhys->add(new GeoIdentifierTag(6));
containerPhys->add(
new GeoTransform(GeoTrf::Translate3D(-s_connectorXOffset, 0.0, -s_connectorZOffset)));
containerPhys->add(cv2);

auto* cv3 = createVerticalConnector("CV_3");
containerPhys->add(new GeoNameTag("CV_3"));
auto* cv3 = createVerticalConnector("/SHiP/magnet/connector_3");
containerPhys->add(new GeoNameTag("/SHiP/magnet/connector_3"));
containerPhys->add(new GeoIdentifierTag(7));
containerPhys->add(
new GeoTransform(GeoTrf::Translate3D(s_connectorXOffset, 0.0, s_connectorZOffset)));
containerPhys->add(cv3);

auto* cv4 = createVerticalConnector("CV_4");
containerPhys->add(new GeoNameTag("CV_4"));
auto* cv4 = createVerticalConnector("/SHiP/magnet/connector_4");
containerPhys->add(new GeoNameTag("/SHiP/magnet/connector_4"));
containerPhys->add(new GeoIdentifierTag(8));
containerPhys->add(
new GeoTransform(GeoTrf::Translate3D(-s_connectorXOffset, 0.0, s_connectorZOffset)));
containerPhys->add(cv4);
Expand All @@ -90,7 +100,7 @@ GeoPhysVol* MagnetFactory::createYoke() {
// Subtract to create yoke shape
const GeoShape* yokeShape = &(outerBox->subtract(*innerBox));

auto* yokeLog = new GeoLogVol("magyoke", yokeShape, iron);
auto* yokeLog = new GeoLogVol("/SHiP/magnet/yoke", yokeShape, iron);
return new GeoPhysVol(yokeLog);
}

Expand Down
Loading