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

#include <MWPCConstruction.h>

Collaboration diagram for LArGeo::MWPCConstruction:

Public Member Functions

 MWPCConstruction (double Step=1.*GeoModelKernelUnits::mm)
 
virtual ~MWPCConstruction ()
 
virtual PVLink GetEnvelope ()
 

Private Attributes

std::unique_ptr< MsgStream > m_msg
 
double m_wireStep
 
GeoPhysVol * m_MWPCPhysical
 

Detailed Description

Definition at line 23 of file MWPCConstruction.h.

Constructor & Destructor Documentation

◆ MWPCConstruction()

LArGeo::MWPCConstruction::MWPCConstruction ( double  Step = 1.*GeoModelKernelUnits::mm)

Definition at line 51 of file MWPCConstruction.cxx.

52  : m_wireStep(Step),
53  m_MWPCPhysical(nullptr)
54 {
55 
56 }

◆ ~MWPCConstruction()

LArGeo::MWPCConstruction::~MWPCConstruction ( )
virtualdefault

Member Function Documentation

◆ GetEnvelope()

PVLink LArGeo::MWPCConstruction::GetEnvelope ( )
virtual

Definition at line 64 of file MWPCConstruction.cxx.

65 {
66 
67  if (m_MWPCPhysical) return m_MWPCPhysical;
68 
69  // Message service:
70  ISvcLocator *svcLocator = Gaudi::svcLocator();
71  IMessageSvc * msgSvc;
72  StatusCode status = svcLocator->service("MessageSvc", msgSvc);
73 
74  if(!status.isFailure()){
75  m_msg = std::make_unique<MsgStream>(msgSvc, "MWPCConstruction");
76  } else {
77  throw std::runtime_error("MWPCConstruction: cannot initialze message service");
78  }
79 
80  (*m_msg) << MSG::INFO << "MWPCConstruction - creating an MWPC with wire step " << m_wireStep << "mm ! " << endmsg;
81 
82 
83 
85  if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) {
86  throw std::runtime_error("Error in MWPCConstruction, cannot access DetectorStore");
87  }
88 
89 
90  ServiceHandle<IGeoModelSvc> geoModelSvc ("GeoModelSvc", "WallsConstruction");
91  if (geoModelSvc.retrieve().isFailure()) {
92  throw std::runtime_error ("Cannot locate GeoModelSvc!!");
93  }
94 
95 
96  // Get the materials from the material manager:-----------------------------------------------------//
97  // //
98 
99  StoredMaterialManager* materialManager = nullptr;
100  if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return nullptr;
101 
102  std::string name;
103  double density;
104  const GeoElement* W=materialManager->getElement("Wolfram");
105  GeoMaterial* Tungsten = new GeoMaterial(name="Tungsten", density=19.3*GeoModelKernelUnits::g/Gaudi::Units::cm3);
106  Tungsten->add(W,1.);
107  Tungsten->lock();
108 
109 
110  const GeoElement* Ar=materialManager->getElement("Argon");
111  const GeoElement* C=materialManager->getElement("Carbon");
112  const GeoElement* H=materialManager->getElement("Hydrogen");
113  GeoMaterial* Isobutane = new GeoMaterial(name="Isobutane", density=2.67*GeoModelKernelUnits::g/Gaudi::Units::cm3);
114  Isobutane->add(C,0.8266);
115  Isobutane->add(H,0.1734);
116  Isobutane->lock();
117  GeoMaterial* ArIso = new GeoMaterial(name="ArIso", density=0.0025*GeoModelKernelUnits::g/Gaudi::Units::cm3);
118  ArIso->add(Ar,0.61);
119  ArIso->add(Isobutane,0.39);
120  ArIso->lock();
121 
122 
123 
124 // // Test to see whether we can get the ArIso from the database
125 // const GeoMaterial *ArIso2 = materialManager->getMaterial("LArTB::Argon70Isobutane30");
126 // if (!ArIso2) (*m_msg) << MSG::INFO << "Found no Argon70Isobutane30 in database" << endmsg;
127 // if (ArIso2) (*m_msg) << MSG::INFO << "Did find LArTB::Argon70Isobutane30 in database!" << endmsg;
128 
129  const GeoMaterial *Air = materialManager->getMaterial("std::Air");
130  if (!Air) throw std::runtime_error("Error in MWPCConstruction, std::Air is not found.");
131 
132  const GeoMaterial *Aluminium = materialManager->getMaterial("std::Aluminium");
133  if (!Aluminium) throw std::runtime_error("Error in MWPCConstruction, std::Aluminium is not found.");
134 
135  const GeoMaterial *Mylar = materialManager->getMaterial("std::Mylar");
136  if (!Mylar) throw std::runtime_error("Error in MWPCConstruction, std::Mylar is not found.");
137 
138 
139  // //
140  //-------------------------------------------------------------------------------------------------//
141 
142 
143 
144  std::string AtlasVersion = geoModelSvc->atlasVersion();
145  std::string LArVersion = geoModelSvc->LAr_VersionOverride();
146 
147  std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
148  std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
149 
150 
152  // Define geometry
154 
155 
156  // Here we creat the envelope for the Moveable FrontBeam Instrumentation. This code is repeated
157  // createEnvelope() method below. There should be a way to avoid this repitition.
158 
159 
160  //------ Now create a MWPC
161 
162  (*m_msg) << " Create MWPC5 " << endmsg;
163 
164  std::string baseName = "LAr::TB";
165  std::string MWPCName = baseName + "::MWPC";
166 
167  // This creates a square wire-chamber:
168  const double MWPCDxy = 64.0*Gaudi::Units::mm;
169  const double MWPCDz = 16.586*Gaudi::Units::mm;
170 
171 
172  GeoBox* MWPCShape = new GeoBox(MWPCDxy, MWPCDxy, MWPCDz); // A generic WWPC
173  const GeoLogVol* MWPCLogical = new GeoLogVol( MWPCName, MWPCShape, ArIso );
174 
175  m_MWPCPhysical = new GeoPhysVol(MWPCLogical);
176 
177 
178  //..... Add Mylar to MWPC:
179  const double MylarDz = 0.015*Gaudi::Units::mm;
180 
181  GeoBox* MylarShape = new GeoBox(MWPCDxy, MWPCDxy, MylarDz); // Mylar fits across the MWPC in x,y
182 
183  for ( int side = 0; side<2 ; side++)
184  {
185  double MylarPos;
186  if (side==0) MylarPos = MylarDz-MWPCDz;
187  else MylarPos = MWPCDz-MylarDz;
188  std::string MylarName = MWPCName + "::Mylar";
189  GeoLogVol* MylarLogical = new GeoLogVol( MylarName, MylarShape, Mylar );
190  GeoIntrusivePtr<GeoPhysVol> MylarPhysical = new GeoPhysVol( MylarLogical );
191  m_MWPCPhysical->add( new GeoIdentifierTag( side ) );
192  m_MWPCPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, (MylarPos) ) ) );
193  m_MWPCPhysical->add( MylarPhysical );
194  }
195  // Done with the Mylar Foils
196 
197 
198 
199  //..... Add Al walls to MWPC5:
200  const double Aluz = 0.014*Gaudi::Units::mm;
201  const double AluDz = Aluz;
202  const double Alu_f = 7.*Gaudi::Units::mm;
203  const double Alu_s = 15.*Gaudi::Units::mm;
204 
205  GeoBox* AluShape = new GeoBox(MWPCDxy, MWPCDxy, AluDz); // Al foil fits across the MWPC in x,y
206  for ( int pos = 0; pos<4 ; pos++)
207  {
208  double AluPos;
209  switch(pos) {
210  case 0: { AluPos = -Alu_s-AluDz; break; }
211  case 1: { AluPos = -Alu_f+AluDz; break; }
212  case 2: { AluPos = Alu_f-AluDz; break; }
213  case 3: { AluPos = Alu_s+AluDz; break; }
214  default: { throw std::runtime_error("MWPC5 - too many Al foils!"); break; }
215  }
216 
217  std::string AluName = MWPCName + "::AlFoil";
218  GeoLogVol* AluLogical = new GeoLogVol( AluName, AluShape, Aluminium );
219  GeoIntrusivePtr<GeoPhysVol> AluPhysical = new GeoPhysVol( AluLogical );
220  m_MWPCPhysical->add( new GeoIdentifierTag( pos ) );
221  m_MWPCPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, (AluPos) ) ) );
222  m_MWPCPhysical->add( AluPhysical );
223  }
224 
225 
226 
227  //..... Add a sensitive X and Y plane to MWPC5:
228  const double Senz = 4.0*Gaudi::Units::mm;
229  const double SenDz = Senz; // z-Thickness of sensitive volume
230  const double SenPos = 11.*Gaudi::Units::mm; // z-Position of sensitive volume
231  //const double Step = 2.*Gaudi::Units::mm; // wire-step size for MWPC5
232 
233  GeoBox* SenPlaneShape = new GeoBox(MWPCDxy, MWPCDxy, SenDz); // Sensitive Volume fits across the MWPC in x,y
234 
235  std::string XPlaneName = MWPCName + "::XPlane";
236  std::string YPlaneName = MWPCName + "::YPlane";
237  GeoLogVol* XPlaneLogical = new GeoLogVol( XPlaneName, SenPlaneShape, ArIso );
238  GeoLogVol* YPlaneLogical = new GeoLogVol( YPlaneName, SenPlaneShape, ArIso );
239  GeoIntrusivePtr<GeoPhysVol> XPlanePhysical = new GeoPhysVol( XPlaneLogical );
240  GeoIntrusivePtr<GeoPhysVol> YPlanePhysical = new GeoPhysVol( YPlaneLogical );
241  m_MWPCPhysical->add( new GeoIdentifierTag( 0 ) );
242  m_MWPCPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, (-SenPos) ) ) );
243  m_MWPCPhysical->add( XPlanePhysical );
244  m_MWPCPhysical->add( new GeoIdentifierTag( 0 ) );
245  m_MWPCPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, (SenPos) ) ) );
246  m_MWPCPhysical->add( YPlanePhysical );
247 
248 
249 //.... The X and Y planes have "divisions"
250 // These divisions will eventually be the sensitive volumes
251 
252  GeoGenfun::Variable Index;
253  int NDiv= int ( 2*MWPCDxy / m_wireStep ) ;
254  GeoXF::TRANSFUNCTION TX = GeoXF::Pow(GeoTrf::TranslateX3D(1.0), -MWPCDxy + m_wireStep/2. + m_wireStep*Index);
255  GeoXF::TRANSFUNCTION TY = GeoXF::Pow(GeoTrf::TranslateY3D(1.0), -MWPCDxy + m_wireStep/2. + m_wireStep*Index);
256  GeoBox* XPlaneDiv = new GeoBox(m_wireStep/2., MWPCDxy , SenDz);
257  GeoBox* YPlaneDiv = new GeoBox(MWPCDxy , m_wireStep/2., SenDz);
258  std::string XDivName = MWPCName + "::XDiv";
259  std::string YDivName = MWPCName + "::YDiv";
260  GeoLogVol* XDivLogical = new GeoLogVol( XDivName, XPlaneDiv, ArIso );
261  GeoLogVol* YDivLogical = new GeoLogVol( YDivName, YPlaneDiv, ArIso );
262  GeoIntrusivePtr<GeoPhysVol> XDivPhysical = new GeoPhysVol( XDivLogical );
263  GeoIntrusivePtr<GeoPhysVol> YDivPhysical = new GeoPhysVol( YDivLogical );
264 
265  GeoSerialIdentifier *sIX = new GeoSerialIdentifier(0);
266  GeoSerialTransformer *sTSX = new GeoSerialTransformer(XDivPhysical, &TX, NDiv );
267  GeoSerialIdentifier *sIY = new GeoSerialIdentifier(0);
268  GeoSerialTransformer *sTSY = new GeoSerialTransformer(YDivPhysical, &TY, NDiv );
269  XPlanePhysical->add(sIX);
270  XPlanePhysical->add(sTSX);
271  YPlanePhysical->add(sIY);
272  YPlanePhysical->add(sTSY);
273 
274 //.... Put wires into the X/Y "divisions"
275  const double WireDiam = 0.006*Gaudi::Units::mm;
276  const double WireLen = MWPCDxy;
277  GeoTubs* WireShape = new GeoTubs(0.*Gaudi::Units::cm, WireDiam/2., WireLen , 0.*Gaudi::Units::deg,360.*Gaudi::Units::deg);
278  std::string WireName = MWPCName + "::Wire";
279  GeoLogVol* WireLogical = new GeoLogVol(WireName, WireShape, Tungsten);
280  GeoIntrusivePtr<GeoPhysVol> WirePhysical = new GeoPhysVol( WireLogical );
281  XDivPhysical->add(new GeoTransform(GeoTrf::RotateX3D( 90.*Gaudi::Units::deg )));
282  XDivPhysical->add(WirePhysical);
283  YDivPhysical->add(new GeoTransform(GeoTrf::RotateY3D( 90.*Gaudi::Units::deg )));
284  YDivPhysical->add(WirePhysical);
285 
286 
287 //----- Done with the MWPC
288 
289 
290  // End Moveable MWPC detectors
291 
292 
293  return m_MWPCPhysical;
294 }

