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
80 changes: 39 additions & 41 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

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
//

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

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

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

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

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

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
// Flow Qc analysis task
// ========================
//
Expand All @@ -19,34 +19,32 @@
// o2-analysis-multiplicity-table, o2-analysis-ft0-corrected-table, o2-analysis-track-propagation,
// o2-analysis-trackselection, o2-analysis-qvector-table, o2-analysis-lf-flow-qc

#include <cmath>

#include "Math/Vector4D.h"

#include "CCDB/BasicCCDBManager.h"
#include "PWGLF/DataModel/EPCalibrationTables.h"

#include "Common/Core/EventPlaneHelper.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/Core/EventPlaneHelper.h"
#include "PWGLF/DataModel/EPCalibrationTables.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Qvectors.h"

#include "CCDB/BasicCCDBManager.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsTPC/BetheBlochAleph.h"
#include "DetectorsBase/GeometryManager.h"
#include "DetectorsBase/Propagator.h"

#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"

#include "Math/Vector4D.h"
#include "TRandom3.h"

#include <cmath>

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
Expand Down Expand Up @@ -111,16 +109,16 @@
int mRunNumber = 0;
float mBz = 0.f;

Configurable<int> cfgHarmonics{"cfgHarmonics", 2, "Harmonics for flow analysis"};
Configurable<float> cfgHarmonic{"cfgHarmonic", 2.f, "Harmonics for flow analysis"};

// Flow analysis
using CollWithEPandQvec = soa::Join<aod::Collisions,
aod::EvSels, aod::CentFT0As, aod::CentFT0Cs, aod::CentFT0Ms, aod::CentFV0As, aod::FT0Mults, aod::FV0Mults, aod::TPCMults, aod::EPCalibrationTables, aod::QvectorFT0CVecs, aod::QvectorFT0AVecs, aod::QvectorFT0MVecs, aod::QvectorFV0AVecs, aod::QvectorTPCallVecs, aod::QvectorTPCposVecs, aod::QvectorTPCnegVecs>::iterator;

