ATLAS Offline Software
SCT_FwdCoolingBlock.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/GeoBox.h"
13 #include "GeoModelKernel/GeoLogVol.h"
14 #include "GeoModelKernel/GeoPhysVol.h"
15 #include "GeoModelKernel/GeoMaterial.h"
16 #include "GeoModelKernel/Units.h"
17 
18 #include <iostream>
19 
20 SCT_FwdCoolingBlock::SCT_FwdCoolingBlock(const std::string & name, int hiLo, int mainOrSecondary,
21  InDetDD::SCT_DetectorManager* detectorManager,
22  SCT_GeometryManager* geometryManager,
23  SCT_MaterialManager* materials)
24  : SCT_SharedComponentFactory(name, detectorManager, geometryManager, materials),
25  m_hiLo(hiLo), m_mainSec(mainOrSecondary)
26 {
27  getParameters();
29 }
30 
31 
32 void
34 {
36 
38  for (int i = 0; i < 4; i++){
39  if (parameters->fwdCoolingBlockHiLo(i) == m_hiLo && parameters->fwdCoolingBlockMainOrSecondary(i) == m_mainSec) {
41  }
42  }
43 
44  if (m_coolingBlockIndex < 0){
45  std::cout << "SCT_FwdCoolingBlock: ERROR. Cooling block type is missing. HiLo = " << m_hiLo
46  << ", MainSecondary = " << m_mainSec << std::endl;
47  // Will crash or give unpredictable results
48  }
49 
50  m_materialName = parameters->fwdCoolingBlockMaterial(m_coolingBlockIndex);
51  m_thickness = parameters->fwdCoolingBlockThickness(m_coolingBlockIndex);
52  m_deltaR = parameters->fwdCoolingBlockDeltaR(m_coolingBlockIndex);
53  m_rphi = parameters->fwdCoolingBlockRPhi(m_coolingBlockIndex);
54  m_offset = parameters->fwdCoolingBlockOffsetFromDisc(m_coolingBlockIndex);
55 
56 
57 }
58 
59 GeoVPhysVol *
61 {
62 
63  // Build the CoolingBlock. Just a simple box.
64  const GeoBox * coolingBlockShape = new GeoBox(0.5*m_deltaR, 0.5*m_rphi, 0.5*m_thickness);
65  m_material = m_materials->getMaterialForVolume(m_materialName, coolingBlockShape->volume());
66  const GeoLogVol *coolingBlockLog =
67  new GeoLogVol(getName(), coolingBlockShape, m_material);
68  GeoPhysVol * coolingBlock = new GeoPhysVol(coolingBlockLog);
69 
70  return coolingBlock;
71 }
SCT_ComponentFactory::m_geometryManager
SCT_GeometryManager * m_geometryManager
Definition: SCT_ComponentFactory.h:42
SCT_MaterialManager
Definition: SCT_MaterialManager.h:21
SCT_FwdCoolingBlock::m_coolingBlockIndex
int m_coolingBlockIndex
Definition: SCT_FwdCoolingBlock.h:52
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
SCT_FwdCoolingBlock::m_materialName
std::string m_materialName
Definition: SCT_FwdCoolingBlock.h:45
SCT_MaterialManager.h
SCT_FwdCoolingBlock::getParameters
void getParameters()
Definition: SCT_FwdCoolingBlock.cxx:33
SCT_FwdCoolingBlock::m_mainSec
int m_mainSec
Definition: SCT_FwdCoolingBlock.h:51
SCT_GeometryManager::forwardParameters
const SCT_ForwardParameters * forwardParameters() const
Definition: SCT_GeometryManager.cxx:98
SCT_FwdCoolingBlock::SCT_FwdCoolingBlock
SCT_FwdCoolingBlock(const std::string &name, int hiLo, int mainOrSecondary, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials)
Definition: SCT_FwdCoolingBlock.cxx:20
SCT_FwdCoolingBlock::m_rphi
double m_rphi
Definition: SCT_FwdCoolingBlock.h:48
SCT_FwdCoolingBlock::build
virtual GeoVPhysVol * build()
Definition: SCT_FwdCoolingBlock.cxx:60
lumiFormat.i
int i
Definition: lumiFormat.py:85
SCT_FwdCoolingBlock::m_offset
double m_offset
Definition: SCT_FwdCoolingBlock.h:49
SCT_FwdCoolingBlock::m_material
const GeoMaterial * m_material
Definition: SCT_FwdCoolingBlock.h:44
SCT_MaterialManager::getMaterialForVolume
const GeoMaterial * getMaterialForVolume(const std::string &materialName, double volume)
Definition: SCT_MaterialManager.cxx:61
SCT_FwdCoolingBlock::m_hiLo
int m_hiLo
Definition: SCT_FwdCoolingBlock.h:50
SCT_FwdCoolingBlock::m_thickness
double m_thickness
Definition: SCT_FwdCoolingBlock.h:46
SCT_ComponentFactory::m_materials
SCT_MaterialManager * m_materials
Definition: SCT_ComponentFactory.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SCT_SharedComponentFactory::m_physVolume
GeoVPhysVol * m_physVolume
Definition: SCT_ComponentFactory.h:70
SCT_SharedComponentFactory
Definition: SCT_ComponentFactory.h:56
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
SCT_ForwardParameters.h
SCT_FwdCoolingBlock::m_deltaR
double m_deltaR
Definition: SCT_FwdCoolingBlock.h:47
SCT_ComponentFactory::getName
const std::string & getName() const
Definition: SCT_ComponentFactory.h:35
SCT_GeometryManager.h
SCT_GeometryManager
Definition: SCT_GeometryManager.h:25
SCT_ForwardParameters
Definition: SCT_ForwardParameters.h:16
SCT_FwdCoolingBlock.h