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 L1CaloRegion;
22 
23 
44 /*
45  * \author Jim Brooke & Greg Heath
46  * \date June 2006
47  */
48 
50 {
51 public:
52  //Typedefs
53  typedef unsigned long int ULong;
54  typedef unsigned short int UShort;
55  typedef std::vector<L1GctRegion> RegionsVector;
56  typedef std::vector<L1GctJet> RawJetVector;
57  typedef std::vector<L1GctJetCand> JetVector;
58  typedef Pipeline<L1GctJet> RawJetPipeline;
63 
64  enum maxValues {
67  };
68 
69 
70  // For HF-based triggers we sum the Et in the two "inner" (large eta) rings;
71  // and count towers over threshold based on the "fineGrain" bit from the RCT.
72  // Define a data type to transfer the result of all calculations.
73  // The results are defined as L1GctJetCount types since they don't have
74  // a separate overFlow bit. An overflow condition gives value=max.
75 
76  struct hfTowerSumsType {
77 
78  enum numberOfBits {
81  };
82 
87 
88  // Define some constructors and an addition operator for our data type
90  hfTowerSumsType(unsigned e0, unsigned e1, unsigned n0, unsigned n1) :
91  etSum0(e0), etSum1(e1), nOverThreshold0(n0), nOverThreshold1(n1) {}
96 
98 
100  hfTowerSumsType temp( (this->etSum0+rhs.etSum0),
101  (this->etSum1+rhs.etSum1),
102  (this->nOverThreshold0+rhs.nOverThreshold0),
103  (this->nOverThreshold1+rhs.nOverThreshold1) );
104  return temp;
105  }
106 
107  };
108 
110  typedef std::vector<lutPtr> lutPtrVector;
111 
112  //Statics
113  static const unsigned int MAX_JETS_OUT;
114  static const unsigned int COL_OFFSET;
115  static const unsigned int N_JF_PER_WHEEL;
116  static const unsigned int N_EXTRA_REGIONS_ETA00;
117 
119  L1GctJetFinderBase(int id);
120 
122 
124  void setNeighbourJetFinders(std::vector<L1GctJetFinderBase*> neighbours);
125 
127  void setJetFinderParams(const L1GctJetFinderParams* jfpars);
128 
130  void setJetEtCalibrationLuts(const lutPtrVector& jfluts);
131 
133  void setupTauAlgo(const bool useImprovedAlgo, const bool ignoreVetoBitsForIsolation) {
134  m_useImprovedTauAlgo = useImprovedAlgo;
135  m_ignoreTauVetoBitsForIsolation = ignoreVetoBitsForIsolation;
136  }
137 
139  bool setupOk() const { return m_idInRange
142  && m_gotJetEtCalLuts; }
143 
145  friend std::ostream& operator << (std::ostream& os, const L1GctJetFinderBase& algo);
146 
148  virtual void fetchInput() = 0;
149 
151  virtual void process() = 0;
152 
154  void setInputRegion(const L1CaloRegion& region);
155 
158 
161 
164 
167 
169  RawJetVector getRawJets() const { return m_outputJetsPipe.contents; }
170 
172  std::vector< L1GctInternJetData > getInternalJets() const;
173 
175  std::vector< L1GctInternEtSum > getInternalEtSums() const;
176  std::vector< L1GctInternHtMiss > getInternalHtMiss() const;
177 
179  const lutPtrVector getJetEtCalLuts() const { return m_jetEtCalLuts; }
180 
181  // The hardware output quantities
182  JetVector getJets() const { return m_sortedJets; }
183  // The hardware output quantities - refactored
184  etTotalType getEtSum() const { return m_outputEtSum; }
187  etHadType getHtSum() const { return m_outputHtSum; }
190 
192 
193  // Access to threshold and cut values
194  unsigned getCenJetSeed() const { return m_CenJetSeed; }
195  unsigned getFwdJetSeed() const { return m_FwdJetSeed; }
196  unsigned getTauJetSeed() const { return m_TauJetSeed; }
197  unsigned getEtaBoundry() const { return m_EtaBoundry; }
199  unsigned getHttSumJetThreshold() const { return m_HttSumJetThreshold; }
200  unsigned getHtmSumJetThreshold() const { return m_HtmSumJetThreshold; }
201 
202  protected:
203 
205  virtual void resetProcessor();
206  virtual void resetPipelines();
207 
209  virtual void setupObjects();
210 
211  protected:
212 
214  enum fetchType { TOP, BOT, TOPBOT };
215 
217  int m_id;
218 
220  std::vector<L1GctJetFinderBase*> m_neighbourJetFinders;
221 
224 
227 
230 
233 
235  unsigned m_CenJetSeed;
236  unsigned m_FwdJetSeed;
237  unsigned m_TauJetSeed;
238  unsigned m_EtaBoundry;
239 
242 
244  // If the following parameter is set to false, the tau identification
245  // is just based on the RCT tau veto bits from the nine regions
247 
248  // If useImprovedTauAlgo is true, these two parameters affect
249  // the operation of the algorithm.
250 
251  // We can require the tau veto bits to be off in all nine regions,
252  // or just in the central region.
254 
255  // In the improved tau algorithm, we require no more than one tower energy to be
256  // above the isolation threshold, in the eight regions surrounding the central one.
258 
261 
268 
272 
275 
283 
285 
286  //PROTECTED METHODS
287  // Return the values of constants that might be changed by different jetFinders.
288  // Each jetFinder must define the constants as private and copy the
289  // function definitions below.
290  virtual unsigned maxRegionsIn() const { return MAX_REGIONS_IN; }
291  virtual unsigned centralCol0() const { return CENTRAL_COL0; }
292  virtual unsigned nCols() const { return N_COLS; }
293 
296  void fetchProtoJetsFromNeighbour(const fetchType ft);
298  void sortJets();
300  void doEnergySums();
301 
303  etTotalType calcEtStrip(const UShort strip) const;
304 
306  etTotalType calcHtStrip(const UShort strip) const;
307 
309  void doEtSums() ;
310 
312  void doHtSums() ;
313 
315  hfTowerSumsType calcHfSums() const;
316 
318  unsigned m_minColThisJf;
319 
320  private:
321 
323  static const unsigned int MAX_REGIONS_IN;
324  static const unsigned int N_COLS;
325  static const unsigned int CENTRAL_COL0;
326 
329 
331  Pipeline< etTotalType > m_outputEtSumPipe;
332  Pipeline< etCompInternJfType > m_outputExSumPipe;
333  Pipeline< etCompInternJfType > m_outputEySumPipe;
334  Pipeline< etHadType > m_outputHtSumPipe;
335  Pipeline< htCompInternJfType > m_outputHxSumPipe;
336  Pipeline< htCompInternJfType > m_outputHySumPipe;
337 
339  template <int kBitsInput, int kBitsOutput>
341  etComponentForJetFinder(const L1GctUnsignedInt<kBitsInput>& etStrip0, const unsigned& fact0,
342  const L1GctUnsignedInt<kBitsInput>& etStrip1, const unsigned& fact1);
343 
344 
345 };
346 
347 std::ostream& operator << (std::ostream& os, const L1GctJetFinderBase& algo);
348 
349 #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
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
input data required for jet finding
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.
unsigned m_CenJetSeed
jetFinder parameters (from EventSetup)
virtual unsigned nCols() const
RegionsVector getInputRegions() const
Return input data.
boost::shared_ptr< L1GctJetEtCalibrationLut > lutPtr
Definition: L1GctJet.h:38
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
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
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.