ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
xAOD::PerfStats Class Reference

Class for collecting information about the xAOD file access pattern. More...

#include <PerfStats.h>

Inheritance diagram for xAOD::PerfStats:
Collaboration diagram for xAOD::PerfStats:

Public Member Functions

 ~PerfStats ()
 Destructor, sometimes called by PROOF. More...
 
void start (bool clear=true)
 Start the statistics collection. More...
 
void stop ()
 Stop the statistics collection. More...
 
Functions inherited from TVirtualPerfStats:
virtual void SimpleEvent (EEventType type)
 Generic function called when a specified event happens. More...
 
virtual void PacketEvent (const char *slave, const char *slavename, const char *filename, ::Long64_t eventsprocessed, ::Double_t latency, ::Double_t proctime, ::Double_t cputime, ::Long64_t bytesRead)
 PROOF specific function, not implemented here. More...
 
virtual void FileEvent (const char *slave, const char *slavename, const char *nodename, const char *filename, ::Bool_t isStart)
 PROOF specific function, not implemented here. More...
 
virtual void FileOpenEvent (::TFile *file, const char *filename, ::Double_t start)
 Function called by PROOF when a file is opened. More...
 
virtual void FileReadEvent (::TFile *file, ::Int_t len, ::Double_t start)
 Function called in general when a file reading operation happens. More...
 
virtual void UnzipEvent (::TObject *tree, ::Long64_t pos, ::Double_t start, ::Int_t complen, ::Int_t objlen)
 Function called in general when a file unzipping operation happens. More...
 
virtual void RateEvent (::Double_t proctime, ::Double_t deltatime, ::Long64_t eventsprocessed, ::Long64_t bytesRead)
 PROOF specific function, not implemented here. More...
 
virtual void SetBytesRead (::Long64_t num)
 Function used by PROOF to set the read bytes correctly on the master. More...
 
virtual ::Long64_t GetBytesRead () const
 Function used by PROOF to set the read bytes correctly on the master. More...
 
virtual void SetNumEvents (::Long64_t num)
 Function used by PROOF to set the number of processed events correctly. More...
 
virtual ::Long64_t GetNumEvents () const
 Function used by PROOF to set the number of processed events correctly. More...
 
virtual void PrintBasketInfo (Option_t *option="") const
 Print the TTree basket read caching statistics. More...
 
virtual void SetLoaded (TBranch *b, size_t basketNumber)
 Increase by 1 the counter of how many times a basket was cached. More...
 
virtual void SetLoaded (size_t bi, size_t basketNumber)
 
virtual void SetLoadedMiss (TBranch *b, size_t basketNumber)
 Increase by 1 the counter of how many times a basket was cached on access. More...
 
virtual void SetLoadedMiss (size_t bi, size_t basketNumber)
 
virtual void SetMissed (TBranch *b, size_t basketNumber)
 Increase count (by 1) of not cached basket reads. More...
 
virtual void SetMissed (size_t bi, size_t basketNumber)
 
virtual void SetUsed (TBranch *b, size_t basketNumber)
 Mark a basket as accessed. More...
 
virtual void SetUsed (size_t bi, size_t basketNumber)
 
virtual void UpdateBranchIndices (TObjArray *branches)
 Update the fBranchIndexCache collection to match the current TTree given the ordered list of branch names. More...
 

Static Public Member Functions

static PerfStatsinstance ()
 Function accessing the singleton instance. More...
 

Protected Member Functions

 PerfStats ()
 The constructor is protected, as it's a singleton. More...
 

Private Types

typedef std::lock_guard< std::mutex > lock_t
 

Private Member Functions

virtual void SetFile (TFile *file)
 Function letting us know that a new file was opened. More...
 

Private Attributes

::TVirtualPerfStats * m_otherPerfStats
 Another performance monitoring object. More...
 
bool m_running
 Flag showing whether the statistic collection is ongoing or not. More...
 
::Double_t m_startTime
 Time when the statistics collection was started. More...
 
::TTree * m_tree
 The tree we're currently investigating. More...
 
::TFile * m_file
 The currently open xAOD file. More...
 
bool m_treeWarningPrinted
 Flag showing whether some information message has already been printed. More...
 

Static Private Attributes

static PerfStats *s_instance ATLAS_THREAD_SAFE
 The single instance of the object. More...
 
static std::mutex s_mutex
 Lock controlling access to the singleton. More...
 

Detailed Description

Class for collecting information about the xAOD file access pattern.

This class is used for collecting the basic information about the file access during an xAOD analysis. It was first developed for the D3PDReader code, and was later adopted to be used with xAOD files.

Note: One can't use override on the virtual functions of this class, as it generates a lot of warnings because of how ClassDef(...) is implemented. :-(

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 34 of file PerfStats.h.

Member Typedef Documentation

◆ lock_t

typedef std::lock_guard<std::mutex> xAOD::PerfStats::lock_t
private

Definition at line 126 of file PerfStats.h.

Constructor & Destructor Documentation

◆ ~PerfStats()

xAOD::PerfStats::~PerfStats ( )

Destructor, sometimes called by PROOF.

◆ PerfStats()

xAOD::PerfStats::PerfStats ( )
protected

The constructor is protected, as it's a singleton.

Member Function Documentation

◆ FileEvent()

virtual void xAOD::PerfStats::FileEvent ( const char slave,
const char slavename,
const char nodename,
const char filename,
::Bool_t  isStart 
)
virtual

PROOF specific function, not implemented here.

◆ FileOpenEvent()

virtual void xAOD::PerfStats::FileOpenEvent ( ::TFile *  file,
const char filename,
::Double_t  start 
)
virtual

Function called by PROOF when a file is opened.

◆ FileReadEvent()

