CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
29 class L1GctJetLeafCard;
30 class L1GctJetFinderBase;
31 class L1GctEmLeafCard;
33 
34 class L1GctWheelJetFpga;
36 class L1GctJetFinalStage;
42 class L1GctChannelMask;
43 class L1CaloEtScale;
44 
45 
47 public:
49  static const int N_JET_LEAF_CARDS;
51  static const int N_EM_LEAF_CARDS;
53  static const int N_WHEEL_CARDS;
54 
60 
63 
66 
69 
71  void reset();
72 
74  void process();
75 
80  void setJetFinderParams(const L1GctJetFinderParams* const jfpars);
81 
83  void setJetEtCalibrationLuts(const lutPtrVector& jfluts);
84 
86  void setupTauAlgo(const bool useImprovedAlgo, const bool ignoreVetoBitsForIsolation);
87 
89  void setHtMissScale(const L1CaloEtScale* const scale);
90 
92  void setupHfSumLuts(const L1CaloEtScale* const scale);
93 
95  void setChannelMask(const L1GctChannelMask* const mask);
96 
102  void setBxRange(const int firstBx, const int lastBx);
104  void setBxRangeSymmetric(const int numOfBx);
106  void setBxRangeAutomatic();
107 
109  int getFirstBx() const { return m_bxStart; }
110  int getLastBx() const { return (m_bxStart + m_numOfBx - 1); }
111  int getTotalBx() const { return m_numOfBx; }
112 
118  void fillRegions(const std::vector<L1CaloRegion>& rgn);
119 
121  void fillEmCands(const std::vector<L1CaloEmCand>& rgn);
122 
125  void setRegion(const L1CaloRegion& region);
126 
128  void setRegion(const unsigned et, const unsigned ieta, const unsigned iphi,
129  const bool overFlow=false, const bool fineGrain=true);
130 
132  void setIsoEm(const L1CaloEmCand& em);
133 
135  void setNonIsoEm(const L1CaloEmCand& em);
136 
142 
145 
148 
151 
154 
157 
160 
163 
166 
169 
173 
174  // Hf sums output to GT
177 
182  std::vector<L1GctJetLeafCard*> getJetLeafCards() const { return theJetLeafCards; }
183 
185  std::vector<L1GctEmLeafCard*> getEmLeafCards() const { return theEmLeafCards; }
186 
188  std::vector<L1GctWheelJetFpga*> getWheelJetFpgas() const { return theWheelJetFpgas; }
189 
191  std::vector<L1GctWheelEnergyFpga*> getWheelEnergyFpgas() const { return theWheelEnergyFpgas; }
192 
195 
198 
201 
205 
208 
211 
216  void print();
217 
219  void setVerbose();
220  void setTerse();
221 
222  private:
223 
226  void sortInputData();
228  void bxSetup();
230  void bxReset(const int bx);
232  void fillEmCands(std::vector<L1CaloEmCand>::iterator& emc, const int bx);
233  void fillRegions(std::vector<L1CaloRegion>::iterator& rgn, const int bx);
235  void bxProcess(const int bx);
236 
238  void build(L1GctJetLeafCard::jetFinderType jfType, unsigned jetLeafMask);
239 
241  bool setupOk() const;
242 
245  unsigned sorterNo(const L1CaloEmCand& em) const;
246 
250  template <class T>
251  struct CompareBx {
252  bool operator()(const T& i, const T& j) const {
253  return i.bx() < j.bx();
254  }
255  };
258 
259  private:
260 
262  std::vector<L1GctJetLeafCard*> theJetLeafCards;
263 
265  std::vector<L1GctJetFinderBase*> theJetFinders;
266 
268  std::vector<L1GctEmLeafCard*> theEmLeafCards;
269 
271  std::vector<L1GctElectronSorter*> theIsoElectronSorters;
272  std::vector<L1GctElectronSorter*> theNonIsoElectronSorters;
273 
275  std::vector<L1GctWheelJetFpga*> theWheelJetFpgas;
276 
278  std::vector<L1GctWheelEnergyFpga*> theWheelEnergyFpgas;
279 
282 
285 
288 
291 
294 
297 
300 
305 
308  std::vector<L1CaloEmCand> m_allInputEmCands;
309  std::vector<L1CaloRegion> m_allInputRegions;
310 };
311 
312 #endif /*L1GLOBALCALOTRIGGER_H_*/
std::vector< L1GctJetLeafCard * > getJetLeafCards() const
Emulates the energy summing on a GCT Wheel card.
L1GctJetFinderBase::lutPtrVector lutPtrVector
L1GctHFRingEtSumsCollection getHFRingEtSumsCollection() const
int i
Definition: DBlmapReader.cc:9
std::vector< L1GctWheelEnergyFpga * > getWheelEnergyFpgas() const
get the Wheel Energy Fpgas
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
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
L1GctUnsignedInt< L1GctEtHad::kEtHadNBits > etHadType
L1GctElectronFinalSort * getNonIsoEmFinalStage() const
std::vector< L1GctEtMiss > L1GctEtMissCollection
Represents a GCT Wheel Jet FPGA.
Jet Et calibration LUT.
int getFirstBx() const
accessor methods
L1GctUnsignedInt< L1GctEtMiss::kEtMissPhiNBits > etMissPhiType
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.
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.
Definition: L1CaloEmCand.h:18
L1GctJetCandCollection getForwardJets() const
forward jet outputs to GT
L1GctJet::lutPtr lutPtr
~L1GlobalCaloTrigger()
dismantle the GCT
L1GctEmCandCollection getNonIsoElectrons() const
non-iso electron outputs to GT
L1GctElectronFinalSort * theNonIsoEmFinalStage
non-iso electron final stage sorter
lutPtrVector m_jetEtCalLuts
Jet Et calibration LUT.
L1GctHtMissCollection getHtMissCollection() const
Htmiss output to GT.
Bit-level emulation of the Global Calorimeter Trigger.
L1GctGlobalHfSumAlgos * getHfSumProcessor() const
provide access to hf sum processor
L1GctJetFinderBase::lutPtr lutPtr
Base class to allow implementation of jetFinder algorithms.
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
std::vector< L1GctHFBitCounts > L1GctHFBitCountsCollection
std::vector< L1GctJetCand > L1GctJetCandCollection
Represents the final stage of L1 jet processing.
CompareBx< L1CaloRegion > rgnBxComparator
const L1GctJetFinderParams * getJetFinderParams() const
get the jetFinder parameters
L1GctElectronFinalSort * theIsoEmFinalStage
iso electron final stage sorter
void setHtMissScale(const L1CaloEtScale *const scale)
setup scale for missing Ht
L1GctInternHtMissCollection getInternalHtMiss() const
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
int j
Definition: DBlmapReader.cc:9
Class that sorts electron candidates.
Emulates the GCT global energy algorithms.
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.
L1GctInternJetDataCollection getInternalJets() const
all jets from jetfinders in raw format
CompareBx< L1CaloEmCand > emcBxComparator
L1GctGlobalEnergyAlgos * getEnergyFinalStage() const
get the energy final stage
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
void setJetEtCalibrationLuts(const lutPtrVector &jfluts)
setup the Jet Calibration Luts
L1GctElectronFinalSort * getIsoEmFinalStage() const
get the electron final stage sorters
void setBxRangeAutomatic()
process all crossings present in the input (and only those crossings)
std::vector< L1GctWheelJetFpga * > getWheelJetFpgas() const
get the Wheel Jet FPGAs
const lutPtrVector getJetEtCalibLuts() const
get the Jet Et calibration LUT
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.
std::vector< lutPtr > lutPtrVector
std::vector< L1GctInternJetData > L1GctInternJetDataCollection
L1GctJetFinalStage * getJetFinalStage() const
get the jet final stage
std::vector< L1GctElectronSorter * > theNonIsoElectronSorters
std::vector< L1CaloRegion > m_allInputRegions
L1GctUnsignedInt< L1GctEtTotal::kEtTotalNBits > etTotalType
typedefs for energy values in fixed numbers of bits
void build(L1GctJetLeafCard::jetFinderType jfType, unsigned jetLeafMask)
instantiate the hardware &amp; algo objects and wire up the system
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:22
void setRegion(const L1CaloRegion &region)
std::vector< L1GctInternEtSum > L1GctInternEtSumCollection
void setBxRangeSymmetric(const int numOfBx)
process crossings from (-numOfBx) to (numOfBx)
bool operator()(const T &i, const T &j) const
long double T
L1GctJetFinalStage * theJetFinalStage
jet final stage algo
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.
L1GctUnsignedInt< L1GctEtMiss::kEtMissNBits > etMissType
std::vector< L1GctEmLeafCard * > getEmLeafCards() const
get the Jet Leaf cards
void setVerbose()
control output messages
std::vector< L1GctEmCand > L1GctEmCandCollection
L1GctInternEtSumCollection getInternalEtSums() const
Et sums and components in internal format.