CMS 3D CMS Logo

RPCMonitorLinkSynchro.cc
Go to the documentation of this file.
3 
7 
9 
10 #include <memory>
11 
13  : theConfig(cfg),
14  theSynchroStat(RPCLinkSynchroStat(theConfig.getUntrackedParameter<bool>("useFirstHitOnly", false)))
15 
16 {
18  consumes<RPCRawSynchro::ProdItem>(cfg.getParameter<edm::InputTag>("rpcRawSynchroProdItemTag"));
19  rpcEMapToken_ = esConsumes<edm::Transition::BeginRun>();
20 }
21 
25 }
26 
28  if (theCablingWatcher.check(es)) {
30  std::unique_ptr<RPCReadOutMapping const> cabling{readoutMapping->convert()};
31  edm::LogInfo("RPCMonitorLinkSynchro")
32  << "RPCMonitorLinkSynchro - record has CHANGED!!, read map, VERSION: " << cabling->version();
33  theSynchroStat.init(cabling.get(), theConfig.getUntrackedParameter<bool>("dumpDelays"));
34  }
35 }
36 
38  edm::Run const& iRun,
39  edm::EventSetup const& es) {
40  ibooker.cd();
41  ibooker.setCurrentFolder("RPC/LinkMonitor/");
42 
43  me_delaySummary = ibooker.book1D("delaySummary", "LinkDelaySummary", 8, -3.5, 4.5);
44  me_delaySummary->getTH1F()->SetStats(true);
45 
46  me_delaySpread = ibooker.book2D("delaySpread", "LinkDelaySpread", 71, -3.05, 4.05, 31, -0.05, 3.05);
47  me_delaySpread->getTH2F()->SetStats(false);
48 
49  me_notComplete[0] = ibooker.book2D("notComplete790", "FED790: not All Paths hit", 36, -0.5, 35.5, 18, -0.5, 17.5);
50  me_notComplete[1] = ibooker.book2D("notComplete791", "FED791: not All Paths hit", 36, -0.5, 35.5, 18, -0.5, 17.5);
51  me_notComplete[2] = ibooker.book2D("notComplete792", "FED792: not All Paths hit", 36, -0.5, 35.5, 18, -0.5, 17.5);
52  for (unsigned int i = 0; i < 3; ++i) {
53  me_notComplete[i]->getTH2F()->GetXaxis()->SetNdivisions(512);
54  me_notComplete[i]->getTH2F()->GetYaxis()->SetNdivisions(505);
55  me_notComplete[i]->setAxisTitle("rmb");
56  me_notComplete[i]->getTH2F()->SetYTitle("link");
57  me_notComplete[i]->getTH2F()->SetStats(false);
58  }
59  me_topOccup = ibooker.book2D("topOccup", "Top10 LinkBoard occupancy", 8, -0.5, 7.5, 10, 0., 10.);
60  me_topSpread = ibooker.book2D("topSpread", "Top10 LinkBoard delay spread", 8, -0.5, 7.5, 10, 0., 10.);
61  me_topOccup->getTH2F()->GetXaxis()->SetNdivisions(110);
62  me_topSpread->getTH2F()->GetXaxis()->SetNdivisions(110);
63  me_topOccup->getTH2F()->SetStats(false);
64  me_topSpread->getTH2F()->SetStats(false);
65 }
66 
69  ev.getByToken(rpcRawSynchroProdItemTag_, synchroCounts);
70  std::vector<LinkBoardElectronicIndex> problems;
71  const RPCRawSynchro::ProdItem& vItem = select(*synchroCounts.product(), ev, es);
72  theSynchroStat.add(vItem, problems);
73 
74  for (std::vector<LinkBoardElectronicIndex>::const_iterator it = problems.begin(); it != problems.end(); ++it) {
75  me_notComplete[it->dccId - 790]->Fill(it->dccInputChannelNum, it->tbLinkInputNum);
76  }
77 }
void init(const RPCReadOutMapping *theCabling, bool addChamberInfo)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * me_topOccup
T const * product() const
Definition: Handle.h:70
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::ESGetToken< RPCEMap, RPCEMapRcd > rpcEMapToken_
RPCMonitorLinkSynchro(const edm::ParameterSet &cfg)
MonitorElement * me_topSpread
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
RPCLinkSynchroStat theSynchroStat
virtual const RPCRawSynchro::ProdItem & select(const RPCRawSynchro::ProdItem &v, const edm::Event &, const edm::EventSetup &)
T getUntrackedParameter(std::string const &, T const &) const
void Fill(long long x)
MonitorElement * me_delaySpread
edm::ESWatcher< RPCEMapRcd > theCablingWatcher
RPCReadOutMapping const * convert() const
Definition: RPCEMap.h:64
std::vector< std::pair< LinkBoardElectronicIndex, int > > ProdItem
Definition: RPCRawSynchro.h:9
edm::EDGetTokenT< RPCRawSynchro::ProdItem > rpcRawSynchroProdItemTag_
void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
void fill(TH1F *hDelay, TH2F *hDelaySpread, TH2F *hTopOccup, TH2F *hTopSpread) const
MonitorElement * me_notComplete[3]
Log< level::Info, false > LogInfo
void add(const RPCRawSynchro::ProdItem &counts, std::vector< LinkBoardElectronicIndex > &problems)
def ls(path, rec=False)
Definition: eostools.py:349
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
edm::ParameterSet theConfig
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:162
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * me_delaySummary
Definition: Run.h:45
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)