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
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 
55 {
56  this->configure(pset);
57 }
58 
59 //------------------------------------------------------------------------------------------------------------------------------------------
60 
62 {
63 }
64 
65 //------------------------------------------------------------------------------------------------------------------------------------------
66 
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 
100 } // namespace lar_cluster3d
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
struct vector vector
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.
Detector simulation of raw signals on wires.
Declaration of signal hit object.
void configure(fhicl::ParameterSet const &pset) override
IHitReader interface class definiton.
Definition: IHitReader.h:25
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
~HitsICARUS()
Destructor.
QTextStream & endl(QTextStream &s)