Classes | Public Types | Public Member Functions | Private Member Functions | List of all members
arttest::PtrmvProducer Class Reference
Inheritance diagram for arttest::PtrmvProducer:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Classes

struct  Config
 

Public Types

using Parameters = Table< Config >
 
- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 

Public Member Functions

 PtrmvProducer (Parameters const &)
 
- Public Member Functions inherited from art::EDProducer
 EDProducer ()=default
 
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer ()
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
void doBeginJob ()
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Modifier
virtual ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void produce (art::Event &e) override
 

Additional Inherited Members

- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 

Detailed Description

Definition at line 29 of file PtrmvProducer_module.cc.

Member Typedef Documentation

Definition at line 33 of file PtrmvProducer_module.cc.

Constructor & Destructor Documentation

arttest::PtrmvProducer::PtrmvProducer ( Parameters const &  ps)
explicit

Definition at line 40 of file PtrmvProducer_module.cc.

40  : EDProducer{ps}
41 {
42  produces<mv_t>();
43  produces<art::Ptr<std::string>>();
44  produces<art::PtrVector<std::string>>();
45  produces<art::Ptr<mvp_t>>();
46  produces<art::PtrVector<mvp_t>>();
47 }
static const double ps
Definition: Units.h:103
EDProducer()=default

Member Function Documentation

void arttest::PtrmvProducer::produce ( art::Event e)
overrideprivatevirtual

Implements art::EDProducer.

Definition at line 50 of file PtrmvProducer_module.cc.

51 {
52  auto mv = std::make_unique<mv_t>();
53  mv->reserve(4);
54  (*mv)[cet::map_vector_key(0)] = "ONE";
55  (*mv)[cet::map_vector_key(3)] = "TWO";
56  (*mv)[cet::map_vector_key(5)] = "THREE";
57  (*mv)[cet::map_vector_key(7)] = "FOUR";
58 
59  art::ProductID const mvID{e.put(std::move(mv))};
60 
61  e.put(
62  std::make_unique<art::Ptr<std::string>>(mvID, 3, e.productGetter(mvID)));
63 
64  auto pv = std::make_unique<art::PtrVector<std::string>>();
65  pv->reserve(4);
66  pv->push_back(art::Ptr<std::string>{mvID, 5, e.productGetter(mvID)});
67  pv->push_back(art::Ptr<std::string>{mvID, 0, e.productGetter(mvID)});
68  pv->push_back(art::Ptr<std::string>{mvID, 7, e.productGetter(mvID)});
69  pv->push_back(art::Ptr<std::string>{mvID, 3, e.productGetter(mvID)});
70 
71  e.put(std::move(pv));
72  e.put(std::make_unique<art::Ptr<mvp_t>>(mvID, 3, e.productGetter(mvID)));
73 
74  auto pvp = std::make_unique<art::PtrVector<mvp_t>>();
75  pvp->reserve(4);
76  pvp->push_back(art::Ptr<mvp_t>{mvID, 5, e.productGetter(mvID)});
77  pvp->push_back(art::Ptr<mvp_t>{mvID, 0, e.productGetter(mvID)});
78  pvp->push_back(art::Ptr<mvp_t>{mvID, 7, e.productGetter(mvID)});
79  pvp->push_back(art::Ptr<mvp_t>{mvID, 3, e.productGetter(mvID)});
80 
81  e.put(std::move(pvp));
82 }
EDProductGetter const * productGetter(ProductID const pid) const
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:692
Definition: fwd.h:26

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