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