Hello,
I have a file with 2 trees. Tree1 is about 90% of the size of the file and Tree2 the 10%.
I use rootrm to delete Tree1 and keep Tree2. It seems to work as when I open the file again Tree1 is gone.
However, the size of the file remains unchanged!!! an example is given below.
Is there a way to effectively remove the tree and obtain a new file with reduced size?
Thanks
Salvador
============= rootrm example with file keeping same size =========================
martis@lxplus763]~/mywork/RMTEST% ls -lh MyTestFile.root
-rw-r--r--. 1 martis zp 665M May 18 19:36 MyTestFile.root
[martis@lxplus763]~/mywork/RMTEST% root MyTestFile.root
------------------------------------------------------------------
| Welcome to ROOT 6.28/00 https://root.cern |
| (c) 1995-2022, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Feb 03 2023, 14:50:41 |
| From tags/v6-28-00@v6-28-00 |
| With g++ (GCC) 11.3.0 |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
root [0]
Attaching file MyTestFile.root as _file0...
(TFile *) 0x314ebf0
root [1] .ls
TFile** MyTestFile.root
TFile* MyTestFile.root
KEY: TTree commonTree;1 Small Tree for Zmumu fits
KEY: TTree FourMu;1 Four Muon monitoring
******************************************************************************
*Tree :commonTree: Small Tree for Zmumu fits *
*Entries : 1667187 : Total = 1758136353 bytes File Size = 695775711 *
* : : Tree compression factor = 2.53 *
******************************************************************************
*Tree :FourMu : Four Muon monitoring *
*Entries : 2089 : Total = 1481378 bytes File Size = 657970 *
* : : Tree compression factor = 2.19 *
******************************************************************************
[martis@lxplus763]~/mywork/RMTEST% rootrm MyTestFile.root:commonTree
[martis@lxplus763]~/mywork/RMTEST% ls -lh MyTestFile.root
-rw-r--r--. 1 martis zp 665M May 18 19:39 MyTestFile.root ==> same size as before !!!
[martis@lxplus763]~/mywork/RMTEST% root -b MyTestFile.root
------------------------------------------------------------------
| Welcome to ROOT 6.28/00 https://root.cern |
| (c) 1995-2022, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Feb 03 2023, 14:50:41 |
| From tags/v6-28-00@v6-28-00 |
| With g++ (GCC) 11.3.0 |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
root [0]
Attaching file MyTestFile.root as _file0...
(TFile *) 0x34b8630
root [1] .ls
TFile** MyTestFile.root
TFile* MyTestFile.root
KEY: TTree FourMu;1 Four Muon monitoring ==> commonTree is gone (as expected)