Hello,
What the title says. I’m trying to get signal and background events from the same tree.
But when I run:
thetree = inputFile.Get("myTree")
sigCut = ROOT.TCut("Class>1")
bgCut = ROOT.TCut("Class<1")
dataloader.SetInputTrees(thetree, sigCut, bgCut)
I get this:
Error in callback <bound method StreamCapture.post_execute of <JupyROOT.helpers.utils.StreamCapture object at 0x000001F21C9AAB38>> (for post_execute):
---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last)
C:\rootinstall\bin\JupyROOT\helpers\utils.py in post_execute(self)
389 # Print for the notebook
390 out = self.ioHandler.GetStdout()
--> 391 err = self.ioHandler.GetStderr()
392 if not transformers:
393 sys.stdout.write(out)
C:\rootinstall\bin\JupyROOT\helpers\handlers.py in GetStderr(self)
66
67 def GetStderr(self):
---> 68 return _lib.JupyROOTExecutorHandler_GetStderr()
69
70 def GetStreamsDicts(self):
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x86 in position 60001: invalid start byte
Edit: What I write below about double loading isn’t correct, so I’m using the solution below. (See also my reply.)
Let me note that the following code, which loads signal and background separately, runs succesfully. But of course it loads all events twice.
dataloader.AddSignalTree(thetree)
dataloader.AddBackgroundTree(thetree)
dataloader.PrepareTrainingAndTestTree(sigCut, bgCut, etc.