ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimOverlapRemovalTool.cxx File Reference
#include "../FPGATrackSimAlgorithms/FPGATrackSimOverlapRemovalTool.h"
#include "FPGATrackSimMaps/FPGATrackSimPlaneMap.h"
#include "FPGATrackSimObjects/FPGATrackSimVectors.h"
#include "GaudiKernel/MsgStream.h"
#include <sstream>
#include <iostream>
#include <fstream>
Include dependency graph for FPGATrackSimOverlapRemovalTool.cxx:

Go to the source code of this file.

Functions

bool isLocalMax (vector2D< FPGATrackSimRoad * > const &acc, unsigned x, unsigned y, int localMaxWindowSize)

Function Documentation

◆ isLocalMax()

bool isLocalMax ( vector2D< FPGATrackSimRoad * > const & acc,
unsigned x,
unsigned y,
int localMaxWindowSize )

Definition at line 43 of file FPGATrackSimOverlapRemovalTool.cxx.

44{
45 if (!localMaxWindowSize) return true;
46 if (!acc(y, x)) return false;
47 for (int j = -localMaxWindowSize; j <= localMaxWindowSize; j++)
48 for (int i = -localMaxWindowSize; i <= localMaxWindowSize; i++)
49 {
50 if (i == 0 && j == 0) continue;
51 if (y + j < acc.size(0) && x + i < acc.size(1))
52 {
53 if (!acc(y+j, x+i)) continue;
54 if (acc(y+j, x+i)->getNHitLayers() > acc(y, x)->getNHitLayers()) return false;
55 if (acc(y+j, x+i)->getNHitLayers() == acc(y, x)->getNHitLayers())
56 {
57 if (acc(y+j, x+i)->getNHits() > acc(y, x)->getNHits()) return false;
58 if (acc(y+j, x+i)->getNHits() == acc(y, x)->getNHits() && j <= 0 && i <= 0) return false;
59 }
60 }
61 }
62
63 return true;
64}
#define y
#define x