10 #include "GeoModelKernel/GeoTransform.h"
11 #include "GeoModelKernel/GeoAlignableTransform.h"
12 #include "GeoModelKernel/GeoNameTag.h"
13 #include "GeoModelKernel/GeoBox.h"
14 #include "GaudiKernel/SystemOfUnits.h"
16 #include "Identifier/Identifier.h"
27 GeoModelIO::ReadGeoModel* sqliteReader,
28 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
29 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
33 double thickness = 0.5;
37 int cellRowPerCirc = 80;
38 int cellColPerCirc = 336;
39 int diodeRowPerCirc = 80;
40 int diodeColPerCirc = 336;
43 double etaPitchLongEnd = 0.05;
44 double etaPitchLong = 0.05;
45 double phiPitch = 0.25;
46 double etaPitch = 0.05;
48 std::shared_ptr<const PixelDiodeMatrix> fullMatrix =
makeMatrix(phiPitch, etaPitch, etaPitchLong, etaPitchLongEnd,
49 circuitsPhi, circuitsEta, diodeRowPerCirc, diodeColPerCirc);
51 std::unique_ptr<PixelModuleDesign> p_dbmdesign = std::make_unique<PixelModuleDesign>(thickness,
84 GeoIdentifierTag* diamondTag =
new GeoIdentifierTag(400);
136 double layerUnitPos_Y = (trapBackY/
cos(
angle) - coolingSidePlateY)*
cos(
angle);
137 double layerUnitPos_Z = coolingSidePlateY*
sin(
angle) + trapBackShortZ + bracketZ - brcktLockZ;
145 if(diamond ==
nullptr)
152 double max_thick = diamond_Z + air_gap + chip_thick + substrate_Z;
155 const GeoBox* dbmModuleBox =
new GeoBox(substrate_X/2.0 + safety, substrate_Y/2.0 + safety, max_thick/2.0 + safety);
156 const GeoLogVol* dbmModuleLog =
new GeoLogVol(
"dbmModuleLog", dbmModuleBox, air);
157 GeoPhysVol* dbmModulePhys =
new GeoPhysVol(dbmModuleLog);
162 const GeoBox* dbmDiamondBox =
new GeoBox(diamond_Z/2.0, diamond_X/2.0, diamond_Y/2.0 );
163 const GeoLogVol* dbmDiamondLog =
new GeoLogVol(
"dbmDiamondLog", dbmDiamondBox, diamond);
164 GeoFullPhysVol* dbmDiamondPhys =
new GeoFullPhysVol(dbmDiamondLog);
170 GeoTrf::Translation3D dbmDiamondPos(0, bot2Diamond+diamond_Y/2.0-substrate_Y/2.0, diamond_Z/2.0-max_thick/2.0);
173 dbmModulePhys->add(diamondTag);
174 dbmModulePhys->add(xform);
175 dbmModulePhys->add(dbmDiamondPhys);
178 const GeoBox* dbmFEI4Box =
new GeoBox(chip_thick/2.0, chip_X/2.0, chip_Y/2.0 );
179 const GeoLogVol* dbmFEI4Log =
new GeoLogVol(
"dbmWallLogF4", dbmFEI4Box, chip_mat);
180 GeoPhysVol* dbmFEI4Phys =
new GeoPhysVol(dbmFEI4Log);
182 GeoTrf::Translation3D dbmFEI4Pos(0, bot2Chip+chip_Y/2.0-substrate_Y/2.0, max_thick/2.0-substrate_Z-chip_thick/2.0);
185 dbmModulePhys->add(xform);
186 dbmModulePhys->add(dbmFEI4Phys);
189 const GeoBox* dbmSubstBox =
new GeoBox(substrate_X/2.0, substrate_Y/2.0, substrate_Z/2.0);
191 const GeoLogVol* dbmSubstLog =
new GeoLogVol(
"dbmWallLogCe", dbmSubstBox, aluminiumNitride);
192 GeoPhysVol* dbmSubstPhys =
new GeoPhysVol(dbmSubstLog);
194 GeoTrf::Translate3D dbmSubstPos(0, 0, max_thick/2.0-substrate_Z/2.0);
195 xform =
new GeoTransform(dbmSubstPos);
197 dbmModulePhys->add(xform);
198 dbmModulePhys->add(dbmSubstPhys);
208 double sensorPosInModuleCage_Z = layer1Space +
layer*Zspacing - (substrate_Z + chip_thick + air_gap + diamond_Z/2.);
209 double sensorPosInModuleCage_Y = Rspacing + bot2Diamond + diamond_Y/2.;
210 double globPosZ = ZToIP + layerUnitPos_Z + (sensorPosInModuleCage_Z *
cos(
angle) - sensorPosInModuleCage_Y *
sin(
angle));
211 double globPosY = RToBeam + layerUnitPos_Y + (sensorPosInModuleCage_Z *
sin(
angle) + sensorPosInModuleCage_Y *
cos(
angle));
215 GeoAlignableTransform *xformAlign =
new GeoAlignableTransform(
GeoTrf::Transform3D(alignTransformPos*rmX10));
219 return dbmModulePhys;
224 std::shared_ptr<const PixelDiodeMatrix>
DBM_Module::makeMatrix(
double phiPitch,
double etaPitch,
double etaPitchLong,
double etaPitchLongEnd,
225 int circuitsPhi,
int circuitsEta,
int diodeRowPerCirc,
int diodeColPerCirc)
240 std::shared_ptr<const PixelDiodeMatrix> fullMatrix =
nullptr;
242 if (etaPitchLongEnd == etaPitchLong && etaPitchLong != etaPitch) {
246 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
247 std::shared_ptr<const PixelDiodeMatrix> bigCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLong);
249 std::shared_ptr<const PixelDiodeMatrix> singleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
255 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
256 nullptr, singleChipRow, circuitsEta,
nullptr);
258 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
259 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);
260 }
else if (etaPitchLongEnd == etaPitchLong && (etaPitchLong == etaPitch || circuitsEta == 1)) {
263 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
264 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
265 nullptr, normalCell, circuitsEta*diodeColPerCirc,
nullptr);
266 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
267 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);
268 }
else if (etaPitchLongEnd == etaPitch && etaPitchLong != etaPitch && circuitsEta > 2) {
271 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
272 std::shared_ptr<const PixelDiodeMatrix> bigCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLong);
274 std::shared_ptr<const PixelDiodeMatrix> lowerSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
279 std::shared_ptr<const PixelDiodeMatrix> middleSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
284 std::shared_ptr<const PixelDiodeMatrix> upperSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
289 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
290 lowerSingleChipRow, middleSingleChipRow, circuitsEta-2, upperSingleChipRow);
291 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
292 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);
293 }
else if (etaPitchLongEnd == etaPitch && etaPitchLong != etaPitch && circuitsEta == 2) {
296 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
297 std::shared_ptr<const PixelDiodeMatrix> bigCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLong);
299 std::shared_ptr<const PixelDiodeMatrix> lowerSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
304 std::shared_ptr<const PixelDiodeMatrix> upperSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
309 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
310 lowerSingleChipRow, upperSingleChipRow, 1,
nullptr);
311 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
312 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);
313 }
else if (circuitsEta == 1 || (etaPitchLongEnd != etaPitch && etaPitchLong == etaPitch )){
317 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
318 std::shared_ptr<const PixelDiodeMatrix> bigCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLongEnd);
320 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
323 circuitsEta*diodeColPerCirc-2,
325 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
326 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);
330 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
331 std::shared_ptr<const PixelDiodeMatrix> bigCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLong);
332 std::shared_ptr<const PixelDiodeMatrix> endCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLongEnd);
334 std::shared_ptr<const PixelDiodeMatrix> lowerSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
339 std::shared_ptr<const PixelDiodeMatrix> middleSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
344 std::shared_ptr<const PixelDiodeMatrix> upperSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
349 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
350 lowerSingleChipRow, middleSingleChipRow, circuitsEta-2, upperSingleChipRow);
351 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
352 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);