Re: how to allow a file-split only at very specific times ?

From: Sebastien Binet <binet_at_cern.ch>
Date: Tue, 8 Feb 2011 17:36:07 +0100


On Tue, 8 Feb 2011 09:50:38 -0600, Tim Head <betatim_at_gmail.com> wrote:
> Hi Philippe
>
> On 8 February 2011 09:27, Philippe Canal <pcanal_at_fnal.gov> wrote:
> > Hi Sebastien,
> >
> > For data based selection, you might be able to use
> >     TFile *output_file = TFile:Open(.....);
> >     TTree *output_tree = input_tree->CopyTree("pz<0"); // Or some other
> > TTree::Draw style selection
> >     output_file->Write();
> > Or if you need more precise/complicated control:
> >
> >   TFile *output_file = TFile:Open(.....);
> >   TTree *output_tree = input_tree->CloneTree(0);
> >   for (Int_t i=0;i<input_tree->GetEntries(); i++) {
> >      input_tree->GetEntry(i);
> >      if (event->GetNtrack() > 605) output_tree->Fill();
> >      event->Clear();
> >   }
> >   output->file->Write();
> >
>
> ROOT will still change the output file at a "random" point in time. He
> wants to loop over several trees at the same time, I think.
spot on.

> Sebastien, I would check out
> http://root.cern.ch/root/html526/TTree#TTree:SetMaxTreeSize and set
> the file size to a very, very large number. This isn't a solution but
> a hack. Any reason why you need to insist on small files, don't think
> there is any file system that can't handle fairly 'huge" files.
small files are 10-15Gb :)
my huge files are tickling the Tb...

my main worry -- as this is/will-be a tool used by many people in the atlas collaboration -- is that this tool may be mis-used and I'd like to still be able to sit at the CERN cafeteria w/o watching my back for knives being sent from CERN IT :)

my users typically want to run over the whole set of say 2010 data and get a smaller data set.
I am not sure to be able to find a big enough value for SetMaxTreeSize in that case... (or even for just smaller periods of data taking)

>
> You can do TTree::GetCurrentFile() and check if the file has changed
> for your first tree after calling Fill() and then change the file for
> the other trees.

yep. I am testing this (with ChangeFile and some heuristics/stats about the average entry-over-trees size to manually trigger the split) just now.

-- 
@+
-s

  • application/pgp-signature attachment: stored
Received on Tue Feb 08 2011 - 17:36:36 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 09 2011 - 11:50:01 CET