Skip to content
Closed
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
10 changes: 5 additions & 5 deletions PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include <TObject.h>
#include <TRandom.h>
#include <TString.h>

#include <KFPTrack.h>
#include <KFPVertex.h>
#include <KFParticle.h>
Expand Down Expand Up @@ -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 <int pairType, uint32_t fillMap, typename T1, typename T2>
static void FillPair(T1 const& t1, T2 const& t2, float* values = nullptr);
template <int pairType, uint32_t fillMap, typename T1, typename T2>
template <int pairType, uint32_t fillMap, typename T1, typename T2>
static void FillPairRotation(T1 const& t1, T2 const& t2, float* values = nullptr);
template <int pairType, uint32_t fillMap, typename C, typename T1, typename T2>
static void FillPairCollision(C const& collision, T1 const& t1, T2 const& t2, float* values = nullptr);
Expand Down Expand Up @@ -3712,7 +3713,7 @@ void VarManager::FillPair(T1 const& t1, T2 const& t2, float* values)
}
}

//change_start: rotation pair
// change_start: rotation pair
template <int pairType, uint32_t fillMap, typename T1, typename T2>
void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, float* values)
{
Expand Down Expand Up @@ -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();
Expand All @@ -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 <int pairType, uint32_t fillMap, typename C, typename T1, typename T2>
void VarManager::FillPairCollision(const C& collision, T1 const& t1, T2 const& t2, float* values)
{
Expand Down
56 changes: 28 additions & 28 deletions PWGDQ/Tasks/tableReader_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down Expand Up @@ -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;

Expand All @@ -2158,43 +2158,43 @@ struct AnalysisSameEventPairing {
if (t2.barrelAmbiguityOutOfBunch() > 1) {
twoTrackFilter |= (static_cast<uint32_t>(1) << 31);
}

for (int icut = 0; icut < ncuts; icut++) {
if (twoTrackFilter & (static_cast<uint32_t>(1) << icut)) {
isAmbiInBunch = (twoTrackFilter & (static_cast<uint32_t>(1) << 28)) || (twoTrackFilter & (static_cast<uint32_t>(1) << 29));
isAmbiOutOfBunch = (twoTrackFilter & (static_cast<uint32_t>(1) << 30)) || (twoTrackFilter & (static_cast<uint32_t>(1) << 31));
isUnambiguous = !(isAmbiInBunch || isAmbiOutOfBunch);
isLeg1Ambi = (twoTrackFilter & (static_cast<uint32_t>(1) << 28) || (twoTrackFilter & (static_cast<uint32_t>(1) << 30)));
isLeg2Ambi = (twoTrackFilter & (static_cast<uint32_t>(1) << 29) || (twoTrackFilter & (static_cast<uint32_t>(1) << 31)));
if constexpr (TPairType == VarManager::kDecayToEE) {
if (isLeg1Ambi && isLeg2Ambi) {
std::pair<uint32_t, uint32_t> iPair(a1.reducedtrackId(), a2.reducedtrackId());
if (fAmbiguousPairs.find(iPair) != fAmbiguousPairs.end()) {
if (fAmbiguousPairs[iPair] & (static_cast<uint32_t>(1) << icut)) { // if this pair is already stored with this cut
isAmbiExtra = true;

for (int icut = 0; icut < ncuts; icut++) {
if (twoTrackFilter & (static_cast<uint32_t>(1) << icut)) {
isAmbiInBunch = (twoTrackFilter & (static_cast<uint32_t>(1) << 28)) || (twoTrackFilter & (static_cast<uint32_t>(1) << 29));
isAmbiOutOfBunch = (twoTrackFilter & (static_cast<uint32_t>(1) << 30)) || (twoTrackFilter & (static_cast<uint32_t>(1) << 31));
isUnambiguous = !(isAmbiInBunch || isAmbiOutOfBunch);
isLeg1Ambi = (twoTrackFilter & (static_cast<uint32_t>(1) << 28) || (twoTrackFilter & (static_cast<uint32_t>(1) << 30)));
isLeg2Ambi = (twoTrackFilter & (static_cast<uint32_t>(1) << 29) || (twoTrackFilter & (static_cast<uint32_t>(1) << 31)));
if constexpr (TPairType == VarManager::kDecayToEE) {
if (isLeg1Ambi && isLeg2Ambi) {
std::pair<uint32_t, uint32_t> iPair(a1.reducedtrackId(), a2.reducedtrackId());
if (fAmbiguousPairs.find(iPair) != fAmbiguousPairs.end()) {
if (fAmbiguousPairs[iPair] & (static_cast<uint32_t>(1) << icut)) { // if this pair is already stored with this cut
isAmbiExtra = true;
} else {
fAmbiguousPairs[iPair] |= static_cast<uint32_t>(1) << icut;
}
} else {
fAmbiguousPairs[iPair] |= static_cast<uint32_t>(1) << icut;
fAmbiguousPairs[iPair] = static_cast<uint32_t>(1) << icut;
}
} else {
fAmbiguousPairs[iPair] = static_cast<uint32_t>(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<TPairType, TTrackFillMap>(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) {
Expand Down