Public Member Functions | |
FWLiteESSource (edm::ParameterSet const &iPS) | |
virtual void | newInterval (const edm::eventsetup::EventSetupRecordKey &iRecordType, const edm::ValidityInterval &iInterval) |
called when a new interval of validity occurs for iRecordType | |
virtual | ~FWLiteESSource () |
Private Member Functions | |
virtual void | delaySettingRecords () |
FWLiteESSource (const FWLiteESSource &) | |
const FWLiteESSource & | operator= (const FWLiteESSource &) |
virtual void | registerProxies (const edm::eventsetup::EventSetupRecordKey &iRecordKey, KeyedProxies &aProxyList) |
virtual void | setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) |
Private Attributes | |
fwlite::EventSetup | m_es |
std::auto_ptr< TFile > | m_file |
std::map < edm::eventsetup::EventSetupRecordKey, fwlite::RecordID > | m_keyToID |
Description: [one line class summary]
Usage: <usage>
Definition at line 101 of file FWLiteESSource.cc.
FWLiteESSource::FWLiteESSource | ( | edm::ParameterSet const & | iPS | ) |
Definition at line 150 of file FWLiteESSource.cc.
: m_file( TFile::Open(iPS.getParameter<std::string>("fileName").c_str())), m_es( m_file.get()) { }
FWLiteESSource::~FWLiteESSource | ( | ) | [virtual] |
Definition at line 161 of file FWLiteESSource.cc.
{ }
FWLiteESSource::FWLiteESSource | ( | const FWLiteESSource & | ) | [private] |
void FWLiteESSource::delaySettingRecords | ( | ) | [private, virtual] |
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 240 of file FWLiteESSource.cc.
References edm::EventSetupRecordIntervalFinder::findingRecordWithKey(), edm::typelookup::findType(), combine::key, m_es, m_keyToID, fwlite::EventSetup::namesOfAvailableRecords(), fwlite::EventSetup::recordID(), lumiQTWidget::t, and edm::eventsetup::DataProxyProvider::usingRecordWithKey().
{ using edm::eventsetup::heterocontainer::HCTypeTag; std::vector<std::string> recordNames = m_es.namesOfAvailableRecords(); for(std::vector<std::string>::const_iterator it = recordNames.begin(), itEnd = recordNames.end(); it != itEnd; ++it) { HCTypeTag t = HCTypeTag::findType(*it); if(t != HCTypeTag() ) { edm::eventsetup::EventSetupRecordKey key(t); findingRecordWithKey(key); usingRecordWithKey(key); m_keyToID[key]=m_es.recordID(it->c_str()); } } }
void FWLiteESSource::newInterval | ( | const edm::eventsetup::EventSetupRecordKey & | iRecordType, |
const edm::ValidityInterval & | iInterval | ||
) | [virtual] |
called when a new interval of validity occurs for iRecordType
Implements edm::eventsetup::DataProxyProvider.
Definition at line 181 of file FWLiteESSource.cc.
References edm::eventsetup::DataProxyProvider::invalidateProxies().
{ invalidateProxies(iRecordType); }
const FWLiteESSource& FWLiteESSource::operator= | ( | const FWLiteESSource & | ) | [private] |
void FWLiteESSource::registerProxies | ( | const edm::eventsetup::EventSetupRecordKey & | iRecordKey, |
KeyedProxies & | aProxyList | ||
) | [private, virtual] |
Implements edm::eventsetup::DataProxyProvider.
Definition at line 191 of file FWLiteESSource.cc.
References gather_cfg::cout, edm::typelookup::findType(), fwlite::EventSetup::get(), LogDebug, m_es, m_keyToID, edm::eventsetup::EventSetupRecordKey::name(), groupFilesInBlocks::tt, and fwlite::Record::typeAndLabelOfAvailableData().
{ using edm::eventsetup::heterocontainer::HCTypeTag; fwlite::RecordID recID = m_keyToID[iRecordKey]; const fwlite::Record& rec = m_es.get(recID); typedef std::vector<std::pair<std::string,std::string> > TypesAndLabels; TypesAndLabels typesAndLabels = rec.typeAndLabelOfAvailableData(); std::cout <<"Looking for data in record "<<iRecordKey.name()<<std::endl; for(TypesAndLabels::const_iterator it = typesAndLabels.begin(), itEnd = typesAndLabels.end(); it != itEnd; ++it) { std::cout <<" need type "<<it->first<<std::endl; HCTypeTag tt = HCTypeTag::findType(it->first); if(tt != HCTypeTag() ) { edm::eventsetup::DataKey dk(tt,edm::eventsetup::IdTags(it->second.c_str())); aProxyList.push_back(std::make_pair(dk, boost::shared_ptr<edm::eventsetup::DataProxy>(new FWLiteProxy(TypeID(tt.value()),&rec)))); } else { LogDebug("UnknownESType")<<"The type '"<<it->first<<"' is unknown in this job"; std::cout <<" *****FAILED*****"<<std::endl; } } }
void FWLiteESSource::setIntervalFor | ( | const edm::eventsetup::EventSetupRecordKey & | iKey, |
const edm::IOVSyncValue & | iSync, | ||
edm::ValidityInterval & | oIOV | ||
) | [private, virtual] |
Implements edm::EventSetupRecordIntervalFinder.
Definition at line 221 of file FWLiteESSource.cc.
References edm::IOVSyncValue::endOfTime(), fwlite::Record::endSyncValue(), edm::IOVSyncValue::eventID(), fwlite::EventSetup::get(), m_es, m_keyToID, fwlite::Record::startSyncValue(), fwlite::EventSetup::syncTo(), and edm::IOVSyncValue::time().
{ m_es.syncTo(iSync.eventID(), iSync.time()); const fwlite::Record& rec = m_es.get(m_keyToID[iKey]); edm::IOVSyncValue endSync(rec.endSyncValue().eventID(), rec.endSyncValue().time()); if(rec.endSyncValue().eventID().run()==0 && rec.endSyncValue().time().value() == 0ULL) { endSync = edm::IOVSyncValue::endOfTime(); } oIOV = edm::ValidityInterval(edm::IOVSyncValue(rec.startSyncValue().eventID(), rec.startSyncValue().time()), endSync); }
fwlite::EventSetup FWLiteESSource::m_es [private] |
Definition at line 133 of file FWLiteESSource.cc.
Referenced by delaySettingRecords(), registerProxies(), and setIntervalFor().
std::auto_ptr<TFile> FWLiteESSource::m_file [private] |
Definition at line 132 of file FWLiteESSource.cc.
std::map<edm::eventsetup::EventSetupRecordKey, fwlite::RecordID> FWLiteESSource::m_keyToID [private] |
Definition at line 134 of file FWLiteESSource.cc.
Referenced by delaySettingRecords(), registerProxies(), and setIntervalFor().