Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:06

0001 /*
0002  * XMLEventWriter.h
0003  *
0004  *  Created on: Oct 12, 2017
0005  *      Author: kbunkow
0006  */
0007 
0008 #ifndef L1T_OmtfP1_XMLEVENTWRITER_H_
0009 #define L1T_OmtfP1_XMLEVENTWRITER_H_
0010 
0011 #include "DataFormats/L1TMuon/interface/RegionalMuonCand.h"
0012 #include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h"
0013 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/AlgoMuon.h"
0014 #include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/IOMTFEmulationObserver.h"
0015 
0016 #include <boost/property_tree/ptree.hpp>
0017 
0018 #include <memory>
0019 #include <string>
0020 #include <vector>
0021 
0022 class XMLEventWriter : public IOMTFEmulationObserver {
0023 public:
0024   XMLEventWriter(const OMTFConfiguration* aOMTFConfig, std::string fName);
0025 
0026   ~XMLEventWriter() override;
0027 
0028   void observeProcesorBegin(unsigned int iProcessor, l1t::tftype mtfType) override;
0029 
0030   void addProcesorData(std::string key, boost::property_tree::ptree& procDataTree) override {
0031     procTree.add_child(key, procDataTree);
0032   }
0033 
0034   void observeProcesorEmulation(unsigned int iProcessor,
0035                                 l1t::tftype mtfType,
0036                                 const std::shared_ptr<OMTFinput>& input,
0037                                 const AlgoMuons& algoCandidates,
0038                                 const AlgoMuons& gbCandidates,
0039                                 const std::vector<l1t::RegionalMuonCand>& candMuons) override;
0040 
0041   void observeEventBegin(const edm::Event& iEvent) override;
0042 
0043   void observeEventEnd(const edm::Event& iEvent,
0044                        std::unique_ptr<l1t::RegionalMuonCandBxCollection>& finalCandidates) override;
0045 
0046   void endJob() override;
0047 
0048 private:
0049   const OMTFConfiguration* omtfConfig;
0050 
0051   boost::property_tree::ptree tree;
0052 
0053   boost::property_tree::ptree* eventTree = nullptr;
0054 
0055   boost::property_tree::ptree procTree;
0056 
0057   std::string fName;
0058 
0059   unsigned int eventNum = 0;
0060 
0061   unsigned int eventId = 0;
0062 };
0063 
0064 #endif /* L1T_OmtfP1_XMLEVENTWRITER_H_ */