26 m_neighbourJetFinders(2),
28 m_gotNeighbourPointers(
false),
29 m_gotJetFinderParams(
false),
30 m_gotJetEtCalLuts(
false),
31 m_CenJetSeed(0), m_FwdJetSeed(0), m_TauJetSeed(0), m_EtaBoundry(0),
33 m_inputRegions(MAX_REGIONS_IN),
34 m_sentProtoJets(MAX_JETS_OUT), m_rcvdProtoJets(MAX_JETS_OUT), m_keptProtoJets(MAX_JETS_OUT),
35 m_outputJets(MAX_JETS_OUT), m_sortedJets(MAX_JETS_OUT),
36 m_HttSumJetThreshold(0), m_HtmSumJetThreshold(0),
38 m_outputJetsPipe(MAX_JETS_OUT),
39 m_outputEtSumPipe(), m_outputExSumPipe(), m_outputEySumPipe(),
40 m_outputHtSumPipe(), m_outputHxSumPipe(), m_outputHySumPipe()
49 <<
"L1GctJetFinderBase::L1GctJetFinderBase() : Jet Finder ID " <<
m_id <<
" has been incorrectly constructed!\n"
64 if (neighbours.size()==2) {
70 <<
"L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " <<
m_id
71 <<
" size of input vector should be 2, but is in fact " << neighbours.size() <<
"\n";
78 <<
"L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " <<
m_id
79 <<
" first neighbour pointer is set to zero\n";
86 <<
"L1GctJetFinderBase::setNeighbourJetFinders() : In Jet Finder ID " <<
m_id
87 <<
" second neighbour pointer is set to zero\n";
91 edm::LogError(
"L1GctSetupError") <<
"Jet Finder ID " <<
m_id <<
" has incorrect assignment of neighbour pointers";
118 os <<
"ID = " << algo.
m_id << endl;
119 os <<
"Calibration lut pointers stored for " << algo.
m_jetEtCalLuts.size() <<
" eta bins" << endl;
121 os <<
"Eta bin " << ieta <<
", JetEtCalibrationLut* = " << algo.
m_jetEtCalLuts.at(ieta) << endl;
123 os <<
"No of input regions " << algo.
m_inputRegions.size() << endl;
128 os <<
"No of output jets " << algo.
m_outputJets.size() << endl;
133 os <<
"Output total scalar Et " << algo.
m_outputEtSum << endl;
134 os <<
"Output vector Et x component " << algo.
m_outputExSum << endl;
135 os <<
"Output vector Et y component " << algo.
m_outputEySum << endl;
136 os <<
"Output total scalar Ht " << algo.
m_outputHtSum << endl;
137 os <<
"Output vector Ht x component " << algo.
m_outputHxSum << endl;
138 os <<
"Output vector Ht y component " << algo.
m_outputHySum << endl;
214 unsigned colAbsolute = (crate+1)*2 + region.
rctPhi();
215 unsigned colRelative = ((colAbsolute+NPHI) -
m_minColThisJf) % NPHI;
216 if (colRelative < this->
nCols()) {
224 if (region.
rctEta() < N_00) {
235 std::vector< L1GctInternJetData >
result;
254 std::vector< L1GctInternEtSum >
result;
255 for (
int bx=0; bx<
numOfBx(); bx++) {
258 static_cast<int16_t
> (bx-
bxMin()) ) );
261 static_cast<int16_t
> (bx-
bxMin()) ) );
264 static_cast<int16_t
> (bx-
bxMin()) ) );
267 static_cast<int16_t
> (bx-
bxMin()) ) );
274 std::vector< L1GctInternHtMiss >
result;
275 for (
int bx=0; bx<
numOfBx(); bx++) {
279 static_cast<int16_t
> (bx-
bxMin()) ) );
297 static const unsigned int MAX_TOPBOT_JETS =
MAX_JETS_OUT/2;
301 for ( ; j<MAX_TOPBOT_JETS; ++
j) {
363 unsigned xfact0 = (4*
m_id + 6) % 36;
364 unsigned xfact1 = (4*
m_id + 8) % 36;
365 unsigned yfact0 = (4*
m_id + 15) % 36;
366 unsigned yfact1 = (4*
m_id + 17) % 36;
369 m_outputExSum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternEtSum::kJetMissEtNBits>
370 (etStrip0, xfact0, etStrip1, xfact1);
371 m_outputEySum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternEtSum::kJetMissEtNBits>
372 (etStrip0, yfact0, etStrip1, yfact1);
416 unsigned xfact0 = (4*
m_id + 10) % 36;
417 unsigned xfact1 = (4*
m_id + 4) % 36;
418 unsigned yfact0 = (4*
m_id + 19) % 36;
419 unsigned yfact1 = (4*
m_id + 13) % 36;
421 m_outputHxSum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternHtMiss::kJetMissHtNBits>
422 (htStrip0, xfact0, htStrip1, xfact1);
423 m_outputHySum = etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternHtMiss::kJetMissHtNBits>
424 (htStrip0, yfact0, htStrip1, yfact1);
429 m_outputHySum.setOverFlow(htmOverFlow);
440 static const UShort NUMBER_OF_FRWRD_RINGS = 4;
441 static const UShort NUMBER_OF_INNER_RINGS = 2;
442 std::vector<unsigned>
et(NUMBER_OF_INNER_RINGS, 0);
443 std::vector<bool> of(NUMBER_OF_INNER_RINGS,
false);
444 std::vector<unsigned>
nt(NUMBER_OF_INNER_RINGS, 0);
447 for (
UShort i=0;
i < NUMBER_OF_FRWRD_RINGS; ++
i) {
451 if (
i<NUMBER_OF_INNER_RINGS) {
463 temp.etSum0.setOverFlow(
temp.etSum0.overFlow() || of.at(0));
464 temp.etSum1.setOverFlow(
temp.etSum1.overFlow() || of.at(1));
473 template <
int kBitsInput,
int kBitsOutput>
494 static const int internalComponentSize = 15;
495 static const int maxEt = 1<<internalComponentSize;
497 static const int kBitsFactor = internalComponentSize+kBitsInput+1;
498 static const int maxFactor = 1<<kBitsFactor;
500 static const int bitsToShift = internalComponentSize-2;
501 static const int halfInputLsb = 1<<(bitsToShift-1);
506 const int factors[19] = {maxFactor-16383, maxFactor-16134, maxFactor-15395, maxFactor-14188, maxFactor-12550,
507 maxFactor-10531, maxFactor-8192, maxFactor-5603, maxFactor-2845, 0,
508 2845, 5603, 8192, 10531, 12550, 14188, 15395, 16134, 16383};
510 int rotatedValue0, rotatedValue1, myFact;
511 int etComponentSum = 0;
513 if (fact0 >= 36 || fact1 >= 36) {
516 <<
"L1GctJetLeafCard::rotateEtValue() has been called with factor numbers "
517 << fact0 <<
" and " << fact1 <<
"; should be less than 36 \n";
522 if (fact0>18) { myFact = factors[(36-fact0)]; }
523 else { myFact = factors[fact0]; }
526 rotatedValue0 =
static_cast<int>(etStrip0.
value()) * myFact;
529 if (fact1>18) { myFact = factors[(36-fact1)]; }
530 else { myFact = factors[fact1]; }
533 rotatedValue1 =
static_cast<int>(etStrip1.
value()) * myFact;
541 etComponentSum = ((rotatedValue0 + rotatedValue1) + halfInputLsb)>>bitsToShift;
543 etComponentSum = etComponentSum & (maxEt-1);
544 if (etComponentSum >= (maxEt/2)) {
545 etComponentSum = etComponentSum - maxEt;
550 OutputType
temp(etComponentSum);
551 temp.setOverFlow(temp.overFlow() || etStrip0.
overFlow() || etStrip1.
overFlow());
559 L1GctJetFinderBase::etComponentForJetFinder<L1GctInternEtSum::kTotEtOrHtNBits,L1GctInternEtSum::kJetMissEtNBits>
566 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
bool m_verbose
Flag to control output messages.
unsigned getCenJetEtSeedGct() const
unsigned getTauJetEtSeedGct() const
std::vector< L1GctInternHtMiss > getInternalHtMiss() const
Gct version of a calorimeter region, used within GCT emulation.
void setBx(int16_t bx)
set bx
Pipeline< etCompInternJfType > m_outputExSumPipe
virtual void resetPipelines()
int bxMin() const
Support for multiple beam crossing operation.
fetchType
different ways of getting the neighbour data
htCompInternJfType m_outputHxSum
std::ostream & operator<<(std::ostream &out, const ALILine &li)
virtual void setupObjects()
Initialise inputs with null objects for the correct bunch crossing if required.
unsigned getTauIsoEtThresholdGct() const
Pipeline< htCompInternJfType > m_outputHySumPipe
Pipeline< htCompInternJfType > m_outputHxSumPipe
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 setNeighbourJetFinders(std::vector< L1GctJetFinderBase * > neighbours)
Set pointers to neighbours - needed to complete the setup.
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.
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.
Pipeline< etHadType > m_outputHtSumPipe
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
static const unsigned int CENTRAL_COL0
RegionsVector m_keptProtoJets
List of pre-clustered jets retained locally as input to the final clustering.
unsigned int offset(bool)
static const unsigned int MAX_REGIONS_IN
The real jetFinders must define these constants.
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
input data required for jet finding
static const unsigned NUMBER_ETA_VALUES
Number of eta bins used in correction.
Pipeline< etCompInternJfType > m_outputEySumPipe
RawJetPipeline m_outputJetsPipe
Output jets "pipeline memory" for checking.
virtual void resetProcessor()
Separate reset methods for the processor itself and any data stored in pipelines. ...
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
unsigned getCenForJetEtaBoundary() const
void setInputRegion(const L1CaloRegion ®ion)
Set input data.
unsigned m_CenJetSeed
jetFinder parameters (from EventSetup)
static const unsigned N_PHI
virtual unsigned nCols() const
std::vector< lutPtr > lutPtrVector
void fetchProtoJetsFromNeighbour(const fetchType ft)
fetch the protoJets from neighbour jetFinder
unsigned getHtJetEtThresholdGct() const
etCompInternJfType m_outputEySum
void setValue(unsigned value)
Set value from unsigned.
Pipeline< etTotalType > m_outputEtSumPipe
"Pipeline memories" for energy sums
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)
unsigned m_minColThisJf
parameter to determine which Regions belong in our acceptance
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< L1GctRegion > RegionsVector
etCompInternJfType m_outputExSum
bool m_gotJetEtCalLuts
Remember whether jet Et calibration Lut pointers have been stored.
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.
unsigned m_HttSumJetThreshold