Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:23:26

0001 #ifndef OMTF_XMLConfigReader_H
0002 #define OMTF_XMLConfigReader_H
0003 
0004 #include <string>
0005 #include <vector>
0006 #include <ostream>
0007 #include <memory>
0008 
0009 #include "xercesc/util/XercesDefs.hpp"
0010 #include "xercesc/dom/DOM.hpp"
0011 
0012 #include "CondFormats/L1TObjects/interface/LUT.h"
0013 #include "L1Trigger/L1TMuonOverlap/interface/OMTFConfiguration.h"
0014 
0015 class GoldenPattern;
0016 class OMTFConfiguration;
0017 class L1TMuonOverlapParams;
0018 
0019 namespace XERCES_CPP_NAMESPACE {
0020 
0021   class DOMElement;
0022   class XercesDOMParser;
0023 
0024 }  // namespace XERCES_CPP_NAMESPACE
0025 
0026 class XMLConfigReader {
0027 public:
0028   XMLConfigReader();
0029   ~XMLConfigReader();
0030 
0031   void readConfig(const std::string fName);
0032 
0033   void setConfigFile(const std::string &fName) { configFile = fName; }
0034 
0035   void setPatternsFile(const std::string &fName) { patternsFile = fName; }
0036 
0037   void setEventsFile(const std::string &fName) { eventsFile = fName; }
0038 
0039   std::vector<std::shared_ptr<GoldenPattern>> readPatterns(const L1TMuonOverlapParams &aConfig);
0040 
0041   void readLUTs(std::vector<l1t::LUT *> luts,
0042                 const L1TMuonOverlapParams &aConfig,
0043                 const std::vector<std::string> &types);
0044 
0045   void readConfig(L1TMuonOverlapParams *aConfig) const;
0046 
0047   unsigned int getPatternsVersion() const;
0048 
0049   std::vector<std::vector<int>> readEvent(unsigned int iEvent = 0, unsigned int iProcessor = 0, bool readEta = false);
0050 
0051 private:
0052   std::string configFile;    //XML file with general configuration
0053   std::string patternsFile;  //XML file with GoldenPatterns
0054   std::string eventsFile;    //XML file with events
0055 
0056   std::unique_ptr<GoldenPattern> buildGP(xercesc::DOMElement *aGPElement,
0057                                          const L1TMuonOverlapParams &aConfig,
0058                                          unsigned int index = 0,
0059                                          unsigned int aGPNumber = 999);
0060 
0061   //  xercesc::XercesDOMParser *parser;
0062   //  xercesc::DOMDocument* doc;
0063 
0064   ///Cache with GPs read.
0065   std::vector<std::shared_ptr<GoldenPattern>> aGPs;
0066 };
0067 
0068 #endif