CMS 3D CMS Logo

Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/DQMServices/Components/src/DQMStoreStats.cc File Reference

#include "DQMServices/Components/src/DQMStoreStats.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/MessageLogger/interface/JobReport.h"

Go to the source code of this file.

Functions

template<class T >
static unsigned int getEmptyMetric (T *array, int lenx, int leny, int lenz)

Function Documentation

template<class T >
static unsigned int getEmptyMetric ( T array,
int  lenx,
int  leny,
int  lenz 
) [static]

Definition at line 20 of file DQMStoreStats.cc.

References i, and query::result.

Referenced by DQMStoreStats::calcstats().

{
  // len{x,y,z} MUST include under/overflow bins.
  unsigned int len = lenx+leny+lenz;
  unsigned int result=0;
  // start from 1 to exclude underflow bin. The comparison is accurate
  // since it takes properly into account under/overflow bins, for all
  // kind of histograms.
  for (unsigned int i=1; i<len; ++i)
  {
    // get rid of under/overflow bins for x,y,z axis, to have a correct statistics.
    if (i%(lenx-1)==0)
      continue;
    if (i%lenx==0)
      continue;
    if (i%(lenx+leny-1)==0)
      continue;
    if (i%(lenx+leny)==0)
      continue;
    if (i%(lenx+leny+lenz-1)==0)
      continue;
  
    if (array[i] == 0)
      result += 1;
  }
  
  return result;
}