ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
xAODRootAccess
Root
TEventFormatRegistry.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
CxxUtils/checker_macros.h
"
6
#include "
xAODRootAccess/tools/TEventFormatRegistry.h
"
7
8
#include <TFile.h>
9
10
#include <mutex>
11
12
namespace
xAOD
{
13
14
const
TEventFormatRegistry
&
TEventFormatRegistry::instance
() {
15
16
static
const
TEventFormatRegistry
instance
;
17
return
instance
;
18
}
19
20
EventFormat
&
TEventFormatRegistry::getEventFormat
(
const
TFile*
file
)
const
{
21
22
static
std::mutex
mutex
;
23
std::scoped_lock
lock
(
mutex
);
24
auto
this_nc
ATLAS_THREAD_SAFE
=
const_cast<
TEventFormatRegistry
*
>
(
this
);
25
return
this_nc->m_eventFormats[
file
];
26
}
27
28
void
TEventFormatRegistry::merge
(
const
TFile*
file
,
29
const
EventFormat
& ef ) {
30
31
// Get the local EventFormat object:
32
EventFormat
& localEf =
getEventFormat
(
file
);
33
34
// Loop over the contents of the new object:
35
EventFormat::const_iterator
itr = ef.begin();
36
EventFormat::const_iterator
end = ef.end();
37
for
( ; itr != end; ++itr ) {
38
// If it's already in the output, continue:
39
if
( localEf.
exists
( itr->first ) )
continue
;
40
// If not, let's add it:
41
localEf.
add
( *( ef.get( itr->first ) ) );
42
}
43
}
44
45
TEventFormatRegistry::TEventFormatRegistry
()
46
:
m_eventFormats
() {
47
48
}
49
50
}
// namespace xAOD
lock
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
TEventFormatRegistry.h
checker_macros.h
Define macros for attributes used to control the static checker.
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition
checker_macros.h:211
mutex
STL class.
xAOD::EventFormat_v1::const_iterator
KeyedData_t::const_iterator const_iterator
Iterator for looping over the elements of the object.
Definition
EventFormat_v1.h:67
xAOD::EventFormat_v1::add
void add(const EventFormatElement &element, bool updatePersistent=true)
Add the description of a new branch.
Definition
EventFormat_v1.cxx:43
xAOD::EventFormat_v1::exists
bool exists(const std::string &key) const
Check if a description exists about a given branch.
Definition
EventFormat_v1.cxx:65
xAOD::TEventFormatRegistry::m_eventFormats
std::map< const TFile *, EventFormat > m_eventFormats
The process-wide event format object.
Definition
TEventFormatRegistry.h:43
xAOD::TEventFormatRegistry::instance
static const TEventFormatRegistry & instance()
Access the only instance of the object in memory.
Definition
TEventFormatRegistry.cxx:14
xAOD::TEventFormatRegistry::getEventFormat
EventFormat & getEventFormat(const TFile *file) const
Access the managed EventFormat object.
Definition
TEventFormatRegistry.cxx:20
xAOD::TEventFormatRegistry::TEventFormatRegistry
TEventFormatRegistry()
Hidden constructor.
Definition
TEventFormatRegistry.cxx:45
xAOD::TEventFormatRegistry::merge
void merge(const TFile *file, const EventFormat &ef)
Merge the contents of another EventFormat object into the managed one.
Definition
TEventFormatRegistry.cxx:28
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
xAOD::EventFormat
EventFormat_v1 EventFormat
Definition of the current event format version.
Definition
EventFormat.h:16
file
TFile * file
Definition
tile_monitor.h:29
Generated on
for ATLAS Offline Software by
1.17.0