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

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 8 Feb 2011 09:27:55 -0600


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();

See $ROOTSYS/tutorials/tree/copytree* for other examples.

Cheers,
Philippe.

On 2/8/11 5:07 AM, Sebastien Binet wrote:
> hi there,
>
> say I want a somewhat more sophisticated filter'n'merge program than
> 'hadd'.
>
> this program should be able to apply on-the-fly an event selection based
> on tree0 of the input file (and accept or reject the same entry for
> tree1-n of the input file.)
>
> so far, so good.
> the issue is when the file-split size is looming and is triggered during
> the copy of merge of trees 1->n: the trees are not kept in synch'.
>
> so... is there a way to specify *when* the split should or should not
> happen ?
> (in essence, I'd like a way to say that a bunch of TTree::Fill should be
> atomic wrt the file split)
>
Received on Tue Feb 08 2011 - 16:28:00 CET

This archive was generated by hypermail 2.2.0 : Tue Feb 08 2011 - 17:50:02 CET