CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RPCLinkSynchroHistoMaker Class Reference

#include <RPCLinkSynchroHistoMaker.h>

Public Member Functions

void fill (TH1F *hDelay, TH2F *hDelaySpread, TH2F *hTopOccup, TH2F *hTopSpread) const
 
void fillDelayHisto (TH1F *histo)
 
void fillDelaySpreadHisto (TH2F *histo)
 
 RPCLinkSynchroHistoMaker (const RPCLinkSynchroStat &a)
 

Private Attributes

const RPCLinkSynchroStattheLinkStat
 

Detailed Description

Definition at line 12 of file RPCLinkSynchroHistoMaker.h.

Constructor & Destructor Documentation

◆ RPCLinkSynchroHistoMaker()

RPCLinkSynchroHistoMaker::RPCLinkSynchroHistoMaker ( const RPCLinkSynchroStat a)
inline

Definition at line 14 of file RPCLinkSynchroHistoMaker.h.

14 : theLinkStat(a) {}

Member Function Documentation

◆ fill()

void RPCLinkSynchroHistoMaker::fill ( TH1F *  hDelay,
TH2F *  hDelaySpread,
TH2F *  hTopOccup,
TH2F *  hTopSpread 
) const

Definition at line 18 of file RPCLinkSynchroHistoMaker.cc.

18  {
19  hDelay->Reset();
20  hDelaySpread->Reset();
21  hTopOccup->Reset();
22  hTopSpread->Reset();
23 
24  typedef std::vector<std::pair<unsigned int, unsigned int> > TopOccup;
25  typedef std::vector<std::pair<double, unsigned int> > TopSpread;
26  TopOccup topOccup(10, std::make_pair(0, 0));
27  TopSpread topSpread(10, std::make_pair(0., 0));
28 
29  for (unsigned int idx = 0; idx < theLinkStat.theLinkStatMap.size(); ++idx) {
31 
32  int sum = bc.second.sum();
33  double rms = bc.second.rms();
34 
35  hDelaySpread->Fill(bc.second.mean() - 3., bc.second.rms());
36 
37  if (sum == 0)
38  continue;
39  for (int i = 0; i <= 7; ++i)
40  hDelay->Fill(i - 3, bc.second.counts()[i]);
41 
42  std::pair<unsigned int, unsigned int> canOccup = std::make_pair(sum, idx);
43  std::pair<double, unsigned int> canSpread = std::make_pair(rms, idx);
44  TopOccup::iterator io = upper_bound(topOccup.begin(), topOccup.end(), canOccup, OrderLbOccup());
45  TopSpread::iterator is = upper_bound(topSpread.begin(), topSpread.end(), canSpread, OrderLbSpread());
46  if (io != topOccup.end()) {
47  topOccup.insert(io, canOccup);
48  topOccup.erase(topOccup.end() - 1);
49  }
50  if (is != topSpread.end()) {
51  topSpread.insert(is, canSpread);
52  topSpread.erase(topSpread.end() - 1);
53  }
54  }
55 
56  for (int itop = 0; itop < 10; itop++) {
57  const RPCLinkSynchroStat::BoardAndCounts& occup = theLinkStat.theLinkStatMap[topOccup[itop].second];
58  const RPCLinkSynchroStat::BoardAndCounts& spread = theLinkStat.theLinkStatMap[topSpread[itop].second];
59  hTopOccup->GetYaxis()->SetBinLabel(itop + 1, occup.first.name().c_str());
60  hTopSpread->GetYaxis()->SetBinLabel(itop + 1, spread.first.name().c_str());
61  for (unsigned int icount = 0; icount < occup.second.counts().size(); icount++) {
62  hTopOccup->SetBinContent(icount + 1, itop + 1, float(occup.second.counts()[icount]));
63  hTopSpread->SetBinContent(icount + 1, itop + 1, float(spread.second.counts()[icount]));
64  }
65  }
66 }

References mps_fire::i, heavyIonCSV_trainingSettings::idx, SiStripPI::rms, theLinkStat, RPCLinkSynchroStat::theLinkStatMap, and pfDeepBoostedJetPreprocessParams_cfi::upper_bound.

Referenced by RPCMonitorLinkSynchro::endLuminosityBlock().

◆ fillDelayHisto()

void RPCLinkSynchroHistoMaker::fillDelayHisto ( TH1F *  histo)

◆ fillDelaySpreadHisto()

void RPCLinkSynchroHistoMaker::fillDelaySpreadHisto ( TH2F *  histo)

Member Data Documentation

◆ theLinkStat

const RPCLinkSynchroStat& RPCLinkSynchroHistoMaker::theLinkStat
private

Definition at line 20 of file RPCLinkSynchroHistoMaker.h.

Referenced by fill().

pfDeepBoostedJetPreprocessParams_cfi.upper_bound
upper_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:16
mps_fire.i
i
Definition: mps_fire.py:428
SiStripPI::rms
Definition: SiStripPayloadInspectorHelper.h:169
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
RPCLinkSynchroStat::BoardAndCounts
std::pair< LinkBoard, SynchroCounts > BoardAndCounts
Definition: RPCLinkSynchroStat.h:68
a
double a
Definition: hdecay.h:119
RPCLinkSynchroStat::theLinkStatMap
std::vector< BoardAndCounts > theLinkStatMap
Definition: RPCLinkSynchroStat.h:89
OrderLbOccup
Definition: RPCLinkSynchroHistoMaker.cc:12
OrderLbSpread
Definition: RPCLinkSynchroHistoMaker.cc:7
RPCLinkSynchroHistoMaker::theLinkStat
const RPCLinkSynchroStat & theLinkStat
Definition: RPCLinkSynchroHistoMaker.h:20