Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
chengtt0406 committed Jan 11, 2024
2 parents 1c3a89d + 4293687 commit 5fc4de0
Show file tree
Hide file tree
Showing 231 changed files with 18,754 additions and 5,818 deletions.
4 changes: 2 additions & 2 deletions ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ struct OnTheFlyTOFPID {

if (scalarProduct1 > scalarProduct2) {
modulus = std::hypot(point1[0] - trcCircle.xC, point1[1] - trcCircle.yC) * std::hypot(startPoint[0] - trcCircle.xC, startPoint[1] - trcCircle.yC);
cosAngle = (point1[0] - trcCircle.xC) * (startPoint[0] - trcCircle.xC) + (point1[1] - trcCircle.yC) * (startPoint[0] - trcCircle.yC);
cosAngle = (point1[0] - trcCircle.xC) * (startPoint[0] - trcCircle.xC) + (point1[1] - trcCircle.yC) * (startPoint[1] - trcCircle.yC);
} else {
modulus = std::hypot(point2[0] - trcCircle.xC, point2[1] - trcCircle.yC) * std::hypot(startPoint[0] - trcCircle.xC, startPoint[1] - trcCircle.yC);
cosAngle = (point2[0] - trcCircle.xC) * (startPoint[0] - trcCircle.xC) + (point2[1] - trcCircle.yC) * (startPoint[0] - trcCircle.yC);
cosAngle = (point2[0] - trcCircle.xC) * (startPoint[0] - trcCircle.xC) + (point2[1] - trcCircle.yC) * (startPoint[1] - trcCircle.yC);
}
cosAngle /= modulus;
length = trcCircle.rC * TMath::ACos(cosAngle);
Expand Down
3 changes: 2 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/DPG @alibuild @chiarazampolli @noferini
/DPG/Tasks/AOTEvent @alibuild @ekryshen @strogolo
/DPG/Tasks/AOTTrack @alibuild @mfaggin @belikov @njacazio
/DPG/Tasks/TOF @alibuild @noferini @njacazio
/EventFiltering @alibuild @mpuccio @strogolo
/EventFiltering/PWGHF @alibuild @fgrosa @zhangbiao-phy @vkucera @mpuccio @strogolo
/EventFiltering/PWGUD @alibuild @pbuehler @mpuccio @strogolo
Expand All @@ -31,7 +32,7 @@
/PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @ivorobye @feisenhu
/PWGEM/PhotonMeson @alibuild @mikesas @rbailhac @m-c-danisch @novitzky @mhemmer-cern @dsekihat
/PWGHF @alibuild @vkucera @fcolamar @fgrosa @fcatalan92 @mfaggin @mmazzilli @deepathoms @nzardosh @NicoleBastid
/PWGLF @alibuild @lramona @alcaliva @lbariogl @chiarapinto @BongHwi @lbarnby @mbombara @iravasen @njacazio @ChiaraDeMartin95 @skundu692
/PWGLF @alibuild @fmazzasc @chiarapinto @BongHwi @smaff92 @mbombara @ChiaraDeMartin95 @njacazio @skundu692
/PWGMM @alibuild @aalkin
/PWGMM/Lumi @alibuild @aalkin
/PWGMM/Mult @alibuild @aalkin @aortizve @ddobrigk
Expand Down
12 changes: 6 additions & 6 deletions Common/Core/CollisionAssociation.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ class CollisionAssociation
RevIndices& reverseIndices)
{
// cache globalBC
std::vector<uint64_t> globalBC;
std::vector<int64_t> globalBC;
for (const auto& track : tracks) {
if (track.has_collision()) {
globalBC.push_back(track.collision().bc().globalBC());
globalBC.push_back((int64_t)track.collision().bc().globalBC());
} else {
for (const auto& ambTrack : ambiguousTracks) {
if constexpr (isCentralBarrel) { // FIXME: to be removed as soon as it is possible to use getId<Table>() for joined tables
Expand All @@ -137,12 +137,12 @@ class CollisionAssociation
globalBC.push_back(-1);
break;
}
globalBC.push_back(ambTrack.bc().begin().globalBC());
globalBC.push_back((int64_t)ambTrack.bc().begin().globalBC());
break;
}
} else {
if (ambTrack.template getId<TTracks>() == track.globalIndex()) {
globalBC.push_back(ambTrack.bc().begin().globalBC());
globalBC.push_back((int64_t)ambTrack.bc().begin().globalBC());
break;
}
}
Expand Down Expand Up @@ -170,15 +170,15 @@ class CollisionAssociation
if (globalBC[track.filteredIndex()] < 0) {
continue;
}
const int64_t bcOffsetWindow = (int64_t)globalBC[track.filteredIndex()] + trackTime / o2::constants::lhc::LHCBunchSpacingNS - (int64_t)collBC;
const int64_t bcOffsetWindow = globalBC[track.filteredIndex()] + trackTime / o2::constants::lhc::LHCBunchSpacingNS - (int64_t)collBC;
if (std::abs(bcOffsetWindow) > bOffsetMax) {
continue;
}

float trackTimeRes = track.trackTimeRes();
if constexpr (isCentralBarrel) {
if (mUsePvAssociation && track.isPVContributor()) {
trackTime = track.collision().collisionTime(); // if PV contributor, we assume the time to be the one of the collision
trackTime = track.collision().collisionTime(); // if PV contributor, we assume the time to be the one of the collision
trackTimeRes = o2::constants::lhc::LHCBunchSpacingNS; // 1 BC
}
}
Expand Down
4 changes: 2 additions & 2 deletions Common/Core/EventPlaneHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ void EventPlaneHelper::GetCorrTwistRecale(const std::shared_ptr<TH2> histQ,
lambdaMinus = b / aMinus;
}

float EventPlaneHelper::GetEventPlane(const float qx, const float qy)
float EventPlaneHelper::GetEventPlane(const float qx, const float qy, int nmode)
{
return (TMath::ATan2(qy, qx));
return (1. / nmode) * (TMath::ATan2(qy, qx));
}

float EventPlaneHelper::GetResolution(const float RefA, const float RefB, const float sig, int nmode)
Expand Down
2 changes: 1 addition & 1 deletion Common/Core/EventPlaneHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class EventPlaneHelper
float& lambdaPlus, float& lambdaMinus);

// Method to calculate the event plane from the provided (Qx, Qy), for n = 2.
float GetEventPlane(const float qx, const float qy);
float GetEventPlane(const float qx, const float qy, int nmode = 2);

// Method to calculate the resolution R2 for the provided profile.
float GetResolution(const float RefA, const float RefB, const float sig, int nmode = 2);
Expand Down
29 changes: 25 additions & 4 deletions Common/Core/TableHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,39 @@ void printTablesInWorkflow(o2::framework::InitContext& initContext)
/// @param table name of the table to check for
bool isTableRequiredInWorkflow(o2::framework::InitContext& initContext, const std::string& table)
{
LOG(info) << "Checking if table " << table << " is needed";
LOG(debug) << "Checking if table " << table << " is needed";
bool tableNeeded = false;
auto& workflows = initContext.services().get<o2::framework::RunningWorkflowInfo const>();
for (auto const& device : workflows.devices) {
for (auto const& input : device.inputs) {
if (input.matcher.binding == table) {
LOG(info) << "Table: " << input.matcher.binding << " is needed in device: " << device.name;
LOG(debug) << "Table: " << input.matcher.binding << " is needed in device: " << device.name;
tableNeeded = true;
}
}
}
return tableNeeded;
}

/// Function to enable or disable a configurable flag, depending on the fact that a table is needed or not
/// @param initContext initContext of the init function
/// @param table name of the table to check for
/// @param flag bool value of flag to set, if the given value is true it will be kept, disregarding the table usage in the workflow.
void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, bool& flag)
{
if (flag) {
LOG(info) << "Table enabled: " + table;
return;
}
if (isTableRequiredInWorkflow(initContext, table)) {
flag = true;
LOG(info) << "Auto-enabling table: " + table;
return;
}
flag = false;
LOG(info) << "Table disabled and not required: " + table;
}

