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