Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mbreisch authored Dec 10, 2020
1 parent 3cdaaa6 commit 1b67387
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions analysis/PSEC_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ def getPedestal(channel, meta_event):

# Function to restructure the data of an acdc board given by the clockcycle
# the trigger happend in
def restructure(data, cycleBit):
def restructure(data, cycleSample):
# The cycleBit is given by the metadata and determines which of the 8
# 320 MHz clockcycles the trigger happend in 32 samples * this bit is
# then the actual first sample
cycleSample = 32 * cycleBit
# Create an empty new array for the transformation
new_vector = np.empty(256)
# Loop over all available samples
Expand Down Expand Up @@ -181,7 +180,10 @@ def checkWidth(data, pedestal):
y = data[0+event:256+event,ch]
# and restructure it with the clockcycle bit
y = y - calib[:,ch]
y = restructure(y, bit)
cycleSample = 32 * bit
y = restructure(y, cycleSample)
offset = 130 #####################################################Enter offset here
y = restructure(y, offset)
# Catch events that are not complete
if len(y)!=N_SAMPLE or len(meta_event)!=N_SAMPLE:
print("len error")
Expand Down

0 comments on commit 1b67387

Please sign in to comment.