Commit 3b9bf843 authored by Paolo Baesso's avatar Paolo Baesso

Root writing works. Still need to sort out the 64-bit time stamp as it is just filled with zeroes.

parent cd7bb016
......@@ -639,12 +639,17 @@ class TLU:
bufPos= 0
evtNumber= evNum
evtType= evType
trigsFired= 0
mystruct.highWord= word0
mystruct.lowhWord= word1
mystruct.extWord= word2
trigsFired= inTrig
mystruct.raw0= fifoData[index]
mystruct.raw1= fifoData[index+1]
mystruct.raw2= fifoData[index+2]
mystruct.raw3= fifoData[index+3]
mystruct.raw4= fifoData[index+4]
mystruct.raw5= fifoData[index+5]
mystruct.evtNumber= evNum
mystruct.tluTimeStamp= tStamp
mystruct.tluEvtType= evType
mystruct.tluTrigFired= inTrig
root_tree.Fill()
outList.insert(len(outList), fineTsList)
......@@ -877,10 +882,10 @@ class TLU:
print " Turning on software trigger veto"
self.setTriggerVetoStatus( int("0x1",16) )
#nFifoWords= int(eventFifoFillLevel)
#fifoData= self.getFifoData(nFifoWords)
nFifoWords= int(eventFifoFillLevel)
fifoData= self.getFifoData(nFifoWords)
#outList= self.parseFifoData(fifoData, nFifoWords/6, True)
outList= self.parseFifoData(fifoData, nFifoWords/6, None, None, True)
if saveD:
self.saveFifoData(outList)
if plotD:
......
......@@ -37,12 +37,12 @@ trigMaskHi = 0x00000000
trigMaskLo = 0x00000002
#
#### DAC THRESHOLD
DACThreshold0 = -0.2
DACThreshold1 = -0.2
DACThreshold2 = -0.2
DACThreshold3 = -0.2
DACThreshold4 = -0.2
DACThreshold5 = -0.2
DACThreshold0 = -0.12
DACThreshold1 = -0.12
DACThreshold2 = -0.12
DACThreshold3 = -0.12
DACThreshold4 = -0.12
DACThreshold5 = -0.12
# Define which DUTs are ON
DutMask = 1
......
......@@ -61,10 +61,16 @@ class MyPrompt(cmd.Cmd):
return
def do_id(self, args):
"""Interrogate the TLU and print it unique ID on screen"""
"""Interrogates the TLU and prints it unique ID on screen"""
TLU.getSN()
return
def do_triggers(self, args):
"""Interrogates the TLU and prints the number of triggers seen by the input discriminators"""
TLU.getChStatus()
TLU.getAllChannelsCounts()
return
def do_startRun(self, args):
"""Starts the TLU run"""
print "==== COMMAND RECEIVED: STARTING TLU RUN"
......@@ -98,21 +104,26 @@ class MyPrompt(cmd.Cmd):
#trigsFired=0
#bufPos = 0
#https://root-forum.cern.ch/t/long-integer/1961/2
gROOT.ProcessLine(
"struct MyStruct {\
Int_t highWord;\
Int_t lowWord;\
Int_t extWord;\
Int_t evtNumber;\
Int_t tluTimeStamp;\
Int_t tluEvtType;\
UInt_t raw0;\
UInt_t raw1;\
UInt_t raw2;\
UInt_t raw3;\
UInt_t raw4;\
UInt_t raw5;\
UInt_t evtNumber;\
ULong64_t tluTimeStamp;\
UChar_t tluEvtType;\
UChar_t tluTrigFired;\
};" );
mystruct= MyStruct()
# Create a branch for each piece of data
root_tree.Branch('myints', mystruct, 'highWord/I:lowWord/I:extWord/I:evtNumber/I:tluTimeStamp/I:tluEvtType/I' )
root_tree.Branch('EVENTS', mystruct, 'raw0/i:raw1/i:raw2/i:raw3/i:raw4/i:raw5/i:evtNumber/i:tluTimeStamp/l:tluEvtType/b:tluTrigFired/b' )
# root_tree.Branch( 'tluHighWord' , highWord , "HighWord/l")
# root_tree.Branch( 'tluLowWord' , lowWord , "LowWord/l")
# root_tree.Branch( 'tluExtWord' , extWord , "ExtWord/l")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment