All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
29 #include "canvas/Persistency/Common/Ptr.h"
30 namespace fhicl {
31  class ParameterSet;
32 }
33 
34 //boost includes
35 #include "boost/multi_array.hpp"
36 
37 #include <memory>
38 #include <vector>
39 
40 namespace sppt {
41 
43  public:
44  explicit SpacePointAlg_TimeSort(fhicl::ParameterSet const& pset);
45 
47  void fillCoordinatesArrays();
48 
49  void createSpacePoints(
50  detinfo::DetectorPropertiesData const& detProp,
51  std::vector<art::Ptr<recob::Hit>>& hitVec_U,
52  std::vector<art::Ptr<recob::Hit>>& hitVec_V,
53  std::vector<art::Ptr<recob::Hit>>& hitVec_Y,
54  std::unique_ptr<std::vector<recob::SpacePoint>>& spptCollection,
55  std::unique_ptr<std::vector<std::vector<art::Ptr<recob::Hit>>>>& spptAssociatedHits);
56 
57  private:
58  float fTimeDiffMax; /// Maximum allowed time difference
59  float fYDiffMax; /// Maximum allowed y-coordinate difference
60  float fZDiffMax; /// Maximum allowed z-coordinate difference
61 
62  bool TIME_OFFSET_SET{false};
63  bool COORDINATES_FILLED{false};
64 
65  double TIME_OFFSET_U;
66  double TIME_OFFSET_V;
67  double TIME_OFFSET_Y;
68  double TICKS_TO_X;
69 
70  boost::multi_array<double, 2> coordinates_UV_y;
71  boost::multi_array<double, 2> coordinates_UV_z;
72  boost::multi_array<double, 2> coordinates_UY_y;
73  boost::multi_array<double, 2> coordinates_UY_z;
74 
75  void sortHitsByTime(std::vector<art::Ptr<recob::Hit>>& hits_handle) const;
76 
77  }; //class SpacePointAlg_TimeSort
78 
79 } //end sppt namespace
80 
81 #endif
void sortHitsByTime(std::vector< art::Ptr< recob::Hit >> &hits_handle) const
SpacePointAlg_TimeSort(fhicl::ParameterSet const &pset)
float fYDiffMax
Maximum allowed time difference.
void setTimeOffsets(detinfo::DetectorPropertiesData const &detProp)
Declaration of signal hit object.
boost::multi_array< double, 2 > coordinates_UV_y
float fZDiffMax
Maximum allowed y-coordinate difference.
boost::multi_array< double, 2 > coordinates_UY_z
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
bool TIME_OFFSET_SET
Maximum allowed z-coordinate difference.
boost::multi_array< double, 2 > coordinates_UY_y
void createSpacePoints(detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> &hitVec_U, std::vector< art::Ptr< recob::Hit >> &hitVec_V, std::vector< art::Ptr< recob::Hit >> &hitVec_Y, std::unique_ptr< std::vector< recob::SpacePoint >> &spptCollection, std::unique_ptr< std::vector< std::vector< art::Ptr< recob::Hit >>>> &spptAssociatedHits)
auto const detProp
boost::multi_array< double, 2 > coordinates_UV_z