diff --git a/PWGLF/DataModel/LFSlimNucleiTables.h b/PWGLF/DataModel/LFSlimNucleiTables.h index 6a8725aa876..e266bed5001 100644 --- a/PWGLF/DataModel/LFSlimNucleiTables.h +++ b/PWGLF/DataModel/LFSlimNucleiTables.h @@ -198,6 +198,7 @@ DECLARE_SOA_TABLE(NucleiTableRed, "AOD", "NUCLEITABLERED", NucleiTableNS::DCAxy, NucleiTableNS::DCAz, NucleiTableNS::Flags, + NucleiTableNS::gPt, NucleiTableNS::McProcess, NucleiTableNS::PDGcode, NucleiTableNS::MotherPDGcode); diff --git a/PWGLF/TableProducer/QC/nucleiQC.cxx b/PWGLF/TableProducer/QC/nucleiQC.cxx index 0c329807f5e..5df2d2d0c12 100644 --- a/PWGLF/TableProducer/QC/nucleiQC.cxx +++ b/PWGLF/TableProducer/QC/nucleiQC.cxx @@ -80,6 +80,11 @@ struct nucleiQC { Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {nuclei::betheBlochDefault[0], nuclei::Species::kNspecies, 6, nuclei::names, nuclei::betheBlochParNames}, "TPC Bethe-Bloch parameterisation for light nuclei"}; Configurable> cfgUseCentralTpcCalibration{"cfgUseCentralTpcCalibration", {nuclei::useCentralTpcCalibrationDefault[0], nuclei::Species::kNspecies, 1, nuclei::names, {"UseCentralTpcCalibration"}}, "Use central TPC calibration"}; + Configurable> cfgUseTrackTuner{"cfgUseTrackTuner", {nuclei::useTrackTuner[0], nuclei::Species::kNspecies, 1, nuclei::names, {"UseTrckTuner"}}, "Use Track Tuner"}; + Configurable cfgTrackTunerParams{"cfgTrackTunerParams", "debugInfo=0|updateTrackDCAs=1|updateTrackCovMat=1|updateCurvature=0|updateCurvatureIU=0|updatePulls=0|isInputFileFromCCDB=1|pathInputFile=Users/m/mfaggin/test/inputsTrackTuner/pp2023/pass4/correct_names|nameInputFile=trackTuner_DataLHC23hPass4_McLHC23k4g.root|pathFileQoverPt=Users/h/hsharma/qOverPtGraphs|nameFileQoverPt=D0sigma_Data_removal_itstps_MC_LHC22b1b.root|usePvRefitCorrections=0|qOverPtMC=-1.|qOverPtData=-1.|nPhiBins=1|autoDetectDcaCalib=false", "TrackTuner parameter initialization (format: =|=)"}; + Configurable cfgTrackTunerConfigSource{"cfgTrackTunerConfigSource", aod::track_tuner::InputString, "1: input string; 2: TrackTuner Configurables"}; + ConfigurableAxis cfgAxisPtQA{"axisPtQA", {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, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for QA histograms"}; + Configurable cfgRapidityMin{"cfgRapidityMin", -1., "Minimum rapidity value"}; Configurable cfgRapidityMax{"cfgRapidityMax", 1., "Maximum rapidity value"}; Configurable cfgRapidityCenterMass{"cfgRapidityCenterMass", 0.0f, "Center of mass rapidity"}; @@ -106,17 +111,26 @@ struct nucleiQC { {"hEventSelections", "Event selections; Selection step; Counts", {HistType::kTH1D, {{nuclei::evSel::kNevSels + 1, -0.5f, static_cast(nuclei::evSel::kNevSels) + 0.5f}}}}, {"hVtxZBefore", "Vertex distribution in Z before selections;Z (cm)", {HistType::kTH1F, {{400, -20.0, 20.0}}}}, {"hVtxZ", "Vertex distribution in Z;Z (cm)", {HistType::kTH1F, {{400, -20.0, 20.0}}}}, + {"hFailCentrality", "0: all the times the centrality filling function is called - 1: each time it fails ; Bool", {HistType::kTH1F, {{2, -0.5, 1.50}}}}, + {"hTrackTunedTracks", "", {HistType::kTH1F, {{1, 0.5, 1.5}}}}, }, OutputObjHandlingPolicy::AnalysisObject, false, true}; + std::shared_ptr mHistFailCentrality = mHistograms.get(HIST("hFailCentrality")); + std::shared_ptr mHistTrackTunedTracks = mHistograms.get(HIST("hTrackTunedTracks")); + std::vector mSpeciesToProcess; Produces mNucleiTableRed; std::vector mNucleiCandidates; std::vector mFilledMcParticleIds; + TrackTuner mTrackTuner; + o2::base::Propagator::MatCorrType mMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; + std::array mDcaInfo; o2::dataformats::DCA mDcaInfoCov; + o2::dataformats::VertexBase mVtx; o2::track::TrackParametrizationWithError mTrackParCov; std::array(nuclei::Species::kNspecies)> mPidManagers; @@ -158,6 +172,33 @@ struct nucleiQC { mPidManagers[kSpeciesRt] = nuclei::PidManager(kSpeciesRt); } }); + + /// TrackTuner initialization + bool anyTrackTuner = false; + for (int iSpecies = 0; iSpecies < static_cast(nuclei::Species::kNspecies); iSpecies++) { + anyTrackTuner = anyTrackTuner || cfgUseTrackTuner->get(iSpecies); + } + + if (anyTrackTuner) { + std::string outputStringParams = ""; + switch (cfgTrackTunerConfigSource) { + case aod::track_tuner::InputString: + outputStringParams = mTrackTuner.configParams(cfgTrackTunerParams); + break; + case aod::track_tuner::Configurables: + outputStringParams = mTrackTuner.configParams(); + break; + + default: + LOG(fatal) << "TrackTuner configuration source not defined. Fix it! (Supported options: input string (1); Configurables (2))"; + break; + } + + if (!mTrackTuner.autoDetectDcaCalib) { + mTrackTuner.getDcaGraphs(); + mHistTrackTunedTracks->SetTitle(outputStringParams.c_str()); + } + } } void initCCDB(const aod::BCsWithTimestamps::iterator& bc) @@ -294,11 +335,12 @@ struct nucleiQC { { candidate.ptGenerated = particle.pt() * (particle.pdgCode() > 0 ? 1.f : -1.f); candidate.etaGenerated = particle.eta(); + candidate.yGenerated = particle.y(); candidate.phiGenerated = particle.phi(); } - template - void fillDcaInformation(const Tcollision& collision, const Ttrack& track, nuclei::SlimCandidate& candidate) + template + void fillDcaInformation(const int iSpecies, const Tcollision& collision, const Ttrack& track, nuclei::SlimCandidate& candidate, const aod::McParticles::iterator& particle) { const o2::math_utils::Point3D collisionVertex{collision.posX(), collision.posY(), collision.posZ()}; @@ -306,11 +348,22 @@ struct nucleiQC { mDcaInfoCov.set(999, 999, 999, 999, 999); setTrackParCov(track, mTrackParCov); mTrackParCov.setPID(track.pidForTracking()); - std::array dcaInfo; - o2::base::Propagator::Instance()->propagateToDCA(collisionVertex, mTrackParCov, mBz, 2.f, static_cast(cfgMaterialCorrection.value), &dcaInfo); - candidate.DCAxy = dcaInfo[0]; - candidate.DCAz = dcaInfo[1]; + if constexpr (isMc) { + if (track.has_mcParticle() && cfgUseTrackTuner->get(iSpecies)) { + mHistTrackTunedTracks->Fill(1.); + mTrackTuner.tuneTrackParams(particle, mTrackParCov, mMatCorr, &mDcaInfoCov, mHistTrackTunedTracks); + } + } else { + mMatCorr = static_cast(cfgMaterialCorrection.value); + } + + mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()}); + mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()); + o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, mTrackParCov, 2.f, mMatCorr, &mDcaInfoCov); + + candidate.DCAxy = mDcaInfoCov.getY(); + candidate.DCAz = mDcaInfoCov.getZ(); } template @@ -333,22 +386,26 @@ struct nucleiQC { .motherPdgCode = 0, .ptGenerated = 0.f, // to be filled for mc .etaGenerated = 0.f, + .yGenerated = 0.f, .phiGenerated = 0.f, - .centrality = nuclei::getCentrality(collision, cfgCentralityEstimator), + .centrality = nuclei::getCentrality(collision, cfgCentralityEstimator, mHistFailCentrality), .mcProcess = TMCProcess::kPNoProcess}; - fillDcaInformation(collision, track, candidate); fillNucleusFlagsPdgs(iSpecies, collision, track, candidate); + aod::McParticles::iterator particle; + if constexpr (isMc) { if (track.has_mcParticle()) { - const auto& particle = track.mcParticle(); + particle = track.mcParticle(); fillNucleusFlagsPdgsMc(particle, candidate); fillNucleusGeneratedVariables(particle, candidate); } } + fillDcaInformation(iSpecies, collision, track, candidate, particle); + return candidate; } @@ -381,11 +438,12 @@ struct nucleiQC { if (isGenerated) { const float ptGenerated = (kIndex == nuclei::Species::kPr || kIndex == nuclei::Species::kDe || kIndex == nuclei::Species::kTr) ? candidate.ptGenerated : candidate.ptGenerated / 2.f; mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/hPtGenerated"), ptGenerated); - mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/h3PtVsEtaVsCentralityGenerated"), ptGenerated, candidate.etaGenerated, candidate.centrality); + mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/h2PtVsCentralityGenerated"), ptGenerated, candidate.centrality); + mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/h3PtVsRapidityVsCentralityGenerated"), ptGenerated, candidate.yGenerated, candidate.centrality); mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/h3PhiVsEtaVsCentralityGenerated"), candidate.phiGenerated, candidate.etaGenerated, candidate.centrality); } else { mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/hPtReconstructed"), candidate.pt); - mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/h3PtVsEtaVsCentralityReconstructed"), candidate.pt, candidate.eta, candidate.centrality); + mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/h2PtVsCentralityReconstructed"), candidate.pt, candidate.centrality); mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/h3PhiVsEtaVsCentralityReconstructed"), candidate.phi, candidate.eta, candidate.centrality); mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/h3DCAxyVsPtVsCentrality"), candidate.pt, candidate.DCAxy, candidate.centrality); mHistograms.fill(HIST(nuclei::cNames[kIndex]) + HIST("/h3DCAzVsPtVsCentrality"), candidate.pt, candidate.DCAz, candidate.centrality); @@ -406,6 +464,20 @@ struct nucleiQC { if (!nuclei::eventSelection(collision, mHistograms, cfgEventSelections, cfgCutVertex)) return; + bool anyTrackTuner = false; + for (int iSpecies = 0; iSpecies < static_cast(nuclei::Species::kNspecies); iSpecies++) { + anyTrackTuner = anyTrackTuner || cfgUseTrackTuner->get(iSpecies); + } + if (anyTrackTuner && mTrackTuner.autoDetectDcaCalib && !mTrackTuner.areGraphsConfigured) { + + mTrackTuner.setRunNumber(mRunNumber); + + /// setup the "auto-detected" path based on the run number + mTrackTuner.getPathInputFileAutomaticFromCCDB(); + mHistTrackTunedTracks->SetTitle(mTrackTuner.outputString.c_str()); + mTrackTuner.getDcaGraphs(); + } + for (const auto& track : tracks) { static_for<0, nuclei::kNspecies - 1>([&](auto iSpecies) { @@ -469,6 +541,7 @@ struct nucleiQC { continue; nuclei::SlimCandidate candidate; + candidate.centrality = nuclei::getCentrality(collision, cfgCentralityEstimator, mHistFailCentrality); fillNucleusFlagsPdgsMc(particle, candidate); fillNucleusGeneratedVariables(particle, candidate); @@ -492,6 +565,7 @@ struct nucleiQC { candidate.DCAxy, candidate.DCAz, candidate.flags, + candidate.ptGenerated, candidate.mcProcess, candidate.pdgCode, candidate.motherPdgCode); diff --git a/PWGLF/Utils/nucleiUtils.h b/PWGLF/Utils/nucleiUtils.h index 66cc1cb7318..649dcc198d7 100644 --- a/PWGLF/Utils/nucleiUtils.h +++ b/PWGLF/Utils/nucleiUtils.h @@ -30,11 +30,6 @@ #include #include -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::constants::physics; - struct NucleusCandidate { int globalIndex; int collTrackIndex; @@ -103,6 +98,7 @@ struct SlimCandidate { int motherPdgCode = 0; float ptGenerated = -999.f; float etaGenerated = -999.f; + float yGenerated = -999.f; float phiGenerated = -999.f; float centrality = -1.f; uint64_t mcProcess = TMCProcess::kPNoProcess; @@ -170,6 +166,12 @@ constexpr int useCentralTpcCalibrationDefault[Species::kNspecies][1]{ {1}, {1}, {1}}; +constexpr int useTrackTuner[Species::kNspecies][1]{ + {1}, + {1}, + {1}, + {0}, + {0}}; constexpr double bbMomScalingDefault[Species::kNspecies][2]{ {1., 1.}, {1., 1.}, @@ -226,7 +228,7 @@ constexpr double DownscalingDefault[Species::kNspecies][1]{ {1.}}; // constexpr bool storeTreesDefault[Species::kNspecies]{false, false, false, false, false}; constexpr float charges[Species::kNspecies]{1.f, 1.f, 1.f, 2.f, 2.f}; -constexpr float masses[Species::kNspecies]{MassProton, MassDeuteron, MassTriton, MassHelium3, MassAlpha}; +constexpr float masses[Species::kNspecies]{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron, o2::constants::physics::MassTriton, o2::constants::physics::MassHelium3, o2::constants::physics::MassAlpha}; constexpr int pdgCodes[Species::kNspecies]{PDG_t::kProton, o2::constants::physics::Pdg::kDeuteron, o2::constants::physics::Pdg::kTriton, o2::constants::physics::Pdg::kHelium3, o2::constants::physics::Pdg::kAlpha}; static constexpr std::string_view cNames[] = {"proton", "deuteron", "triton", "He3", "alpha"}; static const std::vector names{"proton", "deuteron", "triton", "He3", "alpha"}; @@ -285,21 +287,21 @@ constexpr int EvSelDefault[8][1]{ {0}}; template // move to nucleiUtils -bool eventSelection(const Tcollision& collision, HistogramRegistry& registry, LabeledArray eventSelections, const float cutVertex) +bool eventSelection(const Tcollision& collision, o2::framework::HistogramRegistry& registry, o2::framework::LabeledArray eventSelections, const float cutVertex) { if (!registry.contains(HIST("hVtxZBefore"))) { - registry.add("hVtxZBefore", "Vertex distribution in Z before selections;Z (cm)", {HistType::kTH1F, {{400, -20.0, 20.0}}}); + registry.add("hVtxZBefore", "Vertex distribution in Z before selections;Z (cm)", {o2::framework::HistType::kTH1F, {{400, -20.0, 20.0}}}); } if (!registry.contains(HIST("hVtxZ"))) { - registry.add("hVtxZ", "Vertex distribution in Z;Z (cm)", {HistType::kTH1F, {{400, -20.0, 20.0}}}); + registry.add("hVtxZ", "Vertex distribution in Z;Z (cm)", {o2::framework::HistType::kTH1F, {{400, -20.0, 20.0}}}); } if (!registry.contains(HIST("hEventSelections"))) { - registry.add("hEventSelections", "hEventSelections", {HistType::kTH1D, {{evSel::kNevSels + 1, -0.5f, static_cast(evSel::kNevSels) + 0.5f}}}); + registry.add("hEventSelections", "hEventSelections", {o2::framework::HistType::kTH1D, {{evSel::kNevSels + 1, -0.5f, static_cast(evSel::kNevSels) + 0.5f}}}); } registry.fill(HIST("hEventSelections"), 0); registry.fill(HIST("hVtxZBefore"), collision.posZ()); - if (eventSelections.get(evSel::kTVX) && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) { + if (eventSelections.get(evSel::kTVX) && !collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { return false; } registry.fill(HIST("hEventSelections"), evSel::kTVX + 1); @@ -309,27 +311,27 @@ bool eventSelection(const Tcollision& collision, HistogramRegistry& registry, La } registry.fill(HIST("hEventSelections"), evSel::kZvtx + 1); - if (eventSelections.get(evSel::kTFborder) && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + if (eventSelections.get(evSel::kTFborder) && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { return false; } registry.fill(HIST("hEventSelections"), evSel::kTFborder + 1); - if (eventSelections.get(evSel::kITSROFborder) && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + if (eventSelections.get(evSel::kITSROFborder) && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { return false; } registry.fill(HIST("hEventSelections"), evSel::kITSROFborder + 1); - if (eventSelections.get(evSel::kNoSameBunchPileup) && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { + if (eventSelections.get(evSel::kNoSameBunchPileup) && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { return false; } registry.fill(HIST("hEventSelections"), evSel::kNoSameBunchPileup + 1); - if (eventSelections.get(evSel::kIsGoodZvtxFT0vsPV) && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + if (eventSelections.get(evSel::kIsGoodZvtxFT0vsPV) && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } registry.fill(HIST("hEventSelections"), evSel::kIsGoodZvtxFT0vsPV + 1); - if (eventSelections.get(evSel::kIsGoodITSLayersAll) && !collision.selection_bit(aod::evsel::kIsGoodITSLayersAll)) { + if (eventSelections.get(evSel::kIsGoodITSLayersAll) && !collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { return false; } registry.fill(HIST("hEventSelections"), evSel::kIsGoodITSLayersAll + 1); @@ -348,11 +350,21 @@ bool eventSelection(const Tcollision& collision, HistogramRegistry& registry, La return true; } +/** + * hFailCentrality is an histogram which is filled with 0. each time this functio is called, + * then fills 1. if the centrality filling fails (return = -1.) + */ template -float getCentrality(Tcollision const& collision, const int centralityEstimator) +float getCentrality(Tcollision const& collision, const int centralityEstimator, std::shared_ptr hFailCentrality = nullptr) { + if (hFailCentrality) { + hFailCentrality->Fill(0.); + } if constexpr (!o2::aod::HasCentrality) { // requires aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentNTPVs return -1.f; + if (hFailCentrality) { + hFailCentrality->Fill(1.); + } } if (centralityEstimator == centDetectors::kFV0A) { return collision.centFV0A(); @@ -365,6 +377,9 @@ float getCentrality(Tcollision const& collision, const int centralityEstimator) } else { LOG(warning) << "Centrality estimator not valid. Possible values: (FV0A: 0, FT0M: 1, FT0A: 2, FT0C: 3). Centrality set to -1."; } + if (hFailCentrality) { + hFailCentrality->Fill(1.); + } return -1.f; } @@ -379,7 +394,7 @@ enum trackSelection { static const std::array(trackSelection::kNtrackSelections)> trackSelectionLabels{"All", "Track cuts", "PID cuts"}; template -void createHistogramRegistryNucleus(HistogramRegistry& registry) +void createHistogramRegistryNucleus(o2::framework::HistogramRegistry& registry) { constexpr int index = iSpecies; @@ -387,24 +402,25 @@ void createHistogramRegistryNucleus(HistogramRegistry& registry) std::runtime_error("species contains invalid nucleus index"); } - registry.add(fmt::format("{}/hTrackSelections", cNames[index]).c_str(), (fmt::format("{} track selections;", cNames[index]) + std::string("Selection step; Counts")).c_str(), HistType::kTH1D, {{trackSelection::kNtrackSelections, -0.5f, static_cast(trackSelection::kNtrackSelections) - 0.5f}}); - registry.add(fmt::format("{}/hPtReconstructed", cNames[index]).c_str(), (fmt::format("{} - reconstructed variables;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); Counts")).c_str(), HistType::kTH1F, {{240, -6.0f, 6.0f}}); - registry.add(fmt::format("{}/h3PtVsEtaVsCentralityReconstructed", cNames[index]).c_str(), (fmt::format("{} - reconstructed variables;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); #eta; CentralityFT0C (%)")).c_str(), HistType::kTH3F, {{240, -6.0f, 6.0f}, {40, -1.0f, 1.f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3PhiVsEtaVsCentralityReconstructed", cNames[index]).c_str(), (fmt::format("{} - reconstructed variables;", cNames[index]) + std::string("#phi (radians); #eta; CentralityFT0C (%)")).c_str(), HistType::kTH3F, {{40, 0, o2::constants::math::TwoPI}, {40, -1.0f, 1.f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3DCAxyVsPtVsCentrality", cNames[index]).c_str(), (fmt::format(";", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); DCA_{xy} (cm); CentralityFT0C (%)")).c_str(), HistType::kTH3F, {{240, -6.0f, 6.0f}, {200, -0.5f, 0.5f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3DCAzVsPtVsCentrality", cNames[index]).c_str(), (fmt::format("{};", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); DCA_{z} (cm); CentralityFT0C (%)")).c_str(), HistType::kTH3F, {{240, -6.0f, 6.0f}, {200, -0.5f, 0.5f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3NsigmaTPC_preselectionVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} TPC distribution;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{TPC}}({}); CentralityFT0C (%)", cNames[index])).c_str(), HistType::kTH3F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3NsigmaTPCVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} TPC distribution;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{TPC}}({}); Centrality FT0C (%)", cNames[index])).c_str(), HistType::kTH3F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3NsigmaITS_preselectionVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} ITS distribution;", cNames[index]) + std::string("signed #it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{ITS}}({}); Centrality FT0C (%)", cNames[index])).c_str(), HistType::kTH3F, {{50, -5.0f, 5.0f}, {120, -3.0f, 3.0f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3NsigmaITSVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} ITS distribution;", cNames[index]) + std::string("signed #it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{ITS}}({}); Centrality FT0C (%)", cNames[index])).c_str(), HistType::kTH3F, {{50, -5.0f, 5.0f}, {120, -3.0f, 3.0f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3NsigmaTOF_preselectionVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} TOF distribution;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{TOF}}({}); Centrality FT0C (%)", cNames[index])).c_str(), HistType::kTH3F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3NsigmaTOFVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} TOF distribution;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{TOF}}({}); Centrality FT0C (%)", cNames[index], cNames[index])).c_str(), HistType::kTH3F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3BetaVsPtVsCentrality", cNames[index]).c_str(), (fmt::format("{};", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); #beta; CentralityFT0C (%)")).c_str(), HistType::kTH3F, {{240, -6.0f, 6.0f}, {100, 0.0f, 1.0f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3dEdxVsPVsCentrality", cNames[index]).c_str(), (fmt::format("dEdx distribution for {};", cNames[index]) + std::string("#it{p} (GeV/#it{c}); d#it{E}/d#it{x} (a.u.); Centrality FT0C (%)")).c_str(), HistType::kTH3F, {{200, -6.0f, 6.0f}, {100, 0.0f, 2000.0f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3ClusterSizeVsPtVsCentrality", cNames[index]).c_str(), (fmt::format("{};", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); Cluster size ITS; CentralityFT0C (%)")).c_str(), HistType::kTH3F, {{240, -6.0f, 6.0f}, {90, 0.f, 15.f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/hPtGenerated", cNames[index]).c_str(), (fmt::format("{} - generated variables;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); Counts")).c_str(), HistType::kTH1F, {{240, -6.0f, 6.0f}}); - registry.add(fmt::format("{}/h3PtVsEtaVsCentralityGenerated", cNames[index]).c_str(), (fmt::format("{} - generated variables;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); #eta; CentralityFT0C (%)")).c_str(), HistType::kTH3F, {{240, -6.0f, 6.0f}, {40, -1.0f, 1.f}, {20, 0.0f, 100.0f}}); - registry.add(fmt::format("{}/h3PhiVsEtaVsCentralityGenerated", cNames[index]).c_str(), (fmt::format("{} - generated variables;", cNames[index]) + std::string("#phi (radians); #eta; CentralityFT0C (%)")).c_str(), HistType::kTH3F, {{40, 0, o2::constants::math::TwoPI}, {40, -1.0f, 1.f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/hTrackSelections", cNames[index]).c_str(), (fmt::format("{} track selections;", cNames[index]) + std::string("Selection step; Counts")).c_str(), o2::framework::HistType::kTH1D, {{trackSelection::kNtrackSelections, -0.5f, static_cast(trackSelection::kNtrackSelections) - 0.5f}}); + registry.add(fmt::format("{}/hPtReconstructed", cNames[index]).c_str(), (fmt::format("{} - reconstructed variables;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); Counts")).c_str(), o2::framework::HistType::kTH1F, {{400, -10.0f, 10.0f}}); + registry.add(fmt::format("{}/h2PtVsCentralityReconstructed", cNames[index]).c_str(), (fmt::format("{} - reconstructed variables;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); CentralityFT0C (%)")).c_str(), o2::framework::HistType::kTH2F, {{400, -10.0f, 10.0f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3PhiVsEtaVsCentralityReconstructed", cNames[index]).c_str(), (fmt::format("{} - reconstructed variables;", cNames[index]) + std::string("#phi (radians); #eta; CentralityFT0C (%)")).c_str(), o2::framework::HistType::kTH3F, {{40, 0, o2::constants::math::TwoPI}, {40, -1.0f, 1.f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3DCAxyVsPtVsCentrality", cNames[index]).c_str(), (fmt::format(";", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); DCA_{xy} (cm); CentralityFT0C (%)")).c_str(), o2::framework::HistType::kTH3F, {{400, -10.0f, 10.0f}, {200, -0.5f, 0.5f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3DCAzVsPtVsCentrality", cNames[index]).c_str(), (fmt::format("{};", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); DCA_{z} (cm); CentralityFT0C (%)")).c_str(), o2::framework::HistType::kTH3F, {{400, -10.0f, 10.0f}, {200, -0.5f, 0.5f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3NsigmaTPC_preselectionVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} TPC distribution;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{TPC}}({}); CentralityFT0C (%)", cNames[index])).c_str(), o2::framework::HistType::kTH3F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3NsigmaTPCVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} TPC distribution;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{TPC}}({}); Centrality FT0C (%)", cNames[index])).c_str(), o2::framework::HistType::kTH3F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3NsigmaITS_preselectionVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} ITS distribution;", cNames[index]) + std::string("signed #it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{ITS}}({}); Centrality FT0C (%)", cNames[index])).c_str(), o2::framework::HistType::kTH3F, {{50, -5.0f, 5.0f}, {120, -3.0f, 3.0f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3NsigmaITSVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} ITS distribution;", cNames[index]) + std::string("signed #it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{ITS}}({}); Centrality FT0C (%)", cNames[index])).c_str(), o2::framework::HistType::kTH3F, {{50, -5.0f, 5.0f}, {120, -3.0f, 3.0f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3NsigmaTOF_preselectionVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} TOF distribution;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{TOF}}({}); Centrality FT0C (%)", cNames[index])).c_str(), o2::framework::HistType::kTH3F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3NsigmaTOFVsCentrality", cNames[index]).c_str(), (fmt::format("Nsigma{} TOF distribution;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c});") + fmt::format("n#sigma_{{TOF}}({}); Centrality FT0C (%)", cNames[index], cNames[index])).c_str(), o2::framework::HistType::kTH3F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3BetaVsPtVsCentrality", cNames[index]).c_str(), (fmt::format("{};", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); #beta; CentralityFT0C (%)")).c_str(), o2::framework::HistType::kTH3F, {{400, -10.0f, 10.0f}, {100, 0.0f, 1.0f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3dEdxVsPVsCentrality", cNames[index]).c_str(), (fmt::format("dEdx distribution for {};", cNames[index]) + std::string("#it{p} (GeV/#it{c}); d#it{E}/d#it{x} (a.u.); Centrality FT0C (%)")).c_str(), o2::framework::HistType::kTH3F, {{200, -6.0f, 6.0f}, {100, 0.0f, 2000.0f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3ClusterSizeVsPtVsCentrality", cNames[index]).c_str(), (fmt::format("{};", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); Cluster size ITS; CentralityFT0C (%)")).c_str(), o2::framework::HistType::kTH3F, {{400, -10.0f, 10.0f}, {90, 0.f, 15.f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/hPtGenerated", cNames[index]).c_str(), (fmt::format("{} - generated variables;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); Counts")).c_str(), o2::framework::HistType::kTH1F, {{400, -10.0f, 10.0f}}); + registry.add(fmt::format("{}/h2PtVsCentralityGenerated", cNames[index]).c_str(), (fmt::format("{} - generated variables;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); CentralityFT0C (%)")).c_str(), o2::framework::HistType::kTH2F, {{400, -10.0f, 10.0f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3PtVsRapidityVsCentralityGenerated", cNames[index]).c_str(), (fmt::format("{} - generated variables;", cNames[index]) + std::string("#it{p}_{T} / |#it{Z}| (GeV/#it{c}); y; CentralityFT0C (%)")).c_str(), o2::framework::HistType::kTH3F, {{400, -10.0f, 10.0f}, {40, -1.0f, 1.f}, {20, 0.0f, 100.0f}}); + registry.add(fmt::format("{}/h3PhiVsEtaVsCentralityGenerated", cNames[index]).c_str(), (fmt::format("{} - generated variables;", cNames[index]) + std::string("#phi (radians); #eta; CentralityFT0C (%)")).c_str(), o2::framework::HistType::kTH3F, {{40, 0, o2::constants::math::TwoPI}, {40, -1.0f, 1.f}, {20, 0.0f, 100.0f}}); for (size_t iSel = 0; iSel < trackSelection::kNtrackSelections; iSel++) { registry.get(HIST(cNames[index]) + HIST("/hTrackSelections"))->GetXaxis()->SetBinLabel(iSel + 1, trackSelectionLabels[iSel].c_str()); @@ -517,12 +533,12 @@ class PidManager float pScaled = p * mMomScaling[0] + mMomScaling[1]; float betaGamma = pScaled / masses[mSpecies]; - return tpc::BetheBlochAleph(betaGamma, - mTpcBetheBlochParams[0], - mTpcBetheBlochParams[1], - mTpcBetheBlochParams[2], - mTpcBetheBlochParams[3], - mTpcBetheBlochParams[4]); + return o2::tpc::BetheBlochAleph(betaGamma, + mTpcBetheBlochParams[0], + mTpcBetheBlochParams[1], + mTpcBetheBlochParams[2], + mTpcBetheBlochParams[3], + mTpcBetheBlochParams[4]); } template