diff --git a/Kernel/SelectionLine/src/SelectionLine.cpp b/Kernel/SelectionLine/src/SelectionLine.cpp index 3c4c18dbbb3b666b0ee094f8c7f9f01531c3ff3c..98738f6ad553f3fbf6e152e04b589307bd283001 100644 --- a/Kernel/SelectionLine/src/SelectionLine.cpp +++ b/Kernel/SelectionLine/src/SelectionLine.cpp @@ -1,4 +1,3 @@ -// $Id: SelectionLine.cpp,v 1.3 2010-02-27 09:08:24 graven Exp $ // ============================================================================ // Include files // ============================================================================ @@ -51,6 +50,14 @@ using namespace HistogramUtilities; #include "Kernel/SelectionLine.h" // ============================================================================ +#ifdef GAUDI_SYSEXECUTE_WITHCONTEXT +/// \fixme backward compatibility with Gaudi <= v28r1 +#include "GaudiKernel/ThreadLocalContext.h" +#define SYSEX_ARGUMENT Gaudi::Hive::currentContext() +#else +#define SYSEX_ARGUMENT +#endif + namespace { @@ -160,7 +167,7 @@ Selection::Line::Stage::execute(ISequencerTimerTool* timertool) if ( algorithm()->isExecuted() ) return StatusCode::SUCCESS; // TODO: bind timer at init time if ( timertool ) timertool->start( timer() ); - StatusCode result = algorithm()->sysExecute(); + StatusCode result = algorithm()->sysExecute(SYSEX_ARGUMENT); algorithm()->setExecuted( true ); if ( timertool ) timertool->stop( timer() ); return result; diff --git a/Phys/DaVinciKernel/Kernel/DVCommonBase.h b/Phys/DaVinciKernel/Kernel/DVCommonBase.h index ae0e365e3e8f4ca3b444113a2078a78442c1b03f..710bb02e3db3b226879749046bc733079ea14975 100644 --- a/Phys/DaVinciKernel/Kernel/DVCommonBase.h +++ b/Phys/DaVinciKernel/Kernel/DVCommonBase.h @@ -47,6 +47,14 @@ // from DaVinciUtils // ============================================================================ #include "DaVinciUtils/Guards.h" + + +#ifdef GAUDI_SYSEXECUTE_WITHCONTEXT +/// \fixme backward compatibility with Gaudi <= v28r1 +#include "GaudiKernel/EventContext.h" +#endif + + // ============================================================================ /** @class DVCommonBase DVCommonBase.h Kernel/DVCommonBase.h @@ -327,7 +335,12 @@ public: void setFilterPassed( bool state ) override; /// Overridden from Gaudi Algorithm - StatusCode sysExecute () override; + /// \fixme backward compatibility with Gaudi <= v28r1 + #ifdef GAUDI_SYSEXECUTE_WITHCONTEXT + StatusCode sysExecute(const EventContext&) override; + #else + StatusCode sysExecute() override; + #endif // Overridden from Gaudi Algorithm StatusCode initialize () override; diff --git a/Phys/DaVinciKernel/src/Lib/DVCommonBase.icpp b/Phys/DaVinciKernel/src/Lib/DVCommonBase.icpp index 4907e7a130f83297532183f5d7a8c4ca814ad36a..79048ab736fa7b3f11f398901b3c102e50b471f1 100644 --- a/Phys/DaVinciKernel/src/Lib/DVCommonBase.icpp +++ b/Phys/DaVinciKernel/src/Lib/DVCommonBase.icpp @@ -84,14 +84,14 @@ DVCommonBase<PBASE>::DVCommonBase( const std::string& name, "Output Location of Particles" ); m_inputLocations.clear() ; - + // this->declareProperty( "Inputs", m_inputLocations, - "Input Locations forwarded of Particles" ) + "Input Locations forwarded of Particles" ) // use update handler -> declareUpdateHandler ( &DVCommonBase<PBASE>::handleInputsUpdate , this ) ; - + m_p2PVInputLocations.clear() ; this->declareProperty( "P2PVInputLocations", @@ -103,7 +103,7 @@ DVCommonBase<PBASE>::DVCommonBase( const std::string& name, this->declareProperty( "UseP2PVRelations", m_useP2PV, "Use P->PV relations internally. Forced to true if re-fitting PVs. Otherwise disabled for single PV events. Default: true."); - + this->declareProperty( "WriteP2PVRelations", m_writeP2PV, "Write out P->PV relations table to TES. Default: true"); @@ -396,17 +396,17 @@ void DVCommonBase<PBASE>::initializeInputLocations() this->debug() << ">>> Initialising input locations : " << m_inputLocations << endmsg; } - + // Clean up the paths for ( auto& loc : m_inputLocations ) { - - // remove RootInTES prefix, if any - if ( !this->rootInTES().empty() - && "/Event/" != this->rootInTES() - && 0 == loc.find ( this->rootInTES() ) ) + + // remove RootInTES prefix, if any + if ( !this->rootInTES().empty() + && "/Event/" != this->rootInTES() + && 0 == loc.find ( this->rootInTES() ) ) { loc = std::string( loc , this->rootInTES().size() ) ; } - + // Strip any ending "/Particles" DaVinci::StringUtils::removeEnding(loc,"/Particles"); // Strip any starting "/Event/" @@ -473,9 +473,9 @@ template <class PBASE> void DVCommonBase<PBASE>::handleInputsUpdate ( Property& /* p */ ) { // no action if not yet initialized - // initialize will perform the needed actiom anyway + // initialize will perform the needed actiom anyway if ( Gaudi::StateMachine::INITIALIZED > this->FSMState() ) { return ; } - // + // this->initializeInputLocations() ; // } @@ -499,7 +499,11 @@ StatusCode DVCommonBase<PBASE>::loadTools() // Execute // ============================================================================ template <class PBASE> -StatusCode DVCommonBase<PBASE>::sysExecute () +#ifdef GAUDI_SYSEXECUTE_WITHCONTEXT +StatusCode DVCommonBase<PBASE>::sysExecute(const EventContext& ectx) +#else +StatusCode DVCommonBase<PBASE>::sysExecute() +#endif { // register for the algorithm context service IAlgContextSvc* ctx = NULL; @@ -519,7 +523,11 @@ StatusCode DVCommonBase<PBASE>::sysExecute () if ( sc.isFailure() ) return this->Error ( "Not able to load event input" , sc ) ; // execute the algorithm +#ifdef GAUDI_SYSEXECUTE_WITHCONTEXT + sc = this->Algorithm::sysExecute(ectx); +#else sc = this->Algorithm::sysExecute(); +#endif if ( sc.isFailure() ) return sc; if ( !m_setFilterCalled )