I have a root script toto.C and I open it like this :
root toto.C
I would like to suppress this default echo
Processing toto.C…
and also this one
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
Thank you PePe for the answer.
but in this case stdout and stderr is going to /dev/null
I thought something like
root -b -q -l toto.C 2>/dev/null
but is not working
It is working … simply the messages that you see come from stdout (i.e. 1), not from stderr (i.e. 2).
You can get rid of the canvas related message if you add into your “toto.C” something like (somewhere before the first “draw” command):
new TCanvas(“c1”, “c1”);
You can get rid of the “processing” message if you run your macro using:
echo ‘gROOT->LoadMacro(“toto.C”); toto(); gSystem->Exit(0);’ | root -b -l
See also [url]Compile and run from command prompt
ok I understand thank you.
Then stdout of my .C will go also in the /dev/null
The only solution I see is to change in my .C the cout in cerr and to
do what you suggested
Thank you
Oliver
To suppress the ‘Processing’ message you need to have a rootlogon.C file containing:{
gPrintViaErrorHandler = kTRUE;
gErrorIgnoreLevel = kWarning;
}(however this will also suppress all other message send via ROOT’s Printf).
It got rid of not only the warnings but also the fit output, even though I am not using a quiet mode, just options “SIEM”. I would like to have only these output below:
FCN=7.24136 FROM MINOS STATUS=SUCCESSFUL 586 CALLS 5975 TOTAL
EDM=2.22571e-06 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 6.8 per cent
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 p0 1.94920e-10 5.80194e-10 -8.07072e-04 -3.09127e-03
2 p1 6.06819e-02 2.09887e+00 -2.31920e-04 1.06478e-02
3 p2 -1.85090e+00 2.22413e-01 -3.94713e-06 2.84732e-02
4 p3 1.35383e-01 2.10279e-01 2.10279e-01 -3.64646e-04
and get rid of the warning:
NEW MINIMUM FOUND. GO BACK TO MINIMIZATION STEP.