Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:07

0001 #ifndef L1GCTELECTRONLEAFCARD_H_
0002 #define L1GCTELECTRONLEAFCARD_H_
0003 
0004 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEmCand.h"
0005 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctElectronSorter.h"
0006 
0007 #include <vector>
0008 #include <ostream>
0009 
0010 /*!
0011  * \Class L1GctEmLeafCard
0012  * \brief Emulates a leaf card programmed for electron sorting
0013  *
0014  * This class does the 1st stage sorting of the electron candidates.
0015  *
0016  * \author  Jim Brooke
0017  * \date    20/02/06
0018  */
0019 
0020 class L1GctEmLeafCard : public L1GctProcessor {
0021 public:
0022   static const unsigned N_SORTERS;
0023 
0024 public:
0025   /// construct with ID
0026   L1GctEmLeafCard(int id);
0027   ///
0028   /// destruct
0029   ~L1GctEmLeafCard() override;
0030   ///
0031   /// clear internal trigger data buffers
0032   void reset();
0033   ///
0034   /// fetch input data
0035   void fetchInput() override;
0036   ///
0037   /// process the event
0038   void process() override;
0039   ///
0040   /// define the bunch crossing range to process
0041   void setBxRange(const int firstBx, const int numberOfBx);
0042   ///
0043   /// clear input data buffers and process a new bunch crossing
0044   void setNextBx(const int bxnum);
0045   ///
0046   /// get ID
0047   int id() { return m_id; }
0048   ///
0049   /// get the output candidates
0050   std::vector<L1GctEmCand> getOutputIsoEmCands(int fpga);
0051   ///
0052   /// get the output candidates
0053   std::vector<L1GctEmCand> getOutputNonIsoEmCands(int fpga);
0054   ///
0055   /// overload of cout operator
0056   friend std::ostream& operator<<(std::ostream& s, const L1GctEmLeafCard& card);
0057 
0058   L1GctElectronSorter* getIsoElectronSorterU1() { return m_sorters.at(0); }
0059   L1GctElectronSorter* getNonIsoElectronSorterU1() { return m_sorters.at(1); }
0060   L1GctElectronSorter* getIsoElectronSorterU2() { return m_sorters.at(2); }
0061   L1GctElectronSorter* getNonIsoElectronSorterU2() { return m_sorters.at(3); }
0062 
0063 protected:
0064   /// Separate reset methods for the processor itself and any data stored in pipelines
0065   void resetProcessor() override {}
0066   void resetPipelines() override {}
0067 
0068   /// Initialise inputs with null objects for the correct bunch crossing if required
0069   void setupObjects() override {}
0070 
0071 private:
0072   /// card ID (0 or 1)
0073   int m_id;
0074   ///
0075   /// processing - 0,2 are iso sorters, 1,3 are non-iso
0076   std::vector<L1GctElectronSorter*> m_sorters;
0077 };
0078 
0079 std::ostream& operator<<(std::ostream& s, const L1GctEmLeafCard& card);
0080 #endif /*L1GCTELECTRONLEAFCARD_H_*/