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

In This Package:

Public Member Functions
DrawGe68EnergyDiff::DrawEnergyFigsAlg Class Reference
Inheritance diagram for DrawGe68EnergyDiff::DrawEnergyFigsAlg:
Inheritance graph
[legend]
Collaboration diagram for DrawGe68EnergyDiff::DrawEnergyFigsAlg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Detailed Description

Definition at line 23 of file DrawGe68EnergyDiff.py.


Constructor & Destructor Documentation

def DrawGe68EnergyDiff::DrawEnergyFigsAlg::__init__ (   self,
  name 
)

Definition at line 25 of file DrawGe68EnergyDiff.py.

00026                            :
00027         DybPythonAlg.__init__(self,name)
00028         return


Member Function Documentation

def DrawGe68EnergyDiff::DrawEnergyFigsAlg::initialize (   self)

Definition at line 29 of file DrawGe68EnergyDiff.py.

00030                         :
00031         status = DybPythonAlg.initialize(self)
00032         if status.isFailure(): return status
00033         self.info("initializing")
00034 
00035         return SUCCESS

def DrawGe68EnergyDiff::DrawEnergyFigsAlg::execute (   self)

Definition at line 36 of file DrawGe68EnergyDiff.py.

00037                      :
00038         self.info("executing")
00039         
00040         return SUCCESS
        
def DrawGe68EnergyDiff::DrawEnergyFigsAlg::finalize (   self)

Definition at line 41 of file DrawGe68EnergyDiff.py.

00042                       :
00043         self.info("finalizing")
00044 
00045         # Make energy histograms
00046         canvas = TCanvas()
00047 
00048         self.stats["/file0/energy/nobgEnergy"].Draw()
00049         maxbin = self.stats["/file0/energy/nobgEnergy"].GetMaximumBin()
00050         max = self.stats["/file0/energy/nobgEnergy"].GetMaximumBin() * 0.006
00051         interval=0.02
00052         g = 0
00053         oldfitChi = 1000
00054         for i in range(0,15):
00055           self.stats["/file0/energy/nobgEnergy"].Fit("gaus","","",max-interval,max+2*interval)
00056           print "interval1=", max-interval
00057           print "interval2=", max+interval
00058           fitResults = self.stats["/file0/energy/nobgEnergy"].GetFunction("gaus")
00059           fitChi = fitResults.GetChisquare()
00060           ndf = interval*500-3
00061           fitChi = fitChi / ndf
00062           print "ndf=", ndf
00063           print "fitchi=", fitChi
00064           if oldfitChi > fitChi:
00065             g = i
00066           interval=interval+0.02
00067           oldfitChi = fitChi
00068 
00069         interval=0.02+g*0.02
00070         print "interval=", interval
00071         peak1 = TF1("m1","gaus",0,0.75)
00072         peak2 = TF1("m2","gaus",0.75,1.5)
00073         total = TF1("mtotal", "gaus(0) + gaus(3)", 0, 1.5)
00074         #self.stats["/file0/energy/nobgEnergy"].Fit("gaus","","",max-interval,max+2*interval+0.1)
00075         self.stats["/file0/energy/nobgEnergy"].Fit(peak1,"R")
00076         self.stats["/file0/energy/nobgEnergy"].Fit(peak2,"R+")
00077         peak1_0 = peak1.GetParameter(0)
00078         peak1_1 = peak1.GetParameter(1)
00079         peak1_2 = peak1.GetParameter(2)
00080 
00081 
00082         total = TF1("fit", "[0]*TMath::Gaus(x,[1],[2]) + [3]*TMath::Gaus(x,[1]/2,[2]/sqrt(2))", 0, 1.5)
00083         total.SetParameter(0,peak1_0)
00084         total.SetParameter(1,peak1_1)
00085         total.SetParameter(2,peak1_2)
00086         total.SetParameter(3,0)
00087 
00088         self.stats["/file0/energy/nobgEnergy"].Fit(total, "R")
00089         
00090         # Uncomment to save 
00091         #f = open('FitData', 'a')
00092         #fitResults = self.stats["/file0/energy/nobgEnergy"].GetFunction("gaus")
00093         #for i in range(0,3):
00094         #  f.write(repr(fitResults.GetParameter(i)))
00095         #  f.write('\n')
00096         #f.write('\n')
00097         #f.close()
00098         canvas.SaveAs("nobgEnergy.png")
00099         
00100         status = DybPythonAlg.finalize(self)
00101         return status
00102 


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

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