https://github.com/root-project/root
Revision a5494997cc0ade061acd5c7050328bd442c073ec authored by Rene Brun on 18 July 2003, 15:36:38 UTC, committed by Rene Brun on 18 July 2003, 15:36:38 UTC
The text size in PostScript files is now computed in order to fit exactly
with the TTF text size on screen. Previously it was close but a bit
different, therefore on long character strings it was possible to see gaps
between various pieces of a TLatex expression.


git-svn-id: http://root.cern.ch/svn/root/trunk@6973 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent 6d814d7
Raw File
Tip revision: a5494997cc0ade061acd5c7050328bd442c073ec authored by Rene Brun on 18 July 2003, 15:36:38 UTC
From Olivier,
Tip revision: a549499
copytree3.C
{
// Example of Root macro to copy a subset of a Tree to a new Tree
// Only selected entries are copied to the new Tree.
// The input file has been generated by the program in $ROOTSYS/test/Event
// with   Event 1000 1 99 1

   gROOT->Reset();
   gSystem->Load("$ROOTSYS/test/libEvent.so");

   //Get old file, old tree and set top branch address
   TFile *oldfile = new TFile("$ROOTSYS/test/Event.root");
   TTree *oldtree = (TTree*)oldfile->Get("T");
   Int_t nentries = (Int_t)oldtree->GetEntries();
   Event *event   = 0;
   oldtree->SetBranchAddress("event",&event);

   //Create a new file + a clone of old tree in new file
   TFile *newfile = new TFile("small.root","recreate");
   TTree *newtree = oldtree->CloneTree(0);

   for (Int_t i=0;i<nentries; i++) {
      oldtree->GetEntry(i);
      if (event->GetNtrack() > 605) newtree->Fill();
      event->Clear();
   }
   newtree->Print();
   newtree->AutoSave();
   delete oldfile;
   delete newfile;
}
back to top