Hi,
I am trying to append a few histograms to a list. But the code is not working for more than one element. Can anyone please help me to point out the problem?
import ROOT as r
filesig=['RSGraviton_controlPlot.root','BulkGraviton_controlPlot.root','Radion_controlPlot.root','nonreso_controlPlot.root','officialHH_gluglu_10_controlPlot.root']
histsig = []
variable ='InvariantMass_of_4_particle_with_totCharge==0_in_tau1iso_tau2iso'
sigtitle = ['RSGraviton','BulkGraviton','Radion','nonreco','SM']
color = [2,4,6,8,12]
for ifile in range(0,4) :
file_ = r.TFile(filesig[ifile])
histsig.append(file_.Get(variable))
histsig[ifile].SetLineColor(color[ifile])
histsig[ifile].SetMarkerColor(color[ifile])
histsig[ifile].SetName(sigtitle[ifile])
print ifile, '****************',histsig
print histsig
it seems the name of histogram is not accessible after few iteration
python test.py
0 **************** [<ROOT.TH1F object ("RSGraviton") at 0x3bb27f0>]
1 **************** [<ROOT.TH1F object ("BulkGraviton") at 0x3bb27f0>, <ROOT.TH1F object ("BulkGraviton") at 0x3bb27f0>]
*** Break *** segmentation violation
2 **************** [
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
Please help me