48 m_tag(iTag), m_label(iLabel) {}
54 namespace fwliteeswriter {
69 namespace eventsetup {
75 bool iTransientAccessOnly,
76 std::shared_ptr<ESHandleExceptionFactory>& whyFailedFactory)
const {
77 DataKey dataKey(*(iData->m_tag),
81 const void* pValue = this->getFromProxy(dataKey,iDesc,iTransientAccessOnly);
83 throw cms::Exception(
"NoProxyException")<<
"No data of type \""<<iData->m_tag->name()<<
"\" with label \""<<
84 iName<<
"\" in record \""<<this->
key().name()<<
"\"";
86 iData->m_data = pValue;
92 t.
m_tag = &(iHolder.m_info->m_tag);
95 std::shared_ptr<ESHandleExceptionFactory> dummy;
96 this->getImplementation(value, iName.c_str(),desc,
true, dummy);
98 iHolder.m_desc = desc;
107 class RecordHandler {
111 std::vector<DataInfo>& ioInfo):
114 m_writer(m_key.
name(),iFile),
116 m_dataInfos.swap(ioInfo);
121 m_record = iSetup.
find(m_key);
124 if(m_cacheID != m_record->cacheIdentifier()) {
125 m_cacheID = m_record->cacheIdentifier();
127 for(std::vector<DataInfo>::const_iterator it = m_dataInfos.begin(),
128 itEnd = m_dataInfos.end();
132 m_record->get(it->m_label,
h);
133 m_writer.update(
h.m_data,(it->m_tag.value()),it->m_label.c_str());
144 unsigned long long m_cacheID;
145 std::vector<DataInfo> m_dataInfos;
159 virtual void endJob()
override ;
186 if (0 == names.size()) {
189 for (std::vector<std::string>::const_iterator it = names.begin(), itEnd=names.end(); it != itEnd; ++it) {
190 const std::vector<edm::ParameterSet>& ps = iConfig.
getUntrackedParameter<std::vector<edm::ParameterSet> >(*it);
192 for(std::vector<edm::ParameterSet>::const_iterator itPS = ps.begin(),itPSEnd = ps.end();
197 data.push_back(std::make_pair(type,label) );
229 if(tt == HCTypeTag()) {
230 throw cms::Exception(
"UnknownESRecordType")<<
"The name '"<<it->first<<
"' is not associated with a known EventSetupRecord.\n"
231 "Please check spelling or load a module known to link with the package which declares that Record.";
237 throw cms::Exception(
"UnknownESRecordType")<<
"The name '"<<it->first<<
"' is not associated with a type which is not an EventSetupRecord.\n"
238 "Please check your spelling.";
242 std::vector<std::pair<std::string,std::string> >&
data = it->second;
245 std::vector<edm::eventsetup::DataKey>
keys;
247 for(std::vector<edm::eventsetup::DataKey>::iterator itKey = keys.begin(), itKeyEnd = keys.end();
250 data.push_back(std::make_pair(
std::string(itKey->type().name()),
255 std::vector<DataInfo> dataInfos;
256 for (std::vector<std::pair<std::string,std::string> >::iterator itData = data.begin(), itDataEnd = data.end();
260 if(tt == HCTypeTag()) {
261 throw cms::Exception(
"UnknownESDataType")<<
"The name '"<<itData->first<<
"' is not associated with a known type held in the "<<it->first<<
" Record.\n"
262 "Please check spelling or load a module known to link with the package which declares that type.";
265 throw cms::Exception(
"NoDictionary")<<
"The type '"<<itData->first<<
"' can not be retrieved from the Record "<<it->first<<
" and stored \n"
266 "because no dictionary exists for the type.";
268 dataInfos.push_back(DataInfo(tt,itData->second));
270 m_handlers.push_back( boost::shared_ptr<RecordHandler>(
new RecordHandler(rKey,
m_file,dataInfos) ) );
274 for(std::vector<boost::shared_ptr<RecordHandler> >::iterator it =
m_handlers.begin(),itEnd =
m_handlers.end();
277 (*it)->update(iSetup);
T getUntrackedParameter(std::string const &, T const &) const
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
void fillRegisteredDataKeys(std::vector< DataKey > &oToFill) const
clears the oToFill vector and then fills it with the keys for all registered data keys ...
static const HistoName names[]
const EventID & eventID() const
#define DEFINE_FWK_MODULE(type)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
const edm::eventsetup::heterocontainer::HCTypeTag * m_tag
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
std::vector< boost::shared_ptr< RecordHandler > > m_handlers
const edm::eventsetup::ComponentDescription * m_desc
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
virtual void endJob() override
FWLiteESRecordWriterAnalyzer(const edm::ParameterSet &)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Handle(const DataInfo *iInfo)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
~FWLiteESRecordWriterAnalyzer()
std::map< std::string, std::vector< std::pair< std::string, std::string > > > m_recordToDataNames
virtual void beginJob() override
char data[epos_bytes_allocation]
void update(const edm::EventSetup &)
const Timestamp & time() const
const IOVSyncValue & first() const