13#include <unordered_map>
159 auto process(
const std::vector<BarCalData>& signals,
const Cal2HitPar& hit_par) -> bool;
175 double p_value_cut) -> bool;
211 static constexpr auto parse(format_parse_context& ctx) {
return ctx.end(); }
212 template <
typename FmtContent>
215 return fmt::format_to(
216 ctn.out(),
"ModuleNum: {}, left bar: {}, right bar: {}", signal.
module_num, signal.
left, signal.
right);
224 static constexpr auto parse(format_parse_context& ctx) {
return ctx.end(); }
225 template <
typename FmtContent>
228 return fmt::format_to(
229 ctn.out(),
"slope: {}, offset: {}, p_value: {}", fit_par.
slope, fit_par.
offset, fit_par.
p_value);
237 static constexpr auto parse(format_parse_context& ctx) {
return ctx.end(); }
238 template <
typename FmtContent>
240 FmtContent& ctn)
const
242 return fmt::format_to(ctn.out(),
244 "\tx_z plane: {{{}}}\n"
245 "\ty_z plane: {{{}}}",
255 static constexpr auto parse(format_parse_context& ctx) {
return ctx.end(); }
256 template <
typename FmtContent>
259 return fmt::format_to(ctn.out(),
260 "\tx = np.array({})\n"
261 "\tx_err = np.array({})\n"
262 "\ty = np.array({})\n"
263 "\ty_err = np.array({})",
void remove_isolated_bar_signal()
Remove signals that are isolated in the plane.
auto process(const std::vector< BarCalData > &signals, const Cal2HitPar &hit_par) -> bool
Process the cal level data.
MilleDataProcessor(int num_of_modules)
auto get_track_fit_data() const -> const auto &
static auto linear_fit(const NeulandTrackDataSet &data, FitPar &fit_par, HuberRegressor &huber_regressor, double p_value_cut) -> bool
auto check_is_outlier(int module_num) const -> bool
HuberRegressor huber_regressor_
void init_data_registers(int num_of_modules)
void set_data_buffers(DataBufferType &data_buffers, const TrackInfo &track_info, const Cal2HitPar &hit_par) const
NeulandTrackInfo TrackInfo
void fill_bar_disp_dataset()
auto get_track_info() const -> const auto &
auto fit_planes(const Cal2HitPar &hit_par) -> bool
std::unordered_map< int, std::vector< MilleCalData > > data_buffers_
TrackFitDataSet track_fit_data_
void set_p_value_cut(double val)
std::unordered_map< int, std::vector< MilleCalData > > DataBufferType
Data buffer for the event data.
auto get_data() const -> const auto &
constexpr auto DEFAULT_CALIBRATION_P_VALUE_CUT
Simulation of NeuLAND Bar/Paddle.
ValueError< double > ValueErrorD
Data structure to store the cal level data for the data preprocessing.
ValueErrorD position
position of the hit along the bar direction
float residual_bar_pos
residual value against the fitted line of bar positions
bool is_outlier
check if outlier
ClassDefNV(MilleCalData, 1)
MilleCalData(const BarCalData &bar_cal_data)
int module_num
1 based bar num
float fit_diff
Difference value from the fitted line and position (time derived).
ValueErrorD z_pos
z positions
float residual
residual value against the fitted line
NeulandTrackDataSet time_data_x_z
NeulandTrackDataSet time_data_y_z
NeulandTrackDataSet bar_y_z
NeulandTrackDataSet bar_x_z
std::vector< double > vals
std::vector< double > z_errs
std::vector< double > errs
std::vector< double > z_vals
ClassDefNV(NeulandTrackInfo, 1)
TrackFitResult bar_disp_data
auto operator!=(const TrackFitPar &other) const
ClassDefNV(TrackFitPar, 1)
static constexpr auto diff_threshold
10% difference
ClassDefNV(TrackFitResult, 1)