Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
AIDA-2020 TLU
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
AIDA-2020 TLU
Commits
d0e50c4d
Commit
d0e50c4d
authored
Oct 27, 2015
by
David Cussans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edited to write all Longs to Root - makes it easier for Maartin's code
parent
7a264560
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
startTLU_v4.py
firmware/scripts/startTLU_v4.py
+23
-8
No files found.
firmware/scripts/startTLU_v4.py
View file @
d0e50c4d
...
...
@@ -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 {
\
U
Int
_t uBufpos;
\
U
Long64
_t uBufpos;
\
ULong64_t ulHighWord;
\
ULong64_t ulLowWord;
\
U
Int
_t uEvtNumber;
\
U
Long64
_t uEvtNumber;
\
ULong64_t ulTimeStamp;
\
U
Int
_t uEvtType;
\
U
Int
_t uTrigsFired;
\
U
Long64
_t uEvtType;
\
U
Long64
_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\n
Pre,post trigger count at end of run "
,
preVetotriggerCount
,
postVetotriggerCount
termios
.
tcsetattr
(
sys
.
stdin
,
termios
.
TCSADRAIN
,
oldTermSettings
)
f
.
Write
()
f
.
Close
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment