Skip to content

Print key cycle information in rootls -l#7878

Merged
vepadulano merged 1 commit intoroot-project:masterfrom
vepadulano:rootls-improve
May 3, 2021
Merged

Print key cycle information in rootls -l#7878
vepadulano merged 1 commit intoroot-project:masterfrom
vepadulano:rootls-improve

Conversation

@vepadulano
Copy link
Copy Markdown
Member

Fixes #7053 . It prints cycle number next to the key name and mimics the logic for printing "[current cycle]" and "[backup cycle]" found in TDirectoryFile.cxx

@vepadulano
Copy link
Copy Markdown
Member Author

Here are some example outputs from files at root.cern/files
These are without backup key cycles

vpadulan@fedorathinkpad-T550 [~]: rootls -l https://root.cern/files/h1big.root
TTree  May 22 15:57 2006 h42;1 "dstar"  
vpadulan@fedorathinkpad-T550 [~]: rootls -l https://root.cern/files/lhcbfull_ref.root
TTree  Dec 06 11:50 2007 T;1 "TGeo stress"  
vpadulan@fedorathinkpad-T550 [~]: rootls -l https://root.cern/files/tutorials/ntpl004_dimuon_v0.root
ROOT::Experimental::RNTuple  Jul 29 12:13 2020 Events;1 ""
vpadulan@fedorathinkpad-T550 [~]: rootls -l https://root.cern/files/Higgs_data.root
TTree  Mar 17 16:39 2017 bkg_tree;1 "tree"  
TTree  Mar 17 16:39 2017 sig_tree;1 "tree"
vpadulan@fedorathinkpad-T550 [~]: rootls -l https://root.cern/files/Event.root
TH1F        Nov 08 12:27 2007 hstat;1      "Event Histogram"  
TH1F        Nov 08 12:27 2007 htime;1      "Real-Time to write versus time"  
TProcessID  Nov 08 12:27 2007 ProcessID0;1 "005ae54c-f2ae-1732-8001-96a78a89beef"  
TTree       Nov 08 12:27 2007 T;1          "An example of a ROOT tree" 
vpadulan@fedorathinkpad-T550 [~]: rootls -l https://root.cern/files/ATLAS/atlas_aod_mc1613TeVttbar.root
TTree  Apr 22 16:55 2017 ##Links;1            "##Links"  
TTree  Apr 22 16:55 2017 ##Params;1           "##Params"  
TTree  Apr 22 16:55 2017 ##Shapes;1           "##Shapes"  
TTree  Apr 22 16:55 2017 CollectionTree;1     "CollectionTree"  
TTree  Apr 22 16:55 2017 MetaData;1           "MetaData"  
TTree  Apr 22 16:55 2017 MetaDataHdr;1        "MetaDataHdr"  
TTree  Apr 22 16:55 2017 MetaDataHdrForm;1    "MetaDataHdrForm"  
TTree  Apr 22 16:55 2017 POOLCollectionTree;1 "POOLCollectionTree"  
TTree  Apr 22 16:55 2017 POOLContainer;1      "POOLContainer"  
TTree  Apr 22 16:55 2017 POOLContainerForm;1  "POOLContainerForm"

And these with backup cycles

vpadulan@fedorathinkpad-T550 [~]: rootls -l https://root.cern/files/ttree_read_imt.root
TTree  Mar 13 17:17 2019 TreeIMT;2 "TTree for IMT test" [current cycle]
TTree  Mar 13 17:17 2019 TreeIMT;1 "TTree for IMT test" [backup cycle]
vpadulan@fedorathinkpad-T550 [~]: rootls -l https://root.cern/files/rootbench/Run2012BC_DoubleMuParked_Muons.root
TTree  May 20 06:17 2019 Events;75 "Events" [current cycle]
TTree  May 20 06:17 2019 Events;74 "Events" [backup cycle]
vpadulan@fedorathinkpad-T550 [~]: rootls -l https://root.cern/files/atlas20.root
TTree  Sep 22 10:21 2009 CollectionTree;224 "CollectionTree" [current cycle]
TTree  Sep 22 10:21 2009 CollectionTree;223 "CollectionTree" [backup cycle]
vpadulan@fedorathinkpad-T550 [~]: rootls -l https://root.cern/files/RNTuple/treeref/gg_data~zstd.root
TTree  May 15 09:53 2020 mini;55 "mini" [current cycle]
TTree  May 15 09:53 2020 mini;54 "mini" [backup cycle]

