diff --git a/compact/definitions.xml b/compact/definitions.xml
index 2bee4296f..5b3eac10f 100644
--- a/compact/definitions.xml
+++ b/compact/definitions.xml
@@ -590,7 +590,7 @@ Service gaps in FW direction (before endcapP ECAL) and BW direction (before endc
LFHCAL is 140 cm total, but current implementation leaves the final 10 cm empty
-
+
diff --git a/compact/hcal/lfhcal.xml b/compact/hcal/lfhcal.xml
index 3a903e6c7..8e794258e 100644
--- a/compact/hcal/lfhcal.xml
+++ b/compact/hcal/lfhcal.xml
@@ -22,30 +22,32 @@
FIXME: Need actual values once they are decided upon
+
-
+
+
-
+
-
+
-
-
+
+
-
-
+
+
@@ -108,6 +110,7 @@
heightBackInner="EightM_BackInnerHeight"
widthSideWall="Mod_SideWallThickness"
widthTopWall="Mod_TopWallThickness"
+ thicknessMountingPlate="Mod_MountingPlateThickness"
thicknessFrontWall="Mod_FrontWallThickness"
thicknessBackWall="Mod_BackWallThickness"
arrayX="EightM_xArr"
@@ -129,6 +132,7 @@
heightBackInner="FourM_BackInnerHeight"
widthSideWall="Mod_SideWallThickness"
widthTopWall="Mod_TopWallThickness"
+ thicknessMountingPlate="Mod_MountingPlateThickness"
thicknessFrontWall="Mod_FrontWallThickness"
thicknessBackWall="Mod_BackWallThickness"
arrayX="FourM_xArr"
@@ -142,1234 +146,1192 @@
/>
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
### for testing of a single module
-
+
+
+ -->
+
### positions of modules for full area LFHCAL (sorted by ascending r, x, y)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/configurations/lfhcal_with_insert.yml b/configurations/lfhcal_with_insert.yml
index 73095abb5..2c166dbdc 100644
--- a/configurations/lfhcal_with_insert.yml
+++ b/configurations/lfhcal_with_insert.yml
@@ -4,3 +4,4 @@ features:
hcal:
lfhcal_with_space_for_insert:
forward_insert:
+ forward_endcap_flux:
diff --git a/src/LFHCAL_geo.cpp b/src/LFHCAL_geo.cpp
index d705263da..80cc6c38f 100644
--- a/src/LFHCAL_geo.cpp
+++ b/src/LFHCAL_geo.cpp
@@ -23,6 +23,7 @@ struct moduleParamsStrct {
, mod_BIheight(0.)
, mod_SWThick(0.)
, mod_TWThick(0.)
+ , mod_MPThick(0.)
, mod_FWThick(0.)
, mod_BWThick(0.)
, mod_width(0.)
@@ -36,14 +37,15 @@ struct moduleParamsStrct {
, mod_visStr("")
, mod_regStr("")
, mod_limStr("") {}
- moduleParamsStrct(double BIwidth, double BIheight, double SWThick, double TWThick, double FWThick,
- double BWThick, double width, double height, double notchDepth,
+ moduleParamsStrct(double BIwidth, double BIheight, double SWThick, double TWThick, double MPThick,
+ double FWThick, double BWThick, double width, double height, double notchDepth,
double notchHeight, double foilThick, double pcbLegth, double pcbThick,
double pcbWidth, std::string visStr, std::string regStr, std::string limStr) {
mod_BIwidth = BIwidth;
mod_BIheight = BIheight;
mod_SWThick = SWThick;
mod_TWThick = TWThick;
+ mod_MPThick = MPThick;
mod_FWThick = FWThick;
mod_BWThick = BWThick;
mod_width = width;
@@ -62,6 +64,7 @@ struct moduleParamsStrct {
double mod_BIheight = 0.;
double mod_SWThick = 0.;
double mod_TWThick = 0.;
+ double mod_MPThick = 0.;
double mod_FWThick = 0.;
double mod_BWThick = 0.;
double mod_width = 0.;
@@ -478,18 +481,22 @@ Volume createEightMModule(Detector& desc, moduleParamsStrct mod_params,
// Casing definition
// ********************************************************************************
// geom definition 8M module casing
+ Box MountingPlate(mod_params.mod_width / 2., mod_params.mod_height / 2.,
+ mod_params.mod_MPThick / 2.);
Box modFrontPlate(mod_params.mod_width / 2., mod_params.mod_height / 2.,
mod_params.mod_FWThick / 2.);
- Box modSidePlateL(mod_params.mod_SWThick / 2., mod_params.mod_height / 2.,
- (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
- Box modSidePlateR(mod_params.mod_SWThick / 2., mod_params.mod_height / 2.,
- (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
- Box modTopPlate((mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2.,
- mod_params.mod_TWThick / 2.,
- (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
- Box modBottomPlate((mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2.,
- mod_params.mod_TWThick / 2.,
- (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
+ Box modSidePlateL(
+ mod_params.mod_SWThick / 2., mod_params.mod_height / 2.,
+ (length - mod_params.mod_MPThick - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
+ Box modSidePlateR(
+ mod_params.mod_SWThick / 2., mod_params.mod_height / 2.,
+ (length - mod_params.mod_MPThick - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
+ Box modTopPlate(
+ (mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2., mod_params.mod_TWThick / 2.,
+ (length - mod_params.mod_MPThick - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
+ Box modBottomPlate(
+ (mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2., mod_params.mod_TWThick / 2.,
+ (length - mod_params.mod_MPThick - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
Box modBackCutOut(mod_params.mod_BIwidth / 2., mod_params.mod_BIheight / 2.,
mod_params.mod_BWThick / 2.);
Box modBackPlateFull(mod_params.mod_width / 2., mod_params.mod_height / 2.,
@@ -497,6 +504,7 @@ Volume createEightMModule(Detector& desc, moduleParamsStrct mod_params,
SubtractionSolid modBackPlate(modBackPlateFull, modBackCutOut);
// volume definition 8M module casing
+ Volume vol_mountingPlate(baseName + "_MountingPlate", MountingPlate, desc.material("Steel235"));
Volume vol_modFrontPlate(baseName + "_FrontPlate", modFrontPlate, desc.material("Steel235"));
Volume vol_modBackPlate(baseName + "_BackPlate", modBackPlate, desc.material("Steel235"));
Volume vol_modSidePlateL(baseName + "_LeftSidePlate", modSidePlateL, desc.material("Steel235"));
@@ -506,6 +514,7 @@ Volume createEightMModule(Detector& desc, moduleParamsStrct mod_params,
if (allSen) {
sens.setType("calorimeter");
+ vol_mountingPlate.setSensitiveDetector(sens);
vol_modFrontPlate.setSensitiveDetector(sens);
vol_modBackPlate.setSensitiveDetector(sens);
vol_modSidePlateL.setSensitiveDetector(sens);
@@ -515,19 +524,28 @@ Volume createEightMModule(Detector& desc, moduleParamsStrct mod_params,
}
if (renderComp) {
+ vol_mountingPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
+ // mod_params.mod_visStr);
+ "LFHCALLayerTungstenVis");
vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
- mod_params.mod_visStr);
+ // mod_params.mod_visStr);
+ "LFHCALLayerSteelVis");
vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
- mod_params.mod_visStr);
+ // mod_params.mod_visStr);
+ "LFHCALLayerSteelVis");
vol_modSidePlateL.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
mod_params.mod_visStr);
vol_modSidePlateR.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
mod_params.mod_visStr);
vol_modTopPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
- mod_params.mod_visStr);
+ // mod_params.mod_visStr);
+ "LFHCALLayerSteelVis");
vol_modBottomPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
- mod_params.mod_visStr);
+ // mod_params.mod_visStr);
+ "LFHCALLayerSteelVis");
} else {
+ vol_mountingPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
+ "InvisibleNoDaughters");
vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
"InvisibleNoDaughters");
vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
@@ -556,7 +574,8 @@ Volume createEightMModule(Detector& desc, moduleParamsStrct mod_params,
}
int layer_num = 0;
- double slice_z = -length / 2 + mod_params.mod_FWThick; // Keeps track of layers' local z locations
+ double slice_z = -length / 2 + mod_params.mod_MPThick +
+ mod_params.mod_FWThick; // Keeps track of layers' local z locations
// Looping through the number of repeated layers & slices in each section
for (int i = 0; i < (int)sl_params.size(); i++) {
slice_z += sl_params[i].slice_offset +
@@ -628,8 +647,11 @@ Volume createEightMModule(Detector& desc, moduleParamsStrct mod_params,
}
// placement 8M module casing
- pvm = vol_mod.placeVolume(vol_modFrontPlate,
- Position(0, 0, -(length - mod_params.mod_FWThick) / 2.));
+ pvm = vol_mod.placeVolume(vol_mountingPlate,
+ Position(0, 0, -(length - mod_params.mod_MPThick) / 2.));
+ pvm = vol_mod.placeVolume(
+ vol_modFrontPlate,
+ Position(0, 0, -(length - mod_params.mod_FWThick) / 2. + mod_params.mod_MPThick));
if (allSen)
pvm.addPhysVolID("towerx", 2)
.addPhysVolID("towery", 0)
@@ -642,42 +664,48 @@ Volume createEightMModule(Detector& desc, moduleParamsStrct mod_params,
.addPhysVolID("towery", 0)
.addPhysVolID("layerz", layer_num)
.addPhysVolID("passive", 1);
- pvm = vol_mod.placeVolume(vol_modSidePlateL,
- Position(-(mod_params.mod_width - mod_params.mod_SWThick) / 2., 0,
- (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2));
+ pvm = vol_mod.placeVolume(
+ vol_modSidePlateL,
+ Position(-(mod_params.mod_width - mod_params.mod_SWThick) / 2., 0,
+ (mod_params.mod_FWThick + mod_params.mod_MPThick - mod_params.mod_BWThick) / 2));
if (allSen)
pvm.addPhysVolID("towerx", 3)
.addPhysVolID("towery", 0)
.addPhysVolID("layerz", 0)
.addPhysVolID("passive", 1);
- pvm = vol_mod.placeVolume(vol_modSidePlateR,
- Position((mod_params.mod_width - mod_params.mod_SWThick) / 2., 0,
- (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2));
+ pvm = vol_mod.placeVolume(
+ vol_modSidePlateR,
+ Position((mod_params.mod_width - mod_params.mod_SWThick) / 2., 0,
+ (mod_params.mod_FWThick + mod_params.mod_MPThick - mod_params.mod_BWThick) / 2));
if (allSen)
pvm.addPhysVolID("towerx", 0)
.addPhysVolID("towery", 1)
.addPhysVolID("layerz", 0)
.addPhysVolID("passive", 1);
- pvm = vol_mod.placeVolume(vol_modTopPlate,
- Position(0, (mod_params.mod_height - mod_params.mod_TWThick) / 2.,
- (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2));
+ pvm = vol_mod.placeVolume(
+ vol_modTopPlate,
+ Position(0, (mod_params.mod_height - mod_params.mod_TWThick) / 2.,
+ (mod_params.mod_FWThick + mod_params.mod_MPThick - mod_params.mod_BWThick) / 2));
if (allSen)
pvm.addPhysVolID("towerx", 1)
.addPhysVolID("towery", 1)
.addPhysVolID("layerz", 0)
.addPhysVolID("passive", 1);
- pvm = vol_mod.placeVolume(vol_modBottomPlate,
- Position(0, -(mod_params.mod_height - mod_params.mod_TWThick) / 2.,
- (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2));
+ pvm = vol_mod.placeVolume(
+ vol_modBottomPlate,
+ Position(0, -(mod_params.mod_height - mod_params.mod_TWThick) / 2.,
+ (mod_params.mod_FWThick + mod_params.mod_MPThick - mod_params.mod_BWThick) / 2));
if (allSen)
pvm.addPhysVolID("towerx", 2)
.addPhysVolID("towery", 1)
.addPhysVolID("layerz", 0)
.addPhysVolID("passive", 1);
- double lengthA = length - mod_params.mod_FWThick - mod_params.mod_BWThick;
- double z_offSetPCB = (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2 -
- (lengthA - mod_params.mod_pcbLength) / 2.;
+ double lengthA =
+ length - mod_params.mod_FWThick - mod_params.mod_MPThick + mod_params.mod_BWThick / 2;
+ double z_offSetPCB =
+ (mod_params.mod_FWThick + mod_params.mod_MPThick + mod_params.mod_BWThick) / 2 -
+ (lengthA - mod_params.mod_pcbLength) / 2.;
pvm = vol_mod.placeVolume(
vol_modPCB,
@@ -710,18 +738,22 @@ Volume createFourMModule(Detector& desc, moduleParamsStrct mod_params,
// Casing definition
// ********************************************************************************
// geom definition 8M module casing
+ Box MountingPlate(mod_params.mod_width / 2., mod_params.mod_height / 2.,
+ mod_params.mod_MPThick / 2.);
Box modFrontPlate(mod_params.mod_width / 2., mod_params.mod_height / 2.,
mod_params.mod_FWThick / 2.);
- Box modSidePlateL(mod_params.mod_SWThick / 2., mod_params.mod_height / 2.,
- (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
- Box modSidePlateR(mod_params.mod_SWThick / 2., mod_params.mod_height / 2.,
- (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
- Box modTopPlate((mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2.,
- mod_params.mod_TWThick / 2.,
- (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
- Box modBottomPlate((mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2.,
- mod_params.mod_TWThick / 2.,
- (length - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
+ Box modSidePlateL(
+ mod_params.mod_SWThick / 2., mod_params.mod_height / 2.,
+ (length - mod_params.mod_MPThick - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
+ Box modSidePlateR(
+ mod_params.mod_SWThick / 2., mod_params.mod_height / 2.,
+ (length - mod_params.mod_MPThick - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
+ Box modTopPlate(
+ (mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2., mod_params.mod_TWThick / 2.,
+ (length - mod_params.mod_MPThick - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
+ Box modBottomPlate(
+ (mod_params.mod_width - 2 * mod_params.mod_SWThick) / 2., mod_params.mod_TWThick / 2.,
+ (length - mod_params.mod_MPThick - mod_params.mod_FWThick - mod_params.mod_BWThick) / 2.);
Box modBackCutOut(mod_params.mod_BIwidth / 2., mod_params.mod_BIheight / 2.,
mod_params.mod_BWThick / 2.);
Box modBackPlateFull(mod_params.mod_width / 2., mod_params.mod_height / 2.,
@@ -729,6 +761,7 @@ Volume createFourMModule(Detector& desc, moduleParamsStrct mod_params,
SubtractionSolid modBackPlate(modBackPlateFull, modBackCutOut);
// volume definition 8M module casing
+ Volume vol_mountingPlate(baseName + "_MountingPlate", MountingPlate, desc.material("Steel235"));
Volume vol_modFrontPlate(baseName + "_FrontPlate", modFrontPlate, desc.material("Steel235"));
Volume vol_modBackPlate(baseName + "_BackPlate", modBackPlate, desc.material("Steel235"));
Volume vol_modSidePlateL(baseName + "_LeftSidePlate", modSidePlateL, desc.material("Steel235"));
@@ -738,6 +771,7 @@ Volume createFourMModule(Detector& desc, moduleParamsStrct mod_params,
if (allSen) {
sens.setType("calorimeter");
+ vol_mountingPlate.setSensitiveDetector(sens);
vol_modFrontPlate.setSensitiveDetector(sens);
vol_modBackPlate.setSensitiveDetector(sens);
vol_modSidePlateL.setSensitiveDetector(sens);
@@ -747,19 +781,28 @@ Volume createFourMModule(Detector& desc, moduleParamsStrct mod_params,
}
if (renderComp) {
+ vol_mountingPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
+ // mod_params.mod_visStr);
+ "LFHCALLayerTungstenVis");
vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
- mod_params.mod_visStr);
+ // mod_params.mod_visStr);
+ "LFHCALLayerSteelVis");
vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
- mod_params.mod_visStr);
+ // mod_params.mod_visStr);
+ "LFHCALLayerSteelVis");
vol_modSidePlateL.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
mod_params.mod_visStr);
vol_modSidePlateR.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
mod_params.mod_visStr);
vol_modTopPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
- mod_params.mod_visStr);
+ // mod_params.mod_visStr);
+ "LFHCALLayerSteelVis");
vol_modBottomPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
- mod_params.mod_visStr);
+ // mod_params.mod_visStr);
+ "LFHCALLayerSteelVis");
} else {
+ vol_mountingPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
+ "InvisibleNoDaughters");
vol_modFrontPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
"InvisibleNoDaughters");
vol_modBackPlate.setAttributes(desc, mod_params.mod_regStr, mod_params.mod_limStr,
@@ -788,7 +831,8 @@ Volume createFourMModule(Detector& desc, moduleParamsStrct mod_params,
}
int layer_num = 0;
- double slice_z = -length / 2 + mod_params.mod_FWThick; // Keeps track of layers' local z locations
+ double slice_z = -length / 2 + mod_params.mod_MPThick +
+ mod_params.mod_FWThick; // Keeps track of layers' local z locations
// Looping through the number of repeated layers & slices in each section
for (int i = 0; i < (int)sl_params.size(); i++) {
@@ -861,8 +905,11 @@ Volume createFourMModule(Detector& desc, moduleParamsStrct mod_params,
}
// placement 4M module casing
- pvm = vol_mod.placeVolume(vol_modFrontPlate,
- Position(0, 0, -(length - mod_params.mod_FWThick) / 2.));
+ pvm = vol_mod.placeVolume(vol_mountingPlate,
+ Position(0, 0, -(length - mod_params.mod_MPThick) / 2.));
+ pvm = vol_mod.placeVolume(
+ vol_modFrontPlate,
+ Position(0, 0, -(length - mod_params.mod_FWThick) / 2. + mod_params.mod_MPThick));
if (allSen)
pvm.addPhysVolID("towerx", 2)
.addPhysVolID("towery", 0)
@@ -875,42 +922,48 @@ Volume createFourMModule(Detector& desc, moduleParamsStrct mod_params,
.addPhysVolID("towery", 0)
.addPhysVolID("layerz", layer_num)
.addPhysVolID("passive", 1);
- pvm = vol_mod.placeVolume(vol_modSidePlateL,
- Position(-(mod_params.mod_width - mod_params.mod_SWThick) / 2., 0,
- (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2));
+ pvm = vol_mod.placeVolume(
+ vol_modSidePlateL,
+ Position(-(mod_params.mod_width - mod_params.mod_SWThick) / 2., 0,
+ (mod_params.mod_FWThick + mod_params.mod_MPThick - mod_params.mod_BWThick) / 2));
if (allSen)
pvm.addPhysVolID("towerx", 3)
.addPhysVolID("towery", 0)
.addPhysVolID("layerz", 0)
.addPhysVolID("passive", 1);
- pvm = vol_mod.placeVolume(vol_modSidePlateR,
- Position((mod_params.mod_width - mod_params.mod_SWThick) / 2., 0,
- (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2));
+ pvm = vol_mod.placeVolume(
+ vol_modSidePlateR,
+ Position((mod_params.mod_width - mod_params.mod_SWThick) / 2., 0,
+ (mod_params.mod_FWThick + mod_params.mod_MPThick - mod_params.mod_BWThick) / 2));
if (allSen)
pvm.addPhysVolID("towerx", 0)
.addPhysVolID("towery", 1)
.addPhysVolID("layerz", 0)
.addPhysVolID("passive", 1);
- pvm = vol_mod.placeVolume(vol_modTopPlate,
- Position(0, (mod_params.mod_height - mod_params.mod_TWThick) / 2.,
- (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2));
+ pvm = vol_mod.placeVolume(
+ vol_modTopPlate,
+ Position(0, (mod_params.mod_height - mod_params.mod_TWThick) / 2.,
+ (mod_params.mod_FWThick + mod_params.mod_MPThick - mod_params.mod_BWThick) / 2));
if (allSen)
pvm.addPhysVolID("towerx", 1)
.addPhysVolID("towery", 1)
.addPhysVolID("layerz", 0)
.addPhysVolID("passive", 1);
- pvm = vol_mod.placeVolume(vol_modBottomPlate,
- Position(0, -(mod_params.mod_height - mod_params.mod_TWThick) / 2.,
- (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2));
+ pvm = vol_mod.placeVolume(
+ vol_modBottomPlate,
+ Position(0, -(mod_params.mod_height - mod_params.mod_TWThick) / 2.,
+ (mod_params.mod_FWThick + mod_params.mod_MPThick - mod_params.mod_BWThick) / 2));
if (allSen)
pvm.addPhysVolID("towerx", 2)
.addPhysVolID("towery", 1)
.addPhysVolID("layerz", 0)
.addPhysVolID("passive", 1);
- double lengthA = length - mod_params.mod_FWThick - mod_params.mod_BWThick;
- double z_offSetPCB = (mod_params.mod_FWThick - mod_params.mod_BWThick) / 2 -
- (lengthA - mod_params.mod_pcbLength) / 2.;
+ double lengthA =
+ length - mod_params.mod_FWThick - mod_params.mod_MPThick + mod_params.mod_BWThick / 2;
+ double z_offSetPCB =
+ (mod_params.mod_FWThick + mod_params.mod_MPThick + mod_params.mod_BWThick) / 2 -
+ (lengthA - mod_params.mod_pcbLength) / 2.;
pvm = vol_mod.placeVolume(
vol_modPCB,
@@ -960,41 +1013,44 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
// 8M module specific loading
xml_comp_t eightM_xml = detElem.child(_Unicode(eightmodule));
xml_dim_t eightMmod_dim = eightM_xml.dimensions();
- moduleParamsStrct eightM_params(getAttrOrDefault(eightMmod_dim, _Unicode(widthBackInner), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(heightBackInner), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(widthSideWall), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(widthTopWall), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(thicknessFrontWall), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(thicknessBackWall), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(width), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(height), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(notchDepth), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(notchHeight), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(foilThick), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(pcbLength), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(pcbThick), 0.),
- getAttrOrDefault(eightMmod_dim, _Unicode(pcbWidth), 0.),
- eightM_xml.visStr(), eightM_xml.regionStr(),
- eightM_xml.limitsStr());
+ moduleParamsStrct eightM_params(
+ getAttrOrDefault(eightMmod_dim, _Unicode(widthBackInner), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(heightBackInner), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(widthSideWall), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(widthTopWall), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(thicknessMountingPlate), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(thicknessFrontWall), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(thicknessBackWall), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(width), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(height), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(notchDepth), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(notchHeight), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(foilThick), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(pcbLength), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(pcbThick), 0.),
+ getAttrOrDefault(eightMmod_dim, _Unicode(pcbWidth), 0.), eightM_xml.visStr(),
+ eightM_xml.regionStr(), eightM_xml.limitsStr());
// 4M module specific loading
xml_comp_t fourM_xml = detElem.child(_Unicode(fourmodule));
xml_dim_t fourMmod_dim = fourM_xml.dimensions();
- moduleParamsStrct fourM_params(getAttrOrDefault(fourMmod_dim, _Unicode(widthBackInner), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(heightBackInner), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(widthSideWall), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(widthTopWall), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(thicknessFrontWall), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(thicknessBackWall), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(width), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(height), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(notchDepth), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(notchHeight), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(foilThick), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(pcbLength), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(pcbThick), 0.),
- getAttrOrDefault(fourMmod_dim, _Unicode(pcbWidth), 0.),
- fourM_xml.visStr(), fourM_xml.regionStr(), fourM_xml.limitsStr());
+ moduleParamsStrct fourM_params(
+ getAttrOrDefault(fourMmod_dim, _Unicode(widthBackInner), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(heightBackInner), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(widthSideWall), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(widthTopWall), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(thicknessMountingPlate), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(thicknessFrontWall), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(thicknessBackWall), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(width), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(height), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(notchDepth), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(notchHeight), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(foilThick), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(pcbLength), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(pcbThick), 0.),
+ getAttrOrDefault(fourMmod_dim, _Unicode(pcbWidth), 0.), fourM_xml.visStr(),
+ fourM_xml.regionStr(), fourM_xml.limitsStr());
std::vector slice_Params;
int layer_num = 0;
@@ -1009,7 +1065,7 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
}
// Looping through the number of repeated layers in each section
for (int i = 0; i < repeat; i++) {
- int slice_num = 1;
+ int slice_num = 0;
// Looping over each layer's slices
for (xml_coll_t l(x_layer, _U(slice)); l; ++l) {
@@ -1069,9 +1125,8 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
moduleIDy = ((pos8M[e].y + 265) / 10);
// Placing modules in world volume
- auto tr8M =
- Transform3D(Position(-pos8M[e].x - 0.5 * eightM_params.mod_width, -pos8M[e].y, pos8M[e].z));
- phv = assembly.placeVolume(eightMassembly, tr8M);
+ auto tr8M = Transform3D(Position(-pos8M[e].x, -pos8M[e].y, pos8M[e].z));
+ phv = assembly.placeVolume(eightMassembly, tr8M);
phv.addPhysVolID("moduleIDx", moduleIDx)
.addPhysVolID("moduleIDy", moduleIDy)
.addPhysVolID("moduletype", 0);
@@ -1108,9 +1163,8 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
_toString((int)pos4M.size()) + "\t" + _toString(moduleIDx) + "\t" +
_toString(moduleIDy));
}
- auto tr4M =
- Transform3D(Position(-pos4M[f].x - 0.5 * fourM_params.mod_width, -pos4M[f].y, pos4M[f].z));
- phv = assembly.placeVolume(fourMassembly, tr4M);
+ auto tr4M = Transform3D(Position(-pos4M[f].x, -pos4M[f].y, pos4M[f].z));
+ phv = assembly.placeVolume(fourMassembly, tr4M);
phv.addPhysVolID("moduleIDx", moduleIDx)
.addPhysVolID("moduleIDy", moduleIDy)
.addPhysVolID("moduletype", 1);