Skip to content
Merged
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
86 changes: 84 additions & 2 deletions PWGCF/JCorran/Tasks/jEPFlowAnalysis.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGCF/JCorran/Tasks/jEPFlowAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -38,6 +38,7 @@
using namespace std;

using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::Qvectors>;
using MyCollisionsWithSC = soa::Join<aod::Collisions, aod::EvSels, aod::QvectorsShifteds>;
using MyTracks = aod::Tracks;

struct jEPFlowAnalysis {
Expand Down Expand Up @@ -151,6 +152,86 @@
epFlowHistograms.add("hVertex", "", {HistType::kTH1F, {axisVertex}});
}

void processWithSC(MyCollisionsWithSC::iterator const& coll, soa::Filtered<MyTracks> const& tracks, aod::BCsWithTimestamps const&)
{
if (cfgAddEvtSel) {
if (std::abs(coll.posZ()) > cfgVertexZ)
return;
switch (cfgEvtSel) {
case 0: // Sel8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using named constants

if (!coll.sel8())
return;
break;
case 1: // PbPb standard
if (!coll.sel8() || !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) || !coll.selection_bit(aod::evsel::kNoSameBunchPileup))
return;
break;
case 2: // PbPb with pileup
if (!coll.sel8() || !coll.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) ||
!coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) || !coll.selection_bit(aod::evsel::kNoSameBunchPileup))
return;
break;
case 3: // Small systems (OO, NeNe, pp)
if (!coll.sel8() || !coll.selection_bit(aod::evsel::kNoSameBunchPileup))
return;
break;
default:
LOGF(warning, "Event selection flag was not found, continuing without basic event selections!\n");
}
// Check occupancy
if (coll.trackOccupancyInTimeRange() > cfgMaxOccupancy || coll.trackOccupancyInTimeRange() < cfgMinOccupancy)
return;
}

float cent = coll.cent();
epFlowHistograms.fill(HIST("hCentrality"), cent);
epFlowHistograms.fill(HIST("hVertex"), coll.posZ());
float eps[3] = {0.};

if (coll.qvecAmp()[detId] < 1e-5 || coll.qvecAmp()[refAId] < 1e-5 || coll.qvecAmp()[refBId] < 1e-5)

Check failure on line 191 in PWGCF/JCorran/Tasks/jEPFlowAnalysis.cxx

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.
return;

for (int i = 0; i < cfgnMode; i++) { // loop over different harmonic orders
harmInd = cfgnTotalSystem * i; // harmonic index to access corresponding Q-vector as all Q-vectors are in same vector
eps[0] = helperEP.GetEventPlane(coll.qvecShiftedRe()[detId + harmInd], coll.qvecShiftedIm()[detId + harmInd], i + 2);
eps[1] = helperEP.GetEventPlane(coll.qvecShiftedRe()[refAId + harmInd], coll.qvecShiftedIm()[refAId + harmInd], i + 2);
eps[2] = helperEP.GetEventPlane(coll.qvecShiftedRe()[refBId + harmInd], coll.qvecShiftedIm()[refBId + harmInd], i + 2);

float resNumA = helperEP.GetResolution(eps[0], eps[1], i + 2);
float resNumB = helperEP.GetResolution(eps[0], eps[2], i + 2);
float resDenom = helperEP.GetResolution(eps[1], eps[2], i + 2);

epFlowHistograms.fill(HIST("EpDet"), i + 2, cent, eps[0]);
epFlowHistograms.fill(HIST("EpRefA"), i + 2, cent, eps[1]);
epFlowHistograms.fill(HIST("EpRefB"), i + 2, cent, eps[2]);

epFlowHistograms.fill(HIST("EpResDetRefA"), i + 2, cent, resNumA);
epFlowHistograms.fill(HIST("EpResDetRefB"), i + 2, cent, resNumB);
epFlowHistograms.fill(HIST("EpResRefARefB"), i + 2, cent, resDenom);

epFlowHistograms.fill(HIST("EpResQvecDetRefAxx"), i + 2, cent, coll.qvecShiftedRe()[detId + harmInd] * coll.qvecShiftedRe()[refAId + harmInd] + coll.qvecShiftedIm()[detId + harmInd] * coll.qvecShiftedIm()[refAId + harmInd]);
epFlowHistograms.fill(HIST("EpResQvecDetRefAxy"), i + 2, cent, coll.qvecShiftedRe()[refAId + harmInd] * coll.qvecShiftedIm()[detId + harmInd] - coll.qvecShiftedRe()[detId + harmInd] * coll.qvecShiftedIm()[refAId + harmInd]);
epFlowHistograms.fill(HIST("EpResQvecDetRefBxx"), i + 2, cent, coll.qvecShiftedRe()[detId + harmInd] * coll.qvecShiftedRe()[refBId + harmInd] + coll.qvecShiftedIm()[detId + harmInd] * coll.qvecShiftedIm()[refBId + harmInd]);
epFlowHistograms.fill(HIST("EpResQvecDetRefBxy"), i + 2, cent, coll.qvecShiftedRe()[refBId + harmInd] * coll.qvecShiftedIm()[detId + harmInd] - coll.qvecShiftedRe()[detId + harmInd] * coll.qvecShiftedIm()[refBId + harmInd]);
epFlowHistograms.fill(HIST("EpResQvecRefARefBxx"), i + 2, cent, coll.qvecShiftedRe()[refAId + harmInd] * coll.qvecShiftedRe()[refBId + harmInd] + coll.qvecShiftedIm()[refAId + harmInd] * coll.qvecShiftedIm()[refBId + harmInd]);
epFlowHistograms.fill(HIST("EpResQvecRefARefBxy"), i + 2, cent, coll.qvecShiftedRe()[refBId + harmInd] * coll.qvecShiftedIm()[refAId + harmInd] - coll.qvecShiftedRe()[refAId + harmInd] * coll.qvecShiftedIm()[refBId + harmInd]);

float weight = 1.0;

for (const auto& track : tracks) {
float vn = std::cos((i + 2) * (track.phi() - eps[0]));
float vnSin = std::sin((i + 2) * (track.phi() - eps[0]));

epFlowHistograms.fill(HIST("vncos"), i + 2, cent, track.pt(), vn * weight);
epFlowHistograms.fill(HIST("vnsin"), i + 2, cent, track.pt(), vnSin * weight);

epFlowHistograms.fill(HIST("SPvnxx"), i + 2, cent, track.pt(), (TMath::Cos(track.phi()) * coll.qvecShiftedRe()[detId + harmInd] + TMath::Sin(track.phi()) * coll.qvecShiftedIm()[detId + harmInd]) * weight);
epFlowHistograms.fill(HIST("SPvnxy"), i + 2, cent, track.pt(), (TMath::Sin(track.phi()) * coll.qvecShiftedRe()[detId + harmInd] - TMath::Cos(track.phi()) * coll.qvecShiftedIm()[detId + harmInd]) * weight);
}
}
}
PROCESS_SWITCH(jEPFlowAnalysis, processWithSC, "process with shift-corrected qvectors", false);

