8 #include "GeoModelKernel/GeoTransform.h"
9 #include "GeoModelKernel/GeoAlignableTransform.h"
10 #include "GeoModelKernel/GeoNameTag.h"
11 #include "GeoModelKernel/GeoBox.h"
12 #include "GaudiKernel/SystemOfUnits.h"
14 #include "Identifier/Identifier.h"
25 GeoModelIO::ReadGeoModel* sqliteReader,
26 std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
27 std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX)
31 double thickness = 0.5;
35 int cellRowPerCirc = 80;
36 int cellColPerCirc = 336;
37 int diodeRowPerCirc = 80;
38 int diodeColPerCirc = 336;
41 double etaPitchLongEnd = 0.05;
42 double etaPitchLong = 0.05;
43 double phiPitch = 0.25;
44 double etaPitch = 0.05;
46 std::shared_ptr<const PixelDiodeMatrix> fullMatrix =
makeMatrix(phiPitch, etaPitch, etaPitchLong, etaPitchLongEnd,
47 circuitsPhi, circuitsEta, diodeRowPerCirc, diodeColPerCirc);
49 std::unique_ptr<PixelModuleDesign> p_dbmdesign = std::make_unique<PixelModuleDesign>(thickness,
82 GeoIdentifierTag* diamondTag =
new GeoIdentifierTag(400);
134 double layerUnitPos_Y = (trapBackY/
cos(
angle) - coolingSidePlateY)*
cos(
angle);
135 double layerUnitPos_Z = coolingSidePlateY*
sin(
angle) + trapBackShortZ + bracketZ - brcktLockZ;
143 if(diamond ==
nullptr)
150 double max_thick = diamond_Z + air_gap + chip_thick + substrate_Z;
153 const GeoBox* dbmModuleBox =
new GeoBox(substrate_X/2.0 + safety, substrate_Y/2.0 + safety, max_thick/2.0 + safety);
154 const GeoLogVol* dbmModuleLog =
new GeoLogVol(
"dbmModuleLog", dbmModuleBox, air);
155 GeoPhysVol* dbmModulePhys =
new GeoPhysVol(dbmModuleLog);
160 const GeoBox* dbmDiamondBox =
new GeoBox(diamond_Z/2.0, diamond_X/2.0, diamond_Y/2.0 );
161 const GeoLogVol* dbmDiamondLog =
new GeoLogVol(
"dbmDiamondLog", dbmDiamondBox, diamond);
162 GeoFullPhysVol* dbmDiamondPhys =
new GeoFullPhysVol(dbmDiamondLog);
168 GeoTrf::Translation3D dbmDiamondPos(0, bot2Diamond+diamond_Y/2.0-substrate_Y/2.0, diamond_Z/2.0-max_thick/2.0);
171 dbmModulePhys->add(diamondTag);
172 dbmModulePhys->add(xform);
173 dbmModulePhys->add(dbmDiamondPhys);
176 const GeoBox* dbmFEI4Box =
new GeoBox(chip_thick/2.0, chip_X/2.0, chip_Y/2.0 );
177 const GeoLogVol* dbmFEI4Log =
new GeoLogVol(
"dbmWallLogF4", dbmFEI4Box, chip_mat);
178 GeoPhysVol* dbmFEI4Phys =
new GeoPhysVol(dbmFEI4Log);
180 GeoTrf::Translation3D dbmFEI4Pos(0, bot2Chip+chip_Y/2.0-substrate_Y/2.0, max_thick/2.0-substrate_Z-chip_thick/2.0);
183 dbmModulePhys->add(xform);
184 dbmModulePhys->add(dbmFEI4Phys);
187 const GeoBox* dbmSubstBox =
new GeoBox(substrate_X/2.0, substrate_Y/2.0, substrate_Z/2.0);
189 const GeoLogVol* dbmSubstLog =
new GeoLogVol(
"dbmWallLogCe", dbmSubstBox, aluminiumNitride);
190 GeoPhysVol* dbmSubstPhys =
new GeoPhysVol(dbmSubstLog);
192 GeoTrf::Translate3D dbmSubstPos(0, 0, max_thick/2.0-substrate_Z/2.0);
193 xform =
new GeoTransform(dbmSubstPos);
195 dbmModulePhys->add(xform);
196 dbmModulePhys->add(dbmSubstPhys);
206 double sensorPosInModuleCage_Z = layer1Space +
layer*Zspacing - (substrate_Z + chip_thick + air_gap + diamond_Z/2.);
207 double sensorPosInModuleCage_Y = Rspacing + bot2Diamond + diamond_Y/2.;
208 double globPosZ = ZToIP + layerUnitPos_Z + (sensorPosInModuleCage_Z *
cos(
angle) - sensorPosInModuleCage_Y *
sin(
angle));
209 double globPosY = RToBeam + layerUnitPos_Y + (sensorPosInModuleCage_Z *
sin(
angle) + sensorPosInModuleCage_Y *
cos(
angle));
213 GeoAlignableTransform *xformAlign =
new GeoAlignableTransform(
GeoTrf::Transform3D(alignTransformPos*rmX10));
217 return dbmModulePhys;
222 std::shared_ptr<const PixelDiodeMatrix>
DBM_Module::makeMatrix(
double phiPitch,
double etaPitch,
double etaPitchLong,
double etaPitchLongEnd,
223 int circuitsPhi,
int circuitsEta,
int diodeRowPerCirc,
int diodeColPerCirc)
238 std::shared_ptr<const PixelDiodeMatrix> fullMatrix =
nullptr;
240 if (etaPitchLongEnd == etaPitchLong && etaPitchLong != etaPitch) {
244 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
245 std::shared_ptr<const PixelDiodeMatrix> bigCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLong);
247 std::shared_ptr<const PixelDiodeMatrix> singleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
253 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
254 nullptr, singleChipRow, circuitsEta,
nullptr);
256 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
257 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);
258 }
else if (etaPitchLongEnd == etaPitchLong && (etaPitchLong == etaPitch || circuitsEta == 1)) {
261 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
262 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
263 nullptr, normalCell, circuitsEta*diodeColPerCirc,
nullptr);
264 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
265 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);
266 }
else if (etaPitchLongEnd == etaPitch && etaPitchLong != etaPitch && circuitsEta > 2) {
269 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
270 std::shared_ptr<const PixelDiodeMatrix> bigCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLong);
272 std::shared_ptr<const PixelDiodeMatrix> lowerSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
277 std::shared_ptr<const PixelDiodeMatrix> middleSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
282 std::shared_ptr<const PixelDiodeMatrix> upperSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
287 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
288 lowerSingleChipRow, middleSingleChipRow, circuitsEta-2, upperSingleChipRow);
289 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
290 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);
291 }
else if (etaPitchLongEnd == etaPitch && etaPitchLong != etaPitch && circuitsEta == 2) {
294 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
295 std::shared_ptr<const PixelDiodeMatrix> bigCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLong);
297 std::shared_ptr<const PixelDiodeMatrix> lowerSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
302 std::shared_ptr<const PixelDiodeMatrix> upperSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
307 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
308 lowerSingleChipRow, upperSingleChipRow, 1,
nullptr);
309 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
310 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);
311 }
else if (circuitsEta == 1 || (etaPitchLongEnd != etaPitch && etaPitchLong == etaPitch )){
315 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
316 std::shared_ptr<const PixelDiodeMatrix> bigCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLongEnd);
318 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
321 circuitsEta*diodeColPerCirc-2,
323 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
324 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);
328 std::shared_ptr<const PixelDiodeMatrix> normalCell = PixelDiodeMatrix::construct(phiPitch, etaPitch);
329 std::shared_ptr<const PixelDiodeMatrix> bigCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLong);
330 std::shared_ptr<const PixelDiodeMatrix> endCell = PixelDiodeMatrix::construct(phiPitch, etaPitchLongEnd);
332 std::shared_ptr<const PixelDiodeMatrix> lowerSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
337 std::shared_ptr<const PixelDiodeMatrix> middleSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
342 std::shared_ptr<const PixelDiodeMatrix> upperSingleChipRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
347 std::shared_ptr<const PixelDiodeMatrix> singleRow = PixelDiodeMatrix::construct(PixelDiodeMatrix::etaDir,
348 lowerSingleChipRow, middleSingleChipRow, circuitsEta-2, upperSingleChipRow);
349 fullMatrix = PixelDiodeMatrix::construct(PixelDiodeMatrix::phiDir,
350 nullptr, singleRow, circuitsPhi*diodeRowPerCirc,
nullptr);