Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:18

0001 #ifndef L1GtConfigProducers_L1GtVhdlWriterBitManager_h
0002 #define L1GtConfigProducers_L1GtVhdlWriterBitManager_h
0003 
0004 /**
0005  * \class L1GtVhdlWriterBitManager
0006  *
0007  *
0008  * \Description This class builds the LUTS for the GT firmware. Furthermore it is providing some helpers
0009  *  for basic bit operations in binary and hex format.
0010  *
0011  * Implementation:
0012  *    <TODO: enter implementation details>
0013  *
0014  * \author Philipp Wagner
0015  *
0016  *
0017  */
0018 
0019 #include "L1GtVhdlTemplateFile.h"
0020 
0021 // system include files
0022 
0023 #include <iostream>
0024 #include <fstream>
0025 #include <map>
0026 #include <string>
0027 #include <vector>
0028 
0029 #include "CondFormats/L1TObjects/interface/L1GtCaloTemplate.h"
0030 #include "CondFormats/L1TObjects/interface/L1GtMuonTemplate.h"
0031 #include "CondFormats/L1TObjects/interface/L1GtEnergySumTemplate.h"
0032 
0033 class L1GtVhdlWriterBitManager {
0034 private:
0035   std::map<std::string, std::string> hex2binMap_;
0036 
0037 public:
0038   L1GtVhdlWriterBitManager();
0039   std::string bin2hex(std::string binString);
0040   std::string hex2bin(std::string hexString);
0041   std::string capitalLetters(std::string hexString);
0042   std::string mirror(unsigned int offset, std::string hexString, bool hexOutput = true);
0043   std::string readMapInverse(const std::map<std::string, std::string> &map, std::string value);
0044   std::string shiftLeft(std::string hexString);
0045   std::string buildEtaMuon(const std::vector<L1GtMuonTemplate::ObjectParameter> *op,
0046                            const unsigned int &num,
0047                            const unsigned int &counter);
0048   std::string buildEtaCalo(const std::vector<L1GtCaloTemplate::ObjectParameter> *op,
0049                            const unsigned int &num,
0050                            const unsigned int &counter);
0051   /// \param high is true in order to build phiHigh and false in order to build phiLow
0052   std::string buildPhiMuon(const std::vector<L1GtMuonTemplate::ObjectParameter> *op,
0053                            const unsigned int &num,
0054                            const unsigned int &counter,
0055                            bool high);
0056   std::string buildPhiCalo(const std::vector<L1GtCaloTemplate::ObjectParameter> *op,
0057                            const unsigned int &num,
0058                            const unsigned int &counter);
0059   std::string buildPhiEnergySum(const std::vector<L1GtEnergySumTemplate::ObjectParameter> *op,
0060                                 const unsigned int &num,
0061                                 const unsigned int &counter);
0062   std::string buildDeltaEtaMuon(const L1GtMuonTemplate::CorrelationParameter *&cp, const unsigned int &counter);
0063   std::string buildDeltaEtaCalo(const L1GtCaloTemplate::CorrelationParameter *&cp, const unsigned int &counter);
0064   std::string buildDeltaPhiMuon(const L1GtMuonTemplate::CorrelationParameter *&cp, const unsigned int &counter);
0065   std::string buildDeltaPhiCalo(const L1GtCaloTemplate::CorrelationParameter *&cp, const unsigned int &counter);
0066 };
0067 #endif /*L1GtConfigProducers_L1GtVhdlWriterBitManager_h*/