# RooGraphVar

**URL:** <https://root-forum.cern.ch/t/roographvar/18591>\
**Category:** Evolution Proposals, Apps & Ideas\
**Created:** [December 8, 2014, 5:10pm UTC](https://root-forum.cern.ch/t/roographvar/18591 "2014-12-08T17:10:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![schliteur](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@schliteur](https://root-forum.cern.ch/u/schliteur)\
**Post date:** [December 8, 2014, 5:10pm UTC](https://root-forum.cern.ch/t/roographvar/18591/1 "2014-12-08T17:10:53Z")

</div>

Hi everyone,  
I was looking since yesterday for something which seems not to exist in Roofit.  
I wanted to have a variable (inherited from RooAbsReal) which takes values from a TGraph given one server variable. So I have written a class called “RooGraphVar” . I put it in attachement and feel free to use it (you need to compile it with .L RooGraphVar.cxx+).

Here is an example with red crosses representing the TGraph (variable x), the blue solid line is a RooPlot of an RooGraphVar object with linear interpolation and the purple line a RooPlot of an RooGraphVar object with a spline interpolation.

 ![](https://root-forum.cern.ch/uploads/default/original/2X/9/9b99847aeb517e4beb2818c07a9144a5814bc83d.png)  
  
[RooGraphVar.h](https://root-forum.cern.ch/uploads/default/original/2X/8/84d70aa1da0df05c95e8307c2d1142aebfff0911.h) (1.4 KB)  
[RooGraphVar.cxx](https://root-forum.cern.ch/uploads/default/original/2X/f/f3d3380cc0faa409acef0c11857adc5ce96beecc.cxx) (2.63 KB)
