Skip to content

Commit 46cc56e

Browse files
committed
ZDC: replace legacy fast simulation with an ONNX channel-response model
Generate ZN and ZP photon counts from primary nucleons using an ONNX model packaged with its configuration in a ROOT/CCDB object. Add an end-of-event detector hook and integrate the generated hits with the existing ZDC simulation interface. The code was written with assistance from Claude Fable 5.2.
1 parent 9b8decd commit 46cc56e

28 files changed

Lines changed: 611 additions & 1240 deletions

‎Detectors/Base/include/DetectorsBase/Detector.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242

4343
#include <fairmq/FwdDecls.h>
4444

45+
class TParticle;
46+
4547
namespace o2::base
4648
{
4749

@@ -183,6 +185,11 @@ class Detector : public FairDetector
183185
return trackID + (trackID < nprimaries ? primaryOffset : secondaryOffset);
184186
}
185187

188+
// Hook called at the end of the transport of an event (or of a sub-event in a simulation worker),
189+
// before the hits are written/shipped. It receives the primaries of the (sub-)event and allows
190+
// detectors to create hits directly from them (fast simulation without transport).
191+
virtual void finishEventHook(const std::vector<TParticle>& /*primaries*/) {}
192+
186193
// interfaces to attach properly encoded hit information to a FairMQ message
187194
// and to decode it
188195
virtual void attachHits(fair::mq::Channel&, fair::mq::Parts&) = 0;

‎Detectors/ZDC/CMakeLists.txt‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

12-
if (onnxruntime_FOUND)
13-
add_subdirectory(fastsimulation)
14-
endif()
1512
add_subdirectory(base)
1613
add_subdirectory(simulation)
1714
add_subdirectory(reconstruction)

‎Detectors/ZDC/base/include/ZDCBase/Constants.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ constexpr int DbgExtra = 4;
216216
// TODO: CcdbApi and BasicCCDBManager would also take string_view as an argument
217217

218218
const std::string CCDBPathConfigSim = "ZDC/Config/Sim";
219+
const std::string CCDBPathFastSimModel = "ZDC/Config/FastSimModel";
219220
const std::string CCDBPathConfigModule = "ZDC/Config/Module";
220221
const std::string CCDBPathRecoConfigZDC = "ZDC/Calib/RecoConfigZDC";
221222
const std::string CCDBPathTDCCalib = "ZDC/Calib/TDCCalib";

‎Detectors/ZDC/fastsimulation/CMakeLists.txt‎

Lines changed: 0 additions & 24 deletions
This file was deleted.

‎Detectors/ZDC/fastsimulation/include/Config.h‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎Detectors/ZDC/fastsimulation/include/FastSimulations.h‎

Lines changed: 0 additions & 162 deletions
This file was deleted.

‎Detectors/ZDC/fastsimulation/include/Processors.h‎

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)