Back to home page

EIC code displayed by LXR

 
 

    


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

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/InstanceCount.h>
0016 #include <DDDigi/DigiActionSequence.h>
0017 
0018 // C/C++ include files
0019 #include <stdexcept>
0020 
0021 using namespace dd4hep::digi;
0022 
0023 /// Standard constructor
0024 DigiActionSequence::DigiActionSequence(const DigiKernel& kernel, const std::string& nam)
0025   : DigiSynchronize(kernel, nam)
0026 {
0027   InstanceCount::increment(this);
0028 }
0029 
0030 /// Default destructor
0031 DigiActionSequence::~DigiActionSequence() {
0032   m_begin.clear();
0033   m_end.clear();
0034   InstanceCount::decrement(this);
0035 }
0036 
0037 /// Adopt a new action as part of the sequence. Sequence takes ownership.
0038 void DigiActionSequence::adopt(DigiEventAction* action)    {
0039   this->DigiSynchronize::adopt(action);
0040 }
0041 
0042 /// Pre-track action callback
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 /// Standard constructor
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 /// Default destructor
0060 DigiSequentialActionSequence::~DigiSequentialActionSequence() {
0061   InstanceCount::decrement(this);
0062 }
0063 
0064 /// Standard constructor
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 /// Default destructor
0073 DigiParallelActionSequence::~DigiParallelActionSequence() {
0074   InstanceCount::decrement(this);
0075 }