ATLAS Offline Software
AGDDMuonStation.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 
8 #include "GeoModelKernel/GeoTrd.h"
9 #include "GeoModelKernel/GeoShape.h"
10 #include "GeoModelKernel/GeoLogVol.h"
11 #include "GeoModelKernel/GeoPhysVol.h"
12 #include "GeoModelKernel/GeoMaterial.h"
13 
14 #include "StoreGate/StoreGateSvc.h"
15 #include "GaudiKernel/ISvcLocator.h"
16 #include "GaudiKernel/Bootstrap.h"
18 
19 void AGDDMuonStation::CreateSolid (const AGDDBuilder& /*builder*/)
20 {
21  std::cout<<"this is AGDDMuonStation::CreateSolid()"<<std::endl;
22  void *p=GetSolid();
23  if (!p)
24  {
25  std::cout<<" creating solid with dimensions "<<
26  m_small_x<<" "<<m_large_x<<" "<<m_y<<" "<<m_z<<std::endl;
27  GeoShape* solid=new GeoTrd(m_small_x/2.,m_large_x/2.,m_y/2.,m_y/2.,m_z/2.);
28  SetSolid(solid);
29  }
30 }
31 
33 {
34  std::cout<<"this is AGDDMuonStation::CreateVolume()"<<std::endl;
35  static const GeoMaterial* const air = GetMMMaterial("std::Air");
36  if (!air) std::cout<<" Air not found!"<<std::endl;
37 
39 
40  if (!GetVolume())
41  {
42  std::cout<<"trying to create logical volume"<<std::endl;
43  const GeoShape* shape=(GeoShape *)GetSolid();
44  if (!shape) std::cout<<" something wrong, shape is 0"<<std::endl;
45  GeoLogVol *a=new GeoLogVol(GetName(),shape,air);
46  GeoPhysVol *a_phys=new GeoPhysVol(a);
47  SetVolume(a_phys);
48  std::cout<<"done creating volume "<<std::endl;
49  }
50 }
51 
52 const GeoMaterial* AGDDMuonStation::GetMMMaterial(const std::string& name)
53 {
54  StoreGateSvc* pDetStore=nullptr;
55  ISvcLocator* svcLocator = Gaudi::svcLocator();
56  StatusCode sc=svcLocator->service("DetectorStore",pDetStore);
57  if(sc.isSuccess())
58  {
59  StoredMaterialManager* theMaterialManager = nullptr;
60  sc = pDetStore->retrieve(theMaterialManager, "MATERIALS");
61  if(sc.isSuccess())
62  {
63  return theMaterialManager->getMaterial(name);
64  }
65  }
66  return nullptr;
67 }
AGDDMuonStation::GetMMMaterial
static const GeoMaterial * GetMMMaterial(const std::string &)
Definition: AGDDMuonStation.cxx:52
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
AGDDVolume::GetSolid
void * GetSolid()
Definition: AGDDVolume.h:33
AGDDVolume::GetVolume
void * GetVolume()
Definition: AGDDVolume.h:32
AGDDMuonStation::m_small_x
double m_small_x
Definition: AGDDMuonStation.h:41
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
AGDDMuonStation.h
AGDDVolume::SetSolid
void SetSolid(void *p)
Definition: AGDDVolume.h:34
AGDDMuonStation::m_z
double m_z
Definition: AGDDMuonStation.h:44
AGDDBuilder
Definition: AGDDBuilder.h:31
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
createSimpleDistributions.builder
builder
Definition: createSimpleDistributions.py:52
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AGDDMuonStation::m_large_x
double m_large_x
Definition: AGDDMuonStation.h:42
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
StoredMaterialManager.h
a
TList * a
Definition: liststreamerinfos.cxx:10
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
AGDDVolume::GetName
const std::string & GetName() const
Definition: AGDDVolume.h:23
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
AGDDMuonStation::CreateSolid
virtual void CreateSolid(const AGDDBuilder &builder) override
Definition: AGDDMuonStation.cxx:19
AGDDMuonStation::m_y
double m_y
Definition: AGDDMuonStation.h:43
AGDDMuonStation::CreateVolume
virtual void CreateVolume(AGDDBuilder &builder) override
Definition: AGDDMuonStation.cxx:32
StoreGateSvc.h
AGDDVolume::SetVolume
void SetVolume(void *p)
Definition: AGDDVolume.h:35