File indexing completed on 2024-04-06 12:08:13
0001 #ifndef RPCMonitorDigi_h
0002 #define RPCMonitorDigi_h
0003
0004 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0005 #include "DQMServices/Core/interface/DQMStore.h"
0006 #include "FWCore/Framework/interface/Event.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008
0009 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
0010 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0011 #include "DataFormats/Scalers/interface/DcsStatus.h"
0012 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
0013 #include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"
0014 #include "DataFormats/MuonReco/interface/Muon.h"
0015
0016 #include <string>
0017 #include <array>
0018 #include <map>
0019
0020 class RPCMonitorDigi : public DQMEDAnalyzer {
0021 public:
0022 explicit RPCMonitorDigi(const edm::ParameterSet &);
0023 ~RPCMonitorDigi() override = default;
0024
0025 protected:
0026 void analyze(const edm::Event &, const edm::EventSetup &) override;
0027 void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0028
0029 void bookRollME(DQMStore::IBooker &,
0030 const RPCDetId &,
0031 const RPCGeometry *rpcGeo,
0032 const std::string &,
0033 std::map<std::string, MonitorElement *> &);
0034
0035 void bookSectorRingME(DQMStore::IBooker &, const std::string &, std::map<std::string, MonitorElement *> &);
0036
0037 void bookWheelDiskME(DQMStore::IBooker &, const std::string &, std::map<std::string, MonitorElement *> &);
0038
0039 void bookRegionME(DQMStore::IBooker &, const std::string &, std::map<std::string, MonitorElement *> &);
0040
0041 private:
0042 bool useMuonDigis_;
0043
0044 void performSourceOperation(std::map<RPCDetId, std::vector<RPCRecHit> > &, std::string);
0045 int stripsInRoll(const RPCDetId &id, const RPCGeometry *rpcGeo) const;
0046
0047 static const std::array<std::string, 3> regionNames_;
0048 std::string muonFolder_;
0049 std::string noiseFolder_;
0050 int counter;
0051
0052 float muPtCut_, muEtaCut_;
0053 bool useRollInfo_;
0054 MonitorElement *noiseRPCEvents_;
0055 MonitorElement *muonRPCEvents_;
0056
0057 MonitorElement *NumberOfRecHitMuon_;
0058 MonitorElement *NumberOfMuon_;
0059
0060 int numberOfDisks_, numberOfInnerRings_;
0061
0062 std::map<std::string, std::map<std::string, MonitorElement *> > meMuonCollection;
0063 std::map<std::string, MonitorElement *> wheelDiskMuonCollection;
0064 std::map<std::string, MonitorElement *> regionMuonCollection;
0065 std::map<std::string, MonitorElement *> sectorRingMuonCollection;
0066
0067 std::map<std::string, std::map<std::string, MonitorElement *> > meNoiseCollection;
0068 std::map<std::string, MonitorElement *> wheelDiskNoiseCollection;
0069 std::map<std::string, MonitorElement *> regionNoiseCollection;
0070 std::map<std::string, MonitorElement *> sectorRingNoiseCollection;
0071
0072 std::string globalFolder_;
0073 std::string subsystemFolder_;
0074
0075 edm::EDGetTokenT<reco::CandidateView> muonLabel_;
0076 edm::EDGetTokenT<RPCRecHitCollection> rpcRecHitLabel_;
0077 edm::EDGetTokenT<DcsStatusCollection> scalersRawToDigiLabel_;
0078
0079 edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeomToken_;
0080 };
0081
0082 #endif