All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #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;
34  using Comment = fhicl::Comment;
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 
41  fhicl::Atom<unsigned int> NodesFromEnd{
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,
54  void StitchTracksAPA(const detinfo::DetectorClocksData& clockData,
57 
58 private:
59  // Main function of the algorithm
60  void StitchTracks(const detinfo::DetectorClocksData& clockData,
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
double GetTPCOffset(unsigned int tpc, unsigned int cryo, bool isCPA)
ClusterModuleLabel join with tracks
void StitchTracks(const detinfo::DetectorClocksData &clockData, const detinfo::DetectorPropertiesData &detProp, pma::TrkCandidateColl &tracks, bool isCPA)
PMAlgStitching(const pma::PMAlgStitching::Config &config)
double GetTrackPairDelta(TVector3 &pos1, TVector3 &pos2, TVector3 &dir1, TVector3 &dir2) const
shift
Definition: fcl_checks.sh:26
std::map< geo::TPCID, double > fTPCXOffsetsAPA
unsigned int fNodesFromEnd
double GetOptimalStitchShift(TVector3 &pos1, TVector3 &pos2, TVector3 &dir1, TVector3 &dir2, double &shift) const
std::map< geo::TPCID, double > fTPCXOffsetsCPA
fhicl::Atom< int > StitchingThreshold
BEGIN_PROLOG vertical distance to the surface Name
Definition of data types for geometry description.
Contains all timing reference information for the detector.
fhicl::Atom< unsigned int > NodesFromEnd
void StitchTracksAPA(const detinfo::DetectorClocksData &clockData, const detinfo::DetectorPropertiesData &detProp, pma::TrkCandidateColl &tracks)
void StitchTracksCPA(const detinfo::DetectorClocksData &clockData, const detinfo::DetectorPropertiesData &detProp, pma::TrkCandidateColl &tracks)
auto const detProp