File indexing completed on 2025-01-18 09:14:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DD4hep/Printout.h>
0016 #include <DD4hep/InstanceCount.h>
0017 #include <DDDigi/DigiLockedAction.h>
0018
0019 using namespace dd4hep::digi;
0020
0021
0022
0023 DigiLockedAction::DigiLockedAction(const DigiKernel& kernel, const std::string& nam)
0024 : DigiEventAction(kernel, nam)
0025 {
0026 InstanceCount::increment(this);
0027 }
0028
0029
0030 DigiLockedAction::~DigiLockedAction() {
0031 dd4hep::detail::releasePtr(m_action);
0032 InstanceCount::decrement(this);
0033 }
0034
0035
0036 void DigiLockedAction::use(DigiEventAction* action) {
0037 if (action) {
0038 action->addRef();
0039 m_properties.adopt(action->properties());
0040 m_action = action;
0041 return;
0042 }
0043 fatal("DigiLockedAction: Attempt to use invalid actor!");
0044 }
0045
0046
0047 void DigiLockedAction::execute(DigiContext& context) const {
0048 if (m_action) {
0049 m_action->execute(context);
0050 return;
0051 }
0052 fatal("DigiLockedAction: Attempt to use invalid actor! "
0053 "Did you call DigiLockedAction::use?");
0054 }