Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:09

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 // Framework include files
0015 #include <DD4hep/Printout.h>
0016 #include <DD4hep/InstanceCount.h>
0017 #include <DDDigi/DigiLockedAction.h>
0018 
0019 using namespace dd4hep::digi;
0020 
0021 
0022 /// Standard constructor
0023 DigiLockedAction::DigiLockedAction(const DigiKernel& kernel, const std::string& nam)
0024   : DigiEventAction(kernel, nam)
0025 {
0026   InstanceCount::increment(this);
0027 }
0028 
0029 /// Default destructor
0030 DigiLockedAction::~DigiLockedAction()   {
0031   dd4hep::detail::releasePtr(m_action);
0032   InstanceCount::decrement(this);
0033 }
0034 
0035 /// Underlying object to be used during the locked execution
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 /// Pre-track action callback
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 }