CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
perftools::detail::Hist Struct Reference

Public Member Functions

void fill (EdmEventSize::BranchRecord const &br)
 
void finalize ()
 
 Hist (int itop)
 

Public Attributes

TH1F compressed
 
TAxis * cxAxis
 
int top
 
TH1F uncompressed
 
TAxis * uxAxis
 
int x
 

Detailed Description

Definition at line 171 of file EdmEventSize.cc.

Constructor & Destructor Documentation

◆ Hist()

perftools::detail::Hist::Hist ( int  itop)
inlineexplicit

Definition at line 172 of file EdmEventSize.cc.

173  : top(itop),
174  uncompressed("uncompressed", "branch sizes", top, -0.5, -0.5 + top),
175  compressed("compressed", "branch sizes", top, -0.5, -0.5 + top),
176  cxAxis(compressed.GetXaxis()),
177  uxAxis(uncompressed.GetXaxis()),
178  x(0) {}

Member Function Documentation

◆ fill()

void perftools::detail::Hist::fill ( EdmEventSize::BranchRecord const &  br)
inline

Definition at line 180 of file EdmEventSize.cc.

180  {
181  if (x < top) {
182  cxAxis->SetBinLabel(x + 1, br.name.c_str());
183  uxAxis->SetBinLabel(x + 1, br.name.c_str());
184  compressed.Fill(x, br.compr_size);
185  uncompressed.Fill(x, br.uncompr_size);
186  x++;
187  }
188  }

References beamvalidation::br, compressed, cxAxis, top, uncompressed, uxAxis, and x.

Referenced by perftools::EdmEventSize::produceHistos().

◆ finalize()

void perftools::detail::Hist::finalize ( void  )
inline

Definition at line 190 of file EdmEventSize.cc.

190  {
191  double mn = std::numeric_limits<double>::max();
192  for (int i = 1; i <= top; ++i) {
193  double cm = compressed.GetMinimum(i), um = uncompressed.GetMinimum(i);
194  if (cm > 0 && cm < mn)
195  mn = cm;
196  if (um > 0 && um < mn)
197  mn = um;
198  }
199  mn *= 0.8;
200  double mx = std::max(compressed.GetMaximum(), uncompressed.GetMaximum());
201  mx *= 1.2;
202  uncompressed.SetMinimum(mn);
203  uncompressed.SetMaximum(mx);
204  compressed.SetMinimum(mn);
205  // compressed.SetMaximum( mx );
206  cxAxis->SetLabelOffset(-0.32);
207  cxAxis->LabelsOption("v");
208  cxAxis->SetLabelSize(0.03);
209  uxAxis->SetLabelOffset(-0.32);
210  uxAxis->LabelsOption("v");
211  uxAxis->SetLabelSize(0.03);
212  compressed.GetYaxis()->SetTitle("Bytes");
213  compressed.SetFillColor(kBlue);
214  compressed.SetLineWidth(2);
215  uncompressed.GetYaxis()->SetTitle("Bytes");
216  uncompressed.SetFillColor(kRed);
217  uncompressed.SetLineWidth(2);
218  }

References compressed, cxAxis, mps_fire::i, SiStripPI::max, top, uncompressed, and uxAxis.

Member Data Documentation

◆ compressed

TH1F perftools::detail::Hist::compressed

Definition at line 222 of file EdmEventSize.cc.

Referenced by fill(), and finalize().

◆ cxAxis

TAxis* perftools::detail::Hist::cxAxis

Definition at line 223 of file EdmEventSize.cc.

Referenced by fill(), and finalize().

◆ top

int perftools::detail::Hist::top

Definition at line 220 of file EdmEventSize.cc.

Referenced by fill(), and finalize().

◆ uncompressed

TH1F perftools::detail::Hist::uncompressed

Definition at line 221 of file EdmEventSize.cc.

Referenced by fill(), and finalize().

◆ uxAxis

TAxis* perftools::detail::Hist::uxAxis

Definition at line 224 of file EdmEventSize.cc.

Referenced by fill(), and finalize().

◆ x

int perftools::detail::Hist::x
perftools::detail::Hist::uxAxis
TAxis * uxAxis
Definition: EdmEventSize.cc:224
mps_fire.i
i
Definition: mps_fire.py:355
perftools::detail::Hist::top
int top
Definition: EdmEventSize.cc:220
perftools::detail::Hist::compressed
TH1F compressed
Definition: EdmEventSize.cc:222
perftools::detail::Hist::cxAxis
TAxis * cxAxis
Definition: EdmEventSize.cc:223
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
beamvalidation.br
br
Definition: beamvalidation.py:398
perftools::detail::Hist::uncompressed
TH1F uncompressed
Definition: EdmEventSize.cc:221
perftools::detail::Hist::x
int x
Definition: EdmEventSize.cc:226