Root_exe.exe.stackdump

I use the following code to find the peak,but it only calculate to i=68, so I need to rerun from i=69.peaknumber(){ Int_t a,b,c; for (int i=1; i<=93; i++){ char fileName[128]; sprintf(fileName,"eventdata_rn%d.root",i); TFile *f=new TFile(fileName); c=h777->Draw("De1","Pur2<400"); a=h777->Draw("De1","Pur2<400&&De1>1000&&De1<3000"); b=h777->Draw("De1","Pur2<400&&De1>1500&&De1<2500"); cout<<i<<" "<<c<<" De1>1000&&De1<3000 "<<a<<" De1>>1000,1500,2500 "<<b; cout<<endl; //f->Close(); }}

My system is cywin, root_v5.17.04.win32gcc.tar.gz. Ther is a bug file:root_exe.exe.stackdump

Stack trace:
Frame Function Args
0020D638 7C802542 (0000060C, 0000EA60, 000000A4, 0020D680)
0020D758 6109773C (00000000, 7C802600, 7C802542, 000000A4)
0020D848 610952BB (00000000, 003B0023, 00230000, 00000000)
0020D8A8 6109579B (0020D8C0, 00000000, 00000094, 610A0EAA)
0020D968 61095952 (0000059C, 00000006, 0020D998, 61095B52)
0020D978 6109597C (00000006, 600301DC, 0020D9E8, 02E89D73)
0020D998 61095B52 (0020D9C8, 2741C050, 0020DA18, 00000001)
0020D9E8 02E89D87 (0020D870, 007A1200, 0020DA58, 02E84D3A)
0020D9F8 02E85EB6 (2712EB70, 02EEED54, 02E8C4A0, 00B5AC2E)
0020DA58 02E84D3A (007A1200, 2712EC18, 0020DA6C, 2742B298)
0020DAB8 02E84EB4 (007A1200, 2742B2D8, 00000004, 00000000)
0020DE48 02D6FC0F (2712DDA8, 254FC488, 00000000, 00221E6E)
0020DF28 02D9CDDF (255004F8, 2712DDA8, 0224ABF9, 00221E6E)
0020E048 02D94B21 (255004F8, 10476364, 10476394, 0224ABF9)
0020E0A8 021574BE (002162B0, FFFFFFFF, 0020EB80, FFFFFF92)
00214268 004FBD97 (00000000, 00000000, 00214330, 00000000)
End of stack trace (more stack frames may be present)

Please help me!

Hi,

try:void peaknumber() { Int_t a,b,c; for (int i=1; i<=93; i++){ char fileName[128]; sprintf(fileName,"eventdata_rn%d.root",i); TFile *f=new TFile(fileName); TTree*tree = 0; f->GetObject("h777",tree); gROOT->cd(); // To make sure that the histograms are not deleted when the file is closed; c=tree->Draw("De1","Pur2<400"); a=tree->Draw("De1","Pur2<400&&De1>1000&&De1<3000"); b=tree->Draw("De1","Pur2<400&&De1>1500&&De1<2500"); cout<<i<<" "<<c<<" De1>1000&&De1<3000 "<<a<<" De1>>1000,1500,2500 "<<b; cout<<endl; delete f; } }

Cheers,
Philippe.