And this is an example with hsimple.root copied three times into the same file to generate three cycles per key:

vpadulan@fedorathinkpad-T550 [~]: rootls -l hsimple.root
TProfile  Apr 14 17:47 2021 hprof;1  "Profile of pz versus px"  
TH1F      Apr 14 17:47 2021 hpx;1    "This is the px distribution"  
TH2F      Apr 14 17:47 2021 hpxpy;1  "py vs px"  
TNtuple   Apr 14 17:47 2021 ntuple;1 "Demo ntuple"  
vpadulan@fedorathinkpad-T550 [~]: rootcp -r hsimple.root hsimplecopy.root
vpadulan@fedorathinkpad-T550 [~]: rootcp -r hsimple.root hsimplecopy.root
vpadulan@fedorathinkpad-T550 [~]: rootcp -r hsimple.root hsimplecopy.root
vpadulan@fedorathinkpad-T550 [~]: rootls -l hsimplecopy.root
TProfile  Apr 17 10:00 2021 hprof;3  "Profile of pz versus px" [current cycle]
TProfile  Apr 17 10:00 2021 hprof;2  "Profile of pz versus px" [backup cycle]
TProfile  Apr 17 10:00 2021 hprof;1  "Profile of pz versus px" [backup cycle]
TH1F      Apr 17 10:00 2021 hpx;3    "This is the px distribution" [current cycle]
TH1F      Apr 17 10:00 2021 hpx;2    "This is the px distribution" [backup cycle]
TH1F      Apr 17 10:00 2021 hpx;1    "This is the px distribution" [backup cycle]
TH2F      Apr 17 10:00 2021 hpxpy;3  "py vs px" [current cycle]
TH2F      Apr 17 10:00 2021 hpxpy;2  "py vs px" [backup cycle]
TH2F      Apr 17 10:00 2021 hpxpy;1  "py vs px" [backup cycle]
TNtuple   Apr 17 10:00 2021 ntuple;3 "Demo ntuple" [current cycle]
TNtuple   Apr 17 10:00 2021 ntuple;2 "Demo ntuple" [backup cycle]
TNtuple   Apr 17 10:00 2021 ntuple;1 "Demo ntuple" [backup cycle]

@vepadulano vepadulano changed the title [skip-ci] Print key cycle information in rootls -l Print key cycle information in rootls -l Apr 17, 2021
@vepadulano
Copy link
Copy Markdown
Member Author

@phsft-bot build

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@vepadulano
Copy link
Copy Markdown
Member Author

Sibling PR in roottest shows fixed tests, this can be reviewed now

@vepadulano vepadulano marked this pull request as ready for review April 19, 2021 07:25
@vepadulano vepadulano requested a review from pcanal as a code owner April 19, 2021 07:25
@vepadulano vepadulano requested a review from etejedor April 19, 2021 07:25
Adds key cycle number and the [current cycle]/[backup cycle] tags to output of `rootls -l`. This is done by copying the logic used in TDirectoryFile.cxx#L1167-L1184 , rather than refactoring the whole cmdLineUtils.py to use TDirectoryFile::ls
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

Copy link
Copy Markdown
Contributor

@etejedor etejedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vepadulano !

@vepadulano vepadulano merged commit 9a1b16f into root-project:master May 3, 2021
@vepadulano vepadulano deleted the rootls-improve branch October 25, 2021 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rootls does not seem to print the cycle number information

3 participants