ATLAS Offline Software
Loading...
Searching...
No Matches
SimplestToyDetectorFactory.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
7#include "GeoModelKernel/GeoMaterial.h"
8#include "GeoModelKernel/GeoBox.h"
9#include "GeoModelKernel/GeoTube.h"
10#include "GeoModelKernel/GeoLogVol.h"
11#include "GeoModelKernel/GeoNameTag.h"
12#include "GeoModelKernel/GeoPhysVol.h"
13#include "GeoModelKernel/GeoFullPhysVol.h"
14#include "GeoModelKernel/GeoTransform.h"
15#include "GeoModelKernel/GeoSerialDenominator.h"
16#include "GeoModelKernel/GeoAlignableTransform.h"
17#include "GeoModelKernel/GeoSerialTransformer.h"
18#include "GeoModelKernel/Units.h"
19
20#include "GeoGenericFunctions/AbsFunction.h"
21#include "GeoGenericFunctions/Variable.h"
22#include "GeoGenericFunctions/Sin.h"
23#include "GeoGenericFunctions/Cos.h"
24
25using namespace GeoGenfun;
26using namespace GeoXF;
27
28
29SimplestToyDetectorFactory::SimplestToyDetectorFactory(StoreGateSvc *detStore) // TODO: remove StoreGate reference
30:m_detectorManager(NULL), m_detectorStore(detStore) {}
31
32
34
35
36
37//## Other Operations (implementation)
39{
41
42 //-----------------------------------------------------------------------------------//
43 // Get the materials that we shall use. //
44 // ----------------------------------------------------------------------------------//
45
46 // Bogus densities. Later: read from database.
47 double densityOfAir=0.1, densityOfPolystyrene=0.2;
48 const GeoMaterial *air = new GeoMaterial("Air Two",densityOfAir);
49 const GeoMaterial *poly = new GeoMaterial("std::Polystyrene",densityOfPolystyrene);
50
51
52 //-----------------------------------------------------------------------------------//
53 // Next make the box that describes the shape of the toy volume: //
54 const GeoBox *toyBox = new GeoBox(800*GeoModelKernelUnits::cm, 800*GeoModelKernelUnits::cm, 1000*GeoModelKernelUnits::cm); //
55 // Bundle this with a material into a logical volume: //
56 const GeoLogVol *toyLog = new GeoLogVol("ToyLog", toyBox, air); //
57 // ..And create a physical volume: //
58 GeoPhysVol *toyPhys = new GeoPhysVol(toyLog); //
59 // Add this to the list of top level physical volumes: //
60 m_detectorManager->addTreeTop(toyPhys); //
61
62
63
64 GeoBox *sPass = new GeoBox(5.0*GeoModelKernelUnits::cm, 30*GeoModelKernelUnits::cm, 30*GeoModelKernelUnits::cm);
65 GeoLogVol *lPass = new GeoLogVol("Passive", sPass, poly);
66 GeoPhysVol *pPass = new GeoPhysVol(lPass);
67
68 GeoBox *sIPass = new GeoBox(4*GeoModelKernelUnits::cm, 25*GeoModelKernelUnits::cm, 25*GeoModelKernelUnits::cm);
69 GeoLogVol *lIPass = new GeoLogVol("InnerPassive", sIPass, air);
70 GeoPhysVol *pIPass = new GeoPhysVol(lIPass);
71
72 pPass->add(pIPass);
73 toyPhys->add(pPass);
74
75
76
77 //------------------------------------------------------------------------------------//
78 // Now insert all of this into the world... //
79 GeoNameTag *tag = new GeoNameTag("Toy"); //
80 world->add(tag); //
81 world->add(toyPhys); //
82 //------------------------------------------------------------------------------------//
83}
84
SimplestToyDetectorFactory(StoreGateSvc *pDetStore)
virtual const ToyDetectorManager * getDetectorManager() const
virtual void create(GeoPhysVol *world)
The Athena Transient Store API.