Skip to content

Commit

Permalink
refactor: fix pps interval drift histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
furkan-bilgin committed Nov 21, 2024
1 parent c057b6f commit aa7ede9
Show file tree
Hide file tree
Showing 23 changed files with 2,464 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ DataModel/DataModel_Linkdef.hh
UserTools/ImportedTools
UserTools/InactiveTools

build/*
17 changes: 17 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-clang-x64",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
79 changes: 79 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"editor.formatOnSave": false,
"files.associations": {
"*.html": "html",
"ostream": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"*.ipp": "cpp",
"array": "cpp",
"atomic": "cpp",
"strstream": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"set": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"rope": "cpp",
"slist": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cfenv": "cpp",
"cinttypes": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp"
},
"C_Cpp.errorSquiggles": "disabled",
"C_Cpp.intelliSenseEngineFallback": "disabled",
"editor.formatOnSaveMode": "file",
}
Binary file added LAPPDTemp
Binary file not shown.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GIT_VERSION := "$(shell git describe --dirty --always)"

CPPFLAGS= -DVERSION=\"$(GIT_VERSION)\" -Wno-reorder -Wno-sign-compare -Wno-unused-variable -Wno-unused-but-set-variable -Werror=return-type -Wl,--no-as-needed

CC=g++ -std=c++1y -g -fPIC -shared $(CPPFLAGS)
CC=g++ -std=c++1y -g -fPIC -shared -O0 $(CPPFLAGS)
CCC= g++ -std=c++1y -g -fPIC $(CPPFLAGS)


Expand Down
10 changes: 5 additions & 5 deletions UserTools/MonitorLAPPDData/MonitorLAPPDData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2492,7 +2492,7 @@ void MonitorLAPPDData::DrawTimeEvolutionLAPPDData(ULong64_t timestamp_end, doubl
lappd_pps_interval_drift_distribution[lappd_id] = {0, 0, 0};

for (int i_timestamp = 0; i_timestamp < timestamps.size(); i_timestamp++) {
graph_pps_interval_drift.emplace(lappd_id, new TH1F());
graph_pps_interval_drift.emplace(lappd_id, new TH1F("", "", 200, -22e8, 30e8));

// Calculate t
auto curr_timestamp = timestamps.at(i_timestamp);
Expand All @@ -2504,7 +2504,7 @@ void MonitorLAPPDData::DrawTimeEvolutionLAPPDData(ULong64_t timestamp_end, doubl
// Fill in PPS interval drift distribution
if (diff == 0) {
lappd_pps_interval_drift_distribution[lappd_id].at(0)++; // For t = 0
} else if (diff == 3.2e8 || (diff == 3.2e8 + 1) || (diff == 3.2e8 - 1)) {
} else if (diff == 3.2e9 || (diff == 3.2e9 + 1) || (diff == 3.2e9 - 1)) {
lappd_pps_interval_drift_distribution[lappd_id].at(1)++; // For t = 3.2e8 +- 1
} else {
lappd_pps_interval_drift_distribution[lappd_id].at(2)++; // For t = other
Expand Down Expand Up @@ -2616,9 +2616,9 @@ void MonitorLAPPDData::DrawTimeEvolutionLAPPDData(ULong64_t timestamp_end, doubl
canvas_pps_interval_drift->cd();
auto lappd_id = it->first;
auto graph = it->second;
graph->Draw("apl");
graph->GetXaxis()->SetTitle("#Delta t_{pps} (clock ticks)");
graph->GetYaxis()->SetTitle("Events (normalised)");
graph->SetTitle(("PPS Interval Drift for LAPPD: " + std::to_string(lappd_id)).c_str());
graph->GetYaxis()->SetTitle("PPS Interval Drift");
graph->Draw("HIST");

auto dist = lappd_pps_interval_drift_distribution.at(lappd_id);
Expand Down Expand Up @@ -3195,7 +3195,7 @@ LAPPDData->Get("AccInfoFrame", AccInfoFrame);*/
raw_lappd_data_pps_timestamps.at(lappd_id).push_back(pps_63_0);

// Add data event timestamp
data_event_timestamps.push_back(timestamp_ns);
data_event_timestamps.push_back((double)pps_63_0 * CLOCK_to_NSEC);
}

if (pps.size() == 32)
Expand Down
Loading

0 comments on commit aa7ede9

Please sign in to comment.