The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
ReEntAlg.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#include "ReEntAlg.h"
14
15#include <chrono>
16#include <thread>
17
19
20
21
22ReEntAlg::ReEntAlg( const std::string& name, ISvcLocator* pSvcLocator ) : Gaudi::Algorithm( name, pSvcLocator ) {}
23
24/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
25
28 if ( !sc ) return sc;
29 info() << "initialize()" << endmsg;
30 return sc;
31}
32
33/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
34
36 // wait a little bit to make sure the printouts are in a stable order
37 std::this_thread::sleep_for( std::chrono::milliseconds( 50 * ctx.slot() ) );
38
39 info() << "execute(): context: (" << ctx << ") index: " << index() << " cardinality: " << cardinality() << endmsg;
40
41 std::chrono::milliseconds dt{ m_sleep + ctx.slot() * 500 };
42 std::this_thread::sleep_for( dt );
43
44 info() << "... done in " << dt.count() << " ms for " << ctx << endmsg;
45 std::this_thread::sleep_for( std::chrono::milliseconds( 50 ) );
46
48}
49
50/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
51
53 info() << "finalize()" << endmsg;
55}
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
#define DECLARE_COMPONENT(type)
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
This class represents an entry point to all the event specific data.
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
Definition Algorithm.h:98
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition Algorithm.h:175
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
Definition Algorithm.h:181
const std::string & name() const override
The identifying name of the algorithm object.
unsigned int index() const override
unsigned int cardinality() const override
Return the cardinality.
Definition Algorithm.h:395
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition ISvcLocator.h:42
StatusCode initialize() override
Definition ReEntAlg.cpp:26
StatusCode finalize() override
Definition ReEntAlg.cpp:52
StatusCode execute(const EventContext &ctx) const override
Definition ReEntAlg.cpp:35
Gaudi::Property< unsigned int > m_sleep
Definition ReEntAlg.h:28
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
constexpr static const auto SUCCESS
Definition StatusCode.h:99
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1
STL namespace.