9 #include "TClonesArray.h"
10 #include "FairRootManager.h"
13 #include "FairTrackParP.h"
19 fTrackerTask(trackerTask),
23 fZxLineBeforeDipole(0., trackerTask),
25 fZxParabola(0., trackerTask),
27 fZxLineBehindDipole(0., trackerTask),
29 fZyLine(0., trackerTask),
33 fZCoordLineParabola(0.),
34 fZCoordParabolaLine(0.)
37 std::cout <<
"PndFtsHoughTrackCand FATAL ERROR Tracker task pointer not set.\n";
40 if(3<
fVerbose) std::cout <<
"PndFtsHoughTrackCand called with tracker ptr " <<
fTrackerTask <<
'\n';
52 std::cerr <<
"WARNING from PndFtsHoughTrackCand: Line before dipole in zx plane is set more than once! Ignore new values! Potentially FATAL ERROR!\n";
61 std::cerr <<
"WARNING from PndFtsHoughTrackCand: Parabola inside dipole in zx plane is set more than once! Ignore new values! Potentially FATAL ERROR!\n";
66 std::cout <<
"WARNING from PndFtsHoughTrackCand: First line and parabola were not calculated wrt the same z position! Potentially FATAL ERROR!\n";
73 std::cerr <<
"WARNING from PndFtsHoughTrackCand: Line behind dipole in zx plane is set more than once! Ignore new values! Potentially FATAL ERROR!\n";
82 std::cerr <<
"WARNING from PndFtsHoughTrackCand: Line in zy plane is set more than once! Ignore new values! Potentially FATAL ERROR!\n";
95 std::cout <<
"=========== PndFtsHoughTrackCand::Print() ==========\n";
98 std::cout <<
"zx plane\n\n";
99 std::cout <<
"1st line: ";
103 std::cout <<
"parabola: ";
107 std::cout <<
"2nd line: ";
111 std::cout <<
"zy plane\n\n";
112 std::cout <<
"Line: ";
122 for (UInt_t iHit = 0; iHit < inTracklet.
GetNHits(); ++iHit)
125 const Int_t inHitId = inHit.
GetHitId();
126 const Int_t inDetId = inHit.
GetDetId();
145 const Double_t zshifted = zLabSys-zRefLabSys;
152 Double_t xParabolaSys = qDivPzx /2. * By * zshifted;
154 Double_t xLabSys = xParabolaSys + interceptLine;
159 const Double_t tantheta = tan(thetaRad);
160 const Double_t pzstuff = 1. / qDivPzx / By /
sin(thetaRad);
161 const Double_t ztantheta = zshifted / tantheta;
162 const Double_t a = -ztantheta + pzstuff / tantheta;
164 const Double_t wurzel =
sqrt(a * a - 2. * pzstuff * zshifted - ztantheta * ztantheta);
165 const Double_t x1ParabolaSys = a - wurzel;
166 const Double_t x2ParabolaSys = a + wurzel;
169 Double_t x1LabSys = x1ParabolaSys + interceptLine;
170 Double_t x2LabSys = x2ParabolaSys + interceptLine;
173 if (
fabs(x1LabSys)<
fabs(x2LabSys)) {
210 FairTrackParP firstPar, lastPar;
216 return PndTrack(firstPar, lastPar, myCand);
227 if (!
isComplete()) std::cout <<
"getHit: You try to access hits before we have a complete track candidate.\n";
237 if (0 == myHit)
throwError(
"Cannot get hit, probably the tracking has not finished or the index is too large.");
244 TVector3 hitPos =
getPos(zLabSys);
251 TVector3 momError = 0.1*
mom;
255 myHit->Position(origin);
261 FairTrackParP result(hitPos, mom, hitPosError, momError,
getCharge(), origin, dj, dk);
272 std::cout <<
"getPforHit: Track cand. is not complete yet. Momentum will be calculated for incomplete track cand.\n";
277 std::pair<Double_t, Double_t> pZPXLabSys;
291 pZLabSys = pZPXLabSys.first;
292 pXLabSys = pZPXLabSys.second;
294 mom.SetXYZ(pXLabSys, pYLabSys, pZLabSys);
295 if (
fVerbose > 10) std::cout <<
"P-Vector for z=" << zLabSys <<
" : " << mom.X() <<
" " << mom.Y() <<
" " << mom.Z() <<
'\n';
310 return atan2(xLabSys2-xLabSys1, 2*epsilon);
336 if (kFALSE ==
isComplete()) std::cout <<
"getPositionForHit: Track cand. is not complete yet. Position will be calculated for incomplete track cand.\n";
344 position.SetXYZ(xLabSys, yLabSys, zLabSys);
345 if (
fVerbose > 10) std::cout <<
"Pos-Vector for z=" << zLabSys <<
" : " << position.X() <<
" " << position.Y() <<
" " << position.Z() <<
'\n';
PndTrackCand getPndTrackCand()
void SetZxParabola(const PndFtsHoughTracklet zxParabola)
Double_t fZCoordLineParabola
FairTrackParP getTrackParPForHit(const UInt_t i)
Double_t getThetaRadVal() const
void SetZyLine(const PndFtsHoughTracklet zyLine)
Interface between PandaRoot (data input and output) and PndFtsHoughTrackFinder (implementation of PR ...
friend F32vec4 sqrt(const F32vec4 &a)
PndFtsHoughTracklet fZxLineBehindDipole
Double_t getXLabForParabola(const Double_t &zLabSys) const
std::pair< Double_t, Double_t > getPZPXLabLine(const Double_t &zLabSys, const PndFtsHoughTracklet *const lineTracklet) const
friend F32vec4 sin(const F32vec4 &a)
PndTrackCandHit GetSortedHit(UInt_t i)
Bool_t isComplete() const
std::pair< Double_t, Double_t > getPZPXLabParabola(const Double_t &zLabSys) const
void SetZxLineBeforeDipole(const PndFtsHoughTracklet zxLineParabola)
PndTrackCand fIntTrackCand
void addUniqueTrackletHits(const PndFtsHoughTracklet inTracklet)
PndFtsHoughTrackerTask * fTrackerTask
Double_t getZRefLabSys() const
TVector3 getPos(const Double_t zLabSys) const
void throwError(const TString s) const
For error reporting.
PndFtsHoughTracklet fZxParabola
Class for saving the result of one Hough transform for FTS PR.
void AddHit(UInt_t detId, UInt_t hitId, Double_t rho)
Double_t getXOrYLabForLine(const Double_t &zLabSys, const PndFtsHoughTracklet *const lineTracklet) const
PndFtsHoughTrackCand(PndFtsHoughTrackerTask *trackerTask=0)
Set pointer to tracker task (super important as it provides an I/O interface to PandaRoot) ...
ClassImp(PndFtsHoughTrackCand)
Double_t getSecondVal() const
friend F32vec4 fabs(const F32vec4 &a)
Double_t fZCoordParabolaLine
TVector3 getP(const Double_t zLabSys) const
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
void throwIfZOutOfRange(const Double_t &zLabSys) const
void SetZxLineBehindDipole(const PndFtsHoughTracklet zxParabolaLine)
const PndFtsHit * GetFtsHit(UInt_t hitId) const
Returns pointer to the hit with index hitId in the FTS hit array.
PndFtsHoughTracklet fZxLineBeforeDipole
Double_t getQdivPzx() const
Class for saving a FTS track cand. for Hough transform based FTS PR.
Double_t getPYLab() const
Double_t getXLabSys(const Double_t zLabSys) const
const TVector3 GetFtsHitPosErrors(const PndFtsHit *const ftsHit) const
Returns the position error (based on FTS straw geometry) for the hit with index hitId in the FTS hit ...
PndFtsHoughTracklet fZyLine
Int_t HitInTrack(UInt_t detId, UInt_t hitId) const
Double_t getThetaZxRad(const Double_t zLabSys) const