From 038f959646cdaa445c1cb2e642cf33e5b1a36c53 Mon Sep 17 00:00:00 2001
From: "jihee.kim" <jihee.kim@anl.gov>
Date: Wed, 31 Mar 2021 22:00:20 -0500
Subject: [PATCH] Fixed readout and added sector
---
compact/ffi_ZDC.xml | 2 +-
src/ffi_ZDC.cpp | 22 +++++++++++++---------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/compact/ffi_ZDC.xml b/compact/ffi_ZDC.xml
index d149915..36638f1 100644
--- a/compact/ffi_ZDC.xml
+++ b/compact/ffi_ZDC.xml
@@ -26,7 +26,7 @@
<readouts>
<readout name="ffi_ZDC_Hits">
<segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" />
- <id>system:8,module:12,x:32:-16,y:-16</id>
+ <id>system:8,sector:6,module:6,x:32:-16,y:-16</id>
</readout>
</readouts>
diff --git a/src/ffi_ZDC.cpp b/src/ffi_ZDC.cpp
index f9d686a..89690bc 100644
--- a/src/ffi_ZDC.cpp
+++ b/src/ffi_ZDC.cpp
@@ -31,16 +31,15 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
double mGap = mod.attr<double>(_Unicode(gap));
int mNTowers = mod.attr<double>(_Unicode(ntower));
- DetElement det(detName, detID);
- Volume motherVol = desc.pickMotherVolume(det);
+ //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);
- 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);
-
+ //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()));
// Construct Tower
@@ -48,6 +47,8 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
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()));
+ sens.setType("calorimeter");
+ modVol.setSensitiveDetector(sens);
// Module Position
double mod_x = 0.0 * mm;
@@ -75,12 +76,15 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
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);
+ pv_mod.addPhysVolID("sector", 1).addPhysVolID("module",k);
}
}
+ 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);
det.setPlacement(detPV);
return det;
}
--
GitLab