6 #include "GeoModelKernel/GeoMaterial.h"
7 #include "GeoModelKernel/GeoElement.h"
8 #include "GeoModelKernel/GeoPcon.h"
9 #include "GeoModelKernel/GeoTube.h"
10 #include "GeoModelKernel/GeoCons.h"
11 #include "GeoModelKernel/GeoLogVol.h"
12 #include "GeoModelKernel/GeoNameTag.h"
13 #include "GeoModelKernel/GeoPhysVol.h"
14 #include "GeoModelKernel/GeoFullPhysVol.h"
15 #include "GeoModelKernel/GeoTransform.h"
16 #include "GeoModelKernel/GeoAlignableTransform.h"
17 #include "GeoModelKernel/GeoDefinitions.h"
18 #include "GeoModelKernel/Units.h"
26 #include "GaudiKernel/MsgStream.h"
27 #include "GaudiKernel/SystemOfUnits.h"
40 :m_detectorManager(nullptr),
41 m_materialManager(nullptr),
58 log << MSG::INFO <<
" LUCID_DetectorFactory::create " <<
endmsg;
70 double VJConOuterRadFront = 110;
71 double VJConOuterRadBack = 187;
72 double VJConFrontLength = 225;
73 double VJConMidLength = 4485;
74 double VJConBackLength = 425;
75 double VJConFrontRingInnerRad = 100;
76 double VJConBackRingInerRad = 152;
78 aShape->addPlane( 0, VJConFrontRingInnerRad-10, VJConOuterRadFront+10);
79 aShape->addPlane(VJConFrontLength, VJConFrontRingInnerRad-10, VJConOuterRadFront+10);
80 aShape->addPlane(VJConFrontLength+VJConMidLength, VJConFrontRingInnerRad-10, VJConOuterRadBack +10);
81 aShape->addPlane(5036, VJConBackRingInerRad -10, VJConOuterRadBack +10);
82 aShape->addPlane(VJConFrontLength+VJConMidLength+VJConBackLength+30, VJConBackRingInerRad -10, VJConOuterRadBack +10);
85 GeoFullPhysVol* phyVolA =
new GeoFullPhysVol(logVol);
95 double VJConeDistanceToIP = 13442;
97 world->add(
new GeoAlignableTransform(GeoTrf::Translate3D(0, 0, VJConeDistanceToIP)));
98 world->add(
new GeoNameTag(
"LucidSideA"));
105 GeoFullPhysVol* phyVolC = phyVolA->clone();
108 world->add(
new GeoNameTag(
"LucidSideC"));
118 log << MSG::INFO <<
" LUCID_DetectorFactory::buildMaterials " <<
endmsg;
124 double* photonWaveLength =
new double[waveLengthNum];
125 double* photonEnergy =
new double[waveLengthNum];
126 double* quartzRefIndex =
new double[waveLengthNum];
128 log << MSG::INFO <<
" Lambda[nm] Energy[eV] QuartzRefIndex " <<
endmsg;
130 for(
int i=0;
i<waveLengthNum;
i++) {
137 log <<
MSG::DEBUG <<
" **************************************************************************************************** " <<
endmsg;
138 log <<
MSG::DEBUG <<
" Lambda[nm] Energy[eV] QuartzRefIndex GasRefIndex GasAbsLength[m] TubeReflectivity " <<
endmsg;
140 for(
int i=0;
i<waveLengthNum;
i++) {
145 << std::setw(13) << quartzRefIndex [
i]
149 log <<
MSG::DEBUG <<
" ********************************************************************************************************** " <<
endmsg;
158 m_quartz->add(
const_cast<GeoElement*
>(silicon), 1*silicon->getA()/(2*oxygen->getA() + 1*silicon->getA()));
159 m_quartz->add(
const_cast<GeoElement*
>(oxygen) , 2*oxygen->getA() /(2*oxygen->getA() + 1*silicon->getA()));
163 mpt->
AddProperty(
"RINDEX", photonEnergy, quartzRefIndex , waveLengthNum);
170 delete [] photonWaveLength;
171 delete [] photonEnergy;
172 delete [] quartzRefIndex;
178 m_peek->add(
const_cast<GeoElement*
>(carbon),1.0);
186 log << MSG::INFO <<
" LUCID_DetectorFactory::addVJcone " <<
endmsg;
188 double VJConInerRadFront = 105;
189 double VJConOuterRadFront = 110;
190 double VJConInerRadBack = 182;
191 double VJConOuterRadBack = 187;
192 double VJConFrontLength = 225;
193 double VJConMidLength = 4485;
194 double VJConBackLength = 425;
198 aShape->addPlane( 0, VJConInerRadFront, VJConOuterRadFront);
199 aShape->addPlane(VJConFrontLength, VJConInerRadFront, VJConOuterRadFront);
200 aShape->addPlane(VJConFrontLength+VJConMidLength, VJConInerRadBack, VJConOuterRadBack);
201 aShape->addPlane(VJConFrontLength+VJConMidLength+VJConBackLength, VJConInerRadBack, VJConOuterRadBack);
204 GeoPhysVol* phyVol =
new GeoPhysVol(logVol);
206 parent->add(
new GeoTransform(GeoTrf::Translate3D(0, 0, 0)));
207 parent->add(
new GeoNameTag(
"VJcone"));
215 log << MSG::INFO <<
" LUCID_DetectorFactory::addVJconeFrontRing " <<
endmsg;
217 double VJConFrontRingLength = 215;
218 double VJConFrontRingInnerRad = 100;
219 double VJConInerRadFront = 105;
221 GeoShape* aShape =
new GeoTube(VJConFrontRingInnerRad, VJConInerRadFront, VJConFrontRingLength/2);
223 GeoPhysVol* phyVol =
new GeoPhysVol(logVol);
225 parent->add(
new GeoTransform(GeoTrf::Translate3D(0, 0, VJConFrontRingLength/2)));
226 parent->add(
new GeoNameTag(
"VJconeFrontRing"));
234 log << MSG::INFO <<
" LUCID_DetectorFactory::addVJconeBackRing " <<
endmsg;
236 double VJConBackRingLength = 35;
237 double VJConBackRingCentrePosition = (18567-13442)+(VJConBackRingLength/2);
238 double VJConBackRingInerRad = 152;
239 double LucidCylinderRadius = 177;
241 GeoShape* aShape =
new GeoTube(VJConBackRingInerRad, LucidCylinderRadius, VJConBackRingLength/2);
243 GeoPhysVol* phyVol =
new GeoPhysVol(logVol);
245 parent->add(
new GeoTransform(GeoTrf::Translate3D(0, 0, VJConBackRingCentrePosition)));
246 parent->add(
new GeoNameTag(
"VJconeBackRing"));
254 log << MSG::INFO <<
" LUCID_DetectorFactory::addLucidSupportCylinder " <<
endmsg;
256 double LucidCylinderRadius = 110;
257 double LucidCylinderThickness = 1.5;
258 double LucidCylinderLength = 18400-16850;
259 double LucidCylinderCenterPosition = (16850-13442)+(LucidCylinderLength/2);
261 GeoShape* aShape =
new GeoTube (LucidCylinderRadius, LucidCylinderRadius + LucidCylinderThickness, LucidCylinderLength/2);
263 GeoPhysVol* phyVol =
new GeoPhysVol(logVol);
265 parent->add(
new GeoTransform(GeoTrf::Translate3D(0, 0,LucidCylinderCenterPosition)));
266 parent->add(
new GeoNameTag(
"LucidSupportCylinder"));
274 log << MSG::INFO <<
" LUCID_DetectorFactory::addPmtSupportCylinder " <<
endmsg;
276 double PmtSupportCylinderRadius = 111.75;
277 double PmtSupportCylinderThickness = 1.5;
278 double PmtSupportCylinderLength = 17120-16920;
279 double PmtSupportCylinderCenterPosition = (16920-13442)+(PmtSupportCylinderLength/2);
281 GeoShape* aShape =
new GeoTube (PmtSupportCylinderRadius, PmtSupportCylinderRadius + PmtSupportCylinderThickness, PmtSupportCylinderLength/2);
283 GeoPhysVol* phyVol =
new GeoPhysVol(logVol);
285 parent->add(
new GeoTransform(GeoTrf::Translate3D(0, 0, PmtSupportCylinderCenterPosition)));
286 parent->add(
new GeoNameTag(
"PmtSupportCylinder"));
294 log << MSG::INFO <<
" LUCID_DetectorFactory::addPmtSupport" <<
endmsg;
296 double PmtSupportRadius = 113.25;
297 double PmtSupportThickness = 3.4;
298 double PmtSupportLength = 17082-16962;
299 double PmtSupportFrontPosition = (16962-13442);
303 for (
int sec=0; sec<nSections; sec++) {
305 GeoPcon* aShape =
new GeoPcon(0.134 *
M_PI +(sec-1)*(
M_PI/2),0.232 *
M_PI);
307 aShape->addPlane( 0, PmtSupportRadius, PmtSupportRadius+PmtSupportThickness);
308 aShape->addPlane(PmtSupportLength, PmtSupportRadius, PmtSupportRadius+PmtSupportThickness);
311 GeoPhysVol* phyVol =
new GeoPhysVol(logVol);
313 parent->add(
new GeoTransform(GeoTrf::Translate3D(0, 0, PmtSupportFrontPosition)));
314 parent->add(
new GeoNameTag(
"PmtSupport"));
323 log << MSG::INFO <<
" LUCID_DetectorFactory::addPmtTubes " <<
endmsg;
325 double MUMetalCylinderInnerRad = 7.99;
326 double MuMetalCylinderOuterRad = 8.835;
327 double MuMetalCylinderLength = 75;
329 double PmtRadius = 5;
330 double PmtCenterPosition = 125.5;
331 double PmtWindowThickness = 1.2;
333 double PeekCapInnerRad = 1.6;
334 double PeekCapOuterRad = 8.835;
335 double PeekCapLength = 2.8;
337 double MetalConnectorOuterRad = 1.6;
338 double MetalConnectorLength = 9.8;
340 GeoShape* aShape =
new GeoTube(0, PmtRadius, PmtWindowThickness/2);
341 GeoLogVol* logVol =
new GeoLogVol(
"lvPmt", aShape,
m_quartz);
342 GeoPhysVol* phyVol =
new GeoPhysVol(logVol);
344 GeoShape* aShapeMu =
new GeoTube(MUMetalCylinderInnerRad, MuMetalCylinderOuterRad, MuMetalCylinderLength/2);
346 GeoPhysVol* phyVolMu =
new GeoPhysVol(logVolMu);
348 GeoShape* aShapePeekCap =
new GeoTube(PeekCapInnerRad, PeekCapOuterRad, PeekCapLength/2);
349 GeoLogVol* logVolPeekCap =
new GeoLogVol(
"lvPmtPeekCap", aShapePeekCap,
m_peek);
350 GeoPhysVol* phyVolPeekCap =
new GeoPhysVol(logVolPeekCap);
352 GeoShape* aShapeMetalconnector =
new GeoTube(0, MetalConnectorOuterRad, MetalConnectorLength/2);
353 GeoLogVol* logVolMetalConnector =
new GeoLogVol(
"lvPmtMetalConnector", aShapeMetalconnector,
m_materialManager->
getMaterial(
"std::Iron"));
354 GeoPhysVol* phyVolMetalConnector =
new GeoPhysVol(logVolMetalConnector);
358 int nPmtTubesPerSection = 4;
360 for (
int sec=0; sec<nSections; sec++) {
361 for (
int tub=0; tub<nPmtTubesPerSection; tub++) {
365 double z = (16970-13442)+(PmtWindowThickness/2);
366 double zMu = (16963-13442)+(MuMetalCylinderLength/2);
367 double zCap = (16963-13442)-(PeekCapLength/2);
368 double zMetal = (16963-13442)-(MetalConnectorLength/2);
370 char sname[256]; sprintf(sname,
"LucidPmt%d", 4*sec+tub);
373 <<
format(
"Adding %11s phi:%10.3f x:%10.3f y:%10.3f z:%10.3f", sname,
phi,
x,
y,
z)
376 parent->add(
new GeoNameTag (sname));
377 parent->add(
new GeoTransform(GeoTrf::Translate3D(
x,
y,
z)));
380 char snameMu[256]; sprintf(snameMu,
"MuMetal cylinder%d", 4*sec+tub);
383 <<
format(
"Adding %11s phi:%10.3f x:%10.3f y:%10.3f zMu:%10.3f", snameMu,
phi,
x,
y, zMu)
386 parent->add(
new GeoNameTag (snameMu));
387 parent->add(
new GeoTransform(GeoTrf::Translate3D(
x,
y, zMu)));
390 char snamePeekCap[256]; sprintf(snamePeekCap,
"PmtPeekCap%d", 4*sec+tub);
393 <<
format(
"Adding %11s phi:%10.3f x:%10.3f y:%10.3f zCap:%10.3f", snamePeekCap,
phi,
x,
y, zCap)
396 parent->add(
new GeoNameTag (snamePeekCap));
397 parent->add(
new GeoTransform(GeoTrf::Translate3D(
x,
y, zCap)));
398 parent->add(phyVolPeekCap);
400 char snameMetalConnector[256]; sprintf(snameMetalConnector,
"MetalConnector%d", 4*sec+tub);
403 <<
format(
"Adding %11s phi:%10.3f x:%10.3f y:%10.3f zMetal:%10.3f", snameMetalConnector,
phi,
x,
y, zMetal)
406 parent->add(
new GeoNameTag (snameMetalConnector));
407 parent->add(
new GeoTransform(GeoTrf::Translate3D(
x,
y, zMetal)));
408 parent->add(phyVolMetalConnector);