ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
LArGeo::WallsConstruction Class Reference

#include <WallsConstruction.h>

Collaboration diagram for LArGeo::WallsConstruction:

Public Member Functions

 WallsConstruction ()
 
virtual ~WallsConstruction ()
 
virtual PVLink GetEnvelope ()
 

Private Attributes

std::unique_ptr< MsgStream > m_msg
 
GeoPhysVol * m_WallsPhysical
 

Detailed Description

Definition at line 21 of file WallsConstruction.h.

Constructor & Destructor Documentation

◆ WallsConstruction()

LArGeo::WallsConstruction::WallsConstruction ( )

Definition at line 46 of file WallsConstruction.cxx.

47  : m_WallsPhysical(nullptr)
48 {
49 }

◆ ~WallsConstruction()

LArGeo::WallsConstruction::~WallsConstruction ( )
virtualdefault

Member Function Documentation

◆ GetEnvelope()

PVLink LArGeo::WallsConstruction::GetEnvelope ( )
virtual

Definition at line 57 of file WallsConstruction.cxx.

58 {
59 
60  if (m_WallsPhysical) return m_WallsPhysical;
61 
62  // Get access to the material manager:
63 
64  ISvcLocator *svcLocator = Gaudi::svcLocator();
65  IMessageSvc * msgSvc;
66  StatusCode status = svcLocator->service("MessageSvc", msgSvc);
67 
68  if(!status.isFailure()){
69  m_msg = std::make_unique<MsgStream>(msgSvc, "WallsConstruction");
70  } else {
71  throw std::runtime_error("WallsConstruction: cannot initialze message service");
72  }
73 
74  (*m_msg) << MSG::INFO << "WallsConstruction - creating the walls in front of the cryostat " << endmsg;
75 
76 
78  if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) {
79  throw std::runtime_error("Error in WallsConstruction, cannot access DetectorStore");
80  }
81 
82 
83  ServiceHandle<IGeoModelSvc> geoModelSvc ("GeoModelSvc", "WallsConstruction");
84  if (geoModelSvc.retrieve().isFailure()) {
85  throw std::runtime_error ("Cannot locate GeoModelSvc!!");
86  }
87 
88 
89 
90  // Get the materials from the material manager:-----------------------------------------------------//
91  // //
92 
93  StoredMaterialManager* materialManager = nullptr;
94  if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return nullptr;
95 
96  std::string name;
97 
98 
99 
100 
101  const GeoMaterial *Air = materialManager->getMaterial("std::Air");
102  if (!Air) throw std::runtime_error("Error in WallsConstruction, std::Air is not found.");
103 
104  const GeoMaterial *Iron = materialManager->getMaterial("std::Iron");
105  if (!Iron) throw std::runtime_error("Error in WallsConstruction, std::Iron is not found.");
106 
107  const GeoMaterial *Lead = materialManager->getMaterial("std::Lead");
108  if (!Lead) throw std::runtime_error("Error in WallsConstruction, std::Lead is not found.");
109 
110  const GeoMaterial *Aluminium = materialManager->getMaterial("std::Aluminium");
111  if (!Aluminium) throw std::runtime_error("Error in WallsConstruction, std::Aluminium is not found.");
112 
113  // Is this ok for the Scintillator?
114  // I don't really know for sure what kind of a scintillator we have.
115  // Lots of Scintillators are PMMA (Plexiglas), which has a composition of C5 H8 O2 and density 1.18 g/cm3
116  // The Tile uses a composition of C H (density 1.032)
117  // The old Walls testbeam code uses a composition of C9 H10 (density 1.032)
118  // ... because it's easiest at the moment and not all that different from the fractional
119  // composition of the old tb code, take the Tile material (polysterene)...
120  const GeoMaterial *Scint = materialManager->getMaterial("std::Polystyrene");
121  if (!Scint) throw std::runtime_error("Error in WallsConstruction, std::Polystyrene is not found.");
122 
123  const GeoMaterial *Mylar = materialManager->getMaterial("std::Mylar");
124  if (!Mylar) throw std::runtime_error("Error in WallsConstruction, std::Mylar is not found.");
125 
126 
127  // //
128  //-------------------------------------------------------------------------------------------------//
129 
130 
131 
132  std::string AtlasVersion = geoModelSvc->atlasVersion();
133  std::string LArVersion = geoModelSvc->LAr_VersionOverride();
134 
135  std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
136  std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
137 
138 
140  // Define geometry
142 
143 
144  // Here we creat the envelope for the Moveable Walls Instrumentation. This code is repeated
145  // createEnvelope() method below. There should be a way to avoid this repitition.
146 
147  //------ The Walls
148 
149  // All these numbers should really go into the database!...
150  // This hard-coding is only temporary!
151 
152  std::string baseName = "LAr::TBH6";
153  std::string WallsName = baseName + "::Walls";
154 
155  const double WallsX = 1500.*Gaudi::Units::mm;
156  const double WallsY = 2000.*Gaudi::Units::mm;
157  const double WallsZ = 560.5*Gaudi::Units::mm;
158 
159 
160  GeoBox* WallsShape = new GeoBox( WallsX, WallsY, WallsZ );
161  const GeoLogVol* WallsLogical = new GeoLogVol( WallsName, WallsShape, Air );
162 
163  // This is the Mother Volume for all Walls in front of the cryostat:
164  m_WallsPhysical = new GeoPhysVol(WallsLogical);
165 
166 
167  // Into the mother, place all indiviual walls (Iron, Lead, Scntillator and additional iron plates)
168  // All these walls are never moved with respect to one another, so do them all here.
169 
170  //----- First the IronWall
171 
172  (*m_msg) << "Create Iron Wall " << endmsg;
173 
174  const double IronX = 1499.*Gaudi::Units::mm;
175  const double IronY = 1999.*Gaudi::Units::mm;
176  const double IronZ = 200.0*Gaudi::Units::mm;
177  const double IronHoleX = 51.5*Gaudi::Units::mm;
178  const double IronHoleY = 1999.*Gaudi::Units::mm;
179  const double IronHoleZ = 200.*Gaudi::Units::mm;
180  const double IronPosZ = 270.*Gaudi::Units::mm;
181 
182  // The wall itself:
183  GeoBox* IronWallShape = new GeoBox(IronX, IronY, IronZ);
184  std::string IronWallName = baseName + "::IronWall";
185  GeoLogVol* IronWallLogical = new GeoLogVol( IronWallName, IronWallShape, Iron );
186  GeoIntrusivePtr<GeoPhysVol> IronWallPhysical = new GeoPhysVol( IronWallLogical );
187 
188  //Have to put a hole into the wall:
189  GeoBox* IronHoleShape = new GeoBox(IronHoleX, IronHoleY, IronHoleZ);
190  std::string IronHoleName = baseName + "::IronWall::Hole";
191  GeoLogVol* IronHoleLogical = new GeoLogVol( IronHoleName, IronHoleShape, Air );
192  GeoIntrusivePtr<GeoPhysVol> IronHolePhysical = new GeoPhysVol( IronHoleLogical );
193  IronWallPhysical->add(IronHolePhysical);
194 
195  // Add the iron wall to the Wall mother:
196  m_WallsPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::mm, 0.*Gaudi::Units::mm, (WallsZ-IronPosZ) ) ) ) ;
197  m_WallsPhysical->add( new GeoNameTag(IronWallName) );
198  m_WallsPhysical->add( IronWallPhysical );
199 
200  //----- Done with IronWall
201 
202 
203 
204  //----- Now the LeadWall
205 
206  (*m_msg) << "Create Lead Wall " << endmsg;
207 
208  const double LeadX = 1499.*Gaudi::Units::mm;
209  const double LeadY = 1999.*Gaudi::Units::mm;
210  const double LeadZ = 6.*Gaudi::Units::mm;
211  const double LeadHoleX = 23.5*Gaudi::Units::mm;
212  const double LeadHoleY = 1999.*Gaudi::Units::mm;
213  const double LeadHoleZ = 6.*Gaudi::Units::mm;
214  const double LeadPosZ = 1045.*Gaudi::Units::mm;
215 
216  // The wall itself:
217  GeoBox* LeadWallShape = new GeoBox(LeadX, LeadY, LeadZ);
218  std::string LeadWallName = baseName + "::LeadWall";
219  GeoLogVol* LeadWallLogical = new GeoLogVol( LeadWallName, LeadWallShape, Lead );
220  GeoIntrusivePtr<GeoPhysVol> LeadWallPhysical = new GeoPhysVol( LeadWallLogical );
221 
222  //Have to put a hole into the wall:
223  GeoBox* LeadHoleShape = new GeoBox(LeadHoleX, LeadHoleY, LeadHoleZ);
224  std::string LeadHoleName = baseName + "::LeadWall::Hole";
225  GeoLogVol* LeadHoleLogical = new GeoLogVol( LeadHoleName, LeadHoleShape, Air );
226  GeoIntrusivePtr<GeoPhysVol> LeadHolePhysical = new GeoPhysVol( LeadHoleLogical );
227  LeadWallPhysical->add(LeadHolePhysical);
228 
229  // Add the lead wall to the Wall mother:
230  m_WallsPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::mm, 0.*Gaudi::Units::mm, (WallsZ-LeadPosZ) ) ) ) ;
231  m_WallsPhysical->add( new GeoNameTag(LeadWallName) );
232  m_WallsPhysical->add( LeadWallPhysical );
233 
234  //----- Done with LeadWall
235 
236 
237  //----- Now the ScintWall
238 
239  (*m_msg) << "Create Scint Wall " << endmsg;
240 
241  const double ScintX = 1499.*Gaudi::Units::mm;
242  const double ScintY = 1999.*Gaudi::Units::mm;
243  const double ScintZ = 6.5*Gaudi::Units::mm;
244  const double ScintHoleX = 92.5*Gaudi::Units::mm;
245  const double ScintHoleY = 1999.*Gaudi::Units::mm;
246  const double ScintHoleZ = 6.5*Gaudi::Units::mm;
247  const double ScintPosZ = 625.*Gaudi::Units::mm;
248 
249  // The wall itself:
250  GeoBox* ScintWallShape = new GeoBox(ScintX, ScintY, ScintZ);
251  std::string ScintWallName = baseName + "::ScintWall";
252  GeoLogVol* ScintWallLogical = new GeoLogVol( ScintWallName, ScintWallShape, Scint );
253  GeoIntrusivePtr<GeoPhysVol> ScintWallPhysical = new GeoPhysVol( ScintWallLogical );
254 
255  //Have to put a hole into the wall:
256  GeoBox* ScintHoleShape = new GeoBox(ScintHoleX, ScintHoleY, ScintHoleZ);
257  std::string ScintHoleName = baseName + "::ScintWall::Hole";
258  GeoLogVol* ScintHoleLogical = new GeoLogVol( ScintHoleName, ScintHoleShape, Air );
259  GeoIntrusivePtr<GeoPhysVol> ScintHolePhysical = new GeoPhysVol( ScintHoleLogical );
260  ScintWallPhysical->add(ScintHolePhysical);
261 
262  // Add the scintillator wall to the Wall mother:
263  m_WallsPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::mm, 0.*Gaudi::Units::mm, (WallsZ-ScintPosZ) ) ) ) ;
264  m_WallsPhysical->add( new GeoNameTag(ScintWallName) );
265  m_WallsPhysical->add( ScintWallPhysical );
266 
267  //----- Done with ScintWall
268 
269 
270 
271  //----- Finally the iron plates
272 
273  //(*m_msg) << "Create Iron Plate " << endmsg;
274 
275  const double IronPlateX = 50.*Gaudi::Units::mm;
276  const double IronPlateY = 150.*Gaudi::Units::mm;
277  const double IronPlateZ = 4.*Gaudi::Units::mm;
278  const double IronPlatePosZ = 493.*Gaudi::Units::mm;
279  const int nPlate = 0 ;
280  const int PlatePlace = 1 ; // There were two locations used for these plates - unclear which one when and exactly
281  // where they were....! For the moment, sort of copy the standalone code
282  // right now: +1 between Iron wall and Cryostat,
283  // -1 between Lead wall and table
284  // This should really be passed on via jobOptions!
285 
286  if (nPlate>0) {
287  // Print out a warning here, because extra matrial is in place only for a few special runs
288  (*m_msg) << MSG::WARNING << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " << endmsg;
289  (*m_msg) << MSG::WARNING << " EXTRA MATERIAL IN THE BEAM: " << nPlate << " plates " << endmsg;
290  if (PlatePlace== 1) (*m_msg) << MSG::WARNING << " between cryostat and Iron Wall " << endmsg;
291  //if (PlatePlace==-1) (*m_msg) << MSG::WARNING << " between Lead Wall and Table " << endmsg;
292  (*m_msg) << MSG::WARNING << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " << endmsg;
293 
294  std::vector<double> v_PlateZ;
295  v_PlateZ.reserve((nPlate));
296 for (int iz=0; iz<(nPlate); iz++) v_PlateZ.push_back(IronPlatePosZ + double(iz)*(2*IronPlateZ+0.5));
297 
298  // The plate itself:
299  GeoBox* IronPlateShape = new GeoBox(IronPlateX, IronPlateY, IronPlateZ);
300  std::string IronPlateName = baseName + "::IronPlate";
301  GeoLogVol* IronPlateLogical = new GeoLogVol( IronPlateName, IronPlateShape, Iron );
302  GeoIntrusivePtr<GeoPhysVol> IronPlatePhysical = new GeoPhysVol( IronPlateLogical );
303 
304 
305  // Add the iron plate to the Plate mother:
306  for (int iz=0; iz<(nPlate); iz++) {
307  m_WallsPhysical->add( new GeoIdentifierTag(iz) );
308  m_WallsPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::mm, 0.*Gaudi::Units::mm, double(PlatePlace)*(v_PlateZ[iz]) ) ) ) ;
309  m_WallsPhysical->add( new GeoNameTag(IronPlateName) );
310  m_WallsPhysical->add( IronPlatePhysical );
311  }
312  }
313  //----- Done with Iron Plates
314 
315  // Done with all walls in front of the cryostat.
316 
317 
318  return m_WallsPhysical;
319 }

Member Data Documentation

◆ m_msg

std::unique_ptr<MsgStream> LArGeo::WallsConstruction::m_msg
private

Definition at line 32 of file WallsConstruction.h.

◆ m_WallsPhysical

GeoPhysVol* LArGeo::WallsConstruction::m_WallsPhysical
private

Definition at line 33 of file WallsConstruction.h.


The documentation for this class was generated from the following files:
LArGeo::WallsConstruction::m_msg
std::unique_ptr< MsgStream > m_msg
Definition: WallsConstruction.h:32
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
EventInfoWrite.AtlasVersion
AtlasVersion
Definition: EventInfoWrite.py:17
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
LArGeo::WallsConstruction::m_WallsPhysical
GeoPhysVol * m_WallsPhysical
Definition: WallsConstruction.h:33
merge.status
status
Definition: merge.py:17
ServiceHandle< IGeoModelSvc >