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: ...@@ -639,12 +639,17 @@ class TLU:
bufPos= 0 bufPos= 0
evtNumber= evNum evtNumber= evNum
evtType= evType evtType= evType
trigsFired= 0 trigsFired= inTrig
mystruct.highWord= word0 mystruct.raw0= fifoData[index]
mystruct.lowhWord= word1 mystruct.raw1= fifoData[index+1]
mystruct.extWord= word2 mystruct.raw2= fifoData[index+2]
mystruct.raw3= fifoData[index+3]
mystruct.raw4= fifoData[index+4]
mystruct.raw5= fifoData[index+5]
mystruct.evtNumber= evNum mystruct.evtNumber= evNum
mystruct.tluTimeStamp= tStamp mystruct.tluTimeStamp= tStamp
mystruct.tluEvtType= evType
mystruct.tluTrigFired= inTrig
root_tree.Fill() root_tree.Fill()
outList.insert(len(outList), fineTsList) outList.insert(len(outList), fineTsList)
...@@ -877,10 +882,10 @@ class TLU: ...@@ -877,10 +882,10 @@ class TLU:
print " Turning on software trigger veto" print " Turning on software trigger veto"
self.setTriggerVetoStatus( int("0x1",16) ) self.setTriggerVetoStatus( int("0x1",16) )
#nFifoWords= int(eventFifoFillLevel) nFifoWords= int(eventFifoFillLevel)
#fifoData= self.getFifoData(nFifoWords) fifoData= self.getFifoData(nFifoWords)
#outList= self.parseFifoData(fifoData, nFifoWords/6, True) outList= self.parseFifoData(fifoData, nFifoWords/6, None, None, True)
if saveD: if saveD:
self.saveFifoData(outList) self.saveFifoData(outList)
if plotD: if plotD:
......
...@@ -37,12 +37,12 @@ trigMaskHi = 0x00000000 ...@@ -37,12 +37,12 @@ trigMaskHi = 0x00000000
trigMaskLo = 0x00000002 trigMaskLo = 0x00000002
# #
#### DAC THRESHOLD #### DAC THRESHOLD
DACThreshold0 = -0.2 DACThreshold0 = -0.12
DACThreshold1 = -0.2 DACThreshold1 = -0.12
DACThreshold2 = -0.2 DACThreshold2 = -0.12
DACThreshold3 = -0.2 DACThreshold3 = -0.12
DACThreshold4 = -0.2 DACThreshold4 = -0.12
DACThreshold5 = -0.2 DACThreshold5 = -0.12
# Define which DUTs are ON # Define which DUTs are ON
DutMask = 1 DutMask = 1
......
...@@ -61,10 +61,16 @@ class MyPrompt(cmd.Cmd): ...@@ -61,10 +61,16 @@ class MyPrompt(cmd.Cmd):
return return
def do_id(self, args): 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() TLU.getSN()
return 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): def do_startRun(self, args):
"""Starts the TLU run""" """Starts the TLU run"""
print "==== COMMAND RECEIVED: STARTING TLU RUN" print "==== COMMAND RECEIVED: STARTING TLU RUN"
...@@ -98,21 +104,26 @@ class MyPrompt(cmd.Cmd): ...@@ -98,21 +104,26 @@ class MyPrompt(cmd.Cmd):
#trigsFired=0 #trigsFired=0
#bufPos = 0 #bufPos = 0
#https://root-forum.cern.ch/t/long-integer/1961/2
gROOT.ProcessLine( gROOT.ProcessLine(
"struct MyStruct {\ "struct MyStruct {\
Int_t highWord;\ UInt_t raw0;\
Int_t lowWord;\ UInt_t raw1;\
Int_t extWord;\ UInt_t raw2;\
Int_t evtNumber;\ UInt_t raw3;\
Int_t tluTimeStamp;\ UInt_t raw4;\
Int_t tluEvtType;\ UInt_t raw5;\
UInt_t evtNumber;\
ULong64_t tluTimeStamp;\
UChar_t tluEvtType;\
UChar_t tluTrigFired;\
};" ); };" );
mystruct= MyStruct() mystruct= MyStruct()
# Create a branch for each piece of data # 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( 'tluHighWord' , highWord , "HighWord/l")
# root_tree.Branch( 'tluLowWord' , lowWord , "LowWord/l") # root_tree.Branch( 'tluLowWord' , lowWord , "LowWord/l")
# root_tree.Branch( 'tluExtWord' , extWord , "ExtWord/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