CMS 3D CMS Logo

EDConsumerBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Framework
4 // Class : EDConsumerBase
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Chris Jones
10 // Created: Tue, 02 Apr 2013 21:36:06 GMT
11 //
12 
13 // system include files
14 #include <array>
15 #include <algorithm>
16 #include <cassert>
17 #include <cstring>
18 #include <set>
19 #include <utility>
20 
21 // user include files
33 
34 using namespace edm;
35 
36 namespace {
37  std::vector<char> makeEmptyTokenLabels() { return std::vector<char>{'\0'}; }
38 } // namespace
39 
41  : m_tokenLabels{makeEmptyTokenLabels()}, frozen_(false), containsCurrentProcessAlias_(false) {}
42 
44 
45 //
46 // member functions
47 //
49  ConsumesCollector c{this};
50  return c;
51 }
52 
53 static const edm::InputTag kWasEmpty("@EmptyLabel@");
54 
56  if (iTag.label().empty()) {
57  return kWasEmpty;
58  }
59  return iTag;
60 }
61 
63  TypeToGet const& iType,
64  edm::InputTag const& iTag,
65  bool iAlwaysGets) {
66  if (frozen_) {
67  throwConsumesCallAfterFrozen(iType, iTag);
68  }
69 
70  unsigned int index = m_tokenInfo.size();
71 
72  bool skipCurrentProcess = iTag.willSkipCurrentProcess();
73 
74  const size_t labelSize = iTag.label().size();
75  const size_t productInstanceSize = iTag.instance().size();
76  unsigned int labelStart = m_tokenLabels.size();
77  unsigned short delta1 = labelSize + 1;
78  unsigned short delta2 = labelSize + 2 + productInstanceSize;
79  m_tokenInfo.emplace_back(TokenLookupInfo{iType.type(), ProductResolverIndexInvalid, skipCurrentProcess, iBranch},
80  iAlwaysGets,
81  LabelPlacement{labelStart, delta1, delta2},
82  iType.kind());
83 
84  const size_t additionalSize = skipCurrentProcess ? labelSize + productInstanceSize + 3
85  : labelSize + productInstanceSize + iTag.process().size() + 3;
86 
87  m_tokenLabels.reserve(m_tokenLabels.size() + additionalSize);
88  {
89  const std::string& m = iTag.label();
90  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
91  m_tokenLabels.push_back('\0');
92  }
93  {
94  const std::string& m = iTag.instance();
95  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
96  m_tokenLabels.push_back('\0');
97  }
98  {
99  const std::string& m = iTag.process();
100  if (m == InputTag::kCurrentProcess) {
102  }
103  if (!skipCurrentProcess) {
104  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
105  m_tokenLabels.push_back('\0');
106  } else {
107  m_tokenLabels.push_back('\0');
108  }
109  }
110  return index;
111 }
112 
114 
116  ProductResolverIndexHelper const& iHelper,
117  bool iPrefetchMayGet) {
118  frozen_ = true;
120  extendUpdateLookup(iBranchType, iHelper);
121  {
122  auto itKind = m_tokenInfo.begin<kKind>();
123  auto itLabels = m_tokenInfo.begin<kLabels>();
124  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
125  ++itInfo, ++itKind, ++itLabels) {
126  if (itInfo->m_branchType == iBranchType) {
127  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
128  const char* moduleLabel = &(m_tokenLabels[labelStart]);
129  itInfo->m_index = ProductResolverIndexAndSkipBit(iHelper.index(*itKind,
130  itInfo->m_type,
131  moduleLabel,
132  moduleLabel + itLabels->m_deltaToProductInstance,
133  moduleLabel + itLabels->m_deltaToProcessName),
134  itInfo->m_index.skipCurrentProcess());
135  }
136  }
137  }
138 
139  m_tokenInfo.shrink_to_fit();
140 
141  itemsToGet(iBranchType, itemsToGetFromBranch_[iBranchType]);
142  if (iPrefetchMayGet) {
143  itemsMayGet(iBranchType, itemsToGetFromBranch_[iBranchType]);
144  }
145 }
146 
148  // temporarily unfreeze to allow late EventSetup consumes registration
149  frozen_ = false;
151  frozen_ = true;
152 
153  unsigned int index = 0;
154  for (auto it = m_esTokenInfo.begin<kESLookupInfo>(); it != m_esTokenInfo.end<kESLookupInfo>(); ++it, ++index) {
155  auto indexInRecord = iPI.indexInRecord(it->m_record, it->m_key);
157  const char* componentName = &(m_tokenLabels[it->m_startOfComponentName]);
158  if (*componentName) {
159  auto component = iPI.component(it->m_record, it->m_key);
160  if (component->label_.empty()) {
161  if (component->type_ != componentName) {
163  }
164  } else if (component->label_ != componentName) {
166  }
167  }
168  }
169  m_esTokenInfo.get<kESResolverIndex>(index) = indexInRecord;
170 
171  int negIndex = -1 * (index + 1);
172  for (auto& items : esItemsToGetFromTransition_) {
173  for (auto& itemIndex : items) {
174  if (itemIndex.value() == negIndex) {
175  itemIndex = indexInRecord;
176  esRecordsToGetFromTransition_[&items - &esItemsToGetFromTransition_.front()][&itemIndex - &items.front()] =
177  iPI.recordIndexFor(it->m_record);
178  negIndex = 1;
179  break;
180  }
181  }
182  if (negIndex > 0) {
183  break;
184  }
185  }
186  }
187 }
188 
190  eventsetup::EventSetupRecordKey const& iRecord,
192  edm::ESInputTag const& iTag) {
193  if (frozen_) {
194  throwESConsumesCallAfterFrozen(iRecord, iDataType, iTag);
195  }
196 
197  //m_tokenLabels first entry is a null. Since most ES data requests have
198  // empty labels we will assume we can reuse the first entry
199  unsigned int startOfComponentName = 0;
200  if (not iTag.module().empty()) {
201  startOfComponentName = m_tokenLabels.size();
202 
203  m_tokenLabels.reserve(m_tokenLabels.size() + iTag.module().size() + 1);
204  {
205  const std::string& m = iTag.module();
206  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
207  m_tokenLabels.push_back('\0');
208  }
209  }
210 
211  auto index = static_cast<ESResolverIndex::Value_t>(m_esTokenInfo.size());
212  m_esTokenInfo.emplace_back(
213  ESTokenLookupInfo{iRecord, eventsetup::DataKey{iDataType, iTag.data().c_str()}, startOfComponentName},
214  ESResolverIndex{-1});
217  }
218  auto indexForToken = esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)].size();
219  esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)].emplace_back(-1 * (index + 1));
220  esRecordsToGetFromTransition_[static_cast<unsigned int>(iTrans)].emplace_back();
221  return ESTokenIndex{static_cast<ESTokenIndex::Value_t>(indexForToken)};
222 }
223 
224 //
225 // const member functions
226 //
228  BranchType iBranch,
229  TypeID const& iType) const {
230  if (UNLIKELY(iToken.index() >= m_tokenInfo.size())) {
231  throwBadToken(iType, iToken);
232  }
233  const auto& info = m_tokenInfo.get<kLookupInfo>(iToken.index());
234  if (LIKELY(iBranch == info.m_branchType)) {
235  if (LIKELY(iType == info.m_type)) {
236  return info.m_index;
237  } else {
238  throwTypeMismatch(iType, iToken);
239  }
240  } else {
241  throwBranchMismatch(iBranch, iToken);
242  }
244 }
245 
247  return m_tokenInfo.get<kLookupInfo>(iToken.index()).m_index;
248 }
249 
250 void EDConsumerBase::itemsToGet(BranchType iBranch, std::vector<ProductResolverIndexAndSkipBit>& oIndices) const {
251  //how many are we adding?
252  unsigned int count = 0;
253  {
254  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
255  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd;
256  ++it, ++itAlwaysGet) {
257  if (iBranch == it->m_branchType) {
258  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
259  if (*itAlwaysGet) {
260  ++count;
261  }
262  }
263  }
264  }
265  }
266  oIndices.reserve(oIndices.size() + count);
267  {
268  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
269  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd;
270  ++it, ++itAlwaysGet) {
271  if (iBranch == it->m_branchType) {
272  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
273  if (*itAlwaysGet) {
274  oIndices.push_back(it->m_index);
275  }
276  }
277  }
278  }
279  }
280 }
281 
282 void EDConsumerBase::itemsMayGet(BranchType iBranch, std::vector<ProductResolverIndexAndSkipBit>& oIndices) const {
283  //how many are we adding?
284  unsigned int count = 0;
285  {
286  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
287  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd;
288  ++it, ++itAlwaysGet) {
289  if (iBranch == it->m_branchType) {
290  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
291  if (not *itAlwaysGet) {
292  ++count;
293  }
294  }
295  }
296  }
297  }
298  oIndices.reserve(oIndices.size() + count);
299  {
300  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
301  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd;
302  ++it, ++itAlwaysGet) {
303  if (iBranch == it->m_branchType) {
304  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
305  if (not *itAlwaysGet) {
306  oIndices.push_back(it->m_index);
307  }
308  }
309  }
310  }
311  }
312 }
313 
314 void EDConsumerBase::labelsForToken(EDGetToken iToken, Labels& oLabels) const {
315  unsigned int index = iToken.index();
316  auto labels = m_tokenInfo.get<kLabels>(index);
317  unsigned int start = labels.m_startOfModuleLabel;
318  oLabels.module = &(m_tokenLabels[start]);
319  oLabels.productInstance = oLabels.module + labels.m_deltaToProductInstance;
320  oLabels.process = oLabels.module + labels.m_deltaToProcessName;
321 }
322 
324  bool skipCurrentProcess,
325  BranchType iBranch) const {
326  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd; ++it) {
327  if (it->m_index.productResolverIndex() == iIndex and it->m_index.skipCurrentProcess() == skipCurrentProcess and
328  it->m_branchType == iBranch) {
329  return true;
330  }
331  }
332  return false;
333 }
334 
335 void EDConsumerBase::throwTypeMismatch(edm::TypeID const& iType, EDGetToken iToken) const {
336  throw cms::Exception("TypeMismatch") << "A get using a EDGetToken used the C++ type '" << iType.className()
337  << "' but the consumes call was for type '"
338  << m_tokenInfo.get<kLookupInfo>(iToken.index()).m_type.className()
339  << "'.\n Please modify either the consumes or get call so the types match.";
340 }
342  throw cms::Exception("BranchTypeMismatch")
343  << "A get using a EDGetToken was done in " << BranchTypeToString(iBranch) << " but the consumes call was for "
344  << BranchTypeToString(m_tokenInfo.get<kLookupInfo>(iToken.index()).m_branchType)
345  << ".\n Please modify the consumes call to use the correct branch type.";
346 }
347 
348 void EDConsumerBase::throwBadToken(edm::TypeID const& iType, EDGetToken iToken) const {
349  if (iToken.isUninitialized()) {
350  throw cms::Exception("BadToken") << "A get using a EDGetToken with the C++ type '" << iType.className()
351  << "' was made using an uninitialized token.\n Please check that the variable is "
352  "being initialized from a 'consumes' call.";
353  }
354  throw cms::Exception("BadToken")
355  << "A get using a EDGetToken with the C++ type '" << iType.className() << "' was made using a token with a value "
356  << iToken.index()
357  << " which is beyond the range used by this module.\n Please check that the variable is being initialized from a "
358  "'consumes' call from this module.\n You can not share EDGetToken values between modules.";
359 }
360 
362  throw cms::Exception("LogicError") << "A module declared it consumes a product after its constructor.\n"
363  << "This must be done in the contructor\n"
364  << "The product type was: " << typeToGet.type() << "\n"
365  << "and " << inputTag << "\n";
366 }
367 
370  edm::ESInputTag const& iTag) const {
371  throw cms::Exception("LogicError") << "A module declared it consumes an EventSetup product after its constructor.\n"
372  << "This must be done in the contructor\n"
373  << "The product type was: " << iDataType.name() << " in record "
374  << iRecord.type().name() << "\n"
375  << "and ESInputTag was " << iTag << "\n";
376 }
377 
379  throw cms::Exception("LogicError")
380  << "A module declared it consumes an EventSetup product during a ProcessBlock transition.\n"
381  << "EventSetup products can only be consumed in Event, Lumi, or Run transitions.\n";
382 }
383 
385 
386 namespace {
387  struct CharStarComp {
388  bool operator()(const char* iLHS, const char* iRHS) const { return strcmp(iLHS, iRHS) < 0; }
389  };
390 } // namespace
391 
392 namespace {
393  void insertFoundModuleLabel(edm::KindOfType consumedTypeKind,
394  edm::TypeID consumedType,
395  const char* consumedModuleLabel,
396  const char* consumedProductInstance,
397  std::vector<ModuleDescription const*>& modules,
398  std::set<std::string>& alreadyFound,
399  std::map<std::string, ModuleDescription const*> const& labelsToDesc,
400  ProductRegistry const& preg) {
401  // Convert from label string to module description, eliminate duplicates,
402  // then insert into the vector of modules
403  if (auto it = labelsToDesc.find(consumedModuleLabel); it != labelsToDesc.end()) {
404  if (alreadyFound.insert(consumedModuleLabel).second) {
405  modules.push_back(it->second);
406  }
407  return;
408  }
409  // Deal with EDAlias's by converting to the original module label first
410  if (auto aliasToModuleLabels =
411  preg.aliasToModules(consumedTypeKind, consumedType, consumedModuleLabel, consumedProductInstance);
412  not aliasToModuleLabels.empty()) {
413  bool foundInLabelsToDesc = false;
414  for (auto const& label : aliasToModuleLabels) {
415  if (auto it = labelsToDesc.find(label); it != labelsToDesc.end()) {
416  if (alreadyFound.insert(label).second) {
417  modules.push_back(it->second);
418  }
419  foundInLabelsToDesc = true;
420  } else {
421  if (label == "source") {
422  foundInLabelsToDesc = true;
423  }
424  }
425  }
426  if (foundInLabelsToDesc) {
427  return;
428  }
429  }
430  // Ignore the source products, we are only interested in module products.
431  // As far as I know, it should never be anything else so throw if something
432  // unknown gets passed in.
433  if (std::string_view(consumedModuleLabel) != "source") {
434  throw cms::Exception("EDConsumerBase", "insertFoundModuleLabel")
435  << "Couldn't find ModuleDescription for the consumed product type: '" << consumedType.className()
436  << "' module label: '" << consumedModuleLabel << "' product instance name: '" << consumedProductInstance
437  << "'";
438  }
439  }
440 } // namespace
441 
443  std::array<std::vector<ModuleDescription const*>*, NumBranchTypes>& modulesAll,
444  std::vector<ModuleProcessName>& modulesInPreviousProcesses,
445  ProductRegistry const& preg,
446  std::map<std::string, ModuleDescription const*> const& labelsToDesc,
447  std::string const& processName) const {
448  std::set<std::string> alreadyFound;
449 
450  auto modulesInPreviousProcessesEmplace = [&modulesInPreviousProcesses](std::string_view module,
451  std::string_view process) {
452  auto it = std::lower_bound(
453  modulesInPreviousProcesses.begin(), modulesInPreviousProcesses.end(), ModuleProcessName(module, process));
454  modulesInPreviousProcesses.emplace(it, module, process);
455  };
456 
457  auto itKind = m_tokenInfo.begin<kKind>();
458  auto itLabels = m_tokenInfo.begin<kLabels>();
459  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
460  ++itInfo, ++itKind, ++itLabels) {
461  ProductResolverIndexHelper const& helper = *preg.productLookup(itInfo->m_branchType);
462  std::vector<ModuleDescription const*>& modules = *modulesAll[itInfo->m_branchType];
463 
464  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
465  const char* const consumedModuleLabel = &(m_tokenLabels[labelStart]);
466  const char* const consumedProductInstance = consumedModuleLabel + itLabels->m_deltaToProductInstance;
467  const char* const consumedProcessName = consumedModuleLabel + itLabels->m_deltaToProcessName;
468 
469  if (not itInfo->m_index.skipCurrentProcess()) {
470  assert(*consumedModuleLabel != '\0'); // consumesMany used to create empty labels before we removed consumesMany
471  if (*consumedProcessName != '\0') { // process name is specified in consumes call
472  if (helper.index(*itKind, itInfo->m_type, consumedModuleLabel, consumedProductInstance, consumedProcessName) !=
474  if (processName == consumedProcessName) {
475  insertFoundModuleLabel(*itKind,
476  itInfo->m_type,
477  consumedModuleLabel,
478  consumedProductInstance,
479  modules,
480  alreadyFound,
481  labelsToDesc,
482  preg);
483  } else {
484  // Product explicitly from different process than the current process, so must refer to an earlier process (unless it ends up "not found")
485  modulesInPreviousProcessesEmplace(consumedModuleLabel, consumedProcessName);
486  }
487  }
488  } else { // process name was empty
489  auto matches = helper.relatedIndexes(*itKind, itInfo->m_type, consumedModuleLabel, consumedProductInstance);
490  for (unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
491  if (processName == matches.processName(j)) {
492  insertFoundModuleLabel(*itKind,
493  itInfo->m_type,
494  consumedModuleLabel,
495  consumedProductInstance,
496  modules,
497  alreadyFound,
498  labelsToDesc,
499  preg);
500  } else {
501  // Product did not match to current process, so must refer to an earlier process (unless it ends up "not found")
502  // Recall that empty process name means "in the latest process" that can change event-by-event
503  modulesInPreviousProcessesEmplace(consumedModuleLabel, matches.processName(j));
504  }
505  }
506  }
507  } else {
508  // The skipCurrentProcess means the same as empty process name,
509  // except the current process is skipped. Therefore need to do
510  // the same matching as above.
511  auto matches = helper.relatedIndexes(*itKind, itInfo->m_type, consumedModuleLabel, consumedProductInstance);
512  for (unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
513  if (processName != matches.processName(j)) {
514  modulesInPreviousProcessesEmplace(matches.moduleLabel(j), matches.processName(j));
515  }
516  }
517  }
518  }
519 }
520 
522  frozen_ = true;
523 
526 
527  auto newTokenLabels = makeEmptyTokenLabels();
528 
529  // first calculate the size of the new vector and reserve memory for it
530  std::vector<char>::size_type newSize = newTokenLabels.size();
531  std::string newProcessName;
532  for (auto iter = m_tokenInfo.begin<kLabels>(), itEnd = m_tokenInfo.end<kLabels>(); iter != itEnd; ++iter) {
533  newProcessName = &m_tokenLabels[iter->m_startOfModuleLabel + iter->m_deltaToProcessName];
534  if (newProcessName == InputTag::kCurrentProcess) {
535  newProcessName = processName;
536  }
537  newSize += (iter->m_deltaToProcessName + newProcessName.size() + 1);
538  }
539  newTokenLabels.reserve(newSize);
540 
541  unsigned int newStartOfModuleLabel = newTokenLabels.size();
542  for (auto iter = m_tokenInfo.begin<kLabels>(), itEnd = m_tokenInfo.end<kLabels>(); iter != itEnd; ++iter) {
543  unsigned int startOfModuleLabel = iter->m_startOfModuleLabel;
544  unsigned short deltaToProcessName = iter->m_deltaToProcessName;
545 
546  iter->m_startOfModuleLabel = newStartOfModuleLabel;
547 
548  newProcessName = &m_tokenLabels[startOfModuleLabel + deltaToProcessName];
549  if (newProcessName == InputTag::kCurrentProcess) {
550  newProcessName = processName;
551  }
552 
553  newStartOfModuleLabel += (deltaToProcessName + newProcessName.size() + 1);
554 
555  // Copy in both the module label and instance, they are the same
556  newTokenLabels.insert(newTokenLabels.end(),
557  m_tokenLabels.begin() + startOfModuleLabel,
558  m_tokenLabels.begin() + (startOfModuleLabel + deltaToProcessName));
559 
560  newTokenLabels.insert(newTokenLabels.end(), newProcessName.begin(), newProcessName.end());
561  newTokenLabels.push_back('\0');
562  }
563  m_tokenLabels = std::move(newTokenLabels);
564  }
565 }
566 
567 std::vector<ConsumesInfo> EDConsumerBase::consumesInfo() const {
568  std::vector<ConsumesInfo> result;
569  auto itAlways = m_tokenInfo.begin<kAlwaysGets>();
570  auto itKind = m_tokenInfo.begin<kKind>();
571  auto itLabels = m_tokenInfo.begin<kLabels>();
572  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
573  ++itInfo, ++itKind, ++itLabels, ++itAlways) {
574  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
575  const char* consumedModuleLabel = &(m_tokenLabels[labelStart]);
576  const char* consumedInstance = consumedModuleLabel + itLabels->m_deltaToProductInstance;
577  const char* consumedProcessName = consumedModuleLabel + itLabels->m_deltaToProcessName;
578 
579  assert(*consumedModuleLabel != '\0');
580 
581  // Just copy the information into the ConsumesInfo data structure
582  result.emplace_back(itInfo->m_type,
583  consumedModuleLabel,
584  consumedInstance,
585  consumedProcessName,
586  itInfo->m_branchType,
587  *itKind,
588  *itAlways,
589  itInfo->m_index.skipCurrentProcess());
590  }
591  return result;
592 }
593 
594 const char* EDConsumerBase::labelFor(ESTokenIndex iIndex) const {
595  return m_esTokenInfo.get<kESLookupInfo>(iIndex.value()).m_key.name().value();
596 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
Definition: start.py:1
ProductResolverIndexAndSkipBit uncheckedIndexFrom(EDGetToken) const
TypeID const & type() const
Definition: TypeToGet.h:42
static const TGPicture * info(bool iBackgroundIsBlack)
const char * labelFor(ESTokenIndex) const
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:54
Definition: helper.py:1
unsigned int ProductResolverIndex
virtual void doSelectInputProcessBlocks(ProductRegistry const &, ProcessBlockHelperBase const &)
virtual void extendUpdateLookup(BranchType iBranchType, ProductResolverIndexHelper const &)
std::string const & instance() const
Definition: InputTag.h:37
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
void throwESConsumesInProcessBlock() const
std::vector< std::string > aliasToModules(KindOfType kindOfType, TypeID const &type, std::string_view moduleLabel, std::string_view productInstanceName) const
static constexpr ESResolverIndex missingResolverIndex() noexcept
constexpr Value_t value() const noexcept
Definition: ESIndices.h:70
void throwTypeMismatch(edm::TypeID const &, EDGetToken) const
void itemsToGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
ProductResolverIndexAndSkipBit indexFrom(EDGetToken, BranchType, TypeID const &) const
#define LIKELY(x)
Definition: Likely.h:20
void modulesWhoseProductsAreConsumed(std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
std::string const & label() const
Definition: InputTag.h:36
KindOfType kind() const
Definition: TypeToGet.h:43
assert(be >=bs)
uint16_t size_type
const std::string & data() const
Definition: ESInputTag.h:104
BranchType
Definition: BranchType.h:11
char const * process
Definition: ProductLabels.h:7
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
char const * label
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
ProductResolverIndex index(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process=nullptr) const
std::string const & BranchTypeToString(BranchType const &branchType)
Definition: BranchType.cc:93
Transition
Definition: Transition.h:12
ESResolverIndex indexInRecord(EventSetupRecordKey const &iRK, DataKey const &iDK) const noexcept
If the index is not found, returns missingResolverIndex()
static const std::string kCurrentProcess
Definition: InputTag.h:54
void throwESConsumesCallAfterFrozen(eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &) const
std::vector< ConsumesInfo > consumesInfo() const
std::array< std::vector< ESResolverIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esItemsToGetFromTransition_
char const * module
Definition: ProductLabels.h:5
std::array< std::vector< ESRecordIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esRecordsToGetFromTransition_
bool registeredToConsume(ProductResolverIndex, bool, BranchType) const
std::vector< char > m_tokenLabels
std::string const & className() const
Definition: TypeID.cc:40
static const edm::InputTag kWasEmpty("@EmptyLabel@")
void throwBadToken(edm::TypeID const &iType, EDGetToken iToken) const
std::shared_ptr< ProductResolverIndexHelper const > productLookup(BranchType branchType) const
void itemsMayGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
void throwConsumesCallAfterFrozen(TypeToGet const &, InputTag const &) const
char const * productInstance
Definition: ProductLabels.h:6
HLT enums.
bool willSkipCurrentProcess() const
Definition: InputTag.h:42
ESTokenIndex recordESConsumes(Transition, eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &iTag)
virtual void registerLateConsumes(eventsetup::ESRecordsToProductResolverIndices const &)
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)
virtual ~EDConsumerBase() noexcept(false)
ComponentDescription const * component(EventSetupRecordKey const &iRK, DataKey const &iDK) const noexcept
const std::string & module() const
Definition: ESInputTag.h:99
#define UNLIKELY(x)
Definition: Likely.h:21
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:55
std::string const & process() const
Definition: InputTag.h:40
edm::SoATuple< ESTokenLookupInfo, ESResolverIndex > m_esTokenInfo
void convertCurrentProcessAlias(std::string const &processName)
Convert "@currentProcess" in InputTag process names to the actual current process name...
void throwBranchMismatch(BranchType, EDGetToken) const
ESRecordIndex recordIndexFor(EventSetupRecordKey const &iRK) const noexcept
def move(src, dest)
Definition: eostools.py:511
std::array< std::vector< ProductResolverIndexAndSkipBit >, edm::NumBranchTypes > itemsToGetFromBranch_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const