|
InSANE
1.6
|
First you need python and PyROOT. Also recommended is the python module rootplot .
The following example shows one way to use ROOT in python:
from ROOT import gROOT,TCanvas c=TCanvas()
See PyROOT Manual for other ways and more details on using PyROOT.
To use InSANE in python you import classes from the module ROOT (like the example above) but first you need to load the InSANE libraries and their dependencies into ROOT. This similarly done in your rootlogonC .
Create the file .rootlogon.py which is executed when you import ROOT. The following example shows how to load and use InSANE from your .rootlogon.py script.
from ROOT import gROOT,gSystem gSystem.Load( 'libFoam' ) gSystem.Load( 'libTreeViewer' ) gSystem.Load( 'libInSANE' )
import os from ROOT import TCanvas,BigcalDetector c = TCanvas() bc = BigcalDetector() h = bc.GetCalibrationCoefficientHist(1) c.SaveAs('bigcal_calibration.png')