ATLAS Offline Software
Public Member Functions | List of all members
LArGeo::ExcluderConstruction Class Reference

#include <ExcluderConstruction.h>

Collaboration diagram for LArGeo::ExcluderConstruction:

Public Member Functions

 ExcluderConstruction ()
 
virtual ~ExcluderConstruction ()
 
virtual GeoIntrusivePtr< GeoPhysVol > GetEnvelope ()
 

Detailed Description

Definition at line 18 of file ExcluderConstruction.h.

Constructor & Destructor Documentation

◆ ExcluderConstruction()

LArGeo::ExcluderConstruction::ExcluderConstruction ( )
default

◆ ~ExcluderConstruction()

LArGeo::ExcluderConstruction::~ExcluderConstruction ( )
virtualdefault

Member Function Documentation

◆ GetEnvelope()

GeoIntrusivePtr< GeoPhysVol > LArGeo::ExcluderConstruction::GetEnvelope ( )
virtual

Definition at line 54 of file ExcluderConstruction.cxx.

55 {
56 
57  // Need to do the equivalent for excluder here: <<<================
58  // if (cryoMotherPhysical) return cryoMotherPhysical;
59 
60  // Detector Store
61  ISvcLocator *svcLocator = Gaudi::svcLocator();
63  if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) {
64  throw std::runtime_error("Error in ExcluderConstruction, cannot access DetectorStore");
65  }
66 
67  // Material Manager
68 
69  // Need to add Rohacell here! <<<===============
70 
71  StoredMaterialManager* materialManager = nullptr;
72  if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return nullptr;
73 
74 
75  // (use Air for the moment....) <<<================
76  const GeoMaterial *Air = materialManager->getMaterial("std::Air");
77  if (!Air) {
78  throw std::runtime_error("Error in ExcluderConstruction, std::Air is not found.");
79  }
80 
81  // Define Rohacell Foam.
82  // Rohacell foam has density: 0.11g/cm3
83  std::string name;
84  double density;
85  const GeoElement* C=materialManager->getElement("Carbon");
86  const GeoElement* H=materialManager->getElement("Hydrogen");
87  const GeoElement* O=materialManager->getElement("Oxygen");
88  const GeoElement* N=materialManager->getElement("Nitrogen");
89  GeoMaterial* Rohacell = new GeoMaterial(name="Rohacell", density=0.11*GeoModelKernelUnits::g/Gaudi::Units::cm3);
90  Rohacell->add(C,0.6465);
91  Rohacell->add(H,0.07836);
92  Rohacell->add(O,0.19137);
93  Rohacell->add(N,0.08377);
94  Rohacell->lock();
95 
96  ServiceHandle<IGeoDbTagSvc> geoDbTagSvc ("GeoDbTagSvc", "WallsConstruction");
97  if (geoDbTagSvc.retrieve().isFailure()) {
98  throw std::runtime_error ("Cannot locate GeoDbTagSvc!!");
99  }
100 
101  std::string AtlasVersion = geoDbTagSvc->atlasVersion();
102  std::string LArVersion = geoDbTagSvc->LAr_VersionOverride();
103 
104  std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
105  std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
106 
107  //--------
108  // Now build the actual Excluder.
109 
110  // It is a Union out of a GeoBox and a GeoTubs.
111  // Box Dimensions:
112  double xbox = 300.0 *Gaudi::Units::mm;
113  double ybox = 160.0 *Gaudi::Units::mm;
114  double zbox = 300.7 *Gaudi::Units::mm;
115  //
116  // Tubs Dimensions:
117  double ztubs = 300.0 *Gaudi::Units::mm;
118  double phitubs= 76.2 *Gaudi::Units::deg;
119  double delphi = 27.6 *Gaudi::Units::deg;
120  double rcold = 1249.5 *Gaudi::Units::mm;
121  double rmin = 1220.0 *Gaudi::Units::mm;
122 
123  // The radius of the cryostat cold wall is: 1250 Gaudi::Units::mm
124  // Before we make the union, we have to shift the box in y (that actually along the beam axis)
125  // and there, positive y goes from the cryostat centre towards the beam window.
126 
127  std::string ExcluderName = "LAr::H6::Cryostat::Excluder";
128 
129  GeoBox* rohaBox = new GeoBox(xbox, ybox, zbox); // The rectangular part of the excluder
130  const GeoShapeShift & rohaBoxShift = (*rohaBox << GeoTrf::TranslateY3D(1062.85*Gaudi::Units::mm) );
131  GeoTubs* rohaTubs = new GeoTubs(rmin, rcold, ztubs, phitubs, delphi); // The round part of the excluder
132 
133  // Combine the two parts to make one excluder of the correct shape:
134  const GeoShapeUnion* Excluder = new GeoShapeUnion(&rohaBoxShift, rohaTubs);
135 
136  const GeoLogVol* LogExcluder = new GeoLogVol(ExcluderName, Excluder, Rohacell); // <<<==== air should be rohacell !!!
137  GeoIntrusivePtr<GeoPhysVol> PhysExcluder = new GeoPhysVol(LogExcluder);
138  PhysExcluder->add( new GeoNameTag(ExcluderName) );
139 
140  return PhysExcluder;
141 
142 }

The documentation for this class was generated from the following files:
DMTest::C
C_v1 C
Definition: C.h:26
StoredMaterialManager::getElement
virtual const GeoElement * getElement(const std::string &name)=0
cm3
#define cm3
deg
#define deg
Definition: SbPolyhedron.cxx:17
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
lwtDev::Component::O
@ O
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
H
#define H(x, y, z)
Definition: MD5.cxx:114
EventInfoWrite.AtlasVersion
AtlasVersion
Definition: EventInfoWrite.py:17
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
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
ServiceHandle< IGeoDbTagSvc >