ATLAS Offline Software
Loading...
Searching...
No Matches
AGDDMuonStation.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 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
15#include "GaudiKernel/ISvcLocator.h"
16#include "GaudiKernel/Bootstrap.h"
18
20{
21 std::cout<<"this is AGDDMuonStation::CreateSolid()"<<std::endl;
22 void *p=GetSolid();
23 if (!p) {
24 std::cout<<" creating solid with dimensions "<<
25 m_small_x<<" "<<m_large_x<<" "<<m_y<<" "<<m_z<<std::endl;
26 GeoShape* solid=new GeoTrd(m_small_x/2.,m_large_x/2.,m_y/2.,m_y/2.,m_z/2.);
28 }
29}
30
32{
33 std::cout<<"this is AGDDMuonStation::CreateVolume()"<<std::endl;
34 static const GeoMaterial* const air = GetMMMaterial("std::Air");
35 if (!air) std::cout<<" Air not found!"<<std::endl;
36
37 CreateSolid (builder);
38
39 if (!GetVolume()) {
40 std::cout<<"trying to create logical volume"<<std::endl;
41 const GeoShape* shape=(GeoShape *)GetSolid();
42 if (!shape) std::cout<<" something wrong, shape is 0"<<std::endl;
43 GeoLogVol *a=new GeoLogVol(GetName(),shape,air);
44 GeoPhysVol *a_phys=new GeoPhysVol(a);
45 SetVolume(a_phys);
46 std::cout<<"done creating volume "<<std::endl;
47 }
48}
49
50const GeoMaterial* AGDDMuonStation::GetMMMaterial(const std::string& name)
51{
52 SmartIF<StoreGateSvc> pDetStore{Gaudi::svcLocator()->service("DetectorStore")};
53 if(pDetStore.isValid()) {
54 StoredMaterialManager* theMaterialManager = nullptr;
55 if(pDetStore->retrieve(theMaterialManager, "MATERIALS").isSuccess()) {
56 return theMaterialManager->getMaterial(name);
57 }
58 }
59 return nullptr;
60}
static Double_t a
static std::map< double, LArWheelSliceSolid * > solid
virtual void CreateSolid(const AGDDBuilder &builder) override
static const GeoMaterial * GetMMMaterial(const std::string &)
virtual void CreateVolume(AGDDBuilder &builder) override
void SetSolid(void *p)
Definition AGDDVolume.h:34
void * GetSolid()
Definition AGDDVolume.h:33
const std::string & GetName() const
Definition AGDDVolume.h:23
void * GetVolume()
Definition AGDDVolume.h:32
void SetVolume(void *p)
Definition AGDDVolume.h:35
This class holds one or more material managers and makes them storeable, under StoreGate.
virtual const GeoMaterial * getMaterial(const std::string &name)=0