ATLAS Offline Software
Loading...
Searching...
No Matches
CommonAugmentation.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6// CommonAugmentation.cxx
8// Author: James Catmore (James.Catmore@cern.ch)
9// This code loops over common tools from the CP groups, which write
10// into SG so that other derivations can make use of them without
11// re-running the tools.
12
14
15#include <sstream> // C++ utilities
16#include <string>
17#include <algorithm>
18#include <fstream>
19
20#include "GaudiKernel/ISvcLocator.h"
22#include "AthLinks/ElementLink.h"
23#include "GaudiKernel/Chrono.h"
24
27
29
30DerivationFramework::CommonAugmentation::CommonAugmentation(const std::string& name, ISvcLocator* pSvcLocator) :
31AthReentrantAlgorithm(name, pSvcLocator)
32{
33}
34
35// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
36
38
39 ATH_MSG_INFO("Initializing the common selections in " << name());
40
41 // get the augmentation tools
42 ATH_CHECK ( m_augmentationTools.retrieve() );
43 ATH_MSG_INFO("The following augmentation tools will be applied....");
45
46 // get the chrono auditor
47 ATH_CHECK ( m_chronoSvc.retrieve() );
48
49 return StatusCode::SUCCESS;
50
51}
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
54
55StatusCode DerivationFramework::CommonAugmentation::execute(const EventContext& ctx) const {
56
57 // On your marks.... get set....
58 Chrono chrono( &(*m_chronoSvc), name() );
59 // GO!!
60
61 //=============================================================================
62 // AUGMENTATION ===============================================================
63 //=============================================================================
64 for (const auto & augmentationTool : m_augmentationTools) {
65 if ( augmentationTool->addBranches(ctx).isFailure() ) {
66 ATH_MSG_ERROR("Augmentation failed!");
67 return StatusCode::FAILURE;
68 }
69 }
70
71 return StatusCode::SUCCESS;
72
73}
74
75// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
76
78
79 ATH_MSG_INFO( "============================================================================");
80 ATH_MSG_INFO( " The following CP tools were called by " << name() << " for the whole train:");
81 for (const auto & augmentationTool : m_augmentationTools) {
82 ATH_MSG_INFO ( augmentationTool->name() );
83 }
84 ATH_MSG_INFO( "============================================================================");
85
86 return StatusCode::SUCCESS;
87
88}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
An STL vector of pointers that by default owns its pointed-to elements.
An algorithm that can be simultaneously executed in multiple threads.
virtual StatusCode execute(const EventContext &ctx) const override
ServiceHandle< IChronoStatSvc > m_chronoSvc
CommonAugmentation(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
PublicToolHandleArray< IAugmentationTool > m_augmentationTools