LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
HitsStandard_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 HitsStandard : virtual public IHitReader {
26  public:
32  explicit HitsStandard(const fhicl::ParameterSet&);
33 
37  ~HitsStandard();
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 
71  bool HitsStandard::readHits(const std::vector<art::Ptr<recob::Hit>>& inputHits, // input hits
72  std::vector<art::Ptr<recob::Hit>>& xhits, // output hits plane 0
73  std::vector<art::Ptr<recob::Hit>>& uhits, // output hits plane 1
74  std::vector<art::Ptr<recob::Hit>>& vhits) const // output hits plane 2
75  {
76 
77  bool is2view = false;
78 
79  for (auto& hit : inputHits) {
80  if (hit->Integral() < 0 || isnan(hit->Integral()) || isinf(hit->Integral())) {
81  mf::LogWarning("HitsStandard")
82  << "WARNING: bad recob::Hit::Integral() = " << hit->Integral() << ". Skipping."
83  << std::endl;
84  continue;
85  }
86 
87  if (hit->SignalType() == geo::kCollection) {
88  // For DualPhase, both view are collection. Arbitrarily map V to the main
89  // "X" view. For Argoneut and Lariat, collection=V is also the right
90  // convention.
91  if (hit->View() == geo::kZ) { xhits.push_back(hit); }
92  if (hit->View() == geo::kV) {
93  xhits.push_back(hit);
94  is2view = true;
95  }
96  if (hit->View() == geo::kU || hit->View() == geo::kY) {
97  uhits.push_back(hit);
98  is2view = true;
99  }
100  }
101  else {
102  if (hit->View() == geo::kU) uhits.push_back(hit);
103  if (hit->View() == geo::kV) vhits.push_back(hit);
104  }
105  } // end for hit
106 
107  mf::LogDebug("HitsStandard") << ">>>>> Reading hits done" << std::endl;
108 
109  return is2view;
110  }
111 
113 } // namespace lar_cluster3d
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
Planes which measure V.
Definition: geo_types.h:136
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:138
~HitsStandard()
Destructor.
Planes which measure Y direction.
Definition: geo_types.h:139
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
Planes which measure U.
Definition: geo_types.h:135
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.
IHitReader interface class definiton.
Definition: IHitReader.h:23
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void configure(fhicl::ParameterSet const &pset) override
HitsStandard(const fhicl::ParameterSet &)
Constructor.
Signal from collection planes.
Definition: geo_types.h:152