/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
dybNuWaHist::NuWaHistogramExample Class Reference
Inheritance diagram for dybNuWaHist::NuWaHistogramExample:
Inheritance graph
[legend]
Collaboration diagram for dybNuWaHist::NuWaHistogramExample:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Public Attributes

 nhitVsEnergyAD1H
 nhitVsEnergyAD2H

Detailed Description

Definition at line 50 of file dybNuWaHist.py.


Constructor & Destructor Documentation

def dybNuWaHist::NuWaHistogramExample::__init__ (   self,
  name 
)

Definition at line 52 of file dybNuWaHist.py.

00053                            :
00054         DybPythonAlg.__init__(self,name)
00055         return


Member Function Documentation

def dybNuWaHist::NuWaHistogramExample::initialize (   self)

Definition at line 56 of file dybNuWaHist.py.

00057                         :
00058         status = DybPythonAlg.initialize(self)
00059         if status.isFailure(): return status
00060         self.info("initializing")
00061 
00062         # Prepare histograms: Hit PMT count vs. reconstructed energy
00063         self.nhitVsEnergyAD1H = TH2F("nhitVsEnergyAD1H",
00064                                      "Number of Hit PMTs vs. Energy, AD#1",
00065                                      150,0,15,
00066                                      200,0,200);
00067         self.nhitVsEnergyAD1H.GetXaxis().SetTitle("energy [MeV]")
00068         self.nhitVsEnergyAD1H.GetYaxis().SetTitle("Number of hit PMTs")
00069         self.stats["/file1/myhists/nhitVsEnergyAD1H"] = self.nhitVsEnergyAD1H
00070         self.nhitVsEnergyAD2H = TH2F("nhitVsEnergyAD2H",
00071                                      "Number of Hit PMTs vs. Energy, AD#2",
00072                                      150,0,15,
00073                                      200,0,200);
00074         self.nhitVsEnergyAD2H.GetXaxis().SetTitle("energy [MeV]")
00075         self.nhitVsEnergyAD2H.GetYaxis().SetTitle("Number of hit PMTs")
00076         self.stats["/file1/myhists/nhitVsEnergyAD2H"] = self.nhitVsEnergyAD2H
00077 
00078         return SUCCESS

def dybNuWaHist::NuWaHistogramExample::execute (   self)
Process each event

Definition at line 79 of file dybNuWaHist.py.

00080                      :
00081         """Process each event"""
00082         evt = self.evtSvc()
00083 
00084         # Access the reconstructed data
00085         reconHdr = evt["/Event/Rec/AdSimple"]
00086         if reconHdr == None:
00087             self.error("Failed to get current recon header")
00088             return FAILURE
00089         # Access the calibrated data statistics
00090         calibStatsHdr = evt["/Event/Data/CalibStats"]
00091         if reconHdr == None:
00092             self.error("Failed to get current calib stats header")
00093             return FAILURE
00094 
00095         # Check for antineutrino detector
00096         detector = reconHdr.context().GetDetId()
00097         if detector == DetectorId.kAD1 or detector == DetectorId.kAD2:
00098             
00099             # Found an AD.  Get reconstructed trigger
00100             recTrigger = reconHdr.recTrigger()
00101             if not recTrigger:
00102                 # No Reconstructed information
00103                 self.warning("No reconstructed data for AD event!?")
00104                 return FAILURE
00105 
00106             # Get reconstructed values
00107             energyStatus = recTrigger.energyStatus()
00108             energy = recTrigger.energy()
00109             nHit = calibStatsHdr.getInt("nHit")
00110             
00111             # Fill the histograms
00112             if energyStatus == ReconStatus.kGood:
00113                 if detector == DetectorId.kAD1:
00114                     self.nhitVsEnergyAD1H.Fill( energy/units.MeV, nHit )
00115                 elif detector == DetectorId.kAD2:
00116                     self.nhitVsEnergyAD2H.Fill( energy/units.MeV, nHit )
00117 
00118         return SUCCESS
        
def dybNuWaHist::NuWaHistogramExample::finalize (   self)

Definition at line 119 of file dybNuWaHist.py.

00120                       :
00121         self.info("finalizing")
00122         status = DybPythonAlg.finalize(self)
00123         return status


Member Data Documentation

Definition at line 56 of file dybNuWaHist.py.

Definition at line 56 of file dybNuWaHist.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:33 for Quickstart by doxygen 1.7.4