/// Function to enable or disable a configurable flag, depending on the fact that a table is needed or not
/// @param initContext initContext of the init function
/// @param table name of the table to check for
Expand All @@ -68,8 +87,10 @@ void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const st
if (flag < 0) {
flag = 1;
LOG(info) << "Auto-enabling table: " + table;
} else {
LOG(info) << "Table disabled: " + table;
return;
}
LOG(info) << "Table disabled but required: " + table;
}
flag = 0;
LOG(info) << "Table disabled and not required: " + table;
}
13 changes: 12 additions & 1 deletion Common/Core/TableHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ void printTablesInWorkflow(o2::framework::InitContext& initContext);
/// @param table name of the table to check for
bool isTableRequiredInWorkflow(o2::framework::InitContext& initContext, const std::string& table);

/// Function to enable or disable a configurable flag, depending on the fact that a table is needed or not
/// @param initContext initContext of the init function
/// @param table name of the table to check for
/// @param flag bool value of flag to set, if the given value is true it will be kept, disregarding the table usage in the workflow.
void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, bool& flag);

/// Function to enable or disable a configurable flag, depending on the fact that a table is needed or not
/// @param initContext initContext of the init function
/// @param table name of the table to check for
Expand All @@ -48,7 +54,12 @@ void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const st
enableFlagIfTableRequired(initContext, table, flag.value);
}

