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

Fixed readout and added sector

parent 033f48ec
No related branches found
No related tags found
1 merge request!11Resolve "Implement ffi_ZDC"
Pipeline #7858 failed
This commit is part of merge request !11. Comments created here will be created in the context of that merge request.
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<readouts> <readouts>
<readout name="ffi_ZDC_Hits"> <readout name="ffi_ZDC_Hits">
<segmentation type="CartesianGridXY" grid_size_x="1.0*mm" grid_size_y="1.0*mm" /> <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> </readout>
</readouts> </readouts>
......
...@@ -31,16 +31,15 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) ...@@ -31,16 +31,15 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
double mGap = mod.attr<double>(_Unicode(gap)); double mGap = mod.attr<double>(_Unicode(gap));
int mNTowers = mod.attr<double>(_Unicode(ntower)); int mNTowers = mod.attr<double>(_Unicode(ntower));
DetElement det(detName, detID); //DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det); //Volume motherVol = desc.pickMotherVolume(det);
// Create Global Volume // Create Global Volume
Box ffi_ZDC_GVol_Solid(Width * 0.5, Width * 0.5, Thickness * 0.5); 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); 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())); //Transform3D tr(RotationZYX(rot.z(), rot.y(), rot.x()), Position(pos.x(), pos.y(), pos.z()));
PlacedVolume detPV = motherVol.placeVolume(detVol, tr); //PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
detPV.addPhysVolID("system", detID); //detPV.addPhysVolID("system", detID);
detVol.setVisAttributes(desc.visAttributes(x_det.visStr())); detVol.setVisAttributes(desc.visAttributes(x_det.visStr()));
// Construct Tower // Construct Tower
...@@ -48,6 +47,8 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) ...@@ -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); 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); Volume modVol("ffi_ZDC_ECAL_Logic_Tower", ffi_ZDC_ECAL_Solid_Tower, mPbWO4);
modVol.setVisAttributes(desc.visAttributes(mod.visStr())); modVol.setVisAttributes(desc.visAttributes(mod.visStr()));
sens.setType("calorimeter");
modVol.setSensitiveDetector(sens);
// Module Position // Module Position
double mod_x = 0.0 * mm; double mod_x = 0.0 * mm;
...@@ -75,12 +76,15 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens) ...@@ -75,12 +76,15 @@ static Ref_t createDetector(Detector& desc, xml_h e, SensitiveDetector sens)
k++; k++;
string module_name = detName + _toString(k,"_ECAL_Phys_%d"); string module_name = detName + _toString(k,"_ECAL_Phys_%d");
PlacedVolume pv_mod = detVol.placeVolume(modVol, Position(mod_x,mod_y,mod_z)); PlacedVolume pv_mod = detVol.placeVolume(modVol, Position(mod_x,mod_y,mod_z));
pv_mod.addPhysVolID("module",k); pv_mod.addPhysVolID("sector", 1).addPhysVolID("module",k);
sens.setType("calorimeter");
modVol.setSensitiveDetector(sens);
} }
} }
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); det.setPlacement(detPV);
return det; return det;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment