50 explicit TypeID(
const std::type_info& iInfo) :
edm::
TypeIDBase(iInfo) {}
52 using TypeIDBase::typeInfo;
54 struct FWLiteESGenericHandle {
55 FWLiteESGenericHandle(
const TypeID& iType) : m_type(iType), m_data(nullptr), m_exception(nullptr) {}
57 FWLiteESGenericHandle(
const void* iData) : m_type(), m_data(iData), m_exception(nullptr) {}
59 FWLiteESGenericHandle(
cms::Exception* iException) : m_type(), m_data(nullptr), m_exception(iException) {}
61 const std::type_info& typeInfo()
const {
return m_type.typeInfo(); }
77 assert(iKey.type() == m_type);
79 FWLiteESGenericHandle
h(m_type);
80 m_record->get(
h, iKey.name().value());
83 if (
nullptr !=
h.m_exception) {
84 throw *(
h.m_exception);
88 void invalidateCache()
override {
93 void const* getAfterPrefetchImpl()
const final {
return m_data; }
121 std::map<EventSetupRecordKey, fwlite::RecordID>
m_keyToID;
127 : m_file(TFile::Open(iPS.getParameter<
std::
string>(
"fileName").c_str())), m_es(m_file.
get()) {}
138 typedef std::vector<std::pair<std::string, std::string> > TypesAndLabels;
141 std::cout <<
"Looking for data in record " << iRecordKey.
name() << std::endl;
142 for (TypesAndLabels::const_iterator it = typesAndLabels.begin(), itEnd = typesAndLabels.end(); it != itEnd; ++it) {
143 std::cout <<
" need type " << it->first << std::endl;
145 if (
tt != HCTypeTag()) {
147 keyedProxiesVector.emplace_back(dk, std::make_shared<FWLiteProxy>(TypeID(
tt.value()), &rec, &
m_queue, &
m_mutex));
149 LogDebug(
"UnknownESType") <<
"The type '" << it->first <<
"' is unknown in this job";
150 std::cout <<
" *****FAILED*****" << std::endl;
153 return keyedProxiesVector;
173 for (std::vector<std::string>::const_iterator it = recordNames.begin(), itEnd = recordNames.end(); it != itEnd;
176 if (
t != HCTypeTag()) {
std::map< EventSetupRecordKey, fwlite::RecordID > m_keyToID
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
void syncTo(const edm::EventID &, const edm::Timestamp &)
const FWLiteESSource & operator=(const FWLiteESSource &)=delete
std::unique_ptr< TFile > m_file
void usingRecordWithKey(const EventSetupRecordKey &key)
void invalidateCache() override
static const IOVSyncValue & endOfTime()
std::pair< Time_t, Time_t > ValidityInterval
void delaySettingRecords() override
~FWLiteESSource() override
const IOVSyncValue & startSyncValue() const
RecordID recordID(const char *iRecordName) const
void setIntervalFor(const EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
const Record & get(const RecordID &) const
std::vector< std::string > namesOfAvailableRecords() const
const IOVSyncValue & endSyncValue() const
std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >> KeyedProxiesVector
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
TimeValue_t value() const
const edm::EventID & eventID() const
const EventID & eventID() const
edm::SerialTaskQueue m_queue
FWLiteESSource(edm::ParameterSet const &iPS)
const Timestamp & time() const
KeyedProxiesVector registerProxies(const EventSetupRecordKey &, unsigned int iovIndex) override
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
const char * name() const
void findingRecordWithKey(const eventsetup::EventSetupRecordKey &)
std::vector< std::pair< std::string, std::string > > typeAndLabelOfAvailableData() const
const edm::Timestamp & time() const