All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CRTTrackMatchAlg.cc
Go to the documentation of this file.
1 #include "CRTTrackMatchAlg.h"
2 
3 namespace sbnd{
4 
5 CRTTrackMatchAlg::CRTTrackMatchAlg(const Config& config) : CRTTrackMatchAlg(config, lar::providerFrom<geo::Geometry>())
6 {}
7 
8 CRTTrackMatchAlg::CRTTrackMatchAlg(const Config& config, geo::GeometryCore const* GeometryService){
9 
10  this->reconfigure(config);
11 
12  fGeometryService = GeometryService;
13 
14 }
15 
16 
18 
19 
20 }
21 
22 
24 
25 }
26 
27 
29 
30  fMaxAngleDiff = config.MaxAngleDiff();
31  fMaxDistance = config.MaxDistance();
32  fMaxScore = config.MaxScore();
33  fTPCTrackLabel = config.TPCTrackLabel();
35 
36  return;
37 
38 }
39 
40 
41 // Calculate intersection between CRT track and TPC (AABB Ray-Box intersection)
42 // (https://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-box-intersection)
43 std::pair<TVector3, TVector3> CRTTrackMatchAlg::TpcIntersection(const geo::TPCGeo& tpcGeo, sbn::crt::CRTTrack track){
44 
45  // Find the intersection between the track and the TPC
46  TVector3 start (track.x1_pos, track.y1_pos, track.z1_pos);
47  TVector3 end (track.x2_pos, track.y2_pos, track.z2_pos);
48  TVector3 min (tpcGeo.MinX(), tpcGeo.MinY(), tpcGeo.MinZ());
49  TVector3 max (tpcGeo.MaxX(), tpcGeo.MaxY(), tpcGeo.MaxZ());
50 
51  std::pair<TVector3, TVector3> intersection = CRTCommonUtils::CubeIntersection(min, max, start, end);
52  if(intersection.first.X() != -99999) return intersection;
53 
54  // Allow variations in track start/end points
55  // Try the corners of the allowed region
56  TVector3 min1 (track.x1_pos - track.x1_err, track.y1_pos - track.y1_err, track.z1_pos - track.z1_err);
57  TVector3 min2 (track.x2_pos - track.x2_err, track.y2_pos - track.y2_err, track.z2_pos - track.z2_err);
58  intersection = CRTCommonUtils::CubeIntersection(min, max, min1, min2);
59  if(intersection.first.X() != -99999) return intersection;
60 
61  TVector3 max1 (track.x1_pos + track.x1_err, track.y1_pos + track.y1_err, track.z1_pos + track.z1_err);
62  TVector3 max2 (track.x2_pos + track.x2_err, track.y2_pos + track.y2_err, track.z2_pos + track.z2_err);
63  intersection = CRTCommonUtils::CubeIntersection(min, max, max1, max2);
64  return intersection;
65 
66 }
67 
68 
69 // Function to calculate if a CRTTrack crosses the TPC volume
71 
72  for(size_t c = 0; c < fGeometryService->Ncryostats(); c++){
73  const geo::CryostatGeo& cryostat = fGeometryService->Cryostat(c);
74  for(size_t t = 0; t < cryostat.NTPC(); t++){
75  const geo::TPCGeo& tpcGeo = cryostat.TPC(t);
76  std::pair<TVector3, TVector3> intersection = TpcIntersection(tpcGeo, track);
77  if(intersection.first.X() != -99999) return true;
78  }
79  }
80  return false;
81 
82 } // CRTTrackMatchAlg::CrossesTPC()
83 
85  recob::Track tpcTrack, std::vector<sbn::crt::CRTTrack> crtTracks, const art::Event& event) {
86  auto tpcTrackHandle = event.getValidHandle<std::vector<recob::Track>>(fTPCTrackLabel);
87  art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event, fTPCTrackLabel);
88  std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
89  return T0FromCRTTracks(detProp, tpcTrack, hits, crtTracks);
90 }
91 
93  recob::Track tpcTrack, std::vector<art::Ptr<recob::Hit>> hits, std::vector<sbn::crt::CRTTrack> crtTracks) {
94 
95  std::pair<sbn::crt::CRTTrack, double> closest;
96  if(fSelectionMetric == "angle"){
97  closest = ClosestCRTTrackByAngle(detProp, tpcTrack, hits, crtTracks);
98  if(closest.second == -99999 || closest.second > fMaxAngleDiff) return -99999;
99  }
100  else if(fSelectionMetric == "dca"){
101  closest = ClosestCRTTrackByDCA(detProp, tpcTrack, hits, crtTracks);
102  if(closest.second == -99999 || closest.second > fMaxDistance) return -99999;
103  }
104  else{
105  closest = ClosestCRTTrackByScore(detProp, tpcTrack, hits, crtTracks);
106  if(closest.second == -99999 || closest.second > fMaxScore) return -99999;
107  }
108 
109  double crtTime = ((double)(int)closest.first.ts1_ns) * 1e-3; // [us]
110 
111  return crtTime;
112 
113 }
114 
116  recob::Track tpcTrack, std::vector<sbn::crt::CRTTrack> crtTracks, const art::Event& event){
117  std::pair<int, double> result = GetMatchedCRTTrackIdAndScore(detProp, tpcTrack, crtTracks, event);
118  return result.first;
119 }
120 
121 // Find the closest valid matching CRT track ID
123  recob::Track tpcTrack, std::vector<art::Ptr<recob::Hit>> hits, std::vector<sbn::crt::CRTTrack> crtTracks) {
124  std::pair<int, double> result = GetMatchedCRTTrackIdAndScore(detProp, tpcTrack, hits, crtTracks);
125  return result.first;
126 }
127 
129  recob::Track tpcTrack, std::vector<sbn::crt::CRTTrack> crtTracks, const art::Event& event){
130  auto tpcTrackHandle = event.getValidHandle<std::vector<recob::Track>>(fTPCTrackLabel);
131  art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event, fTPCTrackLabel);
132  std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
133  return GetMatchedCRTTrackIdAndScore(detProp, tpcTrack, hits, crtTracks);
134 }
135 
136 // Find the closest valid matching CRT track ID
138  recob::Track tpcTrack, std::vector<art::Ptr<recob::Hit>> hits, std::vector<sbn::crt::CRTTrack> crtTracks) {
139 
140  std::pair<int, double> null = std::make_pair(-99999, -99999);
141 
142  std::pair<sbn::crt::CRTTrack, double> closest;
143  if(fSelectionMetric == "angle"){
144  closest = ClosestCRTTrackByAngle(detProp, tpcTrack, hits, crtTracks);
145  if(closest.second == -99999 || closest.second > fMaxAngleDiff) return null;
146  }
147  else if(fSelectionMetric == "dca"){
148  closest = ClosestCRTTrackByDCA(detProp, tpcTrack, hits, crtTracks);
149  if(closest.second == -99999 || closest.second > fMaxDistance) return null;
150  }
151  else{
152  closest = ClosestCRTTrackByScore(detProp, tpcTrack, hits, crtTracks);
153  if(closest.second == -99999 || closest.second > fMaxScore) return null;
154  }
155 
156  int crt_i = 0;
157  for(auto const& track : crtTracks){
158  if(fCrtBackTrack.TrackCompare(closest.first, track)) return std::make_pair(crt_i, closest.second);
159  crt_i++;
160  }
161 
162  return null;
163 
164 }
165 
167  recob::Track tpcTrack, std::vector<sbn::crt::CRTTrack> crtTracks, const art::Event& event){
168  auto tpcTrackHandle = event.getValidHandle<std::vector<recob::Track>>(fTPCTrackLabel);
169  art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event, fTPCTrackLabel);
170  std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
171  return AllPossibleCRTTracks(detProp, tpcTrack, hits, crtTracks);
172 }
173 
174 
175 // Get all CRT tracks that cross the right TPC within an allowed time
177  recob::Track tpcTrack, std::vector<art::Ptr<recob::Hit>> hits, std::vector<sbn::crt::CRTTrack> crtTracks) {
178 
179  std::vector<sbn::crt::CRTTrack> trackCandidates;
180 
181  // Get the hits associated with the tpc track
182 
183  // Get the drift direction (0 for stitched tracks)
184  int driftDirection = TPCGeoUtil::DriftDirectionFromHits(fGeometryService, hits);
185 
186  // Get the TPC Geo object from the tpc track
187  geo::TPCID tpcID = hits[0]->WireID().asTPCID();
188  const geo::TPCGeo& tpcGeo = fGeometryService->GetElement(tpcID);
189 
190  // Loop over the crt tracks
191  for(auto const& crtTrack : crtTracks){
192  // Calculate the intersection points for that TPC
193  std::pair<TVector3, TVector3> intersection = TpcIntersection(tpcGeo, crtTrack);
194 
195  // Skip if it doesn't intersect
196  if(intersection.first.X() == -99999) continue;
197 
198  // Shift the track to the CRT track
199  double crtTime = ((double)(int)crtTrack.ts1_ns) * 1e-3; // [us]
200  double shift = driftDirection * crtTime * detProp.DriftVelocity();
201  geo::Point_t start = tpcTrack.Vertex();
202  geo::Point_t end = tpcTrack.End();
203  start.SetX(start.X() + shift);
204  end.SetX(end.X() + shift);
205 
206  // Check the track is fully contained in the TPC
207  if(!TPCGeoUtil::InsideTPC(start, tpcGeo, 2.) && shift != 0) continue;
208  if(!TPCGeoUtil::InsideTPC(end, tpcGeo, 2.) && shift != 0) continue;
209 
210  trackCandidates.push_back(crtTrack);
211 
212  }
213 
214  return trackCandidates;
215 }
216 
218  recob::Track tpcTrack, std::vector<sbn::crt::CRTTrack> crtTracks, const art::Event& event, double minDCA){
219  auto tpcTrackHandle = event.getValidHandle<std::vector<recob::Track>>(fTPCTrackLabel);
220  art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event, fTPCTrackLabel);
221  std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
222  return ClosestCRTTrackByAngle(detProp, tpcTrack, hits, crtTracks, minDCA);
223 }
224 
225 // Find the closest matching crt track by angle between tracks within angle and DCA limits
227  recob::Track tpcTrack, std::vector<art::Ptr<recob::Hit>> hits, std::vector<sbn::crt::CRTTrack> crtTracks, double minDCA){
228 
229  // Get the drift direction (0 for stitched tracks)
230  int driftDirection = TPCGeoUtil::DriftDirectionFromHits(fGeometryService, hits);
231 
232  std::vector<sbn::crt::CRTTrack> possTracks = AllPossibleCRTTracks(detProp, tpcTrack, hits, crtTracks);
233 
234  std::vector<std::pair<sbn::crt::CRTTrack, double>> candidates;
235  for(auto const& possTrack : possTracks){
236  double angle = AngleBetweenTracks(tpcTrack, possTrack);
237 
238  if(minDCA != -1){
239  if(minDCA == 0) minDCA = fMaxDistance;
240  double crtTime = ((double)(int)possTrack.ts1_ns) * 1e-3; // [us]
241  double shift = driftDirection * crtTime * detProp.DriftVelocity();
242  double DCA = AveDCABetweenTracks(tpcTrack, possTrack, shift);
243  if(DCA > minDCA) continue;
244  }
245 
246  candidates.push_back(std::make_pair(possTrack, angle));
247  }
248 
249  std::sort(candidates.begin(), candidates.end(), [](auto& left, auto& right){
250  return left.second < right.second;});
251 
252  if(candidates.size() > 0){
253  return candidates[0];
254  }
256  return std::make_pair(track, -99999);
257 }
258 
260  recob::Track tpcTrack, std::vector<sbn::crt::CRTTrack> crtTracks, const art::Event& event, double minAngle) {
261  auto tpcTrackHandle = event.getValidHandle<std::vector<recob::Track>>(fTPCTrackLabel);
262  art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event, fTPCTrackLabel);
263  std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
264  return ClosestCRTTrackByDCA(detProp, tpcTrack, hits, crtTracks, minAngle);
265 }
266 
267 // Find the closest matching crt track by average DCA between tracks within angle and DCA limits
269  recob::Track tpcTrack, std::vector<art::Ptr<recob::Hit>> hits, std::vector<sbn::crt::CRTTrack> crtTracks, double minAngle){
270 
271  // Get the drift direction (0 for stitched tracks)
272  int driftDirection = TPCGeoUtil::DriftDirectionFromHits(fGeometryService, hits);
273 
274  std::vector<sbn::crt::CRTTrack> possTracks = AllPossibleCRTTracks(detProp, tpcTrack, hits, crtTracks);
275 
276  std::vector<std::pair<sbn::crt::CRTTrack, double>> candidates;
277  for(auto const& possTrack : possTracks){
278 
279  double crtTime = ((double)(int)possTrack.ts1_ns) * 1e-3; // [us]
280  double shift = driftDirection * crtTime * detProp.DriftVelocity();
281 
282  double DCA = AveDCABetweenTracks(tpcTrack, possTrack, shift);
283 
284  if(minAngle != -1){
285  if(minAngle == 0) minAngle = fMaxAngleDiff;
286  double angle = AngleBetweenTracks(tpcTrack, possTrack);
287  if(angle > minAngle) continue;
288  }
289  candidates.push_back(std::make_pair(possTrack, DCA));
290  }
291 
292  std::sort(candidates.begin(), candidates.end(), [](auto& left, auto& right){
293  return left.second < right.second;});
294 
295  if(candidates.size() > 0){
296  return candidates[0];
297  }
299  return std::make_pair(track, -99999);
300 
301 }
302 
303 
305  recob::Track tpcTrack, std::vector<sbn::crt::CRTTrack> crtTracks, const art::Event& event) {
306  auto tpcTrackHandle = event.getValidHandle<std::vector<recob::Track>>(fTPCTrackLabel);
307  art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event, fTPCTrackLabel);
308  std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
309  return ClosestCRTTrackByScore(detProp, tpcTrack, hits, crtTracks);
310 }
311 
312 // Find the closest matching crt track by average DCA between tracks within angle and DCA limits
314  recob::Track tpcTrack, std::vector<art::Ptr<recob::Hit>> hits, std::vector<sbn::crt::CRTTrack> crtTracks){
315 
316  // Get the drift direction (0 for stitched tracks)
317  int driftDirection = TPCGeoUtil::DriftDirectionFromHits(fGeometryService, hits);
318 
319  std::vector<sbn::crt::CRTTrack> possTracks = AllPossibleCRTTracks(detProp, tpcTrack, hits, crtTracks);
320 
321  std::vector<std::pair<sbn::crt::CRTTrack, double>> candidates;
322  for(auto const& possTrack : possTracks){
323 
324  double crtTime = ((double)(int)possTrack.ts1_ns) * 1e-3; // [us]
325  double shift = driftDirection * crtTime * detProp.DriftVelocity();
326 
327  double DCA = AveDCABetweenTracks(tpcTrack, possTrack, shift);
328  double angle = AngleBetweenTracks(tpcTrack, possTrack);
329  double score = DCA + 4*180/TMath::Pi()*angle;
330 
331  candidates.push_back(std::make_pair(possTrack, score));
332  }
333 
334  std::sort(candidates.begin(), candidates.end(), [](auto& left, auto& right){
335  return left.second < right.second;});
336 
337  if(candidates.size() > 0){
338  return candidates[0];
339  }
341  return std::make_pair(track, -99999);
342 
343 }
344 
345 
346 // Calculate the angle between tracks assuming start is at the largest Y
348 
349  // Calculate the angle between the tracks
350  TVector3 crtStart (crtTrack.x1_pos, crtTrack.y1_pos, crtTrack.z1_pos);
351  TVector3 crtEnd (crtTrack.x2_pos, crtTrack.y2_pos, crtTrack.z2_pos);
352  if(crtStart.Y() < crtEnd.Y()) std::swap(crtStart, crtEnd);
353 
354  TVector3 tpcStart = tpcTrack.Vertex<TVector3>();
355  TVector3 tpcEnd = tpcTrack.End<TVector3>();
356  if(tpcStart.Y() < tpcEnd.Y()) std::swap(tpcStart, tpcEnd);
357 
358  return (tpcStart - tpcEnd).Angle(crtStart - crtEnd);
359 
360 }
361 
362 
363 // Calculate the average DCA between tracks
365 
366  TVector3 crtStart (crtTrack.x1_pos, crtTrack.y1_pos, crtTrack.z1_pos);
367  TVector3 crtEnd (crtTrack.x2_pos, crtTrack.y2_pos, crtTrack.z2_pos);
368  if(crtStart.Y() < crtEnd.Y()) std::swap(crtStart, crtEnd);
369  double denominator = (crtEnd - crtStart).Mag();
370 
371  size_t npts = tpcTrack.NumberTrajectoryPoints();
372 
373  double aveDCA = 0;
374  int usedPts = 0;
375  for(size_t i = 0; i < npts; i++){
376  TVector3 point = tpcTrack.LocationAtPoint<TVector3>(i);
377 
378  // Pandora produces dummy points
379  if(!tpcTrack.HasValidPoint(i)) continue;
380 
381  point.SetX(point.X() + shift);
382  aveDCA += (point - crtStart).Cross(point - crtEnd).Mag()/denominator;
383  usedPts++;
384  }
385 
386  return aveDCA/usedPts;
387 
388 }
389 
391  recob::Track tpcTrack, sbn::crt::CRTTrack crtTrack, const art::Event& event) {
392  auto tpcTrackHandle = event.getValidHandle<std::vector<recob::Track>>(fTPCTrackLabel);
393  art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event, fTPCTrackLabel);
394  std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
395  return AveDCABetweenTracks(detProp, tpcTrack, hits, crtTrack);
396 }
397 
398 
399 // Calculate the average DCA between tracks
401  recob::Track tpcTrack, std::vector<art::Ptr<recob::Hit>> hits, sbn::crt::CRTTrack crtTrack) {
402 
403  // Get the drift direction (0 for stitched tracks)
404  int driftDirection = TPCGeoUtil::DriftDirectionFromHits(fGeometryService, hits);
405  double crtTime = ((double)(int)crtTrack.ts1_ns) * 1e-3; // [us]
406  double shift = driftDirection * crtTime * detProp.DriftVelocity();
407 
408  TVector3 crtStart (crtTrack.x1_pos, crtTrack.y1_pos, crtTrack.z1_pos);
409  TVector3 crtEnd (crtTrack.x2_pos, crtTrack.y2_pos, crtTrack.z2_pos);
410  if(crtStart.Y() < crtEnd.Y()) std::swap(crtStart, crtEnd);
411  double denominator = (crtEnd - crtStart).Mag();
412 
413  size_t npts = tpcTrack.NumberTrajectoryPoints();
414 
415  double aveDCA = 0;
416  int usedPts = 0;
417  for(size_t i = 0; i < npts; i++){
418  TVector3 point = tpcTrack.LocationAtPoint<TVector3>(i);
419 
420  // Pandora produces dummy points
421  if(!tpcTrack.HasValidPoint(i)) continue;
422 
423  point.SetX(point.X() + shift);
424  aveDCA += (point - crtStart).Cross(point - crtEnd).Mag()/denominator;
425  usedPts++;
426  }
427 
428  return aveDCA/usedPts;
429 
430 }
431 
432 
433 }
void reconfigure(const Config &config)
CryostatGeo const & GetElement(geo::CryostatID const &cryoid) const
T::provider_type const * providerFrom()
Returns a constant pointer to the provider of specified service.
Definition: ServiceUtil.h:77
walls no right
Definition: selectors.fcl:105
Point_t const & LocationAtPoint(size_t i) const
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
Geometry information for a single TPC.
Definition: TPCGeo.h:38
BEGIN_PROLOG or score(default)}sbnd_crttrackmatchingalg_crID
bool CrossesTPC(sbn::crt::CRTTrack track)
bool HasValidPoint(size_t i) const
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
int GetMatchedCRTTrackId(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event)
float x1_pos
X position of first CRTHit.
Definition: CRTTrack.hh:33
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:91
process_name use argoneut_mc_hitfinder track
double AngleBetweenTracks(recob::Track tpcTrack, sbn::crt::CRTTrack crtTrack)
float y1_err
Y position error of first CRTHit.
Definition: CRTTrack.hh:36
fhicl::Atom< art::InputTag > TPCTrackLabel
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
bool TrackCompare(const sbn::crt::CRTTrack &track1, const sbn::crt::CRTTrack &track2)
shift
Definition: fcl_checks.sh:26
double AveDCABetweenTracks(recob::Track tpcTrack, sbn::crt::CRTTrack crtTrack, double shift)
fhicl::Atom< double > MaxDistance
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
float z1_err
Z position error of first CRTHit.
Definition: CRTTrack.hh:38
float y2_err
Y position error of second CRTHit.
Definition: CRTTrack.hh:42
double ts1_ns
Average T1 (nanosecond) of the two hits making the track.
Definition: CRTTrack.hh:28
std::pair< sbn::crt::CRTTrack, double > ClosestCRTTrackByDCA(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event, double minAngle=0.)
art::InputTag fTPCTrackLabel
bool InsideTPC(geo::Point_t point, const geo::TPCGeo &tpc, double buffer)
geo::GeometryCore const * fGeometryService
Point_t const & Vertex() const
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
double MinZ() const
Returns the world z coordinate of the start of the box.
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:181
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
walls no left
Definition: selectors.fcl:105
fhicl::Atom< double > MaxAngleDiff
double DriftVelocity(double efield=0., double temperature=0.) const
cm/us
fhicl::Atom< double > MaxScore
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
Description of geometry of one entire detector.
fhicl::Atom< std::string > SelectionMetric
double MaxY() const
Returns the world y coordinate of the end of the box.
std::vector< sbn::crt::CRTTrack > AllPossibleCRTTracks(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event)
constexpr TPCID const & asTPCID() const
Conversion to TPCID (for convenience of notation).
Definition: geo_types.h:446
CRTTrackMatchAlg(const Config &config)
float z1_pos
Z position of first CRTHit.
Definition: CRTTrack.hh:37
CRTBackTracker fCrtBackTrack
std::pair< TVector3, TVector3 > TpcIntersection(const geo::TPCGeo &tpcGeo, sbn::crt::CRTTrack track)
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
Definition: CryostatGeo.cxx:93
int DriftDirectionFromHits(const geo::GeometryCore *GeometryService, std::vector< art::Ptr< recob::Hit >> hits)
float z2_pos
Z position of second CRTHit.
Definition: CRTTrack.hh:43
double MaxZ() const
Returns the world z coordinate of the end of the box.
float y2_pos
Y position of second CRTHit.
Definition: CRTTrack.hh:41
float y1_pos
Y position of first CRTHit.
Definition: CRTTrack.hh:35
std::pair< sbn::crt::CRTTrack, double > ClosestCRTTrackByAngle(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event, double minDCA=0.)
do i e
Point_t const & End() const
float x2_pos
X position of second CRTHit.
Definition: CRTTrack.hh:39
stream1 can override from command line with o or output services user sbnd
std::pair< TVector3, TVector3 > CubeIntersection(TVector3 min, TVector3 max, TVector3 start, TVector3 end)
finds tracks best matching by angle
double T0FromCRTTracks(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event)
std::pair< int, double > GetMatchedCRTTrackIdAndScore(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event)
float x1_err
X position error of first CRTHit.
Definition: CRTTrack.hh:34
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
double MinY() const
Returns the world y coordinate of the start of the box.
float z2_err
Z position error of second CRTHit.
Definition: CRTTrack.hh:44
float x2_err
X position error of second CRTHit.
Definition: CRTTrack.hh:40
auto const detProp
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track:
std::pair< sbn::crt::CRTTrack, double > ClosestCRTTrackByScore(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event)