Skip to content

Commit

Permalink
Merge branch 'AliceO2Group:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Archita-Dash authored Jan 24, 2025
2 parents de7e4db + 06ae14b commit fd468ed
Show file tree
Hide file tree
Showing 186 changed files with 9,281 additions and 5,032 deletions.
1 change: 1 addition & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ infrastructure:
- '.github/**'
- '.checkov.yml'
- '.mega-linter.yml'
- '.pre-commit-config.yaml'
- 'cmake/**'
- 'CODEOWNERS'
- 'CPPLINT.cfg'
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v18.1.3" # clang-format version
hooks:
- id: clang-format
4 changes: 2 additions & 2 deletions ALICE3/TableProducer/alice3-pidTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct ALICE3pidTOFTask {
if (!track.hasTOF()) {
return -999.f;
}
return ((track.trackTime() - track.collision().collisionTime()) * 1000.f - o2::pid::tof::ExpTimes<Trks::iterator, id>::ComputeExpectedTime(track.tofExpMom() / o2::pid::tof::kCSPEED,
return ((track.trackTime() - track.collision().collisionTime()) * 1000.f - o2::pid::tof::ExpTimes<Trks::iterator, id>::ComputeExpectedTime(track.tofExpMom() * o2::constants::physics::invLightSpeedCm2PS,
track.length())) /
sigma<id>(track);
}
Expand Down Expand Up @@ -294,7 +294,7 @@ struct ALICE3pidTOFTaskQA {
//
// histos.fill(HIST("event/tofsignal"), t.p(), t.tofSignal());
histos.fill(HIST("event/tofsignal"), t.p(), tofSignal);
histos.fill(HIST("event/pexp"), t.p(), t.tofExpMom() / o2::pid::tof::kCSPEED);
histos.fill(HIST("event/pexp"), t.p(), t.tofExpMom() * o2::constants::physics::invLightSpeedCm2PS);
histos.fill(HIST("event/eta"), t.eta());
histos.fill(HIST("event/length"), t.length());
histos.fill(HIST("event/pt"), t.pt());
Expand Down
2 changes: 0 additions & 2 deletions Common/Core/PID/PIDTOF.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ namespace o2::pid::tof
{

// Utility values (to remove!)
static constexpr float kCSPEED = TMath::C() * 1.0e2f * 1.0e-12f; /// Speed of light in TOF units (cm/ps)
static constexpr float kCSPEDDInv = 1.f / kCSPEED; /// Inverse of the Speed of light in TOF units (ps/cm)
static constexpr float defaultReturnValue = -999.f; /// Default return value in case TOF measurement is not available

/// \brief Class to handle the the TOF detector response for the TOF beta measurement
Expand Down
45 changes: 42 additions & 3 deletions Common/TableProducer/centralityTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ static constexpr int kCentFT0As = 8;
static constexpr int kCentFT0Cs = 9;
static constexpr int kCentFDDMs = 10;
static constexpr int kCentNTPVs = 11;
static constexpr int nTables = 12;
static constexpr int kCentNGlobals = 12;
static constexpr int kCentMFTs = 13;
static constexpr int nTables = 14;
static constexpr int nParameters = 1;
static const std::vector<std::string> tableNames{"CentRun2V0Ms",
"CentRun2V0As",
Expand All @@ -57,9 +59,11 @@ static const std::vector<std::string> tableNames{"CentRun2V0Ms",
"CentFT0As",
"CentFT0Cs",
"CentFDDMs",
"CentNTPVs"};
"CentNTPVs",
"CentNGlobals",
"CentMFTs"};
static const std::vector<std::string> parameterNames{"Enable"};
static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}};
static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}};

