|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "Gaudi/Property.h"
31 return StatusCode::SUCCESS;
38 return StatusCode::SUCCESS;
45 const EventContext& ctx = getContext();
48 auto profileCallback = [
this, slot=ctx.slot()]( IScheduler::OccupancySnapshot snap ) ->
void {
50 for (
int const stateTotal : snap.states[slot] ) {
53 ATH_MSG_INFO(
"Slot " << slot <<
" snapshot time " << snap.time.time_since_epoch().count() <<
" states: " <<
states );
55 m_scheduler->recordOccupancy( 0, std::move( profileCallback ) );
58 std::vector<int> viewData;
59 auto viewVector = std::make_unique<ViewContainer>();
60 for (
int viewIndex = 0; viewIndex <
m_viewNumber; ++viewIndex )
62 viewData.push_back( ( viewIndex * 10 ) + 10 + ctx.evt() );
76 if ( parentViewHandle->
size() == viewVector->size() )
78 for (
unsigned int viewIndex = 0; viewIndex < parentViewHandle->
size(); ++viewIndex )
80 ATH_MSG_INFO(
"Linking view " << viewVector->at( viewIndex )->name() <<
" to parent " << parentViewHandle->
at( viewIndex )->name() );
81 viewVector->at( viewIndex )->linkParent( parentViewHandle->
at( viewIndex ) );
94 CHECK( outputViewHandle.
record( std::move( viewVector ) ) );
96 return StatusCode::SUCCESS;
ServiceHandle< IScheduler > m_scheduler
Containers.
Gaudi::Property< std::string > m_viewNodeName
Gaudi::Property< int > m_viewNumber
const_reference at(size_t pos) const
virtual StatusCode finalize()
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
ViewSubgraphAlg()
Default constructor:
virtual StatusCode initialize()
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual StatusCode execute()
Gaudi::Property< std::string > m_viewBaseName
Handle class for recording to StoreGate.
SG::WriteHandleKey< int > m_w_int
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode scheduleViews(ViewContainer *viewVector, std::string const &nodeName, EventContext const &sourceContext, SmartIF< IScheduler > scheduler, bool reverseOrder=false)
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadHandleKey< ViewContainer > m_r_views
StatusCode makeAndPopulate(std::string const &viewNameRoot, ViewContainer *viewVector, SG::WriteHandleKey< T > const &populateKey, EventContext const &sourceContext, std::vector< T > const &inputData, bool const allowFallThrough=true)
std::string to_string(const DetectorType &type)
virtual ~ViewSubgraphAlg()
Destructor:
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
SG::WriteHandleKey< ViewContainer > m_w_views