void process(MyCollisions::iterator const& coll, soa::Filtered<MyTracks> const& tracks, aod::BCsWithTimestamps const&)
{
if (cfgAddEvtSel) {
Expand Down Expand Up @@ -205,7 +286,7 @@
}
}

if (coll.qvecAmp()[detId] < 1e-5 || coll.qvecAmp()[refAId] < 1e-5 || coll.qvecAmp()[refBId] < 1e-5)

Check failure on line 289 in PWGCF/JCorran/Tasks/jEPFlowAnalysis.cxx

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.
return;

for (int i = 0; i < cfgnMode; i++) { // loop over different harmonic orders
Expand Down Expand Up @@ -263,8 +344,8 @@
epFlowHistograms.fill(HIST("EpResQvecDetRefAxy"), i + 2, cent, qx_shifted[1] * qy_shifted[0] - qx_shifted[0] * qy_shifted[1]);
epFlowHistograms.fill(HIST("EpResQvecDetRefBxx"), i + 2, cent, qx_shifted[0] * qx_shifted[2] + qy_shifted[0] * qy_shifted[2]);
epFlowHistograms.fill(HIST("EpResQvecDetRefBxy"), i + 2, cent, qx_shifted[2] * qy_shifted[0] - qx_shifted[0] * qy_shifted[2]);
epFlowHistograms.fill(HIST("EpResQvecRefARefAxx"), i + 2, cent, qx_shifted[1] * qx_shifted[2] + qy_shifted[1] * qy_shifted[2]);
epFlowHistograms.fill(HIST("EpResQvecRefARefAxy"), i + 2, cent, qx_shifted[2] * qy_shifted[1] - qx_shifted[1] * qy_shifted[2]);
epFlowHistograms.fill(HIST("EpResQvecRefARefBxx"), i + 2, cent, qx_shifted[1] * qx_shifted[2] + qy_shifted[1] * qy_shifted[2]);
epFlowHistograms.fill(HIST("EpResQvecRefARefBxy"), i + 2, cent, qx_shifted[2] * qy_shifted[1] - qx_shifted[1] * qy_shifted[2]);

for (const auto& track : tracks) {
float vn = std::cos((i + 2) * (track.phi() - eps[0]));
Expand All @@ -278,6 +359,7 @@
}
}
}
PROCESS_SWITCH(jEPFlowAnalysis, process, "default process", true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is not needed for process
I doubt it can be disabled

};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
Expand Down
Loading