All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HitsICARUS_tool.cc
Go to the documentation of this file.
1 /**
2  * @file HitsICARUS_tool.cc
3  *
4  * @brief art Tool for comparing clusters and merging those that are consistent
5  *
6  */
7 
8 // Framework Includes
9 #include "art/Utilities/ToolMacros.h"
10 #include "messagefacility/MessageLogger/MessageLogger.h"
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 {
27 public:
28  /**
29  * @brief Constructor
30  *
31  * @param pset
32  */
33  explicit HitsICARUS(const fhicl::ParameterSet&);
34 
35  /**
36  * @brief Destructor
37  */
38  ~HitsICARUS();
39 
40  void configure(fhicl::ParameterSet const &pset) override;
41 
42  /**
43  * @brief Scan an input collection of clusters and modify those according
44  * to the specific implementing algorithm
45  *
46  * @param clusterParametersList A list of cluster objects (parameters from associated hits)
47  */
48  bool readHits(const std::vector<art::Ptr<recob::Hit>>&, // input hits
49  std::vector<art::Ptr<recob::Hit>>&, // output hits plane 0
50  std::vector<art::Ptr<recob::Hit>>&, // output hits plane 1
51  std::vector<art::Ptr<recob::Hit>>&) const override; // output hits plane 2
52 };
53 
54 HitsICARUS::HitsICARUS(fhicl::ParameterSet const &pset)
55 {
56  this->configure(pset);
57 }
58 
59 //------------------------------------------------------------------------------------------------------------------------------------------
60 
62 {
63 }
64 
65 //------------------------------------------------------------------------------------------------------------------------------------------
66 
67 void HitsICARUS::configure(fhicl::ParameterSet const &pset)
68 {
69  // m_enableMonitoring = pset.get<bool> ("EnableMonitoring", true );
70 
71  return;
72 }
73 
74 bool HitsICARUS::readHits(const std::vector<art::Ptr<recob::Hit>>& inputHits, // input hits
75  std::vector<art::Ptr<recob::Hit>>& collectionHits, // output hits plane 0
76  std::vector<art::Ptr<recob::Hit>>& firstIndHits, // output hits plane 1
77  std::vector<art::Ptr<recob::Hit>>& secondIndHits) const // output hits plane 2
78 {
79  for(auto& hit: inputHits)
80  {
81  if(hit->Integral() < 0 || isnan(hit->Integral()) || isinf(hit->Integral()))
82  {
83  mf::LogWarning("Hits_ICARUS") << "WARNING: bad recob::Hit::Integral() = "
84  << hit->Integral()
85  << ". Skipping." << std::endl;
86  continue;
87  }
88 
89  if (hit->WireID().Plane == 0) firstIndHits.push_back(hit);
90  else if (hit->WireID().Plane == 1) secondIndHits.push_back(hit);
91  else collectionHits.push_back(hit);
92  } // end for hit
93 
94  mf::LogDebug("Hits_ICARUS") << ">>>>> Reading hits done" << std::endl;
95 
96  return false;
97 }
98 
99 DEFINE_ART_CLASS_TOOL(HitsICARUS)
100 } // namespace lar_cluster3d
Declaration of signal hit object.
This provides an art tool interface definition for reading hits into the SpacePointSolver universe...
process_name hit
Definition: cheaterreco.fcl:51
HitsICARUS(const fhicl::ParameterSet &)
Constructor.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
void configure(fhicl::ParameterSet const &pset) override
Interface for configuring the particular algorithm tool.
IHitReader interface class definiton.
Definition: IHitReader.h:24
~HitsICARUS()
Destructor.
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...