Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1GCTHARDWAREJETFINDER_H_
0002 #define L1GCTHARDWAREJETFINDER_H_
0003 
0004 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctJetFinderBase.h"
0005 
0006 #include <vector>
0007 
0008 /*! \class L1GctHardwareJetFinder
0009  * \brief Emulation of the hardware jet finder.
0010  *
0011  *  
0012  */
0013 /*
0014  * \author Greg Heath
0015  * \date June 2006
0016  */
0017 
0018 class L1GctHardwareJetFinder : public L1GctJetFinderBase {
0019 public:
0020   /// id is 0-8 for -ve Eta jetfinders, 9-17 for +ve Eta, for increasing Phi.
0021   L1GctHardwareJetFinder(int id);
0022 
0023   ~L1GctHardwareJetFinder() override;
0024 
0025   /// Overload << operator
0026   friend std::ostream& operator<<(std::ostream& os, const L1GctHardwareJetFinder& algo);
0027 
0028   /// include additional reset functionality
0029   virtual void reset();
0030 
0031   /// get input data from sources
0032   void fetchInput() override;
0033 
0034   /// process the data, fill output buffers
0035   void process() override;
0036 
0037 protected:
0038   // Each jetFinder must define the constants as private and copy the
0039   // function definitions below.
0040   unsigned maxRegionsIn() const override { return MAX_REGIONS_IN; }
0041   unsigned centralCol0() const override { return CENTRAL_COL0; }
0042   unsigned nCols() const override { return N_COLS; }
0043 
0044 private:
0045   /// The real jetFinders must define these constants
0046   static const unsigned int MAX_REGIONS_IN;  ///< Dependent on number of rows and columns.
0047   static const unsigned int N_COLS;
0048   static const unsigned int CENTRAL_COL0;
0049 
0050   /// Local vectors used during both stages of clustering
0051   RegionsVector m_localMaxima;
0052   /// Each local maximum becomes a cluster
0053   RegionsVector m_clusters;
0054 
0055   /// The number of local Maxima/clusters found at each stage of clustering
0056   unsigned m_numberOfClusters;
0057 
0058   // Additional clusters to avoid double counting of jets across eta=0
0059   RegionsVector m_localMax00;
0060   RegionsVector m_cluster00;
0061 
0062   /// The first stage of clustering, called by fetchInput()
0063   void findProtoJets();
0064   L1GctRegion makeProtoJet(L1GctRegion localMax);
0065   /// The second stage of clustering, called by process()
0066   void findJets();
0067 
0068   /// Find local maxima in the search array
0069   void findLocalMaxima();
0070   /// Convert local maxima to clusters
0071   void findProtoClusters();
0072   /// Convert protojets to final jets
0073   void findFinalClusters();
0074 
0075   /// Organise the pre-clustered jets into the ones we keep and those we send to the neighbour
0076   void convertClustersToProtoJets();
0077   /// Organise the final clustered jets into L1GctJets
0078   void convertClustersToOutputJets();
0079 };
0080 
0081 std::ostream& operator<<(std::ostream& os, const L1GctHardwareJetFinder& algo);
0082 
0083 #endif /*L1GCTHARDWAREJETFINDER_H_*/