29constexpr Float_t n_pixels_to_qdc_params[4] = {0.172, -1.31, 0.006,
57 const std::vector<Float_t>& weights) {
59 dynamic_cast<MTCDetector*
>(gROOT->GetListOfGlobals()->FindObject(
"MTC"));
61 LOG(fatal) <<
"MTCDetHit: MTCDetector not found";
69 Float_t total_light_yield = 0.0f;
70 Float_t earliest_to_A = std::numeric_limits<Float_t>::max();
71 Float_t earliest_to_B = std::numeric_limits<Float_t>::max();
72 const size_t n = points.size();
73 Float_t signal_sum = 0.0f;
74 bool hit_flag =
false;
77 if (plane_type == 2) {
84 Float_t x_temp = 0.0, y_temp = 0.0, z_temp = 0.0;
85 for (
auto* pt : points) {
86 signal_sum += pt->GetEnergyLoss();
88 Float_t arrival = pt->GetTime();
89 earliest_to_B = std::min(earliest_to_B, arrival);
94 time = gRandom->Gaus(earliest_to_B, time_res);
105 total_light_yield = 0.0f;
107 TVector3 sipmA, sipmB;
108 MTCDet->GetSiPMPosition(SiPMChan, sipmA, sipmB);
113 for (
size_t i = 0; i < n; ++i) {
114 auto* pt = points[i];
115 Float_t energy = pt->GetEnergyLoss();
116 Float_t weight = weights[i];
117 Float_t signal = energy * weight;
120 TVector3 impact(pt->GetX(), pt->GetY(), pt->GetZ());
121 const Float_t distance = (sipmB - impact).Mag();
124 Float_t light_yield = signal * 1e6f * 0.16f;
125 light_yield *= light_attenuation(distance);
126 total_light_yield += light_yield;
129 Float_t arrival = pt->GetTime() + distance * inv_signal_speed;
130 earliest_to_A = std::min(earliest_to_A, arrival);
134 const Int_t smeared_light_yield = gRandom->Poisson(total_light_yield);
135 const Float_t n_pixels = sipm_saturation(smeared_light_yield);
136 signals = n_pixels_to_qdc(n_pixels);
139 hit_flag = (smeared_light_yield > n_photons_min);
141 time = gRandom->Gaus(earliest_to_A, time_res);