ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkCore
src
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
13
#include "
DerivationFrameworkCore/CommonAugmentation.h
"
14
15
#include <sstream>
// C++ utilities
16
#include <string>
17
#include <algorithm>
18
#include <fstream>
19
20
#include "GaudiKernel/ISvcLocator.h"
21
#include "
AthContainers/DataVector.h
"
22
#include "AthLinks/ElementLink.h"
23
#include "GaudiKernel/Chrono.h"
24
25
#include "
AthenaKernel/DefaultKey.h
"
26
#include "
SGTools/StlVectorClids.h
"
27
29
30
DerivationFramework::CommonAugmentation::CommonAugmentation
(
const
std::string& name, ISvcLocator* pSvcLocator) :
31
AthReentrantAlgorithm
(name, pSvcLocator)
32
{
33
}
34
35
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
36
37
StatusCode
DerivationFramework::CommonAugmentation::initialize
() {
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...."
);
44
ATH_MSG_INFO
(
m_augmentationTools
);
45
46
// get the chrono auditor
47
ATH_CHECK
(
m_chronoSvc
.retrieve() );
48
49
return
StatusCode::SUCCESS;
50
51
}
52
53
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
54
55
StatusCode
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
77
StatusCode
DerivationFramework::CommonAugmentation::finalize
() {
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
CommonAugmentation.h
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
DefaultKey.h
StlVectorClids.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
DerivationFramework::CommonAugmentation::finalize
virtual StatusCode finalize() override
Definition
CommonAugmentation.cxx:77
DerivationFramework::CommonAugmentation::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
CommonAugmentation.cxx:55
DerivationFramework::CommonAugmentation::m_chronoSvc
ServiceHandle< IChronoStatSvc > m_chronoSvc
Definition
CommonAugmentation.h:31
DerivationFramework::CommonAugmentation::CommonAugmentation
CommonAugmentation(const std::string &name, ISvcLocator *pSvcLocator)
Definition
CommonAugmentation.cxx:30
DerivationFramework::CommonAugmentation::initialize
virtual StatusCode initialize() override
Definition
CommonAugmentation.cxx:37
DerivationFramework::CommonAugmentation::m_augmentationTools
PublicToolHandleArray< IAugmentationTool > m_augmentationTools
Definition
CommonAugmentation.h:30
Generated on
for ATLAS Offline Software by
1.17.0