SusyNtuple
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions
D3PDReader::D3PDReadStats Class Reference

Class describing the access statistics of a collection of branches. More...

#include <D3PDReadStats.h>

List of all members.

Public Types

typedef std::map< ::TString,
VariableStats
Map_t
 Type of the internal object gathering information.

Public Member Functions

 D3PDReadStats (const char *name="D3PDReadStats", const char *title="D3PD reading statistics")
 Constructor just specifying the name of the object.
 D3PDReadStats (const D3PDReadStats &parent)
 Copy constructor.
D3PDReadStatsoperator= (const D3PDReadStats &parent)
 Assignment operator.
void Clear (::Option_t *opt="")
 Clear the statistics information.
void SetBytesRead (::Long64_t num)
 Set how many bytes were read in total during the analysis.
::Long64_t GetBytesRead () const
 Get how many bytes were read in total during the analysis.
void SetVariableNum (::Int_t num)
 Set the total number of variables of the input.
::Int_t GetVariableNum () const
 Get the total number of variables of the input.
void SetFileReads (::Int_t num)
 Set the total number of file read calls.
::Int_t GetFileReads () const
 Get the total number of file read calls.
void SetCacheSize (::Int_t size)
 Set the TTreeCache size used.
::Int_t GetCacheSize () const
 Get the TTreeCache size used.
void SetUnzipTime (::Double_t time)
 Set the time spent in unzipping the data.
::Double_t GetUnzipTime () const
 Get the time spent in unzipping the data.
void SetProcessTime (::Double_t time)
 Set the time spent in processing events.
::Double_t GetProcessTime () const
 Get the time spent in processing events.
D3PDReadStatsAddVariable (const VariableStats &var)
 Add information about a variable to the object.
const VariableStatsGetVariable (const char *name) const
 Get information about a specific variable.
const Map_tGetVariables () const
 Get all variable information.
::Bool_t IsCompatible (const D3PDReadStats &rh) const
 Function checking if two objects are "compatible".
D3PDReadStatsAdd (const D3PDReadStats &rh)
 Function merging two objects.
D3PDReadStatsoperator+= (const D3PDReadStats &rh)
 Operator merging two objects.
void AddToTreeCache (::TTree *tree) const
 Add all branches that were ever accessed, to the TTreeCache.
void AddToTreeCacheByEntries (::TTree *tree,::Long64_t minEntries) const
 Add the branches accessed more than n times to the TTreeCache.
void AddToTreeCacheByEntryFrac (::TTree *tree,::Double_t minEvFraction) const
 Add the branches accessed more than a given fraction of times to the TTreeCache.
void AddToTreeCacheByBytes (::TTree *tree,::Long64_t minBytes) const
 Add the branches from which more than x bytes were read, to the TTreeCache.
void AddToTreeCacheByByteFrac (::TTree *tree,::Double_t minByteFraction) const
 Add the branches from whith more than a given fraction of the bytes were read, to the TTreeCache.
std::vector< TString > GetBranchesByEntries (::Long64_t minEntries) const
 Get the branches accessed more than n times.
std::vector< TString > GetBranchesByEntryFrac (::Double_t minEvFraction) const
 Get the branches accessed more than a given fraction of times.
std::vector< TString > GetBranchesByBytes (::Long64_t minBytes) const
 Get the branches from which more than x bytes were read.
std::vector< TString > GetBranchesByByteFrac (::Double_t minByteFraction) const
 Get the branches from which more than a given fraction of bytes were read.
::TH1 * GetTreeAccessStat () const
 Get a histogram with the TTree access statistics.
::TH1 * GetEntryReadStat () const
 Get a histogram with the entry reading statistics.
::TH1 * GetZippedByteReadStat () const
 Get a histogram with the zipped byte reading statistics.
::TH1 * GetUnzippedByteReadStat () const
 Get a histogram with the unzipped byte reading statistics.
::Int_t Merge (::TCollection *coll)
 Function merging the information from multiple objects.
