TCut and TCutG

Hello Root Users,

I need help with the following problem.

First I open the file that contains a tree (named “t”), two TCut (named “goodEPS” and “goodDPS”) and one TCutG (named “goodCvsA”)
root [0] TFile *f263=new TFile(“phase5/data/a3tp5_263_bche.root”,“update”)

Then, I set TCutG pointer
root [1] TCutG goodCvsA=(TCutG)goodCvsA

Then, I create a TCut named cuts
root [2] TCut cuts=Form("(%s) && (%s) && (goodCvsA)",goodEPS->GetTitle(),goodDPS->GetTitle())

goodEPS contains
KEY: TCut goodEPS;1 (EPS>457956 && EPS<458062) || (EPS>458172 && EPS<458185) || (EPS>458998 && EPS<459021) || (EPS>459053 && EPS<459092) || (EPS>459101 && EPS<459595) || (EPS>459656 && EPS<459777) ||(EPS>459802 && EPS<460797)

and goodDPS contains
KEY: TCut goodDPS;1 DPS>0.021 && DPS<0.045

Then, I draw the tree
root [3] t->Draw(“C:A”,cuts)

This is when I get the following error:
Error in TObjArray::At: index 16 out of bounds (size: 16, this: 0x015ccbf8)
Error in TObjArray::At: index 16 out of bounds (size: 16, this: 0x015ccbf8)
Error in TObjArray::At: index 16 out of bounds (size: 16, this: 0x015ccbf8)

The histogram is drawn, but just curious what this error means and whether there are errors in the displayed histogram.

When I use any two combination of the cut or graphical cut:
root [4] TCut cuts=Form("(%s) && (%s)",goodEPS->GetTitle(),goodDPS->GetTitle())
root [5] t->Draw(“C:A”,cuts)
root [6] TCut cuts=Form("(%s) && (goodCvsA)",goodDPS->GetTitle())
root [7] t->Draw(“C:A”,cuts)
root [8] TCut cuts=Form("(%s) && (goodCvsA)",goodEPS->GetTitle())
root [9] t->Draw(“C:A”,cuts)

This error does not occur.



Which version of ROOT do you have this problem with?


Sorry, I forgot to mention that…I’m using Root 5.22/00


Could you send me your root file so that I can try to reproduce this problem?


I forgot to mention that in t->Draw(“C:A”), “A” is an alias to “RT+RB+LD+LU”.

Also, call TCut goodEPS=(TCut)goodEPS and TCut goodDPS=(TCut)goodDPS before setting TCut cuts…

I’ve tried once again to reproduce the problem but now I get segmentation error shown below (the first line is repeated many times but I’ve only include it once for short)

Error in TObjArray::AddAt: index 10 out of bounds (size: 10, this: 0x014bd5f8)

