CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/L1Trigger/RPCTrigger/interface/MuonsGrabber.h

Go to the documentation of this file.
00001 #ifndef L1Trigger_RPCTrigger_MuonsGrabber_h
00002 #define L1Trigger_RPCTrigger_MuonsGrabber_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     RPCTrigger
00006 // Class  :     MuonsGrabber
00007 // 
00016 //
00017 // Original Author:  
00018 //         Created:  Thu Sep 17 14:20:56 CEST 2009
00019 // $Id: MuonsGrabber.h,v 1.1 2009/09/23 11:01:55 fruboes Exp $
00020 //
00021 
00022 // system include files
00023 
00024 // user include files
00025 
00026 // forward declarations
00027 
00028 #include "L1Trigger/RPCTrigger/interface/RPCTBMuon.h"
00029 #include "L1Trigger/RPCTrigger/interface/RPCBasicTrigConfig.h"
00030 
00031 #include <map>
00032 #include <vector>
00033 
00034 //#include <xercesc/util/PlatformUtils.hpp>
00035 //#include <xercesc/util/XMLString.hpp>
00036 #include <xercesc/dom/DOM.hpp>
00037 //#include <xercesc/framework/LocalFileFormatTarget.hpp>
00038 
00039 
00040 struct RPCMuonExtraStruct {
00041    RPCMuonExtraStruct(signed char l, signed char r, signed char h, signed char i, RPCTBMuon & mu): 
00042                                 _level(l)  , _region(r), _hsHalf(h), _index(i), _mu(mu){};      
00043    signed char _level;
00044    signed char _region; // brl/endcap
00045    signed char _hsHalf; // Determines which halfsorter  
00046    signed char _index; 
00047    RPCTBMuon _mu;
00048    static bool lvlCompare(const RPCMuonExtraStruct &a, const RPCMuonExtraStruct &b) {
00049      return a._level > b._level;
00050    };
00051 };
00052 
00053 class MuonsGrabber
00054 {
00055   
00056       MuonsGrabber();
00057       virtual ~MuonsGrabber();
00058    public:
00059       static MuonsGrabber & Instance();
00060 
00061       void setRPCBasicTrigConfig(RPCBasicTrigConfig * c) {m_trigConfig = c;};
00062    
00063       void startNewEvent(int event, int bx);
00064       void writeDataForRelativeBX(int bx);
00065       void addMuon(RPCTBMuon & mu, int lvl, int region, int hs, int index);
00066 
00067    private:
00068       MuonsGrabber(const MuonsGrabber&); // stop default
00069 
00070       const MuonsGrabber& operator=(const MuonsGrabber&); // stop default
00071       std::string IntToString(int i);
00072 
00073       // ---------- member data --------------------------------
00074       //std::map<int, std::vector< RPCTBMuon  > > m_muons;
00075       std::vector< RPCMuonExtraStruct > m_muons;
00076       RPCBasicTrigConfig* m_trigConfig;
00077            
00078       int m_currentEvent;
00079       int m_currentBX;
00080       XERCES_CPP_NAMESPACE::DOMImplementation* m_dom;
00081       XERCES_CPP_NAMESPACE::DOMDocument* m_doc;
00082       XERCES_CPP_NAMESPACE::DOMElement* m_rootElem;
00083       XERCES_CPP_NAMESPACE::DOMElement* m_currEvent;
00084 };
00085 
00086 
00087 #endif