PandaRoot
PndHoughUtilities.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
14 // PndHoughUtilities
15 // This class contains different methods to handle PndTracks vs Circles
17 
28 #ifndef PndHoughUtilities_H_
29 #define PndHoughUtilities_H_
30 #include "FairTask.h"
31 #include "FairRootManager.h"
32 //#include "PndGeoSttPar.h"
33 //#include "PndSttGeometryMap.h"
34 //#include "PndSttStrawMap.h"
35 //#include "PndSttCellTrackFinder.h"
36 #include "PndSttHit.h"
37 #include "PndMCTrack.h"
38 
39 //#include "TEllipse.h"
40 #include "TH2F.h"
41 #include "TGraph.h"
42 //#include "TCanvas.h" // DRAW
43 
44 #include <vector>
45 #include <tuple>
46 //#include "TDatabasePDG.h"
47 #include "PndHoughData.h"
48 
50 
51  public:
52  PndHoughUtilities(PndHoughData *fData) : fMapFairLinktoFairHit(fData->GetMapFairLinktoFairHit()), fMapFairLinktoIsochrone(fData->GetMapFairLinktoIsochrone())
53  {
54  ioman = FairRootManager::Instance();
55  };
56 
57  PndHoughUtilities() { ioman = FairRootManager::Instance(); };
58 
59  virtual ~PndHoughUtilities(){};
60 
62  std::vector<double> getCircleFromPndTrack(PndTrack &tr);
64  double Pt(double B, double r);
66  std::tuple<TVector3, Int_t> getPandqforHit(int i, double B, TVector3 &circle, PndTrackCand &myCand);
68  FairTrackParP getTrackParPForHit(Int_t i, Double_t B, PndTrackCand &myCand, TVector3 &circle);
70  PndTrack getPndTrack(Double_t B, PndTrackCand &myCand, TVector3 &circle);
71 
73  TVector2 calcPointOnCircle(Int_t i, PndTrackCand &myCand, std::vector<double> &circle);
75  TVector2 findCorrectIntersectionPoint(std::vector<double> &intersectionPoints, TVector2 &point);
77  std::vector<double> calcIntersectionPointCircleLine(std::vector<double> &circle, double m, double b, double Ax);
78 
80  double calcDistanceTrackCandToTrack(PndTrackCand &trackCand, std::vector<double> &circle);
82  double calcDistanceFromIsochroneToCircle(double &xi, double &yi, double &ri, double &xT, double &yT, double &rT);
83 
84  private:
85  FairRootManager *ioman = nullptr;
86 
87  std::map<FairLink, FairHit *> fMapFairLinktoFairHit;
88  std::map<FairLink, double> fMapFairLinktoIsochrone;
89 
90  ClassDef(PndHoughUtilities, 1);
91 };
92 
93 #endif /*PndHoughUtilities_H_*/
std::vector< double > calcIntersectionPointCircleLine(std::vector< double > &circle, double m, double b, double Ax)
Finds the intersection point between a line and a circle.
__m128 m
Definition: P4_F32vec4.h:38
double Pt(double B, double r)
Determines the transverse momentum.
unsigned int i
Definition: P4_F32vec4.h:33
PndHoughUtilities(PndHoughData *fData)
std::vector< double > getCircleFromPndTrack(PndTrack &tr)
Determines the circle from a PndTrack.
PndTrack getPndTrack(Double_t B, PndTrackCand &myCand, TVector3 &circle)
Determined the PndTrack for a given track candidate and a circle.
std::tuple< TVector3, Int_t > getPandqforHit(int i, double B, TVector3 &circle, PndTrackCand &myCand)
Determines the charge q and the momentum p of a hit.
virtual ~PndHoughUtilities()
TVector2 findCorrectIntersectionPoint(std::vector< double > &intersectionPoints, TVector2 &point)
Finds the correct intersection point.
FairTrackParP getTrackParPForHit(Int_t i, Double_t B, PndTrackCand &myCand, TVector3 &circle)
Helper function to find PndTrack parameters from a circle.
double calcDistanceFromIsochroneToCircle(double &xi, double &yi, double &ri, double &xT, double &yT, double &rT)
Calculates the distance from a hitpoint (MVD hit or nearest point of stt isochrone to track) to a cir...
TVector2 calcPointOnCircle(Int_t i, PndTrackCand &myCand, std::vector< double > &circle)
Finds the point on a circle closest to the given hit point.
double calcDistanceTrackCandToTrack(PndTrackCand &trackCand, std::vector< double > &circle)
Calculates the sum of distances from each hit of a track to the track circle.