Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

recocert::HistSets Class Reference

#include <HistSets.hpp>

Inheritance diagram for recocert::HistSets::

recocert::CalHists recocert::CftHists recocert::CpsHists recocert::ElectronHists recocert::JetHists recocert::MetHists recocert::MuonHists recocert::MuonMDTHists recocert::MuonMSCHists recocert::MuonPDTHists recocert::MuonTrackHists recocert::OccupancyHists recocert::SmtClusterBHists recocert::SmtClusterFDHists recocert::SmtClusterHDHists recocert::TimingHists recocert::TrackEffHists recocert::TrackHists recocert::TriggerHists recocert::V0Hists recocert::VertexHists List of all members.

Public Methods

 HistSets (const std::string name, HepRootFileManager *manager=NULL)
virtual ~HistSets ()
 Destructor.

virtual void load (TFile *file, const std::string &dir)
 Load histograms from a subdirectory in a given file.

virtual void add (TFile *file, const std::string &dir)
 Add histograms from a subdirectory in a given file to the current ones.

void save (const std::string &file)
 Save standard set of plots. More...

virtual void draw (const int &level=0, TPostScript *psfile=NULL, std::vector< HistSets *> *overlaySet=NULL)=0
 Draw standard plots. More...

virtual void stat (std::ostream &out, const int &level=0)=0
 Print summary statistics. More...

TH1F* get1DHist (std::string name)
 Get 1D histogram.

TH2F* get2DHist (std::string name)
 Get 2D histogram.

TProfile* getProfileHist (std::string name)
 Get profile histogram.

bool exists (std::string name, std::string type="ANY")
 Check if given histogram exists. More...

void newPage (std::string label, int nxpads, int nypads, TPostScript *psfile=NULL)
 Create a new page for drawing histograms. More...

void draw1D (const std::string &histname, std::vector< HistSets *> *overlaySets=NULL, int logy=0, int logx=0, const std::string &normalize="EVENT", const std::string &option="")
 Draw 1D histogram(s). More...

void draw2D (const std::string &histname, std::vector< HistSets *> *overlaySets=NULL, const std::string &option="")
 Draw 2D histogram(s). More...

void drawProfile (const std::string &histname, std::vector< HistSets *> *overlaySets=NULL, int logy=0, int logx=0, const std::string &option="")
 Draw profile histogram(s). More...


Protected Methods

virtual void init (HepRootFileManager *manager=NULL, const edm::RCP *rcp=NULL)
 Initialize histograms. More...

virtual void create (const edm::RCP *rcp=NULL)=0
 Create the actual histograms.

void fill ()
 Fill special internal histograms.


Protected Attributes

std::map<std::string, TH1F*> _hists1D
 The 1-dimensional histograms.

std::map<std::string, TH2F*> _hists2D
 The 2-dimensional histograms.

std::map<std::string, TProfile*> _histsProfile
 The profile histograms.

const std::string _name
 The name of this histogram set.

HCanvas_canvas
 The current canvas when drawing histograms.

int _pad
 The current pad when drawing histograms.


Detailed Description

A abstract base class representing a collection of histograms.

This abstract base class manages an arbitrary collection of 1D, 2D and profile histograms. Concrete implementations define these histograms, and provide support for filling them.

The base class provides support for loading saved histograms (load) from a file and combining (adding) instances (add) from multiple files. It also allows users direct access to individual histograms (getHist).

Concrete classes are required to provide create, draw and stat methods, which should create new sets of histograms, draw them and print statistics describing them.

In addition, concrete classes should provide appropriate fill methods, which depend specifically on their implementation.


Constructor & Destructor Documentation

recocert::HistSets::HistSets ( const std::string name,
HepRootFileManager * manager = NULL )
 

Create a collection of histograms with a given name.

If an optional file manager is supplied, then a subdirectory is created with that same name, and the histograms are created within that subdirectory.

recocert::HistSets::~HistSets ( ) [virtual]
 

Destructor.


Member Function Documentation

void recocert::HistSets::add ( TFile * file,
const std::string & dir ) [virtual]
 

Add histograms from a subdirectory in a given file to the current ones.

void recocert::HistSets::create ( const edm::RCP * rcp = NULL ) [protected, pure virtual]
 

Create the actual histograms.

Reimplemented in recocert::CalHists, recocert::CftHists, recocert::CpsHists, recocert::ElectronHists, recocert::JetHists, recocert::MetHists, recocert::MuonHists, recocert::MuonMDTHists, recocert::MuonMSCHists, recocert::MuonPDTHists, recocert::MuonTrackHists, recocert::OccupancyHists, recocert::SmtClusterBHists, recocert::SmtClusterFDHists, recocert::SmtClusterHDHists, recocert::TimingHists, recocert::TrackEffHists, recocert::TrackEffIsolHists, recocert::TrackEffJetHists, recocert::TrackHists, recocert::TriggerHists, recocert::V0Hists, and recocert::VertexHists.

void recocert::HistSets::draw ( const int & level = 0,
TPostScript * psfile = NULL,
std::vector< HistSets *> * overlaySet = NULL ) [pure virtual]
 

Draw standard plots.

Standard histograms are drawn depending on the user specified value of level. The higher the level, the more detailed the plots. The default level gives a summary, appropriate for simple testing.

Histograms can be drawn into a postscript file, if supplied.

This method can also optionally overlay histograms from other sets, by supplying a collection of other sets. Implementation depends on the concrete class (e.g. normalization choices, color choices, etc.).

