ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/Configuration/scripts/makePlots.py
(Generate patch)

Comparing UserCode/OSUT3Analysis/Configuration/scripts/makePlots.py (file contents):
Revision 1.20 by lantonel, Tue Mar 19 18:43:26 2013 UTC vs.
Revision 1.21 by ahart, Mon Mar 25 18:17:40 2013 UTC

# Line 84 | Line 84 | for key in testFile.GetListOfKeys():
84   weight = intLumi / 10000.0
85   for dataset in processed_datasets:
86      dataset_file = "%s/%s.root" % (condor_dir,dataset)
87 <    if types[dataset] != "data":
87 >    fin = TFile (dataset_file)
88 >    flags = fin.Get ("flags")
89 >    noWeights = flags and flags.GetBinContent (1)
90 >    fin.Close ()
91 >    if types[dataset] != "data" and not noWeights:
92          os.system("mergeTFileServiceHistograms -i %s -o %s -w %g" % (dataset_file, dataset_file + "_tmp", weight))
93      else:
94          os.system("mergeTFileServiceHistograms -i %s -o %s -w %g" % (dataset_file, dataset_file + "_tmp", 1.0))
# Line 140 | Line 144 | for channel in channels: # loop over fin
144                  inputFile = TFile(dataset_file)
145                  Histogram = inputFile.Get(rootDirectory+"/"+channel+"/"+histogramName).Clone()
146                  Histogram.SetDirectory(0)
147 + #                if (Histogram.GetName () == "muonD0Beamspot" or Histogram.GetName () == "electronD0Beamspot"):
148 + #                    Histogram.Rebin (8)
149 + #                    Histogram.GetXaxis ().SetRangeUser (-0.04, 0.04)
150 +                if (Histogram.GetName () == "muonAbsD0Beamspot" or Histogram.GetName () == "electronAbsD0Beamspot"):
151 +                    Histogram.Rebin (4)
152 + #                    Histogram.GetXaxis ().SetRangeUser (0.0, 0.04)
153 + #                if (Histogram.GetName () == "electronMuonInvMass"):
154 + #                    Histogram.GetXaxis ().SetRangeUser (0, 120)
155                  inputFile.Close()
156                  xAxisLabel = Histogram.GetXaxis().GetTitle()
157                  histoTitle = Histogram.GetTitle()
# Line 260 | Line 272 | for channel in channels: # loop over fin
272                  if not arguments.noStack:
273                      Stack.SetTitle(histoTitle)
274                      Stack.Draw("HIST")
275 + #                    if (histogramName == "muonD0Beamspot" or histogramName == "electronD0Beamspot"):
276 + #                        Stack.GetXaxis ().SetRangeUser (-0.04, 0.04)
277 + #                    if (histogramName == "muonAbsD0Beamspot" or histogramName == "electronAbsD0Beamspot"):
278 + #                        Stack.GetXaxis ().SetRangeUser (0.0, 0.04)
279 + #                    if (histogramName == "electronMuonInvMass"):
280 + #                        Stack.GetXaxis ().SetRangeUser (0, 120)
281 +                    Stack.Draw("HIST")
282                      Stack.GetXaxis().SetTitle(xAxisLabel)
283                      Stack.SetMaximum(1.1*finalMax)
284                      Stack.SetMinimum(0.0001)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines