ATLAS Offline Software
SCT_FwdHybrid.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Simulation for the COMBINED TESTBEAM 2004 //
7 // //
8 // Zdenka.Broklova@matfyz.cz //
9 // Carlos.Escobar@ific.uv.es //
10 // Peter.Kodys@ific.uv.es //
11 // January 23, 2004 //
13 
16 
19 
20 #include "GeoModelKernel/GeoTrd.h"
21 #include "GeoModelKernel/GeoBox.h"
22 #include "GeoModelKernel/GeoLogVol.h"
23 #include "GeoModelKernel/GeoShape.h"
24 #include "GeoModelKernel/GeoShapeShift.h"
25 #include "GeoModelKernel/GeoShapeUnion.h"
26 #include "GeoModelKernel/GeoPhysVol.h"
27 #include "GeoModelKernel/GeoNameTag.h"
28 #include "GeoModelKernel/GeoTransform.h"
29 #include "GeoModelKernel/GeoAlignableTransform.h"
30 #include "GeoModelKernel/GeoMaterial.h"
31 #include "GaudiKernel/SystemOfUnits.h"
32 
33 #include "GeoModelKernel/GeoDefinitions.h"
34 
35 #include <cmath>
36 
37 
38 SCT_FwdHybrid::SCT_FwdHybrid(const std::string & name, int ringType,
39  InDetDD::SCT_DetectorManager* detectorManager,
40  SCT_GeometryManager* geometryManager,
41  SCT_MaterialManager* materials)
42  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
43  m_ringType(ringType)
44 {
45  getParameters();
47 }
48 
49 
50 
51 void
53 {
54 
56 
57  m_materialName = parameters->fwdHybridMaterial();
58 
59  //double Gaudi::Units::radlength;
60  //Gaudi::Units::radlength = 18.8 * Gaudi::Units::cm;
61  // [Gaudi::Units::cm] for carbon (Partickle Physics Booklet)
62 
63  m_thickness = parameters->fwdHybridThickness();
65 
66  m_length = parameters->fwdHybridLength();
67 
68  // TRD part
69  m_innerWidth = parameters->fwdHybridInnerWidth();
70  m_outerWidth = parameters->fwdHybridOuterWidth(); // Width at outer edge
71  m_length1 = parameters->fwdHybridLengthToCorner();
72 
73  // rectangular part.
74  m_length2 = m_length - parameters->fwdHybridLengthToCorner();
76 
78 
79  m_mountPointToInnerEdge = parameters->fwdHybridMountPointToInnerEdge();
81 
82 }
83 
84 GeoVPhysVol * SCT_FwdHybrid::build()
85 {
86 
88 
89  // Make a hybrid. This is a TRD + BOX
90  const GeoTrd * hybridShape1 = new GeoTrd(0.5 * m_thickness, 0.5 * m_thickness,
91  0.5 * m_innerWidth, 0.5 * m_outerWidth,
92  0.5 * m_length1);
93 
94  const GeoBox * hybridShape2 = new GeoBox(0.5 * m_thickness2, 0.5 * m_width2, 0.5 * m_length2);
95 
96  double position = parameters->fwdModuleMountPoint(m_ringType) - (m_mountPointToInnerEdge)
97  + 0.5*(m_length2);
98  // double position = zsmi[m_ringType].mountd - zhyb->hybysh + (zhyb->hyby - zhyb->hybycor) / 2.;
99  if (m_ringType == 0) { position = -1 * position; }; // outer module, hybrid in inner side
100 
101  const GeoShape & hybridPos1 = (*hybridShape2 << GeoTrf::TranslateZ3D(position));
102 
103  position = parameters->fwdModuleMountPoint(m_ringType) - (m_mountPointToInnerEdge)
104  + m_length - 0.5 * parameters->fwdHybridLengthToCorner();
105  // position = zsmi[m_ringType].mountd - zhyb->hybysh + zhyb->hyby - zhyb->hybycor / 2.;
106  if (m_ringType == 0) { // outer module, hybrid in inner side
107  position = -1 * position; };
108 
109  double rotation = 0.;
110  if (m_ringType == 0) rotation = 180. * Gaudi::Units::deg;
111 
112  const GeoShape & hybridPos2 = (*hybridShape1 << GeoTrf::RotateX3D(rotation)
113  << GeoTrf::TranslateZ3D(position) );
114 
115  const GeoShapeUnion & hybridShape = hybridPos1.add(hybridPos2);
116  // error getting volume directly.
117  m_material = m_materials->getMaterialForVolume(m_materialName, hybridShape1->volume()+hybridShape2->volume());
118  const GeoLogVol * hybridLog = new GeoLogVol(getName(), &hybridShape, m_material);
119  GeoPhysVol * hybrid = new GeoPhysVol(hybridLog);
120 
121  return hybrid;
122 
123 }
124 
125 
126 
SCT_ComponentFactory::m_geometryManager
SCT_GeometryManager * m_geometryManager
Definition: SCT_ComponentFactory.h:42
SCT_MaterialManager
Definition: SCT_MaterialManager.h:21
SCT_FwdHybrid::m_ringType
int m_ringType
Definition: SCT_FwdHybrid.h:41
SCT_GeometryManager::forwardModuleParameters
const SCT_ForwardModuleParameters * forwardModuleParameters() const
Definition: SCT_GeometryManager.cxx:91
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
SCT_FwdHybrid::m_material
const GeoMaterial * m_material
Definition: SCT_FwdHybrid.h:58
SCT_MaterialManager.h
SCT_FwdHybrid.h
SCT_FwdHybrid::m_mountPointToOuterEdge
double m_mountPointToOuterEdge
Definition: SCT_FwdHybrid.h:56
deg
#define deg
Definition: SbPolyhedron.cxx:17
SCT_FwdHybrid::m_innerWidth
double m_innerWidth
Definition: SCT_FwdHybrid.h:45
SCT_FwdHybrid::m_length
double m_length
Definition: SCT_FwdHybrid.h:48
SCT_ForwardModuleParameters
Definition: SCT_ForwardModuleParameters.h:12
SCT_FwdHybrid::m_thickness
double m_thickness
Definition: SCT_FwdHybrid.h:49
xAOD::rotation
rotation
Definition: TrackSurface_v1.cxx:15
SCT_ForwardModuleParameters.h
SCT_FwdHybrid::getParameters
void getParameters()
Definition: SCT_FwdHybrid.cxx:52
SCT_FwdHybrid::m_mountPointToInnerEdge
double m_mountPointToInnerEdge
Definition: SCT_FwdHybrid.h:55
SCT_MaterialManager::getMaterialForVolume
const GeoMaterial * getMaterialForVolume(const std::string &materialName, double volume)
Definition: SCT_MaterialManager.cxx:61
SCT_ComponentFactory::m_materials
SCT_MaterialManager * m_materials
Definition: SCT_ComponentFactory.h:43
SCT_FwdHybrid::m_length1
double m_length1
Definition: SCT_FwdHybrid.h:46
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SCT_FwdHybrid::SCT_FwdHybrid
SCT_FwdHybrid(const std::string &name, int ringType, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials)
Definition: SCT_FwdHybrid.cxx:38
SCT_SharedComponentFactory::m_physVolume
GeoVPhysVol * m_physVolume
Definition: SCT_ComponentFactory.h:70
SCT_FwdHybrid::m_materialName
std::string m_materialName
Definition: SCT_FwdHybrid.h:59
SCT_FwdHybrid::m_width2
double m_width2
Definition: SCT_FwdHybrid.h:51
SCT_FwdHybrid::m_outerWidth
double m_outerWidth
Definition: SCT_FwdHybrid.h:43
SCT_SharedComponentFactory
Definition: SCT_ComponentFactory.h:56
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
SCT_ComponentFactory::getName
const std::string & getName() const
Definition: SCT_ComponentFactory.h:35
SCT_GeometryManager.h
SCT_FwdHybrid::m_length2
double m_length2
Definition: SCT_FwdHybrid.h:52
SCT_FwdHybrid::m_thickness2
double m_thickness2
Definition: SCT_FwdHybrid.h:53
SCT_GeometryManager
Definition: SCT_GeometryManager.h:25
SCT_FwdHybrid::build
virtual GeoVPhysVol * build()
Definition: SCT_FwdHybrid.cxx:84