ATLAS Offline Software
Classes | Namespaces | Macros | Enumerations
CondCont.h File Reference

Hold mappings of ranges to condition objects. More...

#include "AthenaKernel/ClassID_traits.h"
#include "AthenaKernel/CLASS_DEF.h"
#include "AthenaKernel/BaseInfo.h"
#include "AthenaKernel/RCUUpdater.h"
#include "AthenaKernel/IConditionsCleanerSvc.h"
#include "AthenaKernel/CondObjDeleter.h"
#include "CxxUtils/ConcurrentRangeMap.h"
#include "CxxUtils/ConcurrentPtrSet.h"
#include "CxxUtils/SimpleUpdater.h"
#include "CxxUtils/checker_macros.h"
#include "GaudiKernel/EventIDBase.h"
#include "GaudiKernel/EventIDRange.h"
#include "GaudiKernel/DataObjID.h"
#include "GaudiKernel/StatusCode.h"
#include "GaudiKernel/ServiceHandle.h"
#include "boost/preprocessor/facilities/overload.hpp"
#include <iostream>
#include <set>
#include <vector>
#include <typeinfo>
#include <mutex>
#include <type_traits>
#include "AthenaKernel/CondCont.icc"
#include "AthenaKernel/CondContMaker.h"

Go to the source code of this file.

Classes

class  CondContBase
 Base class for all conditions containers. More...
 
class  CondContBase::Category
 Status code category for ContCont. More...
 
struct  CondContBase::RangeKey
 Range object to store in ConcurrentRangeMap. More...
 
struct  CondContBase::Compare
 Comparison object needed by ConcurrentRangeMap. More...
 
class  CondContSingleBase
 Base class for conditions containers that are either Run+LBN or timestamp. More...
 
class  CondCont< T >
 Hold mapping of ranges to condition objects. More...
 
class  CondContBaseInfo< T >
 Traits class to find the base for CondCont. More...
 
struct  SG::Bases< CondCont< T > >
 
class  CondCont< T >
 Hold mapping of ranges to condition objects. More...
 
class  CondContMixedBase
 Base class for conditions containers for which keys are ranges in both Run+LBN and timestamp. More...
 
class  CondContMixed< T >
 Conditions container for which keys are ranges in both Run+LBN and timestamp. More...
 
class  CondContMixedBaseInfo< T >
 Traits class to find the base for CondContMixed. More...
 
struct  SG::Bases< CondContMixed< T > >
 
class  CondContMixed< T >
 Conditions container for which keys are ranges in both Run+LBN and timestamp. More...
 

Namespaces

 SG
 Forward declaration.
 
 Athena
 Some weak symbol referencing magic...
 

Macros

#define CONDCONT_BASE(D, B)
 Declare that conditions object D derives from B. More...
 
#define CONDCONT_MIXED_BASE(D, B)
 Declare that conditions object D derives from B. More...
 
#define CONCATUNF_(x, y)   x##y
 
#define CONCATUNF(x, y)   CONCATUNF_(x,y)
 
#define UNIQUEVARNAME   CONCATUNF(CONCATUNF(REGCCM_,__COUNTER__),__LINE__)
 
#define CONDCONT_DEF_2(T, CLID_)
 Declare a conditions container along with its CLID. More...
 
#define CONDCONT_DEF_3(T, CLID_, BASE)
 
#define CONDCONT_DEF(...)   BOOST_PP_OVERLOAD(CONDCONT_DEF_, __VA_ARGS__)(__VA_ARGS__)
 
#define CONDCONT_MIXED_DEF_2(T, CLID_)
 Declare a conditions container along with its CLID. More...
 
#define CONDCONT_MIXED_DEF_3(T, CLID_, BASE)
 
#define CONDCONT_MIXED_DEF(...)   BOOST_PP_OVERLOAD(CONDCONT_MIXED_DEF_, __VA_ARGS__)(__VA_ARGS__)
 

Enumerations

enum  CondContStatusCode : StatusCode::code_t {
  CondContStatusCode::FAILURE = 0, CondContStatusCode::SUCCESS = 1, CondContStatusCode::RECOVERABLE = 2, CondContStatusCode::DUPLICATE = 10,
  CondContStatusCode::OVERLAP = 11, CondContStatusCode::EXTENDED = 12
}
 Define extended status codes used by CondCont. More...
 

Detailed Description

Hold mappings of ranges to condition objects.

Author
Vakho, Charles, Scott
Date
2017 Conditions objects of type T are managed by CondCont<T>, which are recorded in the conditions store. CondCont<T> is a map of IOV ranges to payload objects of type T.

