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 14 of file RPCLinkSynchroHistoMaker.h.

Constructor & Destructor Documentation

RPCLinkSynchroHistoMaker::RPCLinkSynchroHistoMaker ( const RPCLinkSynchroStat a)
inline

Definition at line 16 of file RPCLinkSynchroHistoMaker.h.

References fill(), fillDelayHisto(), fillDelaySpreadHisto(), and trackerHits::histo.

16 : theLinkStat(a) {}
const RPCLinkSynchroStat & theLinkStat

Member Function Documentation

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

Definition at line 15 of file RPCLinkSynchroHistoMaker.cc.

References mps_fire::i, training_settings::idx, SiStripPI::rms, and pfDeepBoostedJetPreprocessParams_cfi::upper_bound.

Referenced by RPCMonitorLinkSynchro::endLuminosityBlock(), and RPCLinkSynchroHistoMaker().

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

Member Data Documentation

const RPCLinkSynchroStat& RPCLinkSynchroHistoMaker::theLinkStat
private

Definition at line 22 of file RPCLinkSynchroHistoMaker.h.