Hello all,
I am having problem with the writing of my file.
I am using a Selector that runs on a chain of datafile. The chain element is called in the Notify() function, then this tree is read and in Process() there is the loop on the File and some operations.
A new tree and output file are defined in the Begin() function with all the branches.
I want to copy a part of the branches of the input file and with the other ones, I want to do some operations and fill new branches.
I tested the program for a small amount of data and looks is working fine, no compilation error so far and all the branches are filled correctly.
I fill the tree for each entry of the loop and write the output file in the Terminate() function of the selector.
When the loop on the first file of the Chain ended I receive the following error:
Error in TFile::WriteBuffer: error writing all requested bytes to file /eos/user/c/cgrieco/HGTDTestbeam/Merged/March2019/Batch1605/Batch1605_analyzed_chain.root, wrote 1439840 of 14122550
Error in TBranchElement::TBranch::WriteBasketImpl: basket’s WriteBuffer failed.
Error in TBranchElement::TBranch::Fill: Failed to write out basket.
Error in TBranchElement::Fill: Failed filling branch:myxTr, nbytes=-1
Error in TTree::Fill: Failed filling branch:mytree.myxTr, nbytes=-1, entry=28851
This error is symptomatic of a Tree created as a memory-resident Tree
Instead of doing:
TTree *T = new TTree(…)
TFile *f = new TFile(…)
you should do:
TFile *f = new TFile(…)
TTree *T = new TTree(…)
This is repeated for all the branches that I want to copy from the input tree to the output one. Not for the “new” one, I am filling with analyzed info from the loop.
I understood that this can be a space related problem but have no idea how can be solved. I tried to write my file each 5000 events but then I am getting this error anyway.
I am running in lxplus and have no idea if this is something related to it because I don’t have the possibility to run locally at the moment.
Hope that someone can help me!
Thank you all,
Chiara
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided