CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Principal.cc
Go to the documentation of this file.
1 
4 #include <algorithm>
5 #include <sstream>
6 #include <stdexcept>
7 #include <limits>
8 #include <cstring>
9 
16 //using boost::lambda::_1;
17 
18 namespace edm {
19 
20  Principal::Principal(boost::shared_ptr<ProductRegistry const> reg,
21  ProcessConfiguration const& pc,
22  BranchType bt) :
24  processHistoryPtr_(boost::shared_ptr<ProcessHistory>(new ProcessHistory)),
25  processHistoryID_(processHistoryPtr_->id()),
26  processConfiguration_(&pc),
27  groups_(reg->constProductList().size(), SharedGroupPtr()),
28  preg_(reg),
29  branchMapperPtr_(),
30  store_(),
31  productPtrs_(),
32  branchType_(bt) {
33  //Now that these have been set, we can create the list of Branches we need.
34  std::string const source("source");
35  ProductRegistry::ProductList const& prodsList = reg->productList();
36  for(ProductRegistry::ProductList::const_iterator itProdInfo = prodsList.begin(),
37  itProdInfoEnd = prodsList.end();
38  itProdInfo != itProdInfoEnd;
39  ++itProdInfo) {
40  if (itProdInfo->second.branchType() == branchType_) {
41  boost::shared_ptr<ConstBranchDescription> bd(new ConstBranchDescription(itProdInfo->second));
42  if (bd->produced()) {
43  if (bd->moduleLabel() == source) {
44  addGroupSource(bd);
45  } else if(bd->onDemand()) {
46  assert(bt == InEvent);
47  addOnDemandGroup(bd);
48  } else {
50  }
51  } else {
52  addGroupInput(bd);
53  }
54  }
55  }
56  }
57 
59  }
60 
61  // Number of products in the Principal.
62  // For products in an input file and not yet read in due to delayed read,
63  // this routine assumes a real product is there.
64  size_t
65  Principal::size() const {
66  size_t size = 0U;
67  for(const_iterator it = this->begin(), itEnd = this->end(); it != itEnd; ++it) {
68  Group const& g = **it;
69  if (!g.productUnavailable() && !g.onDemand() && !g.branchDescription().dropped()) {
70  ++size;
71  }
72  }
73  return size;
74  }
75 
76  //adjust provenance for input groups after new input file has been merged
77  bool
79  if(reg.constProductList().size() > groups_.size()) {
80  return false;
81  }
82  ProductRegistry::ProductList const& prodsList = reg.productList();
83  for(ProductRegistry::ProductList::const_iterator itProdInfo = prodsList.begin(),
84  itProdInfoEnd = prodsList.end();
85  itProdInfo != itProdInfoEnd;
86  ++itProdInfo) {
87  if (!itProdInfo->second.produced() && (itProdInfo->second.branchType() == branchType_)) {
88  boost::shared_ptr<ConstBranchDescription> bd(new ConstBranchDescription(itProdInfo->second));
89  Group *g = getExistingGroup(itProdInfo->second.branchID());
90  if (g == 0 || g->branchDescription().branchName() != bd->branchName()) {
91  return false;
92  }
94  }
95  }
96  return true;
97  }
98 
99  void
100  Principal::addGroupScheduled(boost::shared_ptr<ConstBranchDescription> bd) {
101  std::auto_ptr<Group> g(new ScheduledGroup(bd));
102  addGroupOrThrow(g);
103  }
104 
105  void
106  Principal::addGroupSource(boost::shared_ptr<ConstBranchDescription> bd) {
107  std::auto_ptr<Group> g(new SourceGroup(bd));
108  addGroupOrThrow(g);
109  }
110 
111  void
112  Principal::addGroupInput(boost::shared_ptr<ConstBranchDescription> bd) {
113  std::auto_ptr<Group> g(new InputGroup(bd));
114  addGroupOrThrow(g);
115  }
116 
117  void
118  Principal::addOnDemandGroup(boost::shared_ptr<ConstBranchDescription> bd) {
119  std::auto_ptr<Group> g(new UnscheduledGroup(bd));
120  addGroupOrThrow(g);
121  }
122 
123  // "Zero" the principal so it can be reused for another Event.
124  void
128  branchMapperPtr_.reset();
129  store_.reset();
130  for (Principal::const_iterator i = begin(), iEnd = end(); i != iEnd; ++i) {
131  (*i)->resetGroupData();
132  }
133  productPtrs_.clear();
134  }
135 
136  // Set the principal for the Event, Lumi, or Run.
137  void
138  Principal::fillPrincipal(ProcessHistoryID const& hist, boost::shared_ptr<BranchMapper> mapper, boost::shared_ptr<DelayedReader> rtrv) {
139  branchMapperPtr_ = mapper;
140  store_ = rtrv;
141  if (hist.isValid()) {
143  assert(history.notEmpty());
144  bool found = history.getMapped(hist, *processHistoryPtr_);
145  assert(found);
147  }
148  preg_->productLookup().reorderIfNecessary(branchType_, *processHistoryPtr_,
150  preg_->elementLookup().reorderIfNecessary(branchType_, *processHistoryPtr_,
152  }
153 
154  Group*
156  ProductTransientIndex index = preg_->indexFrom(branchID);
157  assert(index != ProductRegistry::kInvalidIndex);
158  SharedGroupPtr ptr = groups_.at(index);
159  return ptr.get();
160  }
161 
162  Group*
165  assert(0 == g || BranchKey(group.branchDescription()) == BranchKey(g->branchDescription()));
166  return g;
167  }
168 
169  void
170  Principal::addGroup_(std::auto_ptr<Group> group) {
171  ConstBranchDescription const& bd = group->branchDescription();
172  assert (!bd.className().empty());
173  assert (!bd.friendlyClassName().empty());
174  assert (!bd.moduleLabel().empty());
175  assert (!bd.processName().empty());
176  SharedGroupPtr g(group);
177 
178  ProductTransientIndex index = preg_->indexFrom(bd.branchID());
179  assert(index != ProductRegistry::kInvalidIndex);
180  groups_[index] = g;
181  }
182 
183  void
184  Principal::addGroupOrThrow(std::auto_ptr<Group> group) {
185  Group const* g = getExistingGroup(*group);
186  if (g != 0) {
187  ConstBranchDescription const& bd = group->branchDescription();
188  throw edm::Exception(edm::errors::InsertFailure,"AlreadyPresent")
189  << "addGroupOrThrow: Problem found while adding product, "
190  << "product already exists for ("
191  << bd.friendlyClassName() << ","
192  << bd.moduleLabel() << ","
193  << bd.productInstanceName() << ","
194  << bd.processName()
195  << ")\n";
196  }
197  addGroup_(group);
198  }
199 
200  void
204  }
205 
207  Principal::getGroup(BranchID const& bid, bool resolveProd, bool fillOnDemand) const {
208  ProductTransientIndex index = preg_->indexFrom(bid);
209  if(index == ProductRegistry::kInvalidIndex){
210  return SharedConstGroupPtr();
211  }
212  return getGroupByIndex(index, resolveProd, fillOnDemand);
213  }
214 
216  Principal::getGroupByIndex(ProductTransientIndex const& index, bool resolveProd, bool fillOnDemand) const {
217 
219  if (0 == g.get()) {
220  return g;
221  }
222  if (resolveProd && !g->productUnavailable()) {
223  this->resolveProduct(*g, fillOnDemand);
224  }
225  return g;
226  }
227 
229  Principal::getBySelector(TypeID const& productType,
230  SelectorBase const& sel) const {
232 
233  int nFound = findGroup(productType,
234  preg_->productLookup(),
235  sel,
236  result);
237 
238  if (nFound == 0) {
239  boost::shared_ptr<cms::Exception> whyFailed(new edm::Exception(edm::errors::ProductNotFound));
240  *whyFailed
241  << "getBySelector: Found zero products matching all criteria\n"
242  << "Looking for type: " << productType << "\n";
243  return BasicHandle(whyFailed);
244  }
245  if (nFound > 1) {
247  << "getBySelector: Found " << nFound << " products rather than one which match all criteria\n"
248  << "Looking for type: " << productType << "\n";
249  }
250  return result;
251  }
252 
254  Principal::getByLabel(TypeID const& productType,
255  std::string const& label,
256  std::string const& productInstanceName,
257  std::string const& processName,
258  size_t& cachedOffset,
259  int& fillCount) const {
260 
262 
263  bool found = findGroupByLabel(productType,
264  preg_->productLookup(),
265  label,
266  productInstanceName,
267  processName,
268  cachedOffset,
269  fillCount,
270  result);
271 
272  if (!found) {
273  boost::shared_ptr<cms::Exception> whyFailed(new edm::Exception(edm::errors::ProductNotFound));
274  *whyFailed
275  << "getByLabel: Found zero products matching all criteria\n"
276  << "Looking for type: " << productType << "\n"
277  << "Looking for module label: " << label << "\n"
278  << "Looking for productInstanceName: " << productInstanceName << "\n"
279  << (processName.empty() ? "" : "Looking for process: ") << processName << "\n";
280  return BasicHandle(whyFailed);
281  }
282  return result;
283  }
284 
285 
286  void
287  Principal::getMany(TypeID const& productType,
288  SelectorBase const& sel,
289  BasicHandleVec& results) const {
290 
291  findGroups(productType,
292  preg_->productLookup(),
293  sel,
294  results);
295 
296  return;
297  }
298 
300  Principal::getByType(TypeID const& productType) const {
301 
304 
305  int nFound = findGroup(productType,
306  preg_->productLookup(),
307  sel,
308  result);
309 
310  if (nFound == 0) {
311  boost::shared_ptr<cms::Exception> whyFailed(new edm::Exception(edm::errors::ProductNotFound));
312  *whyFailed
313  << "getByType: Found zero products matching all criteria\n"
314  << "Looking for type: " << productType << "\n";
315  return BasicHandle(whyFailed);
316  }
317  if (nFound > 1) {
319  << "getByType: Found " << nFound << " products rather than one which match all criteria\n"
320  << "Looking for type: " << productType << "\n";
321  }
322  return result;
323  }
324 
325  void
326  Principal::getManyByType(TypeID const& productType,
327  BasicHandleVec& results) const {
328 
330 
331  findGroups(productType,
332  preg_->productLookup(),
333  sel,
334  results);
335  return;
336  }
337 
338  size_t
340  SelectorBase const& selector,
341  BasicHandle& result) const {
342 
343  // One new argument is the element lookup container
344  // Otherwise this just passes through the arguments to findGroup
345  return findGroup(typeID,
346  preg_->elementLookup(),
347  selector,
348  result);
349  }
350 
351  size_t
353  TransientProductLookupMap const& typeLookup,
354  SelectorBase const& selector,
355  BasicHandleVec& results) const {
356  assert(results.empty());
357 
359  // A class without a dictionary cannot be in an Event/Lumi/Run.
360  // First, we check if the class has a dictionary. If it does not,
361  // we return immediately.
362  std::pair<TypeLookup::const_iterator, TypeLookup::const_iterator> const range = typeLookup.equal_range(TypeInBranchType(typeID,branchType_));
363  if(range.first == range.second) {
364  return 0;
365  }
366 
367  results.reserve(range.second - range.first);
368 
369  for(TypeLookup::const_iterator it = range.first; it != range.second; ++it) {
370 
371  if(selector.match(*(it->branchDescription()))) {
372 
373  //now see if the data is actually available
374  SharedConstGroupPtr const& group = getGroupByIndex(it->index(), false, false);
375  // Skip product if not available.
376  if (group && !group->productUnavailable()) {
377  this->resolveProduct(*group, true);
378  // If the product is a dummy filler, group will now be marked unavailable.
379  // Unscheduled execution can fail to produce the EDProduct so check
380  if (!group->productUnavailable() && !group->onDemand()) {
381  // Found a good match, save it
382  BasicHandle bh(group->product(), group->provenance());
383  results.push_back(bh);
384  }
385  }
386  }
387  }
388  return results.size();
389  }
390 
391  size_t
393  TransientProductLookupMap const& typeLookup,
394  SelectorBase const& selector,
395  BasicHandle& result) const {
396  assert(!result.isValid());
397 
398  size_t count = 0U;
399 
401  // A class without a dictionary cannot be in an Event/Lumi/Run.
402  // First, we check if the class has a dictionary. If it does not,
403  // we return immediately.
404  std::pair<TypeLookup::const_iterator, TypeLookup::const_iterator> const range = typeLookup.equal_range(TypeInBranchType(typeID,branchType_));
405  if(range.first == range.second) {
406  return 0;
407  }
408 
409  unsigned int processLevelFound = std::numeric_limits<unsigned int>::max();
410  for(TypeLookup::const_iterator it = range.first; it != range.second; ++it) {
411  if(it->processIndex() > processLevelFound) {
412  //this is for a less recent process and we've already found a match for a more recent process
413  continue;
414  }
415 
416  if(selector.match(*(it->branchDescription()))) {
417 
418  //now see if the data is actually available
419  SharedConstGroupPtr const& group = getGroupByIndex(it->index(), false, false);
420  // Skip product if not available.
421  if (group && !group->productUnavailable()) {
422  this->resolveProduct(*group, true);
423  // If the product is a dummy filler, group will now be marked unavailable.
424  // Unscheduled execution can fail to produce the EDProduct so check
425  if (!group->productUnavailable() && !group->onDemand()) {
426  if(it->processIndex() < processLevelFound) {
427  processLevelFound = it->processIndex();
428  count = 0U;
429  }
430  if (count == 0U) {
431  // Found a unique (so far) match, save it
432  result = BasicHandle(group->product(), group->provenance());
433  }
434  ++count;
435  }
436  }
437  }
438  }
439  if (count != 1) result = BasicHandle();
440  return count;
441  }
442 
443  bool
445  TransientProductLookupMap const& typeLookup,
446  std::string const& moduleLabel,
447  std::string const& productInstanceName,
448  std::string const& processName,
449  size_t& cachedOffset,
450  int& fillCount,
451  BasicHandle& result) const {
452  assert(!result.isValid());
453 
455  bool isCached = (fillCount > 0 && fillCount == typeLookup.fillCount());
456  bool toBeCached = (fillCount >= 0 && !isCached);
457 
458  std::pair<TypeLookup::const_iterator, TypeLookup::const_iterator> range =
459  (isCached ? std::make_pair(typeLookup.begin() + cachedOffset, typeLookup.end()) : typeLookup.equal_range(TypeInBranchType(typeID,branchType_), moduleLabel, productInstanceName));
460 
461  if (toBeCached) {
462  cachedOffset = range.first - typeLookup.begin();
463  fillCount = typeLookup.fillCount();
464  }
465 
466  if(range.first == range.second) {
467  if (toBeCached) {
468  cachedOffset = typeLookup.end() - typeLookup.begin();
469  }
470  return false;
471  }
472 
473  if (!processName.empty()) {
474  if (isCached) {
475  assert(processName == range.first->branchDescription()->processName());
476  range.second = range.first + 1;
477  } else if (toBeCached) {
478  bool processFound = false;
479  for(TypeLookup::const_iterator it = range.first; it != range.second; ++it) {
480  if (it->isFirst() && it != range.first) {
481  break;
482  }
483  if (processName == it->branchDescription()->processName()) {
484  processFound = true;
485  range.first = it;
486  cachedOffset = range.first - typeLookup.begin();
487  range.second = range.first + 1;
488  break;
489  }
490  }
491  if (!processFound) {
492  cachedOffset = typeLookup.end() - typeLookup.begin();
493  return false;
494  }
495  } // end if(toBeCached)
496  }
497 
498  for(TypeLookup::const_iterator it = range.first; it != range.second; ++it) {
499  if (it->isFirst() && it != range.first) {
500  return false;
501  }
502  if (!processName.empty() && processName != it->branchDescription()->processName()) {
503  continue;
504  }
505  //now see if the data is actually available
506  SharedConstGroupPtr const& group = getGroupByIndex(it->index(), false, false);
507  // Skip product if not available.
508  if (group && !group->productUnavailable()) {
509  this->resolveProduct(*group, true);
510  // If the product is a dummy filler, group will now be marked unavailable.
511  // Unscheduled execution can fail to produce the EDProduct so check
512  if (!group->productUnavailable() && !group->onDemand()) {
513  // Found the match
514  result = BasicHandle(group->product(), group->provenance());
515  return true;
516  }
517  }
518  }
519  return false;
520  }
521 
523  Principal::getForOutput(BranchID const& bid, bool getProd) const {
524  SharedConstGroupPtr const& g = getGroup(bid, getProd, false);
525  if (g.get() == 0) {
526  throw edm::Exception(edm::errors::LogicError, "Principal::getForOutput\n")
527  << "No entry is present for this branch.\n"
528  << "The branch id is " << bid << "\n"
529  << "Contact a framework developer.\n";
530  }
531  if (!g->provenance() || (!g->product() && !g->productProvenancePtr())) {
532  return OutputHandle();
533  }
534  return OutputHandle(g->product().get(), &g->branchDescription(), g->productProvenancePtr());
535  }
536 
537  Provenance
538  Principal::getProvenance(BranchID const& bid) const {
539  SharedConstGroupPtr const& g = getGroup(bid, false, true);
540  if (g.get() == 0) {
542  << "getProvenance: no product with given branch id: "<< bid << "\n";
543  }
544 
545  if (g->onDemand()) {
546  unscheduledFill(g->branchDescription().moduleLabel());
547  }
548  // We already tried to produce the unscheduled products above
549  // If they still are not there, then throw
550  if (g->onDemand()) {
552  << "getProvenance: no product with given BranchID: "<< bid <<"\n";
553  }
554 
555  return *g->provenance();
556  }
557 
558  // This one is mostly for test printout purposes
559  // No attempt to trigger on demand execution
560  // Skips provenance when the EDProduct is not there
561  void
562  Principal::getAllProvenance(std::vector<Provenance const*>& provenances) const {
563  provenances.clear();
564  for (const_iterator i = begin(), iEnd = end(); i != iEnd; ++i) {
565  if ((*i)->provenanceAvailable()) {
566  // We do not attempt to get the event/lumi/run status from the provenance,
567  // because the per event provenance may have been dropped.
568  if ((*i)->provenance()->product().present()) {
569  provenances.push_back((*i)->provenance());
570  }
571  }
572  }
573  }
574 
575  void
576  Principal::recombine(Principal& other, std::vector<BranchID> const& bids) {
577  for (std::vector<BranchID>::const_iterator it = bids.begin(), itEnd = bids.end(); it != itEnd; ++it) {
578  ProductTransientIndex index= preg_->indexFrom(*it);
579  assert(index!=ProductRegistry::kInvalidIndex);
580  ProductTransientIndex indexO = other.preg_->indexFrom(*it);
581  assert(indexO!=ProductRegistry::kInvalidIndex);
582  groups_[index].swap(other.groups_[indexO]);
583  }
584  store_->mergeReaders(other.store());
585  branchMapperPtr_->mergeMappers(other.branchMapperPtr());
586  }
587 
588  EDProduct const*
590  assert(0);
591  return 0;
592  }
593 
594  void
595  Principal::maybeFlushCache(TypeID const& tid, InputTag const& tag) const {
596  if (tag.typeID() != tid ||
597  tag.branchType() != branchType() ||
598  tag.productRegistry() != &productRegistry()) {
599  tag.fillCount() = 0;
600  tag.cachedOffset() = 0U;
601  tag.typeID() = tid;
602  tag.branchType() = branchType();
603  tag.productRegistry() = &productRegistry();
604  }
605  }
606 
607  void
608  Principal::checkUniquenessAndType(std::auto_ptr<EDProduct>& prod, Group const* g) const {
609  if (prod.get() == 0) return;
610  // These are defensive checks against things that should never happen, but have.
611  // Checks that the same physical product has not already been put into the event.
612  bool alreadyPresent = !productPtrs_.insert(prod.get()).second;
613  if (alreadyPresent) {
614  g->checkType(*prod.release());
616  << "Product on branch " << g->branchDescription().branchName() << " occurs twice in the same event.\n";
617  }
618  // Checks that the real type of the product matches the branch.
619  g->checkType(*prod);
620  }
621 
622  void
623  Principal::putOrMerge(std::auto_ptr<EDProduct> prod, Group const* g) const {
624  bool willBePut = g->putOrMergeProduct();
625  if (willBePut) {
626  checkUniquenessAndType(prod, g);
627  g->putProduct(prod);
628  } else {
629  g->checkType(*prod);
630  g->mergeProduct(prod);
631  }
632  }
633 
634  void
635  Principal::putOrMerge(std::auto_ptr<EDProduct> prod, std::auto_ptr<ProductProvenance> prov, Group* g) {
636  bool willBePut = g->putOrMergeProduct();
637  if (willBePut) {
638  checkUniquenessAndType(prod, g);
639  g->putProduct(prod, prov);
640  } else {
641  g->checkType(*prod);
642  g->mergeProduct(prod, prov);
643  }
644  }
645 
646  void
651  std::swap(groups_,iOther.groups_);
652  std::swap(preg_, iOther.preg_);
654  std::swap(store_,iOther.store_);
655  }
656 
657  void
659  if (preg_->constProductList().size() > groups_.size()) {
660  GroupCollection newGroups(preg_->constProductList().size(), SharedGroupPtr());
661  for (Principal::const_iterator i = begin(), iEnd = end(); i != iEnd; ++i) {
662  ProductTransientIndex index = preg_->indexFrom((*i)->branchDescription().branchID());
663  assert(index != ProductRegistry::kInvalidIndex);
664  newGroups[index] = *i;
665  }
666  groups_.swap(newGroups);
667  // Now we must add new groups for any new product registry entries.
668  ProductRegistry::ProductList const& prodsList = preg_->productList();
669  for(ProductRegistry::ProductList::const_iterator itProdInfo = prodsList.begin(),
670  itProdInfoEnd = prodsList.end();
671  itProdInfo != itProdInfoEnd;
672  ++itProdInfo) {
673  if (itProdInfo->second.branchType() == branchType_) {
674  ProductTransientIndex index = preg_->indexFrom(itProdInfo->second.branchID());
675  assert(index != ProductRegistry::kInvalidIndex);
676  if (!groups_[index]) {
677  // no group. Must add one. The new entry must be an input group.
678  assert(!itProdInfo->second.produced());
679  boost::shared_ptr<ConstBranchDescription> bd(new ConstBranchDescription(itProdInfo->second));
680  addGroupInput(bd);
681  }
682  }
683  }
684  }
685  }
686 }
BranchType branchType_
Definition: Principal.h:237
std::string const & processName() const
void maybeFlushCache(TypeID const &tid, InputTag const &tag) const
Definition: Principal.cc:595
ProductRegistry const & productRegistry() const
Definition: Principal.h:122
void clearPrincipal()
Definition: Principal.cc:125
int i
Definition: DBlmapReader.cc:9
boost::shared_ptr< BranchMapper > branchMapperPtr_
Definition: Principal.h:228
void swapBase(Principal &)
Definition: Principal.cc:647
size_t size() const
Definition: Principal.cc:65
size_t findGroup(TypeID const &typeID, TypeLookup const &typeLookup, SelectorBase const &selector, BasicHandle &result) const
Definition: Principal.cc:392
void addGroupScheduled(boost::shared_ptr< ConstBranchDescription > bd)
Definition: Principal.cc:100
boost::shared_ptr< DelayedReader > store() const
Definition: Principal.h:141
SharedConstGroupPtr const getGroupByIndex(ProductTransientIndex const &oid, bool resolveProd, bool fillOnDemand) const
Definition: Principal.cc:216
const std::string & label
Definition: MVAComputer.cc:186
ConstProductList & constProductList() const
BasicHandle getByLabel(TypeID const &tid, std::string const &label, std::string const &productInstanceName, std::string const &processName, size_t &cachedOffset, int &fillCount) const
Definition: Principal.cc:254
Principal(boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, BranchType bt)
Definition: Principal.cc:20
const_iterator end() const
Definition: Principal.h:131
void addGroup_(std::auto_ptr< Group > g)
Definition: Principal.cc:170
Group * getExistingGroup(BranchID const &branchID)
Definition: Principal.cc:155
void putOrMerge(std::auto_ptr< EDProduct > prod, Group const *group) const
Definition: Principal.cc:623
void addGroupOrThrow(std::auto_ptr< Group > g)
Definition: Principal.cc:184
std::map< BranchKey, BranchDescription > ProductList
ProcessHistoryID processHistoryID_
Definition: Principal.h:215
static ProductTransientIndex const kInvalidIndex
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Principal.cc:562
bool getMapped(key_type const &k, value_type &result) const
boost::shared_ptr< ProductRegistry const > preg_
Definition: Principal.h:224
std::string const & friendlyClassName() const
BranchType & branchType() const
Definition: InputTag.h:35
void addGroupSource(boost::shared_ptr< ConstBranchDescription > bd)
Definition: Principal.cc:106
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
boost::shared_ptr< ProcessHistory > processHistoryPtr_
Definition: Principal.h:213
BranchType
Definition: BranchType.h:11
void resolveProduct(Group const &g, bool fillOnDemand) const
Definition: Principal.h:170
size_t & cachedOffset() const
Definition: InputTag.h:37
ProductLookupIndexList::const_iterator const_iterator
GroupCollection groups_
Definition: Principal.h:220
bool match(ConstBranchDescription const &p) const
Definition: SelectorBase.cc:15
std::string const & processName() const
ProductList const & productList() const
U second(std::pair< T, U > const &p)
TypeID & typeID() const
Definition: InputTag.h:33
bool onDemand() const
Definition: Group.h:78
int & fillCount() const
Definition: InputTag.h:39
boost::shared_ptr< Group > SharedGroupPtr
Definition: Principal.h:54
const T & max(const T &a, const T &b)
void getMany(TypeID const &tid, SelectorBase const &, BasicHandleVec &results) const
Definition: Principal.cc:287
void putProduct(std::auto_ptr< EDProduct > edp, boost::shared_ptr< ProductProvenance > productProvenance)
Definition: Group.h:125
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::string const & productInstanceName() const
void setProcessHistory(Principal const &principal)
Definition: Principal.cc:201
BranchType const & branchType() const
Definition: Principal.h:137
size_t findGroups(TypeID const &typeID, TypeLookup const &typeLookup, SelectorBase const &selector, BasicHandleVec &results) const
Definition: Principal.cc:352
tuple result
Definition: query.py:137
void fillPrincipal(ProcessHistoryID const &hist, boost::shared_ptr< BranchMapper > mapper, boost::shared_ptr< DelayedReader > rtrv)
Definition: Principal.cc:138
void checkUniquenessAndType(std::auto_ptr< EDProduct > &prod, Group const *group) const
Definition: Principal.cc:608
size_t getMatchingSequence(TypeID const &typeID, SelectorBase const &selector, BasicHandle &result) const
Definition: Principal.cc:339
BranchID const & branchID() const
OutputHandle getForOutput(BranchID const &bid, bool getProd) const
Definition: Principal.cc:523
virtual EDProduct const * getIt(ProductID const &) const
Definition: Principal.cc:589
bool putOrMergeProduct() const
Definition: Group.h:138
virtual ~Principal()
Definition: Principal.cc:58
void const *& productRegistry() const
Definition: InputTag.h:41
std::string const & className() const
void checkType(EDProduct const &prod) const
Definition: Group.h:157
std::pair< const_iterator, const_iterator > equal_range(TypeInBranchType const &) const
returns a pair of iterators that define the range for items matching the TypeInBranchType ...
const_iterator begin() const
Definition: Principal.h:130
SharedConstGroupPtr const getGroup(BranchID const &oid, bool resolveProd, bool fillOnDemand) const
Definition: Principal.cc:207
bool isValid() const
Definition: BasicHandle.h:79
void getManyByType(TypeID const &tid, BasicHandleVec &results) const
Definition: Principal.cc:326
std::set< EDProduct * > productPtrs_
Definition: Principal.h:235
std::string const & branchName() const
void addGroupInput(boost::shared_ptr< ConstBranchDescription > bd)
Definition: Principal.cc:112
BasicHandle getByType(TypeID const &tid) const
Definition: Principal.cc:300
boost::filter_iterator< FilledGroupPtr, GroupCollection::const_iterator > const_iterator
Definition: Principal.h:48
author Stefano ARGIRO author Bill Tanenbaum
bool isValid() const
Definition: Hash.h:136
virtual bool unscheduledFill(std::string const &moduleLabel) const =0
bool adjustToNewProductRegistry(ProductRegistry const &reg)
Definition: Principal.cc:78
BasicHandle getBySelector(TypeID const &tid, SelectorBase const &s) const
Definition: Principal.cc:229
bool findGroupByLabel(TypeID const &typeID, TypeLookup const &typeLookup, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, size_t &cachedOffset, int &fillCount, BasicHandle &result) const
Definition: Principal.cc:444
void resetBranchDescription(boost::shared_ptr< ConstBranchDescription > bd)
Definition: Group.h:93
std::vector< boost::shared_ptr< Group > > GroupCollection
Definition: Principal.h:47
boost::shared_ptr< BranchMapper > branchMapperPtr() const
Definition: Principal.h:139
TransientProductLookupMap TypeLookup
Definition: Principal.h:189
static ThreadSafeRegistry * instance()
void adjustIndexesAfterProductRegistryAddition()
Definition: Principal.cc:658
bool productUnavailable() const
Definition: Group.h:72
void mergeProduct(std::auto_ptr< EDProduct > edp, boost::shared_ptr< ProductProvenance > productProvenance)
Definition: Group.h:143
Provenance getProvenance(BranchID const &bid) const
Definition: Principal.cc:538
void recombine(Principal &other, std::vector< BranchID > const &bids)
Definition: Principal.cc:576
boost::shared_ptr< Group const > SharedConstGroupPtr
Definition: Principal.h:50
ProcessConfiguration const * processConfiguration_
Definition: Principal.h:217
tuple size
Write out results.
ConstBranchDescription const & branchDescription() const
Definition: Group.h:90
bool notEmpty() const
Return true if there are any contained value_type objects.
std::vector< BasicHandle > BasicHandleVec
Definition: Principal.h:51
std::string const & moduleLabel() const
boost::shared_ptr< DelayedReader > store_
Definition: Principal.h:232
void addOnDemandGroup(boost::shared_ptr< ConstBranchDescription > bd)
Definition: Principal.cc:118
const std::string * moduleLabel() const
Definition: HLTadd.h:40