10 m_localMaxima (MAX_JETS_OUT),
11 m_clusters (MAX_JETS_OUT),
12 m_numberOfClusters(0),
29 os <<
"===L1GctHardwareJetFinder===" << std::endl;
85 for(
UShort column = 0; column <2; ++column)
102 if (row < (COL_OFFSET-1)) {
108 if (row < (COL_OFFSET-1)) {
114 if (row < (COL_OFFSET-1)) {
120 if (row < (COL_OFFSET-1)) {
126 if (row < (COL_OFFSET-1)) {
132 if (row < (COL_OFFSET-1)) {
170 unsigned numberOfTopJets=0, numberOfBotJets=0;
179 topJets.at(numberOfTopJets) =
temp;
180 topJetsPosition.at(numberOfTopJets) = 0;
181 for (
unsigned k=0;
k<numberOfTopJets; ++
k) {
182 if (topJets.at(numberOfTopJets).et() >= topJets.at(
k).et()) { ++topJetsPosition.at(
k); }
183 if (topJets.at(numberOfTopJets).et() <= topJets.at(
k).et()) { ++topJetsPosition.at(numberOfTopJets); }
188 botJets.at(numberOfBotJets) =
temp;
189 botJetsPosition.at(numberOfBotJets) = 0;
190 for (
unsigned k=0;
k<numberOfBotJets; ++
k) {
191 if (botJets.at(numberOfBotJets).et() >= botJets.at(
k).et()) { ++botJetsPosition.at(
k); }
192 if (botJets.at(numberOfBotJets).et() <= botJets.at(
k).et()) { ++botJetsPosition.at(numberOfBotJets); }
203 static const unsigned int MAX_TOPBOT_JETS =
MAX_JETS_OUT/2;
205 for (
unsigned j=0;
j<numberOfBotJets; ++
j) {
206 if (botJetsPosition.at(
j)<MAX_TOPBOT_JETS) {
211 for (
unsigned j=0;
j<numberOfTopJets; ++
j) {
212 if (topJetsPosition.at(
j)<MAX_TOPBOT_JETS) {
226 int16_t bx = localMax.
bx();
228 unsigned localEta = localMax.
rctEta();
229 unsigned localPhi = localMax.
rctPhi();
231 unsigned etCluster = 0;
232 bool ovrFlowOr =
false;
233 bool tauVetoOr =
false;
234 unsigned rgnsAboveIsoThreshold = 0;
241 unsigned rowStart, rowEnd, rowMid;
244 if (localEta > row0 - 1) {
248 rowStart = row0 - 1 - localEta;
249 rowMid = rowStart + 1;
251 if (localEta > row0 + 2) {
254 rowEnd = row0 + 2 - localEta;
257 rowStart = row0 + localEta;
258 rowMid = rowStart + 1;
260 rowEnd = rowStart + 3;
266 for (
unsigned row=rowStart; row<rowEnd; ++row) {
267 for (
unsigned column=0; column<2; ++column) {
293 if (!((row==rowMid) && (column==localPhi))) {
296 rgnsAboveIsoThreshold++;
311 bool tauFeatureBit =
false;
313 tauVetoOr |= (rgnsAboveIsoThreshold > 1);
314 tauFeatureBit |= (rgnsAboveIsoThreshold == 1);
336 if (et0>=JET_THRESHOLD) {
341 unsigned neighbourEt=
m_cluster00.at(1-localPhi0).et();
342 isolated &= et0 >= neighbourEt;
353 bool distantJet = ((localPhi0==localPhi1) ||
354 (localEta1 > localEta0+1) || (localEta0 > localEta1+1));
356 isolated &= distantJet;
357 storeJet |= !distantJet && ((et0 > et1) || ((et0 == et1) && localPhi0==1));
362 storeJet |= isolated;
366 unsigned etCluster = et0;
369 unsigned rgnsAboveIsoThreshold = (
m_rcvdProtoJets.at(
j).featureBit0() ? 1 : 0);
373 unsigned column=1-localPhi0;
375 unsigned rowStart, rowEnd;
377 rowStart = row0 + localEta0;
379 rowEnd = rowStart + 3;
384 for (
unsigned row=rowStart; row<rowEnd; ++row) {
393 rgnsAboveIsoThreshold++;
409 tauVetoOr |= (rgnsAboveIsoThreshold > 1);
void reset()
complete reset of processor
int16_t bx() const
get bunch-crossing index
bool m_ignoreTauVetoBitsForIsolation
unsigned m_numberOfClusters
The number of local Maxima/clusters found at each stage of clustering.
static const unsigned int MAX_JETS_OUT
Max of 6 jets found per jetfinder in a 2*11 search area.
void findFinalClusters()
Convert protojets to final jets.
RegionsVector m_sentProtoJets
List of pre-clustered jets to be sent to neighbour after the first stage of clustering.
void findProtoJets()
The first stage of clustering, called by fetchInput()
void convertClustersToProtoJets()
Organise the pre-clustered jets into the ones we keep and those we send to the neighbour.
void findJets()
The second stage of clustering, called by process()
RegionsVector m_cluster00
static const unsigned int MAX_REGIONS_IN
The real jetFinders must define these constants.
Gct version of a calorimeter region, used within GCT emulation.
bool setupOk() const
Check setup is Ok.
RegionsVector m_clusters
Each local maximum becomes a cluster.
L1GctHardwareJetFinder(int id)
id is 0-8 for -ve Eta jetfinders, 9-17 for +ve Eta, for increasing Phi.
static L1GctRegion makeProtoJetRegion(const unsigned et, const bool overFlow, const bool fineGrain, const bool tauIsolationVeto, const unsigned ieta, const unsigned iphi, const int16_t bx)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
A Level-1 jet candidate, used within GCT emulation.
void findLocalMaxima()
Find local maxima in the search array.
Base class to allow implementation of jetFinder algorithms.
static const unsigned N_ETA
void findProtoClusters()
Convert local maxima to clusters.
void sortJets()
Sort the found jets. All jetFinders should call this in process().
unsigned m_tauIsolationThreshold
static L1GctRegion makeFinalJetRegion(const unsigned et, const bool overFlow, const bool fineGrain, const unsigned ieta, const unsigned iphi, const int16_t bx)
unsigned rctPhi() const
get local phi index (within RCT crate)
static const unsigned int N_EXTRA_REGIONS_ETA00
Number of additional regions to process on the "wrong" side of eta=0 (determines COL_OFFSET) ...
unsigned short int UShort
RegionsVector m_keptProtoJets
List of pre-clustered jets retained locally as input to the final clustering.
~L1GctHardwareJetFinder()
static const unsigned int COL_OFFSET
The index offset between columns.
RawJetVector m_outputJets
output jets
RegionsVector m_inputRegions
virtual void fetchInput()
get input data from sources
static const unsigned int N_COLS
virtual void process()
process the data, fill output buffers
static const unsigned N_PHI
virtual void reset()
include additional reset functionality
unsigned gctEta() const
get GCT eta index
void fetchProtoJetsFromNeighbour(const fetchType ft)
fetch the protoJets from neighbour jetFinder
unsigned gctPhi() const
get GCT phi index
void convertClustersToOutputJets()
Organise the final clustered jets into L1GctJets.
RegionsVector m_localMax00
Emulation of the hardware jet finder.
unsigned m_minColThisJf
parameter to determine which Regions belong in our acceptance
static const unsigned int CENTRAL_COL0
RegionsVector m_rcvdProtoJets
List of pre-clustered jets received from neighbour before the final stage of clustering.
std::vector< L1GctRegion > RegionsVector
bool m_useImprovedTauAlgo
Setup parameters for the tau jet algorithm.
void doEnergySums()
Fill the Et strip sums and Ht sum. All jetFinders should call this in process().
L1GctRegion makeProtoJet(L1GctRegion localMax)
Method to make a single proto-jet.
virtual unsigned centralCol0() const
RegionsVector m_localMaxima
Local vectors used during both stages of clustering.