A conditions container must be declared as such and given a CLID using the macro CONDCONT_DEF:

CONDCONT_DEF (MyType, 12345);

If one payload class derives from another, it is possible declare conditions containers so that they have the same inheritance by adding the payload base class as a thir argument to CONDCONT_DEF. For example, if MyType derived from MyBase then you can use

CONDCONT_DEF (MyType, 12345, MyBase);

A conditions container declared in this way should have keys that are either ranges in run+lbn or timestamp; they cannot be mixed. However, in the case where one has a conditions algorithm that takes as input both a run+lbn and a timestamp condition, the result will be IOVs that have both run+lbn and timestamp ranges. Such conditions may be stored in a mixed conditions container, declared as:

CONDCONT_MIXED_DEF (MyType, 12345);

CondCont<MyType> is now declared as a mixed container. Mixed containers may also participate in inheritance, but the base class declared for a mixed container must also have been declared as mixed.

Implementation notes: All conditions containers derive from CondContBase. This defines virtual functions that are used by the IOV services. CondContSingleBase derives from this and collects non-templated implementations used by non-mixed containers; most virtual functions can be declared final here. Finally, CondCont<T> derives from CondContSingleBase and implements the type-specific part.

We reduce the amount of templated code that must be instantiated by storing the payloads as void* in the underlying ConcurrentRangeMap. All this needs to do with the payloads is to be able to delete them; we handle this by giving ConcurrentRangeMap a function to call to delete a payload.

For the case of mixed containers, rather than having the ConcurrentRangeMap store the payload directly, it instead holds another ConcurrentRangeMap which in turn hold the payload. The top map is indexed by run+lbn and the secondary ones by timestamp.

For mixed containers, we have CondContMixedBase deriving from CondContBase and CondContMixed<T> deriving from that. The CONDCONT_MIXED_DEF macro then specializes CondCont<T> so that it derives from CondContMixed<T>

Definition in file CondCont.h.

Macro Definition Documentation

◆ CONCATUNF

#define CONCATUNF (   x,
  y 
)    CONCATUNF_(x,y)

Definition at line 1397 of file CondCont.h.

◆ CONCATUNF_

#define CONCATUNF_ (   x,
  y 
)    x##y

Definition at line 1396 of file CondCont.h.

◆ CONDCONT_BASE

#define CONDCONT_BASE (   D,
 
)
Value:
template <> \
{ \
public: \
typedef CondCont<B> Base; \
}; \
SG_BASES(D, B)

Declare that conditions object D derives from B.

This allows using ReadCondHandle to retrieve a conditions object of type D as B.

Definition at line 847 of file CondCont.h.

◆ CONDCONT_DEF

#define CONDCONT_DEF (   ...)    BOOST_PP_OVERLOAD(CONDCONT_DEF_, __VA_ARGS__)(__VA_ARGS__)

Definition at line 1414 of file CondCont.h.

◆ CONDCONT_DEF_2

#define CONDCONT_DEF_2 (   T,
  CLID_ 
)
Value:
CLASS_DEF( CondCont<T>, CLID_, 1) \
static CondContainer::CondContMaker<T> maker_ ## CLID_ {}

Declare a conditions container along with its CLID.

Definition at line 1408 of file CondCont.h.

◆ CONDCONT_DEF_3

#define CONDCONT_DEF_3 (   T,
  CLID_,
  BASE 
)
Value:
CONDCONT_BASE(T, BASE); \
CONDCONT_DEF_2(T, CLID_)

Definition at line 1411 of file CondCont.h.

◆ CONDCONT_MIXED_BASE