Reimplemented in recocert::CalHists, recocert::CftHists, recocert::CpsHists, recocert::ElectronHists, recocert::JetHists, recocert::MetHists, recocert::MuonHists, recocert::MuonMDTHists, recocert::MuonMSCHists, recocert::MuonPDTHists, recocert::MuonTrackHists, recocert::OccupancyHists, recocert::SmtClusterBHists, recocert::SmtClusterFDHists, recocert::SmtClusterHDHists, recocert::TimingHists, recocert::TrackEffIsolHists, recocert::TrackEffJetHists, recocert::TrackHists, recocert::TriggerHists, recocert::V0Hists, and recocert::VertexHists.

void recocert::HistSets::draw1D ( const std::string & histname,
std::vector< HistSets *> * overlaySets = NULL,
int logy = 0,
int logx = 0,
const std::string & normalize = "EVENT",
const std::string & option = "" )
 

Draw 1D histogram(s).

Draw the specified histogram (by name) to the currently open canvas (use newPage() to open a new canvas).

Optionally will overlay histograms with the same name in the supplied vector of HistSets. Each overlaid histogram will have a unique color (starting with red).

Users can optionally select log scales for y and x axes by setting logy or logx equal to 1 respectively [default = linear scale].

If histograms are overlaid, they are by default normalized by the number of events processed. Use the normalize option to override. Currently supported:

  • EVENT -- Normalize by number of events [default]
  • AREA -- Normalize by area
  • NONE -- Do not normalize
Additional ROOT drawing options may be supplied via the option parameter.

void recocert::HistSets::draw2D ( const std::string & histname,
std::vector< HistSets *> * overlaySets = NULL,
const std::string & option = "" )
 

Draw 2D histogram(s).

Draw the specified histogram (by name) to the currently open canvas (use newPage() to open a new canvas).

Optionally will overlay histograms with the same name in the supplied vector of HistSets. Each overlaid histogram will have a unique color (starting with red).

NB - Currently, overlaying is not implemented for 2D histograms.

Additional ROOT drawing options may be supplied via the option parameter.

void recocert::HistSets::drawProfile ( const std::string & histname,
std::vector< HistSets *> * overlaySets = NULL,
int logy = 0,
int logx = 0,
const std::string & option = "" )
 

Draw profile histogram(s).

Draw the specified histogram (by name) to the currently open canvas (use newPage() to open a new canvas).

Optionally will overlay histograms with the same name in the supplied vector of HistSets. Each overlaid histogram will have a unique color (starting with red).

Users can optionally select log scales for y and x axes by setting logy or logx equal to 1 respectively [default = linear scale].

Additional ROOT drawing options may be supplied via the option parameter.

bool recocert::HistSets::exists ( std::string name,
std::string type = "ANY" )
 

Check if given histogram exists.

Return true if there is any histogram within this set with the given name.

Optionally, the user can ask to check for a specific type of histogram. Supported types are:

  • 1D
  • 2D
  • Profile

void recocert::HistSets::fill ( ) [protected]
 

Fill special internal histograms.

TH1F * recocert::HistSets::get1DHist ( std::string name ) [inline]
 

Get 1D histogram.

TH2F * recocert::HistSets::get2DHist ( std::string name ) [inline]
 

Get 2D histogram.

TProfile * recocert::HistSets::getProfileHist ( std::string name ) [inline]
 

Get profile histogram.

void recocert::HistSets::init ( HepRootFileManager * manager = NULL,
const edm::RCP * rcp = NULL ) [protected, virtual]
 

Initialize histograms.

If an optional file manager is supplied, then first create a subdirectory based on the name of the histogram set, and then create the histograms within that subdirectory.

void recocert::HistSets::load ( TFile * file,
const std::string & dir ) [virtual]
 

Load histograms from a subdirectory in a given file.

void recocert::HistSets::newPage ( std::string label,
int nxpads,
int nypads,
TPostScript * psfile = NULL )
 

Create a new page for drawing histograms.

Create a new canvas for drawing histogram, with the specified label. The number of zones (pads) is set to nxpads x nypads.

Optionally the canvas is inserted into the user supplied postscript file (a new page is created).

void recocert::HistSets::save ( const std::string & file )
 

Save standard set of plots.

This method is currently unsupported. It previously saved ROOT canvases containing the drawn histograms. It will soon be used to save merged histograms, created by using the add method.

void recocert::HistSets::stat ( std::ostream & out,
const int & level = 0 ) [pure virtual]
 

Print summary statistics.

Selected statistics are written into the supplied ostream, depending on the user specified value of level. The higher the level, the more detailed the statistics.

Reimplemented in recocert::CalHists, recocert::CftHists, recocert::CpsHists, recocert::ElectronHists, recocert::JetHists, recocert::MetHists, recocert::MuonHists, recocert::MuonMDTHists, recocert::MuonMSCHists, recocert::MuonPDTHists, recocert::MuonTrackHists, recocert::OccupancyHists, recocert::SmtClusterBHists, recocert::SmtClusterFDHists, recocert::SmtClusterHDHists, recocert::TimingHists, recocert::TrackEffIsolHists, recocert::TrackEffJetHists, recocert::TrackHists, recocert::TriggerHists, recocert::V0Hists, and recocert::VertexHists.


Member Data Documentation

HCanvas * recocert::HistSets::_canvas [protected]
 

The current canvas when drawing histograms.

std::map< std::string, TH1F *> recocert::HistSets::_hists1D [protected]
 

The 1-dimensional histograms.

std::map< std::string, TH2F *> recocert::HistSets::_hists2D [protected]
 

The 2-dimensional histograms.

std::map< std::string, TProfile *> recocert::HistSets::_histsProfile [protected]
 

The profile histograms.

const std::string recocert::HistSets::_name [protected]
 

The name of this histogram set.

Reimplemented in recocert::TrackEffHists.

int recocert::HistSets::_pad [protected]
 

The current pad when drawing histograms.


The documentation for this class was generated from the following file:
Generated at Sat Oct 4 20:18:32 2003 for recocert by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001