GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » R3BRoot » Data Analysis » How to create more than one output event in FairTask Exec()-function? (How to create more than one output event in FairTask Exec()-function?)
Re: How to create more than one output event in FairTask Exec()-function? [message #23799 is a reply to message #23793] Wed, 27 March 2019 13:16 Go to previous messageGo to previous message
Jan Mayer is currently offline  Jan Mayer
Messages: 20
Registered: August 2015
occasional visitor
From: *ikp.uni-koeln.de
Quote:
This will then produce 4 distinct .root-files, all with their own digitizer output tree. Hence, I wanted to write another FairTask that does nothing more then merging these 4 files into one.


Aha! Now we're talking.

Quote:
Hence my question: can I manually call a write & reset function for the output TClonesArray?


You don't need to do that. At all.

I mean, if you think about it, this must be such a common problem! Everyone would face that at some point, right? Even the experimental data is split into multiple files automatically. Since decades, people would have to work with that, right? Having their code run over terabytes of data in hundreds of root files!

There are two main solutions: Add the file contents together to form a new large file with "hadd" (not recommended), or simply tell ROOT that the input is split over multiple files - in ROOT terms, that is called a "TChain".

The FairRoot equivalent / abstraction is in "FairFileSource", which has a function "AddFile", which does what it says.

/**Add ROOT file to input, the file will be chained to already added files*/
void AddFile(TString FileName);


[Updated on: Wed, 27 March 2019 13:18]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: reading container parameter
Goto Forum:
  


Current Time: Tue Jun 15 21:13:41 CEST 2021

Total time taken to generate the page: 0.02085 seconds