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

Public Member Functions

 OpFlashFinder (const fhicl::ParameterSet &)
 
void produce (art::Event &)
 

Private Attributes

std::string fInputModule
 
Int_t fBinWidth
 
Float_t fFlashThreshold
 
Float_t fWidthTolerance
 
Double_t fTrigCoinc
 

Detailed Description

Definition at line 38 of file OpFlashFinder_module.cc.

Constructor & Destructor Documentation

opdet::OpFlashFinder::OpFlashFinder ( const fhicl::ParameterSet &  pset)
explicit

Definition at line 66 of file OpFlashFinder_module.cc.

66  : EDProducer{pset}
67  {
68 
69  // Indicate that the Input Module comes from .fcl
70  fInputModule = pset.get<std::string>("InputModule");
71 
72  fBinWidth = pset.get<int>("BinWidth");
73  fFlashThreshold = pset.get<float>("FlashThreshold");
74  fWidthTolerance = pset.get<float>("WidthTolerance");
75  fTrigCoinc = pset.get<double>("TrigCoinc");
76 
77  produces<std::vector<recob::OpFlash>>();
78  produces<art::Assns<recob::OpFlash, recob::OpHit>>();
79  }

Member Function Documentation

void opdet::OpFlashFinder::produce ( art::Event &  evt)

Definition at line 83 of file OpFlashFinder_module.cc.

84  {
85  // These are the storage pointers we will put in the event
86  auto flashPtr = std::make_unique<std::vector<recob::OpFlash>>();
87  auto assnPtr = std::make_unique<art::Assns<recob::OpFlash, recob::OpHit>>();
88 
89  // This will keep track of what flashes will assoc to what ophits
90  // at the end of processing
91  std::vector<std::vector<int>> assocList;
92 
93  auto const& geometry(*lar::providerFrom<geo::Geometry>());
94 
95  auto const clock_data =
96  art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
97 
98  // Get OpHits from the event
99  auto const opHitHandle = evt.getValidHandle<std::vector<recob::OpHit>>(fInputModule);
100 
101  RunFlashFinder(*opHitHandle,
102  *flashPtr,
103  assocList,
104  fBinWidth,
105  geometry,
108  clock_data,
109  fTrigCoinc);
110 
111  // Make the associations which we noted we need
112  for (size_t i = 0; i != assocList.size(); ++i) {
113  art::PtrVector<recob::OpHit> opHitPtrVector;
114  for (size_t const hitIndex : assocList.at(i)) {
115  opHitPtrVector.emplace_back(opHitHandle, hitIndex);
116  }
117 
118  util::CreateAssn(*this, evt, *flashPtr, opHitPtrVector, *(assnPtr.get()), i);
119  }
120 
121  evt.put(std::move(flashPtr));
122  evt.put(std::move(assnPtr));
123  }
const geo::GeometryCore * geometry
void RunFlashFinder(std::vector< recob::OpHit > const &HitVector, std::vector< recob::OpFlash > &FlashVector, std::vector< std::vector< int >> &AssocList, double const BinWidth, geo::GeometryCore const &geom, float const FlashThreshold, float const WidthTolerance, detinfo::DetectorClocksData const &ClocksData, float const TrigCoinc)
Definition: OpFlashAlg.cxx:63
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
TCEvent evt
Definition: DataStructs.cxx:8

Member Data Documentation

Int_t opdet::OpFlashFinder::fBinWidth
private

Definition at line 50 of file OpFlashFinder_module.cc.

Float_t opdet::OpFlashFinder::fFlashThreshold
private

Definition at line 51 of file OpFlashFinder_module.cc.

std::string opdet::OpFlashFinder::fInputModule
private

Definition at line 48 of file OpFlashFinder_module.cc.

Double_t opdet::OpFlashFinder::fTrigCoinc
private

Definition at line 53 of file OpFlashFinder_module.cc.

Float_t opdet::OpFlashFinder::fWidthTolerance
private

Definition at line 52 of file OpFlashFinder_module.cc.


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