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::ESProductResolverProvider edm::EventSetupRecordIntervalFinder

Public Types

using EventSetupRecordKey = edm::eventsetup::EventSetupRecordKey
 

Public Member Functions

 FWLiteESSource (edm::ParameterSet const &iPS)
 
 FWLiteESSource (const FWLiteESSource &)=delete
 
const FWLiteESSourceoperator= (const FWLiteESSource &)=delete
 
 ~FWLiteESSource () override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
virtual void updateLookup (ESRecordsToProductResolverIndices const &)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () 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
 
KeyedResolversVector registerResolvers (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::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
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 105 of file FWLiteESSource.cc.

Member Typedef Documentation

◆ EventSetupRecordKey

Definition at line 112 of file FWLiteESSource.cc.

Constructor & Destructor Documentation

◆ FWLiteESSource() [1/2]

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

Definition at line 129 of file FWLiteESSource.cc.

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

◆ FWLiteESSource() [2/2]

FWLiteESSource::FWLiteESSource ( const FWLiteESSource )
delete

◆ ~FWLiteESSource()

FWLiteESSource::~FWLiteESSource ( )
override

Definition at line 132 of file FWLiteESSource.cc.

132 {}

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 173 of file FWLiteESSource.cc.

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

173  {
175  std::vector<std::string> recordNames = m_es.namesOfAvailableRecords();
176 
177  for (std::vector<std::string>::const_iterator it = recordNames.begin(), itEnd = recordNames.end(); it != itEnd;
178  ++it) {
179  HCTypeTag t = HCTypeTag::findType(*it);
180  if (t != HCTypeTag()) {
184  m_keyToID[key] = m_es.recordID(it->c_str());
185  }
186  }
187 }
std::map< EventSetupRecordKey, fwlite::RecordID > m_keyToID
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:70
void usingRecordWithKey(const EventSetupRecordKey &key)
fwlite::EventSetup m_es
RecordID recordID(const char *iRecordName) const
Definition: EventSetup.cc:87
key
prepare the HTCondor submission files and eventually submit them
std::vector< std::string > namesOfAvailableRecords() const
Definition: EventSetup.cc:122
void findingRecordWithKey(const eventsetup::EventSetupRecordKey &)

◆ operator=()

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

◆ registerResolvers()

edm::eventsetup::ESProductResolverProvider::KeyedResolversVector FWLiteESSource::registerResolvers ( const EventSetupRecordKey iRecordKey,
unsigned int  iovIndex 
)
overrideprivatevirtual

Implements edm::eventsetup::ESProductResolverProvider.

Definition at line 134 of file FWLiteESSource.cc.

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

135  {
136  KeyedResolversVector keyedProxiesVector;
138 
139  fwlite::RecordID recID = m_keyToID[iRecordKey];
140  const fwlite::Record& rec = m_es.get(recID);
141  typedef std::vector<std::pair<std::string, std::string> > TypesAndLabels;
142  TypesAndLabels typesAndLabels = rec.typeAndLabelOfAvailableData();
143 
144  std::cout << "Looking for data in record " << iRecordKey.name() << std::endl;
145  for (TypesAndLabels::const_iterator it = typesAndLabels.begin(), itEnd = typesAndLabels.end(); it != itEnd; ++it) {
146  std::cout << " need type " << it->first << std::endl;
147  HCTypeTag tt = HCTypeTag::findType(it->first);
148  if (tt != HCTypeTag()) {
149  edm::eventsetup::DataKey dk(tt, edm::eventsetup::IdTags(it->second.c_str()));
150  keyedProxiesVector.emplace_back(
151  dk, std::make_shared<FWLiteProductResolver>(TypeID(tt.value()), &rec, &m_queue, &m_mutex));
152  } else {
153  LogDebug("UnknownESType") << "The type '" << it->first << "' is unknown in this job";
154  std::cout << " *****FAILED*****" << std::endl;
155  }
156  }
157  return keyedProxiesVector;
158 }
std::map< EventSetupRecordKey, fwlite::RecordID > m_keyToID
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:70
unsigned int RecordID
Definition: EventSetup.h:65
fwlite::EventSetup m_es
Definition: TTTypes.h:54
std::mutex m_mutex
const Record & get(const RecordID &) const
Definition: EventSetup.cc:117
std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >> KeyedResolversVector
edm::SerialTaskQueue m_queue
std::vector< std::pair< std::string, std::string > > typeAndLabelOfAvailableData() const
Definition: Record.cc:206
#define LogDebug(id)

◆ setIntervalFor()

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

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 160 of file FWLiteESSource.cc.

References edm::IOVSyncValue::endOfTime(), fwlite::Record::endSyncValue(), fwlite::IOVSyncValue::eventID(), edm::IOVSyncValue::eventID(), fwlite::EventSetup::get(), m_es, m_keyToID, edm::EventID::run(), fwlite::Record::startSyncValue(), fwlite::EventSetup::syncTo(), fwlite::IOVSyncValue::time(), edm::IOVSyncValue::time(), and edm::Timestamp::value().

162  {
163  m_es.syncTo(iSync.eventID(), iSync.time());
164 
165  const fwlite::Record& rec = m_es.get(m_keyToID[iKey]);
166  edm::IOVSyncValue endSync(rec.endSyncValue().eventID(), rec.endSyncValue().time());
167  if (rec.endSyncValue().eventID().run() == 0 && rec.endSyncValue().time().value() == 0ULL) {
168  endSync = edm::IOVSyncValue::endOfTime();
169  }
171 }
std::map< EventSetupRecordKey, fwlite::RecordID > m_keyToID
void syncTo(const edm::EventID &, const edm::Timestamp &)
Definition: EventSetup.cc:66
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
const IOVSyncValue & startSyncValue() const
Definition: Record.cc:152
fwlite::EventSetup m_es
const Record & get(const RecordID &) const
Definition: EventSetup.cc:117
const IOVSyncValue & endSyncValue() const
Definition: Record.cc:153
RunNumber_t run() const
Definition: EventID.h:38
TimeValue_t value() const
Definition: Timestamp.h:38
const edm::EventID & eventID() const
Definition: IOVSyncValue.h:40
const EventID & eventID() const
Definition: IOVSyncValue.h:40
const Timestamp & time() const
Definition: IOVSyncValue.h:42
const edm::Timestamp & time() const
Definition: IOVSyncValue.h:42

Member Data Documentation

◆ m_es

fwlite::EventSetup FWLiteESSource::m_es
private

Definition at line 123 of file FWLiteESSource.cc.

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

◆ m_file

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

Definition at line 122 of file FWLiteESSource.cc.

◆ m_keyToID

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

Definition at line 124 of file FWLiteESSource.cc.

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

◆ m_mutex

std::mutex FWLiteESSource::m_mutex
private

Definition at line 126 of file FWLiteESSource.cc.

Referenced by registerResolvers().

◆ m_queue

edm::SerialTaskQueue FWLiteESSource::m_queue
private

Definition at line 125 of file FWLiteESSource.cc.

Referenced by registerResolvers().