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

Public Member Functions

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

Private Attributes

art::InputTag fCRTHitLabel
 
std::string fExperiment
 

Detailed Description

Definition at line 32 of file CRTHitConverter_module.cc.

Constructor & Destructor Documentation

sbn::CRTHitConverter::CRTHitConverter ( fhicl::ParameterSet const &  p)
explicit

Definition at line 104 of file CRTHitConverter_module.cc.

105  : EDProducer{p},
106  fCRTHitLabel(p.get<std::string>("CRTHitLabel", "crthit")),
107  fExperiment(p.get<std::string>("Experiment"))
108 {
109  if (fExperiment != "SBND" && fExperiment != "ICARUS") {
110  std::cerr << "ERROR: Bad experiment configuration (" << fExperiment << "). Experiment must be one of 'SBND' or 'ICARUS'";
111  }
112 
113  produces< std::vector<sbn::crt::CRTHit> >();
114 }
BEGIN_PROLOG could also be cerr
pdgs p
Definition: selectors.fcl:22
sbn::CRTHitConverter::CRTHitConverter ( CRTHitConverter const &  )
delete
sbn::CRTHitConverter::CRTHitConverter ( CRTHitConverter &&  )
delete

Member Function Documentation

CRTHitConverter& sbn::CRTHitConverter::operator= ( CRTHitConverter const &  )
delete
CRTHitConverter& sbn::CRTHitConverter::operator= ( CRTHitConverter &&  )
delete
void sbn::CRTHitConverter::produce ( art::Event &  e)
override

Definition at line 116 of file CRTHitConverter_module.cc.

117 {
118 
119  std::unique_ptr<std::vector<sbn::crt::CRTHit>> crthits(new std::vector<sbn::crt::CRTHit>);
120 
121  if (fExperiment == "SBND") {
122  art::Handle<std::vector<sbnd::crt::CRTHit>> crthit_handle;
123  e.getByLabel(fCRTHitLabel, crthit_handle);
124  if (crthit_handle.isValid()) {
125  for (const sbnd::crt::CRTHit &sbndhit: *crthit_handle) {
126  crthits->push_back(SBNDCRTHit(sbndhit));
127  }
128  }
129  }
130  else if (fExperiment == "ICARUS") {
131  art::Handle<std::vector<icarus::crt::CRTHit>> crthit_handle;
132  e.getByLabel(fCRTHitLabel, crthit_handle);
133  if (crthit_handle.isValid()) {
134  for (const icarus::crt::CRTHit &icarushit: *crthit_handle) {
135  crthits->push_back(ICARUSCRTHit(icarushit));
136  }
137  }
138  }
139 
140  e.put(std::move(crthits));
141 
142 }
sbn::crt::CRTHit ICARUSCRTHit(const icarus::crt::CRTHit &inp)
do i e
sbn::crt::CRTHit SBNDCRTHit(const sbnd::crt::CRTHit &inp)

Member Data Documentation

art::InputTag sbn::CRTHitConverter::fCRTHitLabel
private

Definition at line 49 of file CRTHitConverter_module.cc.

std::string sbn::CRTHitConverter::fExperiment
private

Definition at line 50 of file CRTHitConverter_module.cc.


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