Re: ruby root - Why appears TCanvas?

From: Robert Riemann <robert.riemann_at_physik.hu-berlin.de>
Date: Thu, 4 Feb 2010 11:46:04 +0100


Hi Philippe,

thanks for your hint. It works now as estimated.

I added the following line right after the require 'libRuby': gROOT.SetBatch true

Greets,
Robert

2010/1/29 Philippe Canal <pcanal_at_fnal.gov>:
> Hi,
>
> Try gROOT.SetBatch(kTRUE)
>
> Cheers,
> Philippe.
>
> On 1/28/10 5:48 PM, Robert Riemann wrote:
>>
>> Hi rooters,
>>
>> I want to plot my histograms using the ruby module from root.
>> The result is fine, but I wonder why the canvas are shown to me one
>> after each other up the end of program.
>>
>> Is it possible to disable graphics in the ruby module?
>>
>>
>> Regards,
>> Robert
>>
>>
>>
>> Script with highlighting: http://pastie.org/799713
>> Script:
>>
>> #!/usr/bin/ruby
>>
>> require 'libRuby'
>>
>> hist_names = %w{ DiJet_R_diff DiJet_R_diff_after_boost
>> DiJet_angle_after_boost
>>                  DiJet_phi_diff Jet_acoplanarity Jet_aplanarity
>> Jet_centrality
>>                  Jet_sphericity Jet_thrust }
>> hist_names.map! do |element|
>>   element = "reco_" + element
>> end
>>
>>
>> dataFileName = ARGV[0]
>> dataOutputFileNameSuffix = "_hist.png"
>> dataOutputFolder = "plots/" # have to be created manually
>> size = [800, 600]
>> options = ""
>>
>> file = TFile.new dataFileName
>> hist_names.each do |hist_name|
>>   histogram = file.Get( hist_name )
>>   canvas = TCanvas.new("canvas_" + hist_name , hist_name, size[0],
>> size[1])
>>   histogram.Draw( options )
>>   canvas.SaveAs( dataOutputFolder + hist_name + dataOutputFileNameSuffix )
>> end
>>
>>
>
>
Received on Thu Feb 04 2010 - 11:46:13 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 04 2010 - 17:50:01 CET