# RooHistPdf Generate method not working as expected

**URL:** <https://root-forum.cern.ch/t/roohistpdf-generate-method-not-working-as-expected/33666>\
**Category:** Roofit and RooStats\
**Created:** [April 18, 2019, 10:12pm UTC](https://root-forum.cern.ch/t/roohistpdf-generate-method-not-working-as-expected/33666 "2019-04-18T22:12:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![SAlsum](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@SAlsum](https://root-forum.cern.ch/u/SAlsum)\
**Post date:** [April 18, 2019, 11:41pm UTC](https://root-forum.cern.ch/t/roohistpdf-generate-method-not-working-as-expected/33666/3 "2019-04-18T23:41:19Z")

</div>

For anyone interested, I achieved the expected behavior by adding the RooCmdArg AutoBinned(0) to my generate command.  
so

```auto
RooDataSet* genDS = theHistPdf.generate(myVars, NumEvents(10), Verbose(1));

```

became

```auto
RooDataSet* genDS = theHistPdf.generate(myVars, AutoBinned(0), NumEvents(10), Verbose(1));

```

I am still unsure as to why the previous method gave me the results it did, perhaps it returned a RooDataHist and the bin centers were located in the same spot in memory where the point values would have been for a RooHistPdf? Regardless, turning AutoBinned off gave me what I wanted.

---

_[View the full topic](https://root-forum.cern.ch/t/roohistpdf-generate-method-not-working-as-expected/33666)._
