ATLAS Offline Software
Loading...
Searching...
No Matches
ToyDetectorFactory Class Reference

#include <ToyDetectorFactory.h>

Inheritance diagram for ToyDetectorFactory:
Collaboration diagram for ToyDetectorFactory:

Public Member Functions

 ToyDetectorFactory (StoreGateSvc *pDetStore)
 ~ToyDetectorFactory ()
virtual void create (GeoPhysVol *world)
virtual const ToyDetectorManagergetDetectorManager () const

Private Member Functions

const ToyDetectorFactoryoperator= (const ToyDetectorFactory &right)
 ToyDetectorFactory (const ToyDetectorFactory &right)

Private Attributes

ToyDetectorManagerm_detectorManager
StoreGateSvcm_detectorStore

Detailed Description

Definition at line 10 of file ToyDetectorFactory.h.

Constructor & Destructor Documentation

◆ ToyDetectorFactory() [1/2]

ToyDetectorFactory::ToyDetectorFactory ( StoreGateSvc * pDetStore)

Definition at line 46 of file ToyDetectorFactory.cxx.

47 :m_detectorManager(NULL),
48 m_detectorStore(detStore)
49{
50}
StoreGateSvc * m_detectorStore
ToyDetectorManager * m_detectorManager

◆ ~ToyDetectorFactory()

ToyDetectorFactory::~ToyDetectorFactory ( )

Definition at line 53 of file ToyDetectorFactory.cxx.

54{
55
56}

◆ ToyDetectorFactory() [2/2]

ToyDetectorFactory::ToyDetectorFactory ( const ToyDetectorFactory & right)
private

Member Function Documentation

◆ create()

void ToyDetectorFactory::create ( GeoPhysVol * world)
virtual

Definition at line 61 of file ToyDetectorFactory.cxx.

