Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:51

0001 #ifndef L1GCTTDRJETFINDER_H_
0002 #define L1GCTTDRJETFINDER_H_
0003 
0004 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctJetFinderBase.h"
0005 
0006 #include <vector>
0007 
0008 /*! \class L1GctTdrJetFinder
0009  * \brief 3*3 sliding window algorithm jet finder.
0010  *
0011  *  Locates the jets from 48 inputted L1CaloRegions.
0012  *  This uses the 3*3 sliding window algorithm.
0013  * 
0014  *  The the filling of the input L1CaloRegions happens in the L1GctJetFinderBase class
0015  *
0016  *  Inputted regions are expected in a certain order with respect
0017  *  to the index i:
0018  * 
0019  *  Regions should arrive running from the middle (eta=0) of the detector
0020  *  out towards the edge of the forward HCAL, and then moving across
0021  *  in columns like this but increasing in phi each time.
0022  * 
0023  *  E.g. for 48 inputted regions:
0024  *       region  0: phi=0, other side of eta=0 line (shared data).
0025  *       region  1: phi=0, but correct side of eta=0 (shared data).
0026  *       .
0027  *       . 
0028  *       region 11: phi=0, edge of Forward HCAL (shared data).
0029  *       region 12: phi=20, other side of eta=0 line (shared data)
0030  *       region 13: phi=20, start of jet search area
0031  *       .
0032  *       .
0033  *       region 23: phi=20, edge of HF (jet search area)
0034  *       etc.
0035  * 
0036  *  In the event of neighbouring regions having the same energy, this
0037  *  will locate the jet in the region furthest from eta=0 that has the
0038  *  lowest value of phi.
0039  * 
0040  *  The jet finder now stores jets with (eta, phi) information encoded
0041  *  in an L1CaloRegionDetId.
0042  *
0043  *  Modified to use L1GctJetFinderBase class by Greg Heath, June 2006.
0044  *  
0045  */
0046 /*
0047  * \author Jim Brooke & Robert Frazier
0048  * \date March 2006
0049  */
0050 
0051 class L1GctTdrJetFinder : public L1GctJetFinderBase {
0052 public:
0053   /// id is 0-8 for -ve Eta jetfinders, 9-17 for +ve Eta, for increasing Phi.
0054   L1GctTdrJetFinder(int id);
0055 
0056   ~L1GctTdrJetFinder() override;
0057 
0058   /// Overload << operator
0059   friend std::ostream& operator<<(std::ostream& os, const L1GctTdrJetFinder& algo);
0060 
0061   /// get input data from sources
0062   void fetchInput() override;
0063 
0064   /// process the data, fill output buffers
0065   void process() override;
0066 
0067 protected:
0068   // Each jetFinder must define the constants as private and copy the
0069   // function definitions below.
0070   unsigned maxRegionsIn() const override { return MAX_REGIONS_IN; }
0071   unsigned centralCol0() const override { return CENTRAL_COL0; }
0072   unsigned int nCols() const override { return N_COLS; }
0073 
0074 private:
0075   /// The real jetFinders must define these constants
0076   static const unsigned int MAX_REGIONS_IN;  ///< Dependent on number of rows and columns.
0077   static const unsigned int N_COLS;
0078   static const unsigned int CENTRAL_COL0;
0079 
0080   /// Here is the TDR 3x3 sliding window jet finder algorithm
0081   void findJets();
0082 
0083   /// Returns true if region index is the centre of a jet. Set boundary = true if at edge of HCAL.
0084   bool detectJet(const UShort centreIndex, const bool boundary = false) const;
0085 
0086   /// Returns energy sum of the 9 regions centred (physically) about centreIndex. Set boundary = true if at edge of HCAL.
0087   ULong calcJetEnergy(const UShort centreIndex, const bool boundary = false) const;
0088 
0089   /// returns the encoded (eta, phi) position of the centre region
0090   L1CaloRegionDetId calcJetPosition(const UShort centreIndex) const;
0091 
0092   /// Returns combined tauVeto of the 9 regions centred (physically) about centreIndex. Set boundary = true if at edge of Endcap.
0093   bool calcJetTauVeto(const UShort centreIndex, const bool boundary = false) const;
0094 };
0095 
0096 std::ostream& operator<<(std::ostream& os, const L1GctTdrJetFinder& algo);
0097 
0098 #endif /*L1GCTTDRJETFINDER_H_*/