LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::ProducingService Class Reference

#include "ProducingService.h"

Inheritance diagram for art::ProducingService:
art::ProductRegistryHelper

Public Member Functions

virtual ~ProducingService () noexcept
 
void setModuleDescription (ModuleDescription const &md)
 
void registerCallbacks (ProducingServiceSignals &)
 

Static Public Attributes

static constexpr bool service_handle_allowed {false}
 

Private Member Functions

void doPostReadRun (RunPrincipal &rp)
 
void doPostReadSubRun (SubRunPrincipal &srp)
 
void doPostReadEvent (EventPrincipal &ep)
 
virtual void postReadRun (Run &r)
 
virtual void postReadSubRun (SubRun &sr)
 
virtual void postReadEvent (Event &e)
 
void productList (ProductList *p)
 
void registerProducts (MasterProductRegistry &mpr, ProductDescriptions &productsToRegister, ModuleDescription const &md)
 
template<typename P , BranchType B = InEvent>
void produces (std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
 
template<typename P , BranchType B>
TypeLabel const & reconstitutes (std::string const &modLabel, std::string const &instanceName={})
 
template<typename P , art::BranchType B>
art::TypeLabel const & reconstitutes (std::string const &emulatedModule, std::string const &instanceName)
 
template<BranchType B>
std::set< TypeLabel > const & expectedProducts () const
 

Private Attributes

ModuleDescription md_
 

Detailed Description

Definition at line 14 of file ProducingService.h.

Constructor & Destructor Documentation

art::ProducingService::~ProducingService ( )
virtualdefaultnoexcept

Member Function Documentation

void art::ProducingService::doPostReadEvent ( EventPrincipal ep)
private

Definition at line 40 of file ProducingService.cc.

References e, md_, art::Consumer::non_module_context(), and postReadEvent().

41 {
44  e.commit(ep, true, expectedProducts<InEvent>());
45 }
static cet::exempt_ptr< Consumer > non_module_context()
Definition: Consumer.cc:76
virtual void postReadEvent(Event &e)
ModuleDescription md_
Float_t e
Definition: plot.C:34
void art::ProducingService::doPostReadRun ( RunPrincipal rp)
private

Definition at line 23 of file ProducingService.cc.

References art::RangeSet::forRun(), art::RunPrincipal::id(), md_, art::Consumer::non_module_context(), and postReadRun().

24 {
26  postReadRun(r);
27  r.commit(rp, true, expectedProducts<InRun>());
28 }
static cet::exempt_ptr< Consumer > non_module_context()
Definition: Consumer.cc:76
static RangeSet forRun(RunID)
Definition: RangeSet.cc:52
ModuleDescription md_
virtual void postReadRun(Run &r)
void art::ProducingService::doPostReadSubRun ( SubRunPrincipal srp)
private

Definition at line 31 of file ProducingService.cc.

References art::RangeSet::forSubRun(), art::SubRunPrincipal::id(), md_, art::Consumer::non_module_context(), and postReadSubRun().

32 {
33  SubRun sr{
35  postReadSubRun(sr);
36  sr.commit(srp, true, expectedProducts<InSubRun>());
37 }
virtual void postReadSubRun(SubRun &sr)
static cet::exempt_ptr< Consumer > non_module_context()
Definition: Consumer.cc:76
ModuleDescription md_
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:58
template<BranchType B>
std::set<TypeLabel> const& art::ProductRegistryHelper::expectedProducts ( ) const
inlineinherited

Definition at line 111 of file ProductRegistryHelper.h.

References B, and art::ProductRegistryHelper::typeLabelList_.

112  {
113  return typeLabelList_[B];
114  }
Int_t B
Definition: plot.C:25
std::array< std::set< TypeLabel >, NumBranchTypes > typeLabelList_
void art::ProducingService::postReadEvent ( Event e)
privatevirtual

Definition at line 56 of file ProducingService.cc.

Referenced by doPostReadEvent().

57 {}
void art::ProducingService::postReadRun ( Run r)
privatevirtual

Definition at line 48 of file ProducingService.cc.

Referenced by doPostReadRun().

49 {}
void art::ProducingService::postReadSubRun ( SubRun sr)
privatevirtual

Definition at line 52 of file ProducingService.cc.

Referenced by doPostReadSubRun().

53 {}
template<typename P , art::BranchType B>
void art::ProductRegistryHelper::produces ( std::string const &  instanceName = {},
Persistable const  persistable = Persistable::Yes 
)
inlineinherited

Definition at line 141 of file ProductRegistryHelper.h.

References B, art::ProductRegistryHelper::insertOrThrow(), art::No, art::detail::verifyFriendlyClassName(), and art::detail::verifyInstanceName().

Referenced by larg4::LArG4::LArG4(), art::MixHelper::produces(), recob::ChargedSpacePointCollectionCreator::produces(), and art::ProductRegistryHelper::productList().

143 {
144  verifyInstanceName(instanceName);
145  TypeID const productType{typeid(P)};
146  verifyFriendlyClassName(productType.friendlyClassName());
147  bool const isTransient = (persistable == Persistable::No);
149  B,
150  TypeLabel{productType, instanceName, SupportsView<P>::value, isTransient});
151 }
void verifyFriendlyClassName(std::string const &fcn)
Definition: verify_names.cc:16
Int_t B
Definition: plot.C:25
std::string value(boost::any const &)
TypeLabel const & insertOrThrow(BranchType const bt, TypeLabel const &tl)
void verifyInstanceName(std::string const &in)
Definition: verify_names.cc:5
void art::ProductRegistryHelper::productList ( ProductList p)
inlineinherited
template<typename P , BranchType B>
TypeLabel const& art::ProductRegistryHelper::reconstitutes ( std::string const &  modLabel,
std::string const &  instanceName = {} 
)
inherited
template<typename P , art::BranchType B>
art::TypeLabel const& art::ProductRegistryHelper::reconstitutes ( std::string const &  emulatedModule,
std::string const &  instanceName 
)
inherited

Definition at line 155 of file ProductRegistryHelper.h.

References B, art::ProductRegistryHelper::insertOrThrow(), art::detail::verifyFriendlyClassName(), and art::detail::verifyInstanceName().

157 {
158  verifyModuleLabel(emulatedModule);
159  verifyInstanceName(instanceName);
160  TypeID const productType{typeid(P)};
161  verifyFriendlyClassName(productType.friendlyClassName());
162  return insertOrThrow(
163  B,
164  TypeLabel{
165  productType, instanceName, SupportsView<P>::value, emulatedModule});
166 }
void verifyFriendlyClassName(std::string const &fcn)
Definition: verify_names.cc:16
Int_t B
Definition: plot.C:25
std::string value(boost::any const &)
TypeLabel const & insertOrThrow(BranchType const bt, TypeLabel const &tl)
void verifyInstanceName(std::string const &in)
Definition: verify_names.cc:5
void art::ProducingService::registerCallbacks ( ProducingServiceSignals signals)

Definition at line 15 of file ProducingService.cc.

16 {
17  signals.sPostReadRun.watch(this, &ProducingService::doPostReadRun);
18  signals.sPostReadSubRun.watch(this, &ProducingService::doPostReadSubRun);
19  signals.sPostReadEvent.watch(this, &ProducingService::doPostReadEvent);
20 }
void doPostReadSubRun(SubRunPrincipal &srp)
void doPostReadEvent(EventPrincipal &ep)
void doPostReadRun(RunPrincipal &rp)
void art::ProductRegistryHelper::registerProducts ( MasterProductRegistry mpr,
ProductDescriptions productsToRegister,
ModuleDescription const &  md 
)
inherited

Definition at line 59 of file ProductRegistryHelper.cc.

References art::MasterProductRegistry::addProductsFromModule(), art::InEvent, art::NumBranchTypes, art::ProductRegistryHelper::productList_, art::ProductRegistryHelper::typeLabelList_, and art::MasterProductRegistry::updateFromModule().

Referenced by art::Source< T >::finishProductRegistration_(), art::ProductRegistryHelper::productList(), and art::ResultsProducer::registerProducts().

63 {
64  // First update the MPR with any extant products.
65  if (productList_) {
66  cet::transform_all(*productList_,
67  back_inserter(productsToRegister),
68  [](auto const& pr) { return pr.second; });
69  mpr.updateFromModule(move(productList_));
70  }
71 
72  // Now go through products that will be produced in the current process.
73  check_for_duplicate_Assns(typeLabelList_[InEvent]);
74 
75  ProductDescriptions descriptions;
76  for (std::size_t ibt{}; ibt != NumBranchTypes; ++ibt) {
77  auto const bt = static_cast<BranchType>(ibt);
78  for (auto const& val : typeLabelList_[bt]) {
79  BranchDescription pd{bt, val, md};
80  productsToRegister.push_back(pd);
81  descriptions.push_back(std::move(pd));
82  }
83  }
84  mpr.addProductsFromModule(move(descriptions));
85 }
std::vector< BranchDescription > ProductDescriptions
std::unique_ptr< ProductList > productList_
std::array< std::set< TypeLabel >, NumBranchTypes > typeLabelList_
BranchType
Definition: BranchType.h:18
void art::ProducingService::setModuleDescription ( ModuleDescription const &  md)

Definition at line 60 of file ProducingService.cc.

References md_.

61 {
62  md_ = md;
63 }
ModuleDescription md_

Member Data Documentation

ModuleDescription art::ProducingService::md_
private
constexpr bool art::ProducingService::service_handle_allowed {false}
static

Definition at line 16 of file ProducingService.h.


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