Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:02:48

0001 #ifndef L1Trigger_RPCTrigger_MuonsGrabber_h
0002 #define L1Trigger_RPCTrigger_MuonsGrabber_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     RPCTrigger
0006 // Class  :     MuonsGrabber
0007 //
0008 /**\class MuonsGrabber MuonsGrabber.h L1Trigger/RPCTrigger/interface/MuonsGrabber.h
0009 
0010  Description: <one line class summary>
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:
0018 //         Created:  Thu Sep 17 14:20:56 CEST 2009
0019 // $Id$
0020 //
0021 
0022 // system include files
0023 
0024 // user include files
0025 
0026 // forward declarations
0027 
0028 #include "L1Trigger/RPCTrigger/interface/RPCTBMuon.h"
0029 #include "L1Trigger/RPCTrigger/interface/RPCBasicTrigConfig.h"
0030 
0031 #include <map>
0032 #include <vector>
0033 
0034 //#include "Utilities/Xerces/interface/Xerces.h"
0035 //#include <xercesc/util/XMLString.hpp>
0036 #include <xercesc/dom/DOM.hpp>
0037 //#include <xercesc/framework/LocalFileFormatTarget.hpp>
0038 
0039 struct RPCMuonExtraStruct {
0040   RPCMuonExtraStruct(signed char l, signed char r, signed char h, signed char i, RPCTBMuon& mu)
0041       : _level(l), _region(r), _hsHalf(h), _index(i), _mu(mu){};
0042   signed char _level;
0043   signed char _region;  // brl/endcap
0044   signed char _hsHalf;  // Determines which halfsorter
0045   signed char _index;
0046   RPCTBMuon _mu;
0047   static bool lvlCompare(const RPCMuonExtraStruct& a, const RPCMuonExtraStruct& b) { return a._level > b._level; };
0048 };
0049 
0050 class MuonsGrabber {
0051   MuonsGrabber();
0052   virtual ~MuonsGrabber();
0053 
0054 public:
0055   static MuonsGrabber& Instance();
0056 
0057   MuonsGrabber(const MuonsGrabber&) = delete;  // stop default
0058 
0059   const MuonsGrabber& operator=(const MuonsGrabber&) = delete;  // stop default
0060 
0061   void setRPCBasicTrigConfig(RPCBasicTrigConfig* c) { m_trigConfig = c; };
0062 
0063   void startNewEvent(int event, int bx);
0064   void writeDataForRelativeBX(int bx);
0065   void addMuon(RPCTBMuon& mu, int lvl, int region, int hs, int index);
0066 
0067 private:
0068   std::string IntToString(int i);
0069 
0070   // ---------- member data --------------------------------
0071   //std::map<int, std::vector< RPCTBMuon  > > m_muons;
0072   std::vector<RPCMuonExtraStruct> m_muons;
0073   RPCBasicTrigConfig* m_trigConfig;
0074 
0075   int m_currentEvent;
0076   int m_currentBX;
0077   XERCES_CPP_NAMESPACE::DOMImplementation* m_dom;
0078   XERCES_CPP_NAMESPACE::DOMDocument* m_doc;
0079   XERCES_CPP_NAMESPACE::DOMElement* m_rootElem;
0080   XERCES_CPP_NAMESPACE::DOMElement* m_currEvent;
0081 };
0082 
0083 #endif