29 namespace eventsetup {
36 : dataProxyContainer_(dataProxyContainer), recordIndex_(recordIndex), dataProxiesIndex_(
kInvalidIndex) {}
50 for (
auto const& it : proxies) {
56 for (
auto const& it : proxies) {
57 if (appendToDataLabel.empty()) {
61 auto lengthDataLabel = std::strlen(it.first.name().value());
62 assert(std::strncmp(it.first.name().value(),
64 lengthDataLabel) == 0);
71 for (
auto const& it : proxies) {
79 auto iterEnd = iter + perRecordInfo.
nDataKeys_;
80 for (; iter != iterEnd; ++iter) {
81 if (*iter == dataKey) {
99 std::vector<DataKey>::iterator dataKeysIter,
101 : dataKeysIter_(dataKeysIter), dataProxiesIter_(dataProxiesIter) {}
120 assert(keyedProxiesCollection_.empty());
121 perRecordInfos_.emplace_back(iKey);
126 return (lb != perRecordInfos_.end() && iKey == lb->recordKey_);
130 std::set<EventSetupRecordKey> returnValue;
131 for (
auto const& it : perRecordInfos_) {
132 returnValue.insert(returnValue.end(), it.recordKey_);
138 std::set<EventSetupRecordKey>& recordsNotAllowingConcurrentIOVs)
const {
139 for (
auto const& it : perRecordInfos_) {
142 recordsNotAllowingConcurrentIOVs.insert(recordsNotAllowingConcurrentIOVs.end(),
key);
148 std::sort(perRecordInfos_.begin(), perRecordInfos_.end());
149 perRecordInfos_.erase(
std::unique(perRecordInfos_.begin(), perRecordInfos_.end()), perRecordInfos_.end());
153 unsigned int nConcurrentIOVs) {
154 if (keyedProxiesCollection_.empty()) {
155 sortEventSetupRecordKeys();
157 assert(nConcurrentIOVs > 0U);
159 assert(lb != perRecordInfos_.end() && key == lb->recordKey_);
160 if (lb->nIOVs_ == 0) {
161 lb->nIOVs_ = nConcurrentIOVs;
162 auto recordIndex =
std::distance(perRecordInfos_.begin(), lb);
163 lb->indexToKeyedProxies_ = keyedProxiesCollection_.size();
164 for (
unsigned int i = 0;
i < nConcurrentIOVs; ++
i) {
165 keyedProxiesCollection_.emplace_back(
this, recordIndex);
173 assert(lb != perRecordInfos_.end() && iRecordKey == lb->recordKey_);
174 assert(iovIndex < lb->nIOVs_);
175 return keyedProxiesCollection_[lb->indexToKeyedProxies_ + iovIndex];
186 if (iToAppend.
exists(kParamName)) {
192 unsigned int iovIndex) {
197 std::vector<std::pair<DataKey, std::shared_ptr<DataProxy>>> keyedProxiesVector =
202 for (
auto keyedProxy : keyedProxies) {
203 keyedProxy.dataProxy_->setProviderDescription(&
description());
204 if (mustChangeLabels) {
210 DataKey newKey(keyedProxy.dataKey_.type(), temp.c_str());
211 swap(keyedProxy.dataKey_, newKey);
226 for (
auto&
v : iDesc) {
PerRecordInfo(const EventSetupRecordKey &)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
unsigned int indexToDataKeys_
ParameterSetDescription * defaultDescription()
Returns 0 if no default has been assigned.
unsigned int size() const
std::vector< PerRecordInfo > perRecordInfos_
EventSetupRecordKey const & recordKey() const
virtual KeyedProxiesVector registerProxies(const EventSetupRecordKey &, unsigned int iovIndex)=0
void sortEventSetupRecordKeys()
unsigned int dataProxiesIndex_
tuple key
prepare the HTCondor submission files and eventually submit them
std::vector< edm::propagate_const< std::shared_ptr< DataProxy > > > dataProxies_
KeyedProxies & keyedProxies(const EventSetupRecordKey &iRecordKey, unsigned int iovIndex)
const ComponentDescription & description() const
void swap(DataKey &a, DataKey &b)
bool isLabelUnused(std::string const &label) const
static const std::string kAppendToDataLabel("appendToDataLabel")
virtual void updateLookup(ESRecordsToProxyIndices const &)
bool allowConcurrentIOVs(EventSetupRecordKey const &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool contains(DataKey const &dataKey) const
edm::propagate_const< DataProxyContainer * > dataProxyContainer_
static void prevalidate(ConfigurationDescriptions &)
bool isUsingRecord(const EventSetupRecordKey &) const
void setAppendToDataLabel(const edm::ParameterSet &)
T getParameter(std::string const &) const
void fillRecordsNotAllowingConcurrentIOVs(std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
void insert(std::vector< std::pair< DataKey, std::shared_ptr< DataProxy >>> &&, std::string const &appendToDataLabel)
KeyedProxies & keyedProxies(const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
DataProxyContainer dataProxyContainer_
void createKeyedProxies(EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
unsigned int recordIndex_
Iterator(std::vector< DataKey >::iterator dataKeysIter, std::vector< edm::propagate_const< std::shared_ptr< DataProxy >>>::iterator dataProxiesIter)
constexpr auto kInvalidIndex
std::vector< DataKey > dataKeys_
std::set< EventSetupRecordKey > usingRecords() const
virtual ~DataProxyProvider() noexcept(false)
void usingRecordWithKey(const EventSetupRecordKey &)
std::string appendToDataLabel_
KeyedProxies(DataProxyContainer *, unsigned int recordIndex)
bool unInitialized() const