rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_I1094061::HistoPair Struct Reference
Collaboration diagram for ATLAS_2012_I1094061::HistoPair:

List of all members.

Public Types

enum  HistoType { FOREGROUND, BACKGROUND }

Public Member Functions

 HistoPair ()
void init (int ds, int xaxis, int yaxis, ATLAS_2012_I1094061 *analysis)
void fillForeground (double value, double weight)
void fillBackground (double value, double weight)
void fill (double value, double weight, HistoType type)
void finalize (double wgtSum, double bgWeight, double avNTracks)

Private Attributes

int _ds
int _xaxis
int _yaxis
ATLAS_2012_I1094061_analysis
AIDA::IHistogram1D * _h_foreground
AIDA::IHistogram1D * _h_background
AIDA::IDataPointSet * _d_final

Static Private Attributes

static short _s_counter = 0

Detailed Description

Little container to hold a pair of foreground and background histos and then divide them at the end of the analysis

Definition at line 15 of file ATLAS_2012_I1094061.cc.


Member Enumeration Documentation

enum HistoType
Enumerator:
FOREGROUND 
BACKGROUND 

Definition at line 16 of file ATLAS_2012_I1094061.cc.


Constructor & Destructor Documentation

HistoPair ( ) [inline]

Definition at line 18 of file ATLAS_2012_I1094061.cc.


Member Function Documentation

void fill ( double  value,
double  weight,
HistoType  type 
) [inline]
void fillBackground ( double  value,
double  weight 
) [inline]

Definition at line 39 of file ATLAS_2012_I1094061.cc.

References ATLAS_2012_I1094061::HistoPair::_h_background.

Referenced by ATLAS_2012_I1094061::HistoPair::fill().

                                                      {
        _h_background->fill(value, weight);
        _h_background->fill(-value, weight);
      }
void fillForeground ( double  value,
double  weight 
) [inline]

Definition at line 34 of file ATLAS_2012_I1094061.cc.

References ATLAS_2012_I1094061::HistoPair::_h_foreground.

Referenced by ATLAS_2012_I1094061::HistoPair::fill().

                                                      {
        _h_foreground->fill(value, weight);
        _h_foreground->fill(-value, weight);
      }
void finalize ( double  wgtSum,
double  bgWeight,
double  avNTracks 
) [inline]

Definition at line 56 of file ATLAS_2012_I1094061.cc.

References ATLAS_2012_I1094061::HistoPair::_analysis, ATLAS_2012_I1094061::HistoPair::_ds, ATLAS_2012_I1094061::HistoPair::_h_background, ATLAS_2012_I1094061::HistoPair::_h_foreground, ATLAS_2012_I1094061::HistoPair::_xaxis, ATLAS_2012_I1094061::HistoPair::_yaxis, Analysis::divide(), Analysis::histoPath(), and Rivet::Cuts::pt.

Referenced by ATLAS_2012_I1094061::finalize().

                                                                     {

        _h_foreground->scale(1. / wgtSum);
        _h_background->scale(1. / bgWeight);

        string histoPath = _analysis->histoPath(_ds, _xaxis, _yaxis);

        AIDA::IDataPointSet *final = _analysis->histogramFactory().divide(histoPath, *_h_foreground, *_h_background);

        for (int ii=0; ii!= final->size(); ++ii) {
          AIDA::IDataPoint* pt = final->point(ii);
          double y = pt->coordinate(1)->value();
          pt->coordinate(1)->setValue(y-(avNTracks - 1));
        }

        _analysis->histogramFactory().destroy(_h_foreground);
        _analysis->histogramFactory().destroy(_h_background);
      }
void init ( int  ds,
int  xaxis,
int  yaxis,
ATLAS_2012_I1094061 analysis 
) [inline]

Definition at line 22 of file ATLAS_2012_I1094061.cc.

References ATLAS_2012_I1094061::HistoPair::_analysis, ATLAS_2012_I1094061::HistoPair::_ds, ATLAS_2012_I1094061::HistoPair::_h_background, ATLAS_2012_I1094061::HistoPair::_h_foreground, ATLAS_2012_I1094061::HistoPair::_s_counter, ATLAS_2012_I1094061::HistoPair::_xaxis, and ATLAS_2012_I1094061::HistoPair::_yaxis.

Referenced by ATLAS_2012_I1094061::init().

                                                                            {
        _ds = ds;
        _xaxis = xaxis;
        _yaxis = yaxis;
        _analysis = analysis;
        ++HistoPair::_s_counter;
        const BinEdges& edges = _analysis->binEdges(_ds, _xaxis, _yaxis);
        string sCount = boost::lexical_cast<string>(HistoPair::_s_counter);
        _h_foreground = analysis->bookHistogram1D("tmpForeground" + sCount, edges);
        _h_background = analysis->bookHistogram1D("tmpBackground" + sCount, edges);
      }

Member Data Documentation

AIDA::IDataPointSet* _d_final [private]

Definition at line 83 of file ATLAS_2012_I1094061.cc.

short _s_counter = 0 [static, private]

Definition at line 85 of file ATLAS_2012_I1094061.cc.

Referenced by ATLAS_2012_I1094061::HistoPair::init().


The documentation for this struct was generated from the following file: