/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DrawGe68EnergySpec.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Plots resconstructed energy spectra (from EnergyStatsDiff) from all positions of one ACU axis on one graph.
00004 #
00005 #  Usage:
00006 #   nuwa.py DrawEnergySpec
00007 
00008 # Load DybPython
00009 from DybPython.DybPythonAlg import DybPythonAlg
00010 from GaudiPython import SUCCESS, FAILURE
00011 from GaudiPython import gbl
00012 from decimal import *
00013 
00014 # Make shortcuts to any ROOT classes you want to use
00015 TCanvas = gbl.TCanvas
00016 TLegend = gbl.TLegend
00017 gbl.gStyle.SetPalette(1)
00018 gbl.gStyle.SetOptFit(1)
00019 
00020 # Make your algorithm
00021 class DrawEnergyFigsAlg(DybPythonAlg):
00022     "Algorithm to draw figures from the energy statistics file"
00023     def __init__(self,name):
00024         DybPythonAlg.__init__(self,name)
00025         return
00026 
00027     def initialize(self):
00028         status = DybPythonAlg.initialize(self)
00029         if status.isFailure(): return status
00030         self.info("initializing")
00031 
00032         return SUCCESS
00033 
00034     def execute(self):
00035         self.info("executing")
00036         
00037         return SUCCESS
00038         
00039     def finalize(self):
00040         self.info("finalizing")
00041 
00042         # Make energy histograms
00043         canvas = TCanvas()
00044 
00045         self.stats["/file1/energy/nobgEnergy"].Draw()
00046         self.stats["/file1/energy/nobgEnergy"].SetLineColor(2)
00047 
00048         self.stats["/file0/energy/nobgEnergy"].Draw("same")
00049         self.stats["/file0/energy/nobgEnergy"].SetLineColor(1)
00050         self.stats["/file2/energy/nobgEnergy"].Draw("same")
00051         self.stats["/file2/energy/nobgEnergy"].SetLineColor(3)
00052         self.stats["/file3/energy/nobgEnergy"].Draw("same")
00053         self.stats["/file3/energy/nobgEnergy"].SetLineColor(4)
00054         self.stats["/file4/energy/nobgEnergy"].Draw("same")
00055         self.stats["/file4/energy/nobgEnergy"].SetLineColor(5)
00056         self.stats["/file5/energy/nobgEnergy"].Draw("same")
00057         self.stats["/file5/energy/nobgEnergy"].SetLineColor(6)
00058         self.stats["/file6/energy/nobgEnergy"].Draw("same")
00059         self.stats["/file6/energy/nobgEnergy"].SetLineColor(7)
00060         self.stats["/file8/energy/nobgEnergy"].Draw("same")
00061         self.stats["/file8/energy/nobgEnergy"].SetLineColor(8)
00062 
00063         leg=TLegend(0.5,0.5,0.6,0.9);
00064         leg.SetHeader("Legend");
00065         leg.AddEntry(self.stats["/file5/energy/nobgEnergy"],"-125.0","l");
00066         leg.AddEntry(self.stats["/file3/energy/nobgEnergy"],"-75.0","l");
00067         leg.AddEntry(self.stats["/file1/energy/nobgEnergy"],"-25.0","l");
00068         leg.AddEntry(self.stats["/file0/energy/nobgEnergy"],"0.0","l");
00069         leg.AddEntry(self.stats["/file2/energy/nobgEnergy"],"25.0","l");
00070         leg.AddEntry(self.stats["/file4/energy/nobgEnergy"],"75.0","l");
00071         leg.AddEntry(self.stats["/file6/energy/nobgEnergy"],"125.0","l");
00072         leg.AddEntry(self.stats["/file8/energy/nobgEnergy"],"175.0","l");
00073         leg.Draw();
00074 
00075         canvas.SaveAs("A_nobgEnergySpec.png")
00076         
00077         status = DybPythonAlg.finalize(self)
00078         return status
00079 
00080 
00081 #####  Job Configuration for nuwa.py ########################################
00082 
00083 def configure():
00084     from StatisticsSvc.StatisticsSvcConf import StatisticsSvc
00085     statsSvc = StatisticsSvc()
00086     statsSvc.Input ={"file0":"10000energyStatsDiff_10.root",
00087                      "file1":"10000energyStatsDiff_11.root",
00088                      "file2":"10000energyStatsDiff_12.root",
00089                      "file3":"10000energyStatsDiff_13.root",
00090                      "file4":"10000energyStatsDiff_14.root",
00091                      "file5":"10000energyStatsDiff_15.root",
00092                      "file6":"10000energyStatsDiff_16.root",
00093                      "file8":"10000energyStatsDiff_18.root"
00094                     }
00095     return
00096 
00097 def run(app):
00098     '''
00099     Configure and add an algorithm to job
00100     '''
00101     app.ExtSvc += ["StatisticsSvc"]
00102     energyFigsAlg = DrawEnergyFigsAlg("MyEnergyFigs")
00103     app.addAlgorithm(energyFigsAlg)
00104     pass
00105 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:54:37 for Calibration by doxygen 1.7.4