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

Public Types

typedef art::PtrVector< int > intptrvector_t
 

Public Member Functions

 PtrMakerAnalyzer (fhicl::ParameterSet const &p)
 
 PtrMakerAnalyzer (PtrMakerAnalyzer const &)=delete
 
 PtrMakerAnalyzer (PtrMakerAnalyzer &&)=delete
 
PtrMakerAnalyzeroperator= (PtrMakerAnalyzer const &)=delete
 
PtrMakerAnalyzeroperator= (PtrMakerAnalyzer &&)=delete
 
void analyze (art::Event const &e) override
 

Private Attributes

std::string fInputLabel
 
int nvalues
 

Detailed Description

Definition at line 16 of file PtrMakerAnalyzer_module.cc.

Member Typedef Documentation

typedef art::PtrVector<int> PtrMakerAnalyzer::intptrvector_t

Definition at line 18 of file PtrMakerAnalyzer_module.cc.

Constructor & Destructor Documentation

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

Definition at line 40 of file PtrMakerAnalyzer_module.cc.

41  : EDAnalyzer(p)
42  , fInputLabel(p.get<std::string>("input_label"))
43  , nvalues (p.get<int> ("nvalues"))
44 {}
pdgs p
Definition: selectors.fcl:22
PtrMakerAnalyzer::PtrMakerAnalyzer ( PtrMakerAnalyzer const &  )
delete
PtrMakerAnalyzer::PtrMakerAnalyzer ( PtrMakerAnalyzer &&  )
delete

Member Function Documentation

void PtrMakerAnalyzer::analyze ( art::Event const &  e)
override

Definition at line 46 of file PtrMakerAnalyzer_module.cc.

47 {
48  std::cerr << "PtrMakerAnalyzer is running\n";
49  art::Handle<intptrvector_t> h;
50  e.getByLabel(fInputLabel, h);
51  size_t sz = h->size();
52  if( sz != (size_t)nvalues ) {
53  throw cet::exception("SizeMismatch")
54  << "Expected a PtrVector of size " << nvalues
55  << " but the obtained size is " << sz
56  << '\n';
57  }
58 
59  int eid = e.id().event();
60 
61  //now check the values
63  for (int i = 0; i < nvalues; ++i) {
64  assert(*local[i] == eid*i);
65  }
66 }
BEGIN_PROLOG could also be cerr
while getopts h
then local
do i e
art::PtrVector< int > intptrvector_t
PtrMakerAnalyzer& PtrMakerAnalyzer::operator= ( PtrMakerAnalyzer const &  )
delete
PtrMakerAnalyzer& PtrMakerAnalyzer::operator= ( PtrMakerAnalyzer &&  )
delete

Member Data Documentation

std::string PtrMakerAnalyzer::fInputLabel
private

Definition at line 34 of file PtrMakerAnalyzer_module.cc.

int PtrMakerAnalyzer::nvalues
private

Definition at line 35 of file PtrMakerAnalyzer_module.cc.


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