RivetAIDA.hh

Go to the documentation of this file.
00001 // $Id: $
00002 #ifndef RIVETAIDA_HH 
00003 #define RIVETAIDA_HH 1
00004 
00005 /// @author Andy Buckley
00006 /// @date   2007-01-23
00007 
00008 // Include files
00009 #include "Rivet/Rivet.hh"
00010 #include "AIDA/IAnalysisFactory.h"
00011 #include "AIDA/IHistogramFactory.h"
00012 #include "AIDA/IHistogram1D.h"
00013 #include "AIDA/ITreeFactory.h"
00014 #include "AIDA/IDataPointSetFactory.h"
00015 #include "AIDA/IDataPointSet.h"
00016 #include "AIDA/IDataPoint.h"
00017 #include "AIDA/IMeasurement.h"
00018 #include "AIDA/ITree.h"
00019 #include "AIDA/IAxis.h"
00020 
00021 
00022 namespace Rivet {
00023   /// Typedef for a collection of bin edges.
00024   typedef vector<double> BinEdges;
00025 
00026   /// Function to get a map of all the bin edge vectors in a paper with the
00027   /// given @a papername.
00028   const map<string, BinEdges> getBinEdges(string papername);
00029 
00030   /// Get the file system path to the AIDA reference file for this paper.
00031   const string getDataPath(string papername);
00032 
00033   /// Normalize the histogram to @a norm .
00034   inline void normalize(AIDA::IHistogram1D* histo, const double norm=1.0) {
00035     assert(norm != 0.0);
00036     double area = 0;
00037     for (int i=0; i < histo->axis().bins(); ++i) {
00038       area += histo->binHeight(i) * histo->axis().binWidth(i);
00039     }
00040     if (area != 0) {
00041       histo->scale(norm/area);
00042     }
00043   }
00044 
00045 }
00046 
00047 #endif