26 theJetLeafCards(N_JET_LEAF_CARDS),
27 theJetFinders(N_JET_LEAF_CARDS*3),
28 theEmLeafCards(N_EM_LEAF_CARDS),
29 theIsoElectronSorters(N_EM_LEAF_CARDS*2),
30 theNonIsoElectronSorters(N_EM_LEAF_CARDS*2),
31 theWheelJetFpgas(N_WHEEL_CARDS),
32 theWheelEnergyFpgas(N_WHEEL_CARDS),
35 m_inputChannelMask(0),
37 m_bxStart(0), m_numOfBx(1),
38 m_allInputEmCands(), m_allInputRegions()
42 build(jfType, jetLeafMask);
103 for (
int i=0;
i<N_JET_LEAF_CARDS*3;
i++) {
339 theJetLeafCards.at(
i)->getJetFinderA()->setupTauAlgo(useImprovedAlgo, ignoreVetoBitsForIsolation);
340 theJetLeafCards.at(
i)->getJetFinderB()->setupTauAlgo(useImprovedAlgo, ignoreVetoBitsForIsolation);
341 theJetLeafCards.at(
i)->getJetFinderC()->setupTauAlgo(useImprovedAlgo, ignoreVetoBitsForIsolation);
385 for (
int i=0;
i<N_JET_LEAF_CARDS*3;
i++) {
462 if (emc->isolated()) {
480 unsigned prevphi = crate % NPHI;
481 unsigned thisphi = (crate+1) % NPHI;
482 unsigned nextphi = (crate+2) % NPHI;
497 const bool overFlow,
const bool fineGrain)
530 LogInfo(
"L1GlobalCaloTrigger") <<
"=== Global Calo Trigger ===" << endl;
531 LogInfo(
"L1GlobalCaloTrigger") <<
"=== START DEBUG OUTPUT ===" << endl;
533 LogInfo(
"L1GlobalCaloTrigger") << endl;
534 LogInfo(
"L1GlobalCaloTrigger") <<
"N Jet Leaf Cards " <<
theJetLeafCards.size() << endl;
535 LogInfo(
"L1GlobalCaloTrigger") <<
"N Wheel Jet Fpgas " <<
theWheelJetFpgas.size() << endl;
536 LogInfo(
"L1GlobalCaloTrigger") <<
"N Wheel Energy Fpgas " <<
theWheelEnergyFpgas.size() << endl;
537 LogInfo(
"L1GlobalCaloTrigger") <<
"N Em Leaf Cards " <<
theEmLeafCards.size() << endl;
538 LogInfo(
"L1GlobalCaloTrigger") << endl;
541 LogInfo(
"L1GlobalCaloTrigger") <<
"Jet Leaf Card " <<
i <<
" : " <<
theJetLeafCards.at(
i) << endl;
544 LogInfo(
"L1GlobalCaloTrigger") << endl;
547 LogInfo(
"L1GlobalCaloTrigger") <<
"Wheel Jet FPGA " <<
i <<
" : " <<
theWheelJetFpgas.at(
i) << endl;
550 LogInfo(
"L1GlobalCaloTrigger") << endl;
553 LogInfo(
"L1GlobalCaloTrigger") <<
"Wheel Energy FPGA " <<
i <<
" : " <<
theWheelEnergyFpgas.at(
i) << endl;
556 LogInfo(
"L1GlobalCaloTrigger") << endl;
558 LogInfo(
"L1GlobalCaloTrigger") << (*theJetFinalStage);
559 LogInfo(
"L1GlobalCaloTrigger") << endl;
561 LogInfo(
"L1GlobalCaloTrigger") << (*theEnergyFinalStage);
562 LogInfo(
"L1GlobalCaloTrigger") << endl;
565 LogInfo(
"L1GlobalCaloTrigger") << ( (
i==0) ?
"Positive eta " :
"Negative eta " );
566 LogInfo(
"L1GlobalCaloTrigger") <<
"EM Leaf Card " <<
i <<
" : " <<
theEmLeafCards.at(
i) << endl;
569 LogInfo(
"L1GlobalCaloTrigger") << endl;
571 LogInfo(
"L1GlobalCaloTrigger") << (*theIsoEmFinalStage);
572 LogInfo(
"L1GlobalCaloTrigger") << endl;
574 LogInfo(
"L1GlobalCaloTrigger") << (*theNonIsoEmFinalStage);
576 LogInfo(
"L1GlobalCaloTrigger") <<
"=== Global Calo Trigger ===" << endl;
577 LogInfo(
"L1GlobalCaloTrigger") <<
"=== END DEBUG OUTPUT ===" << endl;
616 allJets.insert(allJets.end(), jfJets.begin(), jfJets.end());
681 allSums.insert(allSums.end(), procSums.begin(), procSums.end());
687 allSums.insert(allSums.end(), procSums.begin(), procSums.end());
693 allSums.insert(allSums.end(), procSums.begin(), procSums.end());
707 allSums.insert(allSums.end(), procSums.begin(), procSums.end());
713 allSums.insert(allSums.end(), procSums.begin(), procSums.end());
719 allSums.insert(allSums.end(), procSums.begin(), procSums.end());
776 for (
int i=0;
i<N_JET_LEAF_CARDS*3;
i++) {
812 for (
int i=0;
i<N_JET_LEAF_CARDS*3;
i++) {
844 if (jetLeafMask==0) {
853 unsigned mask = jetLeafMask;
868 vector<L1GctJetLeafCard*> neighbours(2);
872 int nlc = (jlc+1)%NL;
873 int mlc = (jlc+(NL-1))%NL;
893 vector<L1GctJetLeafCard*> wheelJetLeafCards(3);
894 vector<L1GctJetLeafCard*> wheelEnergyLeafCards(3);
899 for (
int j=0;
j<3;
j++) {
928 unsigned result = ( ((crate%9) < 4) ? 1 : 0 );
929 if (crate>=9) result += 2;
930 if (crate>=18) result = 0;
static L1GctHFRingEtSums fromGctEmulator(const int16_t bx, const uint16_t etSumPosEtaRing1, const uint16_t etSumNegEtaRing1, const uint16_t etSumPosEtaRing2, const uint16_t etSumNegEtaRing2)
named ctor for GCT emulator
Emulates the energy summing on a GCT Wheel card.
std::vector< reco::JetBaseRef > allJets(const Container &)
fill list of all jets associated with values. Return # of jets in the list
void reset()
complete reset of processor
L1GctJetFinderBase::lutPtrVector lutPtrVector
std::vector< etMissType > getHtMissColl() const
return output missing Ht magnitude
L1GctHFRingEtSumsCollection getHFRingEtSumsCollection() const
void bxReset(const int bx)
Partial reset for a new bunch crossing.
bool setupOk() const
check we have done all the setup
void fillEmCands(const std::vector< L1CaloEmCand > &rgn)
set electrons from the RCT at the input to be processed
L1GctJetCandCollection getTauJets() const
tau jet outputs to GT
std::vector< L1GctJetLeafCard * > theJetLeafCards
pointers to the Jet Leaf cards
bool setupOk() const
check setup
void reset()
clear internal buffers
void setupTauAlgo(const bool useImprovedAlgo, const bool ignoreVetoBitsForIsolation)
setup the tau algorithm parameters
void sortInputData()
Sort the input data by bunch crossing number.
L1GctHFBitCountsCollection getHFBitCountsCollection() const
std::vector< L1GctEtMiss > L1GctEtMissCollection
Represents a GCT Wheel Jet FPGA.
JetVector getCentralJets() const
get the central jets output data
std::vector< L1CaloEmCand > m_allInputEmCands
static const int N_WHEEL_CARDS
Number of Wheel Cards.
unsigned rctCrate() const
get RCT crate ID
Emulates the GCT summing and packing of Hf Et sums and tower-over-threshold counts.
std::vector< L1GctHFRingEtSums > L1GctHFRingEtSumsCollection
std::vector< L1GctWheelEnergyFpga * > theWheelEnergyFpgas
Wheel Card Energy Fpgas.
void setJetFinderParams(const L1GctJetFinderParams *const jfpars)
unsigned sorterNo(const L1CaloEmCand &em) const
unsigned getCenJetEtSeedGct() const
unsigned getTauJetEtSeedGct() const
L1GctGlobalEnergyAlgos * theEnergyFinalStage
energy final stage algos
std::vector< L1GctEtHad > L1GctEtHadCollection
std::vector< etMissPhiType > getEtMissPhiColl() const
return output missing Et value
const L1GctChannelMask * m_inputChannelMask
Input channel mask.
virtual void process()
process the data, fill output buffers
void setIsoEm(const L1CaloEmCand &em)
set an isolated EM candidate to be processed
std::vector< L1GctInternHtMiss > L1GctInternHtMissCollection
bool m_bxRangeAuto
Multiple bunch crossing operation.
Level-1 Region Calorimeter Trigger EM candidate.
Persistable copy of missing Et measured at Level-1.
L1GctJetCandCollection getForwardJets() const
forward jet outputs to GT
void setJetFinderParams(const L1GctJetFinderParams *const jfpars)
JetVector getForwardJets() const
get the forward jets output data
~L1GlobalCaloTrigger()
dismantle the GCT
L1GctEmCandCollection getNonIsoElectrons() const
non-iso electron outputs to GT
L1GctElectronFinalSort * theNonIsoEmFinalStage
non-iso electron final stage sorter
JetVector getTauJets() const
get the tau jets output data
lutPtrVector m_jetEtCalLuts
Jet Et calibration LUT.
L1GctHtMissCollection getHtMissCollection() const
Htmiss output to GT.
virtual void process()
process the data, fill output buffers
L1GctGlobalHfSumAlgos * getHfSumProcessor() const
provide access to hf sum processor
L1GctEtTotalCollection getEtSumCollection() const
Total Et output to GT.
std::vector< L1GctJetFinderBase * > theJetFinders
pointers to the Jet Finders
std::vector< L1GctWheelJetFpga * > theWheelJetFpgas
Wheel Card Jet Fpgas.
std::vector< L1GctEtTotal > L1GctEtTotalCollection
void setHtMissScale(const L1CaloEtScale *const scale)
bool emCrateMask(unsigned crate) const
get EM masks for an RCT crate
bool regionMask(unsigned ieta, unsigned iphi) const
get region masks
std::vector< L1GctHFBitCounts > L1GctHFBitCountsCollection
std::vector< L1GctJetCand > L1GctJetCandCollection
Represents the final stage of L1 jet processing.
CompareBx< L1CaloRegion > rgnBxComparator
void setVerbose()
control output messages
std::vector< etHadType > getEtHadColl() const
return std::vector< output calibrated jet Et
virtual void fetchInput()
get input data from sources
L1GctElectronFinalSort * theIsoEmFinalStage
iso electron final stage sorter
void setHtMissScale(const L1CaloEtScale *const scale)
setup scale for missing Ht
const T & max(const T &a, const T &b)
std::vector< L1GctEmCand > getOutputCands() const
return output data
L1GctInternHtMissCollection getInternalHtMiss() const
Persistable copy of total Et measured at Level-1.
unsigned rctCrate() const
get RCT crate
bool setupOk() const
check setup
static const int N_JET_LEAF_CARDS
Number of Leaf Cards configured for jet processing.
void fillRegions(const std::vector< L1CaloRegion > &rgn)
std::vector< L1GctElectronSorter * > theIsoElectronSorters
pointers to the electron sorters
std::vector< etTotalType > getEtSumColl() const
return output total scalar Et
Emulates the GCT global energy algorithms.
L1GctGlobalHfSumAlgos * getHfSumProcessor() const
provide access to hf sum processor
L1GctEtHadCollection getEtHadCollection() const
Total hadronic Et output to GT.
void setupHfSumLuts(const L1CaloEtScale *const scale)
setup Hf sum LUTs
void setBxRange(const int firstBx, const int lastBx)
L1GctJetCandCollection getCentralJets() const
central jet outputs to GT
void setNonIsoEm(const L1CaloEmCand &em)
set a non-isolated EM candidate to be processed
void bxProcess(const int bx)
Process a new bunch crossing.
void setBxRange(const int firstBx, const int numberOfBx)
define the bunch crossing range to process
L1GctInternJetDataCollection getInternalJets() const
all jets from jetfinders in raw format
CompareBx< L1CaloEmCand > emcBxComparator
void setBxRange(const int firstBx, const int numberOfBx)
define the bunch crossing range to process
Persistable copy of total Ht measured at Level-1.
void reset()
Reset internal buffers.
void setChannelMask(const L1GctChannelMask *const mask)
setup the input channel mask
void bxSetup()
Setup bunch crossing range (depending on input data)
L1GctEmCandCollection getIsoElectrons() const
std::vector< L1GctHtMiss > L1GctHtMissCollection
virtual void process()
process the data, fill output buffers
void setJetEtCalibrationLuts(const lutPtrVector &jfluts)
setup the Jet Calibration Luts
unsigned getCenForJetEtaBoundary() const
void setBxRangeAutomatic()
process all crossings present in the input (and only those crossings)
Persistable copy of missing Et measured at Level-1.
L1GlobalCaloTrigger(const L1GctJetLeafCard::jetFinderType jfType=L1GctJetLeafCard::hardwareJetFinder, unsigned jetLeafMask=0)
construct the GCT
static const int N_EM_LEAF_CARDS
Number of Leaf Cards configured for EM processing.
unsigned gctEta() const
get GCT eta index
std::vector< L1GctInternJetData > L1GctInternJetDataCollection
unsigned gctPhi() const
get GCT phi index
std::vector< etMissPhiType > getHtMissPhiColl() const
return output missing Ht value
std::vector< L1GctElectronSorter * > theNonIsoElectronSorters
std::vector< L1CaloRegion > m_allInputRegions
void build(L1GctJetLeafCard::jetFinderType jfType, unsigned jetLeafMask)
instantiate the hardware & algo objects and wire up the system
A calorimeter trigger region (sum of 4x4 trigger towers)
void setRegion(const L1CaloRegion ®ion)
std::vector< L1GctInternEtSum > L1GctInternEtSumCollection
void setBxRangeSymmetric(const int numOfBx)
process crossings from (-numOfBx) to (numOfBx)
static const unsigned N_PHI
void setupLuts(const L1CaloEtScale *scale)
Setup luts.
void setNextBx(const int bx)
partially clear buffers
void setNextBx(const int bxnum)
clear input data buffers and process a new bunch crossing
std::vector< etMissType > getEtMissColl() const
return output missing Et magnitude
virtual void fetchInput()
get input data from sources
L1GctJetFinalStage * theJetFinalStage
jet final stage algo
virtual void fetchInput()
get input data from sources
static L1GctHFBitCounts fromGctEmulator(const int16_t bx, const uint16_t bitCountPosEtaRing1, const uint16_t bitCountNegEtaRing1, const uint16_t bitCountPosEtaRing2, const uint16_t bitCountNegEtaRing2)
named ctor for GCT emulator
std::vector< L1GctEmLeafCard * > theEmLeafCards
pointers to the EM Leaf cards
L1GctEtMissCollection getEtMissCollection() const
Etmiss output to GT.
void process()
process an event
const L1GctJetFinderParams * m_jetFinderParams
Jetfinder parameters.
Emulates a leaf card programmed for electron sorting.
void setVerbose()
control output messages
std::vector< L1GctEmCand > L1GctEmCandCollection
L1GctInternEtSumCollection getInternalEtSums() const
Et sums and components in internal format.