Skip to content

Commit c5a388f

Browse files
authored
[ALICE3] Correctly handle response for short lived particles that do not reach tof layers in otf tof (#18270)
1 parent 91215a4 commit c5a388f

2 files changed

Lines changed: 46 additions & 5 deletions

File tree

‎ALICE3/DataModel/OTFTOF.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ DECLARE_SOA_COLUMN(OuterTOFExpectedTimeDe, outerTOFExpectedTimeDe, float); //!
7979
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeTr, outerTOFExpectedTimeTr, float); //! Reconstructed expected time at the OuterTOF for the Triton mass hypotheses
8080
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeHe3, outerTOFExpectedTimeHe3, float); //! Reconstructed expected time at the OuterTOF for the Helium3 mass hypotheses
8181
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeAl, outerTOFExpectedTimeAl, float); //! Reconstructed expected time at the OuterTOF for the Alpha mass hypotheses
82+
DECLARE_SOA_COLUMN(HasInnerTOF, hasInnerTOF, bool); //! InnerTOF short-lived values are filled (false if dummy)
83+
DECLARE_SOA_COLUMN(HasOuterTOF, hasOuterTOF, bool); //! OuterTOF short-lived values are filled (false if dummy)
8284
DECLARE_SOA_DYNAMIC_COLUMN(NSigmaInnerTOF, nSigmaInnerTOF, //! General function to get the nSigma for the InnerTOF
8385
[](const float el,
8486
const float mu,
@@ -260,10 +262,15 @@ DECLARE_SOA_TABLE(UpgradeTofShortLiveds, "AOD", "UPGRTOFSHRTLVD",
260262
upgrade_tof::OuterTOFExpectedTimeXi,
261263
upgrade_tof::OuterTOFExpectedTimeOm);
262264

265+
DECLARE_SOA_TABLE(UpgradeTofShortLivedSignals, "AOD", "UPGRTOFSLSIGNAL",
266+
upgrade_tof::HasInnerTOF,
267+
upgrade_tof::HasOuterTOF);
268+
263269
using UpgradeTofMC = UpgradeTofMCs::iterator;
264270
using UpgradeTof = UpgradeTofs::iterator;
265271
using UpgradeTofExpectedTime = UpgradeTofExpectedTimes::iterator;
266272
using UpgradeTofShortLived = UpgradeTofShortLiveds::iterator;
273+
using UpgradeTofShortLivedSignal = UpgradeTofShortLivedSignals::iterator;
267274

268275
} // namespace o2::aod
269276

‎ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx‎

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "ALICE3/Core/TrackUtilities.h"
3131
#include "ALICE3/DataModel/OTFCollision.h"
3232
#include "ALICE3/DataModel/OTFTOF.h"
33+
#include "ALICE3/DataModel/tracksAlice3.h"
3334
#include "Common/Core/trackUtilities.h"
3435

3536
#include <CCDB/BasicCCDBManager.h>
@@ -77,6 +78,7 @@ struct OnTheFlyTofPid {
7778
Produces<aod::UpgradeTof> upgradeTof;
7879
Produces<aod::UpgradeTofExpectedTime> upgradeTofExpectedTime;
7980
Produces<aod::UpgradeTofShortLived> upgradeTofShortLived;
81+
Produces<aod::UpgradeTofShortLivedSignal> upgradeTofShortLivedSignal;
8082

8183
// necessary for particle charges
8284
Service<o2::framework::O2DatabasePDG> pdgDatabase{};
@@ -103,6 +105,7 @@ struct OnTheFlyTofPid {
103105
Configurable<float> multiplicityEtaRange{"multiplicityEtaRange", 0.800000012, "eta range to compute the multiplicity"};
104106
Configurable<bool> flagIncludeTrackTimeRes{"flagIncludeTrackTimeRes", true, "flag to include or exclude track time resolution"};
105107
Configurable<bool> flagTOFLoadDelphesLUTs{"flagTOFLoadDelphesLUTs", false, "flag to load Delphes LUTs for tracking correction (use recoTrack parameters if false)"};
108+
Configurable<float> shortLivedRadiusTolerance{"shortLivedRadiusTolerance", 0.1f, "tolerance (cm) when checking if a TOF layer is within the innermost and outermost track update of short-lived particles"};
106109
} simConfig;
107110

108111
struct : ConfigurableGroup {
@@ -211,6 +214,39 @@ struct OnTheFlyTofPid {
211214
particleHe,
212215
particleAl};
213216

217+
template <typename TTrack>
218+
void fillShortLivedTables(const TTrack& track,
219+
std::array<float, NParticles> nSigmaInnerTOF,
220+
std::array<float, NParticles> nSigmaOuterTOF,
221+
std::array<float, NParticles> expectedTimeInnerTOF,
222+
std::array<float, NParticles> expectedTimeOuterTOF,
223+
const std::pair<float, float>& trackLengthInnerTOF,
224+
const std::pair<float, float>& trackLengthOuterTOF)
225+
{
226+
const auto isWithinTrackUpdates = [&](const float tofRadius) {
227+
return (track.trackIU() - simConfig.shortLivedRadiusTolerance <= tofRadius) && (tofRadius <= track.trackOU() + simConfig.shortLivedRadiusTolerance);
228+
};
229+
230+
const bool hasInnerTOF = isWithinTrackUpdates(simConfig.innerTOFRadius) && trackLengthInnerTOF.first > 0 && trackLengthInnerTOF.second > 0;
231+
const bool hasOuterTOF = isWithinTrackUpdates(simConfig.outerTOFRadius) && trackLengthOuterTOF.first > 0 && trackLengthOuterTOF.second > 0;
232+
static constexpr float DummyValue = -999.f;
233+
for (const int ii : {Sp, Sm, Xi, Om}) {
234+
if (!hasInnerTOF) {
235+
nSigmaInnerTOF[ii] = DummyValue;
236+
expectedTimeInnerTOF[ii] = DummyValue;
237+
}
238+
if (!hasOuterTOF) {
239+
nSigmaOuterTOF[ii] = DummyValue;
240+
expectedTimeOuterTOF[ii] = DummyValue;
241+
}
242+
}
243+
upgradeTofShortLived(nSigmaInnerTOF[Sp], nSigmaInnerTOF[Sm], nSigmaInnerTOF[Xi], nSigmaInnerTOF[Om],
244+
nSigmaOuterTOF[Sp], nSigmaOuterTOF[Sm], nSigmaOuterTOF[Xi], nSigmaOuterTOF[Om],
245+
expectedTimeInnerTOF[Sp], expectedTimeInnerTOF[Sm], expectedTimeInnerTOF[Xi], expectedTimeInnerTOF[Om],
246+
expectedTimeOuterTOF[Sp], expectedTimeOuterTOF[Sm], expectedTimeOuterTOF[Xi], expectedTimeOuterTOF[Om]);
247+
upgradeTofShortLivedSignal(hasInnerTOF, hasOuterTOF);
248+
}
249+
214250
bool doQaForParticle(const int pdgCode)
215251
{
216252
return std::find(plotsConfig.particlesForQa.value.begin(), plotsConfig.particlesForQa.value.end(), std::abs(pdgCode)) != plotsConfig.particlesForQa.value.end();
@@ -652,7 +688,7 @@ struct OnTheFlyTofPid {
652688
}
653689

654690
void process(soa::Join<aod::Collisions, aod::McCollisionLabels, aod::OTFLUTConfigId>::iterator const& collision,
655-
soa::Join<aod::Tracks, aod::TracksCov, aod::McTrackLabels> const& tracks,
691+
soa::Join<aod::Tracks, aod::TracksCov, aod::McTrackLabels, aod::TracksAlice3> const& tracks,
656692
aod::McParticles const&,
657693
aod::McCollisions const&)
658694
{
@@ -971,10 +1007,8 @@ struct OnTheFlyTofPid {
9711007
measuredTimeOuterTOF, trackLengthRecoOuterTOF);
9721008
upgradeTofExpectedTime(expectedTimeInnerTOF[El], expectedTimeInnerTOF[Mu], expectedTimeInnerTOF[Pi], expectedTimeInnerTOF[Ka], expectedTimeInnerTOF[Pr], expectedTimeInnerTOF[De], expectedTimeInnerTOF[Tr], expectedTimeInnerTOF[He], expectedTimeInnerTOF[Al],
9731009
expectedTimeOuterTOF[El], expectedTimeOuterTOF[Mu], expectedTimeOuterTOF[Pi], expectedTimeOuterTOF[Ka], expectedTimeOuterTOF[Pr], expectedTimeOuterTOF[De], expectedTimeOuterTOF[Tr], expectedTimeOuterTOF[He], expectedTimeOuterTOF[Al]);
974-
upgradeTofShortLived(nSigmaInnerTOF[Sp], nSigmaInnerTOF[Sm], nSigmaInnerTOF[Xi], nSigmaInnerTOF[Om],
975-
nSigmaOuterTOF[Sp], nSigmaOuterTOF[Sm], nSigmaOuterTOF[Xi], nSigmaOuterTOF[Om],
976-
expectedTimeInnerTOF[Sp], expectedTimeInnerTOF[Sm], expectedTimeInnerTOF[Xi], expectedTimeInnerTOF[Om],
977-
expectedTimeOuterTOF[Sp], expectedTimeOuterTOF[Sm], expectedTimeOuterTOF[Xi], expectedTimeOuterTOF[Om]);
1010+
fillShortLivedTables(track, nSigmaInnerTOF, nSigmaOuterTOF, expectedTimeInnerTOF, expectedTimeOuterTOF,
1011+
trkWithTime.mTrackLengthInnerTOF, trkWithTime.mTrackLengthOuterTOF);
9781012
}
9791013

9801014
if (trackWithTimeIndex != tracks.size()) {

0 commit comments

Comments
 (0)