Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
art::DataViewImpl Class Reference

#include <DataViewImpl.h>

Inheritance diagram for art::DataViewImpl:
art::Event art::Results art::Run art::SubRun

Classes

struct  PMValue
 

Public Member Functions

 ~DataViewImpl ()
 
 DataViewImpl (BranchType bt, Principal const &p, ModuleContext const &mc, bool recordParents, RangeSet const &rs=RangeSet::invalid())
 
 DataViewImpl (DataViewImpl const &)=delete
 
 DataViewImpl (DataViewImpl &&)=delete
 
DataViewImploperator= (DataViewImpl const &)=delete
 
DataViewImploperator= (DataViewImpl &)=delete
 
RunID runID () const
 
SubRunID subRunID () const
 
EventID eventID () const
 
RunNumber_t run () const
 
SubRunNumber_t subRun () const
 
EventNumber_t event () const
 
Timestamp const & beginTime () const
 
Timestamp const & endTime () const
 
Timestamp time () const
 
bool isRealData () const
 
EventAuxiliary::ExperimentType experimentType () const
 
History const & history () const
 
ProcessHistoryID const & processHistoryID () const
 
ProcessHistory const & processHistory () const
 
template<typename PROD >
bool removeCachedProduct (Handle< PROD > &) const
 
EDProductGetter const * productGetter (ProductID const pid) const
 
bool getProcessParameterSet (std::string const &process, fhicl::ParameterSet &) const
 
template<typename PROD >
PROD const & getProduct (InputTag const &tag) const
 
template<typename PROD >
PROD const & getProduct (ProductToken< PROD > const &token) const
 
template<typename PROD >
Handle< PROD > getHandle (SelectorBase const &) const
 
template<typename PROD >
Handle< PROD > getHandle (ProductID const pid) const
 
template<typename PROD >
Handle< PROD > getHandle (InputTag const &tag) const
 
template<typename PROD >
Handle< PROD > getHandle (ProductToken< PROD > const &token) const
 
template<typename PROD >
ValidHandle< PROD > getValidHandle (InputTag const &tag) const
 
template<typename PROD >
ValidHandle< PROD > getValidHandle (ProductToken< PROD > const &token) const
 
template<typename PROD >
std::vector< InputTaggetInputTags (SelectorBase const &selector=MatchAllSelector{}) const
 
template<typename PROD >
std::vector< ProductToken< PROD > > getProductTokens (SelectorBase const &selector=MatchAllSelector{}) const
 
template<typename PROD >
std::vector< Handle< PROD > > getMany (SelectorBase const &selector=MatchAllSelector{}) const
 
template<typename PROD >
bool get (SelectorBase const &, Handle< PROD > &result) const
 
template<typename PROD >
bool get (ProductID const pid, Handle< PROD > &result) const
 
template<typename PROD >
bool getByLabel (std::string const &label, std::string const &instance, Handle< PROD > &result) const
 
template<typename PROD >
bool getByLabel (std::string const &label, std::string const &instance, std::string const &process, Handle< PROD > &result) const
 
template<typename PROD >
bool getByLabel (InputTag const &tag, Handle< PROD > &result) const
 
template<typename PROD >
bool getByToken (ProductToken< PROD > const &token, Handle< PROD > &result) const
 
template<typename PROD >
PROD const * getPointerByLabel (InputTag const &tag) const
 
template<typename PROD >
void getMany (SelectorBase const &, std::vector< Handle< PROD >> &results) const
 
template<typename PROD >
void getManyByType (std::vector< Handle< PROD >> &results) const
 
template<typename ELEMENT >
std::size_t getView (std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
 
template<typename ELEMENT >
std::size_t getView (std::string const &moduleLabel, std::string const &productInstanceName, std::vector< ELEMENT const * > &result) const
 
template<typename ELEMENT >
std::size_t getView (InputTag const &, std::vector< ELEMENT const * > &result) const
 
template<typename ELEMENT >
std::size_t getView (ViewToken< ELEMENT > const &, std::vector< ELEMENT const * > &result) const
 
template<typename ELEMENT >
bool getView (std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, View< ELEMENT > &result) const
 
template<typename ELEMENT >
bool getView (std::string const &moduleLabel, std::string const &productInstanceName, View< ELEMENT > &result) const
 
template<typename ELEMENT >
bool getView (InputTag const &, View< ELEMENT > &result) const
 
template<typename ELEMENT >
bool getView (ViewToken< ELEMENT > const &, View< ELEMENT > &result) const
 
template<typename T >
ProductID getProductID (std::string const &instance_name="") const
 
cet::exempt_ptr< BranchDescription const > getProductDescription (ProductID) const
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, std::string const &instance={})
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, std::string const &instance, RangeSet const &rs)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > semantic)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, FragmentSemantic< Level::Run > semantic)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, RangedFragmentSemantic< Level::Run > semantic)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, std::string const &instance, FullSemantic< Level::Run >)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, std::string const &instance, FragmentSemantic< Level::Run >)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, std::string const &instance, RangedFragmentSemantic< Level::Run > semantic)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, FullSemantic< Level::SubRun > semantic)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, FragmentSemantic< Level::SubRun > semantic)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, RangedFragmentSemantic< Level::SubRun > semantic)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, std::string const &instance, FullSemantic< Level::SubRun >)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, std::string const &instance, FragmentSemantic< Level::SubRun >)
 
template<typename PROD >
ProductID put (std::unique_ptr< PROD > &&edp, std::string const &instance, RangedFragmentSemantic< Level::SubRun > semantic)
 
void movePutProductsToPrincipal (Principal &principal)
 
void movePutProductsToPrincipal (Principal &principal, bool const checkProducts, std::map< TypeLabel, BranchDescription > const *expectedProducts)
 

Private Member Functions

std::string const & getProcessName_ (std::string const &) const
 
BranchDescription const & getProductDescription_ (TypeID const &type, std::string const &instance, bool const alwaysEnableLookupOfProducedProducts=false) const
 
void recordAsParent_ (cet::exempt_ptr< Group const > grp) const
 
cet::exempt_ptr< Group const > getContainerForView_ (TypeID const &, std::string const &moduleLabel, std::string const &productInstanceName, ProcessTag const &processTag) const
 

Private Attributes

std::recursive_mutex mutex_ {}
 
BranchType const branchType_
 
Principal const & principal_
 
ModuleContext const & mc_
 
ModuleDescription const & md_
 
bool const recordParents_
 
RangeSet rangeSet_ {RangeSet::invalid()}
 
std::set< ProductIDretrievedProducts_ {}
 
std::map< TypeLabel, PMValueputProducts_ {}
 

Friends

class detail::Analyzer
 
class detail::Filter
 
class detail::Producer
 
class ResultsProducer
 
class ProducingService
 

Detailed Description

Definition at line 64 of file DataViewImpl.h.

Constructor & Destructor Documentation

