All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
lartest::AssnProducer2 Class Reference
Inheritance diagram for lartest::AssnProducer2:

Public Member Functions

 AssnProducer2 (fhicl::ParameterSet const &p)
 
 AssnProducer2 (AssnProducer2 const &)=delete
 
 AssnProducer2 (AssnProducer2 &&)=delete
 
AssnProducer2operator= (AssnProducer2 const &)=delete
 
AssnProducer2operator= (AssnProducer2 &&)=delete
 
void produce (art::Event &e) override
 

Private Attributes

std::string fInputLabel
 

Detailed Description

Definition at line 24 of file AssnProducer2_module.cc.

Constructor & Destructor Documentation

AssnProducer2::AssnProducer2 ( fhicl::ParameterSet const &  p)
explicit

Definition at line 46 of file AssnProducer2_module.cc.

47  : EDProducer{p}
48  , fInputLabel(p.get<std::string>("input_label"))
49 {
50  produces<art::Assns<int, std::string>>();
51 }
pdgs p
Definition: selectors.fcl:22
lartest::AssnProducer2::AssnProducer2 ( AssnProducer2 const &  )
delete
lartest::AssnProducer2::AssnProducer2 ( AssnProducer2 &&  )
delete

Member Function Documentation

AssnProducer2& lartest::AssnProducer2::operator= ( AssnProducer2 const &  )
delete
AssnProducer2& lartest::AssnProducer2::operator= ( AssnProducer2 &&  )
delete
void AssnProducer2::produce ( art::Event &  e)
override

Definition at line 53 of file AssnProducer2_module.cc.

54 {
55  art::Handle<std::vector<int>> ih;
56  e.getByLabel(fInputLabel, ih);
57  art::Handle<std::vector<std::string>> sh;
58  e.getByLabel(fInputLabel, sh);
59 
60  art::PtrMaker<int> make_intptr(e, ih.id());
61  art::PtrMaker<std::string> make_strptr(e, sh.id());
62 
63  auto assns = std::make_unique<art::Assns<int, std::string>>();
64  for (size_t i=0; i < 3; ++i) {
65  auto p1 = make_intptr(i);
66  for(size_t j=0; j < 2; ++j) {
67  auto p2 = make_strptr(i*2+j);
68  assns -> addSingle(p1, p2);
69  }
70  }
71  e.put(std::move(assns));
72 }
do i e
physics associatedGroupsWithLeft p1

Member Data Documentation

std::string lartest::AssnProducer2::fInputLabel
private

Definition at line 40 of file AssnProducer2_module.cc.


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