Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-06 02:54:07

0001 #ifndef L1T_OmtfP1_XMLConfigWriter_H
0002 #define L1T_OmtfP1_XMLConfigWriter_H
0003 
0004 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OmtfName.h"
0005 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/OMTFConfiguration.h"
0006 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/GoldenPatternBase.h"
0007 #include <string>
0008 #include <vector>
0009 
0010 #include "xercesc/util/XercesDefs.hpp"
0011 
0012 class GoldenPattern;
0013 class OMTFConfiguration;
0014 class OMTFinput;
0015 class GoldenPatternResult;
0016 class AlgoMuon;
0017 namespace l1t {
0018   class RegionalMuonCand;
0019 }
0020 struct Key;
0021 
0022 namespace XERCES_CPP_NAMESPACE {
0023   class DOMElement;
0024   class DOMDocument;
0025   class DOMImplementation;
0026 }  // namespace XERCES_CPP_NAMESPACE
0027 
0028 class XMLConfigWriter {
0029 public:
0030   XMLConfigWriter(const OMTFConfiguration* aOMTFConfig,
0031                   bool writePdfThresholds = false,
0032                   bool writeMeanDistPhi1 = false);
0033 
0034   void initialiseXMLDocument(const std::string& docName);
0035 
0036   void finaliseXMLDocument(const std::string& fName);
0037 
0038   xercesc::DOMElement* writeEventHeader(unsigned int eventId, unsigned int mixedEventId = 0);
0039 
0040   xercesc::DOMElement* writeEventData(xercesc::DOMElement* aTopElement, const OmtfName& board, const OMTFinput& aInput);
0041 
0042   void writeAlgoMuon(xercesc::DOMElement* aTopElement, const AlgoMuon& aMuon);
0043 
0044   void writeCandMuon(xercesc::DOMElement* aTopElement, const l1t::RegionalMuonCand& aCand);
0045 
0046   void writeResultsData(xercesc::DOMElement* aTopElement,
0047                         unsigned int iRegion,
0048                         const Key& aKey,
0049                         const GoldenPatternResult& aResult);
0050 
0051   void writeGPData(GoldenPattern& aGP);
0052 
0053   void writeGPData(GoldenPattern* aGP1, GoldenPattern* aGP2, GoldenPattern* aGP3, GoldenPattern* aGP4);
0054 
0055   template <class GoldenPatternType>
0056   void writeGPs(const GoldenPatternVec<GoldenPatternType>& goldenPats, std::string fName);
0057 
0058   void writeConnectionsData(const std::vector<std::vector<OMTFConfiguration::vector2D> >& measurements4D);
0059 
0060   unsigned int findMaxInput(const OMTFConfiguration::vector1D& myCounts);
0061 
0062 private:
0063   xercesc::DOMImplementation* domImpl;
0064   xercesc::DOMElement* theTopElement;
0065   xercesc::DOMDocument* theDoc;
0066 
0067   const OMTFConfiguration* myOMTFConfig;
0068 
0069   bool writePdfThresholds = false;
0070   bool writeMeanDistPhi1 = false;
0071 };
0072 
0073 //////////////////////////////////
0074 //////////////////////////////////
0075 #endif