CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
FWLiteESSource Class Reference
Inheritance diagram for FWLiteESSource:
edm::eventsetup::DataProxyProvider edm::EventSetupRecordIntervalFinder

Public Types

using EventSetupRecordKey = edm::eventsetup::EventSetupRecordKey
 

Public Member Functions

 FWLiteESSource (const FWLiteESSource &)=delete
 
 FWLiteESSource (edm::ParameterSet const &iPS)
 
const FWLiteESSourceoperator= (const FWLiteESSource &)=delete
 
 ~FWLiteESSource () override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
virtual void updateLookup (ESRecordsToProxyIndices const &)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Private Member Functions

void delaySettingRecords () override
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
void setIntervalFor (const EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 

Private Attributes

fwlite::EventSetup m_es
 
std::unique_ptr< TFile > m_file
 
std::map< EventSetupRecordKey, fwlite::RecordIDm_keyToID
 
std::mutex m_mutex
 
edm::SerialTaskQueue m_queue
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 99 of file FWLiteESSource.cc.

Member Typedef Documentation

◆ EventSetupRecordKey

Definition at line 106 of file FWLiteESSource.cc.

Constructor & Destructor Documentation

◆ FWLiteESSource() [1/2]

FWLiteESSource::FWLiteESSource ( edm::ParameterSet const &  iPS)

Definition at line 123 of file FWLiteESSource.cc.

124  : m_file(TFile::Open(iPS.getParameter<std::string>("fileName").c_str())), m_es(m_file.get()) {}

◆ FWLiteESSource() [2/2]

FWLiteESSource::FWLiteESSource ( const FWLiteESSource )
delete

◆ ~FWLiteESSource()

FWLiteESSource::~FWLiteESSource ( )
override

Definition at line 126 of file FWLiteESSource.cc.

126 {}

Member Function Documentation

◆ delaySettingRecords()

void FWLiteESSource::delaySettingRecords ( )
overrideprivatevirtual

override this method if you need to delay setting what records you will be using until after all modules are loaded

Reimplemented from edm::EventSetupRecordIntervalFinder.

Definition at line 166 of file FWLiteESSource.cc.

166  {
168  std::vector<std::string> recordNames = m_es.namesOfAvailableRecords();
169 
170  for (std::vector<std::string>::const_iterator it = recordNames.begin(), itEnd = recordNames.end(); it != itEnd;
171  ++it) {
172  HCTypeTag t = HCTypeTag::findType(*it);
173  if (t != HCTypeTag()) {
177  m_keyToID[key] = m_es.recordID(it->c_str());
178  }
179  }
180 }

References edm::EventSetupRecordIntervalFinder::findingRecordWithKey(), edm::typelookup::findType(), crabWrapper::key, m_es, m_keyToID, fwlite::EventSetup::namesOfAvailableRecords(), fwlite::EventSetup::recordID(), submitPVValidationJobs::t, and edm::eventsetup::DataProxyProvider::usingRecordWithKey().

◆ operator=()

const FWLiteESSource& FWLiteESSource::operator= ( const FWLiteESSource )
delete

◆ registerProxies()

edm::eventsetup::DataProxyProvider::KeyedProxiesVector FWLiteESSource::registerProxies ( const EventSetupRecordKey iRecordKey,
unsigned int  iovIndex 
)
overrideprivatevirtual

Implements edm::eventsetup::DataProxyProvider.

Definition at line 128 of file FWLiteESSource.cc.

129  {
130  KeyedProxiesVector keyedProxiesVector;
132 
133  fwlite::RecordID recID = m_keyToID[iRecordKey];
134  const fwlite::Record& rec = m_es.get(recID);
135  typedef std::vector<std::pair<std::string, std::string> > TypesAndLabels;
136  TypesAndLabels typesAndLabels = rec.typeAndLabelOfAvailableData();
137 
138  std::cout << "Looking for data in record " << iRecordKey.name() << std::endl;
139  for (TypesAndLabels::const_iterator it = typesAndLabels.begin(), itEnd = typesAndLabels.end(); it != itEnd; ++it) {
140  std::cout << " need type " << it->first << std::endl;
141  HCTypeTag tt = HCTypeTag::findType(it->first);
142  if (tt != HCTypeTag()) {
143  edm::eventsetup::DataKey dk(tt, edm::eventsetup::IdTags(it->second.c_str()));
144  keyedProxiesVector.emplace_back(dk, std::make_shared<FWLiteProxy>(TypeID(tt.value()), &rec, &m_queue, &m_mutex));
145  } else {
146  LogDebug("UnknownESType") << "The type '" << it->first << "' is unknown in this job";
147  std::cout << " *****FAILED*****" << std::endl;
148  }
149  }
150  return keyedProxiesVector;
151 }

References gather_cfg::cout, edm::typelookup::findType(), fwlite::EventSetup::get(), LogDebug, m_es, m_keyToID, m_mutex, m_queue, edm::eventsetup::EventSetupRecordKey::name(), groupFilesInBlocks::tt, and fwlite::Record::typeAndLabelOfAvailableData().

◆ setIntervalFor()

void FWLiteESSource::setIntervalFor ( const EventSetupRecordKey iKey,
const edm::IOVSyncValue iSync,
edm::ValidityInterval oIOV 
)
overrideprivatevirtual

Member Data Documentation

◆ m_es

fwlite::EventSetup FWLiteESSource::m_es
private

Definition at line 117 of file FWLiteESSource.cc.

Referenced by delaySettingRecords(), registerProxies(), and setIntervalFor().

◆ m_file

std::unique_ptr<TFile> FWLiteESSource::m_file
private

Definition at line 116 of file FWLiteESSource.cc.

◆ m_keyToID

std::map<EventSetupRecordKey, fwlite::RecordID> FWLiteESSource::m_keyToID
private

Definition at line 118 of file FWLiteESSource.cc.

Referenced by delaySettingRecords(), registerProxies(), and setIntervalFor().

◆ m_mutex

std::mutex FWLiteESSource::m_mutex
private

Definition at line 120 of file FWLiteESSource.cc.

Referenced by registerProxies().

◆ m_queue

edm::SerialTaskQueue FWLiteESSource::m_queue
private

Definition at line 119 of file FWLiteESSource.cc.

Referenced by registerProxies().

fwlite::EventSetup::get
const Record & get(const RecordID &) const
Definition: EventSetup.cc:117
fwlite::Record::startSyncValue
const IOVSyncValue & startSyncValue() const
Definition: Record.cc:152
edm::typelookup::findType
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:69
FWLiteESSource::m_queue
edm::SerialTaskQueue m_queue
Definition: FWLiteESSource.cc:119
fwlite::EventSetup::recordID
RecordID recordID(const char *iRecordName) const
Definition: EventSetup.cc:87
fwlite::EventSetup::namesOfAvailableRecords
std::vector< std::string > namesOfAvailableRecords() const
Definition: EventSetup.cc:122
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
gather_cfg.cout
cout
Definition: gather_cfg.py:144
FWLiteESSource::m_mutex
std::mutex m_mutex
Definition: FWLiteESSource.cc:120
EventSetupRecordKey
fwlite::Record::endSyncValue
const IOVSyncValue & endSyncValue() const
Definition: Record.cc:153
edm::eventsetup::DataKey
Definition: DataKey.h:29
edm::Timestamp::value
TimeValue_t value() const
Definition: Timestamp.h:45
edm::EventSetupRecordIntervalFinder::findingRecordWithKey
void findingRecordWithKey(const eventsetup::EventSetupRecordKey &)
Definition: EventSetupRecordIntervalFinder.cc:44
FWLiteESSource::m_file
std::unique_ptr< TFile > m_file
Definition: FWLiteESSource.cc:116
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
fwlite::Record
Definition: Record.h:47
edm::IOVSyncValue::eventID
const EventID & eventID() const
Definition: IOVSyncValue.h:40
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
fwlite::RecordID
unsigned int RecordID
Definition: EventSetup.h:65
edm::eventsetup::heterocontainer::HCTypeTag
Definition: HCTypeTag.h:38
fwlite::EventSetup::syncTo
void syncTo(const edm::EventID &, const edm::Timestamp &)
Definition: EventSetup.cc:66
FWLiteESSource::m_keyToID
std::map< EventSetupRecordKey, fwlite::RecordID > m_keyToID
Definition: FWLiteESSource.cc:118
fwlite::Record::typeAndLabelOfAvailableData
std::vector< std::pair< std::string, std::string > > typeAndLabelOfAvailableData() const
Definition: Record.cc:206
edm::eventsetup::DataProxyProvider::KeyedProxiesVector
std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >> KeyedProxiesVector
Definition: DataProxyProvider.h:196
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::eventsetup::DataProxyProvider::usingRecordWithKey
void usingRecordWithKey(const EventSetupRecordKey &key)
Definition: DataProxyProvider.h:194
edm::IOVSyncValue::time
const Timestamp & time() const
Definition: IOVSyncValue.h:42
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
edm::eventsetup::NameTag
Definition: DataKeyTags.h:45
FWLiteESSource::m_es
fwlite::EventSetup m_es
Definition: FWLiteESSource.cc:117
fwlite::IOVSyncValue::time
const edm::Timestamp & time() const
Definition: IOVSyncValue.h:42
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
crabWrapper.key
key
Definition: crabWrapper.py:19
fwlite::IOVSyncValue::eventID
const edm::EventID & eventID() const
Definition: IOVSyncValue.h:40