Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ALICE3/DataModel/OTFTOF.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ DECLARE_SOA_COLUMN(OuterTOFExpectedTimeDe, outerTOFExpectedTimeDe, float); //!
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeTr, outerTOFExpectedTimeTr, float); //! Reconstructed expected time at the OuterTOF for the Triton mass hypotheses
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeHe3, outerTOFExpectedTimeHe3, float); //! Reconstructed expected time at the OuterTOF for the Helium3 mass hypotheses
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeAl, outerTOFExpectedTimeAl, float); //! Reconstructed expected time at the OuterTOF for the Alpha mass hypotheses
DECLARE_SOA_COLUMN(HasInnerTOF, hasInnerTOF, bool); //! InnerTOF short-lived values are filled (false if dummy)
DECLARE_SOA_COLUMN(HasOuterTOF, hasOuterTOF, bool); //! OuterTOF short-lived values are filled (false if dummy)
DECLARE_SOA_DYNAMIC_COLUMN(NSigmaInnerTOF, nSigmaInnerTOF, //! General function to get the nSigma for the InnerTOF
[](const float el,
const float mu,
Expand Down Expand Up @@ -260,10 +262,15 @@ DECLARE_SOA_TABLE(UpgradeTofShortLiveds, "AOD", "UPGRTOFSHRTLVD",
upgrade_tof::OuterTOFExpectedTimeXi,
upgrade_tof::OuterTOFExpectedTimeOm);

DECLARE_SOA_TABLE(UpgradeTofShortLivedSignals, "AOD", "UPGRTOFSLSIGNAL",
upgrade_tof::HasInnerTOF,
upgrade_tof::HasOuterTOF);

using UpgradeTofMC = UpgradeTofMCs::iterator;
using UpgradeTof = UpgradeTofs::iterator;
using UpgradeTofExpectedTime = UpgradeTofExpectedTimes::iterator;
using UpgradeTofShortLived = UpgradeTofShortLiveds::iterator;
using UpgradeTofShortLivedSignal = UpgradeTofShortLivedSignals::iterator;

} // namespace o2::aod

Expand Down
44 changes: 39 additions & 5 deletions ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "ALICE3/Core/TrackUtilities.h"
#include "ALICE3/DataModel/OTFCollision.h"
#include "ALICE3/DataModel/OTFTOF.h"
#include "ALICE3/DataModel/tracksAlice3.h"
#include "Common/Core/trackUtilities.h"

#include <CCDB/BasicCCDBManager.h>
Expand Down Expand Up @@ -77,6 +78,7 @@ struct OnTheFlyTofPid {
Produces<aod::UpgradeTof> upgradeTof;
Produces<aod::UpgradeTofExpectedTime> upgradeTofExpectedTime;
Produces<aod::UpgradeTofShortLived> upgradeTofShortLived;
Produces<aod::UpgradeTofShortLivedSignal> upgradeTofShortLivedSignal;

// necessary for particle charges
Service<o2::framework::O2DatabasePDG> pdgDatabase{};
Expand All @@ -103,6 +105,7 @@ struct OnTheFlyTofPid {
Configurable<float> multiplicityEtaRange{"multiplicityEtaRange", 0.800000012, "eta range to compute the multiplicity"};
Configurable<bool> flagIncludeTrackTimeRes{"flagIncludeTrackTimeRes", true, "flag to include or exclude track time resolution"};
Configurable<bool> flagTOFLoadDelphesLUTs{"flagTOFLoadDelphesLUTs", false, "flag to load Delphes LUTs for tracking correction (use recoTrack parameters if false)"};
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"};
} simConfig;

struct : ConfigurableGroup {
Expand Down Expand Up @@ -211,6 +214,39 @@ struct OnTheFlyTofPid {
particleHe,
particleAl};

template <typename TTrack>
void fillShortLivedTables(const TTrack& track,
std::array<float, NParticles> nSigmaInnerTOF,
std::array<float, NParticles> nSigmaOuterTOF,
std::array<float, NParticles> expectedTimeInnerTOF,
std::array<float, NParticles> expectedTimeOuterTOF,
const std::pair<float, float>& trackLengthInnerTOF,
const std::pair<float, float>& trackLengthOuterTOF)
{
const auto isWithinTrackUpdates = [&](const float tofRadius) {
return (track.trackIU() - simConfig.shortLivedRadiusTolerance <= tofRadius) && (tofRadius <= track.trackOU() + simConfig.shortLivedRadiusTolerance);
};

const bool hasInnerTOF = isWithinTrackUpdates(simConfig.innerTOFRadius) && trackLengthInnerTOF.first > 0 && trackLengthInnerTOF.second > 0;
const bool hasOuterTOF = isWithinTrackUpdates(simConfig.outerTOFRadius) && trackLengthOuterTOF.first > 0 && trackLengthOuterTOF.second > 0;
static constexpr float DummyValue = -999.f;
for (const int ii : {Sp, Sm, Xi, Om}) {
if (!hasInnerTOF) {
nSigmaInnerTOF[ii] = DummyValue;
expectedTimeInnerTOF[ii] = DummyValue;
}
if (!hasOuterTOF) {
nSigmaOuterTOF[ii] = DummyValue;
expectedTimeOuterTOF[ii] = DummyValue;
}
}
upgradeTofShortLived(nSigmaInnerTOF[Sp], nSigmaInnerTOF[Sm], nSigmaInnerTOF[Xi], nSigmaInnerTOF[Om],
nSigmaOuterTOF[Sp], nSigmaOuterTOF[Sm], nSigmaOuterTOF[Xi], nSigmaOuterTOF[Om],
expectedTimeInnerTOF[Sp], expectedTimeInnerTOF[Sm], expectedTimeInnerTOF[Xi], expectedTimeInnerTOF[Om],
expectedTimeOuterTOF[Sp], expectedTimeOuterTOF[Sm], expectedTimeOuterTOF[Xi], expectedTimeOuterTOF[Om]);
upgradeTofShortLivedSignal(hasInnerTOF, hasOuterTOF);
}

bool doQaForParticle(const int pdgCode)
{
return std::find(plotsConfig.particlesForQa.value.begin(), plotsConfig.particlesForQa.value.end(), std::abs(pdgCode)) != plotsConfig.particlesForQa.value.end();
Expand Down Expand Up @@ -652,7 +688,7 @@ struct OnTheFlyTofPid {
}

void process(soa::Join<aod::Collisions, aod::McCollisionLabels, aod::OTFLUTConfigId>::iterator const& collision,
soa::Join<aod::Tracks, aod::TracksCov, aod::McTrackLabels> const& tracks,
soa::Join<aod::Tracks, aod::TracksCov, aod::McTrackLabels, aod::TracksAlice3> const& tracks,
aod::McParticles const&,
aod::McCollisions const&)
{
Expand Down Expand Up @@ -971,10 +1007,8 @@ struct OnTheFlyTofPid {
measuredTimeOuterTOF, trackLengthRecoOuterTOF);
upgradeTofExpectedTime(expectedTimeInnerTOF[El], expectedTimeInnerTOF[Mu], expectedTimeInnerTOF[Pi], expectedTimeInnerTOF[Ka], expectedTimeInnerTOF[Pr], expectedTimeInnerTOF[De], expectedTimeInnerTOF[Tr], expectedTimeInnerTOF[He], expectedTimeInnerTOF[Al],
expectedTimeOuterTOF[El], expectedTimeOuterTOF[Mu], expectedTimeOuterTOF[Pi], expectedTimeOuterTOF[Ka], expectedTimeOuterTOF[Pr], expectedTimeOuterTOF[De], expectedTimeOuterTOF[Tr], expectedTimeOuterTOF[He], expectedTimeOuterTOF[Al]);
upgradeTofShortLived(nSigmaInnerTOF[Sp], nSigmaInnerTOF[Sm], nSigmaInnerTOF[Xi], nSigmaInnerTOF[Om],
nSigmaOuterTOF[Sp], nSigmaOuterTOF[Sm], nSigmaOuterTOF[Xi], nSigmaOuterTOF[Om],
expectedTimeInnerTOF[Sp], expectedTimeInnerTOF[Sm], expectedTimeInnerTOF[Xi], expectedTimeInnerTOF[Om],
expectedTimeOuterTOF[Sp], expectedTimeOuterTOF[Sm], expectedTimeOuterTOF[Xi], expectedTimeOuterTOF[Om]);
fillShortLivedTables(track, nSigmaInnerTOF, nSigmaOuterTOF, expectedTimeInnerTOF, expectedTimeOuterTOF,
trkWithTime.mTrackLengthInnerTOF, trkWithTime.mTrackLengthOuterTOF);
}

if (trackWithTimeIndex != tracks.size()) {
Expand Down
Loading