CMS 3D CMS Logo

L1GlobalCaloTrigger.h
Go to the documentation of this file.
1 #ifndef L1GLOBALCALOTRIGGER_H_
2 #define L1GLOBALCALOTRIGGER_H_
3 
6 
8 
10 
13 
14 #include <vector>
15 
28 class L1GctJetLeafCard;
29 class L1GctJetFinderBase;
30 class L1GctEmLeafCard;
32 
33 class L1GctWheelJetFpga;
35 class L1GctJetFinalStage;
41 class L1GctChannelMask;
42 class L1CaloEtScale;
43 
45 public:
47  static const int N_JET_LEAF_CARDS;
49  static const int N_EM_LEAF_CARDS;
51  static const int N_WHEEL_CARDS;
52 
58 
61 
64  unsigned jetLeafMask = 0);
65 
68 
70  void reset();
71 
73  void process();
74 
79  void setJetFinderParams(const L1GctJetFinderParams* const jfpars);
80 
82  void setJetEtCalibrationLuts(const lutPtrVector& jfluts);
83 
85  void setupTauAlgo(const bool useImprovedAlgo, const bool ignoreVetoBitsForIsolation);
86 
88  void setHtMissScale(const L1CaloEtScale* const scale);
89 
91  void setupHfSumLuts(const L1CaloEtScale* const scale);
92 
94  void setChannelMask(const L1GctChannelMask* const mask);
95 
101  void setBxRange(const int firstBx, const int lastBx);
103  void setBxRangeSymmetric(const int numOfBx);
105  void setBxRangeAutomatic();
106 
108  int getFirstBx() const { return m_bxStart; }
109  int getLastBx() const { return (m_bxStart + m_numOfBx - 1); }
110  int getTotalBx() const { return m_numOfBx; }
111 
117  void fillRegions(const std::vector<L1CaloRegion>& rgn);
118 
120  void fillEmCands(const std::vector<L1CaloEmCand>& rgn);
121 
124  void setRegion(const L1CaloRegion& region);
125 
127  void setRegion(const unsigned et,
128  const unsigned ieta,
129  const unsigned iphi,
130  const bool overFlow = false,
131  const bool fineGrain = true);
132 
134  void setIsoEm(const L1CaloEmCand& em);
135 
137  void setNonIsoEm(const L1CaloEmCand& em);
138 
144 
147 
150 
153 
156 
159 
162 
165 
168 
171 
175 
176  // Hf sums output to GT
179 
184  std::vector<L1GctJetLeafCard*> getJetLeafCards() const { return theJetLeafCards; }
185 
187  std::vector<L1GctEmLeafCard*> getEmLeafCards() const { return theEmLeafCards; }
188 
190  std::vector<L1GctWheelJetFpga*> getWheelJetFpgas() const { return theWheelJetFpgas; }
191 
193  std::vector<L1GctWheelEnergyFpga*> getWheelEnergyFpgas() const { return theWheelEnergyFpgas; }
194 
197 
200 
203 
207 
210 
213 
218  void print();
219 
221  void setVerbose();
222  void setTerse();
223 
224 private:
227  void sortInputData();
229  void bxSetup();
231  void bxReset(const int bx);
233  void fillEmCands(std::vector<L1CaloEmCand>::iterator& emc, const int bx);
234  void fillRegions(std::vector<L1CaloRegion>::iterator& rgn, const int bx);
236  void bxProcess(const int bx);
237 
239  void build(L1GctJetLeafCard::jetFinderType jfType, unsigned jetLeafMask);
240 
242  bool setupOk() const;
243 
246  unsigned sorterNo(const L1CaloEmCand& em) const;
247 
251  template <class T>
252  struct CompareBx {
253  bool operator()(const T& i, const T& j) const { return i.bx() < j.bx(); }
254  };
257 
258 private:
260  std::vector<L1GctJetLeafCard*> theJetLeafCards;
261 
263  std::vector<L1GctJetFinderBase*> theJetFinders;
264 
266  std::vector<L1GctEmLeafCard*> theEmLeafCards;
267 
269  std::vector<L1GctElectronSorter*> theIsoElectronSorters;
270  std::vector<L1GctElectronSorter*> theNonIsoElectronSorters;
271 
273  std::vector<L1GctWheelJetFpga*> theWheelJetFpgas;
274 
276  std::vector<L1GctWheelEnergyFpga*> theWheelEnergyFpgas;
277 
280 
283 
286 
289 
292 
295 
298 
303 
306  std::vector<L1CaloEmCand> m_allInputEmCands;
307  std::vector<L1CaloRegion> m_allInputRegions;
308 };
309 
310 #endif /*L1GLOBALCALOTRIGGER_H_*/
Emulates the energy summing on a GCT Wheel card.
L1GctJetFinderBase::lutPtrVector lutPtrVector
void bxReset(const int bx)
Partial reset for a new bunch crossing.
L1GctJetCandCollection getForwardJets() const
forward jet outputs to GT
void fillEmCands(const std::vector< L1CaloEmCand > &rgn)
set electrons from the RCT at the input to be processed
L1GctInternHtMissCollection getInternalHtMiss() const
L1GctEtMissCollection getEtMissCollection() const
Etmiss output to GT.
std::vector< L1GctJetLeafCard * > theJetLeafCards
pointers to the Jet Leaf cards
void setupTauAlgo(const bool useImprovedAlgo, const bool ignoreVetoBitsForIsolation)
setup the tau algorithm parameters
void sortInputData()
Sort the input data by bunch crossing number.
std::vector< L1GctEtMiss > L1GctEtMissCollection
Represents a GCT Wheel Jet FPGA.
Jet Et calibration LUT.
std::vector< L1GctWheelJetFpga * > getWheelJetFpgas() const
get the Wheel Jet FPGAs
L1GctGlobalEnergyAlgos * getEnergyFinalStage() const
get the energy final stage
std::vector< L1CaloEmCand > m_allInputEmCands
static const int N_WHEEL_CARDS
Number of Wheel Cards.
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
L1GctGlobalEnergyAlgos * theEnergyFinalStage
energy final stage algos
std::vector< L1GctEtHad > L1GctEtHadCollection
const L1GctChannelMask * m_inputChannelMask
Input channel mask.
L1GctUnsignedInt< L1GctEtHad::kEtHadNBits > etHadType
void setIsoEm(const L1CaloEmCand &em)
set an isolated EM candidate to be processed
std::vector< L1GctInternHtMiss > L1GctInternHtMissCollection
L1GctHFRingEtSumsCollection getHFRingEtSumsCollection() const
bool m_bxRangeAuto
Multiple bunch crossing operation.
std::vector< L1GctJetLeafCard * > getJetLeafCards() const
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:17
L1GctHFBitCountsCollection getHFBitCountsCollection() const
L1GctJet::lutPtr lutPtr
~L1GlobalCaloTrigger()
dismantle the GCT
L1GctElectronFinalSort * theNonIsoEmFinalStage
non-iso electron final stage sorter
lutPtrVector m_jetEtCalLuts
Jet Et calibration LUT.
const lutPtrVector getJetEtCalibLuts() const
get the Jet Et calibration LUT
Bit-level emulation of the Global Calorimeter Trigger.
L1GctUnsignedInt< L1GctEtMiss::kEtMissPhiNBits > etMissPhiType
L1GctJetFinderBase::lutPtr lutPtr
Base class to allow implementation of jetFinder algorithms.
std::vector< L1GctJetFinderBase * > theJetFinders
pointers to the Jet Finders
std::vector< L1GctWheelJetFpga * > theWheelJetFpgas
Wheel Card Jet Fpgas.
std::vector< L1GctEtTotal > L1GctEtTotalCollection
std::vector< L1GctHFBitCounts > L1GctHFBitCountsCollection
std::vector< L1GctJetCand > L1GctJetCandCollection
Represents the final stage of L1 jet processing.
CompareBx< L1CaloRegion > rgnBxComparator
L1GctJetCandCollection getTauJets() const
tau jet outputs to GT
int getFirstBx() const
accessor methods
L1GctEmCandCollection getNonIsoElectrons() const
non-iso electron outputs to GT
L1GctElectronFinalSort * theIsoEmFinalStage
iso electron final stage sorter
void setHtMissScale(const L1CaloEtScale *const scale)
setup scale for missing Ht
static const int N_JET_LEAF_CARDS
Number of Leaf Cards configured for jet processing.
void fillRegions(const std::vector< L1CaloRegion > &rgn)
L1GctGlobalHfSumAlgos * getHfSumProcessor() const
provide access to hf sum processor
std::vector< L1GctElectronSorter * > theIsoElectronSorters
pointers to the electron sorters
L1GctElectronFinalSort * getNonIsoEmFinalStage() const
Class that sorts electron candidates.
Emulates the GCT global energy algorithms.
void setupHfSumLuts(const L1CaloEtScale *const scale)
setup Hf sum LUTs
void setBxRange(const int firstBx, const int lastBx)
L1GctInternJetDataCollection getInternalJets() const
all jets from jetfinders in raw format
void setNonIsoEm(const L1CaloEmCand &em)
set a non-isolated EM candidate to be processed
void bxProcess(const int bx)
Process a new bunch crossing.
CompareBx< L1CaloEmCand > emcBxComparator
L1GctInternEtSumCollection getInternalEtSums() const
Et sums and components in internal format.
L1GctJetCandCollection getCentralJets() const
central jet outputs to GT
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)
L1GctJetFinalStage * getJetFinalStage() const
get the jet final stage
std::vector< L1GctHtMiss > L1GctHtMissCollection
void setJetEtCalibrationLuts(const lutPtrVector &jfluts)
setup the Jet Calibration Luts
std::vector< L1GctWheelEnergyFpga * > getWheelEnergyFpgas() const
get the Wheel Energy Fpgas
std::vector< L1GctEmLeafCard * > getEmLeafCards() const
get the Jet Leaf cards
void setBxRangeAutomatic()
process all crossings present in the input (and only those crossings)
L1GctEtHadCollection getEtHadCollection() const
Total hadronic Et output to GT.
L1GlobalCaloTrigger(const L1GctJetLeafCard::jetFinderType jfType=L1GctJetLeafCard::hardwareJetFinder, unsigned jetLeafMask=0)
construct the GCT
const L1GctJetFinderParams * getJetFinderParams() const
get the jetFinder parameters
L1GctEmCandCollection getIsoElectrons() const
L1GctUnsignedInt< L1GctEtTotal::kEtTotalNBits > etTotalType
typedefs for energy values in fixed numbers of bits
static const int N_EM_LEAF_CARDS
Number of Leaf Cards configured for EM processing.
std::vector< lutPtr > lutPtrVector
std::vector< L1GctInternJetData > L1GctInternJetDataCollection
L1GctElectronFinalSort * getIsoEmFinalStage() const
get the electron final stage sorters
bool operator()(const T &i, const T &j) const
L1GctEtTotalCollection getEtSumCollection() const
Total Et output to GT.
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)
Definition: L1CaloRegion.h:21
void setRegion(const L1CaloRegion &region)
std::vector< L1GctInternEtSum > L1GctInternEtSumCollection
void setBxRangeSymmetric(const int numOfBx)
process crossings from (-numOfBx) to (numOfBx)
bool setupOk() const
check we have done all the setup
long double T
L1GctUnsignedInt< L1GctEtMiss::kEtMissNBits > etMissType
L1GctJetFinalStage * theJetFinalStage
jet final stage algo
std::vector< L1GctEmLeafCard * > theEmLeafCards
pointers to the EM Leaf cards
void process()
process an event
const L1GctJetFinderParams * m_jetFinderParams
Jetfinder parameters.
Emulates a leaf card programmed for electron sorting.
void setVerbose()
control output messages
L1GctHtMissCollection getHtMissCollection() const
Htmiss output to GT.
std::vector< L1GctEmCand > L1GctEmCandCollection