SpacePointAlg_TimeSort.h
Go to the documentation of this file.
1 #ifndef SPACEPOINTALG_TIMESORT_H
2 #define SPACEPOINTALG_TIMESORT_H
3 /*!
4  * Title: SpacePointAlg_TimeSort class
5  * Author: wketchum@lanl.gov
6  * Inputs: std::vector<recob::Hit> (one for each plane)
7  * Outputs: std::vector<recob::SpacePoint>
8  *
9  * Description:
10  * This space point algorithm tries to improve speed by
11  * (1) keeping hit collections distinct among planes;
12  * (2) sorting hit collections by time; and,
13  * (3) having a lookup table for (y,z) coordinate positions.
14  * The original use case for this code was with the TTHitFinder,
15  * which produces an incredibly large number of hits per plane,
16  * making some sorted space point alg more attractive.
17  *
18  * This code is totally microboone specific, btw.
19  */
20 
21 // LArSoft Includes
24 namespace detinfo {
25  class DetectorPropertiesData;
26 }
27 
28 // Frmaework includes
30 #include "fhiclcpp/fwd.h"
31 
32 //boost includes
33 #include "boost/multi_array.hpp"
34 
35 namespace sppt {
36 
38  public:
39  explicit SpacePointAlg_TimeSort(fhicl::ParameterSet const& pset);
40 
41  void setTimeOffsets(detinfo::DetectorPropertiesData const& detProp);
42  void fillCoordinatesArrays();
43 
44  void createSpacePoints(
45  detinfo::DetectorPropertiesData const& detProp,
49  std::unique_ptr<std::vector<recob::SpacePoint>>& spptCollection,
50  std::unique_ptr<std::vector<std::vector<art::Ptr<recob::Hit>>>>& spptAssociatedHits);
51 
52  private:
53  float fTimeDiffMax; /// Maximum allowed time difference
54  float fYDiffMax; /// Maximum allowed y-coordinate difference
55  float fZDiffMax; /// Maximum allowed z-coordinate difference
56 
57  bool TIME_OFFSET_SET{false};
58  bool COORDINATES_FILLED{false};
59 
60  double TIME_OFFSET_U;
61  double TIME_OFFSET_V;
62  double TIME_OFFSET_Y;
63  double TICKS_TO_X;
64 
65  boost::multi_array<double, 2> coordinates_UV_y;
66  boost::multi_array<double, 2> coordinates_UV_z;
67  boost::multi_array<double, 2> coordinates_UY_y;
68  boost::multi_array<double, 2> coordinates_UY_z;
69 
70  void sortHitsByTime(std::vector<art::Ptr<recob::Hit>>& hits_handle) const;
71 
72  }; //class SpacePointAlg_TimeSort
73 
74 } //end sppt namespace
75 
76 #endif
float fYDiffMax
Maximum allowed time difference.
struct vector vector
boost::multi_array< double, 2 > coordinates_UV_y
float fZDiffMax
Maximum allowed y-coordinate difference.
boost::multi_array< double, 2 > coordinates_UY_z
General LArSoft Utilities.
Declaration of signal hit object.
boost::multi_array< double, 2 > coordinates_UY_y
boost::multi_array< double, 2 > coordinates_UV_z