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
20 changes: 17 additions & 3 deletions PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@
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>
static void FillPairRotation(T1 const& t1, T2 const& t2, float* values = nullptr);
static void FillPairRotation(T1 const& t1, T2 const& t2, int rotation, 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);
template <int pairType, uint32_t fillMap, typename C, typename T1, typename T2, typename M, typename P>
Expand Down Expand Up @@ -1556,7 +1556,7 @@

static void SetCalibrationType(int type, bool useInterpolation = true)
{
if (type < 0 || type > 2) {

Check failure on line 1559 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOG(fatal) << "Invalid calibration type. Must be 0, 1, or 2.";
}
fgCalibrationType = type;
Expand Down Expand Up @@ -1791,7 +1791,7 @@
{
o2::track::TrackParCovFwd fwdtrack = o2::aod::fwdtrackutils::getTrackParCovFwd3DShift(muon, fgxShiftFwd, fgyShiftFwd, fgzShiftFwd, muon);
o2::dataformats::GlobalFwdTrack propmuon;
if (static_cast<int>(muon.trackType()) > 2) {

Check failure on line 1794 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
o2::dataformats::GlobalFwdTrack track;
track.setParameters(fwdtrack.getParameters());
track.setZ(fwdtrack.getZ());
Expand All @@ -1816,7 +1816,7 @@
propmuon.setZ(proptrack.getZ());
propmuon.setCovariances(proptrack.getCovariances());

} else if (static_cast<int>(muon.trackType()) < 2) {

Check failure on line 1819 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::array<double, 3> dcaInfOrig{999.f, 999.f, 999.f};
fwdtrack.propagateToDCAhelix(fgMagField, {collision.posX(), collision.posY(), collision.posZ()}, dcaInfOrig);
propmuon.setParameters(fwdtrack.getParameters());
Expand Down Expand Up @@ -1878,7 +1878,7 @@

// Redo propagation only for muon tracks
// propagation of MFT tracks alredy done in fwdtrack-extention task
if (static_cast<int>(muon.trackType()) > 2) {

Check failure on line 1881 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
o2::dataformats::GlobalFwdTrack propmuonAtDCA = PropagateMuon(muon, collision, kToDCA);
o2::dataformats::GlobalFwdTrack propmuonAtRabs = PropagateMuon(muon, collision, kToRabs);
float dcaX = (propmuonAtDCA.getX() - collision.posX());
Expand Down Expand Up @@ -2679,7 +2679,7 @@
if (!track.hasTPC()) {
continue; // skip tracks without TPC information
}
if (track.dcaZ() > 998) {

Check failure on line 2682 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue; // skip tracks without valid DCAz
}
dcazValues.push_back(track.dcaZ());
Expand Down Expand Up @@ -2767,11 +2767,11 @@
int counter10mm = 0;
for (auto const& d : dcazValues) {
double absD = std::abs(d);
if (absD > 0.01) {

Check failure on line 2770 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
counter100um++;
if (absD > 0.02) {

Check failure on line 2772 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
counter200um++;
if (absD > 0.05) {

Check failure on line 2774 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
counter500um++;
if (absD > 0.1) {
counter1mm++;
Expand Down Expand Up @@ -4004,7 +4004,7 @@

// 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)
void VarManager::FillPairRotation(T1 const& t1, T2 const& t2, int rotation, float* values)
{
if (!values) {
values = fgValues;
Expand Down Expand Up @@ -4034,7 +4034,21 @@
m2 = o2::constants::physics::MassMuon;
}

double rotationphi2 = SampleRotationPhi(t2.pt(), t2.eta(), t2.sign());
double rotationphi2 = t2.phi();

if (rotation == 1) {
rotationphi2 = t2.phi() + o2::constants::math::PI;
} else if (rotation == 2) {
rotationphi2 = 2 * values[kPsi2A] - t2.phi();
} else if (rotation == 3) {
rotationphi2 = 2 * values[kPsi2A] - t2.phi() + o2::constants::math::PI;
}

if (rotationphi2 >= o2::constants::math::TwoPI) {
rotationphi2 -= o2::constants::math::TwoPI;

Check failure on line 4048 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
} else if (rotationphi2 < 0) {
rotationphi2 += o2::constants::math::TwoPI;

Check failure on line 4050 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
}

values[kCharge] = t1.sign() + t2.sign();
values[kCharge1] = t1.sign();
Expand Down
18 changes: 15 additions & 3 deletions PWGDQ/Tasks/tableReader_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ struct AnalysisSameEventPairing {

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

struct : ConfigurableGroup {
Configurable<std::string> url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Expand Down Expand Up @@ -2449,14 +2449,26 @@ struct AnalysisSameEventPairing {
}
}
if (sign1 * sign2 < 0) {
for (int i = 0; i < fConfigNRotations.value; i++) {
VarManager::FillPairRotation<TPairType, TTrackFillMap>(t1, t2);
if (fConfigNRotations.value == 1) {
VarManager::FillPairRotation<TPairType, TTrackFillMap>(t1, t2, fConfigNRotations.value);
if constexpr (TPairType == VarManager::kDecayToEE) {
fHistMan->FillHistClass(Form("PairsBarrelTRPM_%s", fTrackCuts[icut].Data()), dqtablereader_helpers::varValues());
if (isAmbiExtra) {
fHistMan->FillHistClass(Form("PairsBarrelTRPM_ambiguousextra_%s", fTrackCuts[icut].Data()), dqtablereader_helpers::varValues());
}
}
} else if (fConfigNRotations.value == 3) {
for (int irot = 1; irot <= fConfigNRotations.value; irot++) {
VarManager::FillPairRotation<TPairType, TTrackFillMap>(t1, t2, irot);
if constexpr (TPairType == VarManager::kDecayToEE) {
fHistMan->FillHistClass(Form("PairsBarrelTRPM_%s", fTrackCuts[icut].Data()), dqtablereader_helpers::varValues());
if (isAmbiExtra) {
fHistMan->FillHistClass(Form("PairsBarrelTRPM_ambiguousextra_%s", fTrackCuts[icut].Data()), dqtablereader_helpers::varValues());
}
}
}
} else {
LOGF(fatal, "Unsupported number of rotations: %d, only 1 and 3 are supported", fConfigNRotations.value);
}
}
}
Expand Down
Loading