CbmRoot
Loading...
Searching...
No Matches
HitfinderPars.h
Go to the documentation of this file.
1/* Copyright (C) 2023-2025 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Felix Weiglhofer [committer] */
4#pragma once
5
6#include "CbmYaml.h"
9
10#include <xpu/defines.h>
11
12namespace cbm::algo::sts
13{
15 struct Asic {
16 int nAdc;
18 float threshold;
20 float deadTime;
21 float noise;
23
24 XPU_D float AdcToCharge(unsigned short adc) const
25 {
26 return threshold + dynamicRange / float(nAdc) * (float(adc) + 0.5f);
27 }
28
30 yaml::Property(&Asic::nAdc, "nAdc"),
31 yaml::Property(&Asic::dynamicRange, "dynamicRange"),
32 yaml::Property(&Asic::threshold, "threshold"),
33 yaml::Property(&Asic::timeResolution, "timeResolution"),
34 yaml::Property(&Asic::deadTime, "deadTime"),
35 yaml::Property(&Asic::noise, "noise"),
36 yaml::Property(&Asic::zeroNoiseRate, "zeroNoiseRate")
37 );
38 };
39
41 // Rotation + translation matrix to transform
42 // local module coordinates into global coordinate system.
43 // No need for fancy math types here. These values are just copied
44 // and moved to the GPU.
45 // TODO: thats a lie, should use glm::mat3x4
46 std::array<float, 9> rotation; // 3x3 matrix
47 std::array<float, 3> translation;
48
49 CBM_YAML_PROPERTIES(yaml::Property(&ModuleTransform::rotation, "rotation", "Rotation matrix", YAML::Flow),
50 yaml::Property(&ModuleTransform::translation, "translation", "Translation vector",
51 YAML::Flow));
52 };
53
54 struct Module {
55 int32_t address;
56 float dY;
57 float pitch;
58 float stereoF;
59 float stereoB;
60 float lorentzF;
61 float lorentzB;
63
64 CBM_YAML_PROPERTIES(yaml::Property(&Module::address, "address", "Hardware Address", YAML::Hex),
65 yaml::Property(&Module::dY, "dY"), yaml::Property(&Module::pitch, "pitch"),
66 yaml::Property(&Module::stereoF, "stereoF"), yaml::Property(&Module::stereoB, "stereoB"),
67 yaml::Property(&Module::lorentzF, "lorentzF"), yaml::Property(&Module::lorentzB, "lorentzB"),
68 yaml::Property(&Module::localToGlobal, "localToGlobal"));
69 };
70
73 std::vector<Module> modules;
74 LandauTable landauTable; // Landau table for hitfinder, read from a seperate file
75
77 yaml::Property(&HitfinderPars::asic, "asic",
78 "Asic definitions. Currently assumes same parameters for all asics."),
79 yaml::Property(&HitfinderPars::nChannels, "nChannels",
80 "Total number of channels per module. Hitfinder assumes nChannels / 2 channels per side."),
81 yaml::Property(&HitfinderPars::modules, "modules"));
82 };
83} // namespace cbm::algo::sts
84
#define CBM_YAML_EXTERN_DECL(type)
Declare the external instantiation of the Read and Dump functions for a type.
Definition CbmYaml.h:342
XPU_D float AdcToCharge(unsigned short adc) const
CBM_YAML_PROPERTIES(yaml::Property(&Asic::nAdc, "nAdc"), yaml::Property(&Asic::dynamicRange, "dynamicRange"), yaml::Property(&Asic::threshold, "threshold"), yaml::Property(&Asic::timeResolution, "timeResolution"), yaml::Property(&Asic::deadTime, "deadTime"), yaml::Property(&Asic::noise, "noise"), yaml::Property(&Asic::zeroNoiseRate, "zeroNoiseRate"))
CBM_YAML_PROPERTIES(yaml::Property(&ModuleTransform::rotation, "rotation", "Rotation matrix", YAML::Flow), yaml::Property(&ModuleTransform::translation, "translation", "Translation vector", YAML::Flow))
CBM_YAML_PROPERTIES(yaml::Property(&Module::address, "address", "Hardware Address", YAML::Hex), yaml::Property(&Module::dY, "dY"), yaml::Property(&Module::pitch, "pitch"), yaml::Property(&Module::stereoF, "stereoF"), yaml::Property(&Module::stereoB, "stereoB"), yaml::Property(&Module::lorentzF, "lorentzF"), yaml::Property(&Module::lorentzB, "lorentzB"), yaml::Property(&Module::localToGlobal, "localToGlobal"))
std::vector< Module > modules
CBM_YAML_PROPERTIES(yaml::Property(&HitfinderPars::asic, "asic", "Asic definitions. Currently assumes same parameters for all asics."), yaml::Property(&HitfinderPars::nChannels, "nChannels", "Total number of channels per module. Hitfinder assumes nChannels / 2 channels per side."), yaml::Property(&HitfinderPars::modules, "modules"))