FairShip
Loading...
Searching...
No Matches
StrawPatRec.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP
3// Collaboration
4
5#ifndef ACTSTRACKING_STRAWPATREC_HPP_
6#define ACTSTRACKING_STRAWPATREC_HPP_
7
8#include <optional>
9#include <vector>
10
11#include "ActsStrawGeometry.hpp"
12
13namespace SHiP {
14
17struct PatRecHit {
18 int index;
20 double drift;
21 double sigma;
22};
23
27 double z0{0.};
28 double x0{0.};
29 double tx{0.};
30 double y0{0.};
31 double ty{0.};
32 std::vector<int> hits;
33 std::vector<int> signs;
34 double chi2{0.};
35
36 double x(double z) const { return x0 + tx * (z - z0); }
37 double y(double z) const { return y0 + ty * (z - z0); }
38};
39
49
59 public:
60 struct Config {
63 double tolerance = 0.15;
66 int minYHits = 4;
73 double maxSlope = 0.6;
79 double matchSigmaX = 0.6;
80 double matchSigmaXPerP = 3.;
81 double matchSigmaTx = 1.5e-3;
82 double matchSigmaTxPerP = 0.02;
83 double matchSigmaY = 0.05;
84 double matchSigmaYPerP = 0.5;
85 double maxMatchChi2 = 40.;
89 double lowMomentum = 3.;
92 int maxSharedHits = 12;
93 };
94
97 StrawPatRec(const Config& config, double bendingZ, double fieldIntegral);
98
100 std::vector<TrackCandidate> findTracks(
101 const std::vector<PatRecHit>& hits) const;
102
105 std::optional<TrackCandidate> fitCandidate(
106 const std::vector<PatRecHit>& hits) const;
107
108 private:
109 std::vector<LineSegment> findSegments(const std::vector<PatRecHit>& hits,
110 bool upstream, int maxSegments) const;
111 std::vector<TrackCandidate> matchSegments(
112 const std::vector<LineSegment>& upstream,
113 const std::vector<LineSegment>& downstream) const;
114 std::optional<TrackCandidate> match(const LineSegment& upstream,
115 const LineSegment& downstream) const;
116
120};
121
124double signedWireDistance(const LineSegment& line, const StrawWire& wire);
125
126} // namespace SHiP
127
128#endif // ACTSTRACKING_STRAWPATREC_HPP_
std::vector< TrackCandidate > findTracks(const std::vector< PatRecHit > &hits) const
Find tracks among all hits of the event.
std::vector< LineSegment > findSegments(const std::vector< PatRecHit > &hits, bool upstream, int maxSegments) const
std::optional< TrackCandidate > fitCandidate(const std::vector< PatRecHit > &hits) const
std::vector< TrackCandidate > matchSegments(const std::vector< LineSegment > &upstream, const std::vector< LineSegment > &downstream) const
std::optional< TrackCandidate > match(const LineSegment &upstream, const LineSegment &downstream) const
StrawPatRec(const Config &config, double bendingZ, double fieldIntegral)
double signedWireDistance(const LineSegment &line, const StrawWire &wire)
std::vector< int > signs
signed drift distance = sign * drift
std::vector< int > hits
positions in the hit list
double y(double z) const
double x(double z) const
const StrawWire * wire
double maxSlope
Largest track slopes considered.
double matchSigmaTxPerP
rad GeV
int maxSharedHits
Segments sharing more hits than this are the same segment.
A straw wire in the SHiP frame (cm), for pattern recognition.