ATLAS Offline Software
Functions
dump-cbk.cxx File Reference
#include <POOLRootAccess/TEvent.h>
#include <xAODRootAccess/tools/TFileAccessTracer.h>
#include <AsgMessaging/MessageCheck.h>
#include <AsgTools/StandaloneToolHandle.h>
#include <AsgTools/AsgMetadataTool.h>
#include <TFile.h>
Include dependency graph for dump-cbk.cxx:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 26 of file dump-cbk.cxx.

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 
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
58 #else
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 }
xAOD::TFileAccessTracer::enableDataSubmission
static void enableDataSubmission(::Bool_t value)
Function for turning data submission on/off.
Definition: TFileAccessTracer.cxx:281
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
LArCellConditions.argv
argv
Definition: LArCellConditions.py:112
xAOD::TEvent::kClassAccess
@ kClassAccess
Access auxiliary data using the aux containers.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:97
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
POOL::TEvent::kClassAccess
@ kClassAccess
Definition: PhysicsAnalysis/POOLRootAccess/POOLRootAccess/TEvent.h:45
POOL::TEvent::readFrom
StatusCode readFrom(TFile *file)
Definition: PhysicsAnalysis/POOLRootAccess/src/TEvent.cxx:132
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
asg::StandaloneToolHandle
an "initializing" ToolHandle for stand-alone applications
Definition: StandaloneToolHandle.h:44
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
file
TFile * file
Definition: tile_monitor.h:29
CutFlow
Definition: CutFlow.h:166
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
POOL::TEvent
Definition: PhysicsAnalysis/POOLRootAccess/POOLRootAccess/TEvent.h:39
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
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
xAOD::TEvent
Tool for accessing xAOD files outside of Athena.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:81
xAOD::Init
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
Definition: Init.cxx:31