Hi everyone,
I have a simple question: I define histograms with TH1F ,then I call a variable from a tree and I redirect to histograms defined before with " >> h" but it doesn’t work. It works only if I don’t define histograms, but I have to do this.
These are the first lines of my code: [code]
h1 = TH1F(“dphi”,“dphi”,10,-3.2,3.2)
h2 = TH1F(“dphi_2”,“dphi_2”,10,-3.2,3.2)
h4 = TH1F(“dphi_4”,“dphi_4”,10,-3.2,3.2)
h1.Sumw2()
h2.Sumw2()
h4.Sumw2()
infile_1 = TFile (str(sys.argv[1]),“READ”)
infile_2 = TFile(str(sys.argv[2]),“READ”)
intree_1 = infile_1.Get(“tree;1”)
intree_2 = infile_2.Get(“tree;1”)
intree_1.Draw(“truth_dphi >> h1”,“truth_dphi > -5”)
intree_1.Draw(“truth_dphi >> h4”,“truth_dphi > -5”)
intree_2.Draw(“truth_dphi >> h2”,“truth_dphi > -5”)
[/code]
Thank you!