ATLAS Offline Software
Loading...
Searching...
No Matches
PixelDetectorFactoryDC2.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7
8// Envelope, as a starting point of the geometry
9//#include "GeoPixelEnvelope.h"
10#include "PixelDetectorDC1DC2.h"
11#include "PixelSwitches.h"
12
13// GeoModel includes
14#include "GeoModelKernel/GeoNameTag.h"
15#include "GeoModelKernel/GeoPhysVol.h"
16#include "GeoModelKernel/GeoAlignableTransform.h"
17
18// InDetReadoutGeometry
22
24
26
29
30using namespace PixelGeoDC2;
31
32
34 const PixelSwitches & switches)
35 : InDetDD::DetectorFactoryBase(athenaComps),
36 m_detectorManager(nullptr)
37{
38 // Create the detector manager
40
41 // Create the geometry manager.
43
44 // Pass the switches
45 m_geometryManager->SetServices(switches.services());
46 m_geometryManager->SetG3CompatibleDigits(switches.g3CompatibleDigits());
47 m_geometryManager->SetDC1Geometry(switches.dc1Geometry());
48 m_geometryManager->SetAlignable(switches.alignable());
49 m_geometryManager->SetInitialLayout(switches.initialLayout());
50
51 // Create SiCommonItems ans store it in geometry manager.
52 // These are items that are shared by all elements
53 std::unique_ptr<SiCommonItems> commonItems{std::make_unique<SiCommonItems>(athenaComps->getIdHelper())};
54 m_geometryManager->setCommonItems(commonItems.get());
55
56 m_detectorManager->setCommonItems(std::move(commonItems));
57
58 bool initialLayoutIdDict = (m_detectorManager->tag() == "initial_layout");
59 if (m_geometryManager->InitialLayout() != initialLayoutIdDict ) {
60 if(msgLvl(MSG::WARNING))
61 msg(MSG::WARNING) << "IdDict tag is \"" << m_detectorManager->tag()
62 << "\" which is inconsistent with the layout choosen!"
63 << endmsg;
64 }
65
66
67 //
68 // Set Version information
69 //
70 std::string versionTag = m_geometryManager->versionTag();
71 std::string versionName = "DC2";
72 std::string layout = "Final";
73 std::string description = "DC2 Geometry";
74 int versionMajorNumber = 2;
75 int versionMinorNumber = 2;
76 int versionPatchNumber = 0;
77
78 if (m_geometryManager->G3CompatibleDigits()) {
79 description += ", G3 Compatible Digits";
80 versionMinorNumber = 1;
81 }
82
83 if (m_geometryManager->InitialLayout()) {
84 layout = "Initial";
85 }
86
87 // We determine if we are running DC1 geoemtry via
88 // Barrel version number in NOVA
89 if (m_geometryManager->DC1Geometry()) {
90 versionName = "DC1";
91 description = "DC1 Geometry (300um B-Layer pixels)";
92 versionMajorNumber = 1;
93 versionMinorNumber = 2;
94 if (m_geometryManager->G3CompatibleDigits()) {
95 description += ", G3 Compatible Digits";
96 versionMinorNumber = 1;
97 }
98 }
99
100 InDetDD::Version version(versionTag,
101 versionName,
102 layout,
104 versionMajorNumber,
105 versionMinorNumber,
106 versionPatchNumber);
107 m_detectorManager->setVersion(version);
108
109}
110
111
116
117
118
119//## Other Operations (implementation)
120void PixelDetectorFactoryDC2::create(GeoPhysVol *world)
121{
122 if(msgLvl(MSG::INFO)) {
123 msg(MSG::INFO) << "Building Pixel Detector" << endmsg;
124 msg(MSG::INFO) << " " << m_detectorManager->getVersion().fullDescription() << endmsg;
125
126 // Printout the parameters that are different in DC1 and DC2.
127 msg(MSG::INFO) << " B-Layer basic eta pitch: " << m_geometryManager->DesignPitchZ(true)/Gaudi::Units::micrometer << "um" << endmsg;
128 }
129 m_geometryManager->SetCurrentLD(0);
130 m_geometryManager->SetBarrel();
131 if(msgLvl(MSG::INFO))
132 msg(MSG::INFO) << " B-Layer sensor thickness: " << m_geometryManager->PixelBoardThickness()/Gaudi::Units::micrometer << "um" << endmsg;
133
134 //
135 // Create the Pixel Envelope...
137 GeoVPhysVol* pephys = pe.Build() ;
138 GeoAlignableTransform * transform = new GeoAlignableTransform(GeoTrf::Transform3D::Identity());
139
140 //
141 // Add this to the world
142 //
143 GeoNameTag *tag = new GeoNameTag("Pixel");
144 world->add(tag);
145 world->add(transform);
146 world->add(pephys);
147
148 // Store alignable transform
149 Identifier id = m_geometryManager->getIdHelper()->wafer_id(0,0,0,0);
150 m_detectorManager->addAlignableTransform(2, id, transform, pephys);
151
152 //
153 // Add this to the list of top level physical volumes:
154 //
155 m_detectorManager->addTreeTop(pephys);
156
157
158 // Initialize the neighbours
159 m_detectorManager->initNeighbours();
160
161 // Set maximum rows/columns in numerology
162 for (int iDesign = 0; iDesign < m_detectorManager->numDesigns(); iDesign++) {
163 m_detectorManager->numerology().setMaxNumPhiCells(m_detectorManager->getPixelDesign(iDesign)->rows());
164 m_detectorManager->numerology().setMaxNumEtaCells(m_detectorManager->getPixelDesign(iDesign)->columns());
165 }
166
167 // Register the callbacks and keys and the level corresponding to the key.
168 if (m_geometryManager->Alignable()) {
169 m_detectorManager->addFolder("/Indet/Align");
170 m_detectorManager->addChannel("/Indet/Align/ID", 2, InDetDD::global);
171 m_detectorManager->addChannel("/Indet/Align/PIX", 1, InDetDD::global);
172 m_detectorManager->addChannel("/Indet/Align/PIXB1", 0, InDetDD::local);
173 m_detectorManager->addChannel("/Indet/Align/PIXB2", 0, InDetDD::local);
174 m_detectorManager->addChannel("/Indet/Align/PIXB3", 0, InDetDD::local);
175 m_detectorManager->addChannel("/Indet/Align/PIXEA1", 0, InDetDD::local);
176 m_detectorManager->addChannel("/Indet/Align/PIXEA2", 0, InDetDD::local);
177 m_detectorManager->addChannel("/Indet/Align/PIXEA3", 0, InDetDD::local);
178 m_detectorManager->addChannel("/Indet/Align/PIXEC1", 0, InDetDD::local);
179 m_detectorManager->addChannel("/Indet/Align/PIXEC2", 0, InDetDD::local);
180 m_detectorManager->addChannel("/Indet/Align/PIXEC3", 0, InDetDD::local);
181 }
182}
183
188
#define endmsg
This is an Identifier helper class for the Pixel subdetector.
DetectorFactoryBase(InDetDD::AthenaComps *athenaComps)
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
Helper class to concentrate common items, such as the pointer to the IdHelper, the lorentzAngle tool ...
Class to hold version information consisting of tag, name layout and description as strings,...
Definition Version.h:24
PixelGeoDC2::PixelGeometryManager * m_geometryManager
virtual const InDetDD::PixelDetectorManager * getDetectorManager() const
virtual void create(GeoPhysVol *world)
PixelDetectorFactoryDC2(PixelGeoModelAthenaComps *athenaComps, const PixelSwitches &switches)
InDetDD::PixelDetectorManager * m_detectorManager
Class to hold various Athena components.
const PixelID * getIdHelper() const
bool g3CompatibleDigits() const
bool services() const
bool initialLayout() const
bool dc1Geometry() const
bool alignable() const
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:91
Message Stream Member.
MsgStream & msg
Definition testRead.cxx:32