art::DataViewImpl::~DataViewImpl ( )
default
art::DataViewImpl::DataViewImpl ( BranchType  bt,
Principal const &  p,
ModuleContext const &  mc,
bool  recordParents,
RangeSet const &  rs = RangeSet::invalid() 
)
explicit

Definition at line 36 of file DataViewImpl.cc.

41  : branchType_{bt}
42  , principal_{principal}
43  , mc_{mc}
44  , md_{mc.moduleDescription()}
45  , recordParents_{recordParents}
46  , rangeSet_{rs}
47  {}
Principal const & principal_
Definition: DataViewImpl.h:307
BranchType const branchType_
Definition: DataViewImpl.h:304
bt
Definition: tracks.py:83
ModuleDescription const & md_
Definition: DataViewImpl.h:313
ModuleContext const & mc_
Definition: DataViewImpl.h:310
bool const recordParents_
Definition: DataViewImpl.h:320
art::DataViewImpl::DataViewImpl ( DataViewImpl const &  )
delete
art::DataViewImpl::DataViewImpl ( DataViewImpl &&  )
delete

Member Function Documentation

Timestamp const & art::DataViewImpl::beginTime ( ) const

Definition at line 92 of file DataViewImpl.cc.

93  {
94  std::lock_guard lock{mutex_};
95  return principal_.beginTime();
96  }
Principal const & principal_
Definition: DataViewImpl.h:307
Timestamp const & beginTime() const
Definition: Principal.cc:1097
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
Timestamp const & art::DataViewImpl::endTime ( ) const

Definition at line 99 of file DataViewImpl.cc.

100  {
101  std::lock_guard lock{mutex_};
102  return principal_.endTime();
103  }
Principal const & principal_
Definition: DataViewImpl.h:307
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
Timestamp const & endTime() const
Definition: Principal.cc:1106
EventNumber_t art::DataViewImpl::event ( ) const

Definition at line 85 of file DataViewImpl.cc.

86  {
87  std::lock_guard lock{mutex_};
88  return principal_.event();
89  }
Principal const & principal_
Definition: DataViewImpl.h:307
EventNumber_t event() const
Definition: Principal.cc:1091
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
EventID art::DataViewImpl::eventID ( ) const

Definition at line 64 of file DataViewImpl.cc.

65  {
66  std::lock_guard lock{mutex_};
67  return principal_.eventID();
68  }
EventID const & eventID() const
Definition: Principal.cc:1064
Principal const & principal_
Definition: DataViewImpl.h:307
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
EventAuxiliary::ExperimentType art::DataViewImpl::experimentType ( ) const

Definition at line 120 of file DataViewImpl.cc.

121  {
122  std::lock_guard lock{mutex_};
123  return principal_.ExperimentType();
124  }
Principal const & principal_
Definition: DataViewImpl.h:307
EventAuxiliary::ExperimentType ExperimentType() const
Definition: Principal.cc:896
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
template<typename PROD >
bool art::DataViewImpl::get ( SelectorBase const &  sel,
Handle< PROD > &  result 
) const

Definition at line 606 of file DataViewImpl.h.

607  {
608  result = getHandle<PROD>(sel);
609  return static_cast<bool>(result);
610  }
static QCString result
template<typename PROD >
bool art::DataViewImpl::get ( ProductID const  pid,
Handle< PROD > &  result 
) const

Definition at line 614 of file DataViewImpl.h.

615  {
616  result = getHandle<PROD>(pid);
617  return static_cast<bool>(result);
618  }
static QCString result
template<typename PROD >
bool art::DataViewImpl::getByLabel ( std::string const &  label,
std::string const &  instance,
Handle< PROD > &  result 
) const

Definition at line 633 of file DataViewImpl.h.

636  {
637  result = getHandle<PROD>({moduleLabel, instance});
638  return static_cast<bool>(result);
639  }
static QCString result
const std::string instance
template<typename PROD >
bool art::DataViewImpl::getByLabel ( std::string const &  label,
std::string const &  instance,
std::string const &  process,
Handle< PROD > &  result 
) const

Definition at line 622 of file DataViewImpl.h.

626  {
627  result = getHandle<PROD>({moduleLabel, productInstanceName, processName});
628  return static_cast<bool>(result);
629  }
static QCString result
template<typename PROD >
bool art::DataViewImpl::getByLabel ( InputTag const &  tag,
Handle< PROD > &  result 
) const

Definition at line 643 of file DataViewImpl.h.

644  {
645  result = getHandle<PROD>(tag);
646  return static_cast<bool>(result);
647  }
static QCString result
template<typename PROD >
bool art::DataViewImpl::getByToken ( ProductToken< PROD > const &  token,
Handle< PROD > &  result 
) const

Definition at line 660 of file DataViewImpl.h.

662  {
663  result = getHandle(token);
664  return static_cast<bool>(result);
665  }
static QCString result
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
exempt_ptr< Group const > art::DataViewImpl::getContainerForView_ ( TypeID const &  typeID,
std::string const &  moduleLabel,
std::string const &  productInstanceName,
ProcessTag const &  processTag 
) const
private

Definition at line 314 of file DataViewImpl.cc.

318  {
319  // Check that the consumesView<ELEMENT, BT>(InputTag),
320  // or the mayConsumeView<ELEMENT, BT>(InputTag)
321  // is actually present.
323  branchType_,
324  md_,
326  typeID,
327  moduleLabel,
328  productInstanceName,
329  processTag});
330  // Fetch the specified data products, which must be containers.
331  auto const groups = principal_.getMatchingSequence(
332  mc_,
333  Selector{ModuleLabelSelector{moduleLabel} &&
334  ProductInstanceNameSelector{productInstanceName} &&
335  ProcessNameSelector{processTag.name()}},
336  processTag);
337  auto qrs = resolve_products(groups, TypeID{});
338  // Remove any containers that do not allow upcasting of their
339  // elements to the desired element type.
340  auto new_end =
341  remove_if(qrs.begin(), qrs.end(), [&typeID](auto const& gqr) {
342  auto const group = gqr.result();
343  assert(group->productDescription().supportsView());
344  return !detail::upcastAllowed(*group->uniqueProduct()->typeInfo(),
345  typeID.typeInfo());
346  });
347  qrs.erase(new_end, qrs.end());
348  // Throw if there is not one and only one container to return.
349  if (qrs.size() != 1) {
351  e << "getView: Found "
352  << (qrs.empty() ? "no products" : "more than one product")
353  << " matching all criteria\n"
354  << "Looking for sequence of type: " << typeID << "\n"
355  << "Looking for module label: " << moduleLabel << "\n"
356  << "Looking for productInstanceName: " << productInstanceName << "\n";
357  if (!processTag.name().empty()) {
358  e << "Looking for processName: " << processTag.name() << "\n";
359  }
360  throw e;
361  }
362  // And return the single result.
363  return qrs[0].result();
364  }
Principal const & principal_
Definition: DataViewImpl.h:307
static ConsumesInfo * instance()
Definition: ConsumesInfo.cc:24
BranchType const branchType_
Definition: DataViewImpl.h:304
const double e
ModuleDescription const & md_
Definition: DataViewImpl.h:313
std::vector< cet::exempt_ptr< Group > > getMatchingSequence(ModuleContext const &, SelectorBase const &, ProcessTag const &) const
Definition: Principal.cc:696
void validateConsumedProduct(BranchType const, ModuleDescription const &, ProductInfo const &productInfo)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
bool upcastAllowed(std::type_info const &tiFrom, std::type_info const &tiTo)
ModuleContext const & mc_
Definition: DataViewImpl.h:310
std::vector< GroupQueryResult > resolve_products(std::vector< cet::exempt_ptr< art::Group >> const &groups, art::TypeID const &wrapped_type)
Definition: Group.cc:428
template<typename PROD >
Handle< PROD > art::DataViewImpl::getHandle ( SelectorBase const &  sel) const

Definition at line 382 of file DataViewImpl.h.

383  {
384  std::lock_guard lock{mutex_};
385  // We do *not* track whether consumes was called for a SelectorBase.
386  ProcessTag const processTag{"", md_.processName()};
387  auto qr = principal_.getBySelector(
388  mc_, WrappedTypeID::make<PROD>(), sel, processTag);
389  bool const ok = qr.succeeded() && !qr.failed();
390  if (recordParents_ && ok) {
391  recordAsParent_(qr.result());
392  }
393  return Handle<PROD>{qr};
394  }
Principal const & principal_
Definition: DataViewImpl.h:307
std::string const & processName() const
GroupQueryResult getBySelector(ModuleContext const &mc, WrappedTypeID const &wrapped, SelectorBase const &, ProcessTag const &) const
Definition: Principal.cc:634
ModuleDescription const & md_
Definition: DataViewImpl.h:313
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
void recordAsParent_(cet::exempt_ptr< Group const > grp) const
ModuleContext const & mc_
Definition: DataViewImpl.h:310
bool const recordParents_
Definition: DataViewImpl.h:320
template<typename PROD >
Handle< PROD > art::DataViewImpl::getHandle ( ProductID const  pid) const

Definition at line 398 of file DataViewImpl.h.

399  {
400  std::lock_guard lock{mutex_};
401  auto qr = principal_.getByProductID(pid);
402  bool const ok = qr.succeeded() && !qr.failed();
403  if (recordParents_ && ok) {
404  recordAsParent_(qr.result());
405  }
406  return Handle<PROD>{qr};
407  }
Principal const & principal_
Definition: DataViewImpl.h:307
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
void recordAsParent_(cet::exempt_ptr< Group const > grp) const
GroupQueryResult getByProductID(ProductID const pid) const
Definition: Principal.cc:1151
bool const recordParents_
Definition: DataViewImpl.h:320
template<typename PROD >
Handle< PROD > art::DataViewImpl::getHandle ( InputTag const &  tag) const

Definition at line 411 of file DataViewImpl.h.

412  {
413  std::lock_guard lock{mutex_};
414  auto const wrapped = WrappedTypeID::make<PROD>();
415  ProcessTag const processTag{tag.process(), md_.processName()};
416  ProductInfo const pinfo{ProductInfo::ConsumableType::Product,
417  wrapped.product_type,
418  tag.label(),
419  tag.instance(),
420  processTag};
422  GroupQueryResult qr = principal_.getByLabel(
423  mc_, wrapped, tag.label(), tag.instance(), processTag);
424  bool const ok = qr.succeeded() && !qr.failed();
425  if (recordParents_ && ok) {
426  recordAsParent_(qr.result());
427  }
428  return Handle<PROD>{qr};
429  }
Principal const & principal_
Definition: DataViewImpl.h:307
static ConsumesInfo * instance()
Definition: ConsumesInfo.cc:24
BranchType const branchType_
Definition: DataViewImpl.h:304
std::string const & processName() const
ModuleDescription const & md_
Definition: DataViewImpl.h:313
void validateConsumedProduct(BranchType const, ModuleDescription const &, ProductInfo const &productInfo)
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
void recordAsParent_(cet::exempt_ptr< Group const > grp) const
GroupQueryResult getByLabel(ModuleContext const &mc, WrappedTypeID const &wrapped, std::string const &label, std::string const &productInstanceName, ProcessTag const &processTag) const
Definition: Principal.cc:652
ModuleContext const & mc_
Definition: DataViewImpl.h:310
bool const recordParents_
Definition: DataViewImpl.h:320
template<typename PROD >
Handle< PROD > art::DataViewImpl::getHandle ( ProductToken< PROD > const &  token) const

Definition at line 433 of file DataViewImpl.h.

434  {
435  return getHandle<PROD>(token.inputTag_);
436  }
template<typename PROD >
std::vector< InputTag > art::DataViewImpl::getInputTags ( SelectorBase const &  selector = MatchAllSelector{}) const

Definition at line 457 of file DataViewImpl.h.

458  {
459  auto const wrapped = WrappedTypeID::make<PROD>();
460  ProcessTag const processTag{"", md_.processName()};
461  return principal_.getInputTags(mc_, wrapped, selector, processTag);
462  }
Principal const & principal_
Definition: DataViewImpl.h:307
std::vector< InputTag > getInputTags(ModuleContext const &mc, WrappedTypeID const &wrapped, SelectorBase const &, ProcessTag const &) const
Definition: Principal.cc:666
std::string const & processName() const
ModuleDescription const & md_
Definition: DataViewImpl.h:313
ModuleContext const & mc_
Definition: DataViewImpl.h:310
template<typename PROD >
std::vector< Handle< PROD > > art::DataViewImpl::getMany ( SelectorBase const &  selector = MatchAllSelector{}) const

Definition at line 479 of file DataViewImpl.h.

480  {
481  std::lock_guard lock{mutex_};
482  auto const wrapped = WrappedTypeID::make<PROD>();
484  branchType_,
485  md_,
486  ProductInfo{ProductInfo::ConsumableType::Many, wrapped.product_type});
487  ProcessTag const processTag{"", md_.processName()};
488  std::vector<Handle<PROD>> products;
489  for (auto const& qr : principal_.getMany(mc_, wrapped, sel, processTag)) {
490  products.emplace_back(qr);
491  if (recordParents_) {
492  recordAsParent_(qr.result());
493  }
494  }
495  return products;
496  }
Principal const & principal_
Definition: DataViewImpl.h:307
static ConsumesInfo * instance()
Definition: ConsumesInfo.cc:24
BranchType const branchType_
Definition: DataViewImpl.h:304
std::string const & processName() const
ModuleDescription const & md_
Definition: DataViewImpl.h:313
void validateConsumedProduct(BranchType const, ModuleDescription const &, ProductInfo const &productInfo)
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
void recordAsParent_(cet::exempt_ptr< Group const > grp) const
std::vector< GroupQueryResult > getMany(ModuleContext const &mc, WrappedTypeID const &wrapped, SelectorBase const &, ProcessTag const &) const
Definition: Principal.cc:680
ModuleContext const & mc_
Definition: DataViewImpl.h:310
bool const recordParents_
Definition: DataViewImpl.h:320
template<typename PROD >
void art::DataViewImpl::getMany ( SelectorBase const &  sel,
std::vector< Handle< PROD >> &  results 
) const

Definition at line 669 of file DataViewImpl.h.

671  {
672  results = getMany<PROD>(sel);
673  }
template<typename PROD >
void art::DataViewImpl::getManyByType ( std::vector< Handle< PROD >> &  results) const

Definition at line 677 of file DataViewImpl.h.

678  {
679  results = getMany<PROD>();
680  }
template<typename PROD >
PROD const * art::DataViewImpl::getPointerByLabel ( InputTag const &  tag) const

Definition at line 651 of file DataViewImpl.h.

652  {
653  Handle<PROD> h;
654  getByLabel(tag, h);
655  return h.product();
656  }
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
string const & art::DataViewImpl::getProcessName_ ( std::string const &  specifiedProcessName) const
private

Definition at line 259 of file DataViewImpl.cc.

260  {
261  return specifiedProcessName == "current_process"s ? md_.processName() :
262  specifiedProcessName;
263  }
std::string const & processName() const
ModuleDescription const & md_
Definition: DataViewImpl.h:313
static QCString * s
Definition: config.cpp:1042
bool art::DataViewImpl::getProcessParameterSet ( std::string const &  process,
fhicl::ParameterSet ps 
) const

Definition at line 155 of file DataViewImpl.cc.

157  {
158  std::lock_guard lock{mutex_};
159  if (branchType_ != InEvent) {
160  return false;
161  }
162  ProcessHistory ph;
164  ph)) {
166  << "ProcessHistoryID " << principal_.history().processHistoryID()
167  << " is not found in the ProcessHistoryRegistry.\n"
168  << "This file is malformed.\n";
169  }
170  auto const config = ph.getConfigurationForProcess(processName);
171  if (config) {
172  fhicl::ParameterSetRegistry::get(config->parameterSetID(), ps);
173  }
174  return config.has_value();
175  }
Principal const & principal_
Definition: DataViewImpl.h:307
static collection_type const & get() noexcept
History const & history() const
Definition: Principal.cc:902
BranchType const branchType_
Definition: DataViewImpl.h:304
static collection_type const & get()
static Config * config
Definition: config.cpp:1054
static constexpr double ps
Definition: Units.h:99
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
ProcessHistoryID const & processHistoryID() const noexcept
Definition: History.cc:31
template<typename PROD >
PROD const & art::DataViewImpl::getProduct ( InputTag const &  tag) const

Definition at line 367 of file DataViewImpl.h.

368  {
369  return *getValidHandle<PROD>(tag);
370  }
template<typename PROD >
PROD const & art::DataViewImpl::getProduct ( ProductToken< PROD > const &  token) const

Definition at line 374 of file DataViewImpl.h.

375  {
376  return *getValidHandle(token);
377  }
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
cet::exempt_ptr< BranchDescription const > art::DataViewImpl::getProductDescription ( ProductID  pid) const

Definition at line 178 of file DataViewImpl.cc.

179  {
181  }
Principal const & principal_
Definition: DataViewImpl.h:307
cet::exempt_ptr< BranchDescription const > getProductDescription(ProductID const pid, bool const alwaysEnableLookupOfProducedProducts=false) const
Definition: Principal.cc:994
BranchDescription const & art::DataViewImpl::getProductDescription_ ( TypeID const &  type,
std::string const &  instance,
bool const  alwaysEnableLookupOfProducedProducts = false 
) const
private

Definition at line 266 of file DataViewImpl.cc.

