I want to load a large TChain
(millions of entries) into a RooDataSet
in 4 different observables. When I try, however, I get:
Error in <TBufferFile::WriteByteCount>: bytecount too large (more than 1073741822)
and when I try to import it:
importing dataset...
Error in <TBufferFile::CheckByteCount>: object of class vector<RooVectorDataStore::RealVector*> read too many bytes: 1283909525 instead of 210167701
Warning in <TBufferFile::CheckByteCount>: vector<RooVectorDataStore::RealVector*>::Streamer() not in sync with data on file path/to/file.root, fix Streamer()
Error in <TBufferFile::ReadVersion>: Could not find the StreamerInfo with a checksum of 0xdf5740a1 for the class "vector<RooVectorDataStore::RealFullVector*>" in FitOutput/data/\
path/to/file.root.
Error in <TBufferFile::CheckByteCount>: object of class vector<RooVectorDataStore::RealFullVector*> read too few bytes: 10 instead of 10605960
*** Break *** segmentation violation
Is there a way around this? Snippet of my current approach:
obs = RooArgSet(<RooRealVars>)
obslist = <list version of obs>
t.SetBranchStatus('*', 0)
for bnm in neededbranchnames:
t.SetBranchStatus(bnm, 1)
# Roo stuff
wsout = ROOT.RooWorkspace('myWS')
data = ROOT.RooDataSet('data', 'data', obs)
# fill dataset
for evt in t:
vals = []
for i, v in enumerate(obslist):
vals.append(
eval(evalstring[i].format('evt'))
)
if any(v < o.getMin() or v > o.getMax() for v, o in zip(vals, obslist)):
continue
for v, o in zip(vals, obslist):
o.setVal(v)
data.add(obs)
t.Delete() # save memory space
getattr(wsout, 'import')(data)
fout = ROOT.TFile.Open(outfilename, 'RECREATE')
wsout.Write()
fout.Close()
Three of my observables are only there to make selections on later, so I could just import the observables I plan to fit and use the others just for selections, but it would be convenient to have it all stored in one data set instead of many.