Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1GCTJETFINALSTAGE_H_
0002 #define L1GCTJETFINALSTAGE_H_
0003 
0004 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctJetCand.h"
0005 
0006 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctProcessor.h"
0007 
0008 #include <vector>
0009 
0010 class L1GctWheelJetFpga;
0011 class L1GctJetSorter;
0012 
0013 /*!
0014 * \class L1GctJetFinalStage
0015 * \brief Represents the final stage of L1 jet processing.
0016 *
0017 *  Takes as input the jet data from the two Wheel Jet FPGAs
0018 *  and outputs the top four of each type of jet - central, forward,
0019 *  and tau - for the whole of the CMS detector.
0020 * 
0021 * \author Jim Brooke & Robert Frazier
0022 * \date June 2006
0023 */
0024 
0025 class L1GctJetFinalStage : public L1GctProcessor {
0026 public:
0027   typedef std::vector<L1GctJetCand> JetVector;
0028   typedef Pipeline<L1GctJetCand> JetPipeline;
0029   static const unsigned int MAX_WHEEL_FPGAS;  ///< Max number of wheel FPGA pointers
0030 
0031   /// Takes a vector of 2 wheel jet FPGA pointers, with which to get input data from
0032   L1GctJetFinalStage(const std::vector<L1GctWheelJetFpga*>& m_wheelFpgas);
0033   ~L1GctJetFinalStage() override;
0034 
0035   /// Overload << operator
0036   friend std::ostream& operator<<(std::ostream& os, const L1GctJetFinalStage& fpga);
0037 
0038   /// get input data from sources
0039   void fetchInput() override;
0040 
0041   /// process the data, fill output buffers
0042   void process() override;
0043 
0044   void setInputCentralJet(int i, const L1GctJetCand& jet);  ///< set the central jets input data
0045   void setInputForwardJet(int i, const L1GctJetCand& jet);  ///< set the forward jets input data
0046   void setInputTauJet(int i, const L1GctJetCand& jet);      ///< set the tau jets input data
0047 
0048   JetVector getInputCentralJets() const { return m_inputCentralJets; }  ///< get the central jets input data
0049   JetVector getInputForwardJets() const { return m_inputForwardJets; }  ///< get the forward jets input data
0050   JetVector getInputTauJets() const { return m_inputTauJets; }          ///< get the tau jets input data
0051 
0052   JetVector getCentralJets() const { return m_centralJets.contents; }  ///< get the central jets output data
0053   JetVector getForwardJets() const { return m_forwardJets.contents; }  ///< get the forward jets output data
0054   JetVector getTauJets() const { return m_tauJets.contents; }          ///< get the tau jets output data
0055 
0056   bool setupOk() const { return m_setupOk; }
0057 
0058 protected:
0059   /// Separate reset methods for the processor itself and any data stored in pipelines
0060   void resetProcessor() override;
0061   void resetPipelines() override;
0062 
0063   /// Initialise inputs with null objects for the correct bunch crossing if required
0064   void setupObjects() override {}
0065 
0066 private:
0067   static const int MAX_JETS_IN;   ///< Max number of jets of each type coming in
0068   static const int MAX_JETS_OUT;  ///< Max number of jets of each type going out
0069 
0070   /// wheel jet FPGAs
0071   std::vector<L1GctWheelJetFpga*> m_wheelFpgas;
0072 
0073   /// Jet sorters
0074   L1GctJetSorter* m_centralJetSorter;
0075   L1GctJetSorter* m_forwardJetSorter;
0076   L1GctJetSorter* m_tauJetSorter;
0077 
0078   // input data
0079   JetVector m_inputCentralJets;
0080   JetVector m_inputForwardJets;
0081   JetVector m_inputTauJets;
0082 
0083   // output data
0084   JetPipeline m_centralJets;
0085   JetPipeline m_forwardJets;
0086   JetPipeline m_tauJets;
0087 
0088   // setup flag
0089   bool m_setupOk;
0090 
0091   //PRIVATE MEMBER FUNCTIONS
0092   ///Enters jets into the specified storageVector, according to which wheel card we are taking them from.
0093   void storeJets(JetVector& storageVector, const JetVector& jets, unsigned short iWheel);
0094 };
0095 
0096 std::ostream& operator<<(std::ostream& os, const L1GctJetFinalStage& fpga);
0097 
0098 #endif /*L1GCTJETFINALSTAGE_H_*/