ARTEMIS-CRIB
 
Loading...
Searching...
No Matches
TMUXPositionConverter.h
Go to the documentation of this file.
1/**
2 * @file TMUXPositionConverter.h
3 * @brief
4 * @author Kodai Okawa <okawa@cns.s.u-tokyo.ac.jp>
5 * @date 2022-01-30 11:50:01
6 * @note last modified: 2025-01-08 10:31:54
7 * @details
8 */
9
10#ifndef CRIB_TMUXPOSITIONCONVERTER_H
11#define CRIB_TMUXPOSITIONCONVERTER_H
12
13#include <TConverterBase.h>
14
15namespace art::crib {
16
17/**
18 * @class TMUXPositionConverter
19 * @brief A class for loading and converting MUX position parameters.
20 *
21 * The TMUXPositionConverter class provides functionality to load numeric parameters
22 * from a file and convert MUX position signals into silicon-strip detector
23 * strip numbers using binary search. It inherits from TConverterBase.
24 *
25 * ### Example Steering File
26 *
27 * ```yaml
28 * Processor:
29 * - name: MyTParameterArrayLoader
30 * type: art::TParameterArrayLoader
31 * parameter:
32 * FileFormat: text # [TString] file format : text (default), yaml
33 * FileName: path/to/file # [TString] input filename
34 * Name: parameter # [TString] name of parameter array output
35 * OutputTransparency: 0 # [Bool_t] Output is persistent if false (default)
36 * Type: TParameterObject # [TString] type(class) of parameter
37 * Verbose: 1 # [Int_t] verbose level (default 1 : non quiet)
38 * ```
39 */
41 public:
42 /**
43 * @brief Default constructor.
44 */
46
47 /**
48 * @brief Default destructor.
49 */
51
52 /**
53 * @brief Converts a value based on the loaded parameters.
54 * @param val The input value to be converted.
55 * @return The index of the boundary, or kInvalidI if the value is out of range
56 * or if no parameters have been loaded.
57 */
58 Double_t Convert(Double_t val) const override;
59
60 /**
61 * @brief Loads numeric parameters from a string.
62 * @param str A TString containing the parameters to load.
63 * @return True if parameters were successfully loaded; otherwise, false.
64 */
65 Bool_t LoadString(const TString &str) override;
66
67 /**
68 * @brief Prints the loaded parameters.
69 * @param opt Optional string parameter (currently unused).
70 */
71 void Print(Option_t *opt = "") const override;
72
73 private:
74 std::vector<Double_t> fParams; ///< A vector to store the loaded numeric parameters.
75
76 ClassDefOverride(TMUXPositionConverter, 2); ///< ROOT macro for class definition.
77};
78} // namespace art::crib
79
80#endif // CRIB_TMUXPOSITIONCONVERTER_H
A class for loading and converting MUX position parameters.
~TMUXPositionConverter() override
Default destructor.
std::vector< Double_t > fParams
A vector to store the loaded numeric parameters.
Bool_t LoadString(const TString &str) override
Loads numeric parameters from a string.
TMUXPositionConverter()
Default constructor.
Double_t Convert(Double_t val) const override
Converts a value based on the loaded parameters.
ClassDefOverride(TMUXPositionConverter, 2)
ROOT macro for class definition.
void Print(Option_t *opt="") const override
Prints the loaded parameters.
return to the guide