/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 | Public Attributes
ACUNeutronCapturePosition::CapturePositionAlg Class Reference
Inheritance diagram for ACUNeutronCapturePosition::CapturePositionAlg:
Inheritance graph
[legend]
Collaboration diagram for ACUNeutronCapturePosition::CapturePositionAlg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Public Attributes

 cableSvc

Detailed Description

Definition at line 26 of file ACUNeutronCapturePosition.py.


Constructor & Destructor Documentation

def ACUNeutronCapturePosition::CapturePositionAlg::__init__ (   self,
  name 
)

Definition at line 27 of file ACUNeutronCapturePosition.py.

00028                            :
00029         DybPythonAlg.__init__(self,name)
00030         return


Member Function Documentation

def ACUNeutronCapturePosition::CapturePositionAlg::initialize (   self)

Definition at line 31 of file ACUNeutronCapturePosition.py.

00032                         :
00033         status = DybPythonAlg.initialize(self)
00034         if status.isFailure(): return status
00035         self.info("initializing")
00036 
00037         self.cableSvc = self.svc('ICableSvc','CableSvc')
00038         if self.cableSvc == None:
00039             self.error("Failed to get CableSvc")
00040             return FAILURE
00041 
00042         # Make position histograms
00043         hist = TH2F("CapturePosition","Captured Particle z vs x",
00044                 500,-2500.0,2500.0, 500, 1500.0, 4500.0)
00045         hist.GetXaxis().SetTitle("x [mm]")
00046         hist.GetYaxis().SetTitle("z [mm]")
00047         self.stats["/file0/position/CapturePositionAll"] = hist
00048 
00049 
00050         hist = TH2F("CapturePosition","Captured Particle z vs x",
00051                 500,-2500.0,2500.0, 500, 1500.0 , 4500.0)
00052         hist.GetXaxis().SetTitle("x [mm]")
00053         hist.GetYaxis().SetTitle("z [mm]")
00054         self.stats["/file0/position/CapturePosition"] = hist
00055 
00056         hist = TH2F("CapturePosition","Capture Position for particles with E > 6MeV "
00057                 ,500,-2500.0,2500.0, 500, 1500.0 , 4500.0)
00058         hist.GetXaxis().SetTitle("x [mm]")
00059         hist.GetYaxis().SetTitle("z [mm]")
00060         self.stats["/file0/position/CapturePosition6MeV"] = hist
00061     
00062         hist = TH2F("Reconstructed Position","Energy range 0~2MeV"
00063                 ,500, -2500.0, 2500.0, 500, -500.0, 3500.0)
00064         hist.GetXaxis().SetTitle("x [mm]")
00065         hist.GetYaxis().SetTitle("z [mm]")
00066         self.stats["/file0/position/ReconPosition1"] = hist
00067         
00068         hist = TH2F("Reconstructed Position","Energy range 2~4MeV"
00069                 ,500, -2500.0, 2500.0, 500, -500.0, 3500.0)
00070         hist.GetXaxis().SetTitle("x [mm]")
00071         hist.GetYaxis().SetTitle("z [mm]")
00072         self.stats["/file0/position/ReconPosition2"] = hist
00073 
00074         hist = TH2F("Reconstructed Position","Energy range 4~6MeV"
00075                 ,500, -2500.0, 2500.0, 500, -500.0, 3500.0)
00076         hist.GetXaxis().SetTitle("x [mm]")
00077         hist.GetYaxis().SetTitle("z [mm]")
00078         self.stats["/file0/position/ReconPosition3"] = hist
00079 
00080         hist = TH2F("Reconstructed Position","Energy range 6~8MeV"
00081                 ,500, -2500.0, 2500.0, 500, -500.0, 3500.0)
00082         hist.GetXaxis().SetTitle("x [mm]")
00083         hist.GetYaxis().SetTitle("z [mm]")
00084         self.stats["/file0/position/ReconPosition4"] = hist
00085         
00086         hist = TH2F("Reconstructed Position","Energy range > 8 MeV"
00087                 ,500, -2500.0, 2500.0, 500, -500.0, 3500.0)
00088         hist.GetXaxis().SetTitle("x [mm]")
00089         hist.GetYaxis().SetTitle("z [mm]")
00090         self.stats["/file0/position/ReconPosition5"] = hist
00091 
00092         hist = TH1F("reconEnergy", "Reconstructed Energy",500,0.0,10.0)
00093         hist.GetXaxis().SetTitle("E (MeV)")
00094         hist.GetYaxis().SetTitle("Events")
00095         self.stats["/file0/energy/ReconEnergy"] = hist  
00096         
00097         return SUCCESS

