Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef GCTTESTFIRMWARE_H_
0002 #define GCTTESTFIRMWARE_H_
0003 
0004 /*!
0005  * \class gctTestFirmware
0006  * \brief Test of the emulation of jetfinder firmware
0007  * 
0008  * Test functionality for comparison of emulator and firmware jetfinders,
0009  * migrated from standalone test programs
0010  *
0011  * \author Greg Heath
0012  * \date March 2007
0013  *
0014  */
0015 
0016 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctJet.h"
0017 
0018 #include <vector>
0019 #include <fstream>
0020 
0021 class L1GlobalCaloTrigger;
0022 
0023 class gctTestFirmware {
0024 public:
0025   // structs and typedefs
0026   typedef std::vector<L1GctJet> JetsVector;
0027 
0028   // Constructor and destructor
0029   gctTestFirmware();
0030   ~gctTestFirmware();
0031 
0032   /// Read the firmware results from a file for the next event
0033   void fillJetsFromFirmware(const std::string& fileName, const int bxStart, const int numOfBx);
0034 
0035   /// Check the jet finder against the results from the firmware
0036   bool checkJetFinder(const L1GlobalCaloTrigger* gct) const;
0037 
0038   /// Analyse calculation of energy sums in firmware
0039   bool checkEnergySumsFromFirmware(const L1GlobalCaloTrigger* gct, const std::string& fileName, const int numOfBx);
0040 
0041 private:
0042   // FUNCTION PROTOTYPES FOR JET FINDER CHECKING
0043   /// Read one event's worth of jets from the file
0044   std::vector<JetsVector> getJetsFromFile(const int bxStart, const int numOfBx);
0045   /// Read a single jet
0046   L1GctJet nextJetFromFile(const unsigned jf, const int bx);
0047   //=========================================================================
0048 
0049   std::vector<JetsVector> jetsFromFile;
0050 
0051   std::ifstream jetsFromFirmwareInputFile;
0052   std::ifstream esumsFromFirmwareInputFile;
0053 };
0054 
0055 #endif /*GCTTEST_H_*/