ATLAS Offline Software
Loading...
Searching...
No Matches
MuonWallTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5//************************************************************
6//
7// Class MuonWallTool
8// Class implementing geometry of the MuonWall
9//
10//************************************************************
11
12// class header
13#include "MuonWallTool.h"
14
15//Athena headers
17#include "GeoModelKernel/GeoMaterial.h"
19
20// Geant4 headers
21#include "G4Box.hh"
22#include "G4LogicalVolume.hh"
23#include "G4Material.hh"
24#include "G4PVPlacement.hh"
25#include "G4ThreeVector.hh"
26
27// CLHEP headers
28#include "CLHEP/Units/SystemOfUnits.h"
29
30// STL headers
31#include <string>
32#include <iostream>
33
34MuonWallTool::MuonWallTool(const std::string& type, const std::string& name, const IInterface* parent)
35 : DetectorGeometryBase(type,name,parent)
36{
37}
38
40
41 ATH_MSG_DEBUG( "Building Geometry back muon wall: "
42 << (m_backWall ? "true" : "false")
43 << " side muon wall: "
44 << (m_sideWall ? "true" : "false") );
45
46 // MuonWall description :
47
48 // Scintillator : 400*200*20, calculating half-size
49 const double zScintillator = m_zLength / 2.;
50 const double yScintillator = m_yLength / 2.;
51 const double xScintillator = m_xLength / 2.;
52 const double dzmuonwall = 750. * CLHEP::mm;
53 const double dymuonwall = 425. * CLHEP::mm;
54 const double dxmuonwall = xScintillator;
55
56 G4Box *wall = new G4Box("MuonWall", dxmuonwall, dymuonwall, dzmuonwall);
57
58 // Get the materials
59 StoredMaterialManager* materialManager = nullptr;
60 if (StatusCode::SUCCESS != detStore()->retrieve(materialManager, std::string("MATERIALS"))) {
61 ATH_MSG_ERROR( "Could not find Material Manager MATERIALS" );
62 return;
63 }
64
65 const GeoMaterial *geoAir = materialManager->getMaterial("tile::Air");
66 const GeoMaterial *geoScintillator = materialManager->getMaterial("tile::Scintillator");
67 Geo2G4MaterialFactory theMaterialFactory;
68 G4Material *airMaterial = theMaterialFactory.Build(geoAir);
69 G4Material *scintillatorMaterial = theMaterialFactory.Build(geoScintillator);
70
71 G4LogicalVolume *wallV = new G4LogicalVolume(wall, airMaterial, "MuonWall");
72
73 // ------- Create lead layers and place them inside the mother box --------
74 double zLayer, yLayer, xLayer = 0.;
75
76 if (m_backWall) {
77
78 const int nrOfLayers = 12;
79
80 for (int j = 0; j < nrOfLayers; j++) {
81
82 // Scintillator
83 G4Box *scintillatorLayer = new G4Box("ScintillatorLayer", xScintillator, yScintillator, zScintillator);
84
85 G4LogicalVolume *scintillatorLayerV = new G4LogicalVolume(scintillatorLayer, scintillatorMaterial,
86 "MuScintillatorLayer");
87
88 // scintillatorLayerV->GetLogicalVolume()->SetSensitiveDetector(muonwallSD);
89
90 if (j < 6) {
91 yLayer = yScintillator + 25. * CLHEP::mm;
92 zLayer = -450. * CLHEP::mm + (2 * j + 1) * zScintillator;
93 } else {
94 yLayer = -yScintillator + 25. * CLHEP::mm;
95 zLayer = -450. * CLHEP::mm + (2 * (j - 6) + 1) * zScintillator;
96 }
97
98 G4PVPlacement* scintillatorLayerVPhys __attribute__((unused)) =
99 new G4PVPlacement(0,
100 G4ThreeVector(xLayer,yLayer,zLayer),
101 scintillatorLayerV,
102 "MuScintillatorLayer",
103 wallV,
104 false,
105 j+1);
106 }
107 }
108
109 if (m_sideWall) {
110
111 // Scintillator : 500*100*20 instead of 400*200*20
112 const double yScintillator1 = yScintillator + 50. * CLHEP::mm;
113 const double zScintillator1 = zScintillator - 50. * CLHEP::mm;
114
115 const int nScintLayers = 3;
116
117 for (int j = 0; j < nScintLayers; j++) {
118
119 G4Box* scintillatorLayer = new G4Box("SideScintiLayer", xScintillator, yScintillator1, zScintillator1);
120
121 G4LogicalVolume* scintillatorLayerV = new G4LogicalVolume(scintillatorLayer, scintillatorMaterial,
122 "SideMuScintiLayer");
123
124 yLayer = -175. * CLHEP::mm;
125 zLayer = -750. * CLHEP::mm + (2 * j + 1) * zScintillator1;
126
127 G4PVPlacement* scintillatorLayerVPhys __attribute__((unused)) =
128 new G4PVPlacement(0,
129 G4ThreeVector(xLayer,yLayer,zLayer),
130 scintillatorLayerV,
131 "SideMuScintiLayer",
132 wallV,
133 false,
134 j+1);
135 }
136 }
137
138 // FINAL STEP
139 m_envelope.theEnvelope = wallV;
140}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
void unused(Args &&...)
DetectorGeometryBase(const std::string &type, const std::string &name, const IInterface *parent)
G4Material * Build(const GeoMaterial *)
Gaudi::Property< bool > m_backWall
Gaudi::Property< double > m_zLength
Gaudi::Property< double > m_yLength
Gaudi::Property< double > m_xLength
MuonWallTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< bool > m_sideWall
virtual void BuildGeometry() override final
Override DetectorGeometryBase::BuildGeometry method.
This class holds one or more material managers and makes them storeable, under StoreGate.
virtual const GeoMaterial * getMaterial(const std::string &name)=0