29 namespace eventsetup {
36 unsigned int recordIndex)
37 : productResolverContainer_(productResolverContainer),
38 recordIndex_(recordIndex),
56 for (
auto const&
it : proxies) {
62 for (
auto const&
it : proxies) {
68 auto lengthDataLabel = std::strlen(
it.first.name().value());
70 it.first.name().value(),
72 lengthDataLabel) == 0);
79 for (
auto const&
it : proxies) {
87 auto iterEnd = iter + perRecordInfo.
nDataKeys_;
88 for (; iter != iterEnd; ++iter) {
89 if (*iter == dataKey) {
103 ++productResolversIter_;
108 std::vector<DataKey>::iterator dataKeysIter,
110 : dataKeysIter_(dataKeysIter), productResolversIter_(productResolversIter) {}
129 assert(keyedResolversCollection_.empty());
130 perRecordInfos_.emplace_back(iKey);
135 return (lb != perRecordInfos_.end() && iKey == lb->recordKey_);
139 std::set<EventSetupRecordKey> returnValue;
140 for (
auto const&
it : perRecordInfos_) {
141 returnValue.insert(returnValue.end(),
it.recordKey_);
147 std::set<EventSetupRecordKey>& recordsNotAllowingConcurrentIOVs)
const {
148 for (
auto const&
it : perRecordInfos_) {
151 recordsNotAllowingConcurrentIOVs.insert(recordsNotAllowingConcurrentIOVs.end(),
key);
157 std::sort(perRecordInfos_.begin(), perRecordInfos_.end());
158 perRecordInfos_.erase(
std::unique(perRecordInfos_.begin(), perRecordInfos_.end()), perRecordInfos_.end());
162 unsigned int nConcurrentIOVs) {
163 if (keyedResolversCollection_.empty()) {
164 sortEventSetupRecordKeys();
168 assert(lb != perRecordInfos_.end() &&
key == lb->recordKey_);
169 if (lb->nIOVs_ == 0) {
170 lb->nIOVs_ = nConcurrentIOVs;
171 auto recordIndex =
std::distance(perRecordInfos_.begin(), lb);
172 lb->indexToKeyedResolvers_ = keyedResolversCollection_.size();
173 for (
unsigned int i = 0;
i < nConcurrentIOVs; ++
i) {
174 keyedResolversCollection_.emplace_back(
this, recordIndex);
182 assert(lb != perRecordInfos_.end() && iRecordKey == lb->recordKey_);
183 assert(iovIndex < lb->nIOVs_);
184 return keyedResolversCollection_[lb->indexToKeyedResolvers_ + iovIndex];
195 if (iToAppend.
exists(kParamName)) {
206 std::vector<std::pair<DataKey, std::shared_ptr<ESProductResolver>>> keyedResolversVector =
212 keyedResolver.productResolver_->setProviderDescription(&
description());
213 if (mustChangeLabels) {
219 DataKey newKey(keyedResolver.dataKey_.type(),
temp.c_str());
220 swap(keyedResolver.dataKey_, newKey);
235 for (
auto&
v : iDesc) {
bool isLabelUnused(std::string const &label) const
const ComponentDescription & description() const
T getParameter(std::string const &) const
void fillRecordsNotAllowingConcurrentIOVs(std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
std::vector< PerRecordInfo > perRecordInfos_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
constexpr auto kInvalidIndex
unsigned int size() const
std::string appendToDataLabel_
ParameterSetDescription * defaultDescription()
Returns 0 if no default has been assigned.
Iterator(std::vector< DataKey >::iterator dataKeysIter, std::vector< edm::propagate_const< std::shared_ptr< ESProductResolver >>>::iterator productResolversIter)
KeyedResolvers & keyedResolvers(const EventSetupRecordKey &iRecordKey, unsigned int iovIndex)
bool isUsingRecord(const EventSetupRecordKey &) const
void usingRecordWithKey(const EventSetupRecordKey &)
edm::propagate_const< ESProductResolverContainer * > productResolverContainer_
virtual KeyedResolversVector registerResolvers(const EventSetupRecordKey &, unsigned int iovIndex)=0
def unique(seq, keepstr=True)
void swap(DataKey &a, DataKey &b)
void insert(std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver >>> &&, std::string const &appendToDataLabel)
key
prepare the HTCondor submission files and eventually submit them
static const std::string kAppendToDataLabel("appendToDataLabel")
bool allowConcurrentIOVs(EventSetupRecordKey const &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
virtual ~ESProductResolverProvider() noexcept(false)
ESProductResolverProvider()
virtual void updateLookup(ESRecordsToProductResolverIndices const &)
unsigned int indexToDataKeys_
void createKeyedResolvers(EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
std::set< EventSetupRecordKey > usingRecords() const
KeyedResolvers(ESProductResolverContainer *, unsigned int recordIndex)
void setAppendToDataLabel(const edm::ParameterSet &)
PerRecordInfo(const EventSetupRecordKey &)
static void prevalidate(ConfigurationDescriptions &)
unsigned int recordIndex_
bool unInitialized() const
ESProductResolverContainer productResolverContainer_
unsigned int productResolversIndex_
KeyedResolvers & keyedResolvers(const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
bool contains(DataKey const &dataKey) const
std::vector< DataKey > dataKeys_
EventSetupRecordKey const & recordKey() const
void sortEventSetupRecordKeys()
std::vector< edm::propagate_const< std::shared_ptr< ESProductResolver > > > productResolvers_