54 KeyedResolversVector registerResolvers(
EventSetupRecordKey const&,
unsigned int iovIndex)
final;
73 if (iName ==
"zlib") {
75 }
else if (iName ==
"lzma") {
77 }
else if (iName ==
"none") {
80 throw cms::Exception(
"BadCompressionType") <<
"unknown compression type used in file '" << iName <<
"'";
90 : filename_(iPSet.getUntrackedParameter<
std::
string>(
"filename")),
91 file_(filename_,
cms::h5::
File::kReadOnly),
92 compression_(nameToEnum(file_.findAttribute(
"default_payload_compressor")->readString())) {
95 const auto tagsDataSet = chosenTag->findDataSet(
"Tags");
98 std::vector<hobj_ref_t>
tags = tagsDataSet->readRefs();
100 std::set<std::string> recordsToExclude;
102 auto exclude = iPSet.
getParameter<std::vector<std::string>>(
"excludeRecords");
103 recordsToExclude = std::set(exclude.begin(), exclude.end());
106 for (
auto t :
tags) {
109 record.name_ = tagGroup->findAttribute(
"record")->readString();
112 if (recordsToExclude.end() != recordsToExclude.find(
record.name_)) {
117 auto recordGroup = recordsGroup->findGroup(
record.name_);
119 auto dataProductsGroup = recordGroup->findGroup(
"DataProducts");
122 for (
size_t i = 0;
i < dataProductsGroup->getNumObjs(); ++
i) {
123 std::string productGroupName = dataProductsGroup->getObjnameByIdx(
i);
125 auto dataProductGroup = dataProductsGroup->findGroup(productGroupName);
127 auto const typeAttr = dataProductGroup->findAttribute(
"type");
132 if (
name.size() == 1 and
name[0] ==
'-') {
139 auto const typeAttr = tagGroup->findAttribute(
"time_type");
144 std::vector<hobj_ref_t> payloadRefForIOVs;
146 auto const firstDataSet = tagGroup->findDataSet(
"first");
147 auto const lastDataSet = tagGroup->findDataSet(
"last");
149 record.iovFirsts_ = firstDataSet->readSyncValues();
150 record.iovLasts_ = lastDataSet->readSyncValues();
153 auto const payloadDataSet = tagGroup->findDataSet(
"payload");
154 payloadRefForIOVs = payloadDataSet->readRefs();
155 assert(payloadRefForIOVs.size() ==
record.iovFirsts_.size() *
record.dataProducts_.size());
158 size_t dataProductIndex = 0;
159 for (
auto r : payloadRefForIOVs) {
160 record.dataProducts_[dataProductIndex].payloadForIOVs_.push_back(
r);
162 if (dataProductIndex >=
record.dataProducts_.size()) {
163 dataProductIndex = 0;
182 desc.addUntracked<
std::string>(
"filename")->setComment(
"HDF5 file containing the conditions");
183 desc.add<
std::string>(
"globalTag")->setComment(
"Which global tag to use from the file");
184 desc.add<std::vector<std::string>>(
"excludeRecords", std::vector<std::string>())
185 ->setComment(
"List of Records that should not be read from the file");
195 auto const itRecord =
197 return iE.name_ < iV;
200 auto const&
record = *itRecord;
204 if (itFound ==
record.iovFirsts_.end()) {
215 unsigned int iovIndex) {
219 auto const itRecord =
221 return iE.name_ < iV;
224 auto const&
record = *itRecord;
226 for (
auto const& dataProduct :
record.dataProducts_) {
230 returnValue.emplace_back(
232 dataProduct.name_.c_str()),
233 std::make_shared<HDF5ProductResolver>(
T getParameter(std::string const &) const
std::shared_ptr< Group > derefGroup(hobj_ref_t iRef) const
std::vector< Record > records_
void usingRecordWithKey(const EventSetupRecordKey &key)
CondHDF5ESSource(edm::ParameterSet const &)
edm::SerialTaskQueue queue_
std::shared_ptr< Group > findGroup(std::string const &iName) const
void addDefault(ParameterSetDescription const &psetDescription)
bool isConcurrentFinder() const final
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
key
prepare the HTCondor submission files and eventually submit them
std::vector< IOVSyncValue >::const_iterator findMatchingFirst(std::vector< IOVSyncValue > const &iIOVs, IOVSyncValue iMatch)
Namespace of DDCMS conversion namespace.
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >> KeyedResolversVector
void setIntervalFor(EventSetupRecordKey const &, edm::IOVSyncValue const &, edm::ValidityInterval &) final
static const ValidityInterval & invalidInterval()
IOVSyncValue convertSyncValue(edm::IOVSyncValue const &iFrom, bool iIsRunLumi)
KeyedResolversVector registerResolvers(EventSetupRecordKey const &, unsigned int iovIndex) final
const char * name() const
void findingRecordWithKey(const eventsetup::EventSetupRecordKey &)
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag