@@ -226,19 +226,19 @@ struct OnTheFlyRichPid {
226226 l_aerogel_z[i_central_mirror] = std::sqrt (1.0 + m_val * m_val) * R_min * square_size_barrel_cylinder / (std::sqrt (1.0 + m_val * m_val) * R_max - m_val * square_size_barrel_cylinder);
227227 T_r_plus_g[i_central_mirror] = R_max - R_min;
228228 float t = std::tan (std::atan (m_val) + std::atan (square_size_barrel_cylinder / (2.0 * R_max * std::sqrt (1.0 + m_val * m_val) - square_size_barrel_cylinder * m_val)));
229- theta_max[i_central_mirror] = PI / 2.0 - std::atan (t);
230- theta_min[i_central_mirror] = PI / 2.0 + std::atan (t);
229+ theta_max[i_central_mirror] = M_PI / 2.0 - std::atan (t);
230+ theta_min[i_central_mirror] = M_PI / 2.0 + std::atan (t);
231231 mProjectiveLengthInner = R_min * t;
232232 aerogel_rindex[i_central_mirror] = bRichRefractiveIndexSector[0 ];
233233 for (int i = i_central_mirror + 1 ; i < number_of_sectors_in_z; i++) {
234234 float par_a = t;
235235 float par_b = 2.0 * R_max / square_size_z;
236236 m_val = (std::sqrt (par_a * par_a * par_b * par_b + par_b * par_b - 1.0 ) + par_a * par_b * par_b) / (par_b * par_b - 1.0 );
237- theta_min[i] = PI / 2.0 - std::atan (t);
238- theta_max[2 * i_central_mirror - i] = PI / 2.0 + std::atan (t);
237+ theta_min[i] = M_PI / 2.0 - std::atan (t);
238+ theta_max[2 * i_central_mirror - i] = M_PI / 2.0 + std::atan (t);
239239 t = std::tan (std::atan (m_val) + std::atan (square_size_z / (2.0 * R_max * std::sqrt (1.0 + m_val * m_val) - square_size_z * m_val)));
240- theta_max[i] = PI / 2.0 - std::atan (t);
241- theta_min[2 * i_central_mirror - i] = PI / 2.0 + std::atan (t);
240+ theta_max[i] = M_PI / 2.0 - std::atan (t);
241+ theta_min[2 * i_central_mirror - i] = M_PI / 2.0 + std::atan (t);
242242 // Forward sectors
243243 theta_bi[i] = std::atan (m_val);
244244 R0_tilt[i] = R_max - square_size_z / 2.0 * std::sin (std::atan (m_val));
@@ -269,11 +269,11 @@ struct OnTheFlyRichPid {
269269 float par_a = t;
270270 float par_b = 2.0 * R_max / square_size_z;
271271 m_val = (std::sqrt (par_a * par_a * par_b * par_b + par_b * par_b - 1.0 ) + par_a * par_b * par_b) / (par_b * par_b - 1.0 );
272- theta_min[i] = PI / 2.0 - std::atan (t);
273- theta_max[2 * i_central_mirror - i - 1 ] = PI / 2.0 + std::atan (t);
272+ theta_min[i] = M_PI / 2.0 - std::atan (t);
273+ theta_max[2 * i_central_mirror - i - 1 ] = M_PI / 2.0 + std::atan (t);
274274 t = std::tan (std::atan (m_val) + std::atan (square_size_z / (2.0 * R_max * std::sqrt (1.0 + m_val * m_val) - square_size_z * m_val)));
275- theta_max[i] = PI / 2.0 - std::atan (t);
276- theta_min[2 * i_central_mirror - i - 1 ] = PI / 2.0 + std::atan (t);
275+ theta_max[i] = M_PI / 2.0 - std::atan (t);
276+ theta_min[2 * i_central_mirror - i - 1 ] = M_PI / 2.0 + std::atan (t);
277277 // Forward sectors
278278 theta_bi[i] = std::atan (m_val);
279279 R0_tilt[i] = R_max - square_size_z / 2.0 * std::sin (std::atan (m_val));
@@ -601,9 +601,9 @@ struct OnTheFlyRichPid {
601601 float absZ = std::hypot (radius_ripple - R_sec_rich, z_ripple - z_sec_rich);
602602 float fraction = 1 .;
603603 if (tile_z_length / 2 . - absZ < radius) {
604- fraction = fraction - (1 . / PI ) * std::acos ((tile_z_length / 2 . - absZ) / radius);
604+ fraction = fraction - (1 . / M_PI ) * std::acos ((tile_z_length / 2 . - absZ) / radius);
605605 if (tile_z_length / 2 . + absZ < radius) {
606- fraction = fraction - (1 . / PI ) * std::acos ((tile_z_length / 2 . + absZ) / radius);
606+ fraction = fraction - (1 . / M_PI ) * std::acos ((tile_z_length / 2 . + absZ) / radius);
607607 }
608608 }
609609 return fraction;
@@ -684,7 +684,7 @@ struct OnTheFlyRichPid {
684684 float N0 = 24 . * T_r / 2 .; // photons for N = 1.03 at saturation ( 24/2 factor per radiator cm )
685685 float multiplicity_spectrum_factor = std::pow (std::sin (theta_c), 2 .) / std::pow (std::sin (std::acos (1 . / 1.03 )), 2 .); // scale multiplicity w.r.t. N = 1.03 at saturation
686686 // Considering average resolution (integrated over the sector)
687- // float n_photons = (tile_z_length / 2.0 > radius) ? N0 * multiplicity_spectrum_factor * (1.-(2.0*radius)/(PI *tile_z_length)) : N0 * multiplicity_spectrum_factor * (1.-(2.0*radius)/(PI *tile_z_length) - (2.0/(tile_z_length*PI ))*(-(tile_z_length/(2.0))*std::acos(tile_z_length/(2.0*radius)) + radius*std::sqrt(1.-std::pow(tile_z_length/(2.0*radius),2.0))));
687+ // float n_photons = (tile_z_length / 2.0 > radius) ? N0 * multiplicity_spectrum_factor * (1.-(2.0*radius)/(M_PI *tile_z_length)) : N0 * multiplicity_spectrum_factor * (1.-(2.0*radius)/(M_PI *tile_z_length) - (2.0/(tile_z_length*M_PI ))*(-(tile_z_length/(2.0))*std::acos(tile_z_length/(2.0*radius)) + radius*std::sqrt(1.-std::pow(tile_z_length/(2.0*radius),2.0))));
688688 // Considering "exact" resolution (eta by eta)
689689 float n_photons = N0 * multiplicity_spectrum_factor * fractionPhotonsProjectiveRICH (eta, tile_z_length, radius);
690690 if (n_photons <= error_value + 1 )
0 commit comments