26 m_neighbourJetFinders(2),
28 m_gotNeighbourPointers(
false),
29 m_gotJetFinderParams(
false),
30 m_gotJetEtCalLuts(
false),
31 m_gotChannelMask(
false),
39 m_useImprovedTauAlgo(
false),
40 m_ignoreTauVetoBitsForIsolation(
false),
41 m_tauIsolationThreshold(0),
42 m_HttSumJetThreshold(0),
43 m_HtmSumJetThreshold(0),
48 m_inputRegions(MAX_REGIONS_IN),
49 m_sentProtoJets(MAX_JETS_OUT),
50 m_rcvdProtoJets(MAX_JETS_OUT),
51 m_keptProtoJets(MAX_JETS_OUT),
52 m_outputJets(MAX_JETS_OUT),
53 m_sortedJets(MAX_JETS_OUT),
55 m_outputJetsPipe(MAX_JETS_OUT),
67 edm::LogWarning(
"L1GctSetupError") <<
"L1GctJetFinderBase::L1GctJetFinderBase() : Jet Finder ID " <<
m_id
68 <<
" has been incorrectly constructed!\n"
69 <<
"ID number should be between the range of 0 to "
82 if (neighbours.size() == 2) {
87 edm::LogWarning(
"L1GctSetupError") <<
"L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " <<
m_id
88 <<
" size of input vector should be 2, but is in fact " << neighbours.size()
95 edm::LogWarning(
"L1GctSetupError") <<
"L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " <<
m_id
96 <<
" first neighbour pointer is set to zero\n";
102 edm::LogWarning(
"L1GctSetupError") <<
"L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " <<
m_id
103 <<
" second neighbour pointer is set to zero\n";
107 edm::LogError(
"L1GctSetupError") <<
"Jet Finder ID " <<
m_id <<
" has incorrect assignment of neighbour pointers";
131 bool matchCheckEttAndEtm =
true;
132 if (chmask !=
nullptr) {
134 for (
unsigned ieta = 0; ieta < N_ETA; ++ieta) {
143 if (!matchCheckEttAndEtm)
145 <<
"L1GctJetFinderBase::setEnergySumMasks() : In Jet Finder ID " <<
m_id
146 <<
" setting eta-dependent masks for Et sums: you cannot have different masks for total and missing Et\n";
153 os <<
"ID = " << algo.
m_id << endl;
154 os <<
"Calibration lut pointers stored for " << algo.
m_jetEtCalLuts.size() <<
" eta bins" << endl;
155 for (
unsigned ieta = 0; ieta < algo.
m_jetEtCalLuts.size(); ieta++) {
156 os <<
"Eta bin " << ieta <<
", JetEtCalibrationLut* = " << algo.
m_jetEtCalLuts.at(ieta) << endl;
158 os <<
"No of input regions " << algo.
m_inputRegions.size() << endl;
163 os <<
"No of output jets " << algo.
m_outputJets.size() << endl;
168 os <<
"Output total scalar Et " << algo.
m_outputEtSum << endl;
169 os <<
"Output vector Et x component " << algo.
m_outputExSum << endl;
170 os <<
"Output vector Et y component " << algo.
m_outputEySum << endl;
171 os <<
"Output total scalar Ht " << algo.
m_outputHtSum << endl;
172 os <<
"Output vector Ht x component " << algo.
m_outputHxSum << endl;
173 os <<
"Output vector Ht y component " << algo.
m_outputHySum << endl;
244 unsigned colAbsolute = (crate + 1) * 2 + region.
rctPhi();
245 unsigned colRelative = ((colAbsolute + NPHI) -
m_minColThisJf) % NPHI;
246 if (colRelative < this->
nCols()) {
254 if (region.
rctEta() < N_00) {
264 std::vector<L1GctInternJetData>
result;
281 std::vector<L1GctInternEtSum>
result;
285 static_cast<int16_t
>(
bx -
bxMin())));
288 static_cast<int16_t
>(
bx -
bxMin())));
291 static_cast<int16_t
>(
bx -
bxMin())));
294 static_cast<int16_t
>(
bx -
bxMin())));
300 std::vector<L1GctInternHtMiss>
result;
306 static_cast<int16_t
>(
bx -
bxMin())));
323 static const unsigned int MAX_TOPBOT_JETS =
MAX_JETS_OUT / 2;
327 for (; j < MAX_TOPBOT_JETS; ++
j) {
389 unsigned xfact0 = (4 *
m_id + 6) % 36;
390 unsigned xfact1 = (4 *
m_id + 8) % 36;
391 unsigned yfact0 = (4 *
m_id + 15) % 36;
392 unsigned yfact1 = (4 *
m_id + 17) % 36;
396 m_outputExSum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternEtSum::kJetMissEtNBits>(
397 etStrip0, xfact0, etStrip1, xfact1);
398 m_outputEySum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternEtSum::kJetMissEtNBits>(
399 etStrip0, yfact0, etStrip1, yfact1);
443 unsigned xfact0 = (4 *
m_id + 10) % 36;
444 unsigned xfact1 = (4 *
m_id + 4) % 36;
445 unsigned yfact0 = (4 *
m_id + 19) % 36;
446 unsigned yfact1 = (4 *
m_id + 13) % 36;
448 m_outputHxSum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternHtMiss::kJetMissHtNBits>(
449 htStrip0, xfact0, htStrip1, xfact1);
450 m_outputHySum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternHtMiss::kJetMissHtNBits>(
451 htStrip0, yfact0, htStrip1, yfact1);
456 m_outputHySum.setOverFlow(htmOverFlow);
465 static const UShort NUMBER_OF_FRWRD_RINGS = 4;
466 static const UShort NUMBER_OF_INNER_RINGS = 2;
467 std::vector<unsigned> et(NUMBER_OF_INNER_RINGS, 0);
468 std::vector<bool>
of(NUMBER_OF_INNER_RINGS,
false);
469 std::vector<unsigned>
nt(NUMBER_OF_INNER_RINGS, 0);
472 for (
UShort i = 0;
i < NUMBER_OF_FRWRD_RINGS; ++
i) {
476 if (
i < NUMBER_OF_INNER_RINGS) {
490 temp.etSum0.setOverFlow(
temp.etSum0.overFlow() || of.at(0));
491 temp.etSum1.setOverFlow(
temp.etSum1.overFlow() || of.at(1));
499 template <
int kBitsInput,
int kBitsOutput>
502 const unsigned& fact0,
504 const unsigned& fact1) {
521 static const int internalComponentSize = 15;
522 static const int maxEt = 1 << internalComponentSize;
524 static const int kBitsFactor = internalComponentSize + kBitsInput + 1;
525 static const int maxFactor = 1 << kBitsFactor;
527 static const int bitsToShift = internalComponentSize - 2;
528 static const int halfInputLsb = 1 << (bitsToShift - 1);
533 const int factors[19] = {maxFactor - 16383,
553 int rotatedValue0, rotatedValue1, myFact;
554 int etComponentSum = 0;
556 if (fact0 >= 36 || fact1 >= 36) {
558 edm::LogError(
"L1GctProcessingError") <<
"L1GctJetLeafCard::rotateEtValue() has been called with factor numbers "
559 << fact0 <<
" and " << fact1 <<
"; should be less than 36 \n";
564 myFact = factors[(36 - fact0)];
566 myFact = factors[fact0];
570 rotatedValue0 =
static_cast<int>(etStrip0.
value()) * myFact;
574 myFact = factors[(36 - fact1)];
576 myFact = factors[fact1];
580 rotatedValue1 =
static_cast<int>(etStrip1.
value()) * myFact;
588 etComponentSum = ((rotatedValue0 + rotatedValue1) + halfInputLsb) >> bitsToShift;
590 etComponentSum = etComponentSum & (maxEt - 1);
591 if (etComponentSum >= (maxEt / 2)) {
592 etComponentSum = etComponentSum - maxEt;
597 OutputType
temp(etComponentSum);
598 temp.setOverFlow(temp.overFlow() || etStrip0.
overFlow() || etStrip1.
overFlow());
605 L1GctJetFinderBase::etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternEtSum::kJetMissEtNBits>(
610 L1GctJetFinderBase::etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternHtMiss::kJetMissHtNBits>(
bool m_idInRange
Remember whether range check on the input ID was ok.
bool overFlow() const
access overflow
void setOverFlow(bool oflow)
set the overflow bit
void reset()
complete reset of processor
etTotalType m_outputEtSum
output Et strip sums and Ht - refactored
static const unsigned int MAX_JETS_OUT
Max of 6 jets found per jetfinder in a 2*11 search area.
std::vector< L1GctJetCand > JetVector
void doEtSums()
Calculates scalar and vector sum of Et over input regions.
void setOverFlow(bool oflow)
set the overflow bit
RegionsVector m_sentProtoJets
List of pre-clustered jets to be sent to neighbour after the first stage of clustering.
htCompInternJfType m_outputHySum
static L1GctInternEtSum fromEmulatorJetTotEt(unsigned totEt, bool overFlow, int16_t bx)
Emulator constructors.
hfTowerSumsType calcHfSums() const
Calculates Et sum and number of towers over threshold in Hf.
unsigned rctEta() const
get local eta index (within RCT crate)
unsigned rctCrate() const
get RCT crate ID
void store(const T &thisBx, const int bxNum)
bool m_verbose
Flag to control output messages.
~L1GctJetFinderBase() override
unsigned getCenJetEtSeedGct() const
unsigned getTauJetEtSeedGct() const
std::vector< L1GctInternHtMiss > getInternalHtMiss() const
bool m_gotChannelMask
Remember whether channel mask have been stored.
Gct version of a calorimeter region, used within GCT emulation.
void setBx(int16_t bx)
set bx
bool totalHtMask(unsigned ieta) const
int bxMin() const
Support for multiple beam crossing operation.
void setNeighbourJetFinders(const std::vector< L1GctJetFinderBase * > &neighbours)
Set pointers to neighbours - needed to complete the setup.
bool missingHtMask(unsigned ieta) const
fetchType
different ways of getting the neighbour data
htCompInternJfType m_outputHxSum
Log< level::Error, false > LogError
std::ostream & operator<<(std::ostream &out, const ALILine &li)
unsigned getTauIsoEtThresholdGct() const
Pipeline< etTotalType > m_outputEtSumPipe
"Pipeline memories" for energy sums
L1GctJetFinderBase(int id)
id is 0-8 for -ve Eta jetfinders, 9-17 for +ve Eta, for increasing Phi.
A Level-1 jet candidate, used within GCT emulation.
void setBx(const int16_t bx)
virtual unsigned centralCol0() const
JetVector getSortedJets() const
Base class to allow implementation of jetFinder algorithms.
static L1GctRegion makeJfInputRegion(const L1CaloRegion &)
ABC for a GCT trigger data processing unit.
static L1GctInternEtSum fromEmulatorJetTotHt(unsigned totHt, bool overFlow, int16_t bx)
unsigned value() const
access value as unsigned
unsigned getMHtJetEtThresholdGct() const
L1GctTwosComplement< kBitsOutput > etComponentForJetFinder(const L1GctUnsignedInt< kBitsInput > &etStrip0, const unsigned &fact0, const L1GctUnsignedInt< kBitsInput > &etStrip1, const unsigned &fact1)
Private method for calculating MEt and MHt components.
bool m_gotNeighbourPointers
Remember whether the neighbour pointers have been stored.
Pipeline< etHadType > m_outputHtSumPipe
std::vector< L1GctInternJetData > getInternalJets() const
get output jets in raw format - to be stored in the event
void doHtSums()
Calculates scalar and vector sum of Ht over calibrated jets.
Definition of signed integer types with overflow.
static L1GctInternHtMiss emulatorJetMissHt(const int htx, const int hty, const bool overFlow, const int16_t bx)
Named ctor for making missing Ht x & y components object from emulator (jetFinder output)...
void sortJets()
Sort the found jets. All jetFinders should call this in process().
std::vector< L1GctInternEtSum > getInternalEtSums() const
get et sums in raw format - to be stored in the event
unsigned m_tauIsolationThreshold
unsigned rctPhi() const
get local phi index (within RCT crate)
void setJetEtCalibrationLuts(const lutPtrVector &jfluts)
Set pointer to calibration Lut - needed to complete the setup.
lutPtrVector m_jetEtCalLuts
Jet Et Conversion LUT pointer.
std::vector< L1GctJetFinderBase * > m_neighbourJetFinders
Store neighbour pointers.
static const unsigned int N_EXTRA_REGIONS_ETA00
Number of additional regions to process on the "wrong" side of eta=0 (determines COL_OFFSET) ...
void setupObjects() override
Initialise inputs with null objects for the correct bunch crossing if required.
unsigned short int UShort
static const unsigned int CENTRAL_COL0
RegionsVector m_keptProtoJets
List of pre-clustered jets retained locally as input to the final clustering.
static const unsigned int MAX_REGIONS_IN
The real jetFinders must define these constants.
void resetProcessor() override
Separate reset methods for the processor itself and any data stored in pipelines. ...
static const unsigned int COL_OFFSET
The index offset between columns.
RawJetVector m_outputJets
output jets
void setJetFinderParams(const L1GctJetFinderParams *jfpars)
Set pointer to parameters - needed to complete the setup.
RegionsVector m_inputRegions
static const unsigned NUMBER_ETA_VALUES
Number of eta bins used in correction.
RawJetPipeline m_outputJetsPipe
Output jets "pipeline memory" for checking.
static L1GctInternJetData fromEmulator(L1CaloRegionDetId rgn, int16_t bx, uint16_t et, bool overFlow, bool tauVeto, uint8_t eta, uint8_t phi, uint16_t rank)
unsigned m_HtmSumJetThreshold
void reset(const unsigned nBx)
unsigned getCenForJetEtaBoundary() const
void setInputRegion(const L1CaloRegion ®ion)
Set input data.
virtual unsigned nCols() const
void resetPipelines() override
void setEnergySumMasks(const L1GctChannelMask *chmask)
Set masks for energy summing.
std::vector< lutPtr > lutPtrVector
void fetchProtoJetsFromNeighbour(const fetchType ft)
fetch the protoJets from neighbour jetFinder
unsigned getHtJetEtThresholdGct() const
bool totalEtMask(unsigned ieta) const
etCompInternJfType m_outputEySum
Pipeline< etCompInternJfType > m_outputExSumPipe
void setValue(unsigned value)
Set value from unsigned.
unsigned getForJetEtSeedGct() const
bool m_gotJetFinderParams
Remember whether jetfinder parameters have been stored.
A calorimeter trigger region (sum of 4x4 trigger towers)
virtual unsigned maxRegionsIn() const
static L1GctInternEtSum fromEmulatorJetMissEt(int missEtxOrEty, bool overFlow, int16_t bx)
Pipeline< htCompInternJfType > m_outputHySumPipe
static const unsigned N_PHI
unsigned m_minColThisJf
parameter to determine which Regions belong in our acceptance
Log< level::Warning, false > LogWarning
bool overFlow() const
access overflow
RegionsVector m_rcvdProtoJets
List of pre-clustered jets received from neighbour before the final stage of clustering.
static const unsigned int N_COLS
std::vector< T > contents
std::vector< L1GctRegion > RegionsVector
etCompInternJfType m_outputExSum
bool missingEtMask(unsigned ieta) const
bool m_gotJetEtCalLuts
Remember whether jet Et calibration Lut pointers have been stored.
Pipeline< etCompInternJfType > m_outputEySumPipe
void doEnergySums()
Fill the Et strip sums and Ht sum. All jetFinders should call this in process().
hfTowerSumsType m_outputHfSums
static const unsigned int N_JF_PER_WHEEL
No of jetFinders per Wheel.
Pipeline< htCompInternJfType > m_outputHxSumPipe
unsigned m_HttSumJetThreshold