Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:30:35

0001 #ifndef L1Trigger_RPCPatternsParser_h
0002 #define L1Trigger_RPCPatternsParser_h
0003 /*******************************************************************************
0004 *                                                                              *
0005 *  Karol Bunkowski                                                             *
0006 *  Warsaw University 2005                                                      *
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 //#include "L1Trigger/RPCTrigger/interface/RPCException.h"
0019 
0020 class RPCPatternsParser : public XERCES_CPP_NAMESPACE::DefaultHandler {
0021 public:
0022   //class SAX2PatHandler : public DefaultHandler {
0023   //public:
0024   //  SAX2PatHandler();
0025   //  ~SAX2PatHandler();
0026 
0027   //  void startElement(const XMLCh* const uri, const XMLCh* const localname,
0028   //                    const XMLCh* const qname, const Attributes& attrs);
0029 
0030   //  void endElement (const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname);
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 {  //XXX - clean me!
0050     return m_QualityVec;
0051   };
0052 
0053 private:
0054   //virtual void startElement(const XMLCh* const name, xercesc::AttributeList& attributes);
0055 
0056   //virtual void endElement(const XMLCh* const name);
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