Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion PWGLF/Tasks/Nuspex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,52 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

o2physics_add_dpl_workflow(nuclei-batask

Check failure on line 12 in PWGLF/Tasks/Nuspex/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name nuclei-batask does not match its file name LFNucleiBATask.cxx. (Matches nucleiBatask.cxx.)
SOURCES LFNucleiBATask.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::EventFilteringUtils
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(hypertritonanalysis

Check failure on line 17 in PWGLF/Tasks/Nuspex/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name hypertritonanalysis does not match its file name hypertritonAnalysis.cxx. (Matches hypertritonanalysis.cxx.)
SOURCES hypertritonAnalysis.cxx
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(nuclei-hist

Check failure on line 22 in PWGLF/Tasks/Nuspex/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name nuclei-hist does not match its file name NucleiHistTask.cxx. (Matches nucleiHist.cxx.)
SOURCES NucleiHistTask.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(helium-flow

Check failure on line 27 in PWGLF/Tasks/Nuspex/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name helium-flow does not match its file name helium_flow.cxx. (Matches heliumFlow.cxx.)
SOURCES helium_flow.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(antimatter-abs-hmpid

Check failure on line 32 in PWGLF/Tasks/Nuspex/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name antimatter-abs-hmpid does not match its file name AntimatterAbsorptionHMPID.cxx. (Matches antimatterAbsHmpid.cxx.)
SOURCES AntimatterAbsorptionHMPID.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::ReconstructionDataFormats O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(hyhefour-analysis

Check failure on line 37 in PWGLF/Tasks/Nuspex/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name hyhefour-analysis does not match its file name hyhe4analysis.cxx. (Matches hyhefourAnalysis.cxx.)
SOURCES hyhe4analysis.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(mc-spectra-efficiency

Check failure on line 42 in PWGLF/Tasks/Nuspex/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name mc-spectra-efficiency does not match its file name mcspectraefficiency.cxx. (Matches mcSpectraEfficiency.cxx.)
SOURCES mcspectraefficiency.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(spectra-tof

Check failure on line 47 in PWGLF/Tasks/Nuspex/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name spectra-tof does not match its file name spectraTOF.cxx. (Matches spectraTof.cxx.)
SOURCES spectraTOF.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(spectra-tof-run2

Check failure on line 52 in PWGLF/Tasks/Nuspex/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name spectra-tof-run2 does not match its file name spectraTOFRun2.cxx. (Matches spectraTofRun2.cxx.)
SOURCES spectraTOFRun2.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(spectra-tpc

Check failure on line 57 in PWGLF/Tasks/Nuspex/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name spectra-tpc does not match its file name spectraTPC.cxx. (Matches spectraTpc.cxx.)
SOURCES spectraTPC.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand Down Expand Up @@ -114,7 +114,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(hadronnucleicorrelation
o2physics_add_dpl_workflow(hadron-nuclei-correlation
SOURCES hadronnucleicorrelation.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand Down
94 changes: 52 additions & 42 deletions PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ enum Modes {
kPPbar
};

struct hadronnucleicorrelation {
struct HadronNucleiCorrelation {

static constexpr int betahasTOFthr = -100;

Expand All @@ -87,14 +87,14 @@ struct hadronnucleicorrelation {
Configurable<bool> isMC{"isMC", false, "is MC"};
Configurable<bool> isMCGen{"isMCGen", false, "is isMCGen"};
Configurable<bool> isPrim{"isPrim", true, "is isPrim"};
Configurable<bool> docorrection{"docorrection", false, "do efficiency correction"};
Configurable<bool> doCorrection{"doCorrection", false, "do efficiency correction"};

Configurable<std::string> fCorrectionPath{"fCorrectionPath", "", "Correction path to file"};
Configurable<std::string> fCorrectionHisto{"fCorrectionHisto", "", "Correction histogram"};
Configurable<std::string> url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<std::string> cfgUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

// Event selection
Configurable<float> cutzvertex{"cutzvertex", 10.0, "|vertexZ| value limit"};
Configurable<float> cutzVertex{"cutzVertex", 10.0, "|vertexZ| value limit"};

// Track selection
Configurable<double> par0{"par0", 0.004, "par 0"};
Expand All @@ -103,9 +103,9 @@ struct hadronnucleicorrelation {
Configurable<float> min_TPC_nCrossedRowsOverFindableCls{"min_TPC_nCrossedRowsOverFindableCls", 0.8, "n TPC Crossed Rows Over Findable Cls"};
Configurable<float> max_chi2_TPC{"max_chi2_TPC", 4.0f, "maximum TPC chi^2/Ncls"};
Configurable<float> max_chi2_ITS{"max_chi2_ITS", 36.0f, "maximum ITS chi^2/Ncls"};
Configurable<float> etacut{"etacut", 0.8f, "eta cut"};
Configurable<float> max_dcaxy{"max_dcaxy", 0.14f, "Maximum DCAxy"};
Configurable<float> max_dcaz{"max_dcaz", 0.1f, "Maximum DCAz"};
Configurable<float> etaCut{"etaCut", 0.8f, "eta cut"};
Configurable<float> max_DCAxy{"max_DCAxy", 0.14f, "Maximum DCAxy"};
Configurable<float> max_DCAz{"max_DCAz", 0.1f, "Maximum DCAz"};
Configurable<float> nsigmaTPC{"nsigmaTPC", 3.0f, "cut nsigma TPC"};
Configurable<float> nsigmaElPr{"nsigmaElPr", 1.0f, "cut nsigma TPC El for protons"};
Configurable<float> nsigmaElDe{"nsigmaElDe", 3.0f, "cut nsigma TPC El for protons"};
Expand All @@ -122,14 +122,14 @@ struct hadronnucleicorrelation {
Configurable<int> min_itsNCls{"min_itsNCls", 0, "minimum allowed number of ITS clasters"};
Configurable<int> maxmixcollsGen{"maxmixcollsGen", 100, "maxmixcollsGen"};
Configurable<float> radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"};
Configurable<float> deta{"deta", 0.01, "minimum allowed defference in eta between two tracks in a pair"};
Configurable<float> dphi{"dphi", 0.01, "minimum allowed defference in phi_star between two tracks in a pair"};
Configurable<float> dEta{"dEta", 0.01, "minimum allowed difference in eta between two tracks in a pair"};
Configurable<float> dPhi{"dPhi", 0.01, "minimum allowed difference in phi_star between two tracks in a pair"};

// Mixing parameters
ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 50.0f, 100.0f, 99999.f}, "Mixing bins - multiplicity"};
ConfigurableAxis confVtxBins{"confVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"};
ColumnBinningPolicy<aod::singletrackselector::PosZ, aod::singletrackselector::Mult> colBinning{{confVtxBins, confMultBins}, true};
ColumnBinningPolicy<aod::mccollision::PosZ, o2::aod::mult::MultMCNParticlesEta05> colBinningGen{{confVtxBins, confMultBins}, true};
ColumnBinningPolicy<aod::mccollision::PosZ, o2::aod::mult::MultMCNParticlesEta10> colBinningGen{{confVtxBins, confMultBins}, true};

// pT/A bins
Configurable<std::vector<double>> pTBins{"pTBins", {0.6f, 1.0f, 1.2f, 2.f}, "p_{T} bins"};
Expand All @@ -147,12 +147,12 @@ struct hadronnucleicorrelation {
HistogramRegistry QA{"QA"};

using trkType = const FilteredTracks::iterator*;
using trkTypeMC = const FilteredTracksMC::iterator*;
// using trkTypeMC = const FilteredTracksMC::iterator*;
// typedef std::shared_ptr<FilteredCollisions::iterator> colType;
// typedef std::shared_ptr<SimCollisions::iterator> MCcolType;

std::unique_ptr<o2::aod::singletrackselector::FemtoPair<trkType>> Pair = std::make_unique<o2::aod::singletrackselector::FemtoPair<trkType>>();
std::unique_ptr<o2::aod::singletrackselector::FemtoPair<trkTypeMC>> PairMC = std::make_unique<o2::aod::singletrackselector::FemtoPair<trkTypeMC>>();
// std::unique_ptr<o2::aod::singletrackselector::FemtoPair<trkTypeMC>> PairMC = std::make_unique<o2::aod::singletrackselector::FemtoPair<trkTypeMC>>();

// Data histograms
std::vector<std::shared_ptr<TH3>> hEtaPhi_SE;
Expand All @@ -173,13 +173,13 @@ struct hadronnucleicorrelation {

void init(o2::framework::InitContext&)
{
ccdb->setURL(url.value);
ccdb->setURL(cfgUrl.value);
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
ccdb->setCreatedNotAfter(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count());
ccdb->setFatalWhenNull(false);

if (docorrection) {
if (doCorrection) {
GetCorrection(ccdb, TString(fCorrectionPath), TString(fCorrectionHisto));
} else {
hEffpTEta_proton = nullptr;
Expand Down Expand Up @@ -207,25 +207,25 @@ struct hadronnucleicorrelation {

TString name = "AntiDeAntiPr";
switch (mode) {
case 1:
case kDP:
name = "DePr";
break;
case 2:
case kDbarP:
name = "AntiDePr";
break;
case 3:
case kDPbar:
name = "DeAntiPr";
break;
case 4:
case kPbarP:
name = "AntiPrPr";
break;
case 5:
case kPbarPbar:
name = "AntiPrAntiPr";
break;
case 6:
case kPP:
name = "PrPr";
break;
case 7:
case kPPbar:
name = "PrAntiPr";
break;
}
Expand Down Expand Up @@ -283,7 +283,7 @@ struct hadronnucleicorrelation {
QA.add("QA/hnSigmaTOFVsPt_De", "n#sigma TOF vs p_{T} for d hypothesis (all tracks); p_{T} (GeV/c); n#sigma TOF", {HistType::kTH2D, {pTAxis, AxisNSigma}});
QA.add("QA/hnSigmaITSVsPt_Pr", "n#sigma ITS vs p_{T} for p hypothesis (all tracks); p_{T} (GeV/c); n#sigma ITS", {HistType::kTH2D, {pTAxis, AxisNSigma}});
QA.add("QA/hnSigmaITSVsPt_De", "n#sigma ITS vs p_{T} for d hypothesis (all tracks); p_{T} (GeV/c); n#sigma ITS", {HistType::kTH2D, {pTAxis, AxisNSigma}});
QA.add("QA/hdetadphistar", ";dphi*;deta ", {HistType::kTH2D, {{101, -0.2, 0.2, "dphi*"}, {101, -0.2, 0.2, "deta"}}});
QA.add("QA/hdEtadPhistar", ";dPhi*;dEta ", {HistType::kTH2D, {{101, -0.2, 0.2, "dPhi*"}, {101, -0.2, 0.2, "dEta"}}});

if (!isMC) {
QA.add("QA/hEtaPr", Form("#eta ditribution for p"), {HistType::kTH1F, {etaAxis}});
Expand Down Expand Up @@ -415,14 +415,14 @@ struct hadronnucleicorrelation {
}

// Filters
Filter vertexFilter = nabs(o2::aod::singletrackselector::posZ) <= cutzvertex;
Filter vertexFilter = nabs(o2::aod::singletrackselector::posZ) <= cutzVertex;
Filter trackFilter = o2::aod::singletrackselector::tpcNClsFound >= min_TPC_nClusters &&
o2::aod::singletrackselector::unPack<singletrackselector::binning::chi2>(o2::aod::singletrackselector::storedTpcChi2NCl) <= max_chi2_TPC &&
o2::aod::singletrackselector::unPack<singletrackselector::binning::rowsOverFindable>(o2::aod::singletrackselector::storedTpcCrossedRowsOverFindableCls) >= min_TPC_nCrossedRowsOverFindableCls &&
o2::aod::singletrackselector::unPack<singletrackselector::binning::chi2>(o2::aod::singletrackselector::storedItsChi2NCl) <= max_chi2_ITS &&
nabs(o2::aod::singletrackselector::unPack<singletrackselector::binning::dca>(o2::aod::singletrackselector::storedDcaXY)) <= max_dcaxy &&
nabs(o2::aod::singletrackselector::unPack<singletrackselector::binning::dca>(o2::aod::singletrackselector::storedDcaXY)) <= max_dcaz &&
nabs(o2::aod::singletrackselector::eta) <= etacut;
nabs(o2::aod::singletrackselector::unPack<singletrackselector::binning::dca>(o2::aod::singletrackselector::storedDcaXY)) <= max_DCAxy &&
nabs(o2::aod::singletrackselector::unPack<singletrackselector::binning::dca>(o2::aod::singletrackselector::storedDcaXY)) <= max_DCAz &&
nabs(o2::aod::singletrackselector::eta) <= etaCut;

template <typename Type>
bool IsProton(Type const& track, int sign)
Expand Down Expand Up @@ -560,8 +560,8 @@ struct hadronnucleicorrelation {
{
Pair->SetPair(&part0, &part1);
Pair->SetIdentical(isIdentical);
if (isIdentical && Pair->IsClosePair(deta, dphi, radiusTPC)) {
QA.fill(HIST("QA/hdetadphistar"), Pair->GetPhiStarDiff(radiusTPC), Pair->GetEtaDiff());
if (isIdentical && Pair->IsClosePair(dEta, dPhi, radiusTPC)) {
QA.fill(HIST("QA/hdEtadPhistar"), Pair->GetPhiStarDiff(radiusTPC), Pair->GetEtaDiff());
return;
}

Expand All @@ -575,7 +575,7 @@ struct hadronnucleicorrelation {

float corr0 = 1, corr1 = 1;

if (docorrection) { // Apply corrections
if (doCorrection) { // Apply corrections
switch (mode) {
case 0:
corr0 = hEffpTEta_antideuteron->Interpolate(part0.pt(), part0.eta());
Expand Down Expand Up @@ -684,7 +684,7 @@ struct hadronnucleicorrelation {
void processSameEvent(FilteredCollisions::iterator const& collision, FilteredTracks const& tracks)
{

if (std::abs(collision.posZ()) > cutzvertex)
if (std::abs(collision.posZ()) > cutzVertex)
return;

registry.fill(HIST("hNEvents"), 0.5);
Expand Down Expand Up @@ -757,6 +757,9 @@ struct hadronnucleicorrelation {
}
}

Pair->SetMagField1(collision.magField());
Pair->SetMagField2(collision.magField());

if (mode == kPbarPbar || mode == kPP) { // Identical particle combinations

for (const auto& [part0, part1] : combinations(CombinationsStrictlyUpperIndexPolicy(tracks, tracks))) {
Expand Down Expand Up @@ -853,7 +856,7 @@ struct hadronnucleicorrelation {
}
}
}
PROCESS_SWITCH(hadronnucleicorrelation, processSameEvent, "processSameEvent", true);
PROCESS_SWITCH(HadronNucleiCorrelation, processSameEvent, "processSameEvent", true);

void processMixedEvent(FilteredCollisions const& collisions, FilteredTracks const& tracks)
{
Expand All @@ -872,6 +875,9 @@ struct hadronnucleicorrelation {
continue;
}

Pair->SetMagField1(magFieldTesla1);
Pair->SetMagField2(magFieldTesla2);

for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) {

if (part0.tpcFractionSharedCls() > max_tpcSharedCls)
Expand Down Expand Up @@ -946,12 +952,12 @@ struct hadronnucleicorrelation {
}
}
}
PROCESS_SWITCH(hadronnucleicorrelation, processMixedEvent, "processMixedEvent", true);
PROCESS_SWITCH(HadronNucleiCorrelation, processMixedEvent, "processMixedEvent", true);

void processMC(FilteredCollisions const&, FilteredTracksMC const& tracks)
{
for (const auto& track : tracks) {
if (std::abs(track.template singleCollSel_as<FilteredCollisions>().posZ()) > cutzvertex)
if (std::abs(track.template singleCollSel_as<FilteredCollisions>().posZ()) > cutzVertex)
continue;

if (track.tpcFractionSharedCls() > max_tpcSharedCls)
Expand Down Expand Up @@ -1312,12 +1318,12 @@ struct hadronnucleicorrelation {
}
} // track
}
PROCESS_SWITCH(hadronnucleicorrelation, processMC, "processMC", false);
PROCESS_SWITCH(HadronNucleiCorrelation, processMC, "processMC", false);

void processSameEventGen(SimCollisions::iterator const& mcCollision, SimParticles const& mcParticles)
{

if (std::abs(mcCollision.posZ()) > cutzvertex)
if (std::abs(mcCollision.posZ()) > cutzVertex)
return;

registry.fill(HIST("Generated/hNEventsMC"), 0.5);
Expand Down Expand Up @@ -1348,7 +1354,7 @@ struct hadronnucleicorrelation {
registry.fill(HIST("Generated/hAntiDeuteronsVsPt"), particle.pt());
}

if (std::abs(particle.eta()) > etacut) {
if (std::abs(particle.eta()) > etaCut) {
continue;
}
if (particle.pdgCode() == PDG_t::kProton) {
Expand Down Expand Up @@ -1439,17 +1445,21 @@ struct hadronnucleicorrelation {
}
}
}
PROCESS_SWITCH(hadronnucleicorrelation, processSameEventGen, "processSameEventGen", false);
PROCESS_SWITCH(HadronNucleiCorrelation, processSameEventGen, "processSameEventGen", false);

Preslice<SimParticles> perMcCollision = o2::aod::mcparticle::mcCollisionId;

void processMixedEventGen(SimCollisions const& mcCollisions, SimParticles const& mcParticles)
{

for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningGen, 5, -1, mcCollisions, mcCollisions)) {

// LOGF(info, "Mixed event collisions: (%d, %d) zvtx (%.1f, %.1f) mult (%d, %d)", collision1.globalIndex(), collision2.globalIndex(), collision1.posZ(), collision2.posZ(), collision1.mult(), collision2.mult());
// LOGF(info, "Mixed event collisions: (%d, %d) zvtx (%.1f, %.1f) mult (%d, %d)", collision1.globalIndex(), collision2.globalIndex(), collision1.posZ(), collision2.posZ(), collision1.multMCNParticlesEta10(), collision2.multMCNParticlesEta10());

auto groupPartsOne = mcParticles.sliceBy(perMcCollision, collision1.globalIndex());
auto groupPartsTwo = mcParticles.sliceBy(perMcCollision, collision2.globalIndex());

auto groupPartsOne = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision1.globalIndex(), cache);
auto groupPartsTwo = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision2.globalIndex(), cache);
registry.fill(HIST("hMult"), collision1.multMCNParticlesEta10());

for (const auto& [part0, part1] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) {

Expand Down Expand Up @@ -1506,10 +1516,10 @@ struct hadronnucleicorrelation {
}
}
}
PROCESS_SWITCH(hadronnucleicorrelation, processMixedEventGen, "processMixedEventGen", false);
PROCESS_SWITCH(HadronNucleiCorrelation, processMixedEventGen, "processMixedEventGen", false);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<hadronnucleicorrelation>(cfgc)};
return WorkflowSpec{adaptAnalysisTask<HadronNucleiCorrelation>(cfgc)};
}
Loading