ATLAS Offline Software
BTrackVertexMapLogger.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //============================================================================
6 // BTrackVertexMapLogger.cxx
7 //============================================================================
8 //
9 // Author : Wolfgang Walkowiak <Wolfgang.Walkowiak@cern.ch.>
10 // Changes:
11 // - w.w., 2017-01-22: Added use of BPhysMetaDataTool.
12 //
13 // Store JO metadata in the output file.
14 //
15 // It uses the BPhysMetaDataTool (default) or the IOVDbMetaDataTool to
16 // store job option information as metadata in a specific branch whose
17 // name needs to prefixed by the deriviation format name.
18 // Note: Metadata stored by the IOVDbMetaDataTool is not readable on
19 // 'RootCore' level.
20 //
21 // This is a base class. Inherit from it to add the job options you want
22 // to store. For a usage example, see
23 // Bmumu_metadata.h / Bmumu_metadata.cxx
24 // and
25 // BPHY8.py .
26 //
27 // Job options provided by the base class:
28 // - DerivationName -- assign the name of the derivation format
29 // - MetadataFolderName -- assign the name of the metadata folder,
30 // should start with the derivation format name,
31 // defaults to DerivationName if not set.
32 // - UseIOVDbMetaDataTool -- use the IOVDbMetaDataTool to store
33 // the additional metadata
34 // - UseBPhysMetaDataTool -- use the BPhysMetaDataTool to store
35 // the additional metadata
36 //
37 //============================================================================
38 //
39 
40 #include "BTrackVertexMapLogger.h"
42 
43 namespace DerivationFramework {
44 
45  //--------------------------------------------------------------------------
47  const std::string& n,
48  const IInterface* p)
49  : base_class(t,n,p) {
50 
51  // Declare BPhysTrackVertexMapTool handles
52  declareProperty("TrackVertexMapTools", m_ttvmTools);
53 
54  // Enable log output?
55  declareProperty("Enable", m_enable = true);
56  }
57  //--------------------------------------------------------------------------
59 
60  ATH_MSG_DEBUG("BTrackVertexMapLogger::initialize() -- begin");
61 
62  // get the BPhysTrackVertexMapTools
63  if ( m_enable ) {
64  for (auto ttvmTool : m_ttvmTools) {
65  ATH_CHECK( ttvmTool.retrieve() );
66  ATH_MSG_INFO("initialize: Successfully retrieved "
67  << ttvmTool.name() << " ....");
68  }
69  } // if m_enable
70 
71  ATH_MSG_DEBUG("BTrackVertexMapLogger::initialize() -- end");
72 
73  return StatusCode::SUCCESS;
74  }
75  //--------------------------------------------------------------------------
77 
78  ATH_MSG_DEBUG("BTrackVertexMapLogger::finalize()");
79 
80  // everything all right
81  return StatusCode::SUCCESS;
82  }
83  //--------------------------------------------------------------------------
85 
86  ATH_MSG_DEBUG("BTrackVertexMapLogger::addBranches()");
87 
88  // call the BPhysTrackVertexMapTools
89  if ( m_enable ) {
90  for (auto ttvmTool : m_ttvmTools) {
91  if ( ttvmTool->doLog() ) {
92  ATH_MSG_INFO("addBranches: dump for " << ttvmTool.name() << ":");
93  ATH_CHECK( ttvmTool->logEvent() );
94  } // if doLog()
95  } // for
96  } // if m_enable
97 
98  // still everything is ok
99  return StatusCode::SUCCESS;
100  }
101  //--------------------------------------------------------------------------
102 }
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::BTrackVertexMapLogger::BTrackVertexMapLogger
BTrackVertexMapLogger(const std::string &t, const std::string &n, const IInterface *p)
Definition: BTrackVertexMapLogger.cxx:46
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
beamspotman.n
n
Definition: beamspotman.py:729
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::BTrackVertexMapLogger::m_ttvmTools
ToolHandleArray< xAOD::IBPhysTrackVertexMapTool > m_ttvmTools
Definition: BTrackVertexMapLogger.h:42
BTrackVertexMapLogger.h
DerivationFramework::BTrackVertexMapLogger::finalize
virtual StatusCode finalize()
Definition: BTrackVertexMapLogger.cxx:76
DerivationFramework::BTrackVertexMapLogger::addBranches
virtual StatusCode addBranches() const
Definition: BTrackVertexMapLogger.cxx:84
DerivationFramework::BTrackVertexMapLogger::initialize
virtual StatusCode initialize()
Definition: BTrackVertexMapLogger.cxx:58
DerivationFramework::BTrackVertexMapLogger::m_enable
bool m_enable
Definition: BTrackVertexMapLogger.h:43