270  {
271  std::lock_guard lock{mutex_};
272  auto const& product_name = canonicalProductName(
273  type.friendlyClassName(), md_.moduleLabel(), instance, md_.processName());
274  ProductID const pid{product_name};
276  pid, alwaysEnableLookupOfProducedProducts);
277  if (!bd || (bd->producedClassName() != type.className())) {
278  // Either we did not find the product, or the product we
279  // did find does not match (which can happen with Assns
280  // since Assns(A,B) and Assns(B,A) have the same ProductID
281  // but not the same class name.
283  "DataViewImpl::getProductDescription_: error while "
284  "trying to retrieve product description:\n")
285  << "No product is registered for\n"
286  << " process name: '" << md_.processName() << "'\n"
287  << " module label: '" << md_.moduleLabel() << "'\n"
288  << " product class name: '" << type.className() << "'\n"
289  << " product friendly class name: '" << type.friendlyClassName()
290  << "'\n"
291  << " product instance name: '" << instance << "'\n"
292  << " branch type: '" << branchType_ << "'\n";
293  }
294  // The description object is owned by either the source or the
295  // event processor, whose lifetimes exceed that of the
296  // DataViewImpl object. It is therefore safe to dereference.
297  return *bd;
298  }
Principal const & principal_
Definition: DataViewImpl.h:307
std::string const & moduleLabel() const
const std::string instance
BranchType const branchType_
Definition: DataViewImpl.h:304
std::string const & processName() const
cet::exempt_ptr< BranchDescription const > getProductDescription(ProductID const pid, bool const alwaysEnableLookupOfProducedProducts=false) const
Definition: Principal.cc:994
ModuleDescription const & md_
Definition: DataViewImpl.h:313
std::string canonicalProductName(std::string const &friendlyClassName, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
template<typename PROD >
ProductID art::DataViewImpl::getProductID ( std::string const &  instance_name = "") const

Definition at line 338 of file DataViewImpl.h.

339  {
340  std::lock_guard lock{mutex_};
341  TypeID const type{typeid(PROD)};
342  auto const& product_name = canonicalProductName(
343  type.friendlyClassName(), md_.moduleLabel(), instance, md_.processName());
344  ProductID const pid{product_name};
346  if (!desc) {
348  "DataViewImpl::getProductID: error while trying to "
349  "retrieve product description:\n")
350  << "No product is registered for\n"
351  << " process name: '" << md_.processName() << "'\n"
352  << " module label: '" << md_.moduleLabel() << "'\n"
353  << " product friendly class name: '" << type.friendlyClassName()
354  << "'\n"
355  << " product instance name: '" << instance << "'\n"
356  << " branch type: '" << branchType_ << "'\n";
357  }
358  // The description object is owned by either the source or the
359  // event processor, whose lifetimes exceed that of the
360  // DataViewImpl object. It is therefore safe to dereference.
361  return desc->productID();
362  }
Principal const & principal_
Definition: DataViewImpl.h:307
std::string const & moduleLabel() const
const std::string instance
BranchType const branchType_
Definition: DataViewImpl.h:304
std::string const & processName() const
cet::exempt_ptr< BranchDescription const > getProductDescription(ProductID const pid, bool const alwaysEnableLookupOfProducedProducts=false) const
Definition: Principal.cc:994
ModuleDescription const & md_
Definition: DataViewImpl.h:313
std::string canonicalProductName(std::string const &friendlyClassName, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
template<typename PROD >
std::vector< ProductToken< PROD > > art::DataViewImpl::getProductTokens ( SelectorBase const &  selector = MatchAllSelector{}) const

Definition at line 466 of file DataViewImpl.h.

467  {
468  auto const tags = getInputTags<PROD>(selector);
469  std::vector<ProductToken<PROD>> tokens;
470  tokens.reserve(tags.size());
471  cet::transform_all(tags, back_inserter(tokens), [](auto const& tag) {
472  return ProductToken<PROD>{tag};
473  });
474  return tokens;
475  }
auto transform_all(Container &, OutputIt, UnaryOp)
template<typename PROD >
ValidHandle< PROD > art::DataViewImpl::getValidHandle ( InputTag const &  tag) const

Definition at line 441 of file DataViewImpl.h.

442  {
443  Handle<PROD> h;
444  getByLabel(tag, h);
445  return ValidHandle{h.product(), *h.provenance()};
446  }
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
template<typename PROD >
ValidHandle< PROD > art::DataViewImpl::getValidHandle ( ProductToken< PROD > const &  token) const

Definition at line 450 of file DataViewImpl.h.

451  {
452  return getValidHandle<PROD>(token.inputTag_);
453  }
template<typename ELEMENT >
std::size_t art::DataViewImpl::getView ( std::string const &  moduleLabel,
std::string const &  productInstanceName,
std::string const &  processName,
std::vector< ELEMENT const * > &  result 
) const

Definition at line 500 of file DataViewImpl.h.

504  {
505  std::lock_guard lock{mutex_};
506  std::size_t const orig_size = result.size();
507  auto grp = getContainerForView_(TypeID{typeid(ELEMENT)},
508  moduleLabel,
509  productInstanceName,
510  ProcessTag{processName, md_.processName()});
511  if (recordParents_) {
512  recordAsParent_(grp);
513  }
514  auto const view = grp->uniqueProduct()->getView();
515  std::vector<ELEMENT const*> castedView;
516  for (auto p : view) {
517  castedView.push_back(static_cast<ELEMENT const*>(p));
518  }
519  result = std::move(castedView);
520  return result.size() - orig_size;
521  }
std::string const & processName() const
def move(depos, offset)
Definition: depos.py:107
p
Definition: test.py:223
ModuleDescription const & md_
Definition: DataViewImpl.h:313
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
void recordAsParent_(cet::exempt_ptr< Group const > grp) const
cet::exempt_ptr< Group const > getContainerForView_(TypeID const &, std::string const &moduleLabel, std::string const &productInstanceName, ProcessTag const &processTag) const
bool const recordParents_
Definition: DataViewImpl.h:320
template<typename ELEMENT >
std::size_t art::DataViewImpl::getView ( std::string const &  moduleLabel,
std::string const &  productInstanceName,
std::vector< ELEMENT const * > &  result 
) const

Definition at line 525 of file DataViewImpl.h.

528  {
529  return getView(moduleLabel, productInstanceName, {}, result);
530  }
static QCString result
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:500
template<typename ELEMENT >
std::size_t art::DataViewImpl::getView ( InputTag const &  tag,
std::vector< ELEMENT const * > &  result 
) const

Definition at line 534 of file DataViewImpl.h.

536  {
537  return getView(tag.label(), tag.instance(), tag.process(), result);
538  }
static QCString result
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:500
template<typename ELEMENT >
std::size_t art::DataViewImpl::getView ( ViewToken< ELEMENT > const &  token,
std::vector< ELEMENT const * > &  result 
) const

Definition at line 542 of file DataViewImpl.h.

544  {
545  return getView(token.inputTag_.label(),
546  token.inputTag_.instance(),
547  token.inputTag_.process(),
548  result);
549  }
static QCString result
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:500
template<typename ELEMENT >
bool art::DataViewImpl::getView ( std::string const &  moduleLabel,
std::string const &  productInstanceName,
std::string const &  processName,
View< ELEMENT > &  result 
) const

Definition at line 553 of file DataViewImpl.h.

557  {
558  std::lock_guard lock{mutex_};
559  auto grp = getContainerForView_(TypeID{typeid(ELEMENT)},
560  moduleLabel,
561  productInstanceName,
562  ProcessTag{processName, md_.processName()});
563  if (recordParents_) {
564  recordAsParent_(grp);
565  }
566  auto const view = grp->uniqueProduct()->getView();
567  std::vector<ELEMENT const*> castedView;
568  for (auto p : view) {
569  castedView.push_back(static_cast<ELEMENT const*>(p));
570  }
571  result = View{move(castedView), grp->productID(), grp->uniqueProduct()};
572  return true;
573  }
AdcChannelData::View View
std::string const & processName() const
def move(depos, offset)
Definition: depos.py:107
p
Definition: test.py:223
ModuleDescription const & md_
Definition: DataViewImpl.h:313
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
void recordAsParent_(cet::exempt_ptr< Group const > grp) const
cet::exempt_ptr< Group const > getContainerForView_(TypeID const &, std::string const &moduleLabel, std::string const &productInstanceName, ProcessTag const &processTag) const
bool const recordParents_
Definition: DataViewImpl.h:320
template<typename ELEMENT >
bool art::DataViewImpl::getView ( std::string const &  moduleLabel,
std::string const &  productInstanceName,
View< ELEMENT > &  result 
) const

Definition at line 577 of file DataViewImpl.h.

580  {
581  return getView(moduleLabel, productInstanceName, {}, result);
582  }
static QCString result
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:500
template<typename ELEMENT >
bool art::DataViewImpl::getView ( InputTag const &  tag,
View< ELEMENT > &  result 
) const

Definition at line 586 of file DataViewImpl.h.

587  {
588  return getView(tag.label(), tag.instance(), tag.process(), result);
589  }
static QCString result
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:500
template<typename ELEMENT >
bool art::DataViewImpl::getView ( ViewToken< ELEMENT > const &  token,
View< ELEMENT > &  result 
) const

Definition at line 593 of file DataViewImpl.h.

595  {
596  return getView(token.inputTag_.label(),
597  token.inputTag_.instance(),
598  token.inputTag_.process(),
599  result);
600  }
static QCString result
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
Definition: DataViewImpl.h:500
History const & art::DataViewImpl::history ( ) const

Definition at line 127 of file DataViewImpl.cc.

128  {
129  std::lock_guard lock{mutex_};
130  return principal_.history();
131  }
Principal const & principal_
Definition: DataViewImpl.h:307
History const & history() const
Definition: Principal.cc:902
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
bool art::DataViewImpl::isRealData ( ) const

Definition at line 113 of file DataViewImpl.cc.

114  {
115  std::lock_guard lock{mutex_};
116  return principal_.isReal();
117  }
Principal const & principal_
Definition: DataViewImpl.h:307
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
bool isReal() const
Definition: Principal.cc:890
void art::DataViewImpl::movePutProductsToPrincipal ( Principal principal)

Definition at line 237 of file DataViewImpl.cc.

238  {
239  std::lock_guard lock{mutex_};
240  for (auto& type_label_and_pmvalue : putProducts_) {
241  auto& pmvalue = type_label_and_pmvalue.second;
242  unique_ptr<ProductProvenance const> pp =
243  make_unique<ProductProvenance const>(pmvalue.bd_.productID(),
245  if ((branchType_ == InRun) || (branchType_ == InSubRun)) {
246  principal.put(pmvalue.bd_,
247  move(pp),
248  move(pmvalue.prod_),
249  make_unique<RangeSet>(pmvalue.rs_));
250  } else {
251  principal.put(
252  pmvalue.bd_, move(pp), move(pmvalue.prod_), make_unique<RangeSet>());
253  }
254  };
255  putProducts_.clear();
256  }
BranchType const branchType_
Definition: DataViewImpl.h:304
def move(depos, offset)
Definition: depos.py:107
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
std::map< TypeLabel, PMValue > putProducts_
Definition: DataViewImpl.h:333
constexpr ProductStatus present() noexcept
Definition: ProductStatus.h:10
void art::DataViewImpl::movePutProductsToPrincipal ( Principal principal,
bool const  checkProducts,
std::map< TypeLabel, BranchDescription > const *  expectedProducts 
)

Definition at line 184 of file DataViewImpl.cc.

188  {
189  std::lock_guard lock{mutex_};
190  if (checkProducts) {
191  vector<string> missing;
192  for (auto const& typeLabel_and_bd : *expectedProducts) {
193  if (putProducts_.find(typeLabel_and_bd.first) != putProducts_.cend()) {
194  continue;
195  }
196  ostringstream desc;
197  desc << typeLabel_and_bd.second;
198  missing.emplace_back(desc.str());
199  }
200  if (!missing.empty()) {
201  ostringstream errmsg;
202  HorizontalRule rule{25};
203  errmsg << "The following products have been declared with 'produces',\n"
204  << "but they have not been placed onto the event:\n"
205  << rule('=') << '\n';
206  for (auto const& desc : missing) {
207  errmsg << desc << rule('=') << '\n';
208  }
209  throw Exception{errors::LogicError, "DataViewImpl::checkPutProducts"}
210  << errmsg.str();
211  }
212  }
213  for (auto& type_label_and_pmvalue : putProducts_) {
214  auto& pmvalue = type_label_and_pmvalue.second;
215  unique_ptr<ProductProvenance const> pp;
216  if (branchType_ == InEvent) {
217  vector<ProductID> gotPIDs;
218  if (!retrievedProducts_.empty()) {
219  gotPIDs.reserve(retrievedProducts_.size());
220  gotPIDs.assign(retrievedProducts_.begin(), retrievedProducts_.end());
221  }
222  pp = make_unique<ProductProvenance const>(
223  pmvalue.bd_.productID(), productstatus::present(), gotPIDs);
224  } else {
225  pp = make_unique<ProductProvenance const>(pmvalue.bd_.productID(),
227  }
229  make_unique<RangeSet>(pmvalue.rs_) :
230  make_unique<RangeSet>();
231  principal.put(pmvalue.bd_, move(pp), move(pmvalue.prod_), move(rs));
232  };
233  putProducts_.clear();
234  }
BranchType const branchType_
Definition: DataViewImpl.h:304
def move(depos, offset)
Definition: depos.py:107
std::set< ProductID > retrievedProducts_
Definition: DataViewImpl.h:329
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
std::map< TypeLabel, PMValue > putProducts_
Definition: DataViewImpl.h:333
constexpr bool range_sets_supported(BranchType const bt)
constexpr ProductStatus present() noexcept
Definition: ProductStatus.h:10
DataViewImpl& art::DataViewImpl::operator= ( DataViewImpl const &  )
delete
DataViewImpl& art::DataViewImpl::operator= ( DataViewImpl )
delete
ProcessHistory const & art::DataViewImpl::processHistory ( ) const

Definition at line 141 of file DataViewImpl.cc.

142  {
143  std::lock_guard lock{mutex_};
144  return principal_.processHistory();
145  }
Principal const & principal_
Definition: DataViewImpl.h:307
ProcessHistory const & processHistory() const
Definition: Principal.cc:363
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
ProcessHistoryID const & art::DataViewImpl::processHistoryID ( ) const

Definition at line 134 of file DataViewImpl.cc.

135  {
136  std::lock_guard lock{mutex_};
138  }
Principal const & principal_
Definition: DataViewImpl.h:307
History const & history() const
Definition: Principal.cc:902
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
ProcessHistoryID const & processHistoryID() const noexcept
Definition: History.cc:31
EDProductGetter const * art::DataViewImpl::productGetter ( ProductID const  pid) const

Definition at line 148 of file DataViewImpl.cc.

149  {
150  std::lock_guard lock{mutex_};
151  return principal_.productGetter(pid);
152  }
Principal const & principal_
Definition: DataViewImpl.h:307
EDProductGetter const * productGetter(ProductID const &pid) const
Definition: Principal.cc:297
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
std::string const &  instance = {} 
)

Definition at line 686 of file DataViewImpl.h.

687  {
688  std::lock_guard lock{mutex_};
689  TypeID const tid{typeid(PROD)};
690  if (edp.get() == nullptr) {
692  << "Event::put: A null unique_ptr was passed to 'put'.\n"
693  << "The pointer is of type " << tid << ".\n"
694  << "The specified productInstanceName was '" << instance << "'.\n";
695  }
696  auto const& bd = getProductDescription_(tid, instance, true);
697  assert(bd.productID() != ProductID::invalid());
698  auto const typeLabel =
700  auto wp = std::make_unique<Wrapper<PROD>>(move(edp));
702  rangeSet_.collapse() :
704  bool const result =
705  putProducts_.try_emplace(typeLabel, PMValue{std::move(wp), bd, rs})
706  .second;
707  if (!result) {
708  cet::HorizontalRule rule{30};
710  << "Event::put: Attempt to put multiple products with the\n"
711  << " following description onto the Event.\n"
712  << " Products must be unique per Event.\n"
713  << rule('=') << '\n'
714  << bd << rule('=') << '\n';
715  }
716  return bd.productID();
717  }
static QCString result
TypeLabel type_label_for(TypeID const typeID, std::string const &instance, bool const supportsView, ModuleDescription const &md)
const std::string instance
RangeSet & collapse()
Definition: RangeSet.cc:262
BranchType const branchType_
Definition: DataViewImpl.h:304
def move(depos, offset)
Definition: depos.py:107
ModuleDescription const & md_
Definition: DataViewImpl.h:313
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
std::map< TypeLabel, PMValue > putProducts_
Definition: DataViewImpl.h:333
BranchDescription const & getProductDescription_(TypeID const &type, std::string const &instance, bool const alwaysEnableLookupOfProducedProducts=false) const
static constexpr ProductID invalid() noexcept
Definition: ProductID.h:26
static RangeSet invalid()
Definition: RangeSet.cc:45
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85
constexpr bool range_sets_supported(BranchType const bt)
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
std::string const &  instance,
RangeSet const &  rs 
)

Definition at line 889 of file DataViewImpl.h.

892  {
893  std::lock_guard lock{mutex_};
894  TypeID const tid{typeid(PROD)};
895  if (edp.get() == nullptr) {
897  << "Event::put: A null unique_ptr was passed to 'put'.\n"
898  << "The pointer is of type " << tid << ".\n"
899  << "The specified productInstanceName was '" << instance << "'.\n";
900  }
901  if (!rs.is_valid()) {
902  throw art::Exception{errors::ProductPutFailure, "SubRun::put"}
903  << "\nCannot put a product with an invalid RangeSet.\n"
904  << "Please contact artists@fnal.gov.\n";
905  }
906  auto const& bd = getProductDescription_(tid, instance, true);
907  assert(bd.productID() != ProductID::invalid());
908  auto const typeLabel =
910  auto wp = std::make_unique<Wrapper<PROD>>(move(edp));
911  auto result =
912  putProducts_.try_emplace(typeLabel, PMValue{move(wp), bd, rs}).second;
913  if (!result) {
914  constexpr cet::HorizontalRule rule{30};
916  << "Event::put: Attempt to put multiple products with the\n"
917  << " following description onto the Event.\n"
918  << " Products must be unique per Event.\n"
919  << rule('=') << '\n'
920  << bd << rule('=') << '\n';
921  }
922  return bd.productID();
923  }
static QCString result
TypeLabel type_label_for(TypeID const typeID, std::string const &instance, bool const supportsView, ModuleDescription const &md)
const std::string instance
def move(depos, offset)
Definition: depos.py:107
ModuleDescription const & md_
Definition: DataViewImpl.h:313
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
std::map< TypeLabel, PMValue > putProducts_
Definition: DataViewImpl.h:333
BranchDescription const & getProductDescription_(TypeID const &type, std::string const &instance, bool const alwaysEnableLookupOfProducedProducts=false) const
static constexpr ProductID invalid() noexcept
Definition: ProductID.h:26
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
FullSemantic< Level::Run semantic 
)

