Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1GCTELECTRONFINALSORT_H_
0002 #define L1GCTELECTRONFINALSORT_H_
0003 
0004 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEmCand.h"
0005 
0006 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctProcessor.h"
0007 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctElectronSorter.h"
0008 
0009 #include <vector>
0010 
0011 /*!
0012  * \Class L1GctElectronFinalSort
0013  * \brief Does the final sorting of electron candidates
0014  *
0015  * This class can be constructed to sort iso or non-iso
0016  * electron candidates, which have been through the
0017  * 1st stage sorters on the 2 electron leaf cards.
0018  * The electrons are sorted in ascending order and the 4
0019  * highest in rank will be returned.
0020  * It represents the final-sorter FPGA on the concentrator card.
0021  *
0022  * \author  Maria Hansen
0023  * \date    12/05/06
0024  */
0025 
0026 class L1GctEmLeafCard;
0027 
0028 class L1GctElectronFinalSort : public L1GctProcessor {
0029 public:
0030   /// Use some definitions from the ElectronSorter in the leaf cards
0031   typedef L1GctElectronSorter::prioritisedEmCand prioritisedEmCand;
0032   ///
0033   /// constructor
0034   L1GctElectronFinalSort(bool iso, L1GctEmLeafCard* posEtaCard, L1GctEmLeafCard* negEtaCard);
0035   ///
0036   /// destructor
0037   ~L1GctElectronFinalSort() override;
0038   ///
0039   /// get input data from sources
0040   void fetchInput() override;
0041   ///
0042   /// process the data, fill output buffers
0043   void process() override;
0044   ///
0045   /// set input data
0046   void setInputEmCand(unsigned i, const L1GctEmCand& cand);
0047   ///
0048   /// return input data
0049   inline std::vector<L1GctEmCand> getInputCands() const { return m_inputCands; }
0050   ///
0051   /// return output data
0052   inline std::vector<L1GctEmCand> getOutputCands() const { return m_outputCands.contents; }
0053   ///
0054   /// overload of cout operator
0055   friend std::ostream& operator<<(std::ostream& s, const L1GctElectronFinalSort& cand);
0056   ///
0057   /// check setup
0058   bool setupOk() const { return m_setupOk; }
0059 
0060 protected:
0061   /// Separate reset methods for the processor itself and any data stored in pipelines
0062   void resetProcessor() override;
0063   void resetPipelines() override;
0064 
0065   /// Initialise inputs with null objects for the correct bunch crossing if required
0066   void setupObjects() override {}
0067 
0068 private:
0069   ///
0070   /// type of electron candidate (iso(0) or non-iso(1))
0071   bool m_emCandsType;
0072   ///
0073   /// the 1st stage electron sorters
0074   L1GctEmLeafCard* m_thePosEtaLeafCard;
0075   L1GctEmLeafCard* m_theNegEtaLeafCard;
0076   ///
0077   /// input data
0078   std::vector<L1GctEmCand> m_inputCands;
0079   ///
0080   /// output data
0081   Pipeline<L1GctEmCand> m_outputCands;
0082 
0083   /// Check the setup
0084   bool m_setupOk;
0085 };
0086 
0087 std::ostream& operator<<(std::ostream& s, const L1GctElectronFinalSort& cand);
0088 
0089 #endif /*L1GCTELECTRONFINALSORT_H_*/