Skip to content

Commit c6068a5

Browse files
authored
[ALICE3] Update onTheFlyRichPid.cxx (#12094)
1 parent 259e3d8 commit c6068a5

File tree

2 files changed

+33
-12
lines changed

2 files changed

+33
-12
lines changed

ALICE3/DataModel/OTFRICH.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ DECLARE_SOA_DYNAMIC_COLUMN(NSigmaRich, nSigmaRich, //! General f
5555
}
5656
});
5757

58-
DECLARE_SOA_COLUMN(HasSig, hasSig, bool); //! Has signal in the barrel rich (is particle over threshold)
59-
DECLARE_SOA_COLUMN(HasSigEl, hasSigEl, bool); //! Has nSigma electron BarrelRich (is electron over threshold)
60-
DECLARE_SOA_COLUMN(HasSigMu, hasSigMu, bool); //! Has nSigma muon BarrelRich (is muon over threshold)
61-
DECLARE_SOA_COLUMN(HasSigPi, hasSigPi, bool); //! Has nSigma pion BarrelRich (is pion over threshold)
62-
DECLARE_SOA_COLUMN(HasSigKa, hasSigKa, bool); //! Has nSigma kaon BarrelRich (is kaon over threshold)
63-
DECLARE_SOA_COLUMN(HasSigPr, hasSigPr, bool); //! Has nSigma proton BarrelRich (is proton over threshold)
58+
DECLARE_SOA_COLUMN(HasSig, hasSig, bool); //! Has signal in the barrel rich (is particle over threshold)
59+
DECLARE_SOA_COLUMN(HasSigInGas, hasSigInGas, bool); //! Has signal in the gas radiator in the barrel rich (is particle over threshold)
60+
DECLARE_SOA_COLUMN(HasSigEl, hasSigEl, bool); //! Has nSigma electron BarrelRich (is electron over threshold)
61+
DECLARE_SOA_COLUMN(HasSigMu, hasSigMu, bool); //! Has nSigma muon BarrelRich (is muon over threshold)
62+
DECLARE_SOA_COLUMN(HasSigPi, hasSigPi, bool); //! Has nSigma pion BarrelRich (is pion over threshold)
63+
DECLARE_SOA_COLUMN(HasSigKa, hasSigKa, bool); //! Has nSigma kaon BarrelRich (is kaon over threshold)
64+
DECLARE_SOA_COLUMN(HasSigPr, hasSigPr, bool); //! Has nSigma proton BarrelRich (is proton over threshold)
6465

6566
} // namespace upgrade_rich
6667
DECLARE_SOA_TABLE(UpgradeRichs, "AOD", "UPGRADERICH",
@@ -83,7 +84,8 @@ DECLARE_SOA_TABLE(UpgradeRichSignals, "AOD", "UPGRADERICHSIG",
8384
upgrade_rich::HasSigMu,
8485
upgrade_rich::HasSigPi,
8586
upgrade_rich::HasSigKa,
86-
upgrade_rich::HasSigPr);
87+
upgrade_rich::HasSigPr,
88+
upgrade_rich::HasSigInGas);
8789

8890
using UpgradeRichSignal = UpgradeRichSignals::iterator;
8991

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)