Crombie Tools
HistWriter Class Reference

Can be created using the CrombieTools.SkimmingTools.HistWriter module. More...

#include <HistWriter.h>

Public Member Functions

 HistWriter (TString fileName="output.root", TString histName="corrections")
 Default constructor. More...
 
virtual ~HistWriter ()
 
void Make2DHist (TString configName, unsigned numX, unsigned numY)
 Writes a 2D histogram based on a configuration file. Needs the dimensions to simplify logic... More...
 
void MakeHist (TString configName)
 Writes a histogram based on a configuration file. More...
 
void MakeHist (TString fileName, TString histName, TString configName)
 Sets the output names and reads the configuration file at the same time. More...
 
void SetFileName (TString fileName)
 Sets the output .root file name. More...
 
void SetHistName (TString histName)
 Sets the output histogram name. More...
 

Private Attributes

TString fFileName
 Output .root file name. More...
 
TString fHistName
 Output histogram name. More...
 

Detailed Description

Can be created using the CrombieTools.SkimmingTools.HistWriter module.

Class used to write a histogram into a .root file from a .txt file.

Definition at line 21 of file HistWriter.h.

Constructor & Destructor Documentation

§ HistWriter()

HistWriter::HistWriter ( TString  fileName = "output.root",
TString  histName = "corrections" 
)

Default constructor.

§ ~HistWriter()

HistWriter::~HistWriter ( )
virtual

Definition at line 24 of file HistWriter.cc.

Member Function Documentation

§ Make2DHist()

void HistWriter::Make2DHist ( TString  configName,
unsigned  numX,
unsigned  numY 
)

Writes a 2D histogram based on a configuration file. Needs the dimensions to simplify logic...

Definition at line 68 of file HistWriter.cc.

References fFileName, fHistName, and dojob::outFile.

§ MakeHist() [1/2]

void HistWriter::MakeHist ( TString  configName)

Writes a histogram based on a configuration file.

Reads the configuration file given by configName.

The configuration file consists only of alternating bin edge locations and bin contents. The first and last number of the file should be a bin edge. (The number of edges is the number of bins + 1). These can be separated by spaces or new lines.

Definition at line 37 of file HistWriter.cc.

References fFileName, fHistName, and dojob::outFile.

Referenced by MakeHist().

§ MakeHist() [2/2]

void HistWriter::MakeHist ( TString  fileName,
TString  histName,
TString  configName 
)
inline

Sets the output names and reads the configuration file at the same time.

Definition at line 35 of file HistWriter.h.

References MakeHist(), SetFileName(), and SetHistName().

§ SetFileName()

void HistWriter::SetFileName ( TString  fileName)
inline

Sets the output .root file name.

Definition at line 39 of file HistWriter.h.

References fFileName.

Referenced by MakeHist().

§ SetHistName()

void HistWriter::SetHistName ( TString  histName)
inline

Sets the output histogram name.

Definition at line 41 of file HistWriter.h.

References fHistName.

Referenced by MakeHist().

Member Data Documentation

§ fFileName

TString HistWriter::fFileName
private

Output .root file name.

Definition at line 44 of file HistWriter.h.

Referenced by Make2DHist(), MakeHist(), and SetFileName().

§ fHistName

TString HistWriter::fHistName
private

Output histogram name.

Definition at line 45 of file HistWriter.h.

Referenced by Make2DHist(), MakeHist(), and SetHistName().


The documentation for this class was generated from the following files: