ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
EventBookkeeperTools
util
dump-cbk.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Setup for reading ATLAS data
6
#ifdef XAOD_STANDALONE
7
#include <
xAODRootAccess/Init.h
>
8
#include <
xAODRootAccess/TEvent.h
>
9
#else
10
#include <
POOLRootAccess/TEvent.h
>
11
#endif
12
#include <
xAODRootAccess/tools/TFileAccessTracer.h
>
13
14
// ASG
15
#include <
AsgMessaging/MessageCheck.h
>
16
#include <
AsgTools/StandaloneToolHandle.h
>
17
#include <
AsgTools/AsgMetadataTool.h
>
18
19
ANA_MSG_HEADER
(
CutFlow
)
20
ANA_MSG_SOURCE
(
CutFlow
,
"Dump"
)
21
22
// ROOT dependencies
23
#include <TFile.h>
24
25
// Main routine... here we go!
26
int
main
(
int
argc,
char
**argv)
27
{
28
// Make sure things know we are not in StatusCode land
29
using namespace
CutFlow
;
30
ANA_CHECK_SET_TYPE
(
int
);
31
32
if
(argc < 2) {
33
ANA_MSG_ERROR
(
"Input file missing."
);
34
return
1;
35
}
36
const
char
*inputFile = argv[1];
37
38
// Setup for reading -- if this fails, we have major problems
39
#ifdef XAOD_STANDALONE
40
if
( !
xAOD::Init
().isSuccess() ) {
41
throw
std::runtime_error(
"Cannot initialise xAOD access !"
);
42
}
43
ANA_MSG_INFO
(
"Using xAOD access"
);
44
#else
45
IAppMgrUI *app =
POOL::Init
();
46
ANA_MSG_INFO
(
"Using POOL access"
);
47
#endif
48
49
xAOD::TFileAccessTracer::instance
().
enableDataSubmission
(
false
);
50
51
ANA_MSG_INFO
(
"Reading file:"
<< inputFile);
52
53
// Input chain
54
std::unique_ptr<TFile>
file
(TFile::Open(inputFile,
"READ"
));
55
ANA_CHECK
(
file
.get());
56
#ifdef XAOD_STANDALONE
57
xAOD::TEvent
event(
xAOD::TEvent::kClassAccess
);
58
#else
59
POOL::TEvent
event(
POOL::TEvent::kClassAccess
);
60
#endif
61
ANA_CHECK
(event.readFrom(
file
.get()));
62
63
// Load metadata
64
event
.getEntries();
65
66
// Retrieve the tool
67
asg::StandaloneToolHandle<asg::AsgMetadataTool>
tool(
"BookkeeperDumperTool/BookkeeperDumperTool"
);
68
ANA_CHECK
(tool.setProperty(
"StandaloneMode"
,
true
));
69
ANA_CHECK
(tool.setProperty(
"AllVariations"
,
true
));
70
ANA_CHECK
(tool.retrieve());
71
72
// Trigger finalization of all services and tools created by the Gaudi Application
73
#ifndef XAOD_STANDALONE
74
app->finalize().ignore();
75
#endif
76
77
return
0;
78
}
AsgMetadataTool.h
MessageCheck.h
macros for messaging and checking status codes
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
ANA_MSG_HEADER
#define ANA_MSG_HEADER(NAME)
for standalone code this creates a new message category
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:113
ANA_MSG_SOURCE
#define ANA_MSG_SOURCE(NAME, TITLE)
the source code part of ANA_MSG_SOURCE
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:133
ANA_CHECK_SET_TYPE
#define ANA_CHECK_SET_TYPE(TYPE)
set the type for ANA_CHECK to report failures
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:314
TEvent.h
Init.h
TEvent.h
StandaloneToolHandle.h
TFileAccessTracer.h
CutFlow
Definition
CutFlow.h:166
POOL::TEvent
Definition
PhysicsAnalysis/POOLRootAccess/POOLRootAccess/TEvent.h:40
POOL::TEvent::kClassAccess
@ kClassAccess
Definition
PhysicsAnalysis/POOLRootAccess/POOLRootAccess/TEvent.h:46
asg::StandaloneToolHandle
an "initializing" ToolHandle for stand-alone applications
Definition
StandaloneToolHandle.h:44
xAOD::TEvent
Tool for accessing xAOD files outside of Athena.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:59
xAOD::TEvent::kClassAccess
@ kClassAccess
Access auxiliary data using the aux containers.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:73
xAOD::TFileAccessTracer::enableDataSubmission
void enableDataSubmission(bool value)
Function for turning data submission on/off.
Definition
TFileAccessTracer.cxx:322
xAOD::TFileAccessTracer::instance
static TFileAccessTracer & instance()
Access the singleton instance of this class.
Definition
TFileAccessTracer.cxx:263
main
int main()
Definition
hello.cxx:18
POOL::Init
IAppMgrUI * Init(const char *options="POOLRootAccess/basic.opts")
Bootstraps (creates and configures) the Gaudi Application with the provided options file.
Definition
PhysicsAnalysis/POOLRootAccess/src/TEvent.cxx:29
xAOD::Init
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
Definition
Init.cxx:31
file
TFile * file
Definition
tile_monitor.h:29
Generated on
for ATLAS Offline Software by
1.17.0