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

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.


Constructor & Destructor Documentation

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

Definition at line 35 of file PrintCalibData.py.

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


Member Function Documentation

def PrintCalibData::PrintCalibDataAlg::initialize (   self)

Definition at line 39 of file PrintCalibData.py.

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

def PrintCalibData::PrintCalibDataAlg::execute (   self)

Definition at line 50 of file PrintCalibData.py.

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

Definition at line 120 of file PrintCalibData.py.

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


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