File indexing completed on 2025-01-18 09:14:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DD4hep/InstanceCount.h>
0016 #include <DDDigi/DigiActionSequence.h>
0017
0018
0019 #include <stdexcept>
0020
0021 using namespace dd4hep::digi;
0022
0023
0024 DigiActionSequence::DigiActionSequence(const DigiKernel& kernel, const std::string& nam)
0025 : DigiSynchronize(kernel, nam)
0026 {
0027 InstanceCount::increment(this);
0028 }
0029
0030
0031 DigiActionSequence::~DigiActionSequence() {
0032 m_begin.clear();
0033 m_end.clear();
0034 InstanceCount::decrement(this);
0035 }
0036
0037
0038 void DigiActionSequence::adopt(DigiEventAction* action) {
0039 this->DigiSynchronize::adopt(action);
0040 }
0041
0042
0043 void DigiActionSequence::execute(DigiContext& context) const {
0044 m_begin(&context);
0045 this->DigiSynchronize::execute(context);
0046 debug("+++ Event: %8d (DigiActionSequence) Parallel: %s Done.",
0047 context.event->eventNumber, yes_no(m_parallel));
0048 m_end(&context);
0049 }
0050
0051
0052 DigiSequentialActionSequence::DigiSequentialActionSequence(const DigiKernel& kernel, const std::string& nam)
0053 : DigiActionSequence(kernel, nam)
0054 {
0055 this->m_parallel = false;
0056 InstanceCount::increment(this);
0057 }
0058
0059
0060 DigiSequentialActionSequence::~DigiSequentialActionSequence() {
0061 InstanceCount::decrement(this);
0062 }
0063
0064
0065 DigiParallelActionSequence::DigiParallelActionSequence(const DigiKernel& kernel, const std::string& nam)
0066 : DigiActionSequence(kernel, nam)
0067 {
0068 this->m_parallel = true;
0069 InstanceCount::increment(this);
0070 }
0071
0072
0073 DigiParallelActionSequence::~DigiParallelActionSequence() {
0074 InstanceCount::decrement(this);
0075 }