/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 | Static Public Attributes
SimAmC::ValidateAmCMC::CaptureVertexAlg Class Reference
Inheritance diagram for SimAmC::ValidateAmCMC::CaptureVertexAlg:
Inheritance graph
[legend]
Collaboration diagram for SimAmC::ValidateAmCMC::CaptureVertexAlg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def makeIsotopeHistogram
def captureIsotope
def captureSpectrumForIsotopes
def __init__
def initialize
def execute
def finalize
def __init__
def initialize
def execute
def finalize
def verbose
def debug
def info
def warning
def error
def fatal
def getAES
def initializeHeader
def finalizeHeader

Public Attributes

 cableSvc
 isot
 msgSvc
 archiveSvc
 stats
 defaultInputLocation
 execNumber
 currentJobId

Static Public Attributes

list Isotopes

Detailed Description

Definition at line 41 of file ValidateAmCMC.py.


Constructor & Destructor Documentation

def SimAmC::ValidateAmCMC::CaptureVertexAlg::__init__ (   self,
  name 
)

Definition at line 72 of file ValidateAmCMC.py.

00073                            :
00074         DybPythonAlg.__init__(self,name)
00075         return


Member Function Documentation

def SimAmC::ValidateAmCMC::CaptureVertexAlg::makeIsotopeHistogram (   instance,
  hist,
  isotopes = Isotopes 
)

Definition at line 49 of file ValidateAmCMC.py.

00050                                                                 :
00051         hist.GetXaxis().SetTitle("Isotopes")
00052         hist.GetYaxis().SetTitle("Neutron Capture Events")
00053         for i in range(0,len(isotopes)):
00054             hist.GetXaxis().SetBinLabel(2 + i,isotopes[i][2])

def SimAmC::ValidateAmCMC::CaptureVertexAlg::captureIsotope (   instance,
  a,
  z,
  reconE,
  isotopes = Isotopes 
)

Definition at line 55 of file ValidateAmCMC.py.

00056                                                                 :
00057         for i in range(0,len(isotopes)):
00058             if ((isotopes[i][0] == a) and (isotopes[i][1] == z)):
00059                 instance.stats["/file0/hist/Isotopes"].Fill(isotopes[i][2], 1)
00060                 if reconE >= 6:
00061                     instance.stats["/file0/hist/Isotopes6MeV"].Fill(isotopes[i][2], 1)

def SimAmC::ValidateAmCMC::CaptureVertexAlg::captureSpectrumForIsotopes (   instance,
  a,
  z,
  reconE,
  recZ,
  recY,
  isotopes = Isotopes 
)

Definition at line 62 of file ValidateAmCMC.py.

00063                                                                                           :
00064         isot = ["54Fe","56Fe","157Gd","1H","58Ni","53Cr","55Mn"]
00065         for i in range(0,len(isotopes)):
00066             if ((isotopes[i][0] == a) and (isotopes[i][1] == z)) and (isotopes[i][2] in isot):
00067                 name1 = "/file0/hist/h"+isotopes[i][2]+"Erg"
00068                 name2 = "/file0/hist/h"+isotopes[i][2]+"Vertex"
00069                 instance.stats[name1].Fill(reconE)
00070                 instance.stats[name2].Fill(recY,recZ)
00071 

def SimAmC::ValidateAmCMC::CaptureVertexAlg::initialize (   self)

Definition at line 76 of file ValidateAmCMC.py.

00077                         :
00078         status = DybPythonAlg.initialize(self)
00079         if status.isFailure(): return status
00080         self.info("initializing")
00081 
00082         self.cableSvc = self.svc('ICableSvc','CableSvc')
00083         if self.cableSvc == None:
00084             self.error("Failed to get CableSvc")
00085             return FAILURE
00086 
00087         hist = TH1F("ReconEnergy","Reconstructed spectrum(AdScaled)",100,0,12.0)
00088         hist.GetXaxis().SetTitle("E/MeV")
00089         hist.GetYaxis().SetTitle("Events")
00090         self.stats["/file0/hist/ReconEnergy"] = hist
00091 
00092         hist = TH2F("RecYvsX","Reconstructed vertex: Y vs X",200,-3,3, 200,-3,3)
00093         hist.GetXaxis().SetTitle("X/m")
00094         hist.GetYaxis().SetTitle("Y/m")
00095         self.stats["/file0/hist/RecYvsX"] = hist
00096 
00097         hist = TH2F("RecZvsY","Reconstructed vertex: Z vs Y",200,-3,3, 200,-3,3)
00098         hist.GetXaxis().SetTitle("Y/m")
00099         hist.GetYaxis().SetTitle("Z/m")
00100         self.stats["/file0/hist/RecZvsY"] = hist
00101 
00102         hist = TH2F("CapYvsX","Capture vertex: Y vs X",200,-3,3, 200,-3,3)
00103         hist.GetXaxis().SetTitle("X/m")
00104         hist.GetYaxis().SetTitle("Y/m")
00105         self.stats["/file0/hist/CapYvsX"] = hist
00106 
00107         hist = TH2F("CapZvsY","Capture vertex: Z vs Y",200,-3,3, 200,-3,3)
00108         hist.GetXaxis().SetTitle("Y/m")
00109         hist.GetYaxis().SetTitle("Z/m")
00110         self.stats["/file0/hist/CapZvsY"] = hist
00111 
00112         hist = TH1F("Isotopes","The Capture Target for Neutrons that Generate Signals In AD", 26,0,26.0)
00113         self.makeIsotopeHistogram(hist)
00114         self.stats["/file0/hist/Isotopes"] = hist
00115 
00116         hist = TH1F("Isotopes6MeV","The Capture Target for Neutrons with Reconstructed Energy > 6MeV", 26,0,26.0)
00117         self.makeIsotopeHistogram(hist)
00118         self.stats["/file0/hist/Isotopes6MeV"] = hist
00119 
00120         self.isot = ["54Fe","56Fe","157Gd","1H","58Ni","53Cr","55Mn"]
00121         for iso1 in self.isot:
00122             hist = TH1F("h"+iso1+"Erg","Energy Spectrum for Neutrons Captured on "+iso1, 100,0,12.0)
00123             hist.GetXaxis().SetTitle("E/MeV")
00124             hist.GetYaxis().SetTitle("Events")
00125             self.stats["/file0/hist/h"+iso1+"Erg"] = hist
00126 
00127             hist = TH2F("h"+iso1+"Vertex","Vertex for Neutrons Captured on "+iso1, 200,-3,3, 200,-1.5,4.5)
00128             hist.GetXaxis().SetTitle("Y/m")
00129             hist.GetYaxis().SetTitle("Z/m")
00130             self.stats["/file0/hist/h"+iso1+"Vertex"] = hist
00131 
00132         return SUCCESS

def SimAmC::ValidateAmCMC::CaptureVertexAlg::execute (   self)

Definition at line 133 of file ValidateAmCMC.py.

00134                      :
00135         self.info("executing")
00136         evt = self.evtSvc()
00137         
00138         readoutHdr = evt["/Event/Readout/ReadoutHeader"]
00139         if readoutHdr == None:
00140             self.error("Failed to get ReadoutHeader")
00141             return SUCCESS
00142 
00143         reconHdr = evt["/Event/Rec/AdScaled"]
00144         if reconHdr == None:
00145             self.warning("Failed to get current recon header")
00146             return FAILURE
00147 
00148         recTrigger = reconHdr.recTrigger()
00149         recE = recTrigger.energy()/units.MeV
00150         self.stats["/file0/hist/ReconEnergy"].Fill(recE)
00151         reconPos = recTrigger.position()
00152         recX = reconPos.x()/units.m
00153         recY = reconPos.y()/units.m
00154         recZ = reconPos.z()/units.m
00155         self.stats["/file0/hist/RecYvsX"].Fill(recX,recY)
00156         self.stats["/file0/hist/RecZvsY"].Fill(recY,recZ)
00157 
00158         simHdrs = findHeader(readoutHdr, gbl.DayaBay.SimHeader.classID())
00159         if simHdrs == None:
00160             self.error("Failed to get simHeader")
00161             return SUCCESS
00162         if enumerate(simHdrs) == 0:
00163             self.error("simHeader size = 0")
00164             return SUCCESS
00165 
00166         simHdrs = dict([(hdr.execNumber(), hdr) for hdr in simHdrs]).values()
00167         for ii, simHdr in enumerate(simHdrs):
00168             statsHdr = simHdr.unobservableStatistics()
00169             simStats = statsHdr.stats()
00170             det = self.getDet("/dd/Structure/AD/db-oil1")
00171             phis = simHdr.particleHistory()
00172             trk = phis.trackVector()
00173             ntrk = trk.size()
00174             for i in range(0, ntrk):
00175                 proc = trk[i].vertices()[0].process().name()
00176                 inite = trk[i].vertices()[0].kineticEnergy()/units.MeV
00177                 PDG = trk[i].particle()
00178                 nv = trk[i].vertices().size()
00179                 if nv>0 and proc=="nCapture":
00180                     if PDG>1000000000:
00181                         gloPos = trk[i].vertices()[0].position()
00182                         locPos = det.geometry().toLocal( gloPos )
00183                         capX = locPos.x()/units.m
00184                         capY = locPos.y()/units.m
00185                         capZ = locPos.z()/units.m
00186                         self.stats["/file0/hist/CapYvsX"].Fill(capX,capY)
00187                         self.stats["/file0/hist/CapZvsY"].Fill(capY,capZ)
00188                         Z = (int(PDG/10000)%1000)
00189                         A = (int(PDG/10)%1000)-1
00190                         self.captureIsotope(A,Z,recE)
00191                         self.captureSpectrumForIsotopes(A,Z, recE, recZ, recY)
00192 
00193 
00194         return SUCCESS
        
def SimAmC::ValidateAmCMC::CaptureVertexAlg::finalize (   self)

Definition at line 195 of file ValidateAmCMC.py.

00196                       :
00197         self.info("finalizing")
00198         status = DybPythonAlg.finalize(self)
00199         return status
00200 


Member Data Documentation

Initial value:
[[1,1,'1H'],[12,6,'12C'],[13,6,'13C'],[14,7,'14N'],
                [16,8,'16O'],[28,14,'28Si'],[31,15,'31P'],[32,16,'32S'],
                [35,17,'35Cl'],[37,17,'37Cl'],[50,24,'50Cr'],[52,24,'52Cr'],
                [53,24,'53Cr'],[54,24,'54Cr'],[55,25,'55Mn'],[54,26,'54Fe'],
                [56,26,'56Fe'],[57,26,'57Fe'],[58,26,'58Fe'],[58,28,'58Ni'],
                [60,28,'60Ni'],[62,28,'62Ni'],[107,47,'107Ag'],[155,64,'155Gd'],[157,64,'157Gd']]

Definition at line 42 of file ValidateAmCMC.py.

Definition at line 76 of file ValidateAmCMC.py.

Definition at line 76 of file ValidateAmCMC.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:55:49 for SimAmC by doxygen 1.7.4