CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
edm::EventSetupImpl Class Reference

#include <EventSetupImpl.h>

Public Member Functions

 EventSetupImpl (EventSetupImpl const &)=delete
 
void fillAvailableRecordKeys (std::vector< eventsetup::EventSetupRecordKey > &oToFill) const
 clears the oToFill vector and then fills it with the keys for all available records More...
 
std::optional< eventsetup::EventSetupRecordGenericfind (const eventsetup::EventSetupRecordKey &, unsigned int iTransitionID, ESProxyIndex const *getTokenIndices, ESParentContext const &iParent) const
 
eventsetup::EventSetupRecordImpl const * findImpl (const eventsetup::EventSetupRecordKey &) const
 
eventsetup::EventSetupRecordImpl const * findImpl (ESRecordIndex) const
 
EventSetupImploperator= (EventSetupImpl const &)=delete
 
bool recordIsProvidedByAModule (eventsetup::EventSetupRecordKey const &) const
 
tbb::task_arena * taskArena () const
 
bool validRecord (eventsetup::EventSetupRecordKey const &iKey) const
 
 ~EventSetupImpl ()
 

Protected Member Functions

void addRecordImpl (const eventsetup::EventSetupRecordImpl &iRecord)
 

Private Member Functions

 EventSetupImpl ()=delete
 
 EventSetupImpl (tbb::task_arena *)
 
void insertRecordImpl (const eventsetup::EventSetupRecordKey &, const eventsetup::EventSetupRecordImpl *)
 
void setKeyIters (std::vector< eventsetup::EventSetupRecordKey >::const_iterator const &keysBegin, std::vector< eventsetup::EventSetupRecordKey >::const_iterator const &keysEnd)
 

Private Attributes

std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
 
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_
 
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_
 
tbb::task_arena * taskArena_ = nullptr
 

Friends

class ::testEventsetup
 
class ::testEventsetupRecord
 
class eventsetup::EventSetupProvider
 Only EventSetupProvider allowed to create an EventSetupImpl. More...
 
class eventsetup::EventSetupRecordProvider
 
class ProcessBlockTransitionInfo
 

Detailed Description

Description: Container for all Records dealing with non-RunState info

Usage: <usage>

Definition at line 49 of file EventSetupImpl.h.

Constructor & Destructor Documentation

◆ ~EventSetupImpl()

edm::EventSetupImpl::~EventSetupImpl ( )

Definition at line 28 of file EventSetupImpl.cc.

28 {}

◆ EventSetupImpl() [1/3]

edm::EventSetupImpl::EventSetupImpl ( EventSetupImpl const &  )
delete

◆ EventSetupImpl() [2/3]

edm::EventSetupImpl::EventSetupImpl ( )
privatedelete

◆ EventSetupImpl() [3/3]

edm::EventSetupImpl::EventSetupImpl ( tbb::task_arena *  iArena)
explicitprivate

Definition at line 26 of file EventSetupImpl.cc.

26 : taskArena_{iArena} {}

Member Function Documentation

◆ addRecordImpl()

void edm::EventSetupImpl::addRecordImpl ( const eventsetup::EventSetupRecordImpl iRecord)
protected

◆ fillAvailableRecordKeys()

void edm::EventSetupImpl::fillAvailableRecordKeys ( std::vector< eventsetup::EventSetupRecordKey > &  oToFill) const

clears the oToFill vector and then fills it with the keys for all available records

Definition at line 76 of file EventSetupImpl.cc.

76  {
77  oToFill.clear();
78  oToFill.reserve(recordImpls_.size());
79 
80  for (auto const& recordImpl : recordImpls_) {
81  if (recordImpl != nullptr) {
82  oToFill.push_back(recordImpl->key());
83  }
84  }
85  }

References recordImpls_.

Referenced by edm::EventSetup::fillAvailableRecordKeys().

◆ find()

std::optional< eventsetup::EventSetupRecordGeneric > edm::EventSetupImpl::find ( const eventsetup::EventSetupRecordKey iKey,
unsigned int  iTransitionID,
ESProxyIndex const *  getTokenIndices,
ESParentContext const &  iParent 
) const

Definition at line 45 of file EventSetupImpl.cc.

48  {
49  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
50  if (lb == keysEnd_ || iKey != *lb) {
51  return std::nullopt;
52  }
53  auto index = std::distance(keysBegin_, lb);
54  if (recordImpls_[index] == nullptr) {
55  return std::nullopt;
56  }
57  return eventsetup::EventSetupRecordGeneric(recordImpls_[index], iTransitionID, getTokenIndices, this, &iParent);
58  }

References HLT_FULL_cff::distance, keysBegin_, keysEnd_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, and recordImpls_.

Referenced by edm::EventSetup::find().

◆ findImpl() [1/2]

eventsetup::EventSetupRecordImpl const * edm::EventSetupImpl::findImpl ( const eventsetup::EventSetupRecordKey iKey) const

◆ findImpl() [2/2]

eventsetup::EventSetupRecordImpl const * edm::EventSetupImpl::findImpl ( ESRecordIndex  iKey) const

Definition at line 69 of file EventSetupImpl.cc.

69  {
70  if UNLIKELY (iKey.value() == ESRecordIndex::invalidValue()) {
71  return nullptr;
72  }
73  return recordImpls_[iKey.value()];
74  }

References edm::ESRecordIndex::invalidValue(), recordImpls_, UNLIKELY, and edm::ESRecordIndex::value().

