Use TF1 as weight in chain.Draw()

Dear Experts,

I am trying to fill a TH1F from a TChain doing something like this:

myChain.Draw(“myVar>>myHist”, “myTF1(myOtherVar)”, “goff”)

Where myTF1 is found by fitting some data.

Is this possible? I get “TSelectorDraw::AbortProcess: Variable compilation failed”.

Thank you,

  • Marc

ROOT Version: 6.12
Platform: Scientific Linux CERN SLC release 6.10 (Carbon)
Compiler: python (trying this in pyroot)


It seems there is a missing double quote in the command you posted. But I guess in your real script it is not the case ?

Hi Couet,

Yes, I just edited it to avoid confusion. What I posted is just meant to be pseudocode.

  • Marc

this will work if myTF1 is a C++ function known to the interpreter.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.