*** Break *** segmentation violation
Attaching to program: /proc/10290/exe, process 10290
[Thread debugging using libthread_db enabled]
0x00007fbd8dbcf5d5 in waitpid () from /lib64/
#1 0x00007fbd8db6b861 in ?? () from /lib64/
#2 0x00007fbd8febbdff in TUnixSystem::StackTrace() () from /usr/local/lib64/root/
#3 0x00007fbd8febc9b5 in TUnixSystem::DispatchSignals(ESignals) () from /usr/local/lib64/root/
#5 0x00007fbd8bd8e606 in TBranch::GetEntry(long long, int) () from /usr/local/lib64/root/
#6 0x00007fbd87497d69 in TTreeFormula::EvalInstance(int, char const**) () from /usr/local/lib64/root/
#7 0x00007fbd874828c4 in TSelectorDraw::ProcessFill(long long) () from /usr/local/lib64/root/
#8 0x00007fbd874a27b0 in TTreePlayer::Process(TSelector*, char const*, long long, long long) ()
from /usr/local/lib64/root/
#9 0x00007fbd874a4059 in TTreePlayer::DrawSelect(char const*, char const*, char const*, long long, long long) ()
from /usr/local/lib64/root/
#10 0x00007fbd8be55db4 in G__G__Tree_109_0_40(G__value*, char const*, G__param*, int) () from /usr/local/lib64/root/
#11 0x00007fbd8f07ab1f in Cint::G__ExceptionWrapper(int ()(G__value, char const*, G__param*, int), G__value*, char*, G__param*, int)
() from /usr/local/lib64/root/
#12 0x00007fbd8f128b30 in G__execute_call () from /usr/local/lib64/root/
#13 0x00007fbd8f129a33 in G__call_cppfunc () from /usr/local/lib64/root/
#14 0x00007fbd8f105bbc in G__interpret_func () from /usr/local/lib64/root/
#15 0x00007fbd8f0f2662 in G__getfunction () from /usr/local/lib64/root/
#16 0x00007fbd8f1d7f34 in G__getstructmem () from /usr/local/lib64/root/
#17 0x00007fbd8f1d1c14 in G__getvariable () from /usr/local/lib64/root/
#18 0x00007fbd8f0c538f in G__getitem () from /usr/local/lib64/root/
#19 0x00007fbd8f0c5c8b in G__getitem () from /usr/local/lib64/root/
#20 0x00007fbd8f0cb16f in G__getexpr () from /usr/local/lib64/root/
#21 0x00007fbd8f158be8 in G__exec_statement () from /usr/local/lib64/root/
#22 0x00007fbd8f0b1fd9 in G__exec_tempfile_core () from /usr/local/lib64/root/
#23 0x00007fbd8f0b227e in G__exec_tempfile_fp () from /usr/local/lib64/root/
#24 0x00007fbd8f15e0bb in G__process_cmd () from /usr/local/lib64/root/
#25 0x00007fbd8fea8175 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /usr/local/lib64/root/
#26 0x00007fbd8fde1660 in TApplication::ProcessLine(char const*, bool, int*) () from /usr/local/lib64/root/
#27 0x00007fbd8ea3267f in TRint::HandleTermInput() () from /usr/local/lib64/root/
#28 0x00007fbd8febab99 in TUnixSystem::CheckDescriptors() () from /usr/local/lib64/root/
#29 0x00007fbd8febb1c1 in TUnixSystem::DispatchOneEvent(bool) () from /usr/local/lib64/root/
#30 0x00007fbd8fe3b8e6 in TSystem::InnerLoop() () from /usr/local/lib64/root/
#31 0x00007fbd8fe3da1c in TSystem::Run() () from /usr/local/lib64/root/
#32 0x00007fbd8fddf5af in TApplication::Run(bool) () from /usr/local/lib64/root/
#33 0x00007fbd8ea33f08 in TRint::Run(bool) () from /usr/local/lib64/root/
#34 0x00000000004011cd in main ()
The program is running. Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/10290/exe, process 10290

Also, I’m running ROOT 5.22/00 on openSUSE 11.1 #1 SMP 2009-03-31 14:50:44 +0200 x86_64 x86_64 x86_64 GNU/Linux

with gcc version
gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291]

incase you need this info.

The root file size is 13.2MB to add as an attachment. Any suggestions on how to send it to you?

Thanks for helping.


You can send it to mail via email or better yet post it on a website, ftp site or shared files system (afs for example).



I tried the following,

TCut cuts=Form("(%s) && (goodCvsA) && (%s)",goodEPS->GetTitle(),goodDPS->GetTitle())


TCut cuts=Form("(goodCvsA) && (%s) && (%s)",goodEPS->GetTitle(),goodDPS->GetTitle())

I don’t get errors as I mentioned before. I don’t understand why the order of the graphical cut matters.

Do you still want me to email you the root file?

Thanks for all your quick replies.



If you need any further assistance (i.e. fixing the original problem), I would still need the root file.



I’ve modified the original tree with fewer entries and removed non-essential branch to shrink the file size. With this new tree, I’ve been able to reproduce the problem. Only, two things have changed, the tree is now called “t1” and you don’t need to set the alias for “A”.

Let me know what you find out.

a3tp5_263_bche.root (1.19 MB)


Thank you for reporting this problem. It is fixed in the trunk by the revision #28379.


Hey thanks for fixing it. I’m glad I can help.

ROOT & ROOT support rocks! =D> \:D/