def ACUNeutronCapturePosition::CapturePositionAlg::execute (   self)

Definition at line 98 of file ACUNeutronCapturePosition.py.

00099                      :
00100         self.info("executing")
00101         evt = self.evtSvc()
00102 
00103         #The Capture Position of the Particles that Generate Signals in AD
00104         simHdr = evt["/Event/Sim/SimHeader"]
00105         if simHdr == None:
00106             self.error("Failed to get SimHeader")
00107             return FAILURE
00108         statsHdr = simHdr.unobservableStatistics()
00109         simStats = statsHdr.stats()
00110 
00111         x1 = simStats["xEnd_Trk1"].sum()
00112         y1 = simStats["yEnd_Trk1"].sum()
00113         z1 = simStats["zEnd_Trk1"].sum()
00114 
00115         globalPos1 = XYZPoint(x1, y1, z1)
00116         ad1 = self.detSvc("/dd/Structure/AD/db-oil1")
00117         localPos1 = ad1.geometry().toLocal(globalPos1)
00118         cx = localPos1.x()
00119         cz = localPos1.z()
00120         self.stats["/file0/position/CapturePositionAll"].Fill(cx,cz)
00121 
00122         recHdr = evt["/Event/Rec/RecHeader"]
00123         if recHdr == None:
00124             self.error("Failed to get RecHeader")
00125             return FAILURE
00126         recResults = recHdr.recResults()
00127         recTrigger = recResults["AdSimple"]
00128         if recTrigger.positionStatus() == ReconStatus.kGood:
00129             reconPos = recTrigger.position()
00130             rx = reconPos.x()
00131             rz = reconPos.z()
00132             self.stats["/file0/position/CapturePosition"].Fill(cx,cz)
00133             
00134         if recTrigger.energyStatus() == ReconStatus.kGood:
00135             reconEnergy = recTrigger.energy()
00136             self.stats["/file0/energy/ReconEnergy"].Fill(reconEnergy)
00137             if ((reconEnergy >= 0) & (reconEnergy < 2)):
00138                 self.stats["/file0/position/ReconPosition1"].Fill(rx,rz)
00139 
00140             if ((reconEnergy >= 2) & (reconEnergy < 4)) :
00141                 self.stats["/file0/position/ReconPosition2"].Fill(rx,rz)
00142 
00143             if ((reconEnergy >= 4) & (reconEnergy < 6)) :
00144                 self.stats["/file0/position/ReconPosition3"].Fill(rx,rz)
00145 
00146             if ((reconEnergy >= 6) & (reconEnergy < 8)) :
00147                 self.stats["/file0/position/ReconPosition4"].Fill(rx,rz)
00148                 self.stats["/file0/position/CapturePosition6MeV"].Fill(cx,cz)
00149             if reconEnergy >= 8 :
00150                 self.stats["/file0/position/ReconPosition5"].Fill(rx,rz)
00151                 self.stats["/file0/position/CapturePosition6MeV"].Fill(cx,cz)
00152 
00153         return SUCCESS
        
def ACUNeutronCapturePosition::CapturePositionAlg::finalize (   self)

Definition at line 154 of file ACUNeutronCapturePosition.py.

00155                       :
00156         self.info("finalizing")
00157         status = DybPythonAlg.finalize(self)
00158         return status
00159 


Member Data Documentation

Definition at line 31 of file ACUNeutronCapturePosition.py.


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:37 for Calibration by doxygen 1.7.4