ATLAS Offline Software
SCT_FwdOptoHarness.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 
8 
11 
12 #include "GeoModelKernel/GeoTube.h"
13 #include "GeoModelKernel/GeoLogVol.h"
14 #include "GeoModelKernel/GeoPhysVol.h"
15 #include "GaudiKernel/SystemOfUnits.h"
16 
17 #include <cmath>
18 #include <iostream>
19 
20 inline double sqr(double x) {return x*x;}
21 
22 SCT_FwdOptoHarness::SCT_FwdOptoHarness(const std::string & name, int itype,
23  InDetDD::SCT_DetectorManager* detectorManager,
24  SCT_GeometryManager* geometryManager,
25  SCT_MaterialManager* materials)
26  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
27  m_type(itype)
28 {
29  getParameters();
31 }
32 
33 
34 void
36 {
38 
39  m_index = -1;
40  for(int i=0; i<3; ++i) {
41  if(parameters->fwdOptoHarnessDiscType(i) == m_type) {m_index = i;}
42  }
43 
44  if(m_index < 0) {
45  std::cout << "SCT_FwdOptoHarness: ERROR. Disc type is missing" << m_type << std::endl;
46  std::cout << "Assuming type 1" << std::endl;
47  m_index = 0;
48  }
49 
50  m_materialName= parameters->fwdOptoHarnessMaterial(m_index);
51  m_innerRadius = parameters->fwdOptoHarnessInnerRadius(m_index);
52  m_outerRadius = parameters->fwdOptoHarnessOuterRadius(m_index);
53  m_thickness = parameters->fwdOptoHarnessThickness(m_index);
54 }
55 
56 GeoVPhysVol *
58 {
59  const GeoTube * optoHarnessShape = new GeoTube(m_innerRadius, m_outerRadius, 0.5 * m_thickness);
60  m_material = m_materials->getMaterialForVolume(m_materialName, optoHarnessShape->volume());
61  const GeoLogVol * optoHarnessLog = new GeoLogVol(getName(), optoHarnessShape, m_material);
62 
63  GeoPhysVol * optoHarness = new GeoPhysVol(optoHarnessLog);
64 
65  return optoHarness;
66 }
SCT_ComponentFactory::m_geometryManager
SCT_GeometryManager * m_geometryManager
Definition: SCT_ComponentFactory.h:42
SCT_MaterialManager
Definition: SCT_MaterialManager.h:21
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
SCT_FwdOptoHarness::m_outerRadius
double m_outerRadius
Definition: SCT_FwdOptoHarness.h:37
SCT_FwdOptoHarness.h
SCT_MaterialManager.h
SCT_GeometryManager::forwardParameters
const SCT_ForwardParameters * forwardParameters() const
Definition: SCT_GeometryManager.cxx:98
SCT_FwdOptoHarness::m_material
const GeoMaterial * m_material
Definition: SCT_FwdOptoHarness.h:39
x
#define x
SCT_FwdOptoHarness::m_materialName
std::string m_materialName
Definition: SCT_FwdOptoHarness.h:40
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44
lumiFormat.i
int i
Definition: lumiFormat.py:85
SCT_FwdOptoHarness::build
virtual GeoVPhysVol * build()
Definition: SCT_FwdOptoHarness.cxx:57
SCT_FwdOptoHarness::m_index
int m_index
Definition: SCT_FwdOptoHarness.h:42
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SCT_SharedComponentFactory::m_physVolume
GeoVPhysVol * m_physVolume
Definition: SCT_ComponentFactory.h:70
sqr
double sqr(double x)
Definition: SCT_FwdOptoHarness.cxx:20
SCT_FwdOptoHarness::m_type
int m_type
Definition: SCT_FwdOptoHarness.h:34
SCT_FwdOptoHarness::getParameters
void getParameters()
Definition: SCT_FwdOptoHarness.cxx:35
SCT_FwdOptoHarness::m_thickness
double m_thickness
Definition: SCT_FwdOptoHarness.h:38
SCT_SharedComponentFactory
Definition: SCT_ComponentFactory.h:56
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
SCT_ForwardParameters.h
SCT_ComponentFactory::getName
const std::string & getName() const
Definition: SCT_ComponentFactory.h:35
SCT_FwdOptoHarness::m_innerRadius
double m_innerRadius
Definition: SCT_FwdOptoHarness.h:36
SCT_GeometryManager.h
SCT_GeometryManager
Definition: SCT_GeometryManager.h:25
SCT_ForwardParameters
Definition: SCT_ForwardParameters.h:16
SCT_FwdOptoHarness::SCT_FwdOptoHarness
SCT_FwdOptoHarness(const std::string &name, int iType, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials)
Definition: SCT_FwdOptoHarness.cxx:22