|
|
Go to the documentation of this file.
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) {
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;
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;
240 unsigned crate =
region.rctCrate();
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;
305 static_cast<int16_t>(
bx -
bxMin())));
322 static const unsigned int MAX_TOPBOT_JETS =
MAX_JETS_OUT / 2;
326 for (;
j < MAX_TOPBOT_JETS; ++
j) {
388 unsigned xfact0 = (4 *
m_id + 6) % 36;
389 unsigned xfact1 = (4 *
m_id + 8) % 36;
390 unsigned yfact0 = (4 *
m_id + 15) % 36;
391 unsigned yfact1 = (4 *
m_id + 17) % 36;
395 m_outputExSum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternEtSum::kJetMissEtNBits>(
396 etStrip0, xfact0, etStrip1, xfact1);
397 m_outputEySum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternEtSum::kJetMissEtNBits>(
398 etStrip0, yfact0, etStrip1, yfact1);
442 unsigned xfact0 = (4 *
m_id + 10) % 36;
443 unsigned xfact1 = (4 *
m_id + 4) % 36;
444 unsigned yfact0 = (4 *
m_id + 19) % 36;
445 unsigned yfact1 = (4 *
m_id + 13) % 36;
447 m_outputHxSum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternHtMiss::kJetMissHtNBits>(
448 htStrip0, xfact0, htStrip1, xfact1);
449 m_outputHySum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternHtMiss::kJetMissHtNBits>(
450 htStrip0, yfact0, htStrip1, yfact1);
464 static const UShort NUMBER_OF_FRWRD_RINGS = 4;
465 static const UShort NUMBER_OF_INNER_RINGS = 2;
466 std::vector<unsigned>
et(NUMBER_OF_INNER_RINGS, 0);
467 std::vector<bool> of(NUMBER_OF_INNER_RINGS,
false);
468 std::vector<unsigned>
nt(NUMBER_OF_INNER_RINGS, 0);
471 for (
UShort i = 0;
i < NUMBER_OF_FRWRD_RINGS; ++
i) {
475 if (
i < NUMBER_OF_INNER_RINGS) {
489 temp.etSum0.setOverFlow(
temp.etSum0.overFlow() || of.at(0));
490 temp.etSum1.setOverFlow(
temp.etSum1.overFlow() || of.at(1));
498 template <
int kBitsInput,
int kBitsOutput>
501 const unsigned& fact0,
503 const unsigned& fact1) {
520 static const int internalComponentSize = 15;
521 static const int maxEt = 1 << internalComponentSize;
523 static const int kBitsFactor = internalComponentSize + kBitsInput + 1;
524 static const int maxFactor = 1 << kBitsFactor;
526 static const int bitsToShift = internalComponentSize - 2;
527 static const int halfInputLsb = 1 << (bitsToShift - 1);
532 const int factors[19] = {maxFactor - 16383,
552 int rotatedValue0, rotatedValue1, myFact;
553 int etComponentSum = 0;
555 if (fact0 >= 36 || fact1 >= 36) {
557 edm::LogError(
"L1GctProcessingError") <<
"L1GctJetLeafCard::rotateEtValue() has been called with factor numbers "
558 << fact0 <<
" and " << fact1 <<
"; should be less than 36 \n";
563 myFact = factors[(36 - fact0)];
565 myFact = factors[fact0];
569 rotatedValue0 = static_cast<int>(etStrip0.
value()) * myFact;
573 myFact = factors[(36 - fact1)];
575 myFact = factors[fact1];
579 rotatedValue1 = static_cast<int>(etStrip1.
value()) * myFact;
587 etComponentSum = ((rotatedValue0 + rotatedValue1) + halfInputLsb) >> bitsToShift;
589 etComponentSum = etComponentSum & (
maxEt - 1);
590 if (etComponentSum >= (
maxEt / 2)) {
591 etComponentSum = etComponentSum -
maxEt;
596 OutputType
temp(etComponentSum);
604 L1GctJetFinderBase::etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternEtSum::kJetMissEtNBits>(
609 L1GctJetFinderBase::etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits, L1GctInternHtMiss::kJetMissHtNBits>(
static const unsigned int COL_OFFSET
The index offset between columns.
unsigned getCenJetEtSeedGct() const
unsigned short int UShort
std::vector< L1GctRegion > RegionsVector
lutPtrVector m_jetEtCalLuts
Jet Et Conversion LUT pointer.
void setValue(unsigned value)
Set value from unsigned.
htCompInternJfType m_outputHySum
std::vector< L1GctInternJetData > getInternalJets() const
get output jets in raw format - to be stored in the event
static const unsigned int N_EXTRA_REGIONS_ETA00
Number of additional regions to process on the "wrong" side of eta=0 (determines COL_OFFSET)
Pipeline< etCompInternJfType > m_outputEySumPipe
void setBx(int16_t bx)
set bx
RegionsVector m_keptProtoJets
List of pre-clustered jets retained locally as input to the final clustering.
bool m_gotChannelMask
Remember whether channel mask have been stored.
unsigned getTauJetEtSeedGct() const
std::vector< L1GctJetFinderBase * > m_neighbourJetFinders
Store neighbour pointers.
static const unsigned int MAX_REGIONS_IN
The real jetFinders must define these constants.
A calorimeter trigger region (sum of 4x4 trigger towers)
RawJetPipeline m_outputJetsPipe
Output jets "pipeline memory" for checking.
JetVector getSortedJets() const
static const unsigned int MAX_JETS_OUT
Max of 6 jets found per jetfinder in a 2*11 search area.
void setEnergySumMasks(const L1GctChannelMask *chmask)
Set masks for energy summing.
RawJetVector m_outputJets
output jets
Base class to allow implementation of jetFinder algorithms.
void doEtSums()
Calculates scalar and vector sum of Et over input regions.
static L1GctRegion makeJfInputRegion(const L1CaloRegion &)
std::vector< lutPtr > lutPtrVector
void resetPipelines() override
unsigned value() const
access value as unsigned
void setInputRegion(const L1CaloRegion ®ion)
Set input data.
Pipeline< etCompInternJfType > m_outputExSumPipe
virtual unsigned maxRegionsIn() const
Pipeline< etHadType > m_outputHtSumPipe
std::vector< L1GctInternEtSum > getInternalEtSums() const
get et sums in raw format - to be stored in the event
unsigned getTauIsoEtThresholdGct() const
void setBx(const int16_t bx)
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.
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 getCenForJetEtaBoundary() const
static const unsigned int N_COLS
void setNeighbourJetFinders(const std::vector< L1GctJetFinderBase * > &neighbours)
Set pointers to neighbours - needed to complete the setup.
void fetchProtoJetsFromNeighbour(const fetchType ft)
fetch the protoJets from neighbour jetFinder
std::vector< T > contents
RegionsVector m_rcvdProtoJets
List of pre-clustered jets received from neighbour before the final stage of clustering.
bool m_gotJetEtCalLuts
Remember whether jet Et calibration Lut pointers have been stored.
void setupObjects() override
Initialise inputs with null objects for the correct bunch crossing if required.
hfTowerSumsType calcHfSums() const
Calculates Et sum and number of towers over threshold in Hf.
static const unsigned int CENTRAL_COL0
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).
hfTowerSumsType m_outputHfSums
void setJetEtCalibrationLuts(const lutPtrVector &jfluts)
Set pointer to calibration Lut - needed to complete the setup.
bool m_gotNeighbourPointers
Remember whether the neighbour pointers have been stored.
unsigned m_minColThisJf
parameter to determine which Regions belong in our acceptance
Definition of signed integer types with overflow.
void reset()
complete reset of processor
bool totalEtMask(unsigned ieta) const
RegionsVector m_inputRegions
unsigned getForJetEtSeedGct() const
etCompInternJfType m_outputExSum
bool totalHtMask(unsigned ieta) const
bool m_idInRange
Remember whether range check on the input ID was ok.
void setJetFinderParams(const L1GctJetFinderParams *jfpars)
Set pointer to parameters - needed to complete the setup.
void store(const T &thisBx, const int bxNum)
RegionsVector m_sentProtoJets
List of pre-clustered jets to be sent to neighbour after the first stage of clustering.
std::vector< L1GctJetCand > JetVector
void doHtSums()
Calculates scalar and vector sum of Ht over calibrated jets.
Pipeline< htCompInternJfType > m_outputHxSumPipe
unsigned m_HtmSumJetThreshold
bool m_verbose
Flag to control output messages.
~L1GctJetFinderBase() override
int bxMin() const
Support for multiple beam crossing operation.
unsigned getMHtJetEtThresholdGct() const
void resetProcessor() override
Separate reset methods for the processor itself and any data stored in pipelines.
static L1GctInternEtSum fromEmulatorJetMissEt(int missEtxOrEty, bool overFlow, int16_t bx)
static const unsigned N_PHI
bool m_gotJetFinderParams
Remember whether jetfinder parameters have been stored.
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.
std::vector< L1GctInternHtMiss > getInternalHtMiss() const
htCompInternJfType m_outputHxSum
Pipeline< htCompInternJfType > m_outputHySumPipe
bool overFlow() const
access overflow
void setOverFlow(bool oflow)
set the overflow bit
bool overFlow() const
access overflow
Pipeline< etTotalType > m_outputEtSumPipe
"Pipeline memories" for energy sums
bool missingHtMask(unsigned ieta) const
bool missingEtMask(unsigned ieta) const
void doEnergySums()
Fill the Et strip sums and Ht sum. All jetFinders should call this in process().
fetchType
different ways of getting the neighbour data
static const unsigned int N_JF_PER_WHEEL
No of jetFinders per Wheel.
etCompInternJfType m_outputEySum
virtual unsigned nCols() const
void setOverFlow(bool oflow)
set the overflow bit
static L1GctInternEtSum fromEmulatorJetTotHt(unsigned totHt, bool overFlow, int16_t bx)
Gct version of a calorimeter region, used within GCT emulation.
ABC for a GCT trigger data processing unit.
unsigned m_HttSumJetThreshold
unsigned m_tauIsolationThreshold
virtual unsigned centralCol0() const
static const unsigned NUMBER_ETA_VALUES
Number of eta bins used in correction.
etTotalType m_outputEtSum
output Et strip sums and Ht - refactored
void reset(const unsigned nBx)
unsigned getHtJetEtThresholdGct() const
void sortJets()
Sort the found jets. All jetFinders should call this in process().
static L1GctInternEtSum fromEmulatorJetTotEt(unsigned totEt, bool overFlow, int16_t bx)
Emulator constructors.
std::ostream & operator<<(std::ostream &os, const L1GctJetFinderBase &algo)