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

In This Package:

DrawGe68EnergyGeo.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Draws graph of reconstructed energies of different geometries plotted together.
00004 #
00005 #  Usage:
00006 #   nuwa.py DrawEnergyGeo
00007 
00008 # Load DybPython
00009 from DybPython.DybPythonAlg import DybPythonAlg
00010 from GaudiPython import SUCCESS, FAILURE
00011 from GaudiPython import gbl
00012 
00013 # Make shortcuts to any ROOT classes you want to use
00014 TCanvas = gbl.TCanvas
00015 TLegend = gbl.TLegend
00016 gbl.gStyle.SetPalette(1)
00017 gbl.gStyle.SetOptFit(1)
00018 
00019 # Make your algorithm
00020 class DrawEnergyFigsAlg(DybPythonAlg):
00021     "Algorithm to draw figures from the energy statistics file"
00022     def __init__(self,name):
00023         DybPythonAlg.__init__(self,name)
00024         return
00025 
00026     def initialize(self):
00027         status = DybPythonAlg.initialize(self)
00028         if status.isFailure(): return status
00029         self.info("initializing")
00030 
00031         return SUCCESS
00032 
00033     def execute(self):
00034         self.info("executing")
00035         
00036         return SUCCESS
00037         
00038     def finalize(self):
00039         self.info("finalizing")
00040 
00041         # Make energy histograms
00042         canvas = TCanvas()
00043 
00044 
00045         self.stats["/file3/energy/reconEnergy"].Draw()
00046         self.stats["/file3/energy/reconEnergy"].SetLineColor(4)
00047         self.stats["/file1/energy/reconEnergy"].Draw("same")
00048         self.stats["/file1/energy/reconEnergy"].SetLineColor(1)
00049         self.stats["/file0/energy/reconEnergy"].Draw("same")
00050         self.stats["/file0/energy/reconEnergy"].SetLineColor(2)
00051         self.stats["/file2/energy/reconEnergy"].Draw("same")
00052         self.stats["/file2/energy/reconEnergy"].SetLineColor(3)
00053         self.stats["/file4/energy/reconEnergy"].Draw("same")
00054         self.stats["/file4/energy/reconEnergy"].SetLineColor(5)
00055         self.stats["/file5/energy/reconEnergy"].Draw("same")
00056         self.stats["/file5/energy/reconEnergy"].SetLineColor(6)
00057         self.stats["/file6/energy/reconEnergy"].Draw("same")
00058         self.stats["/file6/energy/reconEnergy"].SetLineColor(7)
00059         self.stats["/file7/energy/reconEnergy"].Draw("same")
00060         self.stats["/file7/energy/reconEnergy"].SetLineColor(8)
00061         self.stats["/file8/energy/reconEnergy"].Draw("same")
00062         self.stats["/file8/energy/reconEnergy"].SetLineColor(9)
00063 
00064 
00065 
00066         leg=TLegend(0.1,0.65,0.3,0.9);
00067         leg.AddEntry(self.stats["/file0/energy/reconEnergy"],"No geometry","l");
00068         leg.AddEntry(self.stats["/file1/energy/reconEnergy"],"With geometry","l");
00069         leg.AddEntry(self.stats["/file2/energy/reconEnergy"],"Al Vacuum","l");
00070         leg.AddEntry(self.stats["/file4/energy/reconEnergy"],"SS Vacuum","l");
00071         leg.AddEntry(self.stats["/file3/energy/reconEnergy"],"Al + SS Vacuum","l");
00072         leg.AddEntry(self.stats["/file5/energy/reconEnergy"],"Al + SS + Ge Vacuum","l");
00073         leg.AddEntry(self.stats["/file8/energy/reconEnergy"],"Al + SS + Acr Vacuum","l");
00074         leg.AddEntry(self.stats["/file7/energy/reconEnergy"],"Ge + Acr Vacuum","l");
00075         leg.AddEntry(self.stats["/file6/energy/reconEnergy"],"Al + SS + Ge + Acr Vacuum","l");
00076         leg.Draw();
00077 
00078 
00079         canvas.SaveAs("reconEnergyDiff.png")
00080 
00081         status = DybPythonAlg.finalize(self)
00082         return status
00083 
00084 
00085 #####  Job Configuration for nuwa.py ########################################
00086 
00087 def configure():
00088     from StatisticsSvc.StatisticsSvcConf import StatisticsSvc
00089     statsSvc = StatisticsSvc()
00090     statsSvc.Input={"file0":"stats_runnoGEO0.root", 
00091         "file1":"stats_runGEO0.root","file2":"stats_runGEO0Alvacuum.root","file3":"stats_runGEO0AlSSvacuum.root","file4":"stats_runGEO0SSvacuum.root", 
00092          "file5":"stats_runGEO0AlSSGEvacuum.root","file6":"stats_runGEO0AlSSGEAcrvacuum.root","file7":"stats_runGeAcrvacuum.root",
00093         "file8":"stats_runGEOAlSSAcrvacuum.root"}
00094     return
00095 
00096 def run(app):
00097     '''
00098     Configure and add an algorithm to job
00099     '''
00100     app.ExtSvc += ["StatisticsSvc"]
00101     energyFigsAlg = DrawEnergyFigsAlg("MyEnergyFigs")
00102     app.addAlgorithm(energyFigsAlg)
00103     pass
00104 
| 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