Skip to content
Draft
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
55 changes: 54 additions & 1 deletion PWGDQ/Tasks/dqFlow.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 PWGDQ/Tasks/dqFlow.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.)

Check failure on line 1 in PWGDQ/Tasks/dqFlow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Use constant references for table subscriptions in process functions.
// 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 @@ -142,8 +142,8 @@
ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.1}, "multiplicity / centrality axis for histograms"};

// Define the filter for barrel tracks and forward tracks
Filter trackFilter = (requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true);
Filter trackFilter = (requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true);
Filter fwdFilter = (aod::fwdtrack::eta < -2.45f) && (aod::fwdtrack::eta > -3.6f);

Check failure on line 146 in PWGDQ/Tasks/dqFlow.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.

// Histograms used for optionnal efficiency and non-uniform acceptance corrections
struct Config {
Expand Down Expand Up @@ -352,6 +352,52 @@
}
}

// Templated function instantianed for all of the process functions
template <uint32_t TEventFillMap, typename TEvent, typename TFT0s>
void runFillQvectorFromCentralFWWithFT0CCumulants(TEvent const& collision, TFT0s const& /*ft0s*/)
{
VarManager::ResetValues(0, VarManager::kNVars);
VarManager::FillEvent<TEventFillMap>(collision);

float S11C = collision.sumAmplFT0C();
float S12C = 0.f;
float S21C = S11C * S11C;

// Compute sum of squares of amplitudes from FT0C for flow analysis
if (collision.has_foundFT0()) {
auto ft0 = collision.foundFT0();
auto const& ampC = ft0.amplitudeC();
for (auto amp : ampC) {

Check failure on line 370 in PWGDQ/Tasks/dqFlow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (amp > 0.f) {
S12C += amp * amp;
}
}
}
VarManager::FillQVectorFromCentralFW(collision);
std::complex<double> Q21C(collision.qvecFT0CRe() * S11C, collision.qvecFT0CIm() * S11C);

// Fill necessary quantities for cumulant calculations with weighted Q-vectors
float M11REF = S21C - S12C;
float CORR2REF = (norm(Q21C) - S12C) / M11REF;
CORR2REF = std::isnan(M11REF) || std::isinf(M11REF) || std::isnan(CORR2REF) || std::isinf(CORR2REF) ? 0 : CORR2REF;
M11REF = std::isnan(M11REF) || std::isinf(M11REF) || std::isnan(CORR2REF) || std::isinf(CORR2REF) ? 0 : M11REF;

if (fConfigQA) {
fHistMan->FillHistClass("Event_BeforeCuts_centralFW", VarManager::fgValues);
if (fEventCut->IsSelected(VarManager::fgValues)) {
fHistMan->FillHistClass("Event_AfterCuts_centralFW", VarManager::fgValues);
}
}

if (fEventCut->IsSelected(VarManager::fgValues)) {
eventQvectorCentr(collision.qvecFT0ARe(), collision.qvecFT0AIm(), collision.qvecFT0CRe(), collision.qvecFT0CIm(), collision.qvecFT0MRe(), collision.qvecFT0MIm(), collision.qvecFV0ARe(), collision.qvecFV0AIm(), collision.qvecTPCposRe(), collision.qvecTPCposIm(), collision.qvecTPCnegRe(), collision.qvecTPCnegIm(),
collision.sumAmplFT0A(), collision.sumAmplFT0C(), collision.sumAmplFT0M(), collision.sumAmplFV0A(), collision.nTrkTPCpos(), collision.nTrkTPCneg());
eventQvectorCentrExtra(collision.qvecTPCallRe(), collision.qvecTPCallIm(), collision.nTrkTPCall());
eventRefFlow(M11REF, -9999, -9999, CORR2REF, -9999, -9999, VarManager::fgValues[VarManager::kCentFT0C]);
eventQvectorExtra(-9999, -9999, -9999, -9999, S11C, S12C, -9999, -9999);
}
}

// Templated function instantianed for all of the process functions
template <uint32_t TEventFillMap, uint32_t TTrackFillMap, typename TEvent, typename TTracks>
void runFillQvector(TEvent const& collision, MyBcs const&, TTracks const& tracks1, aod::Zdcs const&)
Expand Down Expand Up @@ -385,7 +431,7 @@
float weff = 1.0, wacc = 1.0;

// Fill the GFW object in the track loop
for (auto& track : tracks1) {

Check failure on line 434 in PWGDQ/Tasks/dqFlow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.

// Selections for barrel tracks
if (!isTrackSelected<TTrackFillMap>(track)) {
Expand Down Expand Up @@ -475,10 +521,10 @@
S12Full = gfwCumFull.Vec(0, 2).real();
S13Full = gfwCumFull.Vec(0, 3).real();
S14Full = gfwCumFull.Vec(0, 4).real();
S21Full = pow(gfwCumFull.Vec(0, 1).real(), 2);

Check failure on line 524 in PWGDQ/Tasks/dqFlow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
S22Full = pow(gfwCumFull.Vec(0, 2).real(), 2);

Check failure on line 525 in PWGDQ/Tasks/dqFlow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
S31Full = pow(gfwCumFull.Vec(0, 1).real(), 3);

Check failure on line 526 in PWGDQ/Tasks/dqFlow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
S41Full = pow(gfwCumFull.Vec(0, 1).real(), 4);

Check failure on line 527 in PWGDQ/Tasks/dqFlow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

// Get the Q vector for selected harmonic, power (for minPt=0)
Q11N = gfwCumN.Vec(1, 1);
Expand Down Expand Up @@ -574,6 +620,12 @@
runFillQvectorFromCentralFW<gkEventFillMapRun3>(collisions);
}

// Process to fill Q vector using barrel tracks in a reduced event table for barrel/muon tracks flow related analyses Run 3
void processCentralQvectorWithFT0CCumulants(MyEventsWithCentQvectRun3::iterator const& collision, aod::FT0s const& ft0s)
{
runFillQvectorFromCentralFWWithFT0CCumulants<gkEventFillMapRun3>(collision, ft0s);
}

// Process to fill Q vector using forward tracks in a reduced event table for barrel/muon tracks flow related analyses Run 3
void processForwardQvector(MyEventsWithCentRun3::iterator const& collisions, MyBcs const& bcs, soa::Filtered<aod::MFTTracks> const& tracks, aod::Zdcs const& zdcs)
{
Expand All @@ -581,7 +633,7 @@
}

// TODO: dummy function for the case when no process function is enabled
void processDummy(MyEvents&)

Check failure on line 636 in PWGDQ/Tasks/dqFlow.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-process]

Argument MyEvents& is not const&.
{
// do nothing
}
Expand All @@ -590,6 +642,7 @@
PROCESS_SWITCH(DQEventQvector, processBarrelQvector, "Run q-vector task on barrel tracks for Run3", false);
PROCESS_SWITCH(DQEventQvector, processAllQvector, "Run q-vector task on barrel tracks for Run3 and using central q-vector", false);
PROCESS_SWITCH(DQEventQvector, processCentralQvector, "Run q-vector task using central q-vector", false);
PROCESS_SWITCH(DQEventQvector, processCentralQvectorWithFT0CCumulants, "Run q-vector task using central q-vector with FT0C cumulants", false);
PROCESS_SWITCH(DQEventQvector, processForwardQvector, "Run q-vector task on forward tracks for Run3", false);
PROCESS_SWITCH(DQEventQvector, processDummy, "Dummy function", false);
};
Expand Down
Loading