CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctJetFinderBase.h
Go to the documentation of this file.
1 #ifndef L1GCTJETFINDERBASE_H_
2 #define L1GCTJETFINDERBASE_H_
3 
7 
11 
14 
15 #include <boost/cstdint.hpp> //for uint16_t
16 #include <vector>
17 
18 class L1GctInternJetData;
21 class L1GctChannelMask;
22 class L1CaloRegion;
23 
24 
45 /*
46  * \author Jim Brooke & Greg Heath
47  * \date June 2006
48  */
49 
51 {
52 public:
53  //Typedefs
54  typedef unsigned long int ULong;
55  typedef unsigned short int UShort;
56  typedef std::vector<L1GctRegion> RegionsVector;
57  typedef std::vector<L1GctJet> RawJetVector;
58  typedef std::vector<L1GctJetCand> JetVector;
64 
65  enum maxValues {
68  };
69 
70 
71  // For HF-based triggers we sum the Et in the two "inner" (large eta) rings;
72  // and count towers over threshold based on the "fineGrain" bit from the RCT.
73  // Define a data type to transfer the result of all calculations.
74  // The results are defined as L1GctJetCount types since they don't have
75  // a separate overFlow bit. An overflow condition gives value=max.
76 
77  struct hfTowerSumsType {
78 
79  enum numberOfBits {
82  };
83 
88 
89  // Define some constructors and an addition operator for our data type
91  hfTowerSumsType(unsigned e0, unsigned e1, unsigned n0, unsigned n1) :
92  etSum0(e0), etSum1(e1), nOverThreshold0(n0), nOverThreshold1(n1) {}
97 
99 
101  hfTowerSumsType temp( (this->etSum0+rhs.etSum0),
102  (this->etSum1+rhs.etSum1),
103  (this->nOverThreshold0+rhs.nOverThreshold0),
104  (this->nOverThreshold1+rhs.nOverThreshold1) );
105  return temp;
106  }
107 
108  };
109 
111  typedef std::vector<lutPtr> lutPtrVector;
112 
113  //Statics
114  static const unsigned int MAX_JETS_OUT;
115  static const unsigned int COL_OFFSET;
116  static const unsigned int N_JF_PER_WHEEL;
117  static const unsigned int N_EXTRA_REGIONS_ETA00;
118 
120  L1GctJetFinderBase(int id);
121 
123 
125  void setNeighbourJetFinders(std::vector<L1GctJetFinderBase*> neighbours);
126 
128  void setJetFinderParams(const L1GctJetFinderParams* jfpars);
129 
131  void setJetEtCalibrationLuts(const lutPtrVector& jfluts);
132 
134  void setEnergySumMasks(const L1GctChannelMask* chmask);
135 
137  void setupTauAlgo(const bool useImprovedAlgo, const bool ignoreVetoBitsForIsolation) {
138  m_useImprovedTauAlgo = useImprovedAlgo;
139  m_ignoreTauVetoBitsForIsolation = ignoreVetoBitsForIsolation;
140  }
141 
143  bool setupOk() const { return m_idInRange
147  && m_gotChannelMask; }
148 
150  friend std::ostream& operator << (std::ostream& os, const L1GctJetFinderBase& algo);
151 
153  virtual void fetchInput() = 0;
154 
156  virtual void process() = 0;
157 
159  void setInputRegion(const L1CaloRegion& region);
160 
163 
166 
169 
172 
175 
177  std::vector< L1GctInternJetData > getInternalJets() const;
178 
180  std::vector< L1GctInternEtSum > getInternalEtSums() const;
181  std::vector< L1GctInternHtMiss > getInternalHtMiss() const;
182 
184  const lutPtrVector getJetEtCalLuts() const { return m_jetEtCalLuts; }
185 
186  // The hardware output quantities
187  JetVector getJets() const { return m_sortedJets; }
188  // The hardware output quantities - refactored
189  etTotalType getEtSum() const { return m_outputEtSum; }
192  etHadType getHtSum() const { return m_outputHtSum; }
195 
197 
198  // Access to threshold and cut values
199  unsigned getCenJetSeed() const { return m_CenJetSeed; }
200  unsigned getFwdJetSeed() const { return m_FwdJetSeed; }
201  unsigned getTauJetSeed() const { return m_TauJetSeed; }
202  unsigned getEtaBoundry() const { return m_EtaBoundry; }
204  unsigned getHttSumJetThreshold() const { return m_HttSumJetThreshold; }
205  unsigned getHtmSumJetThreshold() const { return m_HtmSumJetThreshold; }
206 
207  protected:
208 
210  virtual void resetProcessor();
211  virtual void resetPipelines();
212 
214  virtual void setupObjects();
215 
216  protected:
217 
219  enum fetchType { TOP, BOT, TOPBOT };
220 
222  int m_id;
223 
225  std::vector<L1GctJetFinderBase*> m_neighbourJetFinders;
226 
229 
232 
235 
238 
241 
247 
249  unsigned m_minColThisJf;
256  unsigned m_CenJetSeed;
257  unsigned m_FwdJetSeed;
258  unsigned m_TauJetSeed;
259  unsigned m_EtaBoundry;
260 
263 
265  // If the following parameter is set to false, the tau identification
266  // is just based on the RCT tau veto bits from the nine regions
268 
269  // If useImprovedTauAlgo is true, these two parameters affect
270  // the operation of the algorithm.
271 
272  // We can require the tau veto bits to be off in all nine regions,
273  // or just in the central region.
275 
276  // In the improved tau algorithm, we require no more than one tower energy to be
277  // above the isolation threshold, in the eight regions surrounding the central one.
279 
280  // Thresholds on individual jet energies used in HTT and HTM summing
283 
284  // Masks for restricting the eta range of energy sums
285  bool m_EttMask[11];
286  bool m_EtmMask[11];
287  bool m_HttMask[11];
288  bool m_HtmMask[11];
289 
299 
306 
310 
318 
320 
325  //PROTECTED METHODS
326  // Return the values of constants that might be changed by different jetFinders.
327  // Each jetFinder must define the constants as private and copy the
328  // function definitions below.
329  virtual unsigned maxRegionsIn() const { return MAX_REGIONS_IN; }
330  virtual unsigned centralCol0() const { return CENTRAL_COL0; }
331  virtual unsigned nCols() const { return N_COLS; }
332 
335  void fetchProtoJetsFromNeighbour(const fetchType ft);
337  void sortJets();
339  void doEnergySums();
340 
342  etTotalType calcEtStrip(const UShort strip) const;
343 
345  etTotalType calcHtStrip(const UShort strip) const;
346 
348  void doEtSums() ;
349 
351  void doHtSums() ;
352 
354  hfTowerSumsType calcHfSums() const;
355 
356  private:
357 
359  static const unsigned int MAX_REGIONS_IN;
360  static const unsigned int N_COLS;
361  static const unsigned int CENTRAL_COL0;
362 
365 
373 
375  template <int kBitsInput, int kBitsOutput>
377  etComponentForJetFinder(const L1GctUnsignedInt<kBitsInput>& etStrip0, const unsigned& fact0,
378  const L1GctUnsignedInt<kBitsInput>& etStrip1, const unsigned& fact1);
379 
380 
381 };
382 
383 std::ostream& operator << (std::ostream& os, const L1GctJetFinderBase& algo);
384 
385 #endif /*L1GCTJETFINDERBASE_H_*/
bool m_idInRange
Remember whether range check on the input ID was ok.
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 strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
RegionsVector m_sentProtoJets
List of pre-clustered jets to be sent to neighbour after the first stage of clustering.
unsigned long int ULong
htCompInternJfType m_outputHySum
unsigned getHtmSumJetThreshold() const
Jet Et calibration LUT.
hfTowerSumsType calcHfSums() const
Calculates Et sum and number of towers over threshold in Hf.
std::vector< L1GctInternHtMiss > getInternalHtMiss() const
bool m_gotChannelMask
Remember whether channel mask have been stored.
L1GctTwosComplement< L1GctInternHtMiss::kJetMissHtNBits > htCompInternJfType
etCompInternJfType getEySum() const
Get the y component of vector Et summed over the input regions.
Pipeline< L1GctJet > RawJetPipeline
Pipeline< etCompInternJfType > m_outputExSumPipe
RegionsVector getRcvdProtoJets() const
get protoJets received from neighbour
bool setupOk() const
Check setup is Ok.
virtual void resetPipelines()
L1 GCT internal jet candidate.
L1GctJet::lutPtr lutPtr
RegionsVector getKeptProtoJets() const
get protoJets kept
fetchType
different ways of getting the neighbour data
htCompInternJfType m_outputHxSum
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual void setupObjects()
Initialise inputs with null objects for the correct bunch crossing if required.
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.
hfTowerSumsType operator+(const hfTowerSumsType &rhs) const
void setNeighbourJetFinders(std::vector< L1GctJetFinderBase * > neighbours)
Set pointers to neighbours - needed to complete the setup.
std::vector< L1GctJet > RawJetVector
virtual unsigned centralCol0() const
Base class to allow implementation of jetFinder algorithms.
ABC for a GCT trigger data processing unit.
etCompInternJfType getExSum() const
Get the x component of vector Et summed over the input regions.
unsigned getTauJetSeed() 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.
friend std::ostream & operator<<(std::ostream &os, const L1GctJetFinderBase &algo)
Overload &lt;&lt; operator.
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.
const lutPtrVector getJetEtCalLuts() const
Return pointers to calibration LUTs.
JetVector getJets() const
Get the located jets.
int n0
Definition: AMPTWrapper.h:34
etTotalType getEtSum() const
Get the scalar sum of Et summed over the input regions.
unsigned getEtaBoundry() const
void sortJets()
Sort the found jets. All jetFinders should call this in process().
L1GctJetCount< kHfEtSumBits > etSum0
std::vector< L1GctInternEtSum > getInternalEtSums() const
get et sums in raw format - to be stored in the event
etHadType getHtSum() const
Get the scalar sum of Ht summed over jets above threshold.
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 &quot;wrong&quot; side of eta=0 (determines COL_OFFSET) ...
unsigned short int UShort
L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits > etHadType
static const unsigned int CENTRAL_COL0
unsigned getHttSumJetThreshold() const
RegionsVector m_keptProtoJets
List of pre-clustered jets retained locally as input to the final clustering.
etTotalType calcEtStrip(const UShort strip) const
Calculates total (raw) energy in a phi strip.
virtual void process()=0
process the data, fill output buffers; to be filled in by derived jetFinders
hfTowerSumsType(L1GctJetCount< kHfEtSumBits > e0, L1GctJetCount< kHfEtSumBits > e1, L1GctJetCount< kHfCountBits > n0, L1GctJetCount< kHfCountBits > n1)
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.
htCompInternJfType getHySum() const
Get the y component of vector Ht summed over jets above threshold.
RegionsVector m_inputRegions
unsigned getCenJetSeed() const
Pipeline< etCompInternJfType > m_outputEySumPipe
L1GctJetCount< kHfCountBits > nOverThreshold1
RawJetPipeline m_outputJetsPipe
Output jets &quot;pipeline memory&quot; for checking.
htCompInternJfType getHxSum() const
Get the x component of vector Ht summed over jets above threshold.
virtual void resetProcessor()
Separate reset methods for the processor itself and any data stored in pipelines. ...
RegionsVector getSentProtoJets() const
get protoJets sent to neighbour
L1GctJetCount< kHfEtSumBits > etSum1
void setupTauAlgo(const bool useImprovedAlgo, const bool ignoreVetoBitsForIsolation)
Setup the tau algorithm parameters.
L1GctTwosComplement< L1GctInternEtSum::kJetMissEtNBits > etCompInternJfType
void setInputRegion(const L1CaloRegion &region)
Set input data.
virtual unsigned nCols() const
RegionsVector getInputRegions() const
Return input data.
boost::shared_ptr< L1GctJetEtCalibrationLut > lutPtr
Definition: L1GctJet.h:38
void setEnergySumMasks(const L1GctChannelMask *chmask)
Set masks for energy summing.
hfTowerSumsType getHfSums() const
Get the Hf tower Et sums and tower-over-threshold counts.
etTotalType calcHtStrip(const UShort strip) const
Calculates total calibrated energy in jets (Ht) sum.
L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits > etTotalType
std::vector< lutPtr > lutPtrVector
void fetchProtoJetsFromNeighbour(const fetchType ft)
fetch the protoJets from neighbour jetFinder
void reset()
reset value and overflow to zero
etCompInternJfType m_outputEySum
RawJetVector getRawJets() const
get output jets in raw format
Pipeline< etTotalType > m_outputEtSumPipe
&quot;Pipeline memories&quot; for energy sums
virtual void fetchInput()=0
get input data from sources; to be filled in by derived jetFinders
bool m_gotJetFinderParams
Remember whether jetfinder parameters have been stored.
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:22
hfTowerSumsType(unsigned e0, unsigned e1, unsigned n0, unsigned n1)
virtual unsigned maxRegionsIn() const
unsigned getTauIsolationThreshold() const
unsigned m_minColThisJf
parameter to determine which Regions belong in our acceptance
LimitAlgo * algo
Definition: Combine.cc:60
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< T > contents
std::vector< L1GctRegion > RegionsVector
etCompInternJfType m_outputExSum
unsigned getFwdJetSeed() const
bool m_gotJetEtCalLuts
Remember whether jet Et calibration Lut pointers have been stored.
bool m_useImprovedTauAlgo
Setup parameters for the tau jet algorithm.
L1GctJetCount< kHfCountBits > nOverThreshold0
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.