11 m_localMaxima (MAX_JETS_OUT),
12 m_clusters (MAX_JETS_OUT),
13 m_numberOfClusters(0),
30 os <<
"===L1GctHardwareJetFinder===" << std::endl;
86 for(
UShort column = 0; column <2; ++column)
103 if (row < (COL_OFFSET-1)) {
109 if (row < (COL_OFFSET-1)) {
115 if (row < (COL_OFFSET-1)) {
121 if (row < (COL_OFFSET-1)) {
127 if (row < (COL_OFFSET-1)) {
133 if (row < (COL_OFFSET-1)) {
171 unsigned numberOfTopJets=0, numberOfBotJets=0;
180 topJets.at(numberOfTopJets) =
temp;
181 topJetsPosition.at(numberOfTopJets) = 0;
182 for (
unsigned k=0;
k<numberOfTopJets; ++
k) {
183 if (topJets.at(numberOfTopJets).et() >= topJets.at(
k).et()) { ++topJetsPosition.at(
k); }
184 if (topJets.at(numberOfTopJets).et() <= topJets.at(
k).et()) { ++topJetsPosition.at(numberOfTopJets); }
189 botJets.at(numberOfBotJets) =
temp;
190 botJetsPosition.at(numberOfBotJets) = 0;
191 for (
unsigned k=0;
k<numberOfBotJets; ++
k) {
192 if (botJets.at(numberOfBotJets).et() >= botJets.at(
k).et()) { ++botJetsPosition.at(
k); }
193 if (botJets.at(numberOfBotJets).et() <= botJets.at(
k).et()) { ++botJetsPosition.at(numberOfBotJets); }
204 static const unsigned int MAX_TOPBOT_JETS =
MAX_JETS_OUT/2;
206 for (
unsigned j=0;
j<numberOfBotJets; ++
j) {
207 if (botJetsPosition.at(
j)<MAX_TOPBOT_JETS) {
212 for (
unsigned j=0;
j<numberOfTopJets; ++
j) {
213 if (topJetsPosition.at(
j)<MAX_TOPBOT_JETS) {
227 int16_t bx = localMax.
bx();
229 unsigned localEta = localMax.
rctEta();
230 unsigned localPhi = localMax.
rctPhi();
232 unsigned etCluster = 0;
233 bool ovrFlowOr =
false;
234 bool tauVetoOr =
false;
235 unsigned rgnsAboveIsoThreshold = 0;
242 unsigned rowStart, rowEnd, rowMid;
245 if (localEta > row0 - 1) {
249 rowStart = row0 - 1 - localEta;
250 rowMid = rowStart + 1;
252 if (localEta > row0 + 2) {
255 rowEnd = row0 + 2 - localEta;
258 rowStart = row0 + localEta;
259 rowMid = rowStart + 1;
261 rowEnd = rowStart + 3;
267 for (
unsigned row=rowStart; row<rowEnd; ++row) {
268 for (
unsigned column=0; column<2; ++column) {
294 if (!((row==rowMid) && (column==localPhi))) {
297 rgnsAboveIsoThreshold++;
312 bool tauFeatureBit =
false;
314 tauVetoOr |= (rgnsAboveIsoThreshold > 1);
315 tauFeatureBit |= (rgnsAboveIsoThreshold == 1);
337 if (et0>=JET_THRESHOLD) {
342 unsigned neighbourEt=
m_cluster00.at(1-localPhi0).et();
343 isolated &= et0 >= neighbourEt;
354 bool distantJet = ((localPhi0==localPhi1) ||
355 (localEta1 > localEta0+1) || (localEta0 > localEta1+1));
357 isolated &= distantJet;
358 storeJet |= !distantJet && ((et0 > et1) || ((et0 == et1) && localPhi0==1));
363 storeJet |= isolated;
367 unsigned etCluster = et0;
370 unsigned rgnsAboveIsoThreshold = (
m_rcvdProtoJets.at(
j).featureBit0() ? 1 : 0);
374 unsigned column=1-localPhi0;
376 unsigned rowStart, rowEnd;
378 rowStart = row0 + localEta0;
380 rowEnd = rowStart + 3;
385 for (
unsigned row=rowStart; row<rowEnd; ++row) {
394 rgnsAboveIsoThreshold++;
410 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.
bool m_positiveEtaWheel
Positive/negative eta flag used in the initial clustering.
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
input data required for jet finding
virtual void fetchInput()
get input data from sources
static const unsigned int N_COLS
virtual void process()
process the data, fill output buffers
unsigned m_CenJetSeed
jetFinder parameters (from EventSetup)
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.