/// Function to check for a specific configurable in the current workflow
/// Function to check for a specific configurable from another task in the current workflow and fetch its value. Useful for tasks that need to know the value of a configurable in another task.
/// @param initContext initContext of the init function
/// @param taskName name of the task to check for
/// @param optName name of the option to check for
/// @param value value of the option to set
/// @param verbose if true, print debug messages
template <typename ValueType>
bool getTaskOptionValue(o2::framework::InitContext& initContext, const std::string& taskName, const std::string& optName, ValueType& value, const bool verbose = true)
{
Expand Down
62 changes: 6 additions & 56 deletions Common/DataModel/Qvectors.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,57 +30,21 @@ namespace qvec
{
DECLARE_SOA_COLUMN(Cent, cent, float);
DECLARE_SOA_COLUMN(CentBin, centBin, int);
DECLARE_SOA_COLUMN(QvecFT0CUncorRe, qvecFT0CUncorRe, float);
DECLARE_SOA_COLUMN(QvecFT0CUncorIm, qvecFT0CUncorIm, float);
DECLARE_SOA_COLUMN(QvecFT0CRectrRe, qvecFT0CRectrRe, float);
DECLARE_SOA_COLUMN(QvecFT0CRectrIm, qvecFT0CRectrIm, float);
DECLARE_SOA_COLUMN(QvecFT0CTwistRe, qvecFT0CTwistRe, float);
DECLARE_SOA_COLUMN(QvecFT0CTwistIm, qvecFT0CTwistIm, float);

DECLARE_SOA_COLUMN(QvecRe, qvecRe, std::vector<float>);
DECLARE_SOA_COLUMN(QvecIm, qvecIm, std::vector<float>);
DECLARE_SOA_COLUMN(QvecAmp, qvecAmp, std::vector<float>);

DECLARE_SOA_COLUMN(QvecFT0CRe, qvecFT0CRe, float);
DECLARE_SOA_COLUMN(QvecFT0CIm, qvecFT0CIm, float);

DECLARE_SOA_COLUMN(QvecFT0AUncorRe, qvecFT0AUncorRe, float);
DECLARE_SOA_COLUMN(QvecFT0AUncorIm, qvecFT0AUncorIm, float);
DECLARE_SOA_COLUMN(QvecFT0ARectrRe, qvecFT0ARectrRe, float);
DECLARE_SOA_COLUMN(QvecFT0ARectrIm, qvecFT0ARectrIm, float);
DECLARE_SOA_COLUMN(QvecFT0ATwistRe, qvecFT0ATwistRe, float);
DECLARE_SOA_COLUMN(QvecFT0ATwistIm, qvecFT0ATwistIm, float);
DECLARE_SOA_COLUMN(QvecFT0ARe, qvecFT0ARe, float);
DECLARE_SOA_COLUMN(QvecFT0AIm, qvecFT0AIm, float);

DECLARE_SOA_COLUMN(QvecFT0MUncorRe, qvecFT0MUncorRe, float);
DECLARE_SOA_COLUMN(QvecFT0MUncorIm, qvecFT0MUncorIm, float);
DECLARE_SOA_COLUMN(QvecFT0MRectrRe, qvecFT0MRectrRe, float);
DECLARE_SOA_COLUMN(QvecFT0MRectrIm, qvecFT0MRectrIm, float);
DECLARE_SOA_COLUMN(QvecFT0MTwistRe, qvecFT0MTwistRe, float);
DECLARE_SOA_COLUMN(QvecFT0MTwistIm, qvecFT0MTwistIm, float);
DECLARE_SOA_COLUMN(QvecFT0MRe, qvecFT0MRe, float);
DECLARE_SOA_COLUMN(QvecFT0MIm, qvecFT0MIm, float);

DECLARE_SOA_COLUMN(QvecFV0AUncorRe, qvecFV0AUncorRe, float);
DECLARE_SOA_COLUMN(QvecFV0AUncorIm, qvecFV0AUncorIm, float);
DECLARE_SOA_COLUMN(QvecFV0ARectrRe, qvecFV0ARectrRe, float);
DECLARE_SOA_COLUMN(QvecFV0ARectrIm, qvecFV0ARectrIm, float);
DECLARE_SOA_COLUMN(QvecFV0ATwistRe, qvecFV0ATwistRe, float);
DECLARE_SOA_COLUMN(QvecFV0ATwistIm, qvecFV0ATwistIm, float);
DECLARE_SOA_COLUMN(QvecFV0ARe, qvecFV0ARe, float);
DECLARE_SOA_COLUMN(QvecFV0AIm, qvecFV0AIm, float);

DECLARE_SOA_COLUMN(QvecBPosUncorRe, qvecBPosUncorRe, float);
DECLARE_SOA_COLUMN(QvecBPosUncorIm, qvecBPosUncorIm, float);
DECLARE_SOA_COLUMN(QvecBPosRectrRe, qvecBPosRectrRe, float);
DECLARE_SOA_COLUMN(QvecBPosRectrIm, qvecBPosRectrIm, float);
DECLARE_SOA_COLUMN(QvecBPosTwistRe, qvecBPosTwistRe, float);
DECLARE_SOA_COLUMN(QvecBPosTwistIm, qvecBPosTwistIm, float);
DECLARE_SOA_COLUMN(QvecBPosRe, qvecBPosRe, float);
DECLARE_SOA_COLUMN(QvecBPosIm, qvecBPosIm, float);

DECLARE_SOA_COLUMN(QvecBNegUncorRe, qvecBNegUncorRe, float);
DECLARE_SOA_COLUMN(QvecBNegUncorIm, qvecBNegUncorIm, float);
DECLARE_SOA_COLUMN(QvecBNegRectrRe, qvecBNegRectrRe, float);
DECLARE_SOA_COLUMN(QvecBNegRectrIm, qvecBNegRectrIm, float);
DECLARE_SOA_COLUMN(QvecBNegTwistRe, qvecBNegTwistRe, float);
DECLARE_SOA_COLUMN(QvecBNegTwistIm, qvecBNegTwistIm, float);
DECLARE_SOA_COLUMN(QvecBNegRe, qvecBNegRe, float);
DECLARE_SOA_COLUMN(QvecBNegIm, qvecBNegIm, float);

Expand All @@ -95,21 +59,7 @@ DECLARE_SOA_COLUMN(LabelsBNeg, labelsBNeg, std::vector<int>);
} // namespace qvec

DECLARE_SOA_TABLE(Qvectors, "AOD", "QVECTORDEVS", //! Table with all Qvectors.
qvec::Cent, qvec::CentBin,
qvec::QvecFT0CUncorRe, qvec::QvecFT0CUncorIm, qvec::QvecFT0CRectrRe, qvec::QvecFT0CRectrIm,
qvec::QvecFT0CTwistRe, qvec::QvecFT0CTwistIm, qvec::QvecFT0CRe, qvec::QvecFT0CIm,
qvec::QvecFT0AUncorRe, qvec::QvecFT0AUncorIm, qvec::QvecFT0ARectrRe, qvec::QvecFT0ARectrIm,
qvec::QvecFT0ATwistRe, qvec::QvecFT0ATwistIm, qvec::QvecFT0ARe, qvec::QvecFT0AIm,
qvec::QvecFT0MUncorRe, qvec::QvecFT0MUncorIm, qvec::QvecFT0MRectrRe, qvec::QvecFT0MRectrIm,
qvec::QvecFT0MTwistRe, qvec::QvecFT0MTwistIm, qvec::QvecFT0MRe, qvec::QvecFT0MIm,
qvec::QvecFV0AUncorRe, qvec::QvecFV0AUncorIm, qvec::QvecFV0ARectrRe, qvec::QvecFV0ARectrIm,
qvec::QvecFV0ATwistRe, qvec::QvecFV0ATwistIm, qvec::QvecFV0ARe, qvec::QvecFV0AIm,
qvec::QvecBPosUncorRe, qvec::QvecBPosUncorIm, qvec::QvecBPosRectrRe, qvec::QvecBPosRectrIm,
qvec::QvecBPosTwistRe, qvec::QvecBPosTwistIm, qvec::QvecBPosRe, qvec::QvecBPosIm,
qvec::QvecBNegUncorRe, qvec::QvecBNegUncorIm, qvec::QvecBNegRectrRe, qvec::QvecBNegRectrIm,
qvec::QvecBNegTwistRe, qvec::QvecBNegTwistIm, qvec::QvecBNegRe, qvec::QvecBNegIm,
qvec::SumAmplFT0C, qvec::SumAmplFT0A, qvec::SumAmplFT0M, qvec::SumAmplFV0A, qvec::NTrkBPos, qvec::NTrkBNeg,
qvec::LabelsBPos, qvec::LabelsBNeg);
qvec::Cent, qvec::CentBin, qvec::QvecRe, qvec::QvecIm, qvec::QvecAmp);
using Qvector = Qvectors::iterator;

DECLARE_SOA_TABLE(QvectorFT0Cs, "AOD", "QVECTORSFT0C", qvec::CentBin, qvec::QvecFT0CRe, qvec::QvecFT0CIm, qvec::SumAmplFT0C);
Expand Down
5 changes: 5 additions & 0 deletions Common/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ o2physics_add_dpl_workflow(weak-decay-indices
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(v0converter
SOURCES v0converter.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(ft0-corrected-table
SOURCES ft0CorrectedTable.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
Expand Down
8 changes: 6 additions & 2 deletions Common/TableProducer/multiplicityTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ struct MultiplicityTableTaskIndexed {
Configurable<LabeledArray<int>> enabledTables{"enabledTables",
{defaultParameters[0], nTables, nParameters, tableNames, parameterNames},
"Produce tables depending on needs. Values different than -1 override the automatic setup: the corresponding table can be set off (0) or on (1)"};

Configurable<std::string> ccdbUrl{"ccdburl", "http://alice-ccdb.cern.ch", "The CCDB endpoint url address"};
Configurable<std::string> ccdbPath{"ccdbpath", "Centrality/Calibration", "The CCDB path for centrality/multiplicity information"};

int mRunNumber;
bool lCalibLoaded;
TList* lCalibObjects;
Expand Down Expand Up @@ -138,7 +142,7 @@ struct MultiplicityTableTaskIndexed {
hVtxZFDDC = nullptr;
hVtxZNTracks = nullptr;

ccdb->setURL("http://alice-ccdb.cern.ch");
ccdb->setURL(ccdbUrl);
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
ccdb->setFatalWhenNull(false); // don't fatal, please - exception is caught explicitly (as it should)
Expand Down Expand Up @@ -284,7 +288,7 @@ struct MultiplicityTableTaskIndexed {
if (doVertexZeq > 0) {
if (bc.runNumber() != mRunNumber) {
mRunNumber = bc.runNumber(); // mark this run as at least tried
lCalibObjects = ccdb->getForTimeStamp<TList>("Centrality/Calibration", bc.timestamp());
lCalibObjects = ccdb->getForTimeStamp<TList>(ccdbPath, bc.timestamp());
if (lCalibObjects) {
hVtxZFV0A = static_cast<TProfile*>(lCalibObjects->FindObject("hVtxZFV0A"));
hVtxZFT0A = static_cast<TProfile*>(lCalibObjects->FindObject("hVtxZFT0A"));
Expand Down
Loading

0 comments on commit 5fc4de0

Please sign in to comment.