# Monitor a histogram while running

**URL:** <https://root-forum.cern.ch/t/monitor-a-histogram-while-running/22287>\
**Category:** ROOT\
**Created:** [November 30, 2016, 4:25pm UTC](https://root-forum.cern.ch/t/monitor-a-histogram-while-running/22287 "2016-11-30T16:25:28Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![betterwang](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/betterwang/32/11724_2.png) [@betterwang](https://root-forum.cern.ch/u/betterwang)\
**Post date:** [November 30, 2016, 4:25pm UTC](https://root-forum.cern.ch/t/monitor-a-histogram-while-running/22287/1 "2016-11-30T16:25:28Z")

</div>

Dear Experts,

Is there a way to monitor a histogram while running a script?  
For example, while I run the following code in a terminal,

```auto
{
        TH1D * h = new TH1D("h", "h", 10, 0, 10);
        for ( int i = 0; i < 1000000; i++ ) {
                sleep(5);
                h->Fill(2);
        }
}
```

Can I draw “h” from another terminal?  
I can definitely write it to a file, but it will generate 1000000 histograms, which I don’t want.

Is there an elegant way to know the content of a histogram while running?

Thanks,

---

_[View the full topic](https://root-forum.cern.ch/t/monitor-a-histogram-while-running/22287)._