Definition at line 721 of file DataViewImpl.h.

723  {
724  return put(move(edp), "", semantic);
725  }
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
FragmentSemantic< Level::Run semantic 
)

Definition at line 729 of file DataViewImpl.h.

731  {
732  return put(move(edp), "", semantic);
733  }
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
RangedFragmentSemantic< Level::Run semantic 
)

Definition at line 737 of file DataViewImpl.h.

739  {
740  return put(move(edp), "", std::move(semantic));
741  }
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
std::string const &  instance,
FullSemantic< Level::Run  
)

Definition at line 745 of file DataViewImpl.h.

748  {
749  return put(move(edp), instance, RangeSet::forRun(runID()));
750  }
const std::string instance
RunID runID() const
Definition: DataViewImpl.cc:50
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
static RangeSet forRun(RunID)
Definition: RangeSet.cc:51
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
std::string const &  instance,
FragmentSemantic< Level::Run  
)

Definition at line 754 of file DataViewImpl.h.

757  {
758  std::lock_guard lock{mutex_};
759  static_assert(
761  "\n\n"
762  "art error: A Run product put with the semantic 'RunFragment'\n"
763  " must be able to be aggregated. Please add the appropriate\n"
764  " void aggregate(T const&)\n"
765  " function to your class, or contact artists@fnal.gov.\n");
766  if (rangeSet_.collapse().is_full_run()) {
767  throw art::Exception{errors::ProductPutFailure, "Run::put"}
768  << "\nCannot put a product corresponding to a full Run using\n"
769  << "art::runFragment(). This can happen if you attempted to\n"
770  << "put a product at beginRun using art::runFragment().\n"
771  << "Please use either:\n"
772  << " art::fullRun(), or\n"
773  << " art::runFragment(art::RangeSet const&)\n"
774  << "or contact artists@fnal.gov for assistance.\n";
775  }
776  return put(move(edp), instance, rangeSet_);
777  }
const std::string instance
RangeSet & collapse()
Definition: RangeSet.cc:262
bool is_full_run() const
Definition: RangeSet.cc:123
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
std::string const &  instance,
RangedFragmentSemantic< Level::Run semantic 
)