◆ insertRecordImpl()

void edm::EventSetupImpl::insertRecordImpl ( const eventsetup::EventSetupRecordKey iKey,
const eventsetup::EventSetupRecordImpl iRecord 
)
private

Definition at line 30 of file EventSetupImpl.cc.

31  {
32  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
33  if (lb == keysEnd_ || iKey != *lb) {
34  throw cms::Exception("LogicError") << "EventSetupImpl::insert Could not find key\n"
35  << "Should be impossible. Please contact Framework developer.\n";
36  }
37  auto index = std::distance(keysBegin_, lb);
38  recordImpls_[index] = iRecord;
39  }

References HLT_FULL_cff::distance, Exception, keysBegin_, keysEnd_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, and recordImpls_.

Referenced by addRecordImpl().

◆ operator=()

EventSetupImpl& edm::EventSetupImpl::operator= ( EventSetupImpl const &  )
delete

◆ recordIsProvidedByAModule()

bool edm::EventSetupImpl::recordIsProvidedByAModule ( eventsetup::EventSetupRecordKey const &  iKey) const

returns true if the Record is provided by a Source or a Producer a value of true does not mean this EventSetup object holds such a record

Definition at line 87 of file EventSetupImpl.cc.

87  {
88  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
89  return lb != keysEnd_ && iKey == *lb;
90  }

References keysBegin_, keysEnd_, and pfDeepBoostedJetPreprocessParams_cfi::lower_bound.

Referenced by edm::eventsetup::recordDoesExist(), and edm::EventSetup::recordIsProvidedByAModule().

◆ setKeyIters()

void edm::EventSetupImpl::setKeyIters ( std::vector< eventsetup::EventSetupRecordKey >::const_iterator const &  keysBegin,
std::vector< eventsetup::EventSetupRecordKey >::const_iterator const &  keysEnd 
)
private

Definition at line 101 of file EventSetupImpl.cc.

102  {
103  keysBegin_ = keysBegin;
104  keysEnd_ = keysEnd;
105  recordImpls_.resize(keysEnd_ - keysBegin_, nullptr);
106  }

References keysBegin_, keysEnd_, and recordImpls_.

◆ taskArena()

tbb::task_arena* edm::EventSetupImpl::taskArena ( ) const
inline

Definition at line 74 of file EventSetupImpl.h.

74 { return taskArena_; }

References taskArena_.

Referenced by edm::Worker::esPrefetchAsync(), and edm::eventsetup::DataProxy::get().

◆ validRecord()

bool edm::EventSetupImpl::validRecord ( eventsetup::EventSetupRecordKey const &  iKey) const

Definition at line 92 of file EventSetupImpl.cc.

92  {
93  auto lb = std::lower_bound(keysBegin_, keysEnd_, iKey);
94  if (lb != keysEnd_ && iKey == *lb) {
95  auto index = std::distance(keysBegin_, lb);
96  return recordImpls_[index] != nullptr;
97  }
98  return false;
99  }

References HLT_FULL_cff::distance, keysBegin_, keysEnd_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, and recordImpls_.

Friends And Related Function Documentation

◆ ::testEventsetup

friend class ::testEventsetup
friend

Definition at line 78 of file EventSetupImpl.h.

◆ ::testEventsetupRecord

friend class ::testEventsetupRecord
friend

Definition at line 79 of file EventSetupImpl.h.

◆ eventsetup::EventSetupProvider

friend class eventsetup::EventSetupProvider
friend

Only EventSetupProvider allowed to create an EventSetupImpl.

Definition at line 76 of file EventSetupImpl.h.

◆ eventsetup::EventSetupRecordProvider

Definition at line 77 of file EventSetupImpl.h.

◆ ProcessBlockTransitionInfo

friend class ProcessBlockTransitionInfo
friend

Definition at line 80 of file EventSetupImpl.h.

Member Data Documentation

◆ keysBegin_

std::vector<eventsetup::EventSetupRecordKey>::const_iterator edm::EventSetupImpl::keysBegin_
private

◆ keysEnd_

std::vector<eventsetup::EventSetupRecordKey>::const_iterator edm::EventSetupImpl::keysEnd_
private

◆ recordImpls_

std::vector<eventsetup::EventSetupRecordImpl const*> edm::EventSetupImpl::recordImpls_
private

◆ taskArena_

tbb::task_arena* edm::EventSetupImpl::taskArena_ = nullptr
private

Definition at line 99 of file EventSetupImpl.h.

Referenced by taskArena().

edm::ESRecordIndex::invalidValue
static constexpr Value_t invalidValue()
Definition: ESIndices.h:97
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
edm::EventSetupImpl::keysEnd_
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysEnd_
Definition: EventSetupImpl.h:97
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
edm::EventSetupImpl::insertRecordImpl
void insertRecordImpl(const eventsetup::EventSetupRecordKey &, const eventsetup::EventSetupRecordImpl *)
Definition: EventSetupImpl.cc:30
edm::EventSetupImpl::keysBegin_
std::vector< eventsetup::EventSetupRecordKey >::const_iterator keysBegin_
Definition: EventSetupImpl.h:96
Exception
Definition: hltDiff.cc:245
edm::EventSetupImpl::taskArena_
tbb::task_arena * taskArena_
Definition: EventSetupImpl.h:99
edm::EventSetupImpl::recordImpls_
std::vector< eventsetup::EventSetupRecordImpl const * > recordImpls_
Definition: EventSetupImpl.h:98
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7733