26 #ifndef PndFtsHoughSpace_H
27 #define PndFtsHoughSpace_H
37 #include "FairLogger.h"
40 #include "TClonesArray.h"
43 #include "FairField.h"
73 const Int_t refIndex = -1,
166 inline void Print()
const;
274 const Int_t lastBinX,
275 const Int_t lastBinY,
276 const Int_t currentBinY,
289 Double_t yVal = 1. / c / By * (-hitZShifted *
sin(thetaRad) + hitXShifted *
cos(thetaRad))/ pow((hitZShifted *
cos(thetaRad) + hitXShifted *
sin(thetaRad)), 2);
304 Double_t yVal = c*By*pow((hitZShifted *
cos(thetaRad) + hitXShifted *
sin(thetaRad)), 2)/(-hitZShifted *
sin(thetaRad) + hitXShifted *
cos(thetaRad));
315 Double_t yVal = -tan(thetaRad)*hitZShifted+hitXLabSys;
357 std::cout <<
"=========== PndFtsHoughSpace::Print() ==========" <<
'\n';
358 std::cout <<
"fZRefPos = " <<
fZRefPos <<
'\n';
364 std::cout << tracklets.size() <<
" peaks found for " << GetName() <<
'\n';
366 for (UInt_t
i=0;
i< tracklets.size(); ++
i)
368 tracklets[
i].Print();
377 Int_t hitIndex =
fHitId.at(index).GetHitId();
389 myHit->Position(hitPos);
401 const TVector3 wireCenter = ftsTube->
GetPosition();
403 const Double_t hitZLabSys = wireCenter.Z();
409 const Double_t param = ( xTM - wireCenter.X() ) / wireDirection.X();
411 const Double_t yStraw = wireCenter.Y() + param*wireDirection.Y();
413 TVector3 crossingPosition(xTM,yStraw,hitZLabSys);
414 return crossingPosition;
419 TString debugOut =
"/home/plots/";
447 fField->GetFieldValue(po, BB);
void AddHitsToTrackletByCalculating(PndFtsHoughTracklet *currentTracklet, Int_t locmax)
Bool_t IsHitFromTubeIdAlreadyAdded(const Int_t tubeIdToAdd)
void setVerbose(Int_t verbose)
const TVector3 CalculateHitPosFromIntersectionsWithZxTrackModel(const PndFtsHit *const myHit) const
PndFtsHoughTrackCand * fAssociatedTrackCand
hits relevant for this Hough space
friend F32vec4 cos(const F32vec4 &a)
std::vector< PndFtsHoughTracklet > FindAllPeaksBinsWoMergingWithSearchWindow(const UInt_t minHeight, const Int_t vicinityLength=0)
Finds all peaks that satisfy the minimum height requirement minHeight.
const Int_t fRefIndex
for debugging output (to which index in some loop does this Hough space and its output belong to) ...
std::vector< Int_t > IdxPath
TH2S MakeEmptyHistoOfSameDimensions(TString specifier="", Int_t index=-1) const
Makes a new empty histogram with the same binning and limits as this.
Double_t equationParabola(Double_t thetaRad, Double_t hitZShifted, Double_t hitXShifted, Double_t By)
Interface between PandaRoot (data input and output) and PndFtsHoughTrackFinder (implementation of PR ...
Double_t fOnlyUseHitsFromZ
Double_t equationParabolaPz(Double_t thetaRad, Double_t hitZShifted, Double_t hitXShifted, Double_t By)
friend F32vec4 sin(const F32vec4 &a)
const TVector3 GetRawOrCalculatedHitPos(const PndFtsHit *const myHit) const
void WriteHistoOfAllPeaks(const std::vector< PndFtsHoughSpacePeak > &peaksToPlot) const
For writing out peaks in Hough spaces as histograms (for debugging purposes).
TVector3 GetWireDirection() const
std::vector< PndTrackCandHit > fHitId
Bool_t fUseNonSkewedStraws
std::vector< PndFtsHoughTracklet > FindAllPeaksScanPathsMergeBins(const UInt_t minHeight)
Finds all peaks that satisfy the minimum height requirement minHeight.
Bool_t FillHoles(const Int_t lastBinX, const Int_t lastBinY, const Int_t currentBinY, IdxPath *ptrThetaYIdxPathVec)
Makes sure there are no holes in the Hough space by filling them with a line.
std::vector< PndFtsHoughTracklet > FindAllPeaksBlanko(const UInt_t minHeight)
Finds all peaks that satisfy the minimum height requirement minHeight.
Double_t getByFromBField(Double_t hitXLabSys, Double_t hitYLabSys, Double_t hitZLabSys)
void throwError(const TString s) const
For error reporting.
Class for saving the result of one Hough transform for FTS PR.
PndFtsHoughSpace(const char *name=0, const Int_t refIndex=-1, PndFtsHoughSpaceBinning binning=PndFtsHoughSpaceBinning(), Double_t zRefPos=0., Double_t interceptZx=0., PndFtsHoughTrackCand *associatedTrackCand=0, PndFtsHoughTrackerTask *trackerTask=0)
std::ostream & operator<<(std::ostream &os, const IdxPath &outVector)
Bool_t setParametersForHsOption()
void WriteHistoOfAllPathsForEachMcTruthTrack() const
For writing out paths from hits which stem from the same MC truth tracks (how the Hough space would b...
void WriteHistoOfAllPaths() const
For writing out paths (how the Hough space was filled seen from one hit) as histograms (for debugging...
std::vector< PndFtsHoughTracklet > FindAllPeaksWithTSpectrum2(const UInt_t minHeight)
Finds all peaks that satisfy the minimum height requirement minHeight.
Class for Hough space based on TH2S (for the moment). Saves the hits which enter this Hough space and...
TVector3 GetPosition() const
Double_t getInterceptZx() const
Int_t fFtsBranchId
@ brief FTS Hits
void WriteHistoOfHoughSpace() const
For writing out Hough spaces as histograms (for debugging purposes).
const PndFtsHit * GetFtsHit(UInt_t hitId) const
Returns pointer to the hit with index hitId in the FTS hit array.
Double_t equationLineZxOrZy(Double_t thetaRad, Double_t hitZShifted, Double_t hitXLabSys)
Int_t getHitIdFromHS(UInt_t index) const
const PndFtsTube * GetFtsTube(const PndFtsHit *const myHit) const
Returns pointer to the FTS tube corresponding to input FTS hit.
Double_t fOnlyUseHitsUpToZ
std::vector< PndFtsHoughTracklet > FindAllPeaksScanPathsMergeBinsCalculatingPaths(const UInt_t minHeight)
Finds all peaks that satisfy the minimum height requirement minHeight.
Helper class for Hough space containing binning. Created: 09.02.2015.
HitIdxPathMap fHitThetaYIdxPath
Class for saving a FTS track cand. for Hough transform based FTS PR.
Double_t getXLabSys(const Double_t zLabSys) const
UInt_t GetEventNr() const
Returns the save debug flag.
void AddHitToHS(UInt_t hitId, Double_t rho)
void PrintFoundTracklets(const std::vector< PndFtsHoughTracklet > &tracklets) const
const PndFtsHit * getHitFromHS(UInt_t index) const
std::map< Int_t, IdxPath > HitIdxPathMap
PndFtsHoughTrackerTask * fTrackerTask
ClassDef(PndFtsHoughSpace, 1)
std::pair< Int_t, IdxPath > HitIdxPathPair
Double_t getZRefPos() const
static const Bool_t fCorrectPzx
TString GetDebugOutName(TString title="", Int_t param=-1) const
For writing out debugging histograms.
void FillHoughSpace()
Fills the Hough space using the equation which corresponds to the name of the Hough space...