Member Data Documentation

◆ m_msg

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

Definition at line 36 of file MWPCConstruction.h.

◆ m_MWPCPhysical

GeoPhysVol* LArGeo::MWPCConstruction::m_MWPCPhysical
private

Definition at line 38 of file MWPCConstruction.h.

◆ m_wireStep

double LArGeo::MWPCConstruction::m_wireStep
private

Definition at line 37 of file MWPCConstruction.h.


The documentation for this class was generated from the following files:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
JetTiledMap::W
@ W
Definition: TiledEtaPhiMap.h:44
LArGeo::MWPCConstruction::m_MWPCPhysical
GeoPhysVol * m_MWPCPhysical
Definition: MWPCConstruction.h:38
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
TRT::Hit::side
@ side
Definition: HitInfo.h:83
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
H
#define H(x, y, z)
Definition: MD5.cxx:114
Index
IndexedConstituentUserInfo::Index Index
Definition: IndexedConstituentUserInfo.cxx:12
EventInfoWrite.AtlasVersion
AtlasVersion
Definition: EventInfoWrite.py:17
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
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
LArGeo::MWPCConstruction::m_wireStep
double m_wireStep
Definition: MWPCConstruction.h:37
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
LArGeo::MWPCConstruction::m_msg
std::unique_ptr< MsgStream > m_msg
Definition: MWPCConstruction.h:36
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
merge.status
status
Definition: merge.py:17
ServiceHandle< IGeoModelSvc >