Skip to content

Commit 1804279

Browse files
authored
Update onTheFlyRichPid.cxx
1 parent 7ad2bd8 commit 1804279

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ struct OnTheFlyRichPid {
105105
Configurable<bool> flagIncludeTrackAngularRes{"flagIncludeTrackAngularRes", true, "flag to include or exclude track time resolution"};
106106
Configurable<float> multiplicityEtaRange{"multiplicityEtaRange", 0.800000012, "eta range to compute the multiplicity"};
107107
Configurable<bool> flagRICHLoadDelphesLUTs{"flagRICHLoadDelphesLUTs", false, "flag to load Delphes LUTs for tracking correction (use recoTrack parameters if false)"};
108+
Configurable<float> gasRadiatorRindex{"gasRadiatorRindex", 1.0006f, "gas radiator refractive index"};
109+
Configurable<float> gasRichRadiatorThickness{"gasRichRadiatorThickness", 25.f, "gas radiator thickness (cm)"};
108110
Configurable<float> bRichRefractiveIndexSector0{"bRichRefractiveIndexSector0", 1.03, "barrel RICH refractive index central(s)"}; // central(s)
109111
Configurable<float> bRichRefractiveIndexSector1{"bRichRefractiveIndexSector1", 1.03, "barrel RICH refractive index central(s)-1 and central(s)+1"}; // central(s)-1 and central(s)+1
110112
Configurable<float> bRichRefractiveIndexSector2{"bRichRefractiveIndexSector2", 1.03, "barrel RICH refractive index central(s)-2 and central(s)+2"}; // central(s)-2 and central(s)+2
@@ -505,6 +507,22 @@ struct OnTheFlyRichPid {
505507
return false; // Particle is below the threshold
506508
}
507509

510+
bool isOverTrhesholdInGasRadiator(const float momentum, const float mass)
511+
{
512+
if (momentum < mass / std::sqrt(gasRadiatorRindex * gasRadiatorRindex - 1.0)) { // Check if particle is above the threshold
513+
return false;
514+
}
515+
const float angle = std::acos(std::sqrt(momentum * momentum + mass * mass) / (momentum * gasRadiatorRindex));
516+
const float meanNumberofDetectedPhotons = 230. * std::sin(angle) * std::sin(angle) * gasRichRadiatorThickness;
517+
518+
// Require at least 3 photons on average for real angle reconstruction
519+
static constexpr float kMinPhotons = 3.f;
520+
if (meanNumberofDetectedPhotons <= kMinPhotons) {
521+
return false;
522+
}
523+
return true;
524+
}
525+
508526
/// returns linear interpolation
509527
/// \param x the eta we want the resolution for
510528
/// \param x0 the closest smaller available eta
@@ -742,9 +760,9 @@ struct OnTheFlyRichPid {
742760

743761
for (const auto& track : tracks) {
744762

745-
auto fillDummyValues = [&]() {
763+
auto fillDummyValues = [&](bool gasRich = false) {
746764
upgradeRich(kErrorValue, kErrorValue, kErrorValue, kErrorValue, kErrorValue);
747-
upgradeRichSignal(false, false, false, false, false, false);
765+
upgradeRichSignal(false, false, false, false, false, false, gasRich);
748766
};
749767

750768
// first step: find precise arrival time (if any)
@@ -770,16 +788,17 @@ struct OnTheFlyRichPid {
770788
}
771789

772790
// find track bRICH sector
773-
int iSecor = findSector(o2track.getEta());
791+
const int iSecor = findSector(o2track.getEta());
774792
if (iSecor < 0) {
775793
fillDummyValues();
776794
continue;
777795
}
778796

797+
const bool expectedAngleBarrelGasRichOk = isOverTrhesholdInGasRadiator(o2track.getP(), pdgInfo->Mass());
779798
float expectedAngleBarrelRich = kErrorValue;
780799
const bool expectedAngleBarrelRichOk = cherenkovAngle(o2track.getP(), pdgInfo->Mass(), aerogelRindex[iSecor], expectedAngleBarrelRich);
781800
if (!expectedAngleBarrelRichOk) {
782-
fillDummyValues();
801+
fillDummyValues(expectedAngleBarrelGasRichOk);
783802
continue; // Particle is below the threshold or not enough photons
784803
}
785804
// float barrelRICHAngularResolution = angularResolution(o2track.getEta());
@@ -959,7 +978,7 @@ struct OnTheFlyRichPid {
959978

960979
// Sigmas have been fully calculated. Please populate the NSigma helper table (once per track)
961980
upgradeRich(nSigmaBarrelRich[0], nSigmaBarrelRich[1], nSigmaBarrelRich[2], nSigmaBarrelRich[3], nSigmaBarrelRich[4]);
962-
upgradeRichSignal(expectedAngleBarrelRichOk, signalBarrelRich[0], signalBarrelRich[1], signalBarrelRich[2], signalBarrelRich[3], signalBarrelRich[4]);
981+
upgradeRichSignal(expectedAngleBarrelRichOk, signalBarrelRich[0], signalBarrelRich[1], signalBarrelRich[2], signalBarrelRich[3], signalBarrelRich[4], expectedAngleBarrelGasRichOk);
963982
}
964983
}
965984
};

0 commit comments

Comments
 (0)