Inheritance diagram for EvtCli:
Public Member Functions | |
__init__ (debug=0, port=EvtCliIO.PortNumber) | |
Event client constructor. | |
setDebug (debug) | |
Set the debug mode. | |
readEvent (dat=None) | |
Read an event. | |
getGGLTStatus () | |
Retrieve the GGLT status. | |
getGGLTStatusStr () | |
Return the string equivalent of the GGLT status code. | |
getOnlineStatus () | |
Retrieve the Online status code. | |
getEvtStatus () | |
Return the event status from the event header. | |
getContributionStatus () | |
Return the contribution status. | |
getContributionStatusStr () | |
Return the contribution status string. | |
getOnlineStatusStr () | |
Retrieve the string equivalent of the Online status code. | |
getEvtSize () | |
Return the event size. | |
isErrorEvent () | |
isTrgParityErrorEvent () | |
isPacketErrorEvent () | |
isSweepEvent () | |
Determine if a sweep event is received. | |
isGGLTStatus (status=None) | |
Determine if the current event is bad. | |
checkOnlineStatus (status, mask) | |
Checks if the bit mask mask matches the status that is assumed as an Online status. | |
checkGGLTstatus (status, mask) | |
Checks if the bit mask mask matches the status that is assumed as a GGLT status. | |
readEventSocket () | |
setCurrentContribution (contributionId) | |
Given a contribution id, set the current contribution data needed for the parsing routines. | |
getCurrentContribution () | |
Return the integer id of the current contribution. | |
getContributionList () | |
Walk through the whole event and construct a list of contribution id strings. | |
dumpContributionData () | |
Prints out information pertaining to the current contribution. | |
evGetTimestamp () | |
Return the timestamp of the event in seconds. | |
evGetTimebase () | |
Return the timestamp of the event derived from the PPC timebase register. | |
evGetEvtSeqMSW () | |
Return the MSW portion of the event sequence. | |
evGetEvtSequence () | |
Return the Event Sequence. | |
getUserId () | |
Return the user id passed to the event client. | |
evGetTKR_Accepts (pAccept) | |
Walks tower event contribution to the TKR accepts data. | |
evGetCAL_NumAccepts () | |
Counts the number of hit calorimeter logs in the tower event contribution. | |
evDumpGEM () | |
Parses the GEM contribution by populating the data in self.evt.gem. | |
evDumpGEM_Veto_List (offset) | |
Parses the Veto List block of the GEM contribution. | |
getWord (wordOffset) | |
Unpack and return a 16-bit word value located at wordOffset. | |
getDWord (dWordOffset) | |
Unpack and return a 32-bit word value located at dWordOffset. | |
getByte (byteOffset) | |
Unpack and return an 8-bit byte value located at byteOffset. | |
evGetCAL_Logs () | |
Walks tower event contribution to the CAL log data. | |
evGetCAL_LogAccepts () | |
Walks the tower event contribution to the calorimeter log accepts word. | |
evDumpCAL_LogAccepts () | |
Decodes the log accepts word and stores it in evt.CAL_LogAccepts. | |
evDumpCAL_Logs () | |
Decodes all the log data for the event and stores it in evt.CAL_LogData. | |
evGetSummary () | |
Return the offset to the summary word of the current contribution. | |
evGetTKR_StripN (pAccepts, stripN, stripData=None) | |
Fetches a 12-bit strip word from pAccepts, indexed by stripN. | |
evDumpTKR () | |
Decodes all the TKR event data and stores it in the event object. | |
evBitCount (x) | |
Count the number of set bits in x. | |
evGetTKR_NumStrips () | |
evGetTKR_TOT () | |
Returns pointer to start of tracker TOT list. | |
evGetTKR_NumAccepts () | |
Counts the number of accepted TKR layer-ends. | |
evGetTEM_Diagnostic () | |
Returns pointer to start of diagnostic event data. | |
evGetTEM_Error () | |
Returns pointer to the error word contribution of event data. | |
evDumpTEM_Error (forcePrint=0) | |
Decodes the event error contribution. | |
evDumpDiagnostic () | |
Decodes the event diagnostic contribution. | |
evDumpSummary (minEvSize=24) | |
Decodes the event summary word. | |
evDumpAEM_Vetos () | |
Decodes the AEM veto hit list contribution. | |
evDumpAEM_Accepts () | |
Decodes the AEM accept list contribution. | |
evGetAEM_PHA (cbl) | |
Returns pointer to start of AEM PHA values. | |
evGetAEM_Vec (cbl, type) | |
Returns the 18-bit vector for cable specified by cbl and type. | |
evDumpAEM_PHA () | |
Decodes the AEM PHA contribution. | |
evDumpEventAEM_G2 () | |
Given a pointer to AEM event contribution print its contents. | |
evDumpEventAEM () | |
The new AEM event parsing routine. | |
print_EOE_Warning () | |
Print warning if we have reached the end of the contribution prematurely. |
Contents:
Receives an event from TCP socket or a file stream and parses it into the evt object.
Overview:
The event client is responsible for communicating with the event server and retrieve events triggered by a script or an external source. The source of the event can be either a TCP socket or an archive file.
The event client uses lazy parsing to parse the event. This means the user application needs to call the parsing routines that corresponds to the section of the event that the user is interested in. The parser methods populate event objects inside the Evt class in the event client, so after the parser method is called these objects can be accessed or iterated over. The parser methods only apply to the current contribution. By default after readEvent() the first contribution after the GEM contribution is the current contribution. Use the setCurrentContribution method to change the current contribution. Use the getContributionList method to find out which contributions exist in the event.
Available parser methods:
Contribution related methods:
Retrieving the timestamp and timebase:
Usage:
For reading events from a socket:
from gEvtCli import * ec = EvtCli(debug=0) ec.connect('gitot') while ec.readEvent() == 0: ec.setCurrentContribution(...) if ec.getContributionStatus() == 0: ec.evDumpXXX() : else: print "Error %s in contribution %s ", (ec.getContributionStatusStr(), cId) ec.disconnect()
from gEvtCli import * ec = EvtCli(debug=0) ec.open('030305165528.ldf') while ec.readEvent() == 0: ec.setCurrentContribution(...) if ec.getContributionStatus() == 0: ec.evDumpXXX() : else: print "Error %s in contribution %s ", (ec.getContributionStatusStr(), cId) ec.close()
from gEvtCli import * ec = EvtCli(debug=0) ec.connect('gitot') status = ec.readEvent() contList = ec.getContributionList() for cId in contList: ec.setCurrentContribution(cId) if ec.getContributionStatus() == 0: ec.evDumpSummary() if cId.startswith('TEM'): ec.evDumpCAL_LogAccepts() ec.evDumpCAL_Logs() ec.evDumpTKR() ec.evDumpTEM_Error() ec.evDumpDiagnostic() elif cId == 'AEM': ec.evDumpEventAEM() else: print "Error %s in contribution %s ", (ec.getContributionStatusStr(), cId)
Definition at line 795 of file gEvtCli.py.
|
Event client constructor.
Reimplemented from EvtCliIO. |
|
Checks if the bit mask mask matches the status that is assumed as a GGLT status.
|
|
Checks if the bit mask mask matches the status that is assumed as an Online status.
|
|
Count the number of set bits in x.
|
|
Decodes the AEM accept list contribution. This method is used by the old AEM event parser evDumpEventAEM_G2 |
|
Decodes the AEM PHA contribution. This method is used by the old AEM event parser evDumpEventAEM_G2 Given a pointer to AEM event contribution print the PHA values. |
|
Decodes the AEM veto hit list contribution. This method is used by the old AEM event parser evDumpEventAEM_G2 |
|
The new AEM event parsing routine. This parser works according to the latest specs where not all cable contributions are guaranteed to be provided. |
|
Given a pointer to AEM event contribution print its contents. This method is the old G2 compatible AEM event parser, please use the new event parser evDumpEventAEM for G3 based AEM events. |
|
Parses the GEM contribution by populating the data in self.evt.gem. Requires calling evtCli.setCurrentContribution(EvtCli.GEM) before usage. |
|
Parses the Veto List block of the GEM contribution. Used by evDumpGEM
|
|
Decodes the event summary word. Given a pointer to tower event contribution print the event summary word.
|
|
Decodes the event error contribution. If an error contribution is present this prints up to 20 16-bit words of the error contribution.
|
|
Returns pointer to start of AEM PHA values. This method is used by the old AEM event parser evDumpEventAEM_G2
|
|
Returns the 18-bit vector for cable specified by cbl and type. This method is used by the old AEM event parser evDumpEventAEM_G2
|
|
Walks the tower event contribution to the calorimeter log accepts word. Given a pointer to an entire TEM event contribution walk the data structure returning a pointer to the calorimeter log accepts word. The 32-bit calorimeter log accepts word is immediately after the event summary word, i.e. the 2nd 32-bit word in the data.
|
|
Walks tower event contribution to the CAL log data. Given a pointer to an entire TEM event contribution walk the data structure to the beginning of the calorimeter log data.
|
|
Counts the number of hit calorimeter logs in the tower event contribution. Given a pointer to an entire TEM event contribution walk the data structure to the calorimeter log accepts word and return the sum of the number of hit logs.
|
|
Return the MSW portion of the event sequence.
|
|
Return the Event Sequence.
|
|
Return the offset to the summary word of the current contribution. In a contribution, first word after the header is the summary word
|
|
Returns pointer to start of diagnostic event data. Caller should check the event summary word if a diagnostic contribution is present before calling this function.
|
|
Returns pointer to the error word contribution of event data. Caller should check the event summary word if an error contribution is present before calling this function.
|
|
Return the timestamp of the event derived from the PPC timebase register. This is a 64 bit value that increments at an SBC implementation dependant rate (60 nS on MVME2306s). The value is reset at PPC reset time.
|
|
Return the timestamp of the event in seconds. The resolution of this timestamp is 1/60th of a second, by default. Consult VxWorks documentation for sysClkRateSet() and clock_setres() to see how to change this default. Beware that increasing the resolution from the default may cause adverse effects due to the increased interrupt rate generated.
|
|
Walks tower event contribution to the TKR accepts data. Fills in the evGetTKR_Accepts structure pointed to by pAccept with the TKR accepts data. Also returns a pointer to the TKR accepts information.
|
|
Counts the number of accepted TKR layer-ends.
|
|
Returns number of hit strips in the event
|
|
Fetches a 12-bit strip word from pAccepts, indexed by stripN. pAccepts points to the top of the accepts data ... the strip data starts 72 bits ( 8 * 9 ) from the beginning of accepts. I.e. it starts 8 bits into the 3rd 32-bit word.
|
|
Returns pointer to start of tracker TOT list.
|
|
Unpack and return an 8-bit byte value located at byteOffset.
|
|
Walk through the whole event and construct a list of contribution id strings.
|
|
Return the contribution status.
|
|
Return the contribution status string.
|
|
Return the integer id of the current contribution.
|
|
Unpack and return a 32-bit word value located at dWordOffset.
|
|
Return the event size.
|
|
Retrieve the GGLT status. If this status value is non zero then the event is considered "bad" |
|
Retrieve the Online status code. See getOnlineStatusStr method for a list of possible errors |
|
Retrieve the string equivalent of the Online status code. The error can be one of the following: GGLT_STATUS_ERROR : A bad event was received. Call getGGLTStatusStr method for the description. MINIMAL_SIZE_ERROR : The event size was below the acceptable size. EOE_ERROR : End of event was reached before the parse completed. UNPACK_ERROR : There was an error while unpacking part of the event for parsing. IO_ERROR : An I/O error occurred while retrieving the event (socket or file). EVENT_VERSION_MISMATCH: An event with an old or unsupported format was received. PLAYBACK_ERROR : End of file was received while playing back an event archive file. READ_TIMEOUT_ERROR : A read timeout occurred while waiting for the event to be retrieved (Set by rcTransitions). EOF_ERROR : End of file is reached while reading the event file.
|
|
Return the user id passed to the event client.
|
|
Unpack and return a 16-bit word value located at wordOffset.
|
|
Determines whether at least one contribution has the error bit set in its summary word.
|
|
Determine if the current event is bad. User script can call this method in process() to determine if the current event is a bad event (gglt_status != 0).
|
|
Determines whether at least one contribution has a non-zero packet error set in the EBF contribution.
|
|
Determine if a sweep event is received. User script can call this method in process() to determine if the current event is a sweep event. A try block around the call should be used in case a bad event is received.
|
|
Determines whether at least one contribution has the trigger parity error bit set in its summary word.
|
|
Read an event. Reads one event from an archive file or socket
|
|
Given a contribution id, set the current contribution data needed for the parsing routines.
|
|
Set the debug mode.
|