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 
42 
43 namespace DerivationFramework {
44 
45  //--------------------------------------------------------------------------
47  const std::string& n,
48  const IInterface* p)
49  : AthAlgTool(t,n,p) {
50 
51  declareInterface<DerivationFramework::IAugmentationTool>(this);
52 
53  // Declare BPhysTrackVertexMapTool handles
54  declareProperty("TrackVertexMapTools", m_ttvmTools);
55 
56  // Enable log output?
57  declareProperty("Enable", m_enable = true);
58  }
59  //--------------------------------------------------------------------------
61 
62  ATH_MSG_DEBUG("BTrackVertexMapLogger::initialize() -- begin");
63 
64  // get the BPhysTrackVertexMapTools
65  if ( m_enable ) {
66  for (auto ttvmTool : m_ttvmTools) {
67  ATH_CHECK( ttvmTool.retrieve() );
68  ATH_MSG_INFO("initialize: Successfully retrieved "
69  << ttvmTool.name() << " ....");
70  }
71  } // if m_enable
72 
73  ATH_MSG_DEBUG("BTrackVertexMapLogger::initialize() -- end");
74 
75  return StatusCode::SUCCESS;
76  }
77  //--------------------------------------------------------------------------
79 
80  ATH_MSG_DEBUG("BTrackVertexMapLogger::finalize()");
81 
82  // everything all right
83  return StatusCode::SUCCESS;
84  }
85  //--------------------------------------------------------------------------
87 
88  ATH_MSG_DEBUG("BTrackVertexMapLogger::addBranches()");
89 
90  // call the BPhysTrackVertexMapTools
91  if ( m_enable ) {
92  for (auto ttvmTool : m_ttvmTools) {
93  if ( ttvmTool->doLog() ) {
94  ATH_MSG_INFO("addBranches: dump for " << ttvmTool.name() << ":");
95  ATH_CHECK( ttvmTool->logEvent() );
96  } // if doLog()
97  } // for
98  } // if m_enable
99 
100  // still everything is ok
101  return StatusCode::SUCCESS;
102  }
103  //--------------------------------------------------------------------------
104 }
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
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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:210
beamspotman.n
n
Definition: beamspotman.py:731
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:43
BTrackVertexMapLogger.h
DerivationFramework::BTrackVertexMapLogger::finalize
virtual StatusCode finalize()
Definition: BTrackVertexMapLogger.cxx:78
DerivationFramework::BTrackVertexMapLogger::addBranches
virtual StatusCode addBranches() const
Pass the thinning service
Definition: BTrackVertexMapLogger.cxx:86
DerivationFramework::BTrackVertexMapLogger::initialize
virtual StatusCode initialize()
Definition: BTrackVertexMapLogger.cxx:60
AthAlgTool
Definition: AthAlgTool.h:26
DerivationFramework::BTrackVertexMapLogger::m_enable
bool m_enable
Definition: BTrackVertexMapLogger.h:44