From d04706582ff7a442e7dad2ea5d1eb169e0c2972f Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Mon, 13 Jul 2026 15:30:09 +0200 Subject: [PATCH] Increase calorimeter size by 4x in every dimension Scales the default transverse width (xywidth 50->200 cm) and every layer thickness across the example/production geometries (run_pbwo4, example.py/ipynb, run_sampling configs, export_xsec) by the same factor, so the calo grows uniformly in x, y, and z. Co-Authored-By: Claude Sonnet 5 --- bind/example.ipynb | 14 +++++++------- bind/example.py | 8 ++++---- bind/run_pbwo4.py | 2 +- export_xsec.cc | 2 +- include/GeometryDescriptor.hh | 2 +- run_pbwo4.cc | 2 +- run_sampling.cc | 18 +++++++++--------- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/bind/example.ipynb b/bind/example.ipynb index 8545ce0..b132a94 100644 --- a/bind/example.ipynb +++ b/bind/example.ipynb @@ -8,14 +8,14 @@ "source": [ "from G4Calo import GeometryDescriptor, run_batch, display_event\n", "\n", - "gd = GeometryDescriptor() #the width of the calorimeter is 50 cm times 50 cm (also steerable, but I'd leave it)\n", + "gd = GeometryDescriptor() #the width of the calorimeter is 200 cm times 200 cm (also steerable, but I'd leave it)\n", "\n", - "gd.addLayer(4,\"G4_Pb\",False) \n", - "gd.addLayer(3,\"G4_POLYSTYRENE\",True, 7)\n", - "gd.addLayer(4,\"G4_Pb\",False) \n", - "gd.addLayer(3,\"G4_POLYSTYRENE\",True, 7)\n", - "gd.addLayer(4,\"G4_Pb\",False)\n", - "gd.addLayer(3,\"G4_POLYSTYRENE\",True, 7)" + "gd.addLayer(16,\"G4_Pb\",False) \n", + "gd.addLayer(12,\"G4_POLYSTYRENE\",True, 7)\n", + "gd.addLayer(16,\"G4_Pb\",False) \n", + "gd.addLayer(12,\"G4_POLYSTYRENE\",True, 7)\n", + "gd.addLayer(16,\"G4_Pb\",False)\n", + "gd.addLayer(12,\"G4_POLYSTYRENE\",True, 7)" ] }, { diff --git a/bind/example.py b/bind/example.py index c95fbff..566c822 100644 --- a/bind/example.py +++ b/bind/example.py @@ -7,8 +7,8 @@ if __name__ == '__main__': gd = GeometryDescriptor() for _ in range(25): - gd.addLayer(0.5, "G4_Pb", False) - gd.addLayer(1.,"G4_POLYSTYRENE",True,1) + gd.addLayer(2.0, "G4_Pb", False) + gd.addLayer(4.,"G4_POLYSTYRENE",True,1) df = run_batch(gd, 100, 'gamma', 1) @@ -16,8 +16,8 @@ if __name__ == '__main__': gd = GeometryDescriptor() for _ in range(30): - gd.addLayer(0.5, "G4_Pb", False) - gd.addLayer(1.,"G4_POLYSTYRENE",True,1) + gd.addLayer(2.0, "G4_Pb", False) + gd.addLayer(4.,"G4_POLYSTYRENE",True,1) df = run_batch(gd,10, 'gamma', 40) display_event(gd,"gamma", 2, outfile='event.html') \ No newline at end of file diff --git a/bind/run_pbwo4.py b/bind/run_pbwo4.py index ce7218e..3e2d2b5 100644 --- a/bind/run_pbwo4.py +++ b/bind/run_pbwo4.py @@ -5,7 +5,7 @@ from minicalo import GeometryDescriptor output_dir = os.path.dirname(os.path.abspath(__file__)) gd = GeometryDescriptor() -gd.addLayer(20.0, "G4_PbWO4", True, 10, 10) +gd.addLayer(80.0, "G4_PbWO4", True, 10, 10) hits, steps = run_batch(gd, 10, "e-", 1.0, return_steps=True) diff --git a/export_xsec.cc b/export_xsec.cc index 3b45fbf..25863fb 100644 --- a/export_xsec.cc +++ b/export_xsec.cc @@ -35,7 +35,7 @@ int main(int argc, char** argv) { // Minimal valid geometry: one active PbWO4 layer so init() has something to build. GeometryDescriptor gd; - gd.addLayer(2.0, materialName, true, 1, 1); + gd.addLayer(8.0, materialName, true, 1, 1); G4System g4; g4.init(gd, -1); diff --git a/include/GeometryDescriptor.hh b/include/GeometryDescriptor.hh index eca710b..3be3d12 100644 --- a/include/GeometryDescriptor.hh +++ b/include/GeometryDescriptor.hh @@ -134,7 +134,7 @@ public: class GeometryDescriptor { public: - GeometryDescriptor() : xywidth(50), g4system(nullptr) {}; + GeometryDescriptor() : xywidth(200), g4system(nullptr) {}; ~GeometryDescriptor(); void addLayer(double thickness_cm, std::string material, bool isActive = true, int nx = 1, int ny = -1); diff --git a/run_pbwo4.cc b/run_pbwo4.cc index c6b11e6..449e84e 100644 --- a/run_pbwo4.cc +++ b/run_pbwo4.cc @@ -48,7 +48,7 @@ int main(int argc, char** argv) { std::string outfile = "pbwo4_" + std::to_string(nEvents) + "events_hits.root"; GeometryDescriptor gd; - gd.addLayer(20.0, "G4_PbWO4", true, 10, 10); + gd.addLayer(80.0, "G4_PbWO4", true, 10, 10); G4System g4; g4.init(gd, seed); diff --git a/run_sampling.cc b/run_sampling.cc index 53c1c7b..c3e51f6 100644 --- a/run_sampling.cc +++ b/run_sampling.cc @@ -13,8 +13,8 @@ namespace { GeometryDescriptor buildPbScint() { GeometryDescriptor gd; for (int i = 0; i < 60; ++i) { - gd.addLayer(0.2, "G4_Pb", false); - gd.addLayer(0.3, "G4_PLASTIC_SC_VINYLTOLUENE", true, 10, 10); + gd.addLayer(0.8, "G4_Pb", false); + gd.addLayer(1.2, "G4_PLASTIC_SC_VINYLTOLUENE", true, 10, 10); } return gd; } @@ -22,8 +22,8 @@ GeometryDescriptor buildPbScint() { GeometryDescriptor buildFeScint() { GeometryDescriptor gd; for (int i = 0; i < 40; ++i) { - gd.addLayer(1.0, "G4_Fe", false); - gd.addLayer(0.5, "G4_PLASTIC_SC_VINYLTOLUENE", true, 10, 10); + gd.addLayer(4.0, "G4_Fe", false); + gd.addLayer(2.0, "G4_PLASTIC_SC_VINYLTOLUENE", true, 10, 10); } return gd; } @@ -31,10 +31,10 @@ GeometryDescriptor buildFeScint() { GeometryDescriptor buildWScintEcal() { GeometryDescriptor gd; // Thin homogeneous preshower: ~0.05 X0, sees MIPs/shower-start, not containment. - gd.addLayer(2.0, "G4_PLASTIC_SC_VINYLTOLUENE", true, 10, 10); + gd.addLayer(8.0, "G4_PLASTIC_SC_VINYLTOLUENE", true, 10, 10); for (int i = 0; i < 75; ++i) { - gd.addLayer(0.1, "G4_W", false); - gd.addLayer(0.2, "G4_PLASTIC_SC_VINYLTOLUENE", true, 10, 10); + gd.addLayer(0.4, "G4_W", false); + gd.addLayer(0.8, "G4_PLASTIC_SC_VINYLTOLUENE", true, 10, 10); } return gd; } @@ -42,8 +42,8 @@ GeometryDescriptor buildWScintEcal() { GeometryDescriptor buildPbLAr() { GeometryDescriptor gd; for (int i = 0; i < 70; ++i) { - gd.addLayer(0.2, "G4_Pb", false); - gd.addLayer(0.4, "G4_lAr", true, 10, 10); + gd.addLayer(0.8, "G4_Pb", false); + gd.addLayer(1.6, "G4_lAr", true, 10, 10); } return gd; }