Definition at line 781 of file DataViewImpl.h.

784  {
785  std::lock_guard lock{mutex_};
786  static_assert(
788  "\n\n"
789  "art error: A Run product put with the semantic 'RunFragment'\n"
790  " must be able to be aggregated. Please add the appropriate\n"
791  " void aggregate(T const&)\n"
792  " function to your class, or contact artists@fnal.gov.\n");
793  if (semantic.rs.collapse().is_full_run()) {
794  throw art::Exception{errors::ProductPutFailure, "Run::put"}
795  << "\nCannot put a product corresponding to a full Run using\n"
796  << "art::runFragment(art::RangeSet&). Please use:\n"
797  << " art::fullRun()\n"
798  << "or contact artists@fnal.gov for assistance.\n";
799  }
800  return put(move(edp), instance, semantic.rs);
801  }
const std::string instance
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
FullSemantic< Level::SubRun semantic 
)

Definition at line 805 of file DataViewImpl.h.

807  {
808  return put(move(edp), "", semantic);
809  }
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
FragmentSemantic< Level::SubRun semantic 
)

Definition at line 813 of file DataViewImpl.h.

815  {
816  return put(move(edp), "", semantic);
817  }
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
RangedFragmentSemantic< Level::SubRun semantic 
)

Definition at line 821 of file DataViewImpl.h.

823  {
824  return put(move(edp), "", std::move(semantic));
825  }
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
std::string const &  instance,
FullSemantic< Level::SubRun  
)

Definition at line 829 of file DataViewImpl.h.

832  {
833  return put(move(edp), instance, RangeSet::forSubRun(subRunID()));
834  }
SubRunID subRunID() const
Definition: DataViewImpl.cc:57
const std::string instance
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:57
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
std::string const &  instance,
FragmentSemantic< Level::SubRun  
)

Definition at line 838 of file DataViewImpl.h.

