Redirecting output

_ROOT Version: ROOT/v6-30-01

Based on e.g. Redirecting output, root 6

Hi, I am trying to redirect all the output of a fit verbose mode in v6-30-01.
As far as I can remember, also looking at the link above, this used to be done in e.g.:

.> a.log
//Fit here and read output in file
TH1* h = //...
h->Fit("gaus");

If these commands are still valid, then my terminal hangs, and it freezes after issuing .> a.log.
Any help would be appreciated.
Thanks as always,
Simone

Hi Simone,

Did you disable the redirection by entering .> for a second time?

Best,
D

Thanks a lot for the reply.
Unfortunately the system hangs up completely.
So what I see is:

root[0] .> a.log


// at this point I have to close the terminal

I waited for 10 mins just to make sure it really froze.

Hi Simone,

hard to tell. Is the process still running? How much time you need to complete the fit?

Best,
D

Hi Danilo, the system hangs right after issuing the redirecting command. It doesn’t give even the opportunity to launch the function itself. So no process is actually running.

Something like this. As you can see I have just opened a terminal only.

Maybe I misunderstood the procedure to redirect the output?

root [0] .> a.log
hpx->Fit("gaus")
.>
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
root [3] .q

% cat a.log
root [1] hpx->Fit("gaus")
****************************************
Minimizer is Minuit2 / Migrad
Chi2                      =      63.6385
NDf                       =           93
Edm                       =  3.85124e-06
NCalls                    =           47
Constant                  =      800.098   +/-   6.20097     
Mean                      =  -0.00385848   +/-   0.0063076   
Sigma                     =     0.994747   +/-   0.00445481   	 (limited)
(TFitResultPtr) <nullptr TFitResult>
root [2] .>
% 

Hi @couet , thanks a lot!
Ok it was my misunderstanding then.
So the procedure is (I have tried and it works as intended):

root [0] .L fit.cpp
root [1] .> a.log
// Here the root prompts disappear
fitfunction()
.q

And the a.log is properly filled. Sorry for the noise

Not exactly. You do not need to quit ROOT. Instead of .q you can type .> (that’s what I did in the example I sent you) and you get back at the ROOT prompt.