ATLAS Offline Software
RootReaderD3PDSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // Gaudi/Athena include(s):
8 
9 // Local include(s):
10 #include "RootReaderD3PDSvc.h"
11 #include "RootReaderD3PD_v1.h"
12 #include "RootReaderD3PD_v2.h"
13 
14 namespace D3PD {
15 
16  RootReaderD3PDSvc::RootReaderD3PDSvc( const std::string& name, ISvcLocator* svcloc )
17  : AthService( name, svcloc ) {
18 
19  declareProperty( "Version", m_version = 2,
20  "Version of the D3PDReader code to be generated" );
21  }
22 
24 
25  if( ( m_version < 1 ) || ( m_version > 2 ) ) {
26  REPORT_MESSAGE( MSG::ERROR ) << "D3PDReader version " << m_version
27  << " not known";
28  return StatusCode::FAILURE;
29  }
30 
31  ATH_MSG_INFO( "Generating sources of version: " << m_version );
32 
33  return StatusCode::SUCCESS;
34  }
35 
37 
38  // Delete all the D3PD objects from memory:
41  for( ; itr != end; ++itr ) {
42  delete ( *itr );
43  }
44  m_d3pds.clear();
45 
46  return StatusCode::SUCCESS;
47  }
48 
49  StatusCode RootReaderD3PDSvc::make( const std::string& name, ID3PD*& d3pd ) {
50 
51  // Create a new D3PD:
52  ID3PD* d = 0;
53  switch( m_version ) {
54  case 1:
55  REPORT_MESSAGE( MSG::VERBOSE ) << "Creating RootReaderD3PD_v1 with name: "
56  << name;
57  d = new RootReaderD3PD_v1();
58  break;
59  case 2:
60  REPORT_MESSAGE( MSG::VERBOSE ) << "Creating RootReaderD3PD_v2 with name: "
61  << name;
62  d = new RootReaderD3PD_v2();
63  break;
64  default:
65  REPORT_MESSAGE( MSG::ERROR ) << "Version number not recognised!";
66  return StatusCode::FAILURE;
67  break;
68  }
69 
70  m_d3pds.push_back( d );
71  d3pd = d;
72 
73  // This function can actually never fail...
74  return StatusCode::SUCCESS;
75  }
76 
78  void** ppvIf ) {
79 
80  if( riid == ID3PDSvc::interfaceID() ) {
81  *ppvIf = static_cast< ID3PDSvc* >( this );
82  addRef();
83  return StatusCode::SUCCESS;
84  }
85 
86  return AthService::queryInterface( riid, ppvIf );
87  }
88 
89 } // namespace D3PD
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
D3PD::ID3PD
Define an abstract interface for building a D3PD tree.
Definition: ID3PD.h:37
RootReaderD3PDSvc.h
hist_file_dump.d
d
Definition: hist_file_dump.py:137
D3PD::RootReaderD3PDSvc::initialize
virtual StatusCode initialize()
Standatd Gaudi initialization function.
Definition: RootReaderD3PDSvc.cxx:23
D3PD::RootReaderD3PDSvc::m_d3pds
std::vector< ID3PD * > m_d3pds
Internal list of all the created D3PD objects.
Definition: RootReaderD3PDSvc.h:58
D3PD::RootReaderD3PD_v1
D3PD class used for generating ROOT D3PDReader classes.
Definition: RootReaderD3PD_v1.h:26
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
D3PD::RootReaderD3PDSvc::finalize
virtual StatusCode finalize()
Standard Gaudi finalization function.
Definition: RootReaderD3PDSvc.cxx:36
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
D3PD::RootReaderD3PDSvc::RootReaderD3PDSvc
RootReaderD3PDSvc(const std::string &name, ISvcLocator *svcloc)
Standard Service constructor.
Definition: RootReaderD3PDSvc.cxx:16
D3PD::RootReaderD3PDSvc::make
virtual StatusCode make(const std::string &name, ID3PD *&d3pd)
Function implementing the ID3PDSvc interface.
Definition: RootReaderD3PDSvc.cxx:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthService
Definition: AthService.h:32
D3PD::RootReaderD3PD_v2
D3PD class used for generating ROOT D3PDReader classes.
Definition: RootReaderD3PD_v2.h:26
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
errorcheck.h
Helpers for checking error return status codes and reporting errors.
REPORT_MESSAGE
#define REPORT_MESSAGE(LVL)
Report a message.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:365
RootReaderD3PD_v2.h
D3PD::RootReaderD3PDSvc::m_version
int m_version
D3PDReader version to use.
Definition: RootReaderD3PDSvc.h:61
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
D3PD::ID3PDSvc
Abstract interface for service to create D3PD trees.
Definition: ID3PDSvc.h:34
RootReaderD3PD_v1.h
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
D3PD::RootReaderD3PDSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvIf)
Gaudi framework function declaring the implemented interfaces.
Definition: RootReaderD3PDSvc.cxx:77