virtual void xAOD::PerfStats::FileReadEvent ( ::TFile *  file,
::Int_t  len,
::Double_t  start 
)
virtual

Function called in general when a file reading operation happens.

◆ GetBytesRead()

virtual ::Long64_t xAOD::PerfStats::GetBytesRead ( ) const

Function used by PROOF to set the read bytes correctly on the master.

◆ GetNumEvents()

virtual ::Long64_t xAOD::PerfStats::GetNumEvents ( ) const

Function used by PROOF to set the number of processed events correctly.

◆ instance()

static PerfStats& xAOD::PerfStats::instance ( )
static

Function accessing the singleton instance.

◆ PacketEvent()

virtual void xAOD::PerfStats::PacketEvent ( const char slave,
const char slavename,
const char filename,
::Long64_t  eventsprocessed,
::Double_t  latency,
::Double_t  proctime,
::Double_t  cputime,
::Long64_t  bytesRead 
)
virtual

PROOF specific function, not implemented here.

◆ PrintBasketInfo()

virtual void xAOD::PerfStats::PrintBasketInfo ( Option_t *  option = "") const
virtual

Print the TTree basket read caching statistics.

◆ RateEvent()

virtual void xAOD::PerfStats::RateEvent ( ::Double_t  proctime,
::Double_t  deltatime,
::Long64_t  eventsprocessed,
::Long64_t  bytesRead 
)
virtual

PROOF specific function, not implemented here.

◆ SetBytesRead()

virtual void xAOD::PerfStats::SetBytesRead ( ::Long64_t  num)
virtual

Function used by PROOF to set the read bytes correctly on the master.

◆ SetFile()

virtual void xAOD::PerfStats::SetFile ( TFile *  file)
privatevirtual

Function letting us know that a new file was opened.

◆ SetLoaded() [1/2]

virtual void xAOD::PerfStats::SetLoaded ( size_t  bi,
size_t  basketNumber 
)
virtual

◆ SetLoaded() [2/2]

virtual void xAOD::PerfStats::SetLoaded ( TBranch *  b,
size_t  basketNumber 
)
virtual

Increase by 1 the counter of how many times a basket was cached.

◆ SetLoadedMiss() [1/2]

virtual void xAOD::PerfStats::SetLoadedMiss ( size_t  bi,
size_t  basketNumber 
)
virtual

◆ SetLoadedMiss() [2/2]

virtual void xAOD::PerfStats::SetLoadedMiss ( TBranch *  b,
size_t  basketNumber 
)
virtual

Increase by 1 the counter of how many times a basket was cached on access.

◆ SetMissed() [1/2]

virtual void xAOD::PerfStats::SetMissed ( size_t  bi,
size_t  basketNumber 
)
virtual

◆ SetMissed() [2/2]

virtual void xAOD::PerfStats::SetMissed ( TBranch *  b,
size_t  basketNumber 
)
virtual

Increase count (by 1) of not cached basket reads.

◆ SetNumEvents()

virtual void xAOD::PerfStats::SetNumEvents ( ::Long64_t  num)
virtual

Function used by PROOF to set the number of processed events correctly.

◆ SetUsed() [1/2]

virtual void xAOD::PerfStats::SetUsed ( size_t  bi,
size_t  basketNumber 
)
virtual

◆ SetUsed() [2/2]

virtual void xAOD::PerfStats::SetUsed ( TBranch *  b,
size_t  basketNumber 
)
virtual

Mark a basket as accessed.

◆ SimpleEvent()

virtual void xAOD::PerfStats::SimpleEvent ( EEventType  type)
virtual

Generic function called when a specified event happens.

◆ start()

void xAOD::PerfStats::start ( bool  clear = true)

Start the statistics collection.

◆ stop()

void xAOD::PerfStats::stop ( )

Stop the statistics collection.

◆ UnzipEvent()

virtual void xAOD::PerfStats::UnzipEvent ( ::TObject *  tree,
::Long64_t  pos,
::Double_t  start,
::Int_t  complen,
::Int_t  objlen 
)
virtual

Function called in general when a file unzipping operation happens.

◆ UpdateBranchIndices()

virtual void xAOD::PerfStats::UpdateBranchIndices ( TObjArray *  branches)
virtual

Update the fBranchIndexCache collection to match the current TTree given the ordered list of branch names.

Member Data Documentation

◆ ATLAS_THREAD_SAFE

PerfStats* s_instance xAOD::PerfStats::ATLAS_THREAD_SAFE
staticprivate

The single instance of the object.

Definition at line 122 of file PerfStats.h.

◆ m_file

::TFile* xAOD::PerfStats::m_file
private

The currently open xAOD file.

Definition at line 139 of file PerfStats.h.

◆ m_otherPerfStats

::TVirtualPerfStats* xAOD::PerfStats::m_otherPerfStats
private

Another performance monitoring object.

Definition at line 129 of file PerfStats.h.

◆ m_running

bool xAOD::PerfStats::m_running
private

Flag showing whether the statistic collection is ongoing or not.

Definition at line 132 of file PerfStats.h.

◆ m_startTime

::Double_t xAOD::PerfStats::m_startTime
private

Time when the statistics collection was started.

Definition at line 134 of file PerfStats.h.

◆ m_tree

::TTree* xAOD::PerfStats::m_tree
private

The tree we're currently investigating.

Definition at line 137 of file PerfStats.h.

◆ m_treeWarningPrinted

bool xAOD::PerfStats::m_treeWarningPrinted
private

Flag showing whether some information message has already been printed.

Definition at line 142 of file PerfStats.h.

◆ s_mutex

std::mutex xAOD::PerfStats::s_mutex
staticprivate

Lock controlling access to the singleton.

Definition at line 125 of file PerfStats.h.


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