All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
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 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 
55 HitsStandard::HitsStandard(fhicl::ParameterSet const &pset)
56 {
57  this->configure(pset);
58 }
59 
60 //------------------------------------------------------------------------------------------------------------------------------------------
61 
63 {
64 }
65 
66 //------------------------------------------------------------------------------------------------------------------------------------------
67 
68 void HitsStandard::configure(fhicl::ParameterSet const &pset)
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 
120 DEFINE_ART_CLASS_TOOL(HitsStandard)
121 } // namespace lar_cluster3d
Planes which measure V.
Definition: geo_types.h:130
Declaration of signal hit object.
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.
process_name hit
Definition: cheaterreco.fcl:51
Planes which measure Y direction.
Definition: geo_types.h:133
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...
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Planes which measure U.
Definition: geo_types.h:129
IHitReader interface class definiton.
Definition: IHitReader.h:24
void configure(fhicl::ParameterSet const &pset) override
Interface for configuring the particular algorithm tool.
HitsStandard(const fhicl::ParameterSet &)
Constructor.
Signal from collection planes.
Definition: geo_types.h:146