diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index e4256084db0..5e5d34e7f3a 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -64,6 +64,7 @@ #include #include #include + #include #include #include @@ -1362,7 +1363,7 @@ class VarManager : public TObject static void FillGlobalMuonRefitCov(T1 const& muontrack, T2 const& mfttrack, const C& collision, C2 const& mftcov, float* values = nullptr); template static void FillPair(T1 const& t1, T2 const& t2, float* values = nullptr); - template + template static void FillPairRotation(T1 const& t1, T2 const& t2, float* values = nullptr); template static void FillPairCollision(C const& collision, T1 const& t1, T2 const& t2, float* values = nullptr); @@ -3712,7 +3713,7 @@ void VarManager::FillPair(T1 const& t1, T2 const& t2, float* values) } } -//change_start: rotation pair +// change_start: rotation pair template void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, float* values) { @@ -3747,7 +3748,8 @@ void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, float* values) double dphi = gRandom->Uniform(0., 2. * TMath::Pi()); double rotationphi2 = t2.phi() + dphi; - if (rotationphi2 > 2. * TMath::Pi()) rotationphi2 -= 2. * TMath::Pi(); + if (rotationphi2 > 2. * TMath::Pi()) + rotationphi2 -= 2. * TMath::Pi(); values[kCharge] = t1.sign() + t2.sign(); values[kCharge1] = t1.sign(); @@ -3771,10 +3773,8 @@ void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, float* values) values[kPt2] = t2.pt(); values[kEta2] = t2.eta(); values[kPhi2] = rotationphi2; - } - template void VarManager::FillPairCollision(const C& collision, T1 const& t1, T2 const& t2, float* values) { diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index b542793aba0..e1f96011471 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -1469,7 +1469,7 @@ struct AnalysisSameEventPairing { if (fEnableBarrelHistos) { names = { - //change define histname + // change define histname Form("PairsBarrelSEPM_%s", objArray->At(icut)->GetName()), Form("PairsBarrelSEPP_%s", objArray->At(icut)->GetName()), Form("PairsBarrelSEMM_%s", objArray->At(icut)->GetName()), @@ -2131,8 +2131,8 @@ struct AnalysisSameEventPairing { } } // end loop (cuts) - //edit - //rotation 20 times + // edit + // rotation 20 times if constexpr (TPairType == VarManager::kDecayToEE) { twoTrackFilter = a1.isBarrelSelected_raw() & a2.isBarrelSelected_raw() & a1.isBarrelSelectedPrefilter_raw() & a2.isBarrelSelectedPrefilter_raw() & fTrackFilterMask; @@ -2158,43 +2158,43 @@ struct AnalysisSameEventPairing { if (t2.barrelAmbiguityOutOfBunch() > 1) { twoTrackFilter |= (static_cast(1) << 31); } - - for (int icut = 0; icut < ncuts; icut++) { - if (twoTrackFilter & (static_cast(1) << icut)) { - isAmbiInBunch = (twoTrackFilter & (static_cast(1) << 28)) || (twoTrackFilter & (static_cast(1) << 29)); - isAmbiOutOfBunch = (twoTrackFilter & (static_cast(1) << 30)) || (twoTrackFilter & (static_cast(1) << 31)); - isUnambiguous = !(isAmbiInBunch || isAmbiOutOfBunch); - isLeg1Ambi = (twoTrackFilter & (static_cast(1) << 28) || (twoTrackFilter & (static_cast(1) << 30))); - isLeg2Ambi = (twoTrackFilter & (static_cast(1) << 29) || (twoTrackFilter & (static_cast(1) << 31))); - if constexpr (TPairType == VarManager::kDecayToEE) { - if (isLeg1Ambi && isLeg2Ambi) { - std::pair iPair(a1.reducedtrackId(), a2.reducedtrackId()); - if (fAmbiguousPairs.find(iPair) != fAmbiguousPairs.end()) { - if (fAmbiguousPairs[iPair] & (static_cast(1) << icut)) { // if this pair is already stored with this cut - isAmbiExtra = true; + + for (int icut = 0; icut < ncuts; icut++) { + if (twoTrackFilter & (static_cast(1) << icut)) { + isAmbiInBunch = (twoTrackFilter & (static_cast(1) << 28)) || (twoTrackFilter & (static_cast(1) << 29)); + isAmbiOutOfBunch = (twoTrackFilter & (static_cast(1) << 30)) || (twoTrackFilter & (static_cast(1) << 31)); + isUnambiguous = !(isAmbiInBunch || isAmbiOutOfBunch); + isLeg1Ambi = (twoTrackFilter & (static_cast(1) << 28) || (twoTrackFilter & (static_cast(1) << 30))); + isLeg2Ambi = (twoTrackFilter & (static_cast(1) << 29) || (twoTrackFilter & (static_cast(1) << 31))); + if constexpr (TPairType == VarManager::kDecayToEE) { + if (isLeg1Ambi && isLeg2Ambi) { + std::pair iPair(a1.reducedtrackId(), a2.reducedtrackId()); + if (fAmbiguousPairs.find(iPair) != fAmbiguousPairs.end()) { + if (fAmbiguousPairs[iPair] & (static_cast(1) << icut)) { // if this pair is already stored with this cut + isAmbiExtra = true; + } else { + fAmbiguousPairs[iPair] |= static_cast(1) << icut; + } } else { - fAmbiguousPairs[iPair] |= static_cast(1) << icut; + fAmbiguousPairs[iPair] = static_cast(1) << icut; } - } else { - fAmbiguousPairs[iPair] = static_cast(1) << icut; } } - } - if (sign1 * sign2 < 0) { - for (int i = 0; i < 20; i++) { + if (sign1 * sign2 < 0) { + for (int i = 0; i < 20; i++) { VarManager::FillPairRotation(t1, t2); if constexpr (TPairType == VarManager::kDecayToEE) { - fHistMan->FillHistClass(Form("PairsBarrelTRPM_%s", fTrackCuts[icut].Data()), VarManager::fgValues); - if (isAmbiExtra) { - fHistMan->FillHistClass(Form("PairsBarrelTRPM_ambiguousextra_%s", fTrackCuts[icut].Data()), VarManager::fgValues); + fHistMan->FillHistClass(Form("PairsBarrelTRPM_%s", fTrackCuts[icut].Data()), VarManager::fgValues); + if (isAmbiExtra) { + fHistMan->FillHistClass(Form("PairsBarrelTRPM_ambiguousextra_%s", fTrackCuts[icut].Data()), VarManager::fgValues); + } } } } } } } - } -//end + // end } // end loop over pairs of track associations VarManager::fgValues[VarManager::kNPairsPerEvent] = fNPairPerEvent; if (fEnableBarrelHistos && fConfigQA) {