Skip to content
Closed
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
50 changes: 29 additions & 21 deletions PWGLF/TableProducer/QC/flowQC.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 PWGLF/TableProducer/QC/flowQC.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 PWGLF/TableProducer/QC/flowQC.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specify task name only when it cannot be derived from the struct name. Only append to the default name.
// 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 @@ -115,13 +115,14 @@

// CCDB options
Configurable<double> cfgBz{"cfgBz", -999, "bz field, -999 is automatic"};
Configurable<std::string> cfgCCDBurl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 118 in PWGLF/TableProducer/QC/flowQC.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<std::string> cfgGRPpath{"cfgGRPpath", "GLO/GRP/GRP", "Path of the grp file"};
Configurable<std::string> cfgGRPmagPath{"cfgGRPmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
int mRunNumber = 0;
float mBz = 0.f;

Configurable<float> cfgHarmonic{"cfgHarmonic", 2.f, "Harmonics for flow analysis"};
Configurable<bool> cfgQuadraticResponse{"cfgQuadraticResponse", false, "Use quadratic response for Q-vector quantities"};

// Flow analysis
using CollWithEPandQvec = soa::Join<aod::Collisions,
Expand Down Expand Up @@ -151,7 +152,7 @@
auto run3grp_timestamp = bc.timestamp();
mRunNumber = bc.runNumber();

if (cfgBz > -990) {

Check failure on line 155 in PWGLF/TableProducer/QC/flowQC.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.
mBz = cfgBz;
} else {
o2::parameters::GRPObject* grpo{ccdb->getForTimeStamp<o2::parameters::GRPObject>(cfgGRPpath, run3grp_timestamp)};
Expand Down Expand Up @@ -183,11 +184,13 @@

const AxisSpec centAxis{cfgCentralityBins, fmt::format("{} percentile", (std::string)centDetectorNames[cfgCentralityEstimator])};

const AxisSpec QxAxis{cfgQvecBins, Form("Q_{%.0f,x}", cfgHarmonic.value)};
const AxisSpec QyAxis{cfgQvecBins, Form("Q_{%.0f,y}", cfgHarmonic.value)};
const char* qLabel = cfgQuadraticResponse ? "Q^{2}" : "Q";

const AxisSpec NormQxAxis{cfgQvecBins, Form("#frac{Q_{%.0f,x}}{||#vec{Q_{%.0f}}||}", cfgHarmonic.value, cfgHarmonic.value)};
const AxisSpec NormQyAxis{cfgQvecBins, Form("#frac{Q_{%.0f,y}}{||#vec{Q_{%.0f}}||}", cfgHarmonic.value, cfgHarmonic.value)};
const AxisSpec QxAxis{cfgQvecBins, Form("%s_{%.0f,x}", qLabel, cfgHarmonic.value)};
const AxisSpec QyAxis{cfgQvecBins, Form("%s_{%.0f,y}", qLabel, cfgHarmonic.value)};

const AxisSpec NormQxAxis{cfgQvecBins, Form("#frac{%s_{%.0f,x}}{||#vec{%s}_{%.0f}||}", qLabel, cfgHarmonic.value, qLabel, cfgHarmonic.value)};
const AxisSpec NormQyAxis{cfgQvecBins, Form("#frac{%s_{%.0f,y}}{||#vec{%s}_{%.0f}||}", qLabel, cfgHarmonic.value, qLabel, cfgHarmonic.value)};

const AxisSpec psiAxis{cfgPhiBins, Form("#psi_{%.0f}", cfgHarmonic.value)};
const AxisSpec psiCompAxis{cfgPhiBins, Form("#psi_{%.0f}^{EP} - #psi_{%.0f}^{Qvec}", cfgHarmonic.value, cfgHarmonic.value)};
Expand Down Expand Up @@ -215,12 +218,12 @@
hDeltaPsi[iMethod][iQvecDet][jQvecDet] = registry->add<TH2>(Form("hDeltaPsi_%s_%s_%s", qVecDetectorNames[iQvecDet].c_str(), qVecDetectorNames[jQvecDet].c_str(), suffixes[iMethod].c_str()), "", HistType::kTH2F, {centAxis, {cfgDeltaPhiBins, Form("#psi_{%s} - #psi_{%s}", qVecDetectorNames[iQvecDet].c_str(), qVecDetectorNames[jQvecDet].c_str())}});

// Scalar-product histograms
auto spLabel = Form("#vec{Q}_{%.0f}^{%s} #upoint #vec{Q}_{%.0f}^{%s}", cfgHarmonic.value, qVecDetectorNames[iQvecDet].c_str(), cfgHarmonic.value, qVecDetectorNames[jQvecDet].c_str());
auto spLabel = Form("#vec{%s}_{%.0f}^{%s} #upoint #vec{%s}_{%.0f}^{%s}", qLabel, cfgHarmonic.value, qVecDetectorNames[iQvecDet].c_str(), qLabel, cfgHarmonic.value, qVecDetectorNames[jQvecDet].c_str());

hScalarProduct[iMethod][iQvecDet][jQvecDet] = registry->add<TH2>(Form("hScalarProduct_%s_%s_%s", qVecDetectorNames[iQvecDet].c_str(), qVecDetectorNames[jQvecDet].c_str(), suffixes[iMethod].c_str()), "", HistType::kTH2F, {centAxis, {cfgQvecBins, spLabel}});

// Normalised scalar-product histograms
auto normSpLabel = Form("#frac{#vec{Q}_{%.0f}^{%s} #upoint #vec{Q}_{%.0f}^{%s}}{||#vec{Q}_{%.0f}^{%s}|| ||#vec{Q}_{%.0f}^{%s}||}", cfgHarmonic.value, qVecDetectorNames[iQvecDet].c_str(), cfgHarmonic.value, qVecDetectorNames[jQvecDet].c_str(), cfgHarmonic.value, qVecDetectorNames[iQvecDet].c_str(), cfgHarmonic.value, qVecDetectorNames[jQvecDet].c_str());
auto normSpLabel = Form("#frac{#vec{%s}_{%.0f}^{%s} #upoint #vec{%s}_{%.0f}^{%s}}{||#vec{%s}_{%.0f}^{%s}|| ||#vec{%s}_{%.0f}^{%s}||}", qLabel, cfgHarmonic.value, qVecDetectorNames[iQvecDet].c_str(), qLabel, cfgHarmonic.value, qVecDetectorNames[jQvecDet].c_str(), qLabel, cfgHarmonic.value, qVecDetectorNames[iQvecDet].c_str(), qLabel, cfgHarmonic.value, qVecDetectorNames[jQvecDet].c_str());

hNormalisedScalarProduct[iMethod][iQvecDet][jQvecDet] = registry->add<TH2>(Form("hNormalisedScalarProduct_%s_%s_%s", qVecDetectorNames[iQvecDet].c_str(), qVecDetectorNames[jQvecDet].c_str(), suffixes[iMethod].c_str()), "", HistType::kTH2F, {centAxis, {cfgQvecBins, normSpLabel}});
}
Expand Down Expand Up @@ -270,55 +273,60 @@

float centrality = getCentrality(collision);

const bool quadraticResponse = cfgQuadraticResponse;
auto maybeSquare = [quadraticResponse](float value) {
return quadraticResponse ? value * value : value;
};

// EP method
float QmodFT0A_EP = collision.qFT0A();
float QmodFT0A_EP = maybeSquare(collision.qFT0A());
float psiFT0A_EP = collision.psiFT0A();
float QxFT0A_EP = QmodFT0A_EP * std::cos(cfgHarmonic.value * psiFT0A_EP);
float QyFT0A_EP = QmodFT0A_EP * std::sin(cfgHarmonic.value * psiFT0A_EP);

float QmodFT0C_EP = collision.qFT0C();
float QmodFT0C_EP = maybeSquare(collision.qFT0C());
float psiFT0C_EP = collision.psiFT0C();
float QxFT0C_EP = QmodFT0C_EP * std::cos(cfgHarmonic.value * psiFT0C_EP);
float QyFT0C_EP = QmodFT0C_EP * std::sin(cfgHarmonic.value * psiFT0C_EP);

float QmodTPCl_EP = collision.qTPCL();
float QmodTPCl_EP = maybeSquare(collision.qTPCL());
float psiTPCl_EP = collision.psiTPCL();
float QxTPCl_EP = QmodTPCl_EP * std::cos(cfgHarmonic.value * psiTPCl_EP);
float QyTPCl_EP = QmodTPCl_EP * std::sin(cfgHarmonic.value * psiTPCl_EP);

float QmodTPCr_EP = collision.qTPCR();
float QmodTPCr_EP = maybeSquare(collision.qTPCR());
float psiTPCr_EP = collision.psiTPCR();
float QxTPCr_EP = QmodTPCr_EP * std::cos(cfgHarmonic.value * psiTPCr_EP);
float QyTPCr_EP = QmodTPCr_EP * std::sin(cfgHarmonic.value * psiTPCr_EP);

float QmodTPC_EP = collision.qTPC();
float QmodTPC_EP = maybeSquare(collision.qTPC());
float psiTPC_EP = collision.psiTPC();
float QxTPC_EP = QmodTPC_EP * std::cos(cfgHarmonic.value * psiTPC_EP);
float QyTPC_EP = QmodTPC_EP * std::sin(cfgHarmonic.value * psiTPC_EP);

// Qvec method
float QxFT0A_Qvec = collision.qvecFT0AReVec()[cfgHarmonic.value - 2];
float QyFT0A_Qvec = collision.qvecFT0AImVec()[cfgHarmonic.value - 2];
float QxFT0A_Qvec = maybeSquare(collision.qvecFT0AReVec()[cfgHarmonic.value - 2]);
float QyFT0A_Qvec = maybeSquare(collision.qvecFT0AImVec()[cfgHarmonic.value - 2]);
float QmodFT0A_Qvec = std::hypot(QxFT0A_Qvec, QyFT0A_Qvec);
float psiFT0A_Qvec = computeEventPlane(QyFT0A_Qvec, QxFT0A_Qvec);

float QxFT0C_Qvec = collision.qvecFT0CReVec()[cfgHarmonic.value - 2];
float QyFT0C_Qvec = collision.qvecFT0CImVec()[cfgHarmonic.value - 2];
float QxFT0C_Qvec = maybeSquare(collision.qvecFT0CReVec()[cfgHarmonic.value - 2]);
float QyFT0C_Qvec = maybeSquare(collision.qvecFT0CImVec()[cfgHarmonic.value - 2]);
float QmodFT0C_Qvec = std::hypot(QxFT0C_Qvec, QyFT0C_Qvec);
float psiFT0C_Qvec = computeEventPlane(QyFT0C_Qvec, QxFT0C_Qvec);

float QxTPCl_Qvec = collision.qvecTPCnegReVec()[cfgHarmonic.value - 2];
float QyTPCl_Qvec = collision.qvecTPCnegImVec()[cfgHarmonic.value - 2];
float QxTPCl_Qvec = maybeSquare(collision.qvecTPCnegReVec()[cfgHarmonic.value - 2]);
float QyTPCl_Qvec = maybeSquare(collision.qvecTPCnegImVec()[cfgHarmonic.value - 2]);
float QmodTPCl_Qvec = std::hypot(QxTPCl_Qvec, QyTPCl_Qvec);
float psiTPCl_Qvec = computeEventPlane(QyTPCl_Qvec, QxTPCl_Qvec);

float QxTPCr_Qvec = collision.qvecTPCposReVec()[cfgHarmonic.value - 2];
float QyTPCr_Qvec = collision.qvecTPCposImVec()[cfgHarmonic.value - 2];
float QxTPCr_Qvec = maybeSquare(collision.qvecTPCposReVec()[cfgHarmonic.value - 2]);
float QyTPCr_Qvec = maybeSquare(collision.qvecTPCposImVec()[cfgHarmonic.value - 2]);
float QmodTPCr_Qvec = std::hypot(QxTPCr_Qvec, QyTPCr_Qvec);
float psiTPCr_Qvec = computeEventPlane(QyTPCr_Qvec, QxTPCr_Qvec);

float QxTPC_Qvec = collision.qvecTPCallReVec()[cfgHarmonic.value - 2];
float QyTPC_Qvec = collision.qvecTPCallImVec()[cfgHarmonic.value - 2];
float QxTPC_Qvec = maybeSquare(collision.qvecTPCallReVec()[cfgHarmonic.value - 2]);
float QyTPC_Qvec = maybeSquare(collision.qvecTPCallImVec()[cfgHarmonic.value - 2]);
float QmodTPC_Qvec = std::hypot(QxTPC_Qvec, QyTPC_Qvec);
float psiTPC_Qvec = computeEventPlane(QyTPC_Qvec, QxTPC_Qvec);

Expand Down Expand Up @@ -358,5 +366,5 @@
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<flowQC>(cfgc, TaskName{"flow-qc"})};

Check failure on line 369 in PWGLF/TableProducer/QC/flowQC.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Device names flow-qc and flow-q-c generated from the specified task name flow-qc and from the struct name flowQC, respectively, differ in hyphenation. Consider fixing capitalisation of the struct name to FlowQc and removing TaskName.
}
Loading