Bad regular expression from FitSlicesY

Hello everybody,
I have tried to use the function FitSlicesY on a TH2F histogram, with root v3.05.07 on lxplus at CERN. What I get is a segmentation violation and the error “Bad Regular Expression”.

In the attachment you can find the root file with the histogram and at the end of the message the commands I gave and the output I got.

Can you please tell me how I can use this function in a proper way?

Thanks,
Lucia

P.S. I wanted to try the new version 3.10.01, but the directory /afs/cern.ch/sw/root/v.3.10.01/rh73_gcc296 is empty…


root [0] TFile *f = new TFile(“Histo.root”)
root [1] TH2F clw = (TH2F)gDirectory->Get(“El_clw”)
root [2] clw->FitSlicesY(0,0,0,20)
Error in TRegexp::Index: Bad Regular Expression

*** Break *** segmentation violation
Generating stack trace…
0x401dbdab in TUnixSystem::StackTrace(void) + 0x25b from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x401da902 in TUnixSystem::DispatchSignals(ESignals) + 0xb2 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x401d999f in from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x401dd679 in from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x42029188 in from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//bin/root.exe
0x408010d3 in TH2::FitSlicesY(TF1 *, int, int, int, char const *) + 0x427 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libHist.so
0x408d0b81 in from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libHist.so
0x405f72ed in G__call_cppfunc + 0x281 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x405e685d in G__interpret_func + 0x895 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x405cc215 in G__getfunction + 0x16f5 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x4065c0eb in G__getstructmem + 0x7c3 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x40654ee2 in G__getvariable + 0x636 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x405c32e5 in G__getitem + 0x6e9 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x405c18a5 in G__getexpr + 0x8e05 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x4060e96d in G__exec_function + 0x169 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x406160bc in G__exec_statement + 0x2f3c from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x405a8ec3 in G__exec_tempfile_core + 0x313 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x405a9072 in G__exec_tempfile_fp + 0x22 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x4061e95b in G__process_cmd + 0x4e9f from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCint.so
0x401846ae in TCint::ProcessLine(char const *, TInterpreter::EErrorCode *) + 0x9a from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x40105f97 in TApplication::ProcessLine(char const *, bool, int *) + 0x56b from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x40de4cc7 in TRint::HandleTermInput(void) + 0x127 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libRint.so
0x40de3ff0 in TTermInputHandler::Notify(void) + 0x28 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libRint.so
0x40de5327 in TTermInputHandler::ReadNotify(void) + 0x13 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libRint.so
0x401dacf7 in TUnixSystem::CheckDescriptors(void) + 0x113 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x401da40a in TUnixSystem::DispatchOneEvent(bool) + 0x112 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x40154b29 in TSystem::InnerLoop(void) + 0x1d from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x40154abe in TSystem::Run(void) + 0x7e from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x40106b25 in TApplication::Run(bool) + 0x31 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libCore.so
0x40de4806 in TRint::Run(bool) + 0x2ba from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//lib/libRint.so
0x08048782 in main + 0x52 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//bin/root.exe
0x42017589 in __libc_start_main + 0x95 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//bin/root.exe
0x08048651 in __register_frame_info + 0x35 from /afs/cern.ch/sw/root/v3.05.07/rh73_gcc296/root//bin/root.exe


Histo.root (10.2 KB)

Dear Lucia,

this reply might not be very helpful for you - but on my box (root3.05-05, Linux RH9, gcc 3.2) it works just fine. I typed the commands exactly as you proposed and got nice slice fits (see attachment).

I wish you luck :wink:

Jörn


Hi,

I can not reproduce the problem either.
However you can now try v3.10.01 (/afs/cern.ch/sw/root/v3.10.01/rh73_gcc296 has been updated).

Cheers,
Philippe

Hello again,
I think now I know where the problem was: I had an old version of the .rootrc file (copied from $ROOTSYS/etc/system.rootrc, where I had modified the library and macro paths). Taking the new one and modifying again the lines I need, makes the FitSlicesY function work again.

Cheers,
Lucia

P.S. Knowing that the problem could not be reproduced actually helped a lot! Many thanks to the people who tried it!