Skip to content
Snippets Groups Projects
Commit b660372e authored by Jihee Kim's avatar Jihee Kim
Browse files

Added towers and Included into reference_detector

parent 5967c57b
No related branches found
No related tags found
1 merge request!11Resolve "Implement ffi_ZDC"
Pipeline #7856 failed
......@@ -440,6 +440,12 @@
<comment> Global parameters </comment>
<constant name="ffi_ZDC_width" value="60.0 * cm"/>
<constant name="ffi_ZDC_thickness" value="250.0 * cm"/>
<constant name="ffi_ZDC_ECAL_thickness" value="30.0 * cm"/>
<constant name="ffi_ZDC_ECAL_inner_radius" value="0.0 * cm"/>
<constant name="ffi_ZDC_ECAL_outer_radius" value="60.0 * cm"/>
<constant name="ffi_ZDC_ECAL_width" value="5.0 * cm"/>
<constant name="ffi_ZDC_ECAL_gap" value="5.0 * mm"/>
<constant name="ffi_ZDC_ECAL_ntower" value="20"/>
<comment>
-----------------------
......
......@@ -50,6 +50,7 @@
<vis name="cb_SolenoidVis" alpha="0.4" r= "0.1" g="0.0" b="0.1" showDaughters="true" visible="true"/>
<vis name="ffi_ZDCVis" alpha="0.1" r= "0.1" g="0.0" b="1.0" showDaughters="true" visible="true"/>
<vis name="ffi_ZDCmoduleVis" alpha="1.0" r= "0.1" g="1.0" b="0.9" showDaughters="true" visible="true"/>
<comment>
Deprecated colors.
......
......@@ -19,6 +19,7 @@
<position x="ffi_ZDC_x_pos" y="ffi_ZDC_y_pos" z="ffi_ZDC_z_pos"/>
<rotation x="ffi_ZDC_rotateX_angle" y="ffi_ZDC_rotateY_angle" z="ffi_ZDC_rotateZ_angle"/>
<dimensions x="ffi_ZDC_width" z="ffi_ZDC_thickness"/>
<module name="ffi_ZDC_ECAL_module" vis="ffi_ZDCmoduleVis" material="PbWO4" thickness="ffi_ZDC_ECAL_thickness" rmin="ffi_ZDC_ECAL_inner_radius" rmax="ffi_ZDC_ECAL_outer_radius" width="ffi_ZDC_ECAL_width" gap="ffi_ZDC_ECAL_gap" ntower="ffi_ZDC_ECAL_ntower"/>
</detector>
</detectors>
......
......@@ -114,6 +114,7 @@
<include ref="reference_detector/vertex_tracker.xml"/>
<include ref="compact/silicon_tracker.xml"/>
-->
<include ref="compact/ffi_ZDC.xml"/>
<include ref="compact/solenoid.xml"/>
<include ref="compact/ecal.xml"/>
<include ref="compact/hcal.xml"/>
......
......@@ -21,19 +21,66 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
Material Vacuum = desc.material("Vacuum");
xml_comp_t mod = x_det.child(_Unicode(module));
string modName = mod.nameStr();
Material mPbWO4 = desc.material(mod.materialStr());
double mThickness = mod.attr<double>(_Unicode(thickness));
double mRmin = mod.attr<double>(_Unicode(rmin));
double mRmax = mod.attr<double>(_Unicode(rmax));
double mWidth = mod.attr<double>(_Unicode(width));
double mGap = mod.attr<double>(_Unicode(gap));
int mNTowers = mod.attr<double>(_Unicode(ntower));
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
// Create Global Volume
Box ffi_ZDC_GVol_Solid(Width * 0.5, Width * 0.5, Thickness * 0.5);
Volume detVol("ffi_ZDC_GVol_Logic", ffi_ZDC_GVol_Solid, Vacuum);
detVol.setSensitiveDetector(sens);
sens.setType("calorimeter");
Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z()));
PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
detPV.addPhysVolID("system", detID);
detVol.setVisAttributes(desc.visAttributes(x_det.visStr()));
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z()));
PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
detPV.addPhysVolID("system", detID).addPhysVolID("module",0);
// Construct Tower
// Module
Box ffi_ZDC_ECAL_Solid_Tower(mWidth * 0.5, mWidth * 0.5, mThickness * 0.5);
Volume modVol("ffi_ZDC_ECAL_Logic_Tower", ffi_ZDC_ECAL_Solid_Tower, mPbWO4);
modVol.setVisAttributes(desc.visAttributes(mod.visStr()));
// Module Position
double mod_x = 0.0 * mm;
double mod_y = 0.0 * mm;
double mod_z = -1.0 * Thickness / 2.0 + mThickness / 2.0 + 2.0 * mm;
int k = -1;
// Place Modules
for (int j = 0; j < mNTowers; j++) {
if (j == 0)
mod_y = Width / 2.0 - mWidth / 2.0 - mGap;
else
mod_y -= (mWidth + mGap);
if (abs(mod_y + mWidth / 2.0) > Width / 2.0)
continue;
mod_x = Width / 2.0 - (mWidth + mGap) * 0.5;
for (int i = 0; i < mNTowers; i++) {
if (i > 0)
mod_x -= (mWidth + mGap);
if (abs(mod_x + mWidth / 2.0) > Width / 2.0)
continue;
k++;
string module_name = detName + _toString(k,"_ECAL_Phys_%d");
PlacedVolume pv_mod = detVol.placeVolume(modVol, Position(mod_x,mod_y,mod_z));
pv_mod.addPhysVolID("module",k);
sens.setType("calorimeter");
modVol.setSensitiveDetector(sens);
}
}
det.setPlacement(detPV);
return det;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment