# Problem in RooFit

**URL:** <https://root-forum.cern.ch/t/problem-in-roofit/33532>\
**Category:** Newbie\
**Created:** [April 10, 2019, 2:46pm UTC](https://root-forum.cern.ch/t/problem-in-roofit/33532 "2019-04-10T14:46:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Princeps10](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Princeps10](https://root-forum.cern.ch/u/Princeps10)\
**Post date:** [April 10, 2019, 2:46pm UTC](https://root-forum.cern.ch/t/problem-in-roofit/33532/1 "2019-04-10T14:46:33Z")

</div>

Hi, everyone!  
I’m working on fitting a ROOT file containing data. To make it, I followed the reference RooFit in 20 minutes, but I find that the data in the reference seems to be produced by the p.d.f. (RooDataSet \*data = sum-\>generate(\*mes, 2000);)and such way doesn’t suit me. I need to work with the data that is contained in the ROOT file(Bs2JpsiPhiData.root). My problem is how can I fit the pdf I write to the data?  
Please help! I’m required to make it immediately!  
Thankssss!  
LQS

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [April 11, 2019, 7:42am UTC](https://root-forum.cern.ch/t/problem-in-roofit/33532/2 "2019-04-11T07:42:12Z")

</div>

@StephanH, please can you help here?

Oksana

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [April 11, 2019, 9:44am UTC](https://root-forum.cern.ch/t/problem-in-roofit/33532/3 "2019-04-11T09:44:22Z")

</div>

You can have a look at the RooFit tutorials here:  
[https://root.cern.ch/doc/master/group\_\_tutorial\_\_roofit.html](https://root.cern.ch/doc/master/group __tutorial__ roofit.html)

rf102 on data import should be your first stop.
