Commit d0e50c4d authored by David Cussans's avatar David Cussans

Edited to write all Longs to Root - makes it easier for Maartin's code

parent 7a264560
......@@ -29,15 +29,26 @@ from ROOT import gROOT # , AddressOf
# "bufferPos, highWord , lowWord , event-number , timestamp , evtType = %x %016x %016x %08x %012x %01x %03x" % ( evt , highWord , lowWord, evtNumber , timeStamp , evtType , trigsFired)
#gROOT.ProcessLine(
#"struct TLUEvtStruct {\
# UInt_t uBufpos;\
# ULong64_t ulHighWord;\
# ULong64_t ulLowWord;\
# UInt_t uEvtNumber;\
# ULong64_t ulTimeStamp;\
# UInt_t uEvtType;\
# UInt_t uTrigsFired;\
#};" );
gROOT.ProcessLine(
"struct TLUEvtStruct {\
UInt_t uBufpos;\
ULong64_t uBufpos;\
ULong64_t ulHighWord;\
ULong64_t ulLowWord;\
UInt_t uEvtNumber;\
ULong64_t uEvtNumber;\
ULong64_t ulTimeStamp;\
UInt_t uEvtType;\
UInt_t uTrigsFired;\
ULong64_t uEvtType;\
ULong64_t uTrigsFired;\
};" );
from ROOT import TLUEvtStruct
......@@ -49,8 +60,8 @@ writeTimestamps = True
listenForTelescopeShutter = False
#TriggerInterval = 400000 # Units = 160MHz clock ticks.
#loopWait = 1.0 # polling interval ( seconds )
#TriggerInterval = 16000 # Units = 160MHz clock ticks.
TriggerInterval = 0 # Units = 160MHz clock ticks.
TriggerInterval = 16000 # Units = 160MHz clock ticks.
#TriggerInterval = 0 # Units = 160MHz clock ticks.
loopWait = 0.05 # polling interval ( seconds )
pulseDelay = 0 # between 0 and 31 in units of 160MHz clock.
pulseStretch = 4 # between 0 and 31 in units of 160MHz clock.
......@@ -71,11 +82,12 @@ board = ChipsBusUdp(bAddrTab,"192.168.200.32",50001)
# Open Root file
f = TFile( rootFname, 'RECREATE' )
tree = TTree( 'T', 'TLU Data' )
tree.Branch( 'tluInts', tluEvtStruct, 'Bufpos/i:HighWord/l:LowWord/l:EvtNumber/i:TimeStamp/l:EvtType/i:TrigsFired/i' )
#tree.Branch( 'tluInts', tluEvtStruct, 'Bufpos/i:HighWord/l:LowWord/l:EvtNumber/i:TimeStamp/l:EvtType/i:TrigsFired/i' )
tree.Branch( 'tluInts', tluEvtStruct, 'Bufpos/l:HighWord/l:LowWord/l:EvtNumber/l:TimeStamp/l:EvtType/l:TrigsFired/l' )
# Initialize TLU registers
initTLU( uhalDevice = hw, pychipsBoard = board, listenForTelescopeShutter = listenForTelescopeShutter, pulseDelay = pulseDelay, pulseStretch = pulseStretch, DUTMask = DUTMask, triggerInterval = TriggerInterval, thresholdVoltage = -0.2, writeTimestamps = True )
initTLU( uhalDevice = hw, pychipsBoard = board, listenForTelescopeShutter = listenForTelescopeShutter, pulseDelay = pulseDelay, pulseStretch = pulseStretch, DUTMask = DUTMask, triggerInterval = TriggerInterval, thresholdVoltage =-0.2 , writeTimestamps = True )
oldEvtNumber = 0
......@@ -170,6 +182,9 @@ while loopRunning:
# Fixme - at the moment infiniate loop.
preVetotriggerCount = board.read("PreVetoTriggersR")
postVetotriggerCount = board.read("PostVetoTriggersR")
print "Exited loop"
print "\n\nPre,post trigger count at end of run " , preVetotriggerCount , postVetotriggerCount
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, oldTermSettings)
f.Write()
f.Close()
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