# Problem with TCutG in Ttree-\>Draw

**URL:** <https://root-forum.cern.ch/t/problem-with-tcutg-in-ttree-draw/32858>\
**Category:** Newbie\
**Created:** [February 22, 2019, 1:49pm UTC](https://root-forum.cern.ch/t/problem-with-tcutg-in-ttree-draw/32858 "2019-02-22T13:49:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davide.rigamonti](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/b9bd4f/32.png) [@davide.rigamonti](https://root-forum.cern.ch/u/davide.rigamonti)\
**Post date:** [February 22, 2019, 1:49pm UTC](https://root-forum.cern.ch/t/problem-with-tcutg-in-ttree-draw/32858/1 "2019-02-22T13:49:18Z")

</div>

Dear all,

I’m having problems with a TCutG when used with ttree-\>Draw.  
Basically my code it draws an empty histogram when a TCutG is applied. I’m using ROOT 6.14/06 on Ubuntu 16.04  
Please find attached my macro.

Thank you.  
cheers,

Davide[Read\_Tree.C](https://root-forum.cern.ch/uploads/default/original/3X/9/1/9188604b9ca102ea6bba5687bb2eb3cc506b0110.C) (1.2 KB)

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 22, 2019, 1:58pm UTC](https://root-forum.cern.ch/t/problem-with-tcutg-in-ttree-draw/32858/2 "2019-02-22T13:58:57Z")

</div>

Try with:

```auto
	mycutg->SetVarX("Br_Ql");
	mycutg->SetVarY("psd");

```

---

<div class="post-metadata">

**Author:** ![davide.rigamonti](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/b9bd4f/32.png) [@davide.rigamonti](https://root-forum.cern.ch/u/davide.rigamonti)\
**Post date:** [February 22, 2019, 2:02pm UTC](https://root-forum.cern.ch/t/problem-with-tcutg-in-ttree-draw/32858/3 "2019-02-22T14:02:45Z")

</div>

It works!  
Thank you!

---

<div class="post-metadata">

**Author:** ![davide.rigamonti](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/b9bd4f/32.png) [@davide.rigamonti](https://root-forum.cern.ch/u/davide.rigamonti)\
**Post date:** [February 22, 2019, 2:09pm UTC](https://root-forum.cern.ch/t/problem-with-tcutg-in-ttree-draw/32858/4 "2019-02-22T14:09:29Z")

</div>

Is it possible to retrieve or select (or mark) the events inside the cut?

Thank you.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 22, 2019, 3:00pm UTC](https://root-forum.cern.ch/t/problem-with-tcutg-in-ttree-draw/32858/5 "2019-02-22T15:00:42Z")

</div>

> [@How to search for a value in ntuple and get the index?](https://root-forum.cern.ch/t/how-to-search-for-a-value-in-ntuple-and-get-the-index/32095/5):
>
> See “Saving the result of Draw to a [TEventList](https://root.cern.ch/doc/master/classTEventList.html), a [TEntryList](https://root.cern.ch/doc/master/classTEntryList.html) or a [TEntryListArray](https://root.cern.ch/doc/master/classTEntryListArray.html)” and then " Using a [TEventList](https://root.cern.ch/doc/master/classTEventList.html), [TEntryList](https://root.cern.ch/doc/master/classTEntryList.html) or [TEntryListArray](https://root.cern.ch/doc/master/classTEntryListArray.html) as Input" in the [TTree::Draw](https://root.cern.ch/doc/master/classTTree.html#a73450649dc6e54b5b94516c468523e45) method description.
