Class describing the access statistics of a collection of branches. More...
#include <D3PDReadStats.h>
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. | |
D3PDReadStats & | operator= (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. | |
D3PDReadStats & | AddVariable (const VariableStats &var) |
Add information about a variable to the object. | |
const VariableStats * | GetVariable (const char *name) const |
Get information about a specific variable. | |
const Map_t & | GetVariables () const |
Get all variable information. | |
::Bool_t | IsCompatible (const D3PDReadStats &rh) const |
Function checking if two objects are "compatible". | |
D3PDReadStats & | Add (const D3PDReadStats &rh) |
Function merging two objects. | |
D3PDReadStats & | operator+= (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. |
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.
$Revision$ $Date$
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.
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.
name | Name for the object |
title | Optional title for the object (not used for anything) |
D3PDReader::D3PDReadStats::D3PDReadStats | ( | const D3PDReadStats & | parent | ) |
Copy constructor.
It's probably not needed actually, but I wanted to be explicit about how the copy constructor should behave.
parent | The object that's being copied |
D3PDReadStats & D3PDReader::D3PDReadStats::Add | ( | const D3PDReadStats & | rh | ) |
Function merging two objects.
This function is used to merge the information from two objects.
rh | The object to be merged into this one |
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.
tree | Tree 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.
tree | Tree for which the caching should be configured |
minByteFraction | Minimum 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.
tree | Tree for which the caching should be configured |
minBytes | Minimum 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.
tree | Tree for which the caching should be configured |
minEntries | Minimum 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.
tree | Tree for which the caching should be configured |
minEvFraction | Minimum fraction of entries read from the branches that should be added to the cache |
D3PDReadStats & D3PDReader::D3PDReadStats::AddVariable | ( | const VariableStats & | var | ) |
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.
var | Access statistics for a single variable |
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.
minByteFraction | Minimum fraction of bytes read from the variables |
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.
minBytes | Minimum number of bytes read from the variables |
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.
minEntries | Minimum number of entries read from the variables |
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.
minEvFrac | Minimum fraction of entries read from the variables |
TH1 * D3PDReader::D3PDReadStats::GetEntryReadStat | ( | ) | const |
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.
TH1 * D3PDReader::D3PDReadStats::GetTreeAccessStat | ( | ) | const |
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.
TH1 * D3PDReader::D3PDReadStats::GetUnzippedByteReadStat | ( | ) | const |
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.
const VariableStats * D3PDReader::D3PDReadStats::GetVariable | ( | const char * | name | ) | const |
Get information about a specific variable.
Get the access statistics of a single D3PD variable.
name | The name of the D3PD variable |
TH1 * D3PDReader::D3PDReadStats::GetZippedByteReadStat | ( | ) | const |
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.
Bool_t D3PDReader::D3PDReadStats::IsCompatible | ( | const D3PDReadStats & | rh | ) | const |
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.
rh | Object to compare to this object |
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.
coll | A collection of D3PDReader::VariableStats objects |
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.
parent | The object that's being copied |
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):
option | Possible options for the printing |