82{
83 const PixelID * idHelper =
m_gmt_mgr->getIdHelper();
85 Identifier idwafer;
87
89 std::string
key =
"DBMDiamond_" + std::to_string(dbmdet) +
"_"+ std::to_string(
m_gmt_mgr->GetLD()) +
"_"+ std::to_string(
m_gmt_mgr->Phi()) +
"_"+ std::to_string(
m_gmt_mgr->Eta());
91
92 m_DDmgr->addDetectorElement(element);
94 return nullptr;
95 }
96 else {
97 GeoIdentifierTag* diamondTag = new GeoIdentifierTag(400);
98
99
100 double safety = 0.003*Gaudi::Units::mm;
101
102
103 double diamond_X =
m_gmt_mgr->DBMDiamondX();
104 double diamond_Y =
m_gmt_mgr->DBMDiamondY();
105 double diamond_Z =
m_gmt_mgr->DBMDiamondZ();
107
108
111 double chip_thick =
m_gmt_mgr->DBMFEI4Z();
112
113
114 double substrate_X =
m_gmt_mgr->DBMCeramicX();
115 double substrate_Y =
m_gmt_mgr->DBMCeramicY();
116 double substrate_Z =
m_gmt_mgr->DBMCeramicZ();
117
118
119
120 double bot2Chip = 0.0*Gaudi::Units::mm;
121 double bot2Diamond = 1.685*Gaudi::Units::mm;
122
123
124
125
126
127
128
129 double ZToIP = 887.002*Gaudi::Units::mm;
130 double RToBeam = 46.678*Gaudi::Units::mm;
131
132
133 double Zspacing =
m_gmt_mgr->DBMSpacingZ();
134 double Rspacing =
m_gmt_mgr->DBMSpacingRadial();
135
136 double layer1Space =
m_gmt_mgr->DBMSpace();
137
138
140 double bracketZ =
m_gmt_mgr->DBMBracketZ();
141 double trapBackY =
m_gmt_mgr->DBMTrapezBackY();
142 double trapBackShortZ =
m_gmt_mgr->DBMTrapezBackShortZ();
143 double coolingSidePlateY =
m_gmt_mgr->DBMCoolingSidePlateY();
144 double brcktLockZ =
m_gmt_mgr->DBMBrcktLockZ();
145
146
147
148
149 double layerUnitPos_Y = (trapBackY/
cos(
angle) - coolingSidePlateY)*
cos(
angle);
150 double layerUnitPos_Z = coolingSidePlateY*
sin(
angle) + trapBackShortZ + bracketZ - brcktLockZ;
151
152
153
154
155 const GeoMaterial* air =
m_mat_mgr->getMaterial(
"std::Air");
156
157 const GeoMaterial* diamond =
m_mat_mgr->getMaterial(
"pix::Diamond");
158 if(diamond == nullptr)
159 {
160 diamond =
m_mat_mgr->getMaterial(
"std::Carbon");
161 }
162
163 const GeoMaterial* chip_mat =
m_mat_mgr->getMaterial(
"pix::ChipBase");
164
165 double max_thick = diamond_Z + air_gap + chip_thick + substrate_Z;
166
167
168 const GeoBox* dbmModuleBox = new GeoBox(substrate_X/2.0 + safety, substrate_Y/2.0 + safety, max_thick/2.0 + safety);
169 const GeoLogVol* dbmModuleLog = new GeoLogVol("dbmModuleLog", dbmModuleBox, air);
170 GeoPhysVol* dbmModulePhys = new GeoPhysVol(dbmModuleLog);
171
172 GeoTrf::Transform3D rm = GeoTrf::RotateZ3D(90.*Gaudi::Units::deg)*GeoTrf::RotateY3D(270.*Gaudi::Units::deg);
173
174
175 const GeoBox* dbmDiamondBox = new GeoBox(diamond_Z/2.0, diamond_X/2.0, diamond_Y/2.0 );
176 const GeoLogVol* dbmDiamondLog = new GeoLogVol("dbmDiamondLog", dbmDiamondBox, diamond);
177 GeoFullPhysVol* dbmDiamondPhys = new GeoFullPhysVol(dbmDiamondLog);
178
179 SiDetectorElement* element=
new SiDetectorElement(idwafer,
m_design, dbmDiamondPhys,
m_gmt_mgr->commonItems());
180
181 m_DDmgr->addDetectorElement(element);
182
183 GeoTrf::Translation3D dbmDiamondPos(0, bot2Diamond+diamond_Y/2.0-substrate_Y/2.0, diamond_Z/2.0-max_thick/2.0);
184 GeoTransform* xform = new GeoTransform(GeoTrf::Transform3D(dbmDiamondPos*rm));
185
186 dbmModulePhys->add(diamondTag);
187 dbmModulePhys->add(xform);
188 dbmModulePhys->add(dbmDiamondPhys);
189
190
191 const GeoBox* dbmFEI4Box = new GeoBox(chip_thick/2.0, chip_X/2.0, chip_Y/2.0 );
192 const GeoLogVol* dbmFEI4Log = new GeoLogVol("dbmWallLogF4", dbmFEI4Box, chip_mat);
193 GeoPhysVol* dbmFEI4Phys = new GeoPhysVol(dbmFEI4Log);
194
195 GeoTrf::Translation3D dbmFEI4Pos(0, bot2Chip+chip_Y/2.0-substrate_Y/2.0, max_thick/2.0-substrate_Z-chip_thick/2.0);
196 xform = new GeoTransform(GeoTrf::Transform3D(dbmFEI4Pos*rm));
197
198 dbmModulePhys->add(xform);
199 dbmModulePhys->add(dbmFEI4Phys);
200
201
202 const GeoBox* dbmSubstBox = new GeoBox(substrate_X/2.0, substrate_Y/2.0, substrate_Z/2.0);
203 const GeoMaterial* aluminiumNitride =
m_mat_mgr->getMaterialForVolume(
"pix::DBMCeramic", dbmSubstBox->volume());
204 const GeoLogVol* dbmSubstLog = new GeoLogVol("dbmWallLogCe", dbmSubstBox, aluminiumNitride);
205 GeoPhysVol* dbmSubstPhys = new GeoPhysVol(dbmSubstLog);
206
207 GeoTrf::Translate3D dbmSubstPos(0, 0, max_thick/2.0-substrate_Z/2.0);
208 xform = new GeoTransform(dbmSubstPos);
209
210 dbmModulePhys->add(xform);
211 dbmModulePhys->add(dbmSubstPhys);
212
213
214
215
216
217
218
219
221 double sensorPosInModuleCage_Z = layer1Space +
layer*Zspacing - (substrate_Z + chip_thick + air_gap + diamond_Z/2.);
222 double sensorPosInModuleCage_Y = Rspacing + bot2Diamond + diamond_Y/2.;
223 double globPosZ = ZToIP + layerUnitPos_Z + (sensorPosInModuleCage_Z *
cos(
angle) - sensorPosInModuleCage_Y *
sin(
angle));
224 double globPosY = RToBeam + layerUnitPos_Y + (sensorPosInModuleCage_Z *
sin(
angle) + sensorPosInModuleCage_Y *
cos(
angle));
225
226 GeoTrf::RotateX3D rmX10(-10.*Gaudi::Units::deg);
227 GeoTrf::Translation3D alignTransformPos(0, globPosY, globPosZ);
228 GeoAlignableTransform *xformAlign = new GeoAlignableTransform(GeoTrf::Transform3D(alignTransformPos*rmX10));
229 m_DDmgr->addAlignableTransform(0, idwafer, xformAlign, dbmDiamondPhys);
230
231
232 return dbmModulePhys;
233 }
234}
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
GeoModelIO::ReadGeoModel * m_sqliteReader
InDetMaterialManager * m_mat_mgr
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.