File indexing completed on 2025-05-27 01:56:23
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 }
0027
0028 class XMLConfigWriter {
0029 public:
0030 XMLConfigWriter(const OMTFConfiguration* aOMTFConfig,
0031 bool writePdfThresholds = false,
0032 bool writeMeanDistPhi1 = false);
0033
0034 ~XMLConfigWriter();
0035
0036 void initialiseXMLDocument(const std::string& docName);
0037
0038 void finaliseXMLDocument(const std::string& fName);
0039
0040 xercesc::DOMElement* writeEventHeader(unsigned int eventId, unsigned int mixedEventId = 0);
0041
0042 xercesc::DOMElement* writeEventData(xercesc::DOMElement* aTopElement, const OmtfName& board, const OMTFinput& aInput);
0043
0044 void writeAlgoMuon(xercesc::DOMElement* aTopElement, const AlgoMuon& aMuon);
0045
0046 void writeCandMuon(xercesc::DOMElement* aTopElement, const l1t::RegionalMuonCand& aCand);
0047
0048 void writeResultsData(xercesc::DOMElement* aTopElement,
0049 unsigned int iRegion,
0050 const Key& aKey,
0051 const GoldenPatternResult& aResult);
0052
0053 void writeGPData(GoldenPattern& aGP);
0054
0055 void writeGPData(GoldenPattern* aGP1, GoldenPattern* aGP2, GoldenPattern* aGP3, GoldenPattern* aGP4);
0056
0057 template <class GoldenPatternType>
0058 void writeGPs(const GoldenPatternVec<GoldenPatternType>& goldenPats, std::string fName);
0059
0060 void writeConnectionsData(const std::vector<std::vector<OMTFConfiguration::vector2D> >& measurements4D);
0061
0062 unsigned int findMaxInput(const OMTFConfiguration::vector1D& myCounts);
0063
0064 private:
0065 xercesc::DOMImplementation* domImpl;
0066 xercesc::DOMElement* theTopElement;
0067 xercesc::DOMDocument* theDoc;
0068
0069 const OMTFConfiguration* myOMTFConfig;
0070
0071 bool writePdfThresholds = false;
0072 bool writeMeanDistPhi1 = false;
0073 };
0074
0075
0076
0077 #endif