Skip to content

Commit a143242

Browse files
ayatsujiringoayatsuji
andauthored
[PWGDQ] [PWGDQ]Add event-plane-preserving track rotation (#17607)
Co-authored-by: ayatsuji <13807650+asakuratou@user.noreply.gitee.com>
1 parent b03c501 commit a143242

2 files changed

Lines changed: 32 additions & 6 deletions

File tree

PWGDQ/Core/VarManager.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ class VarManager : public TObject
14601460
template <int pairType, uint32_t fillMap, typename T1, typename T2>
14611461
static void FillPair(T1 const& t1, T2 const& t2, float* values = nullptr);
14621462
template <int pairType, uint32_t fillMap, typename T1, typename T2>
1463-
static void FillPairRotation(T1 const& t1, T2 const& t2, float* values = nullptr);
1463+
static void FillPairRotation(T1 const& t1, T2 const& t2, int rotation, float* values = nullptr);
14641464
template <int pairType, uint32_t fillMap, typename C, typename T1, typename T2>
14651465
static void FillPairCollision(C const& collision, T1 const& t1, T2 const& t2, float* values = nullptr);
14661466
template <int pairType, uint32_t fillMap, typename C, typename T1, typename T2, typename M, typename P>
@@ -4004,7 +4004,7 @@ void VarManager::FillPair(T1 const& t1, T2 const& t2, float* values)
40044004

40054005
// change_start: rotation pair
40064006
template <int pairType, uint32_t fillMap, typename T1, typename T2>
4007-
void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, float* values)
4007+
void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, int rotation, float* values)
40084008
{
40094009
if (!values) {
40104010
values = fgValues;
@@ -4034,7 +4034,21 @@ void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, float* values)
40344034
m2 = o2::constants::physics::MassMuon;
40354035
}
40364036

4037-
double rotationphi2 = SampleRotationPhi(t2.pt(), t2.eta(), t2.sign());
4037+
double rotationphi2 = t2.phi();
4038+
4039+
if (rotation == 1) {
4040+
rotationphi2 = t2.phi() + o2::constants::math::PI;
4041+
} else if (rotation == 2) {
4042+
rotationphi2 = 2 * values[kPsi2A] - t2.phi();
4043+
} else if (rotation == 3) {
4044+
rotationphi2 = 2 * values[kPsi2A] - t2.phi() + o2::constants::math::PI;
4045+
}
4046+
4047+
if (rotationphi2 >= o2::constants::math::TwoPI) {
4048+
rotationphi2 -= o2::constants::math::TwoPI;
4049+
} else if (rotationphi2 < 0) {
4050+
rotationphi2 += o2::constants::math::TwoPI;
4051+
}
40384052

40394053
values[kCharge] = t1.sign() + t2.sign();
40404054
values[kCharge1] = t1.sign();

PWGDQ/Tasks/tableReader_withAssoc.cxx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ struct AnalysisSameEventPairing {
13801380

13811381
// option for TR pair fill
13821382
Configurable<bool> fConfigTRPairs{"cfgFillTRPairs", false, "If true, fill Track rotation pairs"};
1383-
Configurable<int> fConfigNRotations{"cfgNRotations", 20, "Number of rotations for track rotation method"};
1383+
Configurable<int> fConfigNRotations{"cfgNRotations", 3, "Number of rotations for event plane preserving track rotation method, only 1 or 3 are supported"};
13841384

13851385
struct : ConfigurableGroup {
13861386
Configurable<std::string> url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
@@ -2449,14 +2449,26 @@ struct AnalysisSameEventPairing {
24492449
}
24502450
}
24512451
if (sign1 * sign2 < 0) {
2452-
for (int i = 0; i < fConfigNRotations.value; i++) {
2453-
VarManager::FillPairRotation<TPairType, TTrackFillMap>(t1, t2);
2452+
if (fConfigNRotations.value == 1) {
2453+
VarManager::FillPairRotation<TPairType, TTrackFillMap>(t1, t2, fConfigNRotations.value);
24542454
if constexpr (TPairType == VarManager::kDecayToEE) {
24552455
fHistMan->FillHistClass(Form("PairsBarrelTRPM_%s", fTrackCuts[icut].Data()), dqtablereader_helpers::varValues());
24562456
if (isAmbiExtra) {
24572457
fHistMan->FillHistClass(Form("PairsBarrelTRPM_ambiguousextra_%s", fTrackCuts[icut].Data()), dqtablereader_helpers::varValues());
24582458
}
24592459
}
2460+
} else if (fConfigNRotations.value == 3) {
2461+
for (int irot = 1; irot <= fConfigNRotations.value; irot++) {
2462+
VarManager::FillPairRotation<TPairType, TTrackFillMap>(t1, t2, irot);
2463+
if constexpr (TPairType == VarManager::kDecayToEE) {
2464+
fHistMan->FillHistClass(Form("PairsBarrelTRPM_%s", fTrackCuts[icut].Data()), dqtablereader_helpers::varValues());
2465+
if (isAmbiExtra) {
2466+
fHistMan->FillHistClass(Form("PairsBarrelTRPM_ambiguousextra_%s", fTrackCuts[icut].Data()), dqtablereader_helpers::varValues());
2467+
}
2468+
}
2469+
}
2470+
} else {
2471+
LOGF(fatal, "Unsupported number of rotations: %d, only 1 and 3 are supported", fConfigNRotations.value);
24602472
}
24612473
}
24622474
}

0 commit comments

Comments
 (0)