File indexing completed on 2024-04-06 12:21:40
0001 #ifndef L1Trigger_RPCPatternsParser_h
0002 #define L1Trigger_RPCPatternsParser_h
0003
0004
0005
0006
0007
0008
0009
0010 #include <string>
0011 #include <iostream>
0012
0013 #include <xercesc/sax2/Attributes.hpp>
0014 #include <xercesc/sax2/DefaultHandler.hpp>
0015
0016 #include "L1Trigger/RPCTrigger/interface/RPCConst.h"
0017 #include "CondFormats/L1TObjects/interface/RPCPattern.h"
0018
0019
0020 class RPCPatternsParser : public XERCES_CPP_NAMESPACE::DefaultHandler {
0021 public:
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 RPCPatternsParser();
0034 ~RPCPatternsParser() override;
0035
0036 void startElement(const XMLCh* const uri,
0037 const XMLCh* const localname,
0038 const XMLCh* const qname,
0039 const XERCES_CPP_NAMESPACE::Attributes& attrs) override;
0040
0041 void endElement(const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname) override;
0042
0043 void parse(std::string fileName);
0044
0045 const RPCPattern::RPCPatVec& getPatternsVec(const RPCConst::l1RpcConeCrdnts& coneCrds) const;
0046
0047 const RPCPattern::RPCPatVec& getPatternsVec(const int tower, const int sc, const int sg) const;
0048
0049 const RPCPattern::TQualityVec& getQualityVec() const {
0050 return m_QualityVec;
0051 };
0052
0053 private:
0054
0055
0056
0057
0058 static int m_InstanceCount;
0059
0060 std::string m_CurrElement;
0061
0062 RPCPattern::TQualityVec m_QualityVec;
0063
0064 typedef std::map<RPCConst::l1RpcConeCrdnts, RPCPattern::RPCPatVec> TPatternsVecsMap;
0065
0066 TPatternsVecsMap m_PatternsVecsMap;
0067
0068 TPatternsVecsMap::iterator m_CurPacIt;
0069
0070 RPCPattern m_CurPattern;
0071 };
0072
0073 #endif