62{
63 m_detectorManager=new ToyDetectorManager();
64
65 #ifndef BUILDVP1LIGHT
66 StoredMaterialManager* materialManager = nullptr;
67 if (StatusCode::SUCCESS != m_detectorStore->retrieve(materialManager, std::string("MATERIALS"))) {
68 return;
69 }
70 #endif
71
72 //-----------------------------------------------------------------------------------//
73 // Get the materials that we shall use. //
74 // ----------------------------------------------------------------------------------//
75
76 #if defined BUILDVP1LIGHT
77 // Bogus densities.
78 double densityOfAir=0.1, densityOfPolystyrene=0.2;
79 const GeoMaterial *air = new GeoMaterial("Air Toy",densityOfAir);
80 const GeoMaterial *poly = new GeoMaterial("std::Polystyrene",densityOfPolystyrene);
81 #else
82 // Read from database.
83 const GeoMaterial *air = materialManager->getMaterial("std::Air");
84 const GeoMaterial *poly = materialManager->getMaterial("std::Polystyrene");
85 #endif
86
87 //-----------------------------------------------------------------------------------//
88 // Next make the box that describes the shape of the toy volume: //
89 // //
90 const GeoBox *toyBox = new GeoBox(800*SYSTEM_OF_UNITS::cm,800*SYSTEM_OF_UNITS::cm, 1000*SYSTEM_OF_UNITS::cm); //
91 // //
92 // Bundle this with a material into a logical volume: //
93 // //
94 const GeoLogVol *toyLog = new GeoLogVol("ToyLog", toyBox, air); //
95 // //
96 // ..And create a physical volume: //
97 // //
98 GeoPhysVol *toyPhys = new GeoPhysVol(toyLog); //
99 // //
100 // Add this to the list of top level physical volumes: //
101 // //
102 m_detectorManager->addTreeTop(toyPhys); //
103 //-----------------------------------------------------------------------------------//
104
105 //-----------------------------------------------------------------------------------//
106 // Daughters //
107 // //
108 // //
109 const GeoTube *ringTube = new GeoTube(500*SYSTEM_OF_UNITS::cm, 1000*SYSTEM_OF_UNITS::cm, 5.0*SYSTEM_OF_UNITS::cm); //
110 // //
111 // Bundle this with a material into a logical volume: //
112 // //
113 const GeoLogVol *ringLog = new GeoLogVol("RingLog", ringTube, air); //
114 // //
115 // Make 100 of these within the volume of the toy: //
116 // //
117 GeoSerialDenominator *ringName = new GeoSerialDenominator("RING"); //
118 toyPhys->add(ringName); //
119 for (int i=0;i<100;i++) { //
120 GeoFullPhysVol *ringPhys = new GeoFullPhysVol(ringLog); //
121 GeoAlignableTransform *xform = new GeoAlignableTransform(GeoTrf::TranslateZ3D((i-50)*20*SYSTEM_OF_UNITS::cm));
122 toyPhys->add(xform); //
123 toyPhys->add(ringPhys); //
124 m_detectorManager->addCentralScrutinizer(new CentralScrutinizer(ringPhys)); //
125 } //
126 //-----------------------------------------------------------------------------------//
127
128
129 //-----------------------------------------------------------------------------------//
130 // Now, in addition to active daughters add some passive material. This is done //
131 // here using the "SerialTransformer," our way of parameterizing volumes. It //
132 // does not need to be done this way.. but we want to provide an example of //
133 // parametrizations in the Toy //
134 //-----------------------------------------------------------------------------------//
135
136 GeoBox *sPass = new GeoBox(5.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm);
137 GeoLogVol *lPass = new GeoLogVol("Passive", sPass, poly);
138 GeoPhysVol *pPass = new GeoPhysVol(lPass);
139
140 GeoBox *sIPass = new GeoBox(4*SYSTEM_OF_UNITS::cm, 25*SYSTEM_OF_UNITS::cm, 25*SYSTEM_OF_UNITS::cm);
141 GeoLogVol *lIPass = new GeoLogVol("InnerPassive", sIPass, air);
142 GeoPhysVol *pIPass = new GeoPhysVol(lIPass);
143
144 pPass->add(pIPass);
145
146 const unsigned int NPLATES=100;
147 Variable i;
148 Sin sin;
149 GENFUNCTION f = 360*SYSTEM_OF_UNITS::deg/NPLATES*i;
150 GENFUNCTION g = sin(4*f);
151 GENFUNCTION h = -g;
152 TRANSFUNCTION t1 = Pow(GeoTrf::RotateZ3D(1.0),f)*GeoTrf::TranslateX3D(1100*SYSTEM_OF_UNITS::cm)*Pow(GeoTrf::TranslateZ3D(800*SYSTEM_OF_UNITS::cm),g);
153 TRANSFUNCTION t2 = Pow(GeoTrf::RotateZ3D(1.0),f)*GeoTrf::TranslateX3D(1100*SYSTEM_OF_UNITS::cm)*Pow(GeoTrf::TranslateZ3D(800*SYSTEM_OF_UNITS::cm),h);
154
155 //-----------------------------------------------------------------------------------//
156 // Inside, by the way, the serial transformer will evaluate the functions: //
157 // HepTransform3D xf = t1(i), for i=1,NPLATES.... //
158 //-----------------------------------------------------------------------------------//
159
160 GeoSerialDenominator *pass1Name = new GeoSerialDenominator("PASSIVE-1-");
161 GeoSerialTransformer *s1 = new GeoSerialTransformer(pPass,&t1, NPLATES);
162 toyPhys->add(pass1Name);
163 toyPhys->add(s1);
164
165 GeoSerialDenominator *pass2Name = new GeoSerialDenominator("PASSIVE-2-");
166 GeoSerialTransformer *s2 = new GeoSerialTransformer(pPass,&t2, NPLATES);
167 toyPhys->add(pass2Name);
168 toyPhys->add(s2);
169
170
171 //------------------------------------------------------------------------------------//
172 // Now insert all of this into the world... //
173 GeoNameTag *tag = new GeoNameTag("Toy"); //
174 world->add(tag); //
175 world->add(toyPhys); //
176 //------------------------------------------------------------------------------------//
177}
virtual const GeoMaterial * getMaterial(const std::string &name)=0
std::vector< ALFA_RawDataContainer_p1 > t2
std::vector< ALFA_RawDataCollection_p1 > t1

◆ getDetectorManager()

const ToyDetectorManager * ToyDetectorFactory::getDetectorManager ( ) const
virtual

Definition at line 179 of file ToyDetectorFactory.cxx.

180{
181 return m_detectorManager;
182}

◆ operator=()

const ToyDetectorFactory & ToyDetectorFactory::operator= ( const ToyDetectorFactory & right)
private

Member Data Documentation

◆ m_detectorManager

ToyDetectorManager* ToyDetectorFactory::m_detectorManager
private

Definition at line 33 of file ToyDetectorFactory.h.

◆ m_detectorStore

StoreGateSvc* ToyDetectorFactory::m_detectorStore
private

Definition at line 35 of file ToyDetectorFactory.h.


The documentation for this class was generated from the following files: