HitsStandard_tool.cc
Go to the documentation of this file.
1 /**
2  * @file HitsStandard_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 HitsStandard : virtual public IHitReader
26 {
27 public:
28  /**
29  * @brief Constructor
30  *
31  * @param pset
32  */
33  explicit HitsStandard(const fhicl::ParameterSet&);
34 
35  /**
36  * @brief Destructor
37  */
38  ~HitsStandard();
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 
56 {
57  this->configure(pset);
58 }
59 
60 //------------------------------------------------------------------------------------------------------------------------------------------
61 
63 {
64 }
65 
66 //------------------------------------------------------------------------------------------------------------------------------------------
67 
69 {
70 // m_enableMonitoring = pset.get<bool> ("EnableMonitoring", true );
71 
72  return;
73 }
74 
75 bool HitsStandard::readHits(const std::vector<art::Ptr<recob::Hit>>& inputHits, // input hits
76  std::vector<art::Ptr<recob::Hit>>& xhits, // output hits plane 0
77  std::vector<art::Ptr<recob::Hit>>& uhits, // output hits plane 1
78  std::vector<art::Ptr<recob::Hit>>& vhits) const // output hits plane 2
79 {
80 
81  bool is2view = false;
82 
83  for(auto& hit: inputHits)
84  {
85  if(hit->Integral() < 0 || isnan(hit->Integral()) || isinf(hit->Integral()))
86  {
87  mf::LogWarning("HitsStandard") << "WARNING: bad recob::Hit::Integral() = "
88  << hit->Integral()
89  << ". Skipping." << std::endl;
90  continue;
91  }
92 
93  if(hit->SignalType() == geo::kCollection){
94  // For DualPhase, both view are collection. Arbitrarily map V to the main
95  // "X" view. For Argoneut and Lariat, collection=V is also the right
96  // convention.
97  if(hit->View() == geo::kZ){
98  xhits.push_back(hit);
99  }
100  if(hit->View() == geo::kV){
101  xhits.push_back(hit);
102  is2view = true;
103  }
104  if(hit->View() == geo::kU || hit->View() == geo::kY){
105  uhits.push_back(hit);
106  is2view = true;
107  }
108  }
109  else{
110  if(hit->View() == geo::kU) uhits.push_back(hit);
111  if(hit->View() == geo::kV) vhits.push_back(hit);
112  }
113  } // end for hit
114 
115  mf::LogDebug("HitsStandard") << ">>>>> Reading hits done" << std::endl;
116 
117  return is2view;
118 }
119 
121 } // namespace lar_cluster3d
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
Planes which measure V.
Definition: geo_types.h:130
struct vector vector
This provides an art tool interface definition for reading hits into the SpacePointSolver universe...
Planes which measure Z direction.
Definition: geo_types.h:132
~HitsStandard()
Destructor.
Planes which measure Y direction.
Definition: geo_types.h:133
Planes which measure U.
Definition: geo_types.h:129
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...
Detector simulation of raw signals on wires.
Declaration of signal hit object.
IHitReader interface class definiton.
Definition: IHitReader.h:25
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void configure(fhicl::ParameterSet const &pset) override
HitsStandard(const fhicl::ParameterSet &)
Constructor.
QTextStream & endl(QTextStream &s)
Signal from collection planes.
Definition: geo_types.h:146