ARTEMIS-CRIB
 
Loading...
Searching...
No Matches
TMUXCalibrationProcessor.h
Go to the documentation of this file.
1/**
2 * @file TMUXCalibrationProcessor.h
3 * @brief Processor for calibrating timing, charge, and position data in the MUX system.
4 * @author Kodai Okawa<okawa@cns.s.u-tokyo.ac.jp>
5 * @date 2022-01-30 11:08:53
6 * @note last modified: 2025-03-05 18:32:59
7 * @details
8 */
9
10#ifndef CRIB_TMUXCALIBRATIONPROCESSOR_H
11#define CRIB_TMUXCALIBRATIONPROCESSOR_H
12
13#include <TProcessor.h>
14
15class TClonesArray;
16
17namespace art::crib {
18
19/**
20 * @class TMUXCalibrationProcessor
21 * @brief Handles the calibration of timing, charge, and position data in the MUX system.
22 *
23 * This class reads input data from a TClonesArray, applies calibration
24 * transformations using affine converters for timing and charge,
25 * and custom MUX converters for position. The calibrated data is
26 * then stored in another TClonesArray.
27 *
28 * ### Example Steering File
29 *
30 * ```yaml
31 * Processor:
32 * - name: MyTMUXCalibrationProcessor
33 * type: art::crib::TMUXCalibrationProcessor
34 * parameter:
35 * ChargeConverterArray: no_conversion # [TString] Energy parameter object of TAffineConverter
36 * HasReflection: 0 # [Bool_t] Reverse strip order (0--7) if true
37 * InputCollection: mux_raw # [TString] Array of TMUXData objects
38 * InputIsDigital: 1 # [Bool_t] Add randomness if true
39 * OutputCollection: mux_cal # [TString] Output array of TTimingChargeData objects
40 * OutputTransparency: 0 # [Bool_t] Output is persistent if false (default)
41 * PositionConverterArray: no_conversion # [TString] Position parameter object of TMUXPositionConverter
42 * TimingConverterArray: no_conversion # [TString] Timing parameter object of TAffineConverter
43 * Verbose: 1 # [Int_t] verbose level (default 1 : non quiet)
44 * ```
45 */
47 public:
48 /**
49 * @brief Constructor.
50 */
52
53 /**
54 * @brief Destructor. Cleans up allocated resources.
55 */
57
58 /**
59 * @brief Initializes the processor by setting up input and output collections.
60 * @param col A pointer to the TEventCollection for managing data collections.
61 */
62 void Init(TEventCollection *col) override;
63
64 /**
65 * @brief Processes the input data, applies calibration, and stores the results.
66 */
67 void Process() override;
68
69 private:
70 TString fInputColName; ///< Name of the input collection.
71 TString fOutputColName; ///< Name of the output collection.
72 TClonesArray **fInData; ///<! Pointer to the input data collection.
73 TClonesArray *fOutData; ///<! Pointer to the output data collection.
74
75 TString fTimingConverterArrayName; ///< Name of the timing converter array parameter.
76 TString fChargeConverterArrayName; ///< Name of the charge converter array parameter.
77 TString fPositionConverterArrayName; ///< Name of the position converter array parameter.
78
79 TClonesArray *fTimingConverterArray; ///<! Pointer to the timing converter array.
80 TClonesArray *fChargeConverterArray; ///<! Pointer to the charge converter array.
81 TClonesArray *fPositionConverterArray; ///<! Pointer to the position converter array.
82
83 Bool_t fHasReflection; ///< Indicates whether to apply reflection to the detector ID.
84 Bool_t fInputIsDigital; ///< Indicates whether the input data is digital.
85
86 /**
87 * @brief Converts a raw position value to a detector ID using the position converter array.
88 * @param pos The raw position value to convert.
89 * @param id The index of the converter to use.
90 * @return The converted detector ID, or a default invalid value if conversion fails.
91 */
92 double ConvertPosition(double pos, int id) const;
93
94 /**
95 * @brief Calibrates a raw value (e.g., timing or charge) using the specified converter array.
96 * @param raw The raw value to calibrate.
97 * @param id The index of the converter to use.
98 * @param converterArray The array of converters to use for calibration.
99 * @return The calibrated value, or the raw value if no converter is available.
100 */
101 double CalibrateValue(double raw, int id, const TClonesArray *converterArray) const;
102
105
106 ClassDefOverride(TMUXCalibrationProcessor, 2); ///< ROOT class definition macro.
107};
108} // namespace art::crib
109
110#endif // CRIB_TMUXCALIBRATIONPROCESSOR_H
Handles the calibration of timing, charge, and position data in the MUX system.
Bool_t fHasReflection
Indicates whether to apply reflection to the detector ID.
TClonesArray * fChargeConverterArray
! Pointer to the charge converter array.
TMUXCalibrationProcessor(const TMUXCalibrationProcessor &rhs)=delete
TClonesArray * fTimingConverterArray
! Pointer to the timing converter array.
double CalibrateValue(double raw, int id, const TClonesArray *converterArray) const
Calibrates a raw value (e.g., timing or charge) using the specified converter array.
Bool_t fInputIsDigital
Indicates whether the input data is digital.
TMUXCalibrationProcessor & operator=(const TMUXCalibrationProcessor &rhs)=delete
TClonesArray * fOutData
! Pointer to the output data collection.
TString fPositionConverterArrayName
Name of the position converter array parameter.
ClassDefOverride(TMUXCalibrationProcessor, 2)
ROOT class definition macro.
TClonesArray ** fInData
! Pointer to the input data collection.
TString fChargeConverterArrayName
Name of the charge converter array parameter.
TString fTimingConverterArrayName
Name of the timing converter array parameter.
void Process() override
Processes the input data, applies calibration, and stores the results.
TString fInputColName
Name of the input collection.
double ConvertPosition(double pos, int id) const
Converts a raw position value to a detector ID using the position converter array.
TString fOutputColName
Name of the output collection.
void Init(TEventCollection *col) override
Initializes the processor by setting up input and output collections.
TClonesArray * fPositionConverterArray
! Pointer to the position converter array.
return to the guide