Error reading histogram from root file
<p>I am reading a root file whose structure looks like:</p>

<pre><code>$ root -l Residual_Position_iter_99_R1869.root
.lroot [0] 
Attaching file Residual_Position_iter_99_R1869.root as _file0...
s
Warning in &lt;TClass::TClass&gt;: no dictionary for class TF1Parameters is available
root [1] .ls
TFile**     Residual_Position_iter_99_R1869.root    
 TFile*     Residual_Position_iter_99_R1869.root    
  KEY: TH1F Pos_g3xcl_100;1 
  KEY: TH1F Pos_g3ycl_100;1 
  KEY: TH1F Pos_g2xcl_100;1 
  KEY: TH1F Pos_g2ycl_100;1 
  KEY: TH1F Pos_g1xcl_100;1 
  KEY: TH1F residual_g1xcl_100;1    
  KEY: TH1F residual_g1ycl_100;1    
  KEY: TH1F residual_g2xcl_100;1    
  KEY: TH1F residual_g2ycl_100;1    
  KEY: TH1F residual_g3xcl_100;1    
  KEY: TH1F residual_g3ycl_100;1    
</code></pre>

<p>To read this I wrote a macro :</p>

<pre><code>import ROOT
from ROOT import TFile, TH1F, TObject


ROOT.gROOT.SetBatch(True)  # This will prevent histogram to show

c=ROOT.TCanvas("c","c",800,600)

f1=ROOT.TFile("Residual_Position_iter_99_R1869.root","READ")
h1x=f1.Get("Pos_g1xcl_100");       c.cd();        h1x.Draw()
c.Print("plots/residual.pdf")
</code></pre>

<p>This code is working fine. But its fine only for branches of like <strong>Pos*</strong>. But if I replace </p>

<pre><code>h1x=f1.Get("Pos_g1xcl_100"); 
</code></pre>

<p>with </p>

<pre><code>h1x=f1.Get("residual_g1xcl_100"); 
</code></pre>

<p>then I am getting the segmentation fault[1]. The difference between Pos_g1xcl_100 &amp; residual_g1xcl_100 is that one is simple histogram while later one is histogram along with its fit.</p>

<p>[1]</p>

<p>TClass::TClass:0: RuntimeWarning: no dictionary for class TF1Parameters is available
TStreamerInfo::BuildOld:0: RuntimeWarning: Cannot convert TF1::fParErrors from type:vector to type:Double_t*, skip element
TStreamerInfo::BuildOld:0: RuntimeWarning: Cannot convert TF1::fParMin from type:vector to type:Double_t*, skip element
TStreamerInfo::BuildOld:0: RuntimeWarning: Cannot convert TF1::fParMax from type:vector to type:Double_t*, skip element
TStreamerInfo::BuildOld:0: RuntimeWarning: Cannot convert TF1::fSave from type:vector to type:Double_t*, skip element
TStreamerInfo::BuildOld:0: RuntimeWarning: Cannot convert TF1::fParams from type:TF1Parameters* to type:Double_t*, skip element</p>

<p><strong>* Break *</strong> segmentation violation</p>