ATLAS Offline Software
Loading...
Searching...
No Matches
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
7
8#include <TFile.h>
9
10#include <mutex>
11
12namespace xAOD {
13
19
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
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
49
50} // namespace xAOD
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
STL class.
KeyedData_t::const_iterator const_iterator
Iterator for looping over the elements of the object.
void add(const EventFormatElement &element, bool updatePersistent=true)
Add the description of a new branch.
bool exists(const std::string &key) const
Check if a description exists about a given branch.
std::map< const TFile *, EventFormat > m_eventFormats
The process-wide event format object.
static const TEventFormatRegistry & instance()
Access the only instance of the object in memory.
EventFormat & getEventFormat(const TFile *file) const
Access the managed EventFormat object.
TEventFormatRegistry()
Hidden constructor.
void merge(const TFile *file, const EventFormat &ef)
Merge the contents of another EventFormat object into the managed one.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
EventFormat_v1 EventFormat
Definition of the current event format version.
Definition EventFormat.h:16
TFile * file