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

Public Member Functions

 HMRunProdProducer (fhicl::ParameterSet const &p)
 
- 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 &) override
 
void endSubRun (art::SubRun &sr) override
 
void endRun (art::Run &r) override
 

Private Attributes

std::string const inputLabel_
 
std::vector< std::unique_ptr< HMLargeData > > data_
 

Additional Inherited Members

- 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 >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 

Detailed Description

Definition at line 28 of file HMRunProdProducer_module.cc.

Constructor & Destructor Documentation

arttest::HMRunProdProducer::HMRunProdProducer ( fhicl::ParameterSet const &  p)
explicit

Definition at line 41 of file HMRunProdProducer_module.cc.

42  : EDProducer{p}
43  , inputLabel_(p.get<std::string>("inputLabel"))
44  , data_(N_BLOCKS)
45 {
46  for (unsigned short i = 0; i < N_BLOCKS; ++i) {
47  std::string const instance_name = "block" + std::to_string(i);
48  produces<HMLargeData, art::InRun>(instance_name);
49  consumes<HMLargeData, art::InSubRun>(
50  art::InputTag{inputLabel_, instance_name});
51  }
52 }
std::string string
Definition: nybbler.cc:12
EDProducer()=default
std::vector< std::unique_ptr< HMLargeData > > data_
constexpr unsigned short N_BLOCKS
Definition: HMLargeData.h:12
p
Definition: test.py:228
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34

Member Function Documentation

void arttest::HMRunProdProducer::endRun ( art::Run r)
overrideprivatevirtual

Reimplemented from art::EDProducer.

Definition at line 71 of file HMRunProdProducer_module.cc.

72 {
73  for (unsigned short i = 0; i < N_BLOCKS; ++i) {
74  r.put(std::move(data_[i]),
75  std::string("block") + std::to_string(i),
77  }
78 }
std::string string
Definition: nybbler.cc:12
std::vector< std::unique_ptr< HMLargeData > > data_
constexpr auto runFragment()
constexpr unsigned short N_BLOCKS
Definition: HMLargeData.h:12
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:692
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
void arttest::HMRunProdProducer::endSubRun ( art::SubRun sr)
overrideprivatevirtual

Reimplemented from art::EDProducer.

Definition at line 55 of file HMRunProdProducer_module.cc.

56 {
57  for (unsigned short i = 0; i < N_BLOCKS; ++i) {
59  sr.getByLabel<HMLargeData>(
60  inputLabel_, std::string("block") + std::to_string(i), h);
61  if (data_[i]) {
62  *data_[i] += *h;
63  } else {
64  data_[i] = std::make_unique<HMLargeData>(*h);
65  }
66  assert(sr.removeCachedProduct(h)); // Save the space.
67  }
68 }
std::string string
Definition: nybbler.cc:12
std::vector< std::unique_ptr< HMLargeData > > data_
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:435
constexpr unsigned short N_BLOCKS
Definition: HMLargeData.h:12
bool removeCachedProduct(Handle< PROD > &) const
Definition: DataViewImpl.h:951
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
h
training ###############################
Definition: train_cnn.py:186
void arttest::HMRunProdProducer::produce ( art::Event )
inlineoverrideprivatevirtual

Implements art::EDProducer.

Definition at line 33 of file HMRunProdProducer_module.cc.

33 {};

Member Data Documentation

std::vector<std::unique_ptr<HMLargeData> > arttest::HMRunProdProducer::data_
private

Definition at line 38 of file HMRunProdProducer_module.cc.

std::string const arttest::HMRunProdProducer::inputLabel_
private

Definition at line 37 of file HMRunProdProducer_module.cc.


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