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/Strangeness/CMakeLists.txt
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 warning on line 1 in PWGLF/Tasks/Strangeness/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Use kebab-case for names of workflows and match the name of the workflow file.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
Expand All @@ -9,17 +9,17 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

o2physics_add_dpl_workflow(hyperon-reco-test

Check warning on line 12 in PWGLF/Tasks/Strangeness/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name hyperon-reco-test does not match its file name hyperon-reco-test.cxx. (Matches hyperonRecoTest.cxx.)
SOURCES hyperon-reco-test.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(derivedlambdakzeroanalysis
SOURCES derivedlambdakzeroanalysis.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore O2Physics::AnalysisCCDB
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(lambdakzeroanalysis-mc

Check warning on line 22 in PWGLF/Tasks/Strangeness/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name lambdakzeroanalysis-mc does not match its file name lambdakzeroanalysisMC.cxx. (Matches lambdakzeroanalysisMc.cxx.)
SOURCES lambdakzeroanalysisMC.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -29,12 +29,12 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(sigmaminus-task

Check warning on line 32 in PWGLF/Tasks/Strangeness/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name sigmaminus-task does not match its file name sigmaminustask.cxx. (Matches sigmaminusTask.cxx.)
SOURCES sigmaminustask.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(cascadeanalysismc

Check warning on line 37 in PWGLF/Tasks/Strangeness/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name cascadeanalysismc does not match its file name cascadeanalysisMC.cxx. (Matches cascadeanalysismc.cxx.)
SOURCES cascadeanalysisMC.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -54,12 +54,12 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2::ReconstructionDataFormats O2Physics::AnalysisCore O2::DetectorsBase
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(k0mixedevents

Check warning on line 57 in PWGLF/Tasks/Strangeness/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name k0mixedevents does not match its file name k0_mixed_events.cxx. (Matches k0mixedevents.cxx.)
SOURCES k0_mixed_events.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(vzero-cascade-absorption

Check warning on line 62 in PWGLF/Tasks/Strangeness/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name vzero-cascade-absorption does not match its file name vzero_cascade_absorption.cxx. (Matches vzeroCascadeAbsorption.cxx.)
SOURCES vzero_cascade_absorption.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -74,7 +74,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(hstrangecorrelation

Check warning on line 77 in PWGLF/Tasks/Strangeness/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name hstrangecorrelation does not match its file name hStrangeCorrelation.cxx. (Matches hstrangecorrelation.cxx.)
SOURCES hStrangeCorrelation.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::EventFilteringUtils
COMPONENT_NAME Analysis)
Expand Down Expand Up @@ -119,7 +119,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(strange-yield-pbpb

Check warning on line 122 in PWGLF/Tasks/Strangeness/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name strange-yield-pbpb does not match its file name strange-yield-pbpb.cxx. (Matches strangeYieldPbpb.cxx.)
SOURCES strange-yield-pbpb.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand Down
45 changes: 42 additions & 3 deletions PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "CommonConstants/MathConstants.h"
#include "CommonConstants/PhysicsConstants.h"
#include "Common/Core/trackUtilities.h"
#include "Common/CCDB/ctpRateFetcher.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "PWGLF/DataModel/LFStrangenessMLTables.h"
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
Expand Down Expand Up @@ -80,6 +81,7 @@
Configurable<bool> calculateFeeddownMatrix{"calculateFeeddownMatrix", true, "fill feeddown matrix if MC"};

Configurable<bool> doPPAnalysis{"doPPAnalysis", false, "if in pp, set to true"};
Configurable<std::string> irSource{"irSource", "T0VTX", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};

struct : ConfigurableGroup {
Configurable<bool> requireSel8{"requireSel8", true, "require sel8 event selection"};
Expand Down Expand Up @@ -108,6 +110,9 @@
// fast check on occupancy
Configurable<float> minOccupancy{"minOccupancy", -1, "minimum occupancy from neighbouring collisions"};
Configurable<float> maxOccupancy{"maxOccupancy", -1, "maximum occupancy from neighbouring collisions"};
// fast check on interaction rate
Configurable<float> minIR{"minIR", -1, "minimum IR collisions"};
Configurable<float> maxIR{"maxIR", -1, "maximum IR collisions"};
} eventSelections;

struct : ConfigurableGroup {
Expand Down Expand Up @@ -208,6 +213,8 @@
} ccdbConfigurations;

o2::ccdb::CcdbApi ccdbApi;
Service<o2::ccdb::BasicCCDBManager> ccdb;
ctpRateFetcher rateFetcher;
int mRunNumber;
std::map<std::string, std::string> metadata;

Expand All @@ -221,6 +228,7 @@
ConfigurableAxis axisLambdaMass{"axisLambdaMass", {200, 1.101f, 1.131f}, ""};
ConfigurableAxis axisCentrality{"axisCentrality", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f}, "Centrality"};
ConfigurableAxis axisNch{"axisNch", {500, 0.0f, +5000.0f}, "Number of charged particles"};
ConfigurableAxis axisIRBinning{"axisIRBinning", {500, 0, 50}, "Binning for the interaction rate (kHz)"};

ConfigurableAxis axisRawCentrality{"axisRawCentrality", {VARIABLE_WIDTH, 0.000f, 52.320f, 75.400f, 95.719f, 115.364f, 135.211f, 155.791f, 177.504f, 200.686f, 225.641f, 252.645f, 281.906f, 313.850f, 348.302f, 385.732f, 426.307f, 470.146f, 517.555f, 568.899f, 624.177f, 684.021f, 748.734f, 818.078f, 892.577f, 973.087f, 1058.789f, 1150.915f, 1249.319f, 1354.279f, 1465.979f, 1584.790f, 1710.778f, 1844.863f, 1985.746f, 2134.643f, 2291.610f, 2456.943f, 2630.653f, 2813.959f, 3006.631f, 3207.229f, 3417.641f, 3637.318f, 3865.785f, 4104.997f, 4354.938f, 4615.786f, 4885.335f, 5166.555f, 5458.021f, 5762.584f, 6077.881f, 6406.834f, 6746.435f, 7097.958f, 7462.579f, 7839.165f, 8231.629f, 8635.640f, 9052.000f, 9484.268f, 9929.111f, 10389.350f, 10862.059f, 11352.185f, 11856.823f, 12380.371f, 12920.401f, 13476.971f, 14053.087f, 14646.190f, 15258.426f, 15890.617f, 16544.433f, 17218.024f, 17913.465f, 18631.374f, 19374.983f, 20136.700f, 20927.783f, 21746.796f, 22590.880f, 23465.734f, 24372.274f, 25314.351f, 26290.488f, 27300.899f, 28347.512f, 29436.133f, 30567.840f, 31746.818f, 32982.664f, 34276.329f, 35624.859f, 37042.588f, 38546.609f, 40139.742f, 41837.980f, 43679.429f, 45892.130f, 400000.000f}, "raw centrality signal"}; // for QA

Expand Down Expand Up @@ -334,6 +342,11 @@

void init(InitContext const&)
{
// setting CCDB service
ccdb->setURL(ccdbConfigurations.ccdburl);
ccdb->setCaching(true);
ccdb->setFatalWhenNull(false);

// initialise bit masks
maskTopological = (uint64_t(1) << selCosPA) | (uint64_t(1) << selRadius) | (uint64_t(1) << selDCANegToPV) | (uint64_t(1) << selDCAPosToPV) | (uint64_t(1) << selDCAV0Dau) | (uint64_t(1) << selRadiusMax);
maskTopoNoV0Radius = (uint64_t(1) << selCosPA) | (uint64_t(1) << selDCANegToPV) | (uint64_t(1) << selDCAPosToPV) | (uint64_t(1) << selDCAV0Dau) | (uint64_t(1) << selRadiusMax);
Expand Down Expand Up @@ -425,6 +438,8 @@
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(17, "Below min occup.");
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(18, "Above max occup.");
}
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(19, "Below min IR");
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(20, "Above max IR");

histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{101, 0.0f, 101.0f}});
histos.add("hCentralityVsNch", "hCentralityVsNch", kTH2F, {{101, 0.0f, 101.0f}, axisNch});
Expand All @@ -443,6 +458,9 @@
histos.add("hSelGapSide", "Selected gap side; Entries", kTH1F, {axisSelGap});
histos.add("hEventCentralityVsSelGapSide", ";Centrality (%); Selected gap side", kTH2F, {{101, 0.0f, 101.0f}, axisSelGap});

histos.add("hInteractionRate", "hInteractionRate", kTH1F, {axisIRBinning});
histos.add("hCentralityVsInteractionRate", "hCentralityVsInteractionRate", kTH2F, {{101, 0.0f, 101.0f}, axisIRBinning});

// for QA and test purposes
auto hRawCentrality = histos.add<TH1>("hRawCentrality", "hRawCentrality", kTH1F, {axisRawCentrality});

Expand Down Expand Up @@ -821,7 +839,7 @@
bitset(bitMap, selNegGoodTPCTrack);

// TPC PID
if (fabs(posTrackExtra.tpcNSigmaPi()) < v0Selections.TpcPidNsigmaCut)

Check warning on line 842 in PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
bitset(bitMap, selTPCPIDPositivePion);
if (fabs(posTrackExtra.tpcNSigmaPr()) < v0Selections.TpcPidNsigmaCut)
bitset(bitMap, selTPCPIDPositiveProton);
Expand Down Expand Up @@ -1575,13 +1593,26 @@
histos.fill(HIST("hEventSelection"), 17 /* Above max occupancy */);
}

double interactionRate = rateFetcher.fetch(ccdb.service, collision.timestamp(), collision.runNumber(), irSource) * 1.e-3;
if (eventSelections.minIR >= 0 && interactionRate < eventSelections.minIR) {
return false;
}
if (fillHists)
histos.fill(HIST("hEventSelection"), 18 /* Below min IR */);

if (eventSelections.maxIR >= 0 && interactionRate > eventSelections.maxIR) {
return false;
}
if (fillHists)
histos.fill(HIST("hEventSelection"), 19 /* Above max IR */);

return true;
}

// ______________________________________________________
// Simulated processing
// Return the list of indices to the recoed collision associated to a given MC collision.
std::vector<int> getListOfRecoCollIndices(soa::Join<aod::StraMCCollisions, aod::StraMCCollMults> const& mcCollisions, soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraCollLabels> const& collisions)
std::vector<int> getListOfRecoCollIndices(soa::Join<aod::StraMCCollisions, aod::StraMCCollMults> const& mcCollisions, soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraCollLabels> const& collisions)
{
std::vector<int> listBestCollisionIdx(mcCollisions.size());
for (auto const& mcCollision : mcCollisions) {
Expand Down Expand Up @@ -1611,7 +1642,7 @@
// ______________________________________________________
// Simulated processing
// Fill generated event information (for event loss/splitting estimation)
void fillGeneratedEventProperties(soa::Join<aod::StraMCCollisions, aod::StraMCCollMults> const& mcCollisions, soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraCollLabels> const& collisions)
void fillGeneratedEventProperties(soa::Join<aod::StraMCCollisions, aod::StraMCCollMults> const& mcCollisions, soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraCollLabels> const& collisions)
{
std::vector<int> listBestCollisionIdx(mcCollisions.size());
for (auto const& mcCollision : mcCollisions) {
Expand Down Expand Up @@ -1690,6 +1721,7 @@
centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(doPPAnalysis ? collision.multFT0A() + collision.multFT0C() : collision.multFT0C()));
}
float collisionOccupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange();
double interactionRate = rateFetcher.fetch(ccdb.service, collision.timestamp(), collision.runNumber(), irSource) * 1.e-3;

// gap side
int gapSide = collision.gapSide();
Expand All @@ -1713,6 +1745,9 @@
histos.fill(HIST("hEventOccupancy"), collisionOccupancy);
histos.fill(HIST("hCentralityVsOccupancy"), centrality, collisionOccupancy);

histos.fill(HIST("hInteractionRate"), interactionRate);
histos.fill(HIST("hCentralityVsInteractionRate"), centrality, interactionRate);

// __________________________________________
// perform main analysis
int nK0Shorts = 0;
Expand Down Expand Up @@ -1770,6 +1805,7 @@
centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(doPPAnalysis ? collision.multFT0A() + collision.multFT0C() : collision.multFT0C()));
}
float collisionOccupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange();
double interactionRate = rateFetcher.fetch(ccdb.service, collision.timestamp(), collision.runNumber(), irSource) * 1.e-3;

// gap side
int gapSide = collision.gapSide();
Expand All @@ -1793,6 +1829,9 @@
histos.fill(HIST("hEventOccupancy"), collisionOccupancy);
histos.fill(HIST("hCentralityVsOccupancy"), centrality, collisionOccupancy);

histos.fill(HIST("hInteractionRate"), interactionRate);
histos.fill(HIST("hCentralityVsInteractionRate"), centrality, interactionRate);

// __________________________________________
// perform main analysis
int nK0Shorts = 0;
Expand Down Expand Up @@ -1863,7 +1902,7 @@

// ______________________________________________________
// Simulated processing (subscribes to MC information too)
void processGenerated(soa::Join<aod::StraMCCollisions, aod::StraMCCollMults> const& mcCollisions, soa::Join<aod::V0MCCores, aod::V0MCCollRefs> const& V0MCCores, soa::Join<aod::CascMCCores, aod::CascMCCollRefs> const& CascMCCores, soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraCollLabels> const& collisions)
void processGenerated(soa::Join<aod::StraMCCollisions, aod::StraMCCollMults> const& mcCollisions, soa::Join<aod::V0MCCores, aod::V0MCCollRefs> const& V0MCCores, soa::Join<aod::CascMCCores, aod::CascMCCollRefs> const& CascMCCores, soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraCollLabels> const& collisions)
{
fillGeneratedEventProperties(mcCollisions, collisions);
std::vector<int> listBestCollisionIdx = getListOfRecoCollIndices(mcCollisions, collisions);
Expand Down
Loading