In file included from input_line_10:1:
/home/local1/dnaphysics-build/d2.cxx:22:2: error: called object type 'void' is not a function or function pointer
((TTreePlayer *)t->GetPlayer())->SetScanFileName(outputname);
// Name this file “dump.cxx” and use as:
//
// root [0] .x dump.cxx("dump.txt")
//
// Produces “dump.txt” and “dump.xml” files.
//
void dump(const char *outputname = "dump.txt", const char *fname = "dna.root",
const char *nname = "ntuple")
{
if (!fname || !(*fname) || !nname || !(*nname)) return; // just a precaution
TFile *f = TFile::Open(fname, "READ");
if (!f) return; // just a precaution
TTree *t; f->GetObject(nname, t);
if (!t) { delete f; return; } // just a precaution
t->SetScanField(0);
((TTreePlayer *)t->GetPlayer())->SetScanRedirect(kTRUE)
((TTreePlayer *)t->GetPlayer())->SetScanFileName(outputname);
t->Scan("*");
t->SaveAs("dump.xml");
delete f; // no longer needed (automatically deletes "t")
}
Usage:
$root
root [0] .x d2.cxx("dna.txt")
Result:
In file included from input_line_10:1:
/home/local1/dnaphysics-build/d2.cxx:22:2: error: called object type 'void' is not a function or function pointer
((TTreePlayer *)t->GetPlayer())->SetScanFileName(outputname);
^
Most likely the amount of data in that single entry for that single branch is reaching 1Gb (other less likely possibility included disk error). If this is the case, you will need to ask the branch to be split further. If it is already non-splittable but let us know the class layout and semantic content to see if we can come up with an alternative storage strategy.
Thank you for your quick response;
I am using root 6 and entered the command in same ordered as you advised, you can see in the screenshot but still error; please see the screenshot below;
Have a look inside the dump.cxx file. It needs you to provide 3 arguments (or change the defaults in the macro itself!), according to your files and trees:
I already set the default arguments to my desired file names, moreover same arguments was also given while executing dump.cxx. I wonder to see that the .x dump.cxx(“spect.txt”, “SPECT.root”,“mytree”) does nothing , text file only created after executing .> dump.txt file created ]
BTW, I’ve put (thanks to Wile’s suggestion) a /dist/latest link that should always point to the latest release of Go-HEP binaries (ie: including binaries from groot, a pure-Go implementation of (a subset of) ROOT)