LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PMAlgStitching.h
Go to the documentation of this file.
1 // Class: PMAlgStitching
3 // Author: L.Whitehead (leigh.howard.whitehead@cern.ch) January 2017
5 
6 #ifndef PMAlgStitching_h
7 #define PMAlgStitching_h
8 
9 #include <map>
10 
11 #include "fhiclcpp/types/Atom.h"
12 #include "fhiclcpp/types/Comment.h"
13 #include "fhiclcpp/types/Name.h"
14 
16 
17 class TVector3;
18 
19 namespace detinfo {
20  class DetectorClocksData;
21  class DetectorPropertiesData;
22 }
23 
24 namespace pma {
25  class PMAlgStitching;
26  class TrkCandidateColl;
27 }
28 
30 
31 public:
32  struct Config {
33  using Name = fhicl::Name;
35 
36  fhicl::Atom<int> StitchingThreshold{
37  Name("StitchingThreshold"),
38  Comment("The maximum value allowed for the stitching score. Has dimensions of length, and "
39  "10.0(cm) is a reasonable value.")};
40 
42  Name("NodesFromEnd"),
43  Comment("Number of nodes we step back from the ends of the tracks to perform the stitching "
44  "extrapolation.")};
45  };
46 
47  // Constructor
49 
50  // CPA and APA stitching wrappers
51  void StitchTracksCPA(const detinfo::DetectorClocksData& clockData,
52  const detinfo::DetectorPropertiesData& detProp,
53  pma::TrkCandidateColl& tracks);
54  void StitchTracksAPA(const detinfo::DetectorClocksData& clockData,
55  const detinfo::DetectorPropertiesData& detProp,
56  pma::TrkCandidateColl& tracks);
57 
58 private:
59  // Main function of the algorithm
60  void StitchTracks(const detinfo::DetectorClocksData& clockData,
61  const detinfo::DetectorPropertiesData& detProp,
62  pma::TrkCandidateColl& tracks,
63  bool isCPA);
64 
65  double GetOptimalStitchShift(TVector3& pos1,
66  TVector3& pos2,
67  TVector3& dir1,
68  TVector3& dir2,
69  double& shift) const;
70  double GetTrackPairDelta(TVector3& pos1, TVector3& pos2, TVector3& dir1, TVector3& dir2) const;
71 
72  void GetTPCXOffsets();
73  double GetTPCOffset(unsigned int tpc, unsigned int cryo, bool isCPA);
74 
75  std::map<geo::TPCID, double> fTPCXOffsetsAPA;
76  std::map<geo::TPCID, double> fTPCXOffsetsCPA;
77 
78  // Tuneable parameters
79  double fStitchingThreshold; // The maximum stitching score allowed for a
80  // successful stitch.
81  unsigned int fNodesFromEnd; // Number of nodes we step back to make the stitch
82  // extrapolation. Require to mitigate end effects on tracks.
83 };
84 
85 #endif
std::map< geo::TPCID, double > fTPCXOffsetsAPA
unsigned int fNodesFromEnd
std::map< geo::TPCID, double > fTPCXOffsetsCPA
General LArSoft Utilities.
Definition of data types for geometry description.
Contains all timing reference information for the detector.