-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05-read_clusters.cpp
39 lines (29 loc) · 1.01 KB
/
05-read_clusters.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "aare/ClusterFile.hpp"
#include <cstdint>
#include <filesystem>
#include <fmt/core.h>
int main() {
auto path = std::filesystem::path(
"/mnt/sls_det_storage/moench_data/moenchLGAD_maxIV_202403/clust/"
"En1800eV_300V_0deg_W17_ExitSlit3");
auto fname = path / "En1800eV_300V_0deg_W17_xray_d0_f0_24.clust";
aare::ClusterFile cf(fname);
size_t chunk_size = 1000;
auto clusters = cf.read_clusters(chunk_size);
fmt::print("sizeof(aare:Cluster): {}\n", sizeof(aare::Cluster));
fmt::print("----------------\n");
for (size_t i = 0; i < 10; i++) {
fmt::print("cl.x {}\n", clusters[i].x);
fmt::print("cl.y {}\n", clusters[i].y);
int32_t t2;
int32_t t3;
char quad;
double eta2x;
double eta2y;
double eta3x;
double eta3y;
cf.analyze_cluster(clusters[i], &t2, &t3, &quad, &eta2x, &eta2y, &eta3x, &eta3y);
fmt::print("t2: {}\n", t2);
fmt::print("----------------\n");
}
}