Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Detectors/Base/include/DetectorsBase/Detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

#include <fairmq/FwdDecls.h>

class TParticle;

namespace o2::base
{

Expand Down Expand Up @@ -183,6 +185,13 @@ class Detector : public FairDetector
return trackID + (trackID < nprimaries ? primaryOffset : secondaryOffset);
}

// Hook called at the end of the transport of an event (or of a sub-event in a simulation worker),
// before the hits are written/shipped. It receives the primaries of the (sub-)event and allows
// detectors to create hits directly from them (fast simulation without transport).
// Only detectors returning true from hasFinishEventHook() are considered (queried once, at the first event).
virtual void finishEventHook(const std::vector<TParticle>& /*primaries*/) {}
virtual bool hasFinishEventHook() const { return false; }

// interfaces to attach properly encoded hit information to a FairMQ message
// and to decode it
virtual void attachHits(fair::mq::Channel&, fair::mq::Parts&) = 0;
Expand Down
5 changes: 5 additions & 0 deletions Detectors/Base/include/DetectorsBase/Stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ class Stack : public FairGenericStack
/// Mark the current track as contributing to a hit created by another track
/// \param iDet Detector unique identifier
void modifiesHit(int iDet);
/// Increment number of hits for a primary in a given detector, for hits created outside of
/// the transport of that primary (e.g. by a fast simulation at the end of the event)
/// \param iDet Detector unique identifier
/// \param iPrimary Index of the primary in the current (sub-)event
void addHitFromPrimary(int iDet, int iPrimary);

TClonesArray* GetListOfParticles() override;

Expand Down
11 changes: 11 additions & 0 deletions Detectors/Base/src/Stack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,17 @@ void Stack::addHit(int iDet)
mCurrentParticle.SetBit(ParticleStatus::kHasHits, 1);
mHitCounter++;
}
void Stack::addHitFromPrimary(int iDet, int iPrimary)
{
// primaries are the first entries of mTracks, in the same order as mPrimaryParticles
if (iPrimary < 0 || iPrimary >= mNumberOfPrimaryParticles) {
LOG(error) << "Stack::addHitFromPrimary: invalid primary index " << iPrimary << " (" << mNumberOfPrimaryParticles << " primaries)";
return;
}
const auto bitID = o2::base::Detector::getDetId2HitBitIndex()[iDet];
mTracks->at(iPrimary).setHit(bitID);
mHitCounter++;
}
void Stack::modifiesHit(int iDet)
{
// flag only; hit mask, kHasHits and hit counter stay untouched
Expand Down
3 changes: 0 additions & 3 deletions Detectors/ZDC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

if (onnxruntime_FOUND)
add_subdirectory(fastsimulation)
endif()
add_subdirectory(base)
add_subdirectory(simulation)
add_subdirectory(reconstruction)
Expand Down
1 change: 1 addition & 0 deletions Detectors/ZDC/base/include/ZDCBase/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ constexpr int DbgExtra = 4;
// TODO: CcdbApi and BasicCCDBManager would also take string_view as an argument

const std::string CCDBPathConfigSim = "ZDC/Config/Sim";
const std::string CCDBPathFastSimModel = "ZDC/Config/FastSimModel";
const std::string CCDBPathConfigModule = "ZDC/Config/Module";
const std::string CCDBPathRecoConfigZDC = "ZDC/Calib/RecoConfigZDC";
const std::string CCDBPathTDCCalib = "ZDC/Calib/TDCCalib";
Expand Down
24 changes: 0 additions & 24 deletions Detectors/ZDC/fastsimulation/CMakeLists.txt

This file was deleted.

37 changes: 0 additions & 37 deletions Detectors/ZDC/fastsimulation/include/Config.h

This file was deleted.

162 changes: 0 additions & 162 deletions Detectors/ZDC/fastsimulation/include/FastSimulations.h

This file was deleted.

88 changes: 0 additions & 88 deletions Detectors/ZDC/fastsimulation/include/Processors.h

This file was deleted.

Loading