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
36 changes: 36 additions & 0 deletions Common/TableProducer/qVectorsTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
///

#include "Common/Core/EventPlaneHelper.h"
#include "Common/Core/MetadataHelper.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/FT0Corrected.h"
Expand Down Expand Up @@ -59,6 +60,8 @@
using namespace o2;
using namespace o2::framework;

o2::common::core::MetadataHelper metadataInfo; // Metadata helper

using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::FT0sCorrected,
aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As>;

Expand Down Expand Up @@ -92,7 +95,7 @@
// Configurables.
struct : ConfigurableGroup {
Configurable<std::string> cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"};
Configurable<int64_t> ccdbNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"};

Check failure on line 98 in Common/TableProducer/qVectorsTable.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.)
} cfgCcdbParam;

Configurable<int> cfgCentEsti{"cfgCentEsti", 2, "Centrality estimator (Run3): 0 = FT0M, 1 = FT0A, 2 = FT0C, 3 = FV0A"};
Expand All @@ -106,6 +109,7 @@
Configurable<std::vector<int>> cfgnMods{"cfgnMods", {2, 3}, "Modulation of interest"};
Configurable<float> cfgMaxCentrality{"cfgMaxCentrality", 100.f, "max. centrality for Q vector calibration"};

Configurable<bool> autodetectApass{"autodetectApass", false, "Automatically detect the analysis pass of the Qvector corrections"};
Configurable<bool> useCorrectionForRun{"useCorrectionForRun", true, "Get Qvector corrections based on run number instead of timestamp"};
Configurable<std::string> cfgGainEqPath{"cfgGainEqPath", "Users/j/junlee/Qvector/GainEq", "CCDB path for gain equalization constants"};
Configurable<std::string> cfgQvecCalibPath{"cfgQvecCalibPath", "Analysis/EventPlane/QVecCorrections", "CCDB path for Q-vector calibration constants"};
Expand Down Expand Up @@ -293,14 +297,27 @@
}

corrsQvecSp.clear();
std::string periodFolder;
if (autodetectApass) {
// Construct a subfolder like LHCXX_apassY
int maxCharactersLHCYear = 5; // LHCXX
periodFolder = "/" + metadataInfo.get("LPMProductionTag").substr(0, maxCharactersLHCYear) +
"_" + metadataInfo.get("RecoPassName");
}
for (std::size_t i = 0; i < cfgnMods->size(); i++) {
int ind = cfgnMods->at(i);
fullPath = cfgQvecCalibPath;
if (autodetectApass) {
fullPath += periodFolder;
}
fullPath += "/v";
fullPath += std::to_string(ind);
auto modeCorrQvecSp = getForTsOrRun<TH3F>(fullPath, timestamp, runnumber);
if (!modeCorrQvecSp) {
fullPath = cfgQvecCalibPath;
if (autodetectApass) {
fullPath += periodFolder;
}
fullPath += "/v2";
modeCorrQvecSp = getForTsOrRun<TH3F>(fullPath, timestamp, runnumber);
}
Expand All @@ -316,11 +333,17 @@
for (std::size_t i = 0; i < cfgnMods->size(); i++) {
int ind = cfgnMods->at(i);
fullPath = cfgQvecCalibPath;
if (autodetectApass) {
fullPath += periodFolder;
}
fullPath += "/eseq";
fullPath += std::to_string(ind);
auto modeCorrQvecEse = getForTsOrRun<TH3F>(fullPath, timestamp, runnumber);
if (!modeCorrQvecEse) {
fullPath = cfgQvecCalibPath;
if (autodetectApass) {
fullPath += periodFolder;
}
fullPath += "/eseq2";
modeCorrQvecEse = getForTsOrRun<TH3F>(fullPath, timestamp, runnumber);
}
Expand All @@ -337,6 +360,9 @@
for (std::size_t i = 0; i < cfgnMods->size(); i++) {
int ind = cfgnMods->at(i);
fullPath = cfgShiftPath;
if (autodetectApass) {
fullPath += periodFolder;
}
fullPath += "/v";
fullPath += std::to_string(ind);
auto objshift = getForTsOrRun<TProfile3D>(fullPath, timestamp, runnumber);
Expand All @@ -352,6 +378,9 @@
for (std::size_t i = 0; i < cfgnMods->size(); i++) {
int ind = cfgnMods->at(i);
fullPath = cfgShiftPath;
if (autodetectApass) {
fullPath += periodFolder;
}
fullPath += "/eseq";
fullPath += std::to_string(ind);
auto objshift = getForTsOrRun<TProfile3D>(fullPath, timestamp, runnumber);
Expand All @@ -365,6 +394,9 @@
}

fullPath = cfgGainEqPath;
if (autodetectApass) {
fullPath += periodFolder + "/GainEq";
}
fullPath += "/FT0";
const int nPixelsFT0 = 208;
auto const* objft0Gain = getForTsOrRun<std::vector<float>>(fullPath, timestamp, runnumber);
Expand All @@ -377,6 +409,9 @@
}

fullPath = cfgGainEqPath;
if (autodetectApass) {
fullPath += periodFolder + "/GainEq";
}
fullPath += "/FV0";
const int nChannelsFV0 = 48;
auto const* objfv0Gain = getForTsOrRun<std::vector<float>>(fullPath, timestamp, runnumber);
Expand Down Expand Up @@ -917,6 +952,7 @@

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
metadataInfo.initMetadata(cfgc);
return WorkflowSpec{
adaptAnalysisTask<QVectorsTable>(cfgc)};
}
Loading