#define CONDCONT_MIXED_BASE (   D,
 
)
Value:
template <> \
{ \
public: \
static_assert (std::is_base_of_v<CondContMixed<B>, CondCont<B> >, \
"CondCont<" #B "> is not a mixed conditions container."); \
typedef CondCont<B> Base; \
}; \
SG_BASES(D, B)

Declare that conditions object D derives from B.

This allows using ReadCondHandle to retrieve a conditions object of type D as B.

Definition at line 1232 of file CondCont.h.

◆ CONDCONT_MIXED_DEF

#define CONDCONT_MIXED_DEF (   ...)    BOOST_PP_OVERLOAD(CONDCONT_MIXED_DEF_, __VA_ARGS__)(__VA_ARGS__)

Definition at line 1447 of file CondCont.h.

◆ CONDCONT_MIXED_DEF_2

#define CONDCONT_MIXED_DEF_2 (   T,
  CLID_ 
)
Value:
template<> class CondCont<T> : public CondContMixed<T> { \
public: \
CondCont (Athena::IRCUSvc& rcusvc, const DataObjID& id, \
SG::DataProxy* proxy =nullptr, size_t capacity = 16) \
: CondContMixed<T> (rcusvc, CLID_, id, proxy, capacity) {} \
protected: \
CondCont (Athena::IRCUSvc& rcusvc, CLID clid, const DataObjID& id, \
std::shared_ptr<typename CondContSet::IPayloadDeleter> payloadDeleter, \
size_t capacity = 16) \
: CondContMixed<T> (rcusvc, clid, id, proxy, \
payloadDeleter, capacity) {} \
}; \
CLASS_DEF( CondCont<T>, CLID_, 1) \
static CondContainer::CondContMaker<T> maker_ ## CLID_ {}

Declare a conditions container along with its CLID.

Definition at line 1427 of file CondCont.h.

◆ CONDCONT_MIXED_DEF_3

#define CONDCONT_MIXED_DEF_3 (   T,
  CLID_,
  BASE 
)
Value:
CONDCONT_MIXED_DEF_2(T, CLID_)

Definition at line 1444 of file CondCont.h.

◆ UNIQUEVARNAME

#define UNIQUEVARNAME   CONCATUNF(CONCATUNF(REGCCM_,__COUNTER__),__LINE__)

Definition at line 1398 of file CondCont.h.

Enumeration Type Documentation

◆ CondContStatusCode

enum CondContStatusCode : StatusCode::code_t
strong

Define extended status codes used by CondCont.

We add DUPLICATE, OVERLAP, and EXTENDED.

Enumerator
FAILURE 
SUCCESS 
RECOVERABLE 
DUPLICATE 
OVERLAP 
EXTENDED 

Definition at line 107 of file CondCont.h.

108 {
109  FAILURE = 0,
110  SUCCESS = 1,
111  RECOVERABLE = 2,
112 
113  // Attempt to insert an item in a CondCont with a range duplicating
114  // an existing one. The original contents of the container are unchanged,
115  // and the new item has been deleted.
116  // This is classified as Success.
117  DUPLICATE = 10,
118 
119  // Attempt to insert an item in a CondCont with a range that partially
120  // overlaps with an existing one.
121  // This is classified as Success.
122  OVERLAP = 11,
123 
124  // Attempt to insert an item in a CondCont where the new range is an extension
125  // of the last range. That is, the start time of the new range matches
126  // that of the last range in the container, and the end time of the new range
127  // is larger than that of the last range in the container. The end time
128  // of the last range has been extended to match the new range.
129  // The payload of the existing range is unchanged, and the new
130  // item has been deleted.
131  EXTENDED = 12
132 };
CondContMixedBaseInfo
Traits class to find the base for CondContMixed.
Definition: CondCont.h:1210
CondContBaseInfo
Traits class to find the base for CondCont.
Definition: CondCont.h:823
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
CONDCONT_DEF
#define CONDCONT_DEF(...)
Definition: CondCont.h:1413
CondContainer::CondContMaker
Definition: CondContMaker.h:21
CondContStatusCode::DUPLICATE
@ DUPLICATE
CondContMixed
Conditions container for which keys are ranges in both Run+LBN and timestamp.
Definition: CondCont.h:1198
CondContStatusCode::OVERLAP
@ OVERLAP
Base
Athena::IRCUSvc
Interface for RCU service.
Definition: IRCUSvc.h:40
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
CONDCONT_MIXED_BASE
#define CONDCONT_MIXED_BASE(D, B)
Declare that conditions object D derives from B.
Definition: CondCont.h:1231
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
CondContStatusCode::RECOVERABLE
@ RECOVERABLE
CONDCONT_BASE
#define CONDCONT_BASE(D, B)
Declare that conditions object D derives from B.
Definition: CondCont.h:846
CondCont
Hold mapping of ranges to condition objects.
Definition: CondCont.h:811
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
CondContStatusCode::FAILURE
@ FAILURE
CondContStatusCode::EXTENDED
@ EXTENDED
SG::DataProxy
Definition: DataProxy.h:44
HTXS::SUCCESS
@ SUCCESS
successful classification
Definition: HiggsTemplateCrossSectionsDefs.h:14
CONDCONT_MIXED_DEF
#define CONDCONT_MIXED_DEF(...)
Definition: CondCont.h:1446
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35