LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
HitsICARUS_tool.cc
Go to the documentation of this file.
1 
8 // Framework Includes
11 
12 // LArSoft includes
15 
16 // std includes
17 #include <ostream>
18 #include <vector>
19 
20 //------------------------------------------------------------------------------------------------------------------------------------------
21 // implementation follows
22 
23 namespace reco3d {
24 
25  class HitsICARUS : virtual public IHitReader {
26  public:
32  explicit HitsICARUS(const fhicl::ParameterSet&);
33 
37  ~HitsICARUS();
38 
39  void configure(fhicl::ParameterSet const& pset) override;
40 
47  bool readHits(const std::vector<art::Ptr<recob::Hit>>&, // input hits
48  std::vector<art::Ptr<recob::Hit>>&, // output hits plane 0
49  std::vector<art::Ptr<recob::Hit>>&, // output hits plane 1
50  std::vector<art::Ptr<recob::Hit>>&) const override; // output hits plane 2
51  };
52 
54  {
55  this->configure(pset);
56  }
57 
58  //------------------------------------------------------------------------------------------------------------------------------------------
59 
61 
62  //------------------------------------------------------------------------------------------------------------------------------------------
63 
65  {
66  // m_enableMonitoring = pset.get<bool> ("EnableMonitoring", true );
67 
68  return;
69  }
70 
72  const std::vector<art::Ptr<recob::Hit>>& inputHits, // input hits
73  std::vector<art::Ptr<recob::Hit>>& collectionHits, // output hits plane 0
74  std::vector<art::Ptr<recob::Hit>>& firstIndHits, // output hits plane 1
75  std::vector<art::Ptr<recob::Hit>>& secondIndHits) const // output hits plane 2
76  {
77  for (auto& hit : inputHits) {
78  if (hit->Integral() < 0 || isnan(hit->Integral()) || isinf(hit->Integral())) {
79  mf::LogWarning("Hits_ICARUS") << "WARNING: bad recob::Hit::Integral() = " << hit->Integral()
80  << ". Skipping." << std::endl;
81  continue;
82  }
83 
84  if (hit->WireID().Plane == 0)
85  firstIndHits.push_back(hit);
86  else if (hit->WireID().Plane == 1)
87  secondIndHits.push_back(hit);
88  else
89  collectionHits.push_back(hit);
90  } // end for hit
91 
92  mf::LogDebug("Hits_ICARUS") << ">>>>> Reading hits done" << std::endl;
93 
94  return false;
95  }
96 
98 } // namespace lar_cluster3d
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
Declaration of signal hit object.
This provides an art tool interface definition for reading hits into the SpacePointSolver universe...
bool readHits(const std::vector< art::Ptr< recob::Hit >> &, std::vector< art::Ptr< recob::Hit >> &, std::vector< art::Ptr< recob::Hit >> &, std::vector< art::Ptr< recob::Hit >> &) const override
Scan an input collection of clusters and modify those according to the specific implementing algorith...
HitsICARUS(const fhicl::ParameterSet &)
Constructor.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
Detector simulation of raw signals on wires.
void configure(fhicl::ParameterSet const &pset) override
IHitReader interface class definiton.
Definition: IHitReader.h:23
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
~HitsICARUS()
Destructor.