CbmRoot
Loading...
Searching...
No Matches
HitfinderPars.h
Go to the documentation of this file.
1/* Copyright (C) 2023 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 "Definitions.h"
7#include "LandauTable.h"
8#include "yaml/Property.h"
9#include "yaml/Yaml.h"
10
11#include <xpu/defines.h>
12
13namespace cbm::algo::sts
14{
16 struct Asic {
17 int nAdc;
19 float threshold;
21 float deadTime;
22 float noise;
24
25 XPU_D float AdcToCharge(unsigned short adc) const
26 {
27 return threshold + dynamicRange / float(nAdc) * (float(adc) + 0.5f);
28 }
29
31 yaml::Property(&Asic::nAdc, "nAdc"),
32 yaml::Property(&Asic::dynamicRange, "dynamicRange"),
33 yaml::Property(&Asic::threshold, "threshold"),
34 yaml::Property(&Asic::timeResolution, "timeResolution"),
35 yaml::Property(&Asic::deadTime, "deadTime"),
36 yaml::Property(&Asic::noise, "noise"),
37 yaml::Property(&Asic::zeroNoiseRate, "zeroNoiseRate")
38 );
39 };
40
42 // Rotation + translation matrix to transform
43 // local module coordinates into global coordinate system.
44 // No need for fancy math types here. These values are just copied
45 // and moved to the GPU.
46 // TODO: thats a lie, should use glm::mat3x4
47 std::array<float, 9> rotation; // 3x3 matrix
48 std::array<float, 3> translation;
49
50 CBM_YAML_PROPERTIES(yaml::Property(&ModuleTransform::rotation, "rotation", "Rotation matrix", YAML::Flow),
51 yaml::Property(&ModuleTransform::translation, "translation", "Translation vector",
52 YAML::Flow));
53 };
54
55 struct Module {
56 int32_t address;
57 float dY;
58 float pitch;
59 float stereoF;
60 float stereoB;
61 float lorentzF;
62 float lorentzB;
64
65 CBM_YAML_PROPERTIES(yaml::Property(&Module::address, "address", "Hardware Address", YAML::Hex),
69 yaml::Property(&Module::localToGlobal, "localToGlobal"));
70 };
71
74 std::vector<Module> modules;
75 LandauTable landauTable; // Landau table for hitfinder, read from a seperate file
76
79 "Asic definitions. Currently assumes same parameters for all asics."),
81 "Total number of channels per module. Hitfinder assumes nChannels / 2 channels per side."),
83 };
84} // namespace cbm::algo::sts
85
#define CBM_YAML_EXTERN_DECL(type)
Declare the external instantiation of the Read and Dump functions for a type.
Definition Yaml.h:297
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"))