142 T->SetPerfStats(
this);
143 fNleaves= T->GetListOfLeaves()->GetEntries();
144 fFile = T->GetCurrentFile();
169 fCompress = (T->GetTotBytes()+0.00001)/T->GetZipBytes();
219 const Int_t kMaxDiff = 7;
224 if (py < puymax)
return 9999;
227 if (distance <kMaxDiff) {
if (px > puxmin && py < puymin)
gPad->SetSelected(
fGraphIO);
return distance;}
230 if (distance <kMaxDiff) {
if (px > puxmin && py < puymin)
gPad->SetSelected(
fGraphTime);
return distance;}
233 if (distance <kMaxDiff) {
gPad->SetSelected(
fPave);
return distance;}
240 if (px > puxmax-300)
return 2;
255 if (strlen(option)==0) opt =
"al";
258 if (!
gPad->IsEditable())
gROOT->MakeDefCanvas();
263 gROOT->MakeDefCanvas();
266 gPad->SetLeftMargin(0.35);
345 if (!npoints)
return;
350 for (
Int_t i=1;i<npoints;i++) {
364 for (
int i = 0; i < branches->
GetEntries(); ++i) {
389 for (
Int_t i = 0; i < branches->GetEntries(); ++i) {
390 if (br == branches->UncheckedAt(i)) {
399 index = iter->second;
414 if (brvec.size() <= basketNumber)
415 brvec.resize(basketNumber + 1);
417 return brvec[basketNumber];
441 if ((info.fLoaded + info.fLoadedMiss) > 1) {
443 result.emplace_back(BasketList_t::value_type((
TBranch*)branches->At(i), std::vector<size_t>(1)));;
446 auto &ref( result.back() );
447 ref.second.push_back(j);
461 if (!npoints)
return;
464 if (iomax >= 1e9) toffset = 1.2;
557 printf(
"Readextra = %5.2f per cent\n",extra);
558 printf(
"Real Time = %7.3f seconds\n",
fRealTime);
559 printf(
"CPU Time = %7.3f seconds\n",
fCpuTime);
560 printf(
"Disk Time = %7.3f seconds\n",
fDiskTime);
563 printf(
"UnzipTime = %7.3f seconds\n",
fUnzipTime);
598 const char *branchname = branches->
At(i)->
GetName();
600 printf(
" br=%zu %s read not cached: ", i, branchname);
610 printf(
" br=%zu %s cached more than once: ", i, branchname);
613 if ((info.fLoaded + info.fLoadedMiss) > 1)
614 printf(
"%zu[%d,%d] ", j, info.fLoaded, info.fLoadedMiss);
618 printf(
" br=%zu %s cached but not used: ", i, branchname);
621 if ((info.fLoaded + info.fLoadedMiss) && !info.fUsed) {
622 if (info.fLoadedMiss)
623 printf(
"%zu[%d,%d] ", j, info.fLoaded, info.fLoadedMiss);
631 printf(
" br=%zu %s: ", i, branchname);
634 printf(
"%zu[%d,%d,%d,%d] ", j, info.fUsed, info.fLoaded, info.fLoadedMiss, info.fMissed);
640 printf(
" br=%d %s: no basket information\n", i, branches->At(i)->GetName());
651 ps->TObject::SaveAs(filename);
661 if (
gROOT->ClassSaved(TTreePerfStats::Class())) {
664 out<<
" TTreePerfStats *";
666 out<<
"ps = new TTreePerfStats();"<<std::endl;
667 out<<
" ps->SetName("<<quote<<
GetName()<<quote<<
");"<<std::endl;
668 out<<
" ps->SetHostInfo("<<quote<<
GetHostInfo()<<quote<<
");"<<std::endl;
670 out<<
" ps->SetNleaves("<<
fNleaves<<
");"<<std::endl;
671 out<<
" ps->SetReadCalls("<<
fReadCalls<<
");"<<std::endl;
673 out<<
" ps->SetBytesRead("<<
fBytesRead<<
");"<<std::endl;
675 out<<
" ps->SetRealNorm("<<
fRealNorm<<
");"<<std::endl;
676 out<<
" ps->SetRealTime("<<
fRealTime<<
");"<<std::endl;
677 out<<
" ps->SetCpuTime("<<
fCpuTime<<
");"<<std::endl;
678 out<<
" ps->SetDiskTime("<<
fDiskTime<<
");"<<std::endl;
679 out<<
" ps->SetUnzipTime("<<
fUnzipTime<<
");"<<std::endl;
680 out<<
" ps->SetCompress("<<
fCompress<<
");"<<std::endl;
683 out<<
" TGraphErrors *psGraphIO = new TGraphErrors("<<npoints<<
");"<<std::endl;
684 out<<
" psGraphIO->SetName("<<quote<<
fGraphIO->
GetName()<<quote<<
");"<<std::endl;
685 out<<
" psGraphIO->SetTitle("<<quote<<
fGraphIO->
GetTitle()<<quote<<
");"<<std::endl;
686 out<<
" ps->SetGraphIO(psGraphIO);"<<std::endl;
690 for (i=0;i<npoints;i++) {
692 out<<
" psGraphIO->SetPointError("<<i<<
",0,"<<
fGraphIO->
GetEY()[i]<<
");"<<std::endl;
695 out<<
" TGraphErrors *psGraphTime = new TGraphErrors("<<npoints<<
");"<<std::endl;
696 out<<
" psGraphTime->SetName("<<quote<<
fGraphTime->
GetName()<<quote<<
");"<<std::endl;
697 out<<
" psGraphTime->SetTitle("<<quote<<
fGraphTime->
GetTitle()<<quote<<
");"<<std::endl;
698 out<<
" ps->SetGraphTime(psGraphTime);"<<std::endl;
702 for (i=0;i<npoints;i++) {
704 out<<
" psGraphTime->SetPointError("<<i<<
",0,"<<
fGraphTime->
GetEY()[i]<<
");"<<std::endl;
707 out<<
" ps->Draw("<<quote<<option<<quote<<
");"<<std::endl;
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
A TTree is a list of TBranches.
Using a TBrowser one can browse all ROOT objects.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsString() const
Return the date & time as a string (ctime() format).
virtual TFile * GetFile() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static Int_t GetReadaheadSize()
Static function returning the readahead buffer size.
virtual Long64_t GetBytesReadExtra() const
virtual void Paint(Option_t *chopt="")
Draw this axis with its current attributes.
void SetTitleOffset(Float_t titleoffset=1)
virtual void SetTitle(const char *title="")
Change the title of the axis.
void SetLabelColor(Int_t labelcolor)
void SetTitleColor(Int_t titlecolor)
void SetLabelSize(Float_t labelsize)
virtual void SetName(const char *name)
Change the name of the axis.
A TGraphErrors is a TGraph with error bars.
virtual void SetPointError(Double_t ex, Double_t ey)
Set ex and ey values for point pointed by the mouse.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
virtual void SetName(const char *name="")
Set graph name.
virtual void SetTitle(const char *title="")
Change (i.e.
virtual void Paint(Option_t *chopt="")
Draw this graph with its current attributes.
TAxis * GetXaxis() const
Get x axis of the graph.
TAxis * GetYaxis() const
Get y axis of the graph.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a graph.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Int_t GetEntries() const
Return the number of objects in array (i.e.
TObject * UncheckedAt(Int_t i) const
TObject * At(Int_t idx) const
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
@ kCanDelete
if object in a list can be deleted
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
virtual void Paint(Option_t *option="")
Paint this pavetext with its current attributes.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a pave.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
void ToLower()
Change string to lower-case.
const char * Data() const
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
Base class for several text objects.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a string.
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
virtual void Paint(Option_t *option="")
Paint this text with its current attributes.
The TTimeStamp encapsulates seconds and ns since EPOCH.
A cache to speed-up the reading of ROOT datasets.
const TObjArray * GetCachedBranches() const
TTree I/O performance measurement.
TGraphErrors * fGraphIO
pointer to the Tree being monitored
virtual void Print(Option_t *option="") const
Print the TTree I/O perf stats.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void Draw(Option_t *option="")
Draw the TTree I/O perf graph.
const char * GetName() const
Returns name of object.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Return distance to one of the objects in the TTreePerfStats.
BasketInfo & GetBasketInfo(TBranch *b, size_t basketNumber)
Return the BasketInfo corresponding to the given branch and basket.
std::vector< std::vector< BasketInfo > > fBasketsInfo
TTree * fTree
pointer to the file containing the Tree
virtual void UpdateBranchIndices(TObjArray *branchNames)
Update the fBranchIndexCache collection to match the current TTree given the ordered list of branch n...
virtual void Paint(Option_t *chopt="")
Draw the TTree I/O perf graph.
BasketList_t GetDuplicateBasketCache() const
Return the collection of baskets which have been read by the TTreeCache more than once.
virtual void Finish()
When the run is finished this function must be called to save the current parameters in the file and ...
const char * GetHostInfo() const
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save this object to filename.
virtual void UnzipEvent(TObject *tree, Long64_t pos, Double_t start, Int_t complen, Int_t objlen)
Record TTree unzip event.
std::unordered_map< TBranch *, size_t > fBranchIndexCache
virtual void Browse(TBrowser *b)
Browse.
virtual void PrintBasketInfo(Option_t *option="") const
Print the TTree basket information.
std::vector< std::pair< TBranch *, std::vector< size_t > > > BasketList_t
TGraphErrors * fGraphTime
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Return distance to one of the objects in the TTreePerfStats.
virtual ~TTreePerfStats()
Destructor.
TTreePerfStats()
default constructor (used when reading an object only)
virtual void FileReadEvent(TFile *file, Int_t len, Double_t start)
Record TTree file read event.
A TTree represents a columnar dataset.
TFile * GetCurrentFile() const
Return pointer to the current file.
TDirectory * GetDirectory() const
virtual Long64_t GetReadEntry() const
virtual TTree * GetTree() const
virtual Long64_t GetCacheSize() const
Provides the interface for the PROOF internal performance measurement and event tracing.
T MaxElement(Long64_t n, const T *a)
Return maximum of array a of length n.