ATLAS Offline Software
Loading...
Searching...
No Matches
AFP_GeoModelSID.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
7#include "GaudiKernel/IService.h"
8#include "GaudiKernel/ISvcLocator.h"
9#include "GaudiKernel/MsgStream.h"
12#include "GeoModelKernel/GeoMaterial.h"
13#include "GeoModelKernel/GeoBox.h"
14#include "GeoModelKernel/GeoTube.h"
15#include "GeoModelKernel/GeoTubs.h"
16#include "GeoModelKernel/GeoShapeSubtraction.h"
17#include "GeoModelKernel/GeoShapeIntersection.h"
18#include "GeoModelKernel/GeoShapeUnion.h"
19#include "GeoModelKernel/GeoShapeShift.h"
20#include "GeoModelKernel/GeoLogVol.h"
21#include "GeoModelKernel/GeoNameTag.h"
22#include "GeoModelKernel/GeoPhysVol.h"
23#include "GeoModelKernel/GeoFullPhysVol.h"
24#include "GeoModelKernel/GeoTransform.h"
25#include "GeoModelKernel/GeoAlignableTransform.h"
26#include "GeoModelKernel/GeoDefinitions.h"
27#include "CLHEP/GenericFunctions/AbsFunction.hh"
28#include "CLHEP/GenericFunctions/Variable.hh"
29#include "CLHEP/GenericFunctions/Sin.hh"
30#include "CLHEP/GenericFunctions/Cos.hh"
31
33
34#include <cmath>
35#include <cstdlib>
36#include <format>
37#include <fstream>
38#include <iostream>
39#include <string>
40
41void AFP_GeoModelFactory::addSiDetector(GeoPhysVol* pPhysMotherVol, const char* pszStationName, HepGeom::Transform3D& TransInMotherVolume)
42{
43 std::string szLabel;
44 const std::string pszStationNameStr{pszStationName};
45 GeoLogVol* pLogElement=nullptr;
46 GeoFullPhysVol* pPhysElement;
47 eAFPStation eStation=m_pGeometry->parseStationName(pszStationName);
48 AFP_SIDCONFIGURATION sidcfg=m_CfgParams.sidcfg[eStation];
49
50 //create (constant) solids
51 GeoShape* pSolidSIDPlate=createSolidSIDPlate();
53 GeoShape* pSolidSIDVacuumSensor=new GeoBox(0.5*180.0*CLHEP::mm,0.5*160.0*CLHEP::mm,0.5*AFP_CONSTANTS::Stat_GlobalVacuumSensorThickness);
54
55 //add global vacuum sensitive volume (ID=11)
57 szLabel = std::format("{}_LogSIDVacuumSensor[{}]",pszStationName,nSpecVacSensorID);
58 GeoLogVol* pLogSIDVacuumSensor=new GeoLogVol(szLabel,pSolidSIDVacuumSensor,m_MapMaterials[std::string("std::Vacuum")]);
59 GeoFullPhysVol* pPhysSIDVacuumSensor=new GeoFullPhysVol(pLogSIDVacuumSensor);
60 szLabel = std::format("{}_SIDVacuumSensor[{}]",pszStationName,nSpecVacSensorID);
61 pPhysMotherVol->add(new GeoNameTag(szLabel));
62 pPhysMotherVol->add(new GeoTransform(Amg::CLHEPTransformToEigen(m_pGeometry->getSIDTransform(ESTT_VACUUMSENSOR,pszStationNameStr,nSpecVacSensorID))));
63 pPhysMotherVol->add(pPhysSIDVacuumSensor);
64
65
66 for(int i=0;i<m_pGeometry->getSIDPlatesCnt(eStation);i++)
67 {
68 // create SID plate
69 szLabel = std::format("{}_LogSIDPlate[{}]",pszStationName,i);
70 pLogElement=new GeoLogVol(szLabel,pSolidSIDPlate,m_MapMaterials[std::string("CE7")]);
71 pPhysElement=new GeoFullPhysVol(pLogElement);
72 szLabel = std::format("{}_SIDPlate[{}]",pszStationName,i);
73 pPhysMotherVol->add(new GeoNameTag(szLabel));
74 pPhysMotherVol->add(new GeoTransform(Amg::CLHEPTransformToEigen(TransInMotherVolume*m_pGeometry->getSIDTransform(ESTT_PLATE,pszStationNameStr,i))));
75 pPhysMotherVol->add(pPhysElement);
76
77 // create SID chip
78 GeoShape* pSolidFEI4Chip=new GeoBox(0.5*sidcfg.vecChipXLength[i],0.5*sidcfg.vecChipYLength[i],0.5*AFP_CONSTANTS::SiT_Chip_thickness);
79 szLabel = std::format("{}_LogSIDChip[{}]",pszStationName,i);
80 pLogElement=new GeoLogVol(szLabel,pSolidFEI4Chip,m_MapMaterials[std::string("CE7")]);
81 pPhysElement=new GeoFullPhysVol(pLogElement);
82 szLabel = std::format("{}_SIDChip[{}]",pszStationName,i);
83 pPhysMotherVol->add(new GeoNameTag(szLabel));
84 pPhysMotherVol->add(new GeoTransform(Amg::CLHEPTransformToEigen(TransInMotherVolume*m_pGeometry->getSIDTransform(ESTT_FEI4CHIP,pszStationNameStr,i))));
85 pPhysMotherVol->add(pPhysElement);
86
87 // create SID sensor (pixel area)
88 szLabel = std::format("{}_LogSIDSensor[{}]",pszStationName,i);
89 pLogElement=new GeoLogVol(szLabel,pSolidSIDSensor,m_MapMaterials[std::string("Silicon")]);
90 pPhysElement=new GeoFullPhysVol(pLogElement);
91 szLabel = std::format("{}_SIDSensor[{}]",pszStationName,i);
92 pPhysMotherVol->add(new GeoNameTag(szLabel));
93 pPhysMotherVol->add(new GeoTransform(Amg::CLHEPTransformToEigen(TransInMotherVolume*m_pGeometry->getSIDTransform(ESTT_SENSOR,pszStationNameStr,i))));
94 pPhysMotherVol->add(pPhysElement);
95
96 if(m_CfgParams.sidcfg[eStation].bAddVacuumSensors)
97 {
98 // create logic SID Vacuum Layer
99 szLabel = std::format("{}_LogSIDVacuumSensor[{}]",pszStationName,i);
100 GeoLogVol* pLogSIDVacuumSensor=new GeoLogVol(szLabel,pSolidSIDVacuumSensor,m_MapMaterials[std::string("std::Vacuum")]);
101 GeoFullPhysVol* pPhysSIDVacuumSensor=new GeoFullPhysVol(pLogSIDVacuumSensor);
102
103 szLabel = std::format("{}_SIDVacuumSensor[{}]",pszStationName,i);
104 pPhysMotherVol->add(new GeoNameTag(szLabel));
105 pPhysMotherVol->add(new GeoTransform(Amg::CLHEPTransformToEigen(m_pGeometry->getSIDTransform(ESTT_VACUUMSENSOR,pszStationNameStr,i))));
106 pPhysMotherVol->add(pPhysSIDVacuumSensor);
107 }
108 }
109}
110
111
113{
114 MsgStream LogStream(Athena::getMessageSvc(), "AFP_GeoModelFactory::CreateSolidSIDPlate");
115
116 double fdelta=0.01*CLHEP::mm;//0.01*CLHEP::mm;
117
119
120 //cut side edges
123 double fgamma=45.0*CLHEP::deg-falpha; double fbeta=90.0*CLHEP::deg-falpha;
124
125 //--lower cut
126 HepGeom::Vector3D<double> vecL=(fd/std::sqrt(2.0))*(HepGeom::RotateZ3D(-fgamma)*HepGeom::Vector3D<double>(1.0,0.0,0.0));
127 HepGeom::Vector3D<double> vecB=AFP_CONSTANTS::SiT_Plate_CutEdge_length_x*HepGeom::Vector3D<double>(1.0,0.0,0.0);
128 HepGeom::Vector3D<double> vecX=vecL-vecB;
129 GeoBox* pPlateCut=new GeoBox(0.5*fd, 0.5*fd,0.5*(AFP_CONSTANTS::SiT_Plate_CutEdge_thickness+fdelta));
130 HepGeom::Transform3D TransCut=HepGeom::Translate3D(vecX.x()+0.5*AFP_CONSTANTS::SiT_Plate_Main_length_x,vecX.y()-0.5*AFP_CONSTANTS::SiT_Plate_Main_length_y,0.0)*HepGeom::RotateZ3D(-fbeta);
131 GeoShapeShift* pShiftCut=new GeoShapeShift(pPlateCut, Amg::CLHEPTransformToEigen(TransCut));
132 GeoShapeSubtraction* pShape1=new GeoShapeSubtraction(pMainPlate, pShiftCut);
133
134 //--upper cut
135 vecL=(fd/std::sqrt(2.0))*(HepGeom::RotateZ3D(+fgamma)*HepGeom::Vector3D<double>(1.0,0.0,0.0));
136 vecX=vecL-vecB;
137 pPlateCut=new GeoBox(0.5*fd, 0.5*fd,0.5*(AFP_CONSTANTS::SiT_Plate_CutEdge_thickness+fdelta));
138 TransCut=HepGeom::Translate3D(vecX.x()+0.5*AFP_CONSTANTS::SiT_Plate_Main_length_x,vecX.y()+0.5*AFP_CONSTANTS::SiT_Plate_Main_length_y,0.0)*HepGeom::RotateZ3D(+fbeta);
139 pShiftCut=new GeoShapeShift(pPlateCut,Amg::CLHEPTransformToEigen(TransCut));
140 GeoShapeSubtraction* pShape2=new GeoShapeSubtraction(pShape1, pShiftCut);
141
142 //cut sensitive area
145 pShiftCut=new GeoShapeShift(pPlateCut,Amg::CLHEPTransformToEigen(TransCut));
146 GeoShapeSubtraction* pShape3=new GeoShapeSubtraction(pShape2, pShiftCut);
147
148 return pShape3;
149}
@ ESTT_PLATE
@ ESTT_FEI4CHIP
@ ESTT_VACUUMSENSOR
@ ESTT_SENSOR
eAFPStation
std::map< std::string, GeoRef< const GeoMaterial > > m_MapMaterials
void addSiDetector(GeoPhysVol *pPhysMotherVol, const char *pszStationName, HepGeom::Transform3D &TransInMotherVolume)
AFP_CONFIGURATION m_CfgParams
GeoShape * createSolidSIDPlate()
singleton-like access to IMessageSvc via open function and helper
Amg::Transform3D CLHEPTransformToEigen(const HepGeom::Transform3D &CLHEPtransf)
Converts a CLHEP-based HepGeom::Transform3D into an Eigen Amg::Transform3D.
IMessageSvc * getMessageSvc(bool quiet=false)
static constexpr double SiT_Plate_Window_length_y
static constexpr double SiT_Pixel_length_totx
static constexpr double SiT_Plate_Main_thickness
static constexpr double SiT_Plate_Main_length_y
static constexpr double SiT_Plate_CutEdge_length_x
static constexpr double Stat_GlobalVacuumSensorThickness
static constexpr int Stat_GlobalVacuumSensorID
static constexpr double SiT_Pixel_length_toty
static constexpr double SiT_Plate_Window_thickness
static constexpr double SiT_Chip_thickness
static constexpr double SiT_Plate_Window_length_x
static constexpr double SiT_Pixel_thickness
static constexpr double SiT_Plate_CutEdge_thickness
static constexpr double SiT_Plate_Window_x
static constexpr double SiT_Plate_CutEdge_length_y
static constexpr double SiT_Plate_Main_length_x
static constexpr double SiT_Plate_Window_y
std::vector< double > vecChipXLength
std::vector< double > vecChipYLength