struct CentralityTable {
Produces<aod::CentRun2V0Ms> centRun2V0M;
Expand All @@ -74,6 +78,8 @@ struct CentralityTable {
Produces<aod::CentFT0Cs> centFT0C;
Produces<aod::CentFDDMs> centFDDM;
Produces<aod::CentNTPVs> centNTPV;
Produces<aod::CentNGlobals> centNGlobals;
Produces<aod::CentMFTs> centMFTs;
Service<o2::ccdb::BasicCCDBManager> ccdb;
Configurable<LabeledArray<int>> enabledTables{"enabledTables",
{defaultParameters[0], nTables, nParameters, tableNames, parameterNames},
Expand Down Expand Up @@ -162,6 +168,8 @@ struct CentralityTable {
calibrationInfo FT0CInfo = calibrationInfo("FT0C");
calibrationInfo FDDMInfo = calibrationInfo("FDD");
calibrationInfo NTPVInfo = calibrationInfo("NTracksPV");
calibrationInfo NGlobalInfo = calibrationInfo("NGlobal");
calibrationInfo MFTInfo = calibrationInfo("MFT");
std::vector<int> mEnabledTables; // Vector of enabled tables
std::array<bool, nTables> isTableEnabled;

Expand Down Expand Up @@ -438,6 +446,8 @@ struct CentralityTable {
bool enableCentFT0 = true,
bool enableCentFDD = true,
bool enableCentNTPV = true,
bool enableCentNGlobal = false,
bool enableCentMFT = false,
typename CollisionType>
void produceRun3Tables(CollisionType const& collisions)
{
Expand All @@ -462,6 +472,12 @@ struct CentralityTable {
case kCentNTPVs:
centNTPV.reserve(collisions.size());
break;
case kCentNGlobals:
centNGlobals.reserve(collisions.size());
break;
case kCentMFTs:
centMFTs.reserve(collisions.size());
break;
default:
LOGF(fatal, "Table %d not supported in Run3", table);
break;
Expand Down Expand Up @@ -505,6 +521,8 @@ struct CentralityTable {
FT0CInfo.mCalibrationStored = false;
FDDMInfo.mCalibrationStored = false;
NTPVInfo.mCalibrationStored = false;
NGlobalInfo.mCalibrationStored = false;
MFTInfo.mCalibrationStored = false;
if (callst != nullptr) {
if (produceHistograms) {
listCalib->Add(callst->Clone(Form("%i", bc.runNumber())));
Expand Down Expand Up @@ -552,6 +570,12 @@ struct CentralityTable {
case kCentNTPVs:
getccdb(NTPVInfo, ccdbConfig.genName);
break;
case kCentNGlobals:
getccdb(NGlobalInfo, ccdbConfig.genName);
break;
case kCentMFTs:
getccdb(MFTInfo, ccdbConfig.genName);
break;
default:
LOGF(fatal, "Table %d not supported in Run3", table);
break;
Expand Down Expand Up @@ -658,6 +682,16 @@ struct CentralityTable {
populateTable(centNTPV, NTPVInfo, collision.multZeqNTracksPV());
}
break;
case kCentNGlobals:
if constexpr (enableCentNGlobal) {
populateTable(centNGlobals, NGlobalInfo, collision.multNTracksGlobal());
}
break;
case kCentMFTs:
if constexpr (enableCentMFT) {
populateTable(centMFTs, MFTInfo, collision.mftNtracks());
}
break;
default:
LOGF(fatal, "Table %d not supported in Run3", table);
break;
Expand All @@ -666,6 +700,11 @@ struct CentralityTable {
}
}

void processRun3Complete(soa::Join<aod::Collisions, aod::PVMults, aod::MultZeqs, aod::EvSels, aod::MultsGlobal, aod::MFTMults> const& collisions, BCsWithTimestamps const&)
{
produceRun3Tables<true, true, true, true, true, true>(collisions);
}

void processRun3(soa::Join<aod::Collisions, aod::PVMults, aod::MultZeqs, aod::EvSels> const& collisions, BCsWithTimestamps const&)
{
produceRun3Tables(collisions);
Expand Down
127 changes: 57 additions & 70 deletions Common/Tasks/flowTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ struct flowTest {

ConfigurableAxis axisB{"axisB", {100, 0.0f, 20.0f}, ""};
ConfigurableAxis axisPhi{"axisPhi", {100, 0.0f, 2.0f * TMath::Pi()}, ""};
ConfigurableAxis axisNch{"axisNch", {300, 0.0f, 3000.0f}, "Nch in |eta|<0.8"};

ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f}, "pt axis"};

void init(InitContext&)
{
// pT histograms
histos.add<TH1>("hImpactParameter", "hImpactParameter", HistType::kTH1D, {axisB});
histos.add<TH2>("hNchVsImpactParameter", "hNchVsImpactParameter", HistType::kTH2D, {axisB, axisNch});
histos.add<TH1>("hEventPlaneAngle", "hEventPlaneAngle", HistType::kTH1D, {axisPhi});
histos.add<TH2>("hPtVsPhiGenerated", "hPtVsPhiGenerated", HistType::kTH2D, {axisPhi, axisPt});
histos.add<TH2>("hPtVsPhiGlobal", "hPtVsPhiGlobal", HistType::kTH2D, {axisPhi, axisPt});
Expand Down Expand Up @@ -80,6 +82,8 @@ struct flowTest {
if (evPhi < 0)
evPhi += 2. * TMath::Pi();

long nCh = 0;

if (imp > minB && imp < maxB) {
// event within range
histos.fill(HIST("hImpactParameter"), imp);
Expand All @@ -104,6 +108,8 @@ struct flowTest {
histos.fill(HIST("hPtVsPhiGenerated"), deltaPhi, mcParticle.pt());
histos.fill(HIST("hBVsPtVsPhiGenerated"), imp, deltaPhi, mcParticle.pt());

nCh++;

bool validGlobal = false;
bool validTrack = false;
bool validTPCTrack = false;
Expand Down Expand Up @@ -146,94 +152,75 @@ struct flowTest {
histos.fill(HIST("hBVsPtVsPhiITSABTrack"), imp, deltaPhi, mcParticle.pt());
}
}
histos.fill(HIST("hNchVsImpactParameter"), imp, nCh);
}

using LabeledCascades = soa::Join<aod::CascDataExt, aod::McCascLabels>;

void processCascade(aod::McParticles const& mcParticles, LabeledCascades const& cascades, recoTracks const&, aod::McCollisions const&)
void processCascade(aod::McParticle const& mcParticle, soa::SmallGroups<LabeledCascades> const& cascades, recoTracks const&, aod::McCollisions const&)
{
std::vector<bool> isRecoed;
isRecoed.resize(mcParticles.size(), false);
for (auto const& cascade : cascades) {
if (cascade.has_mcParticle()) {
isRecoed[cascade.mcParticleId()] = true;
}
}

for (auto const& mcParticle : mcParticles) {
auto mcCollision = mcParticle.mcCollision();
float imp = mcCollision.impactParameter();

int pdgCode = TMath::Abs(mcParticle.pdgCode());
if (pdgCode != 3312 && pdgCode != 3334)
return;

if (!mcParticle.isPhysicalPrimary())
return;
if (TMath::Abs(mcParticle.eta()) > 0.8)
return;
auto mcCollision = mcParticle.mcCollision();
float imp = mcCollision.impactParameter();

float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
if (deltaPhi < 0)
deltaPhi += 2. * TMath::Pi();
if (deltaPhi > 2. * TMath::Pi())
deltaPhi -= 2. * TMath::Pi();
int pdgCode = TMath::Abs(mcParticle.pdgCode());
if (pdgCode != 3312 && pdgCode != 3334)
return;

if (!mcParticle.isPhysicalPrimary())
return;
if (TMath::Abs(mcParticle.eta()) > 0.8)
return;

float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
if (deltaPhi < 0)
deltaPhi += 2. * TMath::Pi();
if (deltaPhi > 2. * TMath::Pi())
deltaPhi -= 2. * TMath::Pi();
if (pdgCode == 3312)
histos.fill(HIST("hBVsPtVsPhiGeneratedXi"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3334)
histos.fill(HIST("hBVsPtVsPhiGeneratedOmega"), imp, deltaPhi, mcParticle.pt());

if (cascades.size() > 0) {
if (pdgCode == 3312)
histos.fill(HIST("hBVsPtVsPhiGeneratedXi"), imp, deltaPhi, mcParticle.pt());
histos.fill(HIST("hBVsPtVsPhiGlobalXi"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3334)
histos.fill(HIST("hBVsPtVsPhiGeneratedOmega"), imp, deltaPhi, mcParticle.pt());

if (isRecoed[mcParticle.globalIndex()]) {
if (pdgCode == 3312)
histos.fill(HIST("hBVsPtVsPhiGlobalXi"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3334)
histos.fill(HIST("hBVsPtVsPhiGlobalOmega"), imp, deltaPhi, mcParticle.pt());
}
histos.fill(HIST("hBVsPtVsPhiGlobalOmega"), imp, deltaPhi, mcParticle.pt());
}
}
PROCESS_SWITCH(flowTest, processCascade, "Process cascades", true);

using LabeledV0s = soa::Join<aod::V0Datas, aod::McV0Labels>;

void processV0s(aod::McParticles const& mcParticles, LabeledV0s const& v0s, recoTracks const&, aod::McCollisions const&)
void processV0s(aod::McParticle const& mcParticle, soa::SmallGroups<LabeledV0s> const& v0s, recoTracks const&, aod::McCollisions const&)
{
std::vector<bool> isRecoed;
isRecoed.resize(mcParticles.size(), false);
for (auto const& v0 : v0s) {
if (v0.has_mcParticle()) {
isRecoed[v0.mcParticleId()] = true;
}
}

for (auto const& mcParticle : mcParticles) {
auto mcCollision = mcParticle.mcCollision();
float imp = mcCollision.impactParameter();

int pdgCode = TMath::Abs(mcParticle.pdgCode());
if (pdgCode != 310 && pdgCode != 3122)
return;

if (!mcParticle.isPhysicalPrimary())
return;
if (TMath::Abs(mcParticle.eta()) > 0.8)
return;
auto mcCollision = mcParticle.mcCollision();
float imp = mcCollision.impactParameter();

float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
if (deltaPhi < 0)
deltaPhi += 2. * TMath::Pi();
if (deltaPhi > 2. * TMath::Pi())
deltaPhi -= 2. * TMath::Pi();
int pdgCode = TMath::Abs(mcParticle.pdgCode());
if (pdgCode != 310 && pdgCode != 3122)
return;

if (!mcParticle.isPhysicalPrimary())
return;
if (TMath::Abs(mcParticle.eta()) > 0.8)
return;

float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
if (deltaPhi < 0)
deltaPhi += 2. * TMath::Pi();
if (deltaPhi > 2. * TMath::Pi())
deltaPhi -= 2. * TMath::Pi();
if (pdgCode == 310)
histos.fill(HIST("hBVsPtVsPhiGeneratedK0Short"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3122)
histos.fill(HIST("hBVsPtVsPhiGeneratedLambda"), imp, deltaPhi, mcParticle.pt());

if (v0s.size() > 0) {
if (pdgCode == 310)
histos.fill(HIST("hBVsPtVsPhiGeneratedK0Short"), imp, deltaPhi, mcParticle.pt());
histos.fill(HIST("hBVsPtVsPhiGlobalK0Short"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3122)
histos.fill(HIST("hBVsPtVsPhiGeneratedLambda"), imp, deltaPhi, mcParticle.pt());

if (isRecoed[mcParticle.globalIndex()]) {
if (pdgCode == 310)
histos.fill(HIST("hBVsPtVsPhiGlobalK0Short"), imp, deltaPhi, mcParticle.pt());
if (pdgCode == 3122)
histos.fill(HIST("hBVsPtVsPhiGlobalLambda"), imp, deltaPhi, mcParticle.pt());
}
histos.fill(HIST("hBVsPtVsPhiGlobalLambda"), imp, deltaPhi, mcParticle.pt());
}
}
PROCESS_SWITCH(flowTest, processV0s, "Process V0s", true);
Expand Down
4 changes: 2 additions & 2 deletions DPG/Tasks/AOTEvent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ o2physics_add_dpl_workflow(lumi-qa
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2::DetectorsBase
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(mshape-qa
SOURCES mshapeQa.cxx
o2physics_add_dpl_workflow(time-dependent-qa
SOURCES timeDependentQa.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2::DetectorsBase O2::TPCCalibration
COMPONENT_NAME Analysis)

Expand Down
Loading

0 comments on commit fd468ed

Please sign in to comment.