From 52766f0936f6a383b5b399dfd5c2ebb67fb1f688 Mon Sep 17 00:00:00 2001 From: Stefanie Mrozinski Date: Mon, 23 Nov 2026 15:25:27 +0100 Subject: [PATCH] adjust templates using c++ 20 concepts --- .../TableProducer/photonconversionbuilder.h | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h index 76a61b66df0..fff39a0df75 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h @@ -880,7 +880,7 @@ struct PhotonConversionBuilder { } std::pair> its_ib_Requirement = {0, {0, 1, 2}}; // no hit on 3 ITS ib layers. - template + template bool checkV0leg(TTrack const& track) { using namespace o2::pwgem::photonmeson; @@ -983,7 +983,7 @@ struct PhotonConversionBuilder { return cospaRZ; } - template + template void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, const float dcaXY, const float dcaZ) { v0legs(track.collisionId(), track.globalIndex(), track.sign(), @@ -1009,7 +1009,7 @@ struct PhotonConversionBuilder { // free legs (fillFreeLegs): after the tables are written; a track that passes the leg cuts, has a collision and the TPC (as the // finder takes them) and is the leg of no stored photon; TPC-only legs moved to their own collision as in the fit - template + template void writeFreeLegs(TCollisions const& collisions, TTracks const& tracks, std::set const& skimRejected) { std::set usedLegs; @@ -1062,7 +1062,7 @@ struct PhotonConversionBuilder { registry.fill(HIST("hNFreeLegs"), static_cast(nFree)); } - template + template void fillV0Table(TV0 const& v0, const bool filltable) { const auto& pos = v0.template posTrack_as(); @@ -1084,7 +1084,7 @@ struct PhotonConversionBuilder { // the purity score (finder LLR tables) is only needed for the finder gate and the split-leg order bool usePurity() const { return recovery.runFinder.value || dedup.resolveSplitLegs.value; } - template + template static float purityScore(TTrack const& pos, TTrack const& ele, const float cosPA3D, const float pca, const float mee, const float gap, const float psipair) { return o2::pwgem::photonmeson::finderPurityScore({cosPA3D, pca, mee, gap, std::fabs(pos.tgl() - ele.tgl()), psipair, @@ -1112,7 +1112,7 @@ struct PhotonConversionBuilder { } // fit of one leg pair with the V0 cuts - template + template void fitV0Candidate(TCollision const& collision, TTrack const& pos, TTrack const& ele, const int64_t v0Id, const bool filltable, FitOptions const& opt = {}) { using namespace o2::pwgem::photonmeson; @@ -1774,7 +1774,7 @@ struct PhotonConversionBuilder { } // finder leg: helix circle and the time window in which the track can belong to a collision (TPC-only legs: from the drift-time asymmetry) - template + template bool makeFinderLeg(TTrack const& track, TCollisions const& collisions, const int64_t bcRef, FinderLeg& leg) { using namespace o2::pwgem::photonmeson; @@ -1810,7 +1810,7 @@ struct PhotonConversionBuilder { // pairs the free legs of the whole DF (not used by any candidate unless finderFreeCollinearLegs, at least one leg without ITS); a pair that passes the geometry // (evalFinderPair) and matches a collision in z is fitted and becomes a dedup candidate with v0Id = -1 - template + template void runPhotonFinder(TCollisions const& collisions, TTracks const& tracks) { std::set usedLegs; @@ -1995,7 +1995,7 @@ struct PhotonConversionBuilder { } // two stored photons that use two pieces of one track (same tgl, compatible parameters): keep the better one - template + template void resolveSplitLegConflicts(TTracks const& tracks, DedupDiag* diag) { const auto indexOfKey = candidateIndexByKey(); @@ -2079,7 +2079,7 @@ struct PhotonConversionBuilder { // ambiguity resolver // two stored photons of one collision, close in q and in space: fit the crossed leg pairing; if both crossed photons pass and // their summed score is lower, swap - template + template void runSwapResolver(TCollisions const& collisions, TTracks const& tracks, DedupDiag* diag) { const auto indexOfKey = candidateIndexByKey(); @@ -2591,7 +2591,7 @@ struct PhotonConversionBuilder { }); } - template + template void build(TCollisions const& collisions, TV0s const& v0s, TTracks const& tracks, TBCs const&, DedupDiag* diag = nullptr) { mRelaxedKeys.clear(); @@ -2789,7 +2789,7 @@ struct PhotonConversionBuilder { }; LegMC posMC, eleMC; }; - template + template static void setMixPairLegs(MixPairPhoton& p, TLeg const& pos, TLeg const& ele) { p.posKey = {pos.sourceEventUid(), pos.mcMotherId()}; @@ -2993,7 +2993,7 @@ struct PhotonConversionBuilder { float score = 1.e9f, missT = 999.f, thetaB = 3.15f, ptBV = 0.f, lever = 0.f; int orderV = -1, legV = -1; }; - template + template BremsPointing mixBremsPointing(MixPairPhoton const& a, MixPairPhoton const& b, TLegs const& legs) const { constexpr float StepCm = 0.25f, MaxArcCm = 100.f, MarginCm = 2.f; @@ -3170,7 +3170,7 @@ struct PhotonConversionBuilder { } // data-driven bremsstrahlung template: all pairs of stored photons of one artificial event after run 2 below 500 MeV/c (normalisation), below 100 MeV/c with the - template + template void fillBremsJoint(const float type, const float cent, const float occ, std::vector const& photons, TLegs const& legs) { constexpr float MaxQNorm = 0.5f, MaxQ = 0.1f, MaxQAngle = 0.05f, DVTight = 0.1f, DTight = 0.3f, DLoose = 1.f, DNone = 100.f, AngleTight = 0.03f, AngleLoose = 0.1f, ScoreNone = 11.f, Half = 0.5f, LogFloorA = 1e-3f; @@ -3208,7 +3208,7 @@ struct PhotonConversionBuilder { } } } - template + template void fillMixSwapBrems(const float type, const float stage, const int64_t colId, std::vector const& photons, std::map, float> const& candScore, TLegs const& legs) { @@ -3306,7 +3306,7 @@ struct PhotonConversionBuilder { } // run 2: cache one table iterator per leg of this artificial event for the mixed-event photon pair analysis, to avoid repeated lookups in the legs table - template + template void cacheLegsOf(TMixCollision const& collision, TMixLegs const& legs) { mLegItFirst = collision.firstLeg(); @@ -3318,7 +3318,7 @@ struct PhotonConversionBuilder { } // fill the occupancy of the source events and the deduplication diagnostics for the mixed-event photon pairs - template + template void fillMatchedConfigs(TMixCollisions const& collisions, TMixLegs const& legs) { for (const auto& collision : collisions) { // same-event artificial events carry the occupancy of their source event @@ -3447,7 +3447,7 @@ struct PhotonConversionBuilder { } // truth of a photon pair: 0 both genuine, 1 crossed, 2 other (at least one leg not from a true photon), for all candidates of a collision - template + template void fillFourLegAll(TMixCollisions const& collisions, TMixLegs const& legs, const size_t nFit) { using Key3 = std::tuple; @@ -3502,7 +3502,7 @@ struct PhotonConversionBuilder { } } - template + template void fillFourLegTruthAligned(TMixCollisions const& collisions, TMixLegs const& legs, const int64_t colId, const float type, const float truth, const float isolated, const float actual, V0CandidateHelper const& a, V0CandidateHelper const& b, V0CandidateHelper const& x1, V0CandidateHelper const& x2, const int groupSize) @@ -3643,7 +3643,7 @@ struct PhotonConversionBuilder { } } - template + template void fillTakenApart(TMixCollisions const& collisions, TMixLegs const& legs, const size_t nFit, std::set const& afterChoice, std::set const& afterSplit) { using Key3 = std::tuple; @@ -3698,7 +3698,7 @@ struct PhotonConversionBuilder { } } - template + template void fillFourLegDecisions(TMixCollisions const& collisions, TMixLegs const& legs, const size_t nFit) { fillFourLegAll(collisions, legs, nFit); @@ -3789,7 +3789,7 @@ struct PhotonConversionBuilder { } // run 2: build the mixed event, fill the crossed pairings, and fill the diagnostics of the run-1 photons (pooled free legs) before the dedup and resolvers - template + template void buildMixed(TMixCollisions const& collisions, TMixLegs const& legs) { const auto tDF = std::chrono::steady_clock::now(); @@ -4420,7 +4420,7 @@ struct PhotonConversionBuilder { } } - template + template void fillRun1FourLeg(TMCParticles const& mcparticles, DedupDiag const& diag, std::vector const& cls, std::vector const& motherPos, std::set const& storedSet, std::map& nCandsOfTrack) {