841  {
842  std::lock_guard lock{mutex_};
843  static_assert(
845  "\n\n"
846  "art error: A SubRun product put with the semantic 'SubRunFragment'\n"
847  " must be able to be aggregated. Please add the appropriate\n"
848  " void aggregate(T const&)\n"
849  " function to your class, or contact artists@fnal.gov.\n");
851  throw art::Exception(errors::ProductPutFailure, "SubRun::put")
852  << "\nCannot put a product corresponding to a full SubRun using\n"
853  << "art::subRunFragment(). This can happen if you attempted to\n"
854  << "put a product at beginSubRun using art::subRunFragment().\n"
855  << "Please use either:\n"
856  << " art::fullSubRun(), or\n"
857  << " art::subRunFragment(art::RangeSet const&)\n"
858  << "or contact artists@fnal.gov for assistance.\n";
859  }
860  return put(move(edp), instance, rangeSet_);
861  }
const std::string instance
RangeSet & collapse()
Definition: RangeSet.cc:262
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
bool is_full_subRun() const
Definition: RangeSet.cc:130
template<typename PROD >
ProductID art::DataViewImpl::put ( std::unique_ptr< PROD > &&  edp,
std::string const &  instance,
RangedFragmentSemantic< Level::SubRun semantic 
)

Definition at line 865 of file DataViewImpl.h.

868  {
869  std::lock_guard lock{mutex_};
870  static_assert(
872  "\n\n"
873  "art error: A SubRun product put with the semantic 'SubRunFragment'\n"
874  " must be able to be aggregated. Please add the appropriate\n"
875  " void aggregate(T const&)\n"
876  " function to your class, or contact artists@fnal.gov.\n");
877  if (semantic.rs.collapse().is_full_subRun()) {
878  throw art::Exception{errors::ProductPutFailure, "Run::put"}
879  << "\nCannot put a product corresponding to a full SubRun using\n"
880  << "art::subRunFragment(art::RangeSet&). Please use:\n"
881  << " art::fullSubRun()\n"
882  << "or contact artists@fnal.gov for assistance.\n";
883  }
884  return put(move(edp), instance, semantic.rs);
885  }
const std::string instance
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
void art::DataViewImpl::recordAsParent_ ( cet::exempt_ptr< Group const >  grp) const
private

Definition at line 301 of file DataViewImpl.cc.

302  {
303  if (grp->productDescription().transient()) {
304  // If the product retrieved is transient, don't use its
305  // ProductID; use the ProductID's of its parents.
306  auto const& parents = grp->productProvenance()->parentage().parents();
307  retrievedProducts_.insert(cbegin(parents), cend(parents));
308  } else {
309  retrievedProducts_.insert(grp->productDescription().productID());
310  }
311  }
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
Definition: StdUtils.h:87
std::set< ProductID > retrievedProducts_
Definition: DataViewImpl.h:329
decltype(auto) constexpr cbegin(T &&obj)
ADL-aware version of std::cbegin.
Definition: StdUtils.h:82
template<typename PROD >
bool art::DataViewImpl::removeCachedProduct ( Handle< PROD > &  h) const

Definition at line 927 of file DataViewImpl.h.

928  {
929  std::lock_guard lock{mutex_};
930  bool result{false};
931  if (h.isValid() && !h.provenance()->produced()) {
933  h.clear();
934  result = true;
935  }
936  return result;
937  }
Principal const & principal_
Definition: DataViewImpl.h:307
static QCString result
void removeCachedProduct(ProductID) const
Definition: Principal.cc:417
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
RunNumber_t art::DataViewImpl::run ( ) const

Definition at line 71 of file DataViewImpl.cc.

72  {
73  std::lock_guard lock{mutex_};
74  return principal_.run();
75  }
RunNumber_t run() const
Definition: Principal.cc:1070
Principal const & principal_
Definition: DataViewImpl.h:307
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
RunID art::DataViewImpl::runID ( ) const

Definition at line 50 of file DataViewImpl.cc.

51  {
52  std::lock_guard lock{mutex_};
53  return principal_.runID();
54  }
Principal const & principal_
Definition: DataViewImpl.h:307
RunID const & runID() const
Definition: Principal.cc:1052
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
SubRunNumber_t art::DataViewImpl::subRun ( ) const

Definition at line 78 of file DataViewImpl.cc.

79  {
80  std::lock_guard lock{mutex_};
81  return principal_.subRun();
82  }
Principal const & principal_
Definition: DataViewImpl.h:307
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
SubRunNumber_t subRun() const
Definition: Principal.cc:1082
SubRunID art::DataViewImpl::subRunID ( ) const

Definition at line 57 of file DataViewImpl.cc.

58  {
59  std::lock_guard lock{mutex_};
60  return principal_.subRunID();
61  }
Principal const & principal_
Definition: DataViewImpl.h:307
SubRunID subRunID() const
Definition: Principal.cc:1058
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301
Timestamp art::DataViewImpl::time ( ) const

Definition at line 106 of file DataViewImpl.cc.

107  {
108  std::lock_guard lock{mutex_};
109  return principal_.time();
110  }
Principal const & principal_
Definition: DataViewImpl.h:307
Timestamp const & time() const
Definition: Principal.cc:1125
std::recursive_mutex mutex_
Definition: DataViewImpl.h:301

Friends And Related Function Documentation

friend class detail::Analyzer
friend

Definition at line 67 of file DataViewImpl.h.

friend class detail::Filter
friend

Definition at line 68 of file DataViewImpl.h.

friend class detail::Producer
friend

Definition at line 69 of file DataViewImpl.h.

friend class ProducingService
friend

Definition at line 71 of file DataViewImpl.h.

friend class ResultsProducer
friend

Definition at line 70 of file DataViewImpl.h.

Member Data Documentation

BranchType const art::DataViewImpl::branchType_
private

Definition at line 304 of file DataViewImpl.h.

ModuleContext const& art::DataViewImpl::mc_
private

Definition at line 310 of file DataViewImpl.h.

ModuleDescription const& art::DataViewImpl::md_
private

Definition at line 313 of file DataViewImpl.h.

std::recursive_mutex art::DataViewImpl::mutex_ {}
mutableprivate

Definition at line 301 of file DataViewImpl.h.

Principal const& art::DataViewImpl::principal_
private

Definition at line 307 of file DataViewImpl.h.

std::map<TypeLabel, PMValue> art::DataViewImpl::putProducts_ {}
private

Definition at line 333 of file DataViewImpl.h.

RangeSet art::DataViewImpl::rangeSet_ {RangeSet::invalid()}
private

Definition at line 324 of file DataViewImpl.h.

bool const art::DataViewImpl::recordParents_
private

Definition at line 320 of file DataViewImpl.h.

std::set<ProductID> art::DataViewImpl::retrievedProducts_ {}
mutableprivate

Definition at line 329 of file DataViewImpl.h.


The documentation for this class was generated from the following files: