/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
PrintRawData::PrintRawDataAlg Class Reference
Inheritance diagram for PrintRawData::PrintRawDataAlg:
Inheritance graph
[legend]
Collaboration diagram for PrintRawData::PrintRawDataAlg:
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 PrintRawData.py.


Constructor & Destructor Documentation

def PrintRawData::PrintRawDataAlg::__init__ (   self,
  name 
)

Definition at line 35 of file PrintRawData.py.

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


Member Function Documentation

def PrintRawData::PrintRawDataAlg::initialize (   self)

Definition at line 39 of file PrintRawData.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/adcSum"] = TH1F("adcSum",
00047                                    "Sum of raw ADC values for each trigger",
00048                                    2000,0,20000)
00049         return SUCCESS

def PrintRawData::PrintRawDataAlg::execute (   self)

Definition at line 50 of file PrintRawData.py.

00051                      :
00052         self.info("executing")
00053 
00054         evt = self.evtSvc()
00055 
00056         # Access the Readout Header.  This is a container for the readout data
00057         readoutHdr = evt["/Event/Readout/ReadoutHeader"]
00058         if readoutHdr == None:
00059             self.error("Failed to get current readout header")
00060             return FAILURE
00061 
00062         # Access the DaqCrate Readout.  This is the data from one trigger.
00063         daqCrate = readoutHdr.daqCrate()
00064         if daqCrate == None:
00065             self.info("No daqCrate readout this cycle")
00066             return SUCCESS
00067 
00068         # Get the detector ID for this trigger
00069         detector = daqCrate.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( daqCrate.triggerType() ))
00074         # Event Number: A count of the trigger, according to the DAQ
00075         self.info("Event Number: "+str( daqCrate.eventNumber() ))
00076 
00077         # Trigger Time: Absolute time of trigger for this raw data
00078         triggerTime = daqCrate.triggerTime()
00079         # Trigger Time [Seconds]: Trigger time in seconds from some day in 1990
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         readout = daqCrate.asPmtCrate()
00092         if readout == None:
00093             self.info("No pmt readout this cycle")
00094             return SUCCESS
00095         
00096         # Loop over each channel data in this trigger
00097         adcSum = 0
00098         for channel in readout.channelReadouts():
00099             channelId = channel.channelId()
00100 
00101             # The channel ID contains the detector ID, electronics board number,
00102             # and the connector number on the board.
00103             self.info("Channel ID:"
00104                       +" detector="
00105                       +channelId.detName()
00106                       +" board="
00107                       +str(channelId.board())
00108                       +" connector="
00109                       +str(channelId.connector()))
00110             
00111             # Loop over hits for this channel
00112             for hitIdx in range( channel.hitCount() ):
00113                 # TDC data for this channel
00114                 #
00115                 # The TDC is an integer count of the time between the time
00116                 # the PMT pulse arrived at the channel, and the time the
00117                 # trigger reads out the data.  Therefore, a larger TDC =
00118                 # earlier time.  One TDC count ~= 1.5625 nanoseconds.
00119                 #
00120                 tdc = channel.tdc( hitIdx )
00121                 self.info("TDC value: "+str( tdc ))
00122 
00123                 # ADC data for this channel
00124                 #
00125                 # The ADC is an integer count of the charge of the PMT
00126                 # pulse.  It is 12 bits (0 to 4095).  There are two ADCs
00127                 # for every PMT channel (High gain and Low gain).  Only
00128                 # the high gain ADC is recorded by default.  If the high
00129                 # gain ADC is saturated (near 4095), then the low gain ADC
00130                 # is recorded instead.
00131                 #
00132                 # For the Mini Dry Run data, one PMT photoelectron makes
00133                 # about 20 high gain ADC counts and about 1 low gain ADC
00134                 # count.  There is an offset (Pedestal) for each ADC of
00135                 # ~70 ADC counts (ie. no signal = ~70 ADC, 1 photoelectron
00136                 # = ~90 ADC, 2 p.e. = ~110 ADC, etc.)
00137                 #
00138                 # The ADC peal cycle is a record of the clock cycle which had
00139                 # the 'peak' ADC.
00140                 #
00141                 # ADC Gain: Here is a description of ADC gain for these values
00142                 #  Unknown = 0
00143                 #  High = 1
00144                 #  Low = 2
00145                 #
00146                 adc = channel.adc( hitIdx )
00147                 preAdc = channel.preAdcAvg( hitIdx )
00148                 peakCycle = channel.peakCycle( hitIdx )
00149                 isHighGain = channel.isHighGainAdc( hitIdx )
00150                 self.info("ADC value: "+str(adc)
00151                           + " (preAdc: "+str( preAdc )+","
00152                           + " peak cycle: "+str( peakCycle )+","
00153                           + " isHighGain?: "+str( isHighGain )+")")
00154                 # Add to total ADC sum for this trigger
00155                 if isHighGain == 1:
00156                     adcSum += (adc-preAdc)
00157                 else:
00158                     # Adjust low gain adc to high gain scale
00159                     adcSum += (adc-preAdc) * 19
00160 
00161         # Add this trigger to histogram of ADC sum
00162         self.stats["/file1/myhists/adcSum"].Fill( adcSum )
00163         return SUCCESS
        
def PrintRawData::PrintRawDataAlg::finalize (   self)

Definition at line 164 of file PrintRawData.py.

00165                       :
00166         self.info("finalizing")
00167         status = DybPythonAlg.finalize(self)
00168         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