CMS 3D CMS Logo

RPCMonitorLinkSynchro.cc
Go to the documentation of this file.
3 
5 
10 
13 
14 
16  : theConfig(cfg),
17  theSynchroStat(RPCLinkSynchroStat(theConfig.getUntrackedParameter<bool>("useFirstHitOnly", false)))
18 
19 {
20 
21  rpcRawSynchroProdItemTag_=consumes<RPCRawSynchro::ProdItem>(cfg.getParameter<edm::InputTag>("rpcRawSynchroProdItemTag"));
22 
23 }
24 
26 
28 {
29 
32 }
33 
34 
35 
37  if (theCablingWatcher.check(es)) {
38  edm::ESTransientHandle<RPCEMap> readoutMapping;
39  es.get<RPCEMapRcd>().get(readoutMapping);
40  RPCReadOutMapping const* cabling = readoutMapping->convert();
41  edm::LogInfo("RPCMonitorLinkSynchro") << "RPCMonitorLinkSynchro - record has CHANGED!!, read map, VERSION: " << cabling->version();
42  theSynchroStat.init(cabling, theConfig.getUntrackedParameter<bool>("dumpDelays"));
43  delete cabling;
44  }
45 }
46 
48  edm::Run const & iRun ,
49  edm::EventSetup const & es ) {
50  ibooker.cd();
51  ibooker.setCurrentFolder("RPC/LinkMonitor/");
52 
53  me_delaySummary = ibooker.book1D("delaySummary","LinkDelaySummary",8,-3.5, 4.5);
54  me_delaySummary->getTH1F()->SetStats(true);
55 
56  me_delaySpread = ibooker.book2D("delaySpread","LinkDelaySpread",71,-3.05, 4.05, 31,-0.05,3.05);
57  me_delaySpread->getTH2F()->SetStats(false);
58 
59  me_notComplete[0] = ibooker.book2D("notComplete790","FED790: not All Paths hit",36,-0.5,35.5,18,-0.5,17.5);
60  me_notComplete[1] = ibooker.book2D("notComplete791","FED791: not All Paths hit",36,-0.5,35.5,18,-0.5,17.5);
61  me_notComplete[2] = ibooker.book2D("notComplete792","FED792: not All Paths hit",36,-0.5,35.5,18,-0.5,17.5);
62  for (unsigned int i=0;i<3;++i) {
63  me_notComplete[i]->getTH2F()->GetXaxis()->SetNdivisions(512);
64  me_notComplete[i]->getTH2F()->GetYaxis()->SetNdivisions(505);
65  me_notComplete[i]->getTH2F()->SetXTitle("rmb");
66  me_notComplete[i]->getTH2F()->SetYTitle("link");
67  me_notComplete[i]->getTH2F()->SetStats(false);
68  }
69  me_topOccup = ibooker.book2D("topOccup","Top10 LinkBoard occupancy",8,-0.5,7.5, 10,0.,10.);
70  me_topSpread = ibooker.book2D("topSpread","Top10 LinkBoard delay spread",8,-0.5,7.5, 10,0.,10.);
71  me_topOccup->getTH2F()->GetXaxis()->SetNdivisions(110);
72  me_topSpread->getTH2F()->GetXaxis()->SetNdivisions(110);
73  me_topOccup->getTH2F()->SetStats(false);
74  me_topSpread->getTH2F()->SetStats(false);
75 
76 }
77 
78 
80 {
82  ev.getByToken(rpcRawSynchroProdItemTag_, synchroCounts);
83  std::vector<LinkBoardElectronicIndex> problems;
84  const RPCRawSynchro::ProdItem &vItem = select(*synchroCounts.product(), ev,es);
85  theSynchroStat.add(vItem, problems);
86 
87  for (std::vector<LinkBoardElectronicIndex>::const_iterator it=problems.begin(); it != problems.end(); ++it) {
88  me_notComplete[it->dccId-790]->Fill(it->dccInputChannelNum,it->tbLinkInputNum);
89  }
90 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void init(const RPCReadOutMapping *theCabling, bool addChamberInfo)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
TH1F * getTH1F() const
std::vector< std::pair< LinkBoardElectronicIndex, int > > ProdItem
Definition: RPCRawSynchro.h:9
MonitorElement * me_topOccup
bool ev
void analyze(const edm::Event &, const edm::EventSetup &) override
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 &)
void Fill(long long x)
MonitorElement * me_delaySpread
edm::ESWatcher< RPCEMapRcd > theCablingWatcher
const std::string & version() const
version as string
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
edm::EDGetTokenT< RPCRawSynchro::ProdItem > rpcRawSynchroProdItemTag_
void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
TH2F * getTH2F() const
MonitorElement * me_notComplete[3]
void add(const RPCRawSynchro::ProdItem &counts, std::vector< LinkBoardElectronicIndex > &problems)
def ls(path, rec=False)
Definition: eostools.py:348
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
T const * product() const
Definition: Handle.h:81
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
const T & get() const
Definition: EventSetup.h:58
edm::ParameterSet theConfig
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
void fill(TH1F *hDelay, TH2F *hDelaySpread, TH2F *hTopOccup, TH2F *hTopSpread) const
RPCReadOutMapping const * convert() const
Definition: RPCEMap.h:67
MonitorElement * me_delaySummary
Definition: Run.h:43
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override