11 : fTrackerTask(trackerTask),
15 fMinPeakHeightZxLineBeforeDipole(6),
16 fMinPeakHeightZxParabola(8),
17 fMinPeakHeightZxLineBehindDipole(6),
18 fMinPeakHeightZyLine(8),
21 fNLinesBeforeDipoleFound(0),
22 fNLinesBehindDipoleFound(0),
27 std::cout <<
"PndFtsHoughTrackFinder FATAL ERROR Tracker task not set.\n";
50 static const Int_t thetaDegLowHigh = 80;
53 static const Double_t xLowHigh = 200;
55 static const Int_t stepsPerThetaDeg = 8;
56 static const Int_t nBinsInSecVal = 400;
66 binningZxLineBehindDipole,
71 catch (std::runtime_error& e) {
73 <<
"Hough Space for zx line behind dipole could not be created! \n";
74 std::cerr <<
"runtime_error: " << e.what() <<
'\n';
77 std::vector<PndFtsHoughTracklet> trackletsLineBehindDipole = houghSpaceZxLineBehindDipole.FindAllPeaksScanPathsMergeBins(
79 return trackletsLineBehindDipole;
99 static const Int_t thetaDegLowHigh = 25;
102 static const Double_t xLowHigh = 80;
104 static const Int_t stepsPerThetaDeg = 8;
105 static const Int_t nBinsInSecVal = 160;
115 binningZxLineBeforeDipole,
120 catch (std::runtime_error& e) {
122 <<
"Hough Space could not be created! \n";
123 std::cerr <<
"runtime_error: " << e.what() <<
'\n';
128 return trackletsLineBeforeDipole;
132 const std::vector<PndFtsHoughTracklet>& linesBeforeDipole,
133 const std::vector<PndFtsHoughTracklet>& linesBehindDipole
141 for (UInt_t iLB4D = 0; iLB4D < linesBeforeDipole.size(); ++iLB4D) {
142 const Double_t peakThetaRadLB4D = linesBeforeDipole[iLB4D].getThetaRadVal();
143 const Double_t peakInterceptLB4D = linesBeforeDipole[iLB4D].getSecondVal();
144 const Double_t peakThetaRadHwLB4D = linesBeforeDipole[iLB4D].getThetaRadHw();
150 const Double_t parabolaThetaRadLow = peakThetaRadLB4D
151 - parabolaHwScan*peakThetaRadHwLB4D;
152 const Double_t parabolaThetaRadHigh = peakThetaRadLB4D
153 + parabolaHwScan*peakThetaRadHwLB4D;
154 if (parabolaThetaRadHigh == parabolaThetaRadLow) std::cout <<
"ERROR: low and high are the same for parabola!\n";
155 const Double_t parabolaThetaDegLow = parabolaThetaRadLow*TMath::RadToDeg();
156 const Double_t parabolaThetaDegHigh = parabolaThetaRadHigh*TMath::RadToDeg();
158 UInt_t thetaBins = ceil(parabolaStepsPerThetaDeg * (parabolaThetaDegHigh - parabolaThetaDegLow));
162 <<
"\n thetaRadLowParabola=" << parabolaThetaRadLow
163 <<
" thetaRadHighParabola=" << parabolaThetaRadHigh
164 <<
" thetaBins=" << thetaBins
165 <<
" peakThetaRadLB4D="
167 <<
" peakThetaRadHwLB4D="
168 << peakThetaRadHwLB4D
169 <<
" peakInterceptLB4D=" << peakInterceptLB4D
170 <<
" peakThetaRadHwLB4D=" << peakThetaRadHwLB4D
180 parabolaThetaRadHigh,
182 -1*parabolaQDivPzxArgMax,
183 parabolaQDivPzxArgMax
191 catch (std::runtime_error& e) {
192 std::cerr <<
"Hough Space for zx parabola could not be created! \n";
193 std::cerr <<
"runtime_error: " << e.what() <<
'\n';
198 std::vector<PndFtsHoughTracklet> zxParabolaTracklets = houghspaceZxParabola.FindAllPeaksBinsWoMergingWithSearchWindow(
fMinPeakHeightZxParabola);
206 <<
"Create track candidates from line in zx before dipole "
207 << iLB4D <<
" and all parabolas within dipole.\n"
208 <<
"And all lines behind dipole which match line+parabola (if exist)\n";
211 for (UInt_t iParabola = 0; iParabola < zxParabolaTracklets.size(); ++iParabola) {
220 Bool_t foundLineBehindDipole = kFALSE;
221 for (UInt_t iLBhD = 0; iLBhD < linesBehindDipole.size(); ++iLBhD) {
226 foundLineBehindDipole = kTRUE;
245 static const Int_t stepsPerThetaDegZyLine = 4;
246 static const Int_t thetaDegLowZyLine = -18;
247 static const Int_t thetaDegHighZyLine = 18;
250 stepsPerThetaDegZyLine * (thetaDegHighZyLine - thetaDegLowZyLine),
251 thetaDegLowZyLine * TMath::DegToRad(),
252 thetaDegHighZyLine * TMath::DegToRad(),
253 stepsPerThetaDegZyLine * 16,
264 }
catch (std::runtime_error& e) {
266 <<
"Hough Space for zy line before dipole could not be created! \n";
267 std::cerr <<
"runtime_error: " << e.what() <<
'\n';
270 std::vector<PndFtsHoughTracklet> trackletsZyLine =
276 <<
"Create track candidates by adding line in zy to line+parabola+line in zx "
278 <<
"If no zy line can be found, delete track candidate.\n";
281 for (UInt_t iZyLine = 0; iZyLine < trackletsZyLine.size(); ++iZyLine) {
284 fullTrackCand.
SetZyLine(trackletsZyLine[iZyLine]);
373 UInt_t maxAcceptableSharedHits,
374 std::vector<PndFtsHoughTracklet> &tracklets
378 std::set<UInt_t> indicesToDelete;
379 std::set<UInt_t>::iterator findIndex;
383 for (UInt_t iTrackletLeft = 0; iTrackletLeft < tracklets.size(); ++iTrackletLeft)
385 for (UInt_t iTrackletRight = iTrackletLeft+1; iTrackletRight < tracklets.size(); ++iTrackletRight)
390 const UInt_t nSharedHits = trackletLeft.
getNSharedHits(trackletRight);
391 if (nSharedHits>maxAcceptableSharedHits){
395 if (heightLeft>heightRight){
396 indicesToDelete.insert(iTrackletRight);
397 }
else if (heightLeft<heightRight){
398 indicesToDelete.insert(iTrackletLeft);
399 }
else if (heightLeft==heightRight){
400 std::cout <<
"WARNING: Found two peaks of the same height that share " << nSharedHits <<
" hits.\n";
401 std::cout <<
"The max. number of shared hits was set to " << maxAcceptableSharedHits <<
" hits.\n";
402 std::cout <<
"Both peaks / tracklets will be kept. \n";
410 if (0==indicesToDelete.size()){
411 if (1<
fTrackerTask->
GetVerbose()) { std::cout <<
"FilterTrackletsBasedOnSharedHits: No tracklets are marked for deletion.\n"; }
416 std::vector<PndFtsHoughTracklet> filteredTracklets;
417 for (UInt_t iTracklet = 0; iTracklet < tracklets.size(); ++iTracklet)
420 findIndex = indicesToDelete.find(iTracklet);
421 if (findIndex == indicesToDelete.end()){
423 filteredTracklets.push_back(tracklets[iTracklet]);
427 tracklets = filteredTracklets;
virtual ~PndFtsHoughTrackFinder()
Destructor.
virtual void FindTracks()
Performs the track finding.
Double_t getZParabolaLine() const
const UInt_t fMinPeakHeightZxLineBehindDipole
Minimum required height for peaks in Hough spaces.
void SetZxParabola(const PndFtsHoughTracklet zxParabola)
void FindZyLineMatchingToLineParabolaLineInZx()
void SetZyLine(const PndFtsHoughTracklet zyLine)
Interface between PandaRoot (data input and output) and PndFtsHoughTrackFinder (implementation of PR ...
ClassImp(PndFtsHoughTrackFinder)
Double_t getZLineParabola() const
PndFtsHoughTrackFinderParams fParams
void SetZxLineBeforeDipole(const PndFtsHoughTracklet zxLineParabola)
Double_t getParabolaQDivPzxArgMax() const
Bool_t LineBehindDipoleMatchesToLinePlusParabola(const PndFtsHoughTrackCand &lineParabola, const PndFtsHoughTracklet &lineBehindDipole) const
PndFtsHoughTrackerTask * fTrackerTask
Task which handles PandaRoot input/output and provides settings for FTS PR. Has to be set using the c...
Bool_t FilterTrackletsBasedOnSharedHits(UInt_t maxAcceptableSharedHits, std::vector< PndFtsHoughTracklet > &tracklets)
Filters a vector of tracklets based on the number of shared hits.
Double_t getParabolaHwScan() const
const UInt_t fMinPeakHeightZyLine
zy line
std::vector< PndFtsHoughTracklet > FindLinesBehindDipoleZx()
std::vector< PndFtsHoughTracklet > FindAllPeaksScanPathsMergeBins(const UInt_t minHeight)
Finds all peaks that satisfy the minimum height requirement minHeight.
Int_t GetNFtsHits() const
Returns the event number.
Class for saving the result of one Hough transform for FTS PR.
const UInt_t fMinPeakHeightZxParabola
Minimum required height for peaks in Hough spaces.
std::vector< PndFtsHoughTrackCand > fHoughTrackCandsZxPlaneOnly
For internal storing of track cands. (zx plane track model only)
Int_t fNLinesBehindDipoleFound
Double_t getParabolaStepsPerThetaDeg() const
Implementation of the Hough transform based FTS PR. Creates Hough spaces, finds peaks (=tracklets) an...
UInt_t getNSharedHits(const PndFtsHoughTracklet &rhs)
Class for Hough space based on TH2S (for the moment). Saves the hits which enter this Hough space and...
FairLogger * fLogger
Returns pointer to the B field.
Double_t getPeakHeightFromPeakFinder() const
static const Double_t fThetaRadLineBehindDipoleMatchesToParabolaIfBelow
Minimum required height for peaks in Hough spaces.
void SetZxLineBehindDipole(const PndFtsHoughTracklet zxParabolaLine)
const UInt_t fMinPeakHeightZxLineBeforeDipole
Minimum required height for peaks in Hough spaces.
PndFtsHoughTrackFinder(PndFtsHoughTrackerTask *trackerTask)
Set pointer to tracker task (super important as it provides an I/O interface to PandaRoot) ...
Helper class for Hough space containing binning. Created: 09.02.2015.
Class for saving a FTS track cand. for Hough transform based FTS PR.
UInt_t GetEventNr() const
Returns the save debug flag.
std::vector< PndFtsHoughTracklet > FindLinesBeforeDipoleZx()
Int_t getParabolaNBinsPzxInv() const
void FindMatchingParabolaToLineBeforeDipoleZxAndAddLineBehindDipole(const std::vector< PndFtsHoughTracklet > &trackletsLineBeforeDipole, const std::vector< PndFtsHoughTracklet > &trackletsLineBehindDipole)
std::vector< PndFtsHoughTrackCand > fHoughTrackCandsComplete
For internal storing of complete track cands.
Int_t fNLinesBeforeDipoleFound
void FillHoughSpace()
Fills the Hough space using the equation which corresponds to the name of the Hough space...