ATLAS Offline Software
Loading...
Searching...
No Matches
AFP_GeoModelSID.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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 GeoLogVol* pLogElement=nullptr;
45 GeoFullPhysVol* pPhysElement;
46 eAFPStation eStation=m_pGeometry->parseStationName(pszStationName);
47 AFP_SIDCONFIGURATION sidcfg=m_CfgParams.sidcfg[eStation];
48
49 //create (constant) solids
50 GeoShape* pSolidSIDPlate=createSolidSIDPlate();
52 GeoShape* pSolidSIDVacuumSensor=new GeoBox(0.5*180.0*CLHEP::mm,0.5*160.0*CLHEP::mm,0.5*AFP_CONSTANTS::Stat_GlobalVacuumSensorThickness);
53
54 //add global vacuum sensitive volume (ID=11)
56 szLabel = std::format("{}_LogSIDVacuumSensor[{}]",pszStationName,nSpecVacSensorID);
57 GeoLogVol* pLogSIDVacuumSensor=new GeoLogVol(szLabel,pSolidSIDVacuumSensor,m_MapMaterials[std::string("std::Vacuum")]);
58 GeoFullPhysVol* pPhysSIDVacuumSensor=new GeoFullPhysVol(pLogSIDVacuumSensor);
59 szLabel = std::format("{}_SIDVacuumSensor[{}]",pszStationName,nSpecVacSensorID);
60 pPhysMotherVol->add(new GeoNameTag(szLabel));
61 pPhysMotherVol->add(new GeoTransform(Amg::CLHEPTransformToEigen(m_pGeometry->getSIDTransform(ESTT_VACUUMSENSOR,pszStationName,nSpecVacSensorID))));
62 pPhysMotherVol->add(pPhysSIDVacuumSensor);
63
64
65 for(int i=0;i<m_pGeometry->getSIDPlatesCnt(eStation);i++)
66 {
67 // create SID plate
68 szLabel = std::format("{}_LogSIDPlate[{}]",pszStationName,i);
69 pLogElement=new GeoLogVol(szLabel,pSolidSIDPlate,m_MapMaterials[std::string("CE7")]);
70 pPhysElement=new GeoFullPhysVol(pLogElement);
71 szLabel = std::format("{}_SIDPlate[{}]",pszStationName,i);
72 pPhysMotherVol->add(new GeoNameTag(szLabel));
73 pPhysMotherVol->add(new GeoTransform(Amg::CLHEPTransformToEigen(TransInMotherVolume*m_pGeometry->getSIDTransform(ESTT_PLATE,pszStationName,i))));
74 pPhysMotherVol->add(pPhysElement);
75
76 // create SID chip
77 GeoShape* pSolidFEI4Chip=new GeoBox(0.5*sidcfg.vecChipXLength[i],0.5*sidcfg.vecChipYLength[i],0.5*AFP_CONSTANTS::SiT_Chip_thickness);
78 szLabel = std::format("{}_LogSIDChip[{}]",pszStationName,i);
79 pLogElement=new GeoLogVol(szLabel,pSolidFEI4Chip,m_MapMaterials[std::string("CE7")]);
80 pPhysElement=new GeoFullPhysVol(pLogElement);
81 szLabel = std::format("{}_SIDChip[{}]",pszStationName,i);
82 pPhysMotherVol->add(new GeoNameTag(szLabel));
83 pPhysMotherVol->add(new GeoTransform(Amg::CLHEPTransformToEigen(TransInMotherVolume*m_pGeometry->getSIDTransform(ESTT_FEI4CHIP,pszStationName,i))));
84 pPhysMotherVol->add(pPhysElement);
85
86 // create SID sensor (pixel area)
87 szLabel = std::format("{}_LogSIDSensor[{}]",pszStationName,i);
88 pLogElement=new GeoLogVol(szLabel,pSolidSIDSensor,m_MapMaterials[std::string("Silicon")]);
89 pPhysElement=new GeoFullPhysVol(pLogElement);
90 szLabel = std::format("{}_SIDSensor[{}]",pszStationName,i);
91 pPhysMotherVol->add(new GeoNameTag(szLabel));
92 pPhysMotherVol->add(new GeoTransform(Amg::CLHEPTransformToEigen(TransInMotherVolume*m_pGeometry->getSIDTransform(ESTT_SENSOR,pszStationName,i))));
93 pPhysMotherVol->add(pPhysElement);
94
95 if(m_CfgParams.sidcfg[eStation].bAddVacuumSensors)
96 {
97 // create logic SID Vacuum Layer
98 szLabel = std::format("{}_LogSIDVacuumSensor[{}]",pszStationName,i);
99 GeoLogVol* pLogSIDVacuumSensor=new GeoLogVol(szLabel,pSolidSIDVacuumSensor,m_MapMaterials[std::string("std::Vacuum")]);
100 GeoFullPhysVol* pPhysSIDVacuumSensor=new GeoFullPhysVol(pLogSIDVacuumSensor);
101
102 szLabel = std::format("{}_SIDVacuumSensor[{}]",pszStationName,i);
103 pPhysMotherVol->add(new GeoNameTag(szLabel));
104 pPhysMotherVol->add(new GeoTransform(Amg::CLHEPTransformToEigen(m_pGeometry->getSIDTransform(ESTT_VACUUMSENSOR,pszStationName,i))));
105 pPhysMotherVol->add(pPhysSIDVacuumSensor);
106 }
107 }
108}
109
110
112{
113 MsgStream LogStream(Athena::getMessageSvc(), "AFP_GeoModelFactory::CreateSolidSIDPlate");
114
115 double fdelta=0.01*CLHEP::mm;//0.01*CLHEP::mm;
116
118
119 //cut side edges
122 double fgamma=45.0*CLHEP::deg-falpha; double fbeta=90.0*CLHEP::deg-falpha;
123
124 //--lower cut
125 HepGeom::Vector3D<double> vecL=(fd/std::sqrt(2.0))*(HepGeom::RotateZ3D(-fgamma)*HepGeom::Vector3D<double>(1.0,0.0,0.0));
126 HepGeom::Vector3D<double> vecB=AFP_CONSTANTS::SiT_Plate_CutEdge_length_x*HepGeom::Vector3D<double>(1.0,0.0,0.0);
127 HepGeom::Vector3D<double> vecX=vecL-vecB;
128 GeoBox* pPlateCut=new GeoBox(0.5*fd, 0.5*fd,0.5*(AFP_CONSTANTS::SiT_Plate_CutEdge_thickness+fdelta));
129 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);
130 GeoShapeShift* pShiftCut=new GeoShapeShift(pPlateCut, Amg::CLHEPTransformToEigen(TransCut));
131 GeoShapeSubtraction* pShape1=new GeoShapeSubtraction(pMainPlate, pShiftCut);
132
133 //--upper cut
134 vecL=(fd/std::sqrt(2.0))*(HepGeom::RotateZ3D(+fgamma)*HepGeom::Vector3D<double>(1.0,0.0,0.0));
135 vecX=vecL-vecB;
136 pPlateCut=new GeoBox(0.5*fd, 0.5*fd,0.5*(AFP_CONSTANTS::SiT_Plate_CutEdge_thickness+fdelta));
137 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);
138 pShiftCut=new GeoShapeShift(pPlateCut,Amg::CLHEPTransformToEigen(TransCut));
139 GeoShapeSubtraction* pShape2=new GeoShapeSubtraction(pShape1, pShiftCut);
140
141 //cut sensitive area
144 pShiftCut=new GeoShapeShift(pPlateCut,Amg::CLHEPTransformToEigen(TransCut));
145 GeoShapeSubtraction* pShape3=new GeoShapeSubtraction(pShape2, pShiftCut);
146
147 return pShape3;
148}
@ 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