void Print (::Option_t *option="") const
 Print information about the collected statistics.

Detailed Description

Class describing the access statistics of a collection of branches.

Objects of this class are used to describe the access pattern of a D3PD analysis. The object can also be used to optimize the caching for the analysis in subsequent runs.

Author:
Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>

$Revision$ $Date$


Member Typedef Documentation

typedef std::map< ::TString, VariableStats > D3PDReader::D3PDReadStats::Map_t

Type of the internal object gathering information.

Notice that I can't write ::TString here, because the generated dictionary would then have code with <:: in it, which is not a valid C++ operator.


Constructor & Destructor Documentation

D3PDReader::D3PDReadStats::D3PDReadStats ( const char *  name = "D3PDReadStats",
const char *  title = "D3PD reading statistics" 
)

Constructor just specifying the name of the object.

In order to be able to stream such objects, they have to have an explicit name. It can be specified using this constructor, but usually leaving the default is just fine.

Parameters:
nameName for the object
titleOptional title for the object (not used for anything)

Copy constructor.

It's probably not needed actually, but I wanted to be explicit about how the copy constructor should behave.

Parameters:
parentThe object that's being copied

Member Function Documentation

Function merging two objects.

This function is used to merge the information from two objects.

Parameters:
rhThe object to be merged into this one
Returns:
A reference to the merged object
void D3PDReader::D3PDReadStats::AddToTreeCache ( ::TTree *  tree) const

Add all branches that were ever accessed, to the TTreeCache.

This function can be used to add all the branches that this object knows about, to the cache of the TTree given to the function.

It can be useful for blankly enabling caching for all the variables that a D3PDReader object can possibly access.

Parameters:
treeTree for which the caching should be configured
void D3PDReader::D3PDReadStats::AddToTreeCacheByByteFrac ( ::TTree *  tree,
::Double_t  minByteFraction 
) const

Add the branches from whith more than a given fraction of the bytes were read, to the TTreeCache.

This function can be used to add all the variables to the cache from which more than some fraction of the bytes were read in a previous running.

Parameters:
treeTree for which the caching should be configured
minByteFractionMinimum fraction of bytes read from the variable to qualify for caching
void D3PDReader::D3PDReadStats::AddToTreeCacheByBytes ( ::TTree *  tree,
::Long64_t  minBytes 
) const

Add the branches from which more than x bytes were read, to the TTreeCache.

This function can be used to add all the variables to the cache from which more than some bytes were read in a previous running.

Parameters:
treeTree for which the caching should be configured
minBytesMinimum number of bytes read from the variable to qualify for caching
void D3PDReader::D3PDReadStats::AddToTreeCacheByEntries ( ::TTree *  tree,
::Long64_t  minEntries 
) const

Add the branches accessed more than n times to the TTreeCache.

This should be one of the most useful functions of this class. It can be used to selectively enable the caching for the branches which were accessed more than a specified number of times in a previous running.

Parameters:
treeTree for which the caching should be configured
minEntriesMinimum number of entries read from the variable to qualify for caching
void D3PDReader::D3PDReadStats::AddToTreeCacheByEntryFrac ( ::TTree *  tree,
::Double_t  minEvFraction 
) const

Add the branches accessed more than a given fraction of times to the TTreeCache.

This should be one of the most useful functions of this class. It can be used to selectively enable the caching for the branches which were accessed more than a specified fraction of times in a previous running. This is slightly more general than the version of this function expecting an absolute entry number.

Parameters:
treeTree for which the caching should be configured
minEvFractionMinimum fraction of entries read from the branches that should be added to the cache

Add information about a variable to the object.

Add information about a single variable to the statistics. Note that it's perfectly valid to add multiple objects describing the same variable. In that case the information is accumulated properly.

Parameters:
varAccess statistics for a single variable
Returns:
A reference to the modified object
std::vector<::TString > D3PDReader::D3PDReadStats::GetBranchesByByteFrac ( ::Double_t  minByteFraction) const

