Skip to content

Commit ce21fdb

Browse files
authored
Update onTheFlyRichPid.cxx
1 parent 372e7ab commit ce21fdb

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "CCDB/BasicCCDBManager.h"
4242
#include "CCDB/CcdbApi.h"
4343
#include "CommonConstants/GeomConstants.h"
44+
#include "CommonConstants/MathConstants.h"
4445
#include "CommonConstants/PhysicsConstants.h"
4546
#include "CommonUtils/NameConf.h"
4647
#include "DataFormatsCalibration/MeanVertexObject.h"
@@ -506,7 +507,7 @@ struct OnTheFlyRichPid {
506507
/// \param n the refractive index of the considered sector
507508
/// \param angle the output angle (passed by reference)
508509
/// \return true if particle is above the threshold and enough photons, false otherwise
509-
bool CherenkovAngle(const float momentum, const float mass, const float n, float& angle)
510+
bool cherenkovAngle(const float momentum, const float mass, const float n, float& angle)
510511
{
511512
if (momentum > mass / std::sqrt(n * n - 1.0)) { // Check if particle is above the threshold
512513
// Calculate angle
@@ -539,7 +540,7 @@ struct OnTheFlyRichPid {
539540

540541
/// returns angular resolution for considered track eta
541542
/// \param eta the pseudorapidity of the tarck (assuming primary vertex at origin)
542-
float AngularResolution(float eta)
543+
float angularResolution(float eta)
543544
{
544545
// Vectors for sampling (USE ANALYTICAL EXTRAPOLATION FOR BETTER RESULTS)
545546
static constexpr float etaSampling[] = {-2.000000, -1.909740, -1.731184, -1.552999, -1.375325, -1.198342, -1.022276, -0.847390, -0.673976, -0.502324, -0.332683, -0.165221, 0.000000, 0.165221, 0.332683, 0.502324, 0.673976, 0.847390, 1.022276, 1.198342, 1.375325, 1.552999, 1.731184, 1.909740, 2.000000};
@@ -628,30 +629,30 @@ struct OnTheFlyRichPid {
628629
const float sinPhi = std::sin(phiC);
629630
const float cosPhi = std::cos(phiC);
630631
// const float ze = thicknessRad / (2. * zP);
631-
const float az = zP * cosThetaCherenkov - xP * sinThetaCherenkov * cosPhi;
632-
const float e3z = std::sqrt(az * az + (nGas / n) * (nGas / n) - 1.);
632+
const float aZ = zP * cosThetaCherenkov - xP * sinThetaCherenkov * cosPhi;
633+
const float e3Z = std::sqrt(aZ * aZ + (nGas / n) * (nGas / n) - 1.);
633634
const float Z = thicknessGas;
634-
const float alpha = e3z / az;
635-
const float etac = e3z * n * n;
635+
const float alpha = e3Z / aZ;
636+
const float etac = e3Z * n * n;
636637
const float k = thicknessRad / (2. * Z);
637638
const float m = 1. / (n * n);
638639
const float lambda = (1. + k * alpha * alpha * alpha) / (1. + k * alpha);
639640
// Derivative d(thetaCherenkov)/dx
640641
const float temp1 = etac / Z;
641-
const float temp2 = alpha * e3z * cosPhi;
642+
const float temp2 = alpha * e3Z * cosPhi;
642643
const float temp3 = xP * sinThetaCherenkov * sinPhi * sinPhi;
643644
const float dThetaX = temp1 * (temp2 - temp3);
644645
// Derivative d(thetaCherenkov)/dy
645646
const float temp4 = etac * sinPhi / Z;
646-
const float temp5 = cosThetaCherenkov - zP * (1 - m) / az;
647+
const float temp5 = cosThetaCherenkov - zP * (1 - m) / aZ;
647648
const float dThetaY = temp4 * temp5;
648649
// Derivative d(thetaCherenkov)/dze
649650
const float temp8 = etac * sinThetaCherenkov;
650651
const float temp9 = Z * (1.0 + k * alpha * alpha * alpha * n * n);
651652
const float temp10 = alpha * alpha * (1.0 - xP * xP * sinPhi * sinPhi) + lambda * xP * xP * sinPhi * sinPhi;
652653
const float dThetaZe = temp8 * temp10 / temp9;
653654
// Derivative d(thetaCherenkov)/dn
654-
const float dThetaN = zP / (n * az * sinThetaCherenkov);
655+
const float dThetaN = zP / (n * aZ * sinThetaCherenkov);
655656
// RMS wavelength (using Sellmeier formula with measured aerogel parameters)
656657
const float a0 = 0.0616;
657658
const float w0 = 56.5;
@@ -681,14 +682,14 @@ struct OnTheFlyRichPid {
681682
// Fraction of photons in rings (to account loss close to sector boundary in projective geometry)
682683
const float sinThetaCherenkovSquared = sinThetaCherenkov * sinThetaCherenkov;
683684
const float radius = (thicknessRad / 2.0) * std::tan(thetaCherenkov) + thicknessGas * std::tan(std::asin((n / nGas) * sinThetaCherenkov));
684-
const float N0 = 24. * thicknessRad / 2.; // photons for N = 1.03 at saturation ( 24/2 factor per radiator cm )
685+
const float n0 = 24. * thicknessRad / 2.; // photons for N = 1.03 at saturation ( 24/2 factor per radiator cm )
685686
const float sinAngle = std::sin(std::acos(1. / 1.03));
686687
const float sinAngleSquared = sinAngle * sinAngle;
687688
const float multiplicitySpectrumFactor = sinThetaCherenkovSquared / sinAngleSquared; // scale multiplicity w.r.t. N = 1.03 at saturation
688689
// Considering average resolution (integrated over the sector)
689-
// float nPhotons = (tileZlength / 2.0 > radius) ? N0 * multiplicitySpectrumFactor * (1.-(2.0*radius)/(o2::constants::math::PI*tileZlength)) : N0 * multiplicitySpectrumFactor * (1.-(2.0*radius)/(o2::constants::math::PI*tileZlength) - (2.0/(tileZlength*o2::constants::math::PI))*(-(tileZlength/(2.0))*std::acos(tileZlength/(2.0*radius)) + radius*std::sqrt(1.-std::pow(tileZlength/(2.0*radius),2.0))));
690+
// float nPhotons = (tileZlength / 2.0 > radius) ? n0 * multiplicitySpectrumFactor * (1.-(2.0*radius)/(o2::constants::math::PI*tileZlength)) : n0 * multiplicitySpectrumFactor * (1.-(2.0*radius)/(o2::constants::math::PI*tileZlength) - (2.0/(tileZlength*o2::constants::math::PI))*(-(tileZlength/(2.0))*std::acos(tileZlength/(2.0*radius)) + radius*std::sqrt(1.-std::pow(tileZlength/(2.0*radius),2.0))));
690691
// Considering "exact" resolution (eta by eta)
691-
const float nPhotons = N0 * multiplicitySpectrumFactor * fractionPhotonsProjectiveRICH(eta, tileZlength, radius);
692+
const float nPhotons = n0 * multiplicitySpectrumFactor * fractionPhotonsProjectiveRICH(eta, tileZlength, radius);
692693
if (nPhotons <= kErrorValue + 1)
693694
return kErrorValue;
694695
// Ring angular resolution
@@ -797,12 +798,12 @@ struct OnTheFlyRichPid {
797798
}
798799

799800
float expectedAngleBarrelRich = kErrorValue;
800-
const bool expectedAngleBarrelRichOk = CherenkovAngle(o2track.getP(), pdgInfo->Mass(), aerogelRindex[iSecor], expectedAngleBarrelRich);
801+
const bool expectedAngleBarrelRichOk = cherenkovAngle(o2track.getP(), pdgInfo->Mass(), aerogelRindex[iSecor], expectedAngleBarrelRich);
801802
if (!expectedAngleBarrelRichOk) {
802803
fillDummyValues();
803804
continue; // Particle is below the threshold or not enough photons
804805
}
805-
// float barrelRICHAngularResolution = AngularResolution(o2track.getEta());
806+
// float barrelRICHAngularResolution = angularResolution(o2track.getEta());
806807
const float barrelRICHAngularResolution = extractRingAngularResolution(o2track.getEta(), aerogelRindex[iSecor], bRichGapRefractiveIndex, bRichRadiatorThickness, gapThickness[iSecor], bRICHPixelSize, expectedAngleBarrelRich, photodetrctorLength[iSecor]);
807808
const float projectiveRadiatorRadius = radiusRipple(o2track.getEta(), iSecor);
808809
bool flagReachesRadiator = false;
@@ -844,7 +845,7 @@ struct OnTheFlyRichPid {
844845
for (int ii = 0; ii < kNspecies; ii++) { // Loop on the particle hypotheses
845846

846847
float hypothesisAngleBarrelRich = kErrorValue;
847-
const bool hypothesisAngleBarrelRichOk = CherenkovAngle(recoTrack.getP(), masses[ii], aerogelRindex[iSecor], hypothesisAngleBarrelRich);
848+
const bool hypothesisAngleBarrelRichOk = cherenkovAngle(recoTrack.getP(), masses[ii], aerogelRindex[iSecor], hypothesisAngleBarrelRich);
848849
signalBarrelRich[ii] = hypothesisAngleBarrelRichOk; // Particle is above the threshold and enough photons
849850

850851
// Evaluate total sigma (layer + tracking resolution)

0 commit comments

Comments
 (0)