7 #include <unordered_set>
15 const Settings* settings,
unsigned int iPhiSec,
unsigned int iEtaReg,
unsigned int nBinsX,
unsigned int nBinsY)
16 : settings_(settings),
21 htArray_(nBinsX, nBinsY),
22 optoLinkID_(this->calcOptoLinkID()) {}
48 unsigned int nStubs = 0;
63 unordered_set<unsigned int> stubIDs;
69 const vector<Stub*>& vStubs =
htArray_(
i,
j)->stubs();
70 for (
const Stub* stub : vStubs) {
71 stubIDs.insert(stub->index());
76 return stubIDs.size();
82 unsigned int nStubs = 0;
86 nStubs += trk.stubs().size();
96 vector<const L1track2D*> assocRecoTrk;
100 if (trk.matchedTP() !=
nullptr) {
101 if (trk.matchedTP()->index() == tp.
index())
102 assocRecoTrk.push_back(&trk);
123 unsigned int nBinsAxis,
125 float coordAxisBinSize,
126 unsigned int killSomeHTcells)
const {
127 float coordMin = coordRange.first;
128 float coordMax = coordRange.second;
129 float coordAvg = (coordRange.first + coordRange.second) / 2.;
131 int iCoordBinMin, iCoordBinMax;
137 if (killSomeHTcells == 0) {
139 iCoordBinMin = floor((coordMin - coordAxisMin) / coordAxisBinSize);
140 iCoordBinMax = floor((coordMax - coordAxisMin) / coordAxisBinSize);
141 }
else if (killSomeHTcells == 1) {
144 const float fracCut = 0.3;
145 iCoordBinMin = floor((coordMin - coordAxisMin) / coordAxisBinSize);
146 iCoordBinMax = floor((coordMax - coordAxisMin) / coordAxisBinSize);
147 unsigned int nbins = iCoordBinMax - iCoordBinMin + 1;
149 float lower = coordAxisMin + (iCoordBinMin + 1) * coordAxisBinSize;
150 float upper = coordAxisMin + (iCoordBinMax)*coordAxisBinSize;
152 float extraLow = (lower - coordMin) / coordAxisBinSize;
153 float extraUp = (coordMax - upper) / coordAxisBinSize;
154 constexpr
float small = 0.001;
155 if (
min(extraLow, extraUp) < -small ||
max(extraLow, extraUp) > (1.0 + small))
156 throw cms::Exception(
"LogicError") <<
"HTbase: convertCoordRangeToBinRange error";
157 if (extraLow < fracCut && (nbins >= 3 || extraLow < extraUp))
159 if (extraUp < fracCut && (nbins >= 3 || extraUp < extraLow))
162 }
else if (killSomeHTcells == 2) {
164 iCoordBinMin = floor((coordAvg - coordAxisMin) / coordAxisBinSize);
165 iCoordBinMax = iCoordBinMin;
167 throw cms::Exception(
"BadConfig") <<
"HT: invalid KillSomeHTCells option in cfg";
171 iCoordBinMin =
max(iCoordBinMin, 0);
172 iCoordBinMax =
min(iCoordBinMax,
int(nBinsAxis) - 1);
175 if (iCoordBinMin >
int(nBinsAxis) - 1 || iCoordBinMax < 0) {
176 iCoordBinMin = int(nBinsAxis) - 1;
180 return pair<unsigned int, unsigned int>(iCoordBinMin, iCoordBinMax);
192 bool wantOrdering = (not iOrder.empty());
197 unsigned int iPos = wantOrdering ? iOrder[
i] :
i;
200 if (
htArray_(iPos,
j)->trackCandFound()) {
206 const vector<Stub*>& stubs =
htArray_(iPos,
j)->stubs();
209 const pair<unsigned int, unsigned int> cellLocation(iPos,
j);
215 trackCands2D.emplace_back(
virtual std::list< L1track2D > killTracksBusySec(const std::list< L1track2D > &tracks) const =0
unsigned int index() const
virtual std::pair< unsigned int, unsigned int > convertCoordRangeToBinRange(std::pair< float, float > coordRange, unsigned int nBinsAxis, float coordAxisMin, float coordAxisBinSize, unsigned int killSomeHTcells) const
Array2D< std::unique_ptr< HTcell > > htArray_
virtual const std::list< L1track2D > & trackCands2D() const
virtual std::vector< unsigned int > rowOrder(unsigned int numRows) const =0
bool busySectorKill() const
virtual unsigned int numStubsOnTrackCands2D() const
const Settings * settings_
virtual std::vector< const L1track2D * > assocTrackCands2D(const TP &tp) const
virtual unsigned int numStubsExc() const
virtual unsigned int numStubsInc() const
std::list< L1track2D > trackCands2D_
virtual std::list< L1track2D > calcTrackCands2D() const
virtual std::pair< float, float > helix2Dconventional(unsigned int i, unsigned int j) const =0
virtual void disableBendFilter()