HistogramRegistry general{"general", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
HistogramRegistry flow_ep{"flow_ep", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
HistogramRegistry flow_qvec{"flow_qvec", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
HistogramRegistry flow_comp{"flow_comp", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.

template <class collision_t>
bool eventSelection(collision_t& collision)
Expand All @@ -130,7 +128,7 @@

float computeEventPlane(float y, float x)
{
return 0.5 * TMath::ATan2(y, x);

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

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}

void initCCDB(aod::BCsWithTimestamps::iterator const& bc)
Expand All @@ -138,10 +136,10 @@
if (mRunNumber == bc.runNumber()) {
return;
}
auto run3grp_timestamp = bc.timestamp();

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
mRunNumber = bc.runNumber();

if (cfgBz > -990) {

Check failure on line 142 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 @@ -173,15 +171,15 @@

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

const AxisSpec QxAxis{cfgQvecBins, Form("Q_{%d,x}", cfgHarmonics.value)};
const AxisSpec QyAxis{cfgQvecBins, Form("Q_{%d,y}", cfgHarmonics.value)};
const AxisSpec QxAxis{cfgQvecBins, Form("Q_{%.0f,x}", cfgHarmonic.value)};
const AxisSpec QyAxis{cfgQvecBins, Form("Q_{%.0f,y}", cfgHarmonic.value)};

const AxisSpec NormQxAxis{cfgQvecBins, Form("#frac{Q_{%d,x}}{||#vec{Q_{%d}}||}", cfgHarmonics.value, cfgHarmonics.value)};
const AxisSpec NormQyAxis{cfgQvecBins, Form("#frac{Q_{%d,y}}{||#vec{Q_{%d}}||}", cfgHarmonics.value, cfgHarmonics.value)};
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 psiAxis{cfgPhiBins, Form("#psi_{%d}", cfgHarmonics.value)};
const AxisSpec psiCompAxis{cfgPhiBins, Form("#psi_{%d}^{EP} - #psi_{%d}^{Qvec}", cfgHarmonics.value, cfgHarmonics.value)};
const AxisSpec cosPsiCompAxis{cfgCosPhiBins, Form("cos[2(#psi_{%d}^{EP} - #psi_{%d}^{Qvec})]", cfgHarmonics.value, cfgHarmonics.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)};
const AxisSpec cosPsiCompAxis{cfgCosPhiBins, Form("cos[2(#psi_{%.0f}^{EP} - #psi_{%.0f}^{Qvec})]", cfgHarmonic.value, cfgHarmonic.value)};

// z vertex histogram
general.add("hRecVtxZData", "collision z position", HistType::kTH1F, {{200, -20., +20., "z position (cm)"}});
Expand All @@ -205,12 +203,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}_{%d}^{%s} #upoint #vec{Q}_{%d}^{%s}", cfgHarmonics.value, qVecDetectorNames[iQvecDet].c_str(), cfgHarmonics.value, qVecDetectorNames[jQvecDet].c_str());
auto spLabel = Form("#vec{Q}_{%.0f}^{%s} #upoint #vec{Q}_{%.0f}^{%s}", cfgHarmonic.value, qVecDetectorNames[iQvecDet].c_str(), 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}_{%d}^{%s} #upoint #vec{Q}_{%d}^{%s}}{||#vec{Q}_{%d}^{%s}|| ||#vec{Q}_{%d}^{%s}||}", cfgHarmonics.value, qVecDetectorNames[iQvecDet].c_str(), cfgHarmonics.value, qVecDetectorNames[jQvecDet].c_str(), cfgHarmonics.value, qVecDetectorNames[iQvecDet].c_str(), cfgHarmonics.value, qVecDetectorNames[jQvecDet].c_str());
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());

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 @@ -263,52 +261,52 @@
// EP method
float QmodFT0A_EP = collision.qFT0A();
float psiFT0A_EP = collision.psiFT0A();
float QxFT0A_EP = QmodFT0A_EP * std::cos(2 * psiFT0A_EP);
float QyFT0A_EP = QmodFT0A_EP * std::sin(2 * psiFT0A_EP);
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 psiFT0C_EP = collision.psiFT0C();
float QxFT0C_EP = QmodFT0C_EP * std::cos(2 * psiFT0C_EP);
float QyFT0C_EP = QmodFT0C_EP * std::sin(2 * psiFT0C_EP);
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 psiTPCl_EP = collision.psiTPCL();
float QxTPCl_EP = QmodTPCl_EP * std::cos(2 * psiTPCl_EP);
float QyTPCl_EP = QmodTPCl_EP * std::sin(2 * psiTPCl_EP);
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 psiTPCr_EP = collision.psiTPCR();
float QxTPCr_EP = QmodTPCr_EP * std::cos(2 * psiTPCr_EP);
float QyTPCr_EP = QmodTPCr_EP * std::sin(2 * psiTPCr_EP);
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 psiTPC_EP = collision.psiTPC();
float QxTPC_EP = QmodTPC_EP * std::cos(2 * psiTPC_EP);
float QyTPC_EP = QmodTPC_EP * std::sin(2 * psiTPC_EP);
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()[cfgHarmonics - 2];
float QyFT0A_Qvec = collision.qvecFT0AImVec()[cfgHarmonics - 2];
float QxFT0A_Qvec = collision.qvecFT0AReVec()[cfgHarmonic.value - 2];
float QyFT0A_Qvec = 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()[cfgHarmonics - 2];
float QyFT0C_Qvec = collision.qvecFT0CImVec()[cfgHarmonics - 2];
float QxFT0C_Qvec = collision.qvecFT0CReVec()[cfgHarmonic.value - 2];
float QyFT0C_Qvec = 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()[cfgHarmonics - 2];
float QyTPCl_Qvec = collision.qvecTPCnegImVec()[cfgHarmonics - 2];
float QxTPCl_Qvec = collision.qvecTPCnegReVec()[cfgHarmonic.value - 2];
float QyTPCl_Qvec = 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()[cfgHarmonics - 2];
float QyTPCr_Qvec = collision.qvecTPCposImVec()[cfgHarmonics - 2];
float QxTPCr_Qvec = collision.qvecTPCposReVec()[cfgHarmonic.value - 2];
float QyTPCr_Qvec = 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()[cfgHarmonics - 2];
float QyTPC_Qvec = collision.qvecTPCallImVec()[cfgHarmonics - 2];
float QxTPC_Qvec = collision.qvecTPCallReVec()[cfgHarmonic.value - 2];
float QyTPC_Qvec = 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 @@ -340,7 +338,7 @@
}
for (int iQvecDet = 0; iQvecDet < qVecDetectors::kNqVecDetectors; iQvecDet++) {
hPsiComp[iQvecDet]->Fill(centrality, vec_Qpsi[methods::kEP][iQvecDet] - vec_Qpsi[methods::kQvec][iQvecDet]);
hCosPsiComp[iQvecDet]->Fill(centrality, std::cos(2 * (vec_Qpsi[methods::kEP][iQvecDet] - vec_Qpsi[methods::kQvec][iQvecDet])));
hCosPsiComp[iQvecDet]->Fill(centrality, std::cos(cfgHarmonic.value * (vec_Qpsi[methods::kEP][iQvecDet] - vec_Qpsi[methods::kQvec][iQvecDet])));
}
}
};
Expand Down
Loading