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

Public Member Functions

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

Private Attributes

std::string _t0_producer
 The T0 producer (to be set) More...
 

Detailed Description

Definition at line 29 of file SBNDOpT0FinderAna_module.cc.

Constructor & Destructor Documentation

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

Definition at line 51 of file SBNDOpT0FinderAna_module.cc.

52  : EDAnalyzer{p}
53 {
54  _t0_producer = p.get<std::string>("T0Producer");
55 }
pdgs p
Definition: selectors.fcl:22
std::string _t0_producer
The T0 producer (to be set)
SBNDOpT0FinderAna::SBNDOpT0FinderAna ( SBNDOpT0FinderAna const &  )
delete
SBNDOpT0FinderAna::SBNDOpT0FinderAna ( SBNDOpT0FinderAna &&  )
delete

Member Function Documentation

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

Definition at line 57 of file SBNDOpT0FinderAna_module.cc.

58 {
59 
60  // Get all the T0 objects
61  ::art::Handle<std::vector<anab::T0>> t0_h;
62  e.getByLabel(_t0_producer, t0_h);
63  if(!t0_h.isValid() || t0_h->empty()) {
64  mf::LogWarning("SBNDOpT0FinderAna") << "Don't have good T0s." << std::endl;
65  return;
66  }
67  std::vector<art::Ptr<anab::T0>> t0_v;
68  art::fill_ptr_vector(t0_v, t0_h);
69 
70  // Get the T0->Slice association
71  art::FindManyP<recob::Slice> t0_to_slices(t0_h, e, _t0_producer);
72  art::FindManyP<recob::OpFlash> t0_to_flashes(t0_h, e, _t0_producer);
73 
74  for (size_t n_t0 = 0; n_t0 < t0_v.size(); n_t0++) {
75 
76  // The T0 object
77  auto const t0 = t0_v[n_t0];
78 
79  // The associations from T0 to both slices and flashes
80  std::vector<art::Ptr<recob::Slice>> slice_v = t0_to_slices.at(t0.key());
81  std::vector<art::Ptr<recob::OpFlash>> flash_v = t0_to_flashes.at(t0.key());
82 
83  // One T0 object is always associated to one and only one Slice and Flash
84  assert(slice_v.size() == 1);
85  assert(flash_v.size() == 1);
86 
87  std::cout << "T0 obj: " << n_t0 << ", score: " << t0->TriggerConfidence() << std::endl;
88  std::cout << "\t is associated with slice ID " << slice_v[0]->ID() << std::endl;
89  std::cout << "\t is associated with flash with time " << flash_v[0]->Time()
90  << ", total PE " << flash_v[0]->TotalPE() << std::endl;
91  }
92 
93 }
std::string _t0_producer
The T0 producer (to be set)
do i e
BEGIN_PROLOG could also be cout
SBNDOpT0FinderAna& SBNDOpT0FinderAna::operator= ( SBNDOpT0FinderAna const &  )
delete
SBNDOpT0FinderAna& SBNDOpT0FinderAna::operator= ( SBNDOpT0FinderAna &&  )
delete

Member Data Documentation

std::string SBNDOpT0FinderAna::_t0_producer
private

The T0 producer (to be set)

Definition at line 46 of file SBNDOpT0FinderAna_module.cc.


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