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 3, 2020
1 parent c29e727 commit 1c51de8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
18 changes: 14 additions & 4 deletions analysis/PSEC_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
N_BOARDS = 8 # Maximum number of acdc boards
SIGN = -1 # Setting for the expected sign of the pulse
THRESHOLD = 500 # Setting for the threshold to count a pulse as a pulse
WIDTH_NS = 5
WIDTH_NS = 5 # Setting for the expected width of a puse

# Function to load a set of events from one acdc board at a time
def load_board_data(filename, offset):
Expand Down Expand Up @@ -184,6 +184,18 @@ def checkWidth(data, pedestal):
pedestal = getPedestal(ch, meta_event)
# Check the waveform for a pulse by checking on the
# correct sign as well as pulse height
####################################################################
# From this point on you have x and y available as arrays to work with
## x is a set arrays from 0 to 255 representing the samples
## y is the array containing the data of one waveform (which is already
# restructured by correcting the clockcycle with the trigger in it)
# Right here is within 3 for loops going over boards>channels>events to
# allow for event to event evaluation.
# Additional information available for one event:
## pedestal which reads the set pedestal value from the metadata
## meta_event which is the entire array of metadata available
### The following evaluation is just a quick example/test evaluation to count
### pulses per channel and represent them.
####################################################################
chk_sign = checkSign(y, pedestal)
chk_height = checkHeight(y, pedestal)
Expand All @@ -192,10 +204,8 @@ def checkWidth(data, pedestal):
# otherwise tell why not
if chk_sign==True and chk_height== True and chk_width==True:
chk_counter+=1
####################################################################
count_table[int(counter)] = chk_counter
counter+=1
# Print how many channels had events in them
print(count_table)
bar_x = range(0,N_CHANNEL*int(num_boards))
plt.bar(bar_x,count_table)
####################################################################
1 change: 0 additions & 1 deletion lib/ACC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,6 @@ void ACC::writePsecData(ofstream& d, vector<int> boardsReadyForRead)
for(string k: keys)
{
ofs << k << endl; //decimal

}
ofs.close();
}
Expand Down

0 comments on commit 1c51de8

Please sign in to comment.