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 177 of file EdmEventSize.cc.

Constructor & Destructor Documentation

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

Definition at line 179 of file EdmEventSize.cc.

References x().

179  :
180  top(itop),
181  uncompressed( "uncompressed", "branch sizes", top, -0.5, - 0.5 + top ),
182  compressed( "compressed", "branch sizes", top, -0.5, - 0.5 + top ),
183  cxAxis(compressed.GetXaxis()),
184  uxAxis(uncompressed.GetXaxis()),
185  x(0) {}

Member Function Documentation

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

Definition at line 187 of file EdmEventSize.cc.

References perftools::EdmEventSize::BranchRecord::compr_size, perftools::EdmEventSize::BranchRecord::name, perftools::EdmEventSize::BranchRecord::uncompr_size, and x().

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

187  {
188  if ( x < top ) {
189  cxAxis->SetBinLabel( x + 1, br.name.c_str() );
190  uxAxis->SetBinLabel( x + 1, br.name.c_str() );
191  compressed.Fill( x, br.compr_size );
192  uncompressed.Fill( x, br.uncompr_size );
193  x++;
194  }
195  }
void perftools::detail::Hist::finalize ( void  )
inline

Definition at line 197 of file EdmEventSize.cc.

References mps_fire::i, and hpstanc_transforms::max.

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

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

Member Data Documentation

TH1F perftools::detail::Hist::compressed

Definition at line 228 of file EdmEventSize.cc.

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

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

Definition at line 229 of file EdmEventSize.cc.

int perftools::detail::Hist::top

Definition at line 226 of file EdmEventSize.cc.

TH1F perftools::detail::Hist::uncompressed

Definition at line 227 of file EdmEventSize.cc.

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

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

Definition at line 230 of file EdmEventSize.cc.

int perftools::detail::Hist::x