Get the branches from which more than a given fraction of bytes were read.

This function can be used to get a list of branch names from which more than a specified fraction of bytes were read in the analysis.

Parameters:
minByteFractionMinimum fraction of bytes read from the variables
Returns:
A list of variable names fulfilling the requirement
std::vector<::TString > D3PDReader::D3PDReadStats::GetBranchesByBytes ( ::Long64_t  minBytes) const

Get the branches from which more than x bytes were read.

This function can be used to get a list of branch names from which more than a specified number of bytes were read in the analysis.

Parameters:
minBytesMinimum number of bytes read from the variables
Returns:
A list of variable names fulfilling the requirement
std::vector<::TString > D3PDReader::D3PDReadStats::GetBranchesByEntries ( ::Long64_t  minEntries) const

Get the branches accessed more than n times.

This function can be used to get a list of branch names that were accessed more than a specified number of times in the analysis.

Parameters:
minEntriesMinimum number of entries read from the variables
Returns:
A list of variable names fulfilling the requirement
std::vector<::TString > D3PDReader::D3PDReadStats::GetBranchesByEntryFrac ( ::Double_t  minEvFrac) const

Get the branches accessed more than a given fraction of times.

This function can be used to get a list of branch names that were accessed more than some fraction of times in the analysis.

Parameters:
minEvFracMinimum fraction of entries read from the variables
Returns:
A list of variable names fulfilling the requirement

Get a histogram with the entry reading statistics.

This function can be used to produce a nice histogram showing how many entries were accessed by how many of the branches.

Note that the caller is responsible for deleting the created histogram.

Returns:
The histogram showing the distribution

Get a histogram with the TTree access statistics.

This function can be used to produce a nice histogram showing how many TTrees were accessed by how many of the branches.

Note that the caller is responsible for deleting the created histogram.

Returns:
The histogram showing the distribution

Get a histogram with the unzipped byte reading statistics.

This function can be used to produce a nice histogram showing how many uncompressed bytes were accessed by how many of the branches.

Note that the caller is responsible for deleting the created histogram.

Returns:
The histogram showing the distribution
const VariableStats * D3PDReader::D3PDReadStats::GetVariable ( const char *  name) const

Get information about a specific variable.

Get the access statistics of a single D3PD variable.

Parameters:
nameThe name of the D3PD variable
Returns:
A pointer to the object describing the access statistics, or a null pointer if the variable is unknown

Get a histogram with the zipped byte reading statistics.

This function can be used to produce a nice histogram showing how many raw bytes were accessed by how many of the branches.

Note that the caller is responsible for deleting the created histogram.

Returns:
The histogram showing the distribution

Function checking if two objects are "compatible".

This function checks whether two objects are "compatible" with each other. This just means that it checks whether it appears as if the two statistics objects would've been recorded from the same input type or not.

Parameters:
rhObject to compare to this object
Returns:
kTRUE if the two objects are compatible, kFALSE otherwise
Int_t D3PDReader::D3PDReadStats::Merge ( ::TCollection *  coll)

Function merging the information from multiple objects.

This function makes it possible to properly merge objects coming from PROOF workers.

Parameters:
collA collection of D3PDReader::VariableStats objects
Returns:
0 in case of failure, a positive number in case of success
D3PDReadStats & D3PDReader::D3PDReadStats::operator= ( const D3PDReadStats parent)

Assignment operator.

This is probably not needed either, but again, I wanted to be explicit.

Parameters:
parentThe object that's being copied
Returns:
A reference to the copied object
void D3PDReader::D3PDReadStats::Print ( ::Option_t *  option = "") const

Print information about the collected statistics.

Standard ROOT printing function. It prints the gathered information about the variables accessed in an analysis.

The option parameter understands the following value(s):

  • "Summary": Only the summary information is printed.
  • "ByEntries": Order the variables by the number of entries read from them.
  • "ByBytes": Order the variables by the number of bytes read from them.
Parameters:
optionPossible options for the printing

The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations Enumerator