| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

PrintCalibData::PrintCalibDataAlg Class Reference

List of all members.

Public Member Functions

def __init__
def initialize
def execute
def finalize

Detailed Description

Definition at line 33 of file PrintCalibData.py.


Member Function Documentation

def PrintCalibData::PrintCalibDataAlg::__init__ (   self,
  name 
)

Definition at line 35 of file PrintCalibData.py.

00035                            :
00036         DybPythonAlg.__init__(self,name)
00037         return
00038 
    def initialize(self):

def PrintCalibData::PrintCalibDataAlg::initialize (   self  ) 

Definition at line 39 of file PrintCalibData.py.

00039                         :
00040         status = DybPythonAlg.initialize(self)
00041         if status.isFailure(): return status
00042         self.info("initializing")
00043 
00044         # Example histogram: Total raw ADC sum for each trigger
00045         self.stats["/file1/myhists/chargeSum"] = TH1F("chargeSum",
00046                                    "Sum of PMT charge for each trigger",
00047                                    2000,0,2000)
00048         return SUCCESS
00049 
    def execute(self):

def PrintCalibData::PrintCalibDataAlg::execute (   self  ) 

Definition at line 50 of file PrintCalibData.py.

00050                      :
00051         self.info("executing")
00052 
00053         evt = self.evtSvc()
00054 
00055         # Access the Calib Readout Header.
00056         # This is a container for calibrated data
00057         calibHdr = evt["/Event/CalibReadout/CalibReadoutHeader"]
00058         if calibHdr == None:
00059             self.error("Failed to get current calib readout header")
00060             return FAILURE
00061 
00062         # Access the Readout.  This is the calibrated data from one trigger.
00063         calibReadout = calibHdr.calibReadout()
00064         if calibReadout == None:
00065             self.error("Failed to get calibrated readout from header")
00066             return FAILURE
00067 
00068         # Get the detector ID for this trigger
00069         detector = calibReadout.detector()
00070         self.info("Detector Name: "+detector.detName())
00071 
00072         # Trigger Type: This is an integer of the type for this trigger
00073         self.info("Trigger Type: "+str( calibReadout.triggerType() ))
00074         # Trigger Number: A count of the trigger, according to the DAQ
00075         self.info("Trigger Number: "+str( calibReadout.triggerNumber() ))
00076 
00077         # Trigger Time: Absolute time of trigger for this calibrated data
00078         triggerTime = calibReadout.triggerTime()
00079         # Trigger Time [Seconds]: Trigger time in seconds
00080         self.info("Trigger Time [Seconds part]: "
00081                   +str( triggerTime.GetSec() ))
00082         # Trigger Time [Nanoseconds]: Nanoseconds part of trigger time
00083         self.info("Trigger Time [Nanoseconds part]: "
00084                   +str( triggerTime.GetNanoSec() ))
00085         # Full Trigger Time: Seconds + nanoseconds
00086         # Warning: When you add this together, it will lose some precision.
00087         self.info("Full Trigger Time: "
00088                   +str( triggerTime.GetSec()
00089                         +triggerTime.GetNanoSec()*1.0e-9 ))
00090         
00091         # Loop over each channel data in this trigger
00092         chargeSum = 0
00093         for channel in calibReadout.channelReadout():
00094             sensorId = channel.pmtSensorId()
00095             pmtId = AdPmtSensor( sensorId.fullPackedData() )
00096 
00097             # The pmt ID contains the detector ID, AD column and row numbers.
00098             self.info("Pmt ID:"
00099                       +" detector="
00100                       +pmtId.detName()
00101                       +" column="
00102                       +str(pmtId.column())
00103                       +" ring="
00104                       +str(pmtId.ring()))
00105 
00106             # Calibrated hit data for this channel
00107             for hitIdx in range( channel.size() ):
00108                 # Hit time is in units of ns, and is relative to trigger time
00109                 hitTime = channel.time( hitIdx )
00110                 self.info("Hit Time: "+str( hitTime ))
00111                 # Hit charge is in units of photoelectrons
00112                 hitCharge = channel.charge( hitIdx )
00113                 self.info("Hit Charge: "+str( hitCharge ))
00114                 chargeSum += hitCharge
00115 
00116         # Add this trigger to histogram of Charge sum
00117         self.stats["/file1/myhists/chargeSum"].Fill( chargeSum )
00118         return SUCCESS
00119         
    def finalize(self):

def PrintCalibData::PrintCalibDataAlg::finalize (   self  ) 

Definition at line 120 of file PrintCalibData.py.

00120                       :
00121         self.info("finalizing")
00122         status = DybPythonAlg.finalize(self)
00123         return status
00124 
#####  Job Configuration for nuwa.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 Mon Apr 11 20:11:13 2011 for Quickstart by doxygen 1.4.7