diff --git a/ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx b/ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx index ed1913420d5..5d63cc48434 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx @@ -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); diff --git a/CODEOWNERS b/CODEOWNERS index a1123028fa1..4c222d06b34 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -29,7 +29,7 @@ /PWGDQ @alibuild @iarsene @dsekihat @feisenhu @lucamicheletti93 /PWGEM @alibuild @mikesas @rbailhac @feisenhu /PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @ivorobye @feisenhu -/PWGEM/PhotonMeson @alibuild @mikesas @rbailhac @m-c-danisch @novitzky @mhemmer-cern +/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 /PWGMM @alibuild @aalkin diff --git a/Common/DataModel/PIDResponse.h b/Common/DataModel/PIDResponse.h index f4c0d8ac0dc..d64aced3c94 100644 --- a/Common/DataModel/PIDResponse.h +++ b/Common/DataModel/PIDResponse.h @@ -46,6 +46,13 @@ void packInTable(const float& valueToBin, T& table) } } +// Function to unpack a binned value into a float +template +float unPackInTable(const typename binningType::binned_t& valueToUnpack) +{ + return binningType::bin_width * static_cast(valueToUnpack); +} + // Checkers for TOF PID hypothesis availability (runtime) template using hasTOFEl = decltype(std::declval().tofNSigmaEl()); @@ -481,7 +488,7 @@ DECLARE_SOA_COLUMN(TOFNSigmaAl, tofNSigmaAl, float); //! Nsigma separation with // Macro to convert the stored Nsigmas to floats #define DEFINE_UNWRAP_NSIGMA_COLUMN(COLUMN, COLUMN_NAME) \ DECLARE_SOA_DYNAMIC_COLUMN(COLUMN, COLUMN_NAME, \ - [](binning::binned_t nsigma_binned) -> float { return binning::bin_width * static_cast(nsigma_binned); }); + [](binning::binned_t nsigma_binned) -> float { return o2::aod::pidutils::unPackInTable(nsigma_binned); }); namespace pidtof_tiny { diff --git a/Common/TableProducer/trackPropagation.cxx b/Common/TableProducer/trackPropagation.cxx index 0f085a67477..d0f64b15c9e 100644 --- a/Common/TableProducer/trackPropagation.cxx +++ b/Common/TableProducer/trackPropagation.cxx @@ -151,7 +151,7 @@ struct TrackPropagation { for (auto& track : tracks) { if constexpr (fillCovMat) { - if (fillTracksDCACov) { + if (fillTracksDCA || fillTracksDCACov) { mDcaInfoCov.set(999, 999, 999, 999, 999); } setTrackParCov(track, mTrackParCov); diff --git a/DPG/Tasks/AOTTrack/perfK0sResolution.cxx b/DPG/Tasks/AOTTrack/perfK0sResolution.cxx index 9c5b31a4d4d..ef22df6c07c 100644 --- a/DPG/Tasks/AOTTrack/perfK0sResolution.cxx +++ b/DPG/Tasks/AOTTrack/perfK0sResolution.cxx @@ -46,6 +46,16 @@ struct perfK0sResolution { const AxisSpec etaAxis{etaBins, "#eta"}; const AxisSpec phiAxis{phiBins, "#phi"}; + int nProc = 0; + if (doprocessData) { + LOG(info) << "processData enabled"; + nProc++; + } + if (doprocessMC) { + LOG(info) << "processMC enabled"; + nProc++; + } + registry.add("h2_masspT", "h2_masspT", {HistType::kTH2F, {mAxis, pTAxis}}); registry.add("h2_masseta", "h2_masseta", {HistType::kTH2F, {mAxis, etaAxis}}); registry.add("h2_massphi", "h2_massphi", {HistType::kTH2F, {mAxis, phiAxis}}); @@ -62,26 +72,70 @@ struct perfK0sResolution { Configurable nSigTPC{"nSigTPC", 10., "nSigTPC"}; Configurable trdSelectionPos{"trdSelectionPos", 0, "Flag for the TRD selection on positive daughters: -1 no TRD, 0 no selection, 1 TRD"}; Configurable trdSelectionNeg{"trdSelectionNeg", 0, "Flag for the TRD selection on negative daughters: -1 no TRD, 0 no selection, 1 TRD"}; + Configurable tofSelectionPos{"tofSelectionPos", 0, "Flag for the TOF selection on positive daughters: -1 no TOF, 0 no selection, 1 TOF"}; + Configurable tofSelectionNeg{"tofSelectionNeg", 0, "Flag for the TOF selection on negative daughters: -1 no TOF, 0 no selection, 1 TOF"}; Configurable eventSelection{"eventSelection", true, "event selection"}; template bool acceptV0(const T1& v0, const T2& ntrack, const T2& ptrack, const C& collision) { // Apply selections on V0 - if (TMath::Abs(v0.yK0Short()) > rapidity) + if (TMath::Abs(v0.yK0Short()) > rapidity) { return false; - if (v0.v0cosPA() < v0setting_cospa) + } + if (v0.v0cosPA() < v0setting_cospa) { return false; - if (v0.v0radius() < v0setting_radius) + } + if (v0.v0radius() < v0setting_radius) { return false; - if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * pid_constants::sMasses[PID::K0] > 2.684 * v0lifetime) + } + if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * pid_constants::sMasses[PID::K0] > 2.684 * v0lifetime) { return false; + } // Apply selections on V0 daughters - if (!ntrack.hasTPC() || !ptrack.hasTPC()) + if (!ntrack.hasTPC() || !ptrack.hasTPC()) { return false; - if (ntrack.tpcNSigmaPi() > nSigTPC || ptrack.tpcNSigmaPi() > nSigTPC) + } + if (ntrack.tpcNSigmaPi() > nSigTPC || ptrack.tpcNSigmaPi() > nSigTPC) { return false; + } + // TOF selection + switch (tofSelectionPos) { + case -1: + if (ptrack.hasTOF()) { + return false; + } + break; + case 0: + break; + case 1: + if (!ptrack.hasTOF()) { + return false; + } + break; + default: + LOG(fatal) << "Invalid TRD selection for positive daughter"; + break; + } + switch (tofSelectionNeg) { + case -1: + if (ntrack.hasTOF()) { + return false; + } + break; + case 0: + break; + case 1: + if (!ntrack.hasTOF()) { + return false; + } + break; + default: + LOG(fatal) << "Invalid TRD selection for negative daughter"; + break; + } + // TRD selection switch (trdSelectionPos) { case -1: if (ptrack.hasTRD()) { @@ -121,7 +175,7 @@ struct perfK0sResolution { Filter v0Filter = nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv&& nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv&& aod::v0data::dcaV0daughters < v0setting_dcav0dau; - void process(SelectedCollisions::iterator const& collision, soa::Filtered const& fullV0s, PIDTracks const& tracks) + void processData(SelectedCollisions::iterator const& collision, soa::Filtered const& fullV0s, PIDTracks const& tracks) { if (eventSelection && !collision.sel8()) return; @@ -138,10 +192,34 @@ struct perfK0sResolution { registry.fill(HIST("h2_massphi"), v0.mK0Short(), v0.phi()); } } + PROCESS_SWITCH(perfK0sResolution, processData, "Process data", true); + + void processMC(SelectedCollisions::iterator const& collision, soa::Filtered const& fullV0s, soa::Join const& tracks, aod::McParticles const&) + { + if (eventSelection && !collision.sel8()) + return; + + for (auto& v0 : fullV0s) { + + const auto& posTrack = v0.posTrack_as>(); + const auto& negTrack = v0.negTrack_as>(); + if (!acceptV0(v0, negTrack, posTrack, collision)) + continue; + if (!posTrack.has_mcParticle()) { + continue; + } + if (!negTrack.has_mcParticle()) { + continue; + } + if (posTrack.mcParticle().pdgCode() != PID::Pion || negTrack.mcParticle().pdgCode() != PID::Pion) { + continue; + } + registry.fill(HIST("h2_masspT"), v0.mK0Short(), v0.pt()); + registry.fill(HIST("h2_masseta"), v0.mK0Short(), v0.eta()); + registry.fill(HIST("h2_massphi"), v0.mK0Short(), v0.phi()); + } + } + PROCESS_SWITCH(perfK0sResolution, processMC, "Process MC", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; -} +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/DPG/Tasks/AOTTrack/qaEfficiencyV0s.cxx b/DPG/Tasks/AOTTrack/qaEfficiencyV0s.cxx index ab77a8b121a..0476d724b22 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiencyV0s.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiencyV0s.cxx @@ -36,45 +36,53 @@ #include "THashList.h" using namespace o2::framework; +static constexpr int nSpecies = 2; // One per PDG +// static constexpr const char* particleTitle[nSpecies] = {"K0s", "-K0s"}; +static constexpr int PDGs[nSpecies] = {kK0Short, -kK0Short}; +int pdgToIndex(int pdg) +{ + for (int i = 0; i < nSpecies; i++) { + if (pdg == PDGs[i]) { + return i; + } + } + return -1; +} +static constexpr int kHistoPtNum = 0; +static constexpr int kHistoPtDen = 1; +static constexpr int kHistoTot = 2; + +std::shared_ptr histograms[nSpecies][kHistoTot] = {{nullptr}}; +std::shared_ptr histogramsPrm[nSpecies][kHistoTot] = {{nullptr}}; +std::shared_ptr histogramsPrmRap[nSpecies][kHistoTot] = {{nullptr}}; struct QaEfficiencyV0s { // Particle information - static constexpr int nSpecies = 1; // One per PDG - static constexpr const char* particleTitle[nSpecies] = {"K0s"}; - static constexpr int PDGs[nSpecies] = {kK0Short}; - // Particle only selection - Configurable doK0s{"do-k0s", false, "Flag to run with the PDG code of k0s"}; Configurable rapidityCut{"rapidityCut", 0.5, "Rapidity cut"}; ConfigurableAxis ptBins{"ptBins", {200, 0.f, 5.f}, "Pt binning"}; OutputObj listEfficiencyMC{"EfficiencyMC"}; - // Histograms - HistogramRegistry registry{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - void init(InitContext&) { const AxisSpec axisPt{ptBins, "#it{p}_{T} GeV/#it{c}"}; - auto h = registry.add("Pos/PtNum_310", "Pos/Num_310", kTH1F, {axisPt}); - registry.add("Pos/PtDen_310", "Pos/Den_310", kTH1F, {axisPt}); - registry.add("Neg/PtNum_310", "Neg/Num_310", kTH1F, {axisPt}); - registry.add("Neg/PtDen_310", "Neg/Den_310", kTH1F, {axisPt}); - registry.add("Prm/Pos/PtNum_310", "Prm/Pos/Num_310", kTH1F, {axisPt}); - registry.add("Prm/Pos/PtDen_310", "Prm/Pos/Den_310", kTH1F, {axisPt}); - registry.add("Prm/Neg/PtNum_310", "Prm/Neg/Num_310", kTH1F, {axisPt}); - registry.add("Prm/Neg/PtDen_310", "Prm/Neg/Den_310", kTH1F, {axisPt}); - registry.add("PrmRap/Pos/PtNum_310", "PrmRap/Pos/Num_310", kTH1F, {axisPt}); - registry.add("PrmRap/Pos/PtDen_310", "PrmRap/Pos/Den_310", kTH1F, {axisPt}); - registry.add("PrmRap/Neg/PtNum_310", "PrmRap/Neg/Num_310", kTH1F, {axisPt}); - registry.add("PrmRap/Neg/PtDen_310", "PrmRap/Neg/Den_310", kTH1F, {axisPt}); - - TAxis* axis = h->GetXaxis(); listEfficiencyMC.setObject(new THashList); - listEfficiencyMC->Add(new TEfficiency(Form("efficiencyPt_pdg%d", PDGs[0]), Form("efficiencyPt_pdg%d", PDGs[0]), axis->GetNbins(), axis->GetXmin(), axis->GetXmax())); - listEfficiencyMC->Add(new TEfficiency(Form("efficiencyPt_pdg-%d", PDGs[0]), Form("efficiencyPt_pdg-%d", PDGs[0]), axis->GetNbins(), axis->GetXmin(), axis->GetXmax())); - listEfficiencyMC->Add(new TEfficiency(Form("efficiencyPtPrm_pdg%d", PDGs[0]), Form("efficiencyPtPrm_pdg%d", PDGs[0]), axis->GetNbins(), axis->GetXmin(), axis->GetXmax())); - listEfficiencyMC->Add(new TEfficiency(Form("efficiencyPtPrm_pdg-%d", PDGs[0]), Form("efficiencyPtPrm_pdg-%d", PDGs[0]), axis->GetNbins(), axis->GetXmin(), axis->GetXmax())); - listEfficiencyMC->Add(new TEfficiency(Form("efficiencyPtPrmRap_pdg%d", PDGs[0]), Form("efficiencyPtPrmRap_pdg%d", PDGs[0]), axis->GetNbins(), axis->GetXmin(), axis->GetXmax())); - listEfficiencyMC->Add(new TEfficiency(Form("efficiencyPtPrmRap_pdg-%d", PDGs[0]), Form("efficiencyPtPrmRap_pdg-%d", PDGs[0]), axis->GetNbins(), axis->GetXmin(), axis->GetXmax())); + + for (int i = 0; i < nSpecies; i++) { + // MC efficiency (PDG code + histograms[i][kHistoPtNum] = registry.add(Form("Pt/Num_%i", PDGs[i]), Form("Num %i", PDGs[i]), kTH1F, {axisPt}); + histograms[i][kHistoPtDen] = registry.add(Form("Pt/Den_%i", PDGs[i]), Form("Den %i", PDGs[i]), kTH1F, {axisPt}); + + histogramsPrm[i][kHistoPtNum] = registry.add(Form("Pt/Prm/Num_%i", PDGs[i]), Form("Pt Prm Num %i", PDGs[i]), kTH1F, {axisPt}); + histogramsPrm[i][kHistoPtDen] = registry.add(Form("Pt/Prm/Den_%i", PDGs[i]), Form("Pt Prm Den %i", PDGs[i]), kTH1F, {axisPt}); + + histogramsPrmRap[i][kHistoPtNum] = registry.add(Form("Pt/Prm/Rap/PtNum_%i", PDGs[i]), Form("Pt Prm Rap Num %i", PDGs[i]), kTH1F, {axisPt}); + histogramsPrmRap[i][kHistoPtDen] = registry.add(Form("Pt/Prm/Rap/PtDen_%i", PDGs[i]), Form("Pt Prm Rap Den %i", PDGs[i]), kTH1F, {axisPt}); + + TAxis* axis = histograms[i][0]->GetXaxis(); + listEfficiencyMC->Add(new TEfficiency(Form("efficiencyPt_pdg%d", PDGs[i]), Form("efficiencyPt_pdg%d", PDGs[i]), axis->GetNbins(), axis->GetXmin(), axis->GetXmax())); + listEfficiencyMC->Add(new TEfficiency(Form("efficiencyPtPrm_pdg%d", PDGs[i]), Form("efficiencyPtPrm_pdg%d", PDGs[i]), axis->GetNbins(), axis->GetXmin(), axis->GetXmax())); + listEfficiencyMC->Add(new TEfficiency(Form("efficiencyPtPrmRap_pdg%d", PDGs[i]), Form("efficiencyPtPrmRap_pdg%d", PDGs[i]), axis->GetNbins(), axis->GetXmin(), axis->GetXmax())); + } } // MC process @@ -83,62 +91,44 @@ struct QaEfficiencyV0s { void process(o2::aod::McV0Labels const& V0s, o2::aod::McParticles const& mcParticles) { - for (auto const& v0 : V0s) { + for (auto const& v0 : V0s) { // Numerator if (v0.has_mcParticle()) { auto mcparticle = v0.mcParticle(); - if (mcparticle.pdgCode() == PDGs[0]) { - registry.fill(HIST("Pos/PtNum_310"), mcparticle.pt()); - if (mcparticle.isPhysicalPrimary()) { - registry.fill(HIST("Prm/Pos/PtNum_310"), mcparticle.pt()); - if (TMath::Abs(mcparticle.y()) < rapidityCut) { - registry.fill(HIST("PrmRap/Pos/PtNum_310"), mcparticle.pt()); - } - } - } else if (mcparticle.pdgCode() == -PDGs[0]) { - registry.fill(HIST("Neg/PtNum_310"), mcparticle.pt()); - if (mcparticle.isPhysicalPrimary()) { - registry.fill(HIST("Prm/Neg/PtNum_310"), mcparticle.pt()); - if (TMath::Abs(mcparticle.y()) < rapidityCut) { - registry.fill(HIST("PrmRap/Neg/PtNum_310"), mcparticle.pt()); - } - } + const auto index = pdgToIndex(mcparticle.pdgCode()); + if (index < 0) { + continue; } - } - } - for (auto const& mcparticle : mcParticles) { - if (mcparticle.pdgCode() == PDGs[0]) { - registry.fill(HIST("Pos/PtDen_310"), mcparticle.pt()); + histograms[index][kHistoPtNum]->Fill(mcparticle.pt()); if (mcparticle.isPhysicalPrimary()) { - registry.fill(HIST("Prm/Pos/PtDen_310"), mcparticle.pt()); + histogramsPrm[index][kHistoPtNum]->Fill(mcparticle.pt()); if (TMath::Abs(mcparticle.y()) < rapidityCut) { - registry.fill(HIST("PrmRap/Pos/PtDen_310"), mcparticle.pt()); + histogramsPrmRap[index][kHistoPtNum]->Fill(mcparticle.pt()); } } - } else if (mcparticle.pdgCode() == -PDGs[0]) { - registry.fill(HIST("Neg/PtDen_310"), mcparticle.pt()); - if (mcparticle.isPhysicalPrimary()) { - registry.fill(HIST("Prm/Neg/PtDen_310"), mcparticle.pt()); - if (TMath::Abs(mcparticle.y()) < rapidityCut) { - registry.fill(HIST("PrmRap/Neg/PtDen_310"), mcparticle.pt()); - } + } + } + for (auto const& mcparticle : mcParticles) { // Denominator + const auto index = pdgToIndex(mcparticle.pdgCode()); + if (index < 0) { + continue; + } + histograms[index][kHistoPtDen]->Fill(mcparticle.pt()); + if (mcparticle.isPhysicalPrimary()) { + histogramsPrm[index][kHistoPtDen]->Fill(mcparticle.pt()); + if (TMath::Abs(mcparticle.y()) < rapidityCut) { + histogramsPrmRap[index][kHistoPtDen]->Fill(mcparticle.pt()); } } } - static_cast(listEfficiencyMC->At(0))->SetPassedHistogram(*registry.get(HIST("Pos/PtNum_310")), "f"); - static_cast(listEfficiencyMC->At(0))->SetTotalHistogram(*registry.get(HIST("Pos/PtDen_310")), "f"); - static_cast(listEfficiencyMC->At(1))->SetPassedHistogram(*registry.get(HIST("Neg/PtNum_310")), "f"); - static_cast(listEfficiencyMC->At(1))->SetTotalHistogram(*registry.get(HIST("Neg/PtDen_310")), "f"); - - static_cast(listEfficiencyMC->At(2))->SetPassedHistogram(*registry.get(HIST("Prm/Pos/PtNum_310")), "f"); - static_cast(listEfficiencyMC->At(2))->SetTotalHistogram(*registry.get(HIST("Prm/Pos/PtDen_310")), "f"); - static_cast(listEfficiencyMC->At(3))->SetPassedHistogram(*registry.get(HIST("Prm/Neg/PtNum_310")), "f"); - static_cast(listEfficiencyMC->At(3))->SetTotalHistogram(*registry.get(HIST("Prm/Neg/PtDen_310")), "f"); - - static_cast(listEfficiencyMC->At(4))->SetPassedHistogram(*registry.get(HIST("PrmRap/Pos/PtNum_310")), "f"); - static_cast(listEfficiencyMC->At(4))->SetTotalHistogram(*registry.get(HIST("PrmRap/Pos/PtDen_310")), "f"); - static_cast(listEfficiencyMC->At(5))->SetPassedHistogram(*registry.get(HIST("PrmRap/Neg/PtNum_310")), "f"); - static_cast(listEfficiencyMC->At(5))->SetTotalHistogram(*registry.get(HIST("PrmRap/Neg/PtDen_310")), "f"); + for (int i = 0; i < nSpecies; i++) { + static_cast(listEfficiencyMC->At(i * nSpecies))->SetPassedHistogram(*histograms[i][kHistoPtNum].get(), "f"); + static_cast(listEfficiencyMC->At(i * nSpecies))->SetTotalHistogram(*histograms[i][kHistoPtDen].get(), "f"); + static_cast(listEfficiencyMC->At(i * nSpecies + 1))->SetPassedHistogram(*histogramsPrm[i][kHistoPtNum].get(), "f"); + static_cast(listEfficiencyMC->At(i * nSpecies + 1))->SetTotalHistogram(*histogramsPrm[i][kHistoPtDen].get(), "f"); + static_cast(listEfficiencyMC->At(i * nSpecies + 2))->SetPassedHistogram(*histogramsPrmRap[i][kHistoPtNum].get(), "f"); + static_cast(listEfficiencyMC->At(i * nSpecies + 2))->SetTotalHistogram(*histogramsPrmRap[i][kHistoPtDen].get(), "f"); + } } }; diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index d2a7e8aeeac..5208db8e2a1 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -376,12 +376,13 @@ struct HfFilter { // Main struct for HF triggers getPxPyPz(trackParNeg, pVecNeg); } - bool isCharmTagged{true}, isBeautyTagged{true}; + bool isSignalTagged{true}, isCharmTagged{true}, isBeautyTagged{true}; // apply ML models int tagBDT = 0; float scoresToFill[3] = {-1., -1., -1.}; if (applyML && onnxFiles[kD0] != "") { + isSignalTagged = false; isCharmTagged = false; isBeautyTagged = false; @@ -411,11 +412,12 @@ struct HfFilter { // Main struct for HF triggers hBDTScoreNonPrompt[kD0]->Fill(scoresToFill[2]); } + isSignalTagged = TESTBIT(tagBDT, RecoDecay::OriginType::None); isCharmTagged = TESTBIT(tagBDT, RecoDecay::OriginType::Prompt); isBeautyTagged = TESTBIT(tagBDT, RecoDecay::OriginType::NonPrompt); } - if (!isCharmTagged && !isBeautyTagged) { + if (!isSignalTagged) { continue; } @@ -546,7 +548,7 @@ struct HfFilter { // Main struct for HF triggers // 2-prong with Gamma (conversion photon) auto v0sThisCollision = theV0s.sliceBy(v0sPerCollision, thisCollId); for (const auto& v0 : v0sThisCollision) { - if (!keepEvent[kV0Charm2P] && (isCharmTagged || isBeautyTagged) && (TESTBIT(selD0, 0) || TESTBIT(selD0, 1))) { + if (!keepEvent[kV0Charm2P] && (isSignalTagged) && (TESTBIT(selD0, 0) || TESTBIT(selD0, 1))) { auto posTrack = v0.posTrack_as(); auto negTrack = v0.negTrack_as(); auto selV0 = helper.isSelectedV0(v0, std::array{posTrack, negTrack}, collision, activateQA, hV0Selected, hArmPod); @@ -694,6 +696,7 @@ struct HfFilter { // Main struct for HF triggers } } + std::array isSignalTagged = is3Prong; std::array isCharmTagged = is3Prong; std::array isBeautyTagged = is3Prong; @@ -703,6 +706,7 @@ struct HfFilter { // Main struct for HF triggers } // initialize BDT scores array outside ML loop // apply ML models if (applyML) { + isSignalTagged = std::array{0}; isCharmTagged = std::array{0}; isBeautyTagged = std::array{0}; @@ -731,6 +735,7 @@ struct HfFilter { // Main struct for HF triggers LOG(error) << "Error running model inference for " << charmParticleNames[iCharmPart + 1].data() << ": Unexpected input data type."; } + isSignalTagged[iCharmPart] = TESTBIT(tagBDT, RecoDecay::OriginType::None); isCharmTagged[iCharmPart] = TESTBIT(tagBDT, RecoDecay::OriginType::Prompt); isBeautyTagged[iCharmPart] = TESTBIT(tagBDT, RecoDecay::OriginType::NonPrompt); @@ -742,7 +747,7 @@ struct HfFilter { // Main struct for HF triggers } } - if (!std::accumulate(isCharmTagged.begin(), isCharmTagged.end(), 0) && !std::accumulate(isBeautyTagged.begin(), isBeautyTagged.end(), 0)) { + if (!std::accumulate(isSignalTagged.begin(), isSignalTagged.end(), 0)) { continue; } @@ -784,7 +789,7 @@ struct HfFilter { // Main struct for HF triggers keepEvent[kHighPt3P] = true; if (activateQA) { for (auto iCharmPart{1}; iCharmPart < kNCharmParticles; ++iCharmPart) { - if (is3Prong[iCharmPart - 1] && (isCharmTagged[iCharmPart - 1] || isBeautyTagged[iCharmPart - 1])) { + if (is3Prong[iCharmPart - 1] && (isSignalTagged[iCharmPart - 1])) { hCharmHighPt[iCharmPart]->Fill(pt3Prong); } } @@ -855,9 +860,9 @@ struct HfFilter { // Main struct for HF triggers // 3-prong with V0 (Ds gamma, D+ K0S, D+ Lambda) auto v0sThisCollision = theV0s.sliceBy(v0sPerCollision, thisCollId); - bool isGoodDsToKKPi = (isCharmTagged[kDs - 1] || isBeautyTagged[kDs - 1]) && TESTBIT(is3ProngInMass[kDs - 1], 0); - bool isGoodDsToPiKK = (isCharmTagged[kDs - 1] || isBeautyTagged[kDs - 1]) && TESTBIT(is3ProngInMass[kDs - 1], 1); - bool isGoodDPlus = (isCharmTagged[kDplus - 1] || isBeautyTagged[kDplus - 1]) && is3ProngInMass[kDplus - 1]; + bool isGoodDsToKKPi = (isSignalTagged[kDs - 1]) && TESTBIT(is3ProngInMass[kDs - 1], 0); + bool isGoodDsToPiKK = (isSignalTagged[kDs - 1]) && TESTBIT(is3ProngInMass[kDs - 1], 1); + bool isGoodDPlus = (isSignalTagged[kDplus - 1]) && is3ProngInMass[kDplus - 1]; auto massDPlusCand = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird}, std::array{massPi, massKa, massPi}); auto massDsKKPi = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird}, std::array{massKa, massKa, massPi}); auto massDsPiKK = RecoDecay::m(std::array{pVecFirst, pVecSecond, pVecThird}, std::array{massPi, massKa, massKa}); diff --git a/EventFiltering/PWGHF/HFFilterCharmHadronSignals.cxx b/EventFiltering/PWGHF/HFFilterCharmHadronSignals.cxx index d2c568e6617..3d3be1942d9 100644 --- a/EventFiltering/PWGHF/HFFilterCharmHadronSignals.cxx +++ b/EventFiltering/PWGHF/HFFilterCharmHadronSignals.cxx @@ -67,6 +67,8 @@ struct HfFilterCharmHadronSignals { // Main struct for HF triggers Configurable maxPtSoftPion{"maxPtSoftPion", static_cast(cutsPt[1][1]), "maximum pT for soft pion tracks in D*+ -> D0pi decay"}; Configurable maxDeltaMassDstar{"maxDeltaMassDstar", static_cast(cutsMassCharmReso[0][0]), "maximum invariant-mass delta for D*+ in GeV/c2"}; Configurable maxDeltaMassDzeroFromDstar{"maxDeltaMassDzeroFromDstar", static_cast(cutsDeltaMassB[0][kNBeautyParticles]), "maximum invariant-mass delta for D0 in D*+ -> D0pi decay"}; + Configurable> pTBinsTrack{"pTBinsTrack", std::vector{hf_cuts_single_track::vecBinsPtTrack}, "track pT bin limits for DCAXY pT-dependent cut (D* from beauty)"}; + Configurable> cutsTrackBeauty3Prong{"cutsTrackBeauty3Prong", {hf_cuts_single_track::cutsTrack[0], hf_cuts_single_track::nBinsPtTrack, hf_cuts_single_track::nCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track selections per pT bin for 3-prong beauty candidates"}; // CCDB configuration o2::ccdb::CcdbApi ccdbApi; @@ -92,14 +94,14 @@ struct HfFilterCharmHadronSignals { // Main struct for HF triggers std::array, kNCharmParticles> thresholdBDTScores; ConfigurableAxis pvContributorsAxis{"pvContributorsAxis", {250, 0.f, 250.f}, "PV contributors"}; - ConfigurableAxis multiplicityAxis{"multiplicityAxis", {100, 0.f, 100.f}, "MultFT0M"}; + ConfigurableAxis multiplicityAxis{"multiplicityAxis", {100, 0.f, 1000.f}, "MultFT0M"}; ConfigurableAxis zVtxAxis{"zVtxAxis", {150, -15.f, 15.f}, "#it{z}_{vtx} (cm)"}; ConfigurableAxis invMassDmesAxis = {"invMassDmesAxis", {300, 1.65f, 2.25f}, "inv. mass (GeV/#it{c}^{2})"}; ConfigurableAxis invMassDstarAxis = {"invMassDstarAxis", {180, 0.f, 0.18f}, "inv. mass difference (GeV/#it{c}^{2})"}; ConfigurableAxis invMassCbaryonAxis = {"invMassCbaryonAxis", {300, 2.05f, 2.65f}, "inv. mass (GeV/#it{c}^{2})"}; ConfigurableAxis ptAxis = {"ptAxis", {100, 0.f, 50.f}, "#it{p}_{T} (GeV/#it{c})"}; ConfigurableAxis yAxis = {"yAxis", {10, -1.f, 1.f}, "#it{y}"}; - ConfigurableAxis phiAxis = {"phiAxis", {90, -constants::math::PI, constants::math::PI}, "#varphi (rad)"}; + ConfigurableAxis phiAxis = {"phiAxis", {90, 0., constants::math::TwoPI}, "#varphi (rad)"}; ConfigurableAxis bdtPromptAxis{"bdtPromptAxis", {100, 0.f, 1.f}, "BDT prompt"}; ConfigurableAxis bdtNonPromptAxis{"bdtNonPromptAxis", {100, 0.f, 1.f}, "BDT nonprompt"}; @@ -114,8 +116,8 @@ struct HfFilterCharmHadronSignals { // Main struct for HF triggers void init(InitContext&) { helper.setPtLimitsDstarSoftPion(minPtSoftPion, maxPtSoftPion); - helper.setPtBinsSingleTracks(std::vector{hf_cuts_single_track::vecBinsPtTrack}); - helper.setCutsSingleTrackBeauty(cutsSingleTrackDummy, cutsSingleTrackDummy); + helper.setPtBinsSingleTracks(pTBinsTrack); + helper.setCutsSingleTrackBeauty(cutsTrackBeauty3Prong, cutsTrackBeauty3Prong); helper.setDeltaMassCharmHadForBeauty(maxDeltaMassDzeroFromDstar); ccdb->setURL(url.value); @@ -239,7 +241,7 @@ struct HfFilterCharmHadronSignals { // Main struct for HF triggers LOG(fatal) << "Error running model inference for D0: Unexpected input data type."; } - if (!TESTBIT(tagBDT, RecoDecay::OriginType::Prompt) && !TESTBIT(tagBDT, RecoDecay::OriginType::NonPrompt)) { // if not tagged neither as prompt nor nonprompt, we skip + if (!TESTBIT(tagBDT, RecoDecay::OriginType::None)) { // if not signal, we skip continue; } } @@ -279,7 +281,7 @@ struct HfFilterCharmHadronSignals { // Main struct for HF triggers o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParThird, 2.f, noMatCorr, &dcaThird); getPxPyPz(trackParThird, pVecThird); } - auto isTrackSelected = helper.isSelectedTrackForSoftPionOrBeauty(track, trackParThird, dcaThird, 2); + auto isTrackSelected = helper.isSelectedTrackForSoftPionOrBeauty(track, trackParThird, dcaThird, kBeauty3P); if (TESTBIT(isTrackSelected, kSoftPion)) { std::array massDausD0{massPi, massKa}; auto invMassD0dau = invMassD0; @@ -358,6 +360,7 @@ struct HfFilterCharmHadronSignals { // Main struct for HF triggers } } + std::array isSignalTagged = is3Prong; std::array isCharmTagged = is3Prong; std::array isBeautyTagged = is3Prong; float scoresToFill[kNCharmParticles - 1][3]; @@ -365,6 +368,7 @@ struct HfFilterCharmHadronSignals { // Main struct for HF triggers std::fill_n(scoresToFill[i], 3, -1); } // initialize BDT scores array outside ML loop if (applyML) { + isSignalTagged = std::array{0}; isCharmTagged = std::array{0}; isBeautyTagged = std::array{0}; @@ -392,12 +396,13 @@ struct HfFilterCharmHadronSignals { // Main struct for HF triggers LOG(error) << "Error running model inference for " << charmParticleNames[iCharmPart + 1].data() << ": Unexpected input data type."; } + isSignalTagged[iCharmPart] = TESTBIT(tagBDT, RecoDecay::OriginType::None); isCharmTagged[iCharmPart] = TESTBIT(tagBDT, RecoDecay::OriginType::Prompt); isBeautyTagged[iCharmPart] = TESTBIT(tagBDT, RecoDecay::OriginType::NonPrompt); } } - if (!std::accumulate(isCharmTagged.begin(), isCharmTagged.end(), 0) && !std::accumulate(isBeautyTagged.begin(), isBeautyTagged.end(), 0)) { + if (!std::accumulate(isSignalTagged.begin(), isSignalTagged.end(), 0)) { continue; } diff --git a/EventFiltering/PWGHF/HFFilterHelpers.h b/EventFiltering/PWGHF/HFFilterHelpers.h index 9008235e2cd..623c5ffe8b5 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -1152,6 +1152,7 @@ inline int8_t HfFilterHelper::isBDTSelected(const T& scores, const U& thresholdB if (scores[0] > thresholdBDTScores.get(0u, 0u)) { return retValue; } + retValue |= BIT(RecoDecay::OriginType::None); // signal, but not yet tagged as prompt or nonprompt if (scores[1] > thresholdBDTScores.get(0u, 1u)) { retValue |= BIT(RecoDecay::OriginType::Prompt); } diff --git a/PWGCF/Femto3D/DataModel/singletrackselector.h b/PWGCF/Femto3D/DataModel/singletrackselector.h old mode 100644 new mode 100755 index 4a7f8b50251..91dfb63e856 --- a/PWGCF/Femto3D/DataModel/singletrackselector.h +++ b/PWGCF/Femto3D/DataModel/singletrackselector.h @@ -30,8 +30,9 @@ namespace o2::aod { namespace singletrackselector { + template -typename binningType::binned_t packInTable(const float& valueToBin) +inline typename binningType::binned_t packInTable(const float& valueToBin) { if (valueToBin <= binningType::binned_min) { return binningType::underflowBin; @@ -39,16 +40,13 @@ typename binningType::binned_t packInTable(const float& valueToBin) return binningType::overflowBin; } else { return static_cast(valueToBin / binningType::bin_width); - // return static_cast(((valueToBin - (binningType::binned_max - binningType::binned_min) * 0.5) / binningType::bin_width)); } } template -float unPack(const typename binningType::binned_t& b) +inline float unPack(const typename binningType::binned_t& b) { return static_cast(binningType::bin_width * b); - - // return static_cast((binningType::binned_max - binningType::binned_min) * 0.5 + binningType::bin_width * b); } namespace nsigma @@ -65,15 +63,17 @@ struct binning { }; } // namespace nsigma -DECLARE_SOA_COLUMN(Mult, mult, int); // Multiplicity of the collision -DECLARE_SOA_COLUMN(PosZ, posZ, float); // Vertex of the collision -DECLARE_SOA_COLUMN(MagField, magField, float); // Magnetic field corresponding to a collision (in T) +DECLARE_SOA_COLUMN(Mult, mult, int); // Multiplicity of the collision +DECLARE_SOA_COLUMN(MultPercentile, multPerc, float); // Percentiles of multiplicity of the collision +DECLARE_SOA_COLUMN(PosZ, posZ, float); // Vertex of the collision +DECLARE_SOA_COLUMN(MagField, magField, float); // Magnetic field corresponding to a collision (in T) } // namespace singletrackselector DECLARE_SOA_TABLE(SingleCollSels, "AOD", "SINGLECOLLSEL", // Table of the variables for single track selection. o2::soa::Index<>, singletrackselector::Mult, + singletrackselector::MultPercentile, singletrackselector::PosZ, singletrackselector::MagField); @@ -101,37 +101,40 @@ DECLARE_SOA_COLUMN(StoredTPCNSigmaPr, storedTpcNSigmaPr, nsigma::binning::binned DECLARE_SOA_COLUMN(StoredTOFNSigmaDe, storedTofNSigmaDe, nsigma::binning::binned_t); DECLARE_SOA_COLUMN(StoredTPCNSigmaDe, storedTpcNSigmaDe, nsigma::binning::binned_t); -DECLARE_SOA_DYNAMIC_COLUMN(Energy, energy, - [](float p, float mass) -> float { return sqrt(p * p + mass * mass); }); -DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, - [](float p, float eta) -> float { return p / std::cosh(eta); }); -DECLARE_SOA_DYNAMIC_COLUMN(Px, px, - [](float p, float eta, float phi) -> float { return (p / std::cosh(eta)) * std::sin(phi); }); -DECLARE_SOA_DYNAMIC_COLUMN(Py, py, - [](float p, float eta, float phi) -> float { return (p / std::cosh(eta)) * std::cos(phi); }); -DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, - [](float p, float eta) -> float { return p * std::tanh(eta); }); +DECLARE_SOA_DYNAMIC_COLUMN(Energy, energy, [](float p, float mass) -> float { return sqrt(p * p + mass * mass); }); +DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float p, float eta) -> float { return p / std::cosh(eta); }); +DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float p, float eta, float phi) -> float { return (p / std::cosh(eta)) * std::sin(phi); }); +DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float p, float eta, float phi) -> float { return (p / std::cosh(eta)) * std::cos(phi); }); +DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float p, float eta) -> float { return p * std::tanh(eta); }); DECLARE_SOA_DYNAMIC_COLUMN(PhiStar, phiStar, [](float p, float eta, float sign, float phi, float magfield = 0.0, float radius = 1.6) -> float { if (magfield == 0.0) { - return -1000.0f; + return -1000.0; } else { return phi + std::asin(-0.3 * magfield * sign * radius / (2.0 * p / std::cosh(eta))); } }); DECLARE_SOA_DYNAMIC_COLUMN(TOFNSigmaPr, tofNSigmaPr, - [](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack(nsigma_binned); }); + [](nsigma::binning::binned_t nsigma_binned) -> float { + return singletrackselector::unPack(nsigma_binned); + }); DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaPr, tpcNSigmaPr, - [](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack(nsigma_binned); }); + [](nsigma::binning::binned_t nsigma_binned) -> float { + return singletrackselector::unPack(nsigma_binned); + }); DECLARE_SOA_DYNAMIC_COLUMN(TOFNSigmaDe, tofNSigmaDe, - [](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack(nsigma_binned); }); + [](nsigma::binning::binned_t nsigma_binned) -> float { + return singletrackselector::unPack(nsigma_binned); + }); DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaDe, tpcNSigmaDe, - [](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack(nsigma_binned); }); + [](nsigma::binning::binned_t nsigma_binned) -> float { + return singletrackselector::unPack(nsigma_binned); + }); } // namespace singletrackselector -DECLARE_SOA_TABLE_FULL(SingleTrackSels, "SingleTrackSels", "AOD", "SINGLETRACKSEL", // Table of the variables for single track selection. +DECLARE_SOA_TABLE_FULL(SingleTrackSels, "SelTracks", "AOD", "SINGLETRACKSEL", // Table of the variables for single track selection. o2::soa::Index<>, singletrackselector::SingleCollSelId, singletrackselector::P, @@ -173,48 +176,53 @@ namespace o2::aod::singletrackselector template inline bool TPCselection(TrackType const& track, std::pair> const& PIDcuts) { - // add check for the size of the vector and order of the values??? must be 2 valies in order => [down, up] - float Nsigma = -1000; - if (PIDcuts.first == 2212) { - Nsigma = track.tpcNSigmaPr(); - } - if (PIDcuts.first == 1000010020) { - Nsigma = track.tpcNSigmaDe(); + switch (PIDcuts.first) { + case 2212: + Nsigma = track.tpcNSigmaPr(); + break; + case 1000010020: + Nsigma = track.tpcNSigmaDe(); + break; + default: + LOG(fatal) << "Cannot interpret PDG for TPC selection: " << PIDcuts.first; } if (Nsigma > PIDcuts.second[0] && Nsigma < PIDcuts.second[1]) { return true; - } else { - return false; } + return false; } template inline bool TOFselection(TrackType const& track, std::pair> const& PIDcuts) { - // add check for the size of the vector and order of the values??? must be 2 valies in order => [down, up] - float Nsigma = -1000; - if (PIDcuts.first == 2212) { - Nsigma = track.tofNSigmaPr(); - } else if (PIDcuts.first == 1000010020) { - Nsigma = track.tofNSigmaDe(); - } else if (PIDcuts.first == 211) { - if constexpr (std::experimental::is_detected::value) - Nsigma = track.tofNSigmaPi(); - } else if (PIDcuts.first == 321) { - if constexpr (std::experimental::is_detected::value) { - Nsigma = track.tofNSigmaKa(); - } + switch (PIDcuts.first) { + case 2212: + Nsigma = track.tofNSigmaPr(); + break; + case 1000010020: + Nsigma = track.tofNSigmaDe(); + break; + case 211: + if constexpr (std::experimental::is_detected::value) { + Nsigma = track.tofNSigmaPi(); + } + case 321: + if constexpr (std::experimental::is_detected::value) { + Nsigma = track.tofNSigmaKa(); + } + default: + LOG(fatal) << "Cannot interpret PDG for TOF selection: " << PIDcuts.first; } if (Nsigma > PIDcuts.second[0] && Nsigma < PIDcuts.second[1]) { return true; - } else { - return false; } + return false; } + } // namespace o2::aod::singletrackselector diff --git a/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx b/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx old mode 100644 new mode 100755 index 4f324909019..4ebc3723246 --- a/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx +++ b/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx @@ -26,7 +26,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/Centrality.h" #include "DetectorsBase/Propagator.h" #include "DataFormatsParameters/GRPObject.h" @@ -55,12 +55,18 @@ struct singleTrackSelector { Configurable> _particlesToReject{"particlesToRejectPDGs", std::vector{}, "PDG codes of perticles that will be rejected with TOF (only pion, kaon, proton and deurton are supported now)"}; Configurable> rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", std::vector{-5.0f, 5.0f}, "TOF rejection Nsigma range for particles specified with PDG to be rejected"}; + Configurable _tpcNClsFound{"tpcNClsFound", 70, "Minimun number of cluster found in TPC"}; + Configurable _itsNCls{"itsNCls", 0, "Minimun number of cluster found in ITS"}; + Configurable _tpcCrossedRowsOverFindableCls{"tpcCrossedRowsOverFindableCls", 0.f, "Minimun number of crossed rows over findable clusters"}; + Configurable _dcaXY{"dcaXY", 1000.f, "Maximum dca of track in xy"}; + Configurable _dcaZ{"dcaZ", 1000.f, "Maximum dca of track in xy"}; + using Trks = soa::Join; - using Coll = soa::Join; + using Coll = soa::Join; Produces tableRow; Produces tableRowColl; @@ -70,6 +76,9 @@ struct singleTrackSelector { ((applyEvSel.node() == 2) && (aod::evsel::sel8 == true)); Filter vertexFilter = ((o2::aod::collision::posZ < 15.f) && (o2::aod::collision::posZ > -15.f)); Filter trackFilter = ((o2::aod::track::itsChi2NCl <= 36.f) && (o2::aod::track::itsChi2NCl >= 0.f) && (o2::aod::track::tpcChi2NCl >= 0.f) && (o2::aod::track::tpcChi2NCl <= 4.f)); + Filter tpcFilter = ((o2::aod::singletrackselector::tpcNClsFound >= _tpcNClsFound) && (o2::aod::singletrackselector::tpcCrossedRowsOverFindableCls >= _tpcCrossedRowsOverFindableCls)); + Filter itsFilter = (o2::aod::singletrackselector::itsNCls >= _itsNCls); + Filter dcaFilter = (o2::aod::track::dcaXY <= _dcaXY) && (o2::aod::track::dcaZ <= _dcaZ); int mRunNumber = 0; float d_bz = 0.f; @@ -122,13 +131,13 @@ struct singleTrackSelector { { bool skip_track = false; // flag used for track rejection - tableRow.reserve(tracks.size()); auto bc = collision.bc_as(); initCCDB(bc); tableRowColl(collision.multTPC(), + collision.centFT0M(), collision.posZ(), d_bz); diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 7dea5b7ddda..d4cd080b9ee 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -288,10 +288,10 @@ struct femtoUniverseProducerTask { void init(InitContext&) { - if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData) == false && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth) == false) { + if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0) == false && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth) == false) { LOGF(fatal, "Neither processFullData nor processFullMC enabled. Please choose one."); } - if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData) == true && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth) == true) { + if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0) == true && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth) == true) { LOGF(fatal, "Cannot enable process Data and process MC at the same time. " "Please choose one."); @@ -874,15 +874,27 @@ struct femtoUniverseProducerTask { processFullData(aod::FemtoFullCollision const& col, aod::BCsWithTimestamps const&, aod::FemtoFullTracks const& tracks, - o2::aod::V0Datas const& fullV0s) /// \todo with FilteredFullV0s + o2::aod::V0Datas const& fullV0s) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables fillCollisionsAndTracksAndV0AndPhi(col, tracks, fullV0s); } - PROCESS_SWITCH(femtoUniverseProducerTask, processFullData, - "Provide experimental data", false); + PROCESS_SWITCH(femtoUniverseProducerTask, processFullData, "Provide experimental data", false); + + void + processTrackV0(aod::FemtoFullCollision const& col, + aod::BCsWithTimestamps const&, + soa::Filtered const& tracks, + o2::aod::V0Datas const& fullV0s) + { + // get magnetic field for run + getMagneticFieldTesla(col.bc_as()); + // fill the tables + fillCollisionsAndTracksAndV0AndPhi(col, tracks, fullV0s); + } + PROCESS_SWITCH(femtoUniverseProducerTask, processTrackV0, "Provide experimental data for track v0", true); void processFullMC(aod::FemtoFullCollisionMC const& col, @@ -890,7 +902,7 @@ struct femtoUniverseProducerTask { soa::Join const& tracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles, - soa::Join const& fullV0s) /// \todo with FilteredFullV0s + soa::Join const& fullV0s) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); @@ -917,7 +929,7 @@ struct femtoUniverseProducerTask { void processTrackData(aod::FemtoFullCollision const& col, aod::BCsWithTimestamps const&, - aod::FemtoFullTracks const& tracks) /// \todo with FilteredFullV0s + aod::FemtoFullTracks const& tracks) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); @@ -926,7 +938,7 @@ struct femtoUniverseProducerTask { fillTracks(tracks); } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackData, - "Provide experimental data for track track", true); + "Provide experimental data for track track", false); // using FilteredFemtoFullTracks = soa::Filtered; void processTrackPhiData(aod::FemtoFullCollision const& col, diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0.cxx index 7de3a9db2a8..edb0b5abb7c 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0.cxx @@ -13,6 +13,7 @@ /// \brief Tasks that reads the track tables used for the pairing and builds pairs of two tracks /// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de /// \author Zuzanna Chochulska, WUT Warsaw, zuzanna.chochulska.stud@pw.edu.pl +/// \author Shirajum Monira, WUT Warsaw, shirajum.monira.dokt@pw.edu.pl #include #include "Framework/AnalysisTask.h" @@ -21,7 +22,6 @@ #include "Framework/ASoAHelpers.h" #include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" - #include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h" @@ -35,59 +35,46 @@ using namespace o2::soa; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::analysis::femtoUniverse; - -namespace -{ -static constexpr int nTrack = 1; -static constexpr int nV0Children = 2; -static constexpr int nCuts = 5; -static const std::vector TrackName{"Track"}; -static const std::vector V0ChildrenName{"PosChild", "NegChild"}; -static const std::vector cutNames{"MaxPt", "PIDthr", "nSigmaTPC", "nSigmaTPCTOF", "MaxP"}; -static const float cutsTableTrack[nTrack][nCuts]{{4.05f, 0.75f, 3.f, 3.f, 100.f}}; -static const float cutsTableV0Children[nV0Children][nCuts]{ - {90.f, 99.f, 5.f, 5.f, 100.f}, - {90.f, 99.f, 5.f, 5.f, 100.f}}; -} // namespace +using namespace o2::aod::pidutils; struct femtoUniversePairTaskTrackV0 { + SliceCache cache; - Preslice perCol = aod::femtouniverseparticle::fdCollisionId; - - /// Particle 1 (track) - Configurable> ConfTrkCutTable{"ConfTrkCutTable", {cutsTableTrack[0], nTrack, nCuts, TrackName, cutNames}, "Particle selections"}; - Configurable ConfTrkPDGCodePartOne{"ConfTrkPDGCodePartOne", 2212, "Particle 1 (Track) - PDG code"}; - Configurable ConfTrkCutPartOne{"ConfTrkCutPartOne", 5542474, "Particle 1 (Track) - Selection bit from cutCulator"}; - Configurable ConfTrkPIDPartOne{"ConfTrkPIDPartOne", 2, "Particle 1 - Read from cutCulator"}; - Configurable ConfNspecies{"ConfNspecies", 2, "Number of particle spieces with PID info"}; - Configurable> ConfTrkPIDnSigmaMax{"ConfTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; + // using FemtoFullParticles = soa::Join; + using FemtoFullParticles = soa::Join; + Preslice perCol = aod::femtouniverseparticle::fdCollisionId; + + /// Particle 1 (from track) + Configurable ConfTrkPDGCodePartOne{"ConfTrkPDGCodePartOne", 211, "Particle 1 (Track) - PDG code"}; + Configurable ConfTrackChoicePartOne{"ConfTrackChoicePartOne", 1, "0:Proton, 1:Pion, 2:Kaon"}; ConfigurableAxis ConfTrkTempFitVarBins{"ConfTrkDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; ConfigurableAxis ConfTrkTempFitVarpTBins{"ConfTrkTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; + // Configurable ConfChargePart1{"ConfChargePart1", 1, "sign of particle 1"}; // not used + Configurable ConfHPtPart1{"ConfHPtPart1", 4.0f, "higher limit for pt of particle 1"}; + Configurable ConfLPtPart1{"ConfLPtPart1", 0.3f, "lower limit for pt of particle 1"}; + Configurable Confmom{"Confmom", 0.5, "momentum threshold for particle identification using TOF"}; + Configurable ConfNsigmaTPCParticle{"ConfNsigmaTPCParticle", 3.0, "TPC Sigma for particle momentum < Confmom"}; + Configurable ConfNsigmaCombinedParticle{"ConfNsigmaCombinedParticle", 3.0, "TPC and TOF Sigma (combined) for particle momentum > Confmom"}; /// Partition for particle 1 - Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && ((aod::femtouniverseparticle::cut & ConfTrkCutPartOne) == ConfTrkCutPartOne); + // Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == ConfChargePart1 && aod::femtouniverseparticle::pt < ConfHPtPart1 && aod::femtouniverseparticle::pt > ConfLPtPart1; + Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::pt < ConfHPtPart1 && aod::femtouniverseparticle::pt > ConfLPtPart1; /// Histogramming for particle 1 FemtoUniverseParticleHisto trackHistoPartOne; - /// Particle 2 (V0) - Configurable> ConfV0ChildrenCutTable{"ConfV0ChildrenCutTable", {cutsTableV0Children[0], nV0Children, nCuts, V0ChildrenName, cutNames}, "V0 Children selections"}; + /// Particle 2 (from V0) Configurable ConfV0PDGCodePartTwo{"ConfV0PDGCodePartTwo", 3122, "Particle 2 (V0) - PDG code"}; - Configurable ConfV0CutPartTwo{"ConfV0CutPartTwo", 338, "Particle 2 (V0) - Selection bit"}; ConfigurableAxis ConfV0TempFitVarBins{"ConfV0TempFitVarBins", {300, 0.95, 1.}, "V0: binning of the TempFitVar in the pT vs. TempFitVar plot"}; ConfigurableAxis ConfV0TempFitVarpTBins{"ConfV0TempFitVarpTBins", {20, 0.5, 4.05}, "V0: pT binning of the pT vs. TempFitVar plot"}; - - Configurable ConfCutChildPos{"ConfCutChildPos", 150, "Positive Child of V0 - Selection bit from cutCulator"}; - Configurable ConfCutChildNeg{"ConfCutChildNeg", 149, "Negative Child of V0 - Selection bit from cutCulator"}; - Configurable ConfChildPosIndex{"ConfChildPosIndex", 1, "Positive Child of V0 - Index from cutCulator"}; - Configurable ConfChildNegIndex{"ConfChildNegIndex", 0, "Negative Child of V0 - Index from cutCulator"}; - Configurable> ConfChildPIDnSigmaMax{"ConfChildPIDnSigmaMax", std::vector{4.f, 3.f}, "V0 child sel: Max. PID nSigma TPC"}; - Configurable ConfChildnSpecies{"ConfChildnSpecies", 2, "Number of particle spieces (for V0 children) with PID info"}; + // Configurable ConfChildnSpecies{"ConfChildnSpecies", 2, "Number of particle spieces (for V0 children) with PID info"}; // not used ConfigurableAxis ConfChildTempFitVarBins{"ConfChildTempFitVarBins", {300, -0.15, 0.15}, "V0 child: binning of the TempFitVar in the pT vs. TempFitVar plot"}; ConfigurableAxis ConfChildTempFitVarpTBins{"ConfChildTempFitVarpTBins", {20, 0.5, 4.05}, "V0 child: pT binning of the pT vs. TempFitVar plot"}; + Configurable ConfHPtPart2{"ConfHPtPart2", 4.0f, "higher limit for pt of particle 2"}; + Configurable ConfLPtPart2{"ConfLPtPart2", 0.3f, "lower limit for pt of particle 2"}; /// Partition for particle 2 - Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) && ((aod::femtouniverseparticle::cut & ConfV0CutPartTwo) == ConfV0CutPartTwo); + Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) && aod::femtouniverseparticle::pt < ConfHPtPart2 && aod::femtouniverseparticle::pt > ConfLPtPart2; /// Histogramming for particle 2 FemtoUniverseParticleHisto trackHistoPartTwo; @@ -97,10 +84,8 @@ struct femtoUniversePairTaskTrackV0 { /// Histogramming for Event FemtoUniverseEventHisto eventHisto; - int vPIDPartOne; - std::vector kNsigma; - /// Correlation part + // Configurable ConfTrackChoicePartTwo{"ConfTrackChoicePartTwo", 1, "0:Proton, 1:Pion, 2:Kaon"}; //not used Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; @@ -108,14 +93,13 @@ struct femtoUniversePairTaskTrackV0 { ConfigurableAxis ConfkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"}; ConfigurableAxis ConfkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; ConfigurableAxis ConfmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; - Configurable ConfNEventsMix{"ConfNEventsMix", 5, "Number of events for mixing"}; + // Configurable ConfNEventsMix{"ConfNEventsMix", 5, "Number of events for mixing"}; // not used Configurable ConfIsCPR{"ConfIsCPR", true, "Close Pair Rejection"}; Configurable ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"}; Configurable ConfCPRdeltaPhiMax{"ConfCPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"}; Configurable ConfCPRdeltaEtaMax{"ConfCPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"}; Configurable ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"}; Configurable ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"}; - ConfigurableAxis ConfmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; ConfigurableAxis ConfmultBins3D{"ConfMultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; @@ -127,29 +111,47 @@ struct femtoUniversePairTaskTrackV0 { HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject}; + bool IsParticleNSigma(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle) + { + if (mom < Confmom) { + if (TMath::Abs(nsigmaTPCParticle) < ConfNsigmaTPCParticle) { + return true; + } else { + return false; + } + } else { + if (TMath::Hypot(nsigmaTOFParticle, nsigmaTPCParticle) < ConfNsigmaCombinedParticle) { + return true; + } else { + return false; + } + } + } + void init(InitContext&) { eventHisto.init(&qaRegistry); + qaRegistry.add("Tracks_one/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {100, -5, 5}}); + qaRegistry.add("Tracks_one/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {100, -5, 5}}); trackHistoPartOne.init(&qaRegistry, ConfTrkTempFitVarpTBins, ConfTrkTempFitVarBins, ConfIsMC, ConfTrkPDGCodePartOne); trackHistoPartTwo.init(&qaRegistry, ConfV0TempFitVarpTBins, ConfV0TempFitVarBins, ConfIsMC, ConfV0PDGCodePartTwo); posChildHistos.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, false); negChildHistos.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, false); + // sameEventCont.setDeltaEta(-1.5, 1.5); sameEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, ConfIsMC, ConfUse3D); sameEventCont.setPDGCodes(ConfTrkPDGCodePartOne, ConfV0PDGCodePartTwo); + // mixedEventCont.setDeltaEta(-1.5, 1.5); mixedEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, ConfIsMC, ConfUse3D); mixedEventCont.setPDGCodes(ConfTrkPDGCodePartOne, ConfV0PDGCodePartTwo); + pairCleaner.init(&qaRegistry); if (ConfIsCPR.value) { pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiMax.value, ConfCPRdeltaEtaMax.value, ConfCPRPlotPerRadii.value); } - vPIDPartOne = ConfTrkPIDPartOne.value; - kNsigma = ConfTrkPIDnSigmaMax.value; } - /// This function processes the same event and takes care of all the histogramming - /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... - void processSameEvent(o2::aod::FDCollision& col, o2::aod::FDParticles& parts) + void processSameEvent(o2::aod::FDCollision& col, FemtoFullParticles& parts) { const auto& magFieldTesla = col.magField(); @@ -160,42 +162,32 @@ struct femtoUniversePairTaskTrackV0 { eventHisto.fillQA(col); /// Histogramming same event - for (auto& part : groupPartsOne) { - if (part.p() > ConfTrkCutTable->get("Track", "MaxP") || part.pt() > ConfTrkCutTable->get("Track", "MaxPt") || - !isFullPIDSelected(part.pidcut(), part.p(), ConfTrkCutTable->get("Track", "PIDthr"), vPIDPartOne, ConfNspecies, kNsigma, ConfTrkCutTable->get("Track", "nSigmaTPC"), ConfTrkCutTable->get("Track", "nSigmaTPCTOF"))) { - continue; - } - trackHistoPartOne.fillQA(part); - } - for (auto& part : groupPartsTwo) { const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); - // check cuts on V0 children - if (!((posChild.cut() & ConfCutChildPos) == ConfCutChildPos) || !((negChild.cut() & ConfCutChildNeg) == ConfCutChildNeg) || - !isFullPIDSelected(posChild.pidcut(), posChild.p(), ConfV0ChildrenCutTable->get("PosChild", "PIDthr"), ConfChildPosIndex.value, ConfChildnSpecies.value, ConfChildPIDnSigmaMax.value, ConfV0ChildrenCutTable->get("PosChild", "nSigmaTPC"), ConfV0ChildrenCutTable->get("PosChild", "nSigmaTPCTOF")) || - !isFullPIDSelected(negChild.pidcut(), negChild.p(), ConfV0ChildrenCutTable->get("PosChild", "PIDthr"), ConfChildNegIndex.value, ConfChildnSpecies.value, ConfChildPIDnSigmaMax.value, ConfV0ChildrenCutTable->get("NegChild", "nSigmaTPC"), ConfV0ChildrenCutTable->get("NegChild", "nSigmaTPCTOF"))) { - continue; - } + // printf("-- V0 d- %d d+ %d\n",negChild.globalIndex(),posChild.globalIndex()); + trackHistoPartTwo.fillQA(part); posChildHistos.fillQA(posChild); negChildHistos.fillQA(negChild); } - /// Now build the combinations - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (p1.p() > ConfTrkCutTable->get("Track", "MaxP") || p1.pt() > ConfTrkCutTable->get("Track", "MaxPt") || - !isFullPIDSelected(p1.pidcut(), p1.p(), ConfTrkCutTable->get("Track", "PIDthr"), vPIDPartOne, ConfNspecies, kNsigma, ConfTrkCutTable->get("Track", "nSigmaTPC"), ConfTrkCutTable->get("Track", "nSigmaTPCTOF"))) { - continue; - } - const auto& posChild = parts.iteratorAt(p2.index() - 2); - const auto& negChild = parts.iteratorAt(p2.index() - 1); - // check cuts on V0 children - if (!((posChild.cut() & ConfCutChildPos) == ConfCutChildPos) || !((negChild.cut() & ConfCutChildNeg) == ConfCutChildNeg) || - !isFullPIDSelected(posChild.pidcut(), posChild.p(), ConfV0ChildrenCutTable->get("PosChild", "PIDthr"), ConfChildPosIndex.value, ConfChildnSpecies.value, ConfChildPIDnSigmaMax.value, ConfV0ChildrenCutTable->get("PosChild", "nSigmaTPC"), ConfV0ChildrenCutTable->get("PosChild", "nSigmaTPCTOF")) || - !isFullPIDSelected(negChild.pidcut(), negChild.p(), ConfV0ChildrenCutTable->get("PosChild", "PIDthr"), ConfChildNegIndex.value, ConfChildnSpecies.value, ConfChildPIDnSigmaMax.value, ConfV0ChildrenCutTable->get("NegChild", "nSigmaTPC"), ConfV0ChildrenCutTable->get("NegChild", "nSigmaTPCTOF"))) { + for (auto& part : groupPartsOne) { + /// PID using stored binned nsigma + const float tpcNSigmas[3] = {unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tpcNSigmaStoreKa())}; + const float tofNSigmas[3] = {unPackInTable(part.tofNSigmaStorePr()), unPackInTable(part.tofNSigmaStorePi()), unPackInTable(part.tofNSigmaStoreKa())}; + + if (!IsParticleNSigma(part.pt(), tpcNSigmas[ConfTrackChoicePartOne], tofNSigmas[ConfTrackChoicePartOne])) { continue; } + qaRegistry.fill(HIST("Tracks_one/nSigmaTPC"), part.p(), tpcNSigmas[ConfTrackChoicePartOne]); + qaRegistry.fill(HIST("Tracks_one/nSigmaTOF"), part.p(), tofNSigmas[ConfTrackChoicePartOne]); + + trackHistoPartOne.fillQA(part); + } + + /// Now build the combinations + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { if (ConfIsCPR.value) { if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla)) { continue; @@ -205,6 +197,13 @@ struct femtoUniversePairTaskTrackV0 { if (!pairCleaner.isCleanPair(p1, p2, parts)) { continue; } + /// PID using stored binned nsigma + const float tpcNSigmas[3] = {unPackInTable(p1.tpcNSigmaStorePr()), unPackInTable(p1.tpcNSigmaStorePi()), unPackInTable(p1.tpcNSigmaStoreKa())}; + const float tofNSigmas[3] = {unPackInTable(p1.tofNSigmaStorePr()), unPackInTable(p1.tofNSigmaStorePi()), unPackInTable(p1.tofNSigmaStoreKa())}; + + if (!IsParticleNSigma(p1.pt(), tpcNSigmas[ConfTrackChoicePartOne], tofNSigmas[ConfTrackChoicePartOne])) { + continue; + } sameEventCont.setPair(p1, p2, multCol, ConfUse3D); } } @@ -212,8 +211,7 @@ struct femtoUniversePairTaskTrackV0 { PROCESS_SWITCH(femtoUniversePairTaskTrackV0, processSameEvent, "Enable processing same event", true); /// This function processes the mixed event - /// \todo the trivial loops over the collisions and tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... - void processMixedEvent(o2::aod::FDCollisions& cols, o2::aod::FDParticles& parts) + void processMixedEvent(o2::aod::FDCollisions& cols, FemtoFullParticles& parts) { ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; @@ -232,18 +230,6 @@ struct femtoUniversePairTaskTrackV0 { } for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (p1.p() > ConfTrkCutTable->get("Track", "MaxP") || p1.pt() > ConfTrkCutTable->get("Track", "MaxPt") || - !isFullPIDSelected(p1.pidcut(), p1.p(), ConfTrkCutTable->get("Track", "PIDthr"), vPIDPartOne, ConfNspecies, kNsigma, ConfTrkCutTable->get("Track", "nSigmaTPC"), ConfTrkCutTable->get("Track", "nSigmaTPCTOF"))) { - continue; - } - const auto& posChild = parts.iteratorAt(p2.index() - 2); - const auto& negChild = parts.iteratorAt(p2.index() - 1); - // check cuts on V0 children - if (!((posChild.cut() & ConfCutChildPos) == ConfCutChildPos) || !((negChild.cut() & ConfCutChildNeg) == ConfCutChildNeg) || - !isFullPIDSelected(posChild.pidcut(), posChild.p(), ConfV0ChildrenCutTable->get("PosChild", "PIDthr"), ConfChildPosIndex.value, ConfChildnSpecies.value, ConfChildPIDnSigmaMax.value, ConfV0ChildrenCutTable->get("PosChild", "nSigmaTPC"), ConfV0ChildrenCutTable->get("PosChild", "nSigmaTPCTOF")) || - !isFullPIDSelected(negChild.pidcut(), negChild.p(), ConfV0ChildrenCutTable->get("PosChild", "PIDthr"), ConfChildNegIndex.value, ConfChildnSpecies.value, ConfChildPIDnSigmaMax.value, ConfV0ChildrenCutTable->get("NegChild", "nSigmaTPC"), ConfV0ChildrenCutTable->get("NegChild", "nSigmaTPCTOF"))) { - continue; - } if (ConfIsCPR.value) { if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla1)) { continue; @@ -253,6 +239,13 @@ struct femtoUniversePairTaskTrackV0 { if (!pairCleaner.isCleanPair(p1, p2, parts)) { continue; } + /// PID using stored binned nsigma + const float tpcNSigmas[3] = {unPackInTable(p1.tpcNSigmaStorePr()), unPackInTable(p1.tpcNSigmaStorePi()), unPackInTable(p1.tpcNSigmaStoreKa())}; + const float tofNSigmas[3] = {unPackInTable(p1.tofNSigmaStorePr()), unPackInTable(p1.tofNSigmaStorePi()), unPackInTable(p1.tofNSigmaStoreKa())}; + + if (!IsParticleNSigma(p1.pt(), tpcNSigmas[ConfTrackChoicePartOne], tofNSigmas[ConfTrackChoicePartOne])) { + continue; + } mixedEventCont.setPair(p1, p2, multCol, ConfUse3D); } } diff --git a/PWGCF/Flow/Tasks/CMakeLists.txt b/PWGCF/Flow/Tasks/CMakeLists.txt index 997f5024e29..b6e1291b1f2 100644 --- a/PWGCF/Flow/Tasks/CMakeLists.txt +++ b/PWGCF/Flow/Tasks/CMakeLists.txt @@ -13,3 +13,9 @@ o2physics_add_dpl_workflow(flow-pt-efficiency SOURCES flowPtEfficiency.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(flow-pbpb-task + SOURCES FlowPbPbTask.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore + COMPONENT_NAME Analysis) + diff --git a/PWGCF/Flow/Tasks/FlowPbPbTask.cxx b/PWGCF/Flow/Tasks/FlowPbPbTask.cxx new file mode 100644 index 00000000000..e5114c20774 --- /dev/null +++ b/PWGCF/Flow/Tasks/FlowPbPbTask.cxx @@ -0,0 +1,381 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include +#include +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/HistogramRegistry.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/Centrality.h" + +#include "GFWPowerArray.h" +#include "GFW.h" +#include "GFWCumulant.h" +#include "FlowContainer.h" +#include "TList.h" +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; + +struct FlowPbPbTask { + + O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 10.0f, "Accepted z-vertex range") + O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMin, float, 0.2f, "Minimal pT for poi tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMax, float, 10.0f, "Maximal pT for poi tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtMin, float, 0.2f, "Minimal pT for ref tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtMax, float, 3.0f, "Maximal pT for ref tracks") + O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks") + O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5, "Chi2 per TPC clusters") + O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Use Nch for flow observables") + O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") + + ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for histograms"}; + ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; + ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; + ConfigurableAxis axisPtHist{"axisPtHist", {100, 0., 10.}, "pt axis for histograms"}; + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.30, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00}, "pt axis for histograms"}; + ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; + + Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); + + // Connect to ccdb + Service ccdb; + Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable url{"ccdb-url", "http://ccdb-test.cern.ch:8080", "url of the ccdb repository"}; + + // Define output + OutputObj fFC{FlowContainer("FlowContainer")}; + HistogramRegistry registry{"registry"}; + + // define global variables + GFW* fGFW = new GFW(); + std::vector corrconfigs; + TAxis* fPtAxis; + TRandom3* fRndm = new TRandom3(0); + std::vector>> BootstrapArray; + + using aodCollisions = soa::Filtered>; + using aodTracks = soa::Filtered>; + + void init(InitContext const&) + { + ccdb->setURL(url.value); + ccdb->setCaching(true); + ccdb->setCreatedNotAfter(nolaterthan.value); + + // Add some output objects to the histogram registry + registry.add("hPhi", "", {HistType::kTH1D, {axisPhi}}); + registry.add("hEta", "", {HistType::kTH1D, {axisEta}}); + registry.add("hPt", "", {HistType::kTH1D, {axisPtHist}}); + registry.add("hVtxZ", "", {HistType::kTH1D, {axisVertex}}); + registry.add("hMult", "", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); + registry.add("hCent", "", {HistType::kTH1D, {{90, 0, 90}}}); + registry.add("hMeanPt", "", {HistType::kTProfile, {axisMultiplicity}}); + registry.add("hMeanPtWithinGap08", "", {HistType::kTProfile, {axisMultiplicity}}); + registry.add("c22_gap08_Weff", "", {HistType::kTProfile, {axisMultiplicity}}); + registry.add("c22_gap08_trackMeanPt", "", {HistType::kTProfile, {axisMultiplicity}}); + registry.add("PtVariance_partA_WithinGap08", "", {HistType::kTProfile, {axisMultiplicity}}); + registry.add("PtVariance_partB_WithinGap08", "", {HistType::kTProfile, {axisMultiplicity}}); + + // initial array + BootstrapArray.resize(cfgNbootstrap); + for (int i = 0; i < cfgNbootstrap; i++) { + // currently we have 5 TProfiles in each sub dir + BootstrapArray[i].resize(5); + } + for (int i = 0; i < cfgNbootstrap; i++) { + BootstrapArray[i][0] = std::get>(registry.add(Form("BootstrapContainer_%d/hMeanPtWithinGap08", i), "", {HistType::kTProfile, {axisMultiplicity}})); + BootstrapArray[i][1] = std::get>(registry.add(Form("BootstrapContainer_%d/c22_gap08_Weff", i), "", {HistType::kTProfile, {axisMultiplicity}})); + BootstrapArray[i][2] = std::get>(registry.add(Form("BootstrapContainer_%d/c22_gap08_trackMeanPt", i), "", {HistType::kTProfile, {axisMultiplicity}})); + BootstrapArray[i][3] = std::get>(registry.add(Form("BootstrapContainer_%d/PtVariance_partA_WithinGap08", i), "", {HistType::kTProfile, {axisMultiplicity}})); + BootstrapArray[i][4] = std::get>(registry.add(Form("BootstrapContainer_%d/PtVariance_partB_WithinGap08", i), "", {HistType::kTProfile, {axisMultiplicity}})); + } + + o2::framework::AxisSpec axis = axisPt; + int nPtBins = axis.binEdges.size() - 1; + double* PtBins = &(axis.binEdges)[0]; + fPtAxis = new TAxis(nPtBins, PtBins); + + // add in FlowContainer to Get boostrap sample automatically + TObjArray* oba = new TObjArray(); + oba->Add(new TNamed("ChGap22", "ChGap22")); + for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + oba->Add(new TNamed(Form("ChGap22_pt_%i", i + 1), "ChGap22_pTDiff")); + oba->Add(new TNamed("ChFull22", "ChFull22")); + oba->Add(new TNamed("ChFull32", "ChFull32")); + oba->Add(new TNamed("ChFull42", "ChFull42")); + oba->Add(new TNamed("ChFull24", "ChFull24")); + oba->Add(new TNamed("ChFull26", "ChFull26")); + oba->Add(new TNamed("Ch04Gap22", "Ch04Gap22")); + oba->Add(new TNamed("Ch06Gap22", "Ch06Gap22")); + oba->Add(new TNamed("Ch08Gap22", "Ch08Gap22")); + oba->Add(new TNamed("Ch10Gap22", "Ch10Gap22")); + oba->Add(new TNamed("Ch04Gap32", "Ch04Gap32")); + oba->Add(new TNamed("Ch06Gap32", "Ch06Gap32")); + oba->Add(new TNamed("Ch08Gap32", "Ch08Gap32")); + oba->Add(new TNamed("Ch10Gap32", "Ch10Gap32")); + oba->Add(new TNamed("Ch04Gap42", "Ch04Gap42")); + oba->Add(new TNamed("Ch06Gap42", "Ch06Gap42")); + oba->Add(new TNamed("Ch08Gap42", "Ch08Gap42")); + oba->Add(new TNamed("Ch10Gap42", "Ch10Gap42")); + oba->Add(new TNamed("ChFull422", "ChFull422")); + oba->Add(new TNamed("Ch04GapA422", "Ch04GapA422")); + oba->Add(new TNamed("Ch04GapB422", "Ch04GapB422")); + oba->Add(new TNamed("Ch10GapA422", "Ch10GapA422")); + oba->Add(new TNamed("Ch10GapB422", "Ch10GapB422")); + oba->Add(new TNamed("ChFull3232", "ChFull3232")); + oba->Add(new TNamed("ChFull4242", "ChFull4242")); + oba->Add(new TNamed("Ch04Gap3232", "Ch04Gap3232")); + oba->Add(new TNamed("Ch04Gap4242", "Ch04Gap4242")); + oba->Add(new TNamed("Ch04Gap24", "Ch04Gap24")); + oba->Add(new TNamed("Ch10Gap3232", "Ch10Gap3232")); + oba->Add(new TNamed("Ch10Gap4242", "Ch10Gap4242")); + oba->Add(new TNamed("Ch10Gap24", "Ch10Gap24")); + fFC->SetName("FlowContainer"); + fFC->SetXAxis(fPtAxis); + fFC->Initialize(oba, axisMultiplicity, cfgNbootstrap); + delete oba; + + // eta region + fGFW->AddRegion("full", -0.8, 0.8, 1, 1); + fGFW->AddRegion("refN04", -0.8, -0.2, 1, 1); // gap4 negative region + fGFW->AddRegion("refP04", 0.2, 0.8, 1, 1); // gap4 positve region + fGFW->AddRegion("refN06", -0.8, -0.3, 1, 1); // gap6 negative region + fGFW->AddRegion("refP06", 0.3, 0.8, 1, 1); // gap6 positve region + fGFW->AddRegion("refN08", -0.8, -0.4, 1, 1); + fGFW->AddRegion("refP08", 0.4, 0.8, 1, 1); + fGFW->AddRegion("refN10", -0.8, -0.5, 1, 1); + fGFW->AddRegion("refP10", 0.5, 0.8, 1, 1); + fGFW->AddRegion("refP", 0.4, 0.8, 1, 1); + fGFW->AddRegion("refN", -0.8, -0.4, 1, 1); + fGFW->AddRegion("poiN", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 2); + fGFW->AddRegion("olN", -0.8, -0.4, 1, 4); + + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {3 -3}", "ChFull32", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {4 -4}", "ChFull42", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {2 2 -2 -2}", "ChFull24", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {2 2 2 -2 -2 -2}", "ChFull26", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN04 {2} refP04 {-2}", "Ch04Gap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN06 {2} refP06 {-2}", "Ch06Gap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "Ch08Gap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {2} refP10 {-2}", "Ch10Gap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN04 {3} refP04 {-3}", "Ch04Gap32", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN06 {3} refP06 {-3}", "Ch06Gap32", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {3} refP08 {-3}", "Ch08Gap32", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {3} refP10 {-3}", "Ch10Gap32", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN04 {4} refP04 {-4}", "Ch04Gap42", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN06 {4} refP06 {-4}", "Ch06Gap42", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {4} refP08 {-4}", "Ch08Gap42", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {4} refP10 {-4}", "Ch10Gap42", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN {2} refP {-2}", "ChGap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiN refN | olN {2} refP {-2}", "ChGap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {4 -2 -2}", "ChFull422", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN04 {-2 -2} refP04 {4}", "Ch04GapA422", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN04 {4} refP04 {-2 -2}", "Ch04GapB422", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {-2 -2} refP10 {4}", "Ch10GapA422", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {4} refP10 {-2 -2}", "Ch10GapB422", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {3 2 -3 -2}", "ChFull3232", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {4 2 -4 -2}", "ChFull4242", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN04 {3 2} refP04 {-3 -2}", "Ch04Gap3232", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN04 {4 2} refP04 {-4 -2}", "Ch04Gap4242", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN04 {2 2} refP04 {-2 -2}", "Ch04Gap24", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {3 2} refP10 {-3 -2}", "Ch10Gap3232", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {4 2} refP10 {-4 -2}", "Ch10Gap4242", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {2 2} refP10 {-2 -2}", "Ch10Gap24", kFALSE)); + fGFW->CreateRegions(); + } + + template + void FillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + { + double dnx, val; + dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) + return; + if (!corrconf.pTDif) { + val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) + registry.fill(tarName, cent, val, dnx); + return; + } + return; + } + + template + void FillpTvnProfile(const GFW::CorrConfig& corrconf, const double& sum_pt, const double& WeffEvent, const ConstStr& vnWeff, const ConstStr& vnpT, const double& cent) + { + double meanPt = sum_pt / WeffEvent; + double dnx, val; + dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) + return; + if (!corrconf.pTDif) { + val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) { + registry.fill(vnWeff, cent, val, dnx * WeffEvent); + registry.fill(vnpT, cent, val * meanPt, dnx * WeffEvent); + } + return; + } + return; + } + + void FillpTvnProfile(const GFW::CorrConfig& corrconf, const double& sum_pt, const double& WeffEvent, std::shared_ptr vnWeff, std::shared_ptr vnpT, const double& cent) + { + double meanPt = sum_pt / WeffEvent; + double dnx, val; + dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) + return; + if (!corrconf.pTDif) { + val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) { + vnWeff->Fill(cent, val, dnx * WeffEvent); + vnpT->Fill(cent, val * meanPt, dnx * WeffEvent); + } + return; + } + return; + } + + void FillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) + { + double dnx, val; + dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) + return; + if (!corrconf.pTDif) { + val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) + fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm); + return; + } + for (Int_t i = 1; i <= fPtAxis->GetNbins(); i++) { + dnx = fGFW->Calculate(corrconf, i - 1, kTRUE).real(); + if (dnx == 0) + continue; + val = fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) + fFC->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm); + } + return; + } + + void process(aodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks) + { + int Ntot = tracks.size(); + if (Ntot < 1) + return; + float l_Random = fRndm->Rndm(); + float vtxz = collision.posZ(); + registry.fill(HIST("hVtxZ"), vtxz); + registry.fill(HIST("hMult"), Ntot); + registry.fill(HIST("hCent"), collision.centFT0C()); + fGFW->Clear(); + const auto cent = collision.centFT0C(); + float weff = 1, wacc = 1; + double weffEvent = 0, waccEvent = 0; + int TrackNum = 0; + double ptSum = 0., ptSum_Gap08 = 0.; + double weffEvent_WithinGap08 = 0., weffEventSquare_WithinGap08 = 0.; + double sum_ptSquare_wSquare_WithinGap08 = 0., sum_pt_wSquare_WithinGap08 = 0.; + + for (auto& track : tracks) { + double pt = track.pt(); + double eta = track.eta(); + bool WithinPtPOI = (cfgCutPtPOIMin < pt) && (pt < cfgCutPtPOIMax); // within POI pT range + bool WithinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax); // within RF pT range + bool WithinEtaGap08 = (eta >= -0.4) && (eta <= 0.4); + if (WithinPtRef) { + registry.fill(HIST("hPhi"), track.phi()); + registry.fill(HIST("hEta"), track.eta()); + registry.fill(HIST("hPt"), pt); + weffEvent += weff; + waccEvent += wacc; + ptSum += weff * pt; + TrackNum++; + if (WithinEtaGap08) { + ptSum_Gap08 += weff * pt; + sum_pt_wSquare_WithinGap08 += weff * weff * pt; + sum_ptSquare_wSquare_WithinGap08 += weff * weff * pt * pt; + weffEvent_WithinGap08 += weff; + weffEventSquare_WithinGap08 += weff * weff; + } + } + if (WithinPtRef) + fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 1); + if (WithinPtPOI) + fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 2); + if (WithinPtPOI && WithinPtRef) + fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 4); + } + + double WeffEvent_diff_WithGap08 = weffEvent_WithinGap08 * weffEvent_WithinGap08 - weffEventSquare_WithinGap08; + // Filling TProfile + // MeanPt + registry.fill(HIST("hMeanPt"), cent, ptSum / weffEvent, weffEvent); + if (weffEvent_WithinGap08 > 1e-6) + registry.fill(HIST("hMeanPtWithinGap08"), cent, ptSum_Gap08 / weffEvent_WithinGap08, weffEvent_WithinGap08); + // v22-Pt + // c22_gap8 * pt_withGap8 + if (weffEvent_WithinGap08 > 1e-6) + FillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEvent_WithinGap08, HIST("c22_gap08_Weff"), HIST("c22_gap08_trackMeanPt"), cent); + // PtVariance + if (WeffEvent_diff_WithGap08 > 1e-6) { + registry.fill(HIST("PtVariance_partA_WithinGap08"), cent, + (ptSum_Gap08 * ptSum_Gap08 - sum_ptSquare_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, + WeffEvent_diff_WithGap08); + registry.fill(HIST("PtVariance_partB_WithinGap08"), cent, + (weffEvent_WithinGap08 * ptSum_Gap08 - sum_pt_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, + WeffEvent_diff_WithGap08); + } + + // Filling Bootstrap Samples + int SampleIndex = static_cast(cfgNbootstrap * l_Random); + if (weffEvent_WithinGap08 > 1e-6) + BootstrapArray[SampleIndex][0]->Fill(cent, ptSum_Gap08 / weffEvent_WithinGap08, weffEvent_WithinGap08); + if (weffEvent_WithinGap08 > 1e-6) + FillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEvent_WithinGap08, BootstrapArray[SampleIndex][1], BootstrapArray[SampleIndex][2], cent); + if (WeffEvent_diff_WithGap08 > 1e-6) { + BootstrapArray[SampleIndex][3]->Fill(cent, + (ptSum_Gap08 * ptSum_Gap08 - sum_ptSquare_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, + WeffEvent_diff_WithGap08); + BootstrapArray[SampleIndex][4]->Fill(cent, + (weffEvent_WithinGap08 * ptSum_Gap08 - sum_pt_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, + WeffEvent_diff_WithGap08); + } + + // Filling Flow Container + for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) { + FillFC(corrconfigs.at(l_ind), cent, l_Random); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 44191404d17..3a32a1127f7 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -2140,6 +2140,36 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } + if (!nameStr.compare("paird_prefilter1")) { + cut->AddCut(GetAnalysisCut("paird_prefilter1")); + return cut; + } + + if (!nameStr.compare("paire_prefilter1")) { + cut->AddCut(GetAnalysisCut("paire_prefilter1")); + return cut; + } + + if (!nameStr.compare("pairf_prefilter1")) { + cut->AddCut(GetAnalysisCut("pairf_prefilter1")); + return cut; + } + + if (!nameStr.compare("pairg_prefilter1")) { + cut->AddCut(GetAnalysisCut("pairg_prefilter1")); + return cut; + } + + if (!nameStr.compare("pairh_prefilter1")) { + cut->AddCut(GetAnalysisCut("pairh_prefilter1")); + return cut; + } + + if (!nameStr.compare("pairi_prefilter1")) { + cut->AddCut(GetAnalysisCut("pairi_prefilter1")); + return cut; + } + if (!nameStr.compare("pairJpsi")) { cut->AddCut(GetAnalysisCut("pairJpsi")); return cut; @@ -3942,6 +3972,36 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("paird_prefilter1")) { + cut->AddCut(VarManager::kOpeningAngle, 0.0, 0.025); + return cut; + } + + if (!nameStr.compare("paire_prefilter1")) { + cut->AddCut(VarManager::kOpeningAngle, 0.0, 0.05); + return cut; + } + + if (!nameStr.compare("pairf_prefilter1")) { + cut->AddCut(VarManager::kOpeningAngle, 0.0, 0.075); + return cut; + } + + if (!nameStr.compare("pairg_prefilter1")) { + cut->AddCut(VarManager::kOpeningAngle, 0.0, 0.1); + return cut; + } + + if (!nameStr.compare("pairh_prefilter1")) { + cut->AddCut(VarManager::kOpeningAngle, 0.0, 0.125); + return cut; + } + + if (!nameStr.compare("pairi_prefilter1")) { + cut->AddCut(VarManager::kOpeningAngle, 0.0, 0.15); + return cut; + } + if (!nameStr.compare("pairNoCut")) { cut->AddCut(VarManager::kMass, 0.0, 1000.0); return cut; diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index a9cda0e7d05..8183ace5dd9 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -93,6 +93,16 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "MultTPC_MultFT0C", "MultTPC vs MultFT0C", false, 400, 0, 800.0, VarManager::kMultTPC, 100, 0, 1000.0, VarManager::kMultFT0C); hm->AddHistogram(histClass, "MultFT0A_MultFT0C", "MultFT0A vs MultFT0C", false, 100, 0, 1000.0, VarManager::kMultFT0A, 100, 0, 1000.0, VarManager::kMultFT0C); } + if (subGroupStr.Contains("ftmulpbpb")) { + hm->AddHistogram(histClass, "MultTPC", "MultTPC", false, 100, 0.0, 50000.0, VarManager::kMultTPC); + hm->AddHistogram(histClass, "MultFT0C", "MultFT0C", false, 100, 0.0, 60000.0, VarManager::kMultFT0C); + hm->AddHistogram(histClass, "MultFT0A", "MultFT0A", false, 100, 0.0, 180000.0, VarManager::kMultFT0A); + hm->AddHistogram(histClass, "VtxNContribReal", "Vtx n contributors", false, 100, 0.0, 10000.0, VarManager::kVtxNcontribReal); + hm->AddHistogram(histClass, "VtxNContrib", "Vtx n contributors", false, 100, 0.0, 10000.0, VarManager::kVtxNcontrib); + hm->AddHistogram(histClass, "MultTPC_VtxNContrib", "MultTPC vs VtxNContrib", false, 100, 0, 50000.0, VarManager::kMultTPC, 100, 0, 10000.0, VarManager::kVtxNcontrib); + hm->AddHistogram(histClass, "MultFT0C_VtxNContrib", "MultFT0C vs VtxNContrib", false, 100, 0, 60000.0, VarManager::kMultFT0C, 100, 0, 10000.0, VarManager::kVtxNcontrib); + hm->AddHistogram(histClass, "MultFT0A_VtxNContrib", "MultFT0A vs VtxNContrib", false, 100, 0, 180000.0, VarManager::kMultFT0A, 100, 0, 10000.0, VarManager::kVtxNcontrib); + } if (subGroupStr.Contains("mc")) { hm->AddHistogram(histClass, "MCVtxX_VtxX", "Vtx X (MC vs rec)", false, 100, -0.5, 0.5, VarManager::kVtxX, 100, -0.5, 0.5, VarManager::kMCVtxX); hm->AddHistogram(histClass, "MCVtxY_VtxY", "Vtx Y (MC vs rec)", false, 100, -0.5, 0.5, VarManager::kVtxY, 100, -0.5, 0.5, VarManager::kMCVtxY); diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 1f9005519f8..9d4fc0e4f04 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -106,7 +106,8 @@ class VarManager : public TObject DalitzBits = BIT(21), TrackTPCPID = BIT(22), TrackMFT = BIT(23), - ReducedTrackCollInfo = BIT(24) // TODO: remove it once new reduced data tables are produced for dielectron with ReducedTracksBarrelInfo + ReducedTrackCollInfo = BIT(24), // TODO: remove it once new reduced data tables are produced for dielectron with ReducedTracksBarrelInfo + ReducedMuonCollInfo = BIT(25) // TODO: remove it once new reduced data tables are produced for dielectron with ReducedTracksBarrelInfo }; enum PairCandidateType { diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index bca09220b93..c939c1ac66f 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -101,10 +101,11 @@ using MyBarrelTracksSelectedWithPrefilter = soa::Join; using MyBarrelTracksSelectedWithColl = soa::Join; using MyPairCandidatesSelected = soa::Join; -using MyMuonTracks = soa::Join; -using MyMuonTracksSelected = soa::Join; -using MyMuonTracksWithCov = soa::Join; -using MyMuonTracksSelectedWithCov = soa::Join; +using MyMuonTracks = soa::Join; +using MyMuonTracksSelected = soa::Join; +using MyMuonTracksWithCov = soa::Join; +using MyMuonTracksSelectedWithCov = soa::Join; +using MyMuonTracksSelectedWithColl = soa::Join; // bit maps used for the Fill functions of the VarManager constexpr static uint32_t gkEventFillMap = VarManager::ObjTypes::ReducedEvent | VarManager::ObjTypes::ReducedEventExtended; @@ -117,6 +118,7 @@ constexpr static uint32_t gkTrackFillMapWithColl = VarManager::ObjTypes::Reduced constexpr static uint32_t gkMuonFillMap = VarManager::ObjTypes::ReducedMuon | VarManager::ObjTypes::ReducedMuonExtra; constexpr static uint32_t gkMuonFillMapWithCov = VarManager::ObjTypes::ReducedMuon | VarManager::ObjTypes::ReducedMuonExtra | VarManager::ObjTypes::ReducedMuonCov; +constexpr static uint32_t gkMuonFillMapWithColl = VarManager::ObjTypes::ReducedMuon | VarManager::ObjTypes::ReducedMuonExtra | VarManager::ObjTypes::ReducedMuonCollInfo; constexpr static int pairTypeEE = VarManager::kDecayToEE; constexpr static int pairTypeMuMu = VarManager::kDecayToMuMu; @@ -850,7 +852,7 @@ struct AnalysisSameEventPairing { } // end if (track cuts) } - if (context.mOptions.get("processDecayToMuMuSkimmed") || context.mOptions.get("processDecayToMuMuVertexingSkimmed") || context.mOptions.get("processVnDecayToMuMuSkimmed") || context.mOptions.get("processAllSkimmed")) { + if (context.mOptions.get("processDecayToMuMuSkimmed") || context.mOptions.get("processDecayToMuMuVertexingSkimmed") || context.mOptions.get("processDecayToMuMuSkimmedWithColl") || context.mOptions.get("processVnDecayToMuMuSkimmed") || context.mOptions.get("processAllSkimmed")) { TString cutNames = fConfigMuonCuts.value; if (!cutNames.IsNull()) { std::unique_ptr objArray(cutNames.Tokenize(",")); @@ -1006,7 +1008,7 @@ struct AnalysisSameEventPairing { dileptonFilterMap = twoTrackFilter; dileptonList(event, VarManager::fgValues[VarManager::kMass], VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kEta], VarManager::fgValues[VarManager::kPhi], t1.sign() + t2.sign(), dileptonFilterMap, dileptonMcDecision); - if constexpr ((TPairType == pairTypeMuMu) || (TPairType == pairTypeEE && ((TTrackFillMap & VarManager::ObjTypes::ReducedTrackCollInfo) > 0))) { + if constexpr ((TPairType == pairTypeMuMu && ((TTrackFillMap & VarManager::ObjTypes::ReducedMuonCollInfo) > 0)) || (TPairType == pairTypeEE && ((TTrackFillMap & VarManager::ObjTypes::ReducedTrackCollInfo) > 0))) { dileptonInfoList(t1.collisionId(), event.posX(), event.posY(), event.posZ()); } @@ -1129,6 +1131,13 @@ struct AnalysisSameEventPairing { VarManager::FillEvent(event, VarManager::fgValues); runSameEventPairing(event, muons, muons); } + void processDecayToMuMuSkimmedWithColl(soa::Filtered::iterator const& event, soa::Filtered const& muons) + { + // Reset the fValues array + VarManager::ResetValues(0, VarManager::kNVars); + VarManager::FillEvent(event, VarManager::fgValues); + runSameEventPairing(event, muons, muons); + } void processVnDecayToEESkimmed(soa::Filtered::iterator const& event, soa::Filtered const& tracks) { // Reset the fValues array diff --git a/PWGDQ/Tasks/taskJpsiHf.cxx b/PWGDQ/Tasks/taskJpsiHf.cxx index 3bb6983eae3..8514b3410b0 100644 --- a/PWGDQ/Tasks/taskJpsiHf.cxx +++ b/PWGDQ/Tasks/taskJpsiHf.cxx @@ -26,13 +26,25 @@ #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" using namespace o2; +using namespace o2::analysis; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +// pT differential BDT cuts +namespace bdtcuts +{ +static constexpr int nBinsPt = 14; +constexpr float binsPt[nBinsPt + 1] = {0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 10.0f, 12.0f, 16.0f, 24.0f, 36.0f, 1000.0f}; +constexpr float bdtCuts[nBinsPt][3] = {{1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}}; +static const std::vector labelsPt{}; +static const std::vector labelsCutsBdt = {"BDT background", "BDT prompt", "BDT nonprompt"}; +} // namespace bdtcuts + // Declarations of various short names using MyRedEvents = aod::RedJpDmColls; using MyRedPairCandidatesSelected = aod::RedJpDmDileptons; @@ -47,14 +59,24 @@ struct taskJPsiHf { Produces redDileptDimesAll; // HF configurables - Configurable massHfCandMin{"massHfCandMin", 1.5, "minimum HF mass"}; - Configurable massHfCandMax{"massHfCandMax", 2.1, "maximum HF mass"}; + Configurable massHfCandMin{"massHfCandMin", 1.5f, "minimum HF mass"}; + Configurable massHfCandMax{"massHfCandMax", 2.1f, "maximum HF mass"}; + Configurable> binsPtDmesForBdt{"binsPtDmesForBdt", std::vector{bdtcuts::binsPt, bdtcuts::binsPt + bdtcuts::nBinsPt + 1}, "pT bin limits for BDT cuts"}; + Configurable> cutsDmesBdt{"cutsDmesBdt", {bdtcuts::bdtCuts[0], bdtcuts::nBinsPt, 3, bdtcuts::labelsPt, bdtcuts::labelsCutsBdt}, "D-meson BDT selections per pT bin"}; + // DQ configurables - Configurable massDileptonCandMin{"massDileptonCandMin", 1, "minimum dilepton mass"}; - Configurable massDileptonCandMax{"massDileptonCandMax", 5, "maximum dilepton mass"}; + Configurable massDileptonCandMin{"massDileptonCandMin", 1.f, "minimum dilepton mass"}; + Configurable massDileptonCandMax{"massDileptonCandMax", 5.f, "maximum dilepton mass"}; + + // histogram for normalisation + std::shared_ptr hCollisions; + HistogramRegistry registry{"registry"}; void init(o2::framework::InitContext& context) { + hCollisions = registry.add("hCollisions", ";;entries", HistType::kTH1F, {{2, -0.5, 1.5}}); + hCollisions->GetXaxis()->SetBinLabel(1, "all collisions"); + hCollisions->GetXaxis()->SetBinLabel(2, "collisions with pairs"); } // Template function to run pair - hadron combinations @@ -81,27 +103,44 @@ struct taskJPsiHf { phiDmeson = RecoDecay::phi(dmeson.px(), dmeson.py()); deltaPhi = RecoDecay::constrainAngle(phiDilepton - phiDmeson, -o2::constants::math::PIHalf); + auto ptBinDmesForBdt = findBin(binsPtDmesForBdt, ptDmeson); + if (ptBinDmesForBdt == -1) { + continue; + } + if (dmeson.massD0() > 0) { rapDmeson = RecoDecay::y(std::array{dmeson.px(), dmeson.py(), dmeson.pz()}, dmeson.massD0()); deltaRap = rapDilepton - rapDmeson; - if ((dilepton.mass() > massDileptonCandMin && dilepton.mass() < massDileptonCandMax) && (dmeson.massD0() > massHfCandMin && dmeson.massD0() < massHfCandMax)) { - redDileptDimesAll(dilepton.mass(), dmeson.massD0(), ptDilepton, ptDmeson, rapDilepton, rapDmeson, phiDilepton, phiDmeson, deltaRap, deltaPhi, dmeson.bdtBkgMassHypo0(), dmeson.bdtPromptMassHypo0(), dmeson.bdtNonpromptMassHypo0()); + auto bdtBkg = dmeson.bdtBkgMassHypo0(); + auto bdtPrompt = dmeson.bdtPromptMassHypo0(); + auto bdtNonPrompt = dmeson.bdtNonpromptMassHypo0(); + if ((dilepton.mass() > massDileptonCandMin && dilepton.mass() < massDileptonCandMax) && (dmeson.massD0() > massHfCandMin && dmeson.massD0() < massHfCandMax && bdtBkg < cutsDmesBdt->get(ptBinDmesForBdt, "BDT background") && bdtPrompt > cutsDmesBdt->get(ptBinDmesForBdt, "BDT prompt") && bdtNonPrompt > cutsDmesBdt->get(ptBinDmesForBdt, "BDT nonprompt"))) { + redDileptDimesAll(dilepton.mass(), dmeson.massD0(), ptDilepton, ptDmeson, rapDilepton, rapDmeson, phiDilepton, phiDmeson, deltaRap, deltaPhi, bdtBkg, bdtPrompt, bdtNonPrompt); } } if (dmeson.massD0bar() > 0) { rapDmeson = RecoDecay::y(std::array{dmeson.px(), dmeson.py(), dmeson.pz()}, dmeson.massD0bar()); deltaRap = rapDilepton - rapDmeson; - if ((dilepton.mass() > massDileptonCandMin && dilepton.mass() < massDileptonCandMax) && (dmeson.massD0() > massHfCandMin && dmeson.massD0() < massHfCandMax)) { - redDileptDimesAll(dilepton.mass(), dmeson.massD0bar(), ptDilepton, ptDmeson, rapDilepton, rapDmeson, phiDilepton, phiDmeson, deltaRap, deltaPhi, dmeson.bdtBkgMassHypo1(), dmeson.bdtPromptMassHypo1(), dmeson.bdtNonpromptMassHypo1()); + auto bdtBkg = dmeson.bdtBkgMassHypo1(); + auto bdtPrompt = dmeson.bdtPromptMassHypo1(); + auto bdtNonPrompt = dmeson.bdtNonpromptMassHypo1(); + if ((dilepton.mass() > massDileptonCandMin && dilepton.mass() < massDileptonCandMax) && (dmeson.massD0() > massHfCandMin && dmeson.massD0() < massHfCandMax && bdtBkg < cutsDmesBdt->get(ptBinDmesForBdt, "BDT background") && bdtPrompt > cutsDmesBdt->get(ptBinDmesForBdt, "BDT prompt") && bdtNonPrompt > cutsDmesBdt->get(ptBinDmesForBdt, "BDT nonprompt"))) { + redDileptDimesAll(dilepton.mass(), dmeson.massD0bar(), ptDilepton, ptDmeson, rapDilepton, rapDmeson, phiDilepton, phiDmeson, deltaRap, deltaPhi, bdtBkg, bdtPrompt, bdtNonPrompt); } } } } } - void processRedJspiD0(MyRedEvents::iterator const& event, MyRedPairCandidatesSelected const& dileptons, MyRedD0CandidatesSelected const& dmesons) + void processRedJspiD0(RedJpDmColCounts const& normCounters, MyRedEvents const& events, MyRedPairCandidatesSelected const& dileptons, MyRedD0CandidatesSelected const& dmesons) { - runDileptonDmeson(event, dileptons, dmesons); + for (const auto& normCounter : normCounters) { + hCollisions->Fill(0.f, static_cast(normCounter.numColls())); + } + for (const auto& event : events) { + hCollisions->Fill(1.f); + runDileptonDmeson(event, dileptons, dmesons); + } } PROCESS_SWITCH(taskJPsiHf, processRedJspiD0, "Process J/psi - D0", true); diff --git a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx index 7a99a8662b8..bbd3f65ee35 100644 --- a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx +++ b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx @@ -28,7 +28,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetTPCNsigmaElRange(-3, +3); cut->SetIsWithinBeamPipe(true); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.995); cut->SetMaxPCA(0.5); @@ -45,11 +45,11 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetTPCNsigmaElRange(-3, +3); cut->SetIsWithinBeamPipe(true); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.99); - cut->SetMaxPCA(0.5); - cut->SetRxyRange(1, 180); + cut->SetMaxPCA(1.5); + cut->SetRxyRange(1, 90); return cut; } if (!nameStr.compare("qc_ITSTPC")) { @@ -63,12 +63,12 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetIsWithinBeamPipe(true); cut->SetRequireITSTPC(true); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.99); cut->SetMaxPCA(0.5); - cut->SetRxyRange(1, 180); - cut->SetAPRange(0.95, 0.02); + cut->SetRxyRange(1, 90); + cut->SetAPRange(0.95, 0.01); return cut; } if (!nameStr.compare("qc_ITSonly")) { @@ -78,12 +78,12 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetIsWithinBeamPipe(true); cut->SetRequireITSonly(true); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.99); cut->SetMaxPCA(0.5); - cut->SetRxyRange(1, 180); - cut->SetAPRange(0.95, 0.02); + cut->SetRxyRange(1, 90); + cut->SetAPRange(0.95, 0.01); return cut; } if (!nameStr.compare("qc_TPConly")) { @@ -97,11 +97,12 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetIsWithinBeamPipe(true); cut->SetRequireTPConly(true); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.99); cut->SetMaxPCA(1.5); - cut->SetRxyRange(1, 180); + cut->SetRxyRange(1, 90); + cut->SetAPRange(0.95, 0.01); return cut; } if (!nameStr.compare("wwire")) { // conversion only on tungstate wire @@ -115,13 +116,13 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetNClustersITS(2, 4); // cut->SetIsWithinBeamPipe(true); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.99); cut->SetMaxPCA(0.5); cut->SetOnWwireIB(true); cut->SetOnWwireOB(true); - cut->SetAPRange(0.95, 0.02); + cut->SetAPRange(0.95, 0.01); return cut; } if (!nameStr.compare("wwire_ib")) { // conversion only on tungstate wire outside of ITSib @@ -135,13 +136,13 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetNClustersITS(2, 4); // cut->SetIsWithinBeamPipe(true); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.99); cut->SetMaxPCA(0.5); cut->SetOnWwireIB(true); cut->SetOnWwireOB(false); - cut->SetAPRange(0.95, 0.02); + cut->SetAPRange(0.95, 0.01); return cut; } if (!nameStr.compare("wwire_ob")) { // conversion only on tungstate wire outside of ITSob (middle layer) @@ -155,13 +156,13 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetNClustersITS(0, 2); // cut->SetIsWithinBeamPipe(true); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.99); cut->SetMaxPCA(0.5); cut->SetOnWwireIB(false); cut->SetOnWwireOB(true); - cut->SetAPRange(0.95, 0.02); + cut->SetAPRange(0.95, 0.01); return cut; } if (!nameStr.compare("nopid")) { @@ -173,7 +174,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetChi2PerClusterTPC(0.0, 4.0); cut->SetIsWithinBeamPipe(true); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.99); cut->SetMaxPCA(1.5); @@ -190,7 +191,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetTPCNsigmaElRange(-3, +3); cut->SetIsWithinBeamPipe(false); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.99); cut->SetMaxPCA(1.5); @@ -208,7 +209,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetIsWithinBeamPipe(true); cut->SetRequireITSTPC(true); // for v0 - cut->SetV0PtRange(0.05f, 1e10f); + cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); cut->SetMinCosPA(0.995); cut->SetMaxPCA(0.5); diff --git a/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx b/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx index f257a6eb6a3..9fb85b461a1 100644 --- a/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx +++ b/PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx @@ -64,15 +64,15 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char* list->Add(new TH2F("hZX", "Z vs. X;Z (cm);X (cm)", 200, -100, 100, 100, 0, 100)); list->Add(new TH2F("hZY", "Z vs. Y;Z (cm);Y (cm)", 200, -100, 100, 100, -50, 50)); list->Add(new TH2F("hDCAxyZ", "DCAxy vs. Z;Z (cm);DCA_{xy} (cm)", 200, -100, +100, 100, -50, 50)); - list->Add(new TH2F("hXZ_tgl", "correlation of tgl vs. z/x;tgl;z/x", 300, -1.5, 1.5, 300, -1.5, 1.5)); + list->Add(new TH2F("hXZ_tgl", "correlation of tgl vs. z/x;tgl;z/x - tgl", 300, -1.5, 1.5, 300, -1.5, 1.5)); if (TString(subGroup) == "mc") { - list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, 10, 1000, -1.0f, 1.0f)); - list->Add(new TH2F("hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, 10, 1000, -1.0f, 1.0f)); - list->Add(new TH2F("hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", 1000, 0, 10, 1000, -1.0f, 1.0f)); + list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, 10, 400, -1.0f, 1.0f)); + list->Add(new TH2F("hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, 10, 400, -1.0f, 1.0f)); + list->Add(new TH2F("hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", 1000, 0, 10, 400, -1.0f, 1.0f)); } } if (TString(histClass) == "V0") { - list->Add(new TH1F("hPt", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); + list->Add(new TH1F("hPt", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f)); list->Add(new TH2F("hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", 200, -100, 100, 200, 0.0f, 100.0f)); list->Add(new TH2F("hRadius_recalc", "V0Radius; radius in Z (cm);radius in XY (cm)", 200, -100, 100, 200, 0.0f, 100.0f)); @@ -93,30 +93,31 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char* list->Add(new TH1F("hNgamma", "Number of #gamma candidates per collision", 101, -0.5f, 100.5f)); if (TString(subGroup) == "mc") { - list->Add(new TH1F("hPt_Photon_Candidate", "pT of photon candidate;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for denominator of purity + list->Add(new TH1F("hPt_Photon_Candidate", "pT of photon candidate;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for denominator of purity list->Add(new TH2F("hEtaPhi_Photon_Candidate", "#eta vs. #varphi of photon candidate ;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f)); // for denominator of purity - list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for MC efficiency + list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC efficiency list->Add(new TH2F("hEtaPhi_Photon_Primary", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f)); // for MC efficiency - list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for MC feed down correction - list->Add(new TH2F("hEtaPhi_Photon_FromWD", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f)); // for MC feed down correction + + list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC feed down correction + list->Add(new TH2F("hEtaPhi_Photon_FromWD", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, TMath::TwoPi(), 40, -2.0f, 2.0f)); // for MC feed down correction list->Add(new TH2F("hRZ_Photon_hs", "R vs. Z of photon from hadronic shower in materials;Z (cm);R_{xy} (cm)", 200, -100.0f, +100, 100, 0, 100)); list->Add(new TH1F("hPt_Photon_hs", "pT of photon from hadronic shower in materials;p_{T} (GeV/c)", 1000, 0.0f, 10)); list->Add(new TH1F("hEta_Photon_hs", "rapidity of photon from hadronic shower in materials;y", 40, -2.0f, 2.0f)); list->Add(new TH1F("hPhi_Photon_hs", "#varphi of photon from hadronic shower in materials;#varphi (rad.);", 180, 0, TMath::TwoPi())); - list->Add(new TH2F("hConvPoint_diffX", "conversion point diff X MC;X_{MC} (cm);X_{rec} - X_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f)); - list->Add(new TH2F("hConvPoint_diffY", "conversion point diff Y MC;Y_{MC} (cm);Y_{rec} - Y_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f)); - list->Add(new TH2F("hConvPoint_diffZ", "conversion point diff Z MC;Z_{MC} (cm);Z_{rec} - Z_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f)); + list->Add(new TH2F("hConvPoint_diffX", "conversion point diff X MC;X_{MC} (cm);X_{rec} - X_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f)); + list->Add(new TH2F("hConvPoint_diffY", "conversion point diff Y MC;Y_{MC} (cm);Y_{rec} - Y_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f)); + list->Add(new TH2F("hConvPoint_diffZ", "conversion point diff Z MC;Z_{MC} (cm);Z_{rec} - Z_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f)); - list->Add(new TH2F("hConvPoint_diffX_recalc", "conversion point diff X MC;X_{MC} (cm);X_{rec}^{recalc} - X_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f)); - list->Add(new TH2F("hConvPoint_diffY_recalc", "conversion point diff Y MC;Y_{MC} (cm);Y_{rec}^{recalc} - Y_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f)); - list->Add(new TH2F("hConvPoint_diffZ_recalc", "conversion point diff Z MC;Z_{MC} (cm);Z_{rec}^{recalc} - Z_{MC} (cm)", 500, -250, +250, 100, -50.0f, 50.0f)); + list->Add(new TH2F("hConvPoint_diffX_recalc", "conversion point diff X MC;X_{MC} (cm);X_{rec}^{recalc} - X_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f)); + list->Add(new TH2F("hConvPoint_diffY_recalc", "conversion point diff Y MC;Y_{MC} (cm);Y_{rec}^{recalc} - Y_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f)); + list->Add(new TH2F("hConvPoint_diffZ_recalc", "conversion point diff Z MC;Z_{MC} (cm);Z_{rec}^{recalc} - Z_{MC} (cm)", 200, -100, +100, 100, -50.0f, 50.0f)); - list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "photon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, 10, 1000, -1.0f, 1.0f)); - list->Add(new TH2F("hPtGen_DeltaEta", "photon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, 10, 1000, -1.0f, 1.0f)); - list->Add(new TH2F("hPtGen_DeltaPhi", "photon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", 1000, 0, 10, 1000, -1.0f, 1.0f)); + list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "photon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, 10, 400, -1.0f, 1.0f)); + list->Add(new TH2F("hPtGen_DeltaEta", "photon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, 10, 400, -1.0f, 1.0f)); + list->Add(new TH2F("hPtGen_DeltaPhi", "photon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", 1000, 0, 10, 400, -1.0f, 1.0f)); } // end of mc } // end of V0 @@ -239,6 +240,11 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char* list->Add(new TH1F("hNclsITS", "number of ITS clusters", 8, -0.5, 7.5)); list->Add(new TH1F("hChi2ITS", "chi2/number of ITS clusters", 100, 0, 10)); list->Add(new TH1F("hITSClusterMap", "ITS cluster map", 128, -0.5, 127.5)); + if (TString(subGroup).Contains("mc")) { + list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, maxP, 400, -1.0f, 1.0f)); + list->Add(new TH2F("hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, maxP, 400, -1.0f, 1.0f)); + list->Add(new TH2F("hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", 1000, 0, maxP, 400, -1.0f, 1.0f)); + } } if (TString(histClass) == "Cluster") { @@ -260,17 +266,17 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char* } if (TString(histClass) == "singlephoton") { - list->Add(new TH1F("hPt", "pT of photon candidates;p_{T} (GeV/c)", 1000, 0.0f, 10)); + list->Add(new TH1F("hPt", "pT of photon candidates;p_{T} (GeV/c)", 2000, 0.0f, 20)); list->Add(new TH1F("hY", "rapidity of photon candidates;y", 40, -2.0f, 2.0f)); list->Add(new TH1F("hPhi", "azimuthal angle of photon candidates;#varphi (rad.)", 180, 0, TMath::TwoPi())); if (TString(subGroup) == "mc") { - list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for MC efficiency + list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC efficiency list->Add(new TH1F("hY_Photon_Primary", "rapidity;y", 40, -2.0f, 2.0f)); // for MC efficiency list->Add(new TH1F("hPhi_Photon_Primary", "#varphi;#varphi (rad.);", 180, 0, TMath::TwoPi())); // for MC efficiency - list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); // for MC efficiency - list->Add(new TH1F("hY_Photon_FromWD", "rapidity;y", 40, -2.0f, 2.0f)); // for MC efficiency - list->Add(new TH1F("hPhi_Photon_FromWD", "#varphi;#varphi (rad.);", 180, 0, TMath::TwoPi())); // for MC efficiency - list->Add(new TH1F("hPt_Photon_hs", "pT of photon from hadronic shower in materials;p_{T} (GeV/c)", 1000, 0.0f, 10)); + list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for Feed down correction + list->Add(new TH1F("hY_Photon_FromWD", "rapidity;y", 40, -2.0f, 2.0f)); // for Feed down correction + list->Add(new TH1F("hPhi_Photon_FromWD", "#varphi;#varphi (rad.);", 180, 0, TMath::TwoPi())); // for Feed down correction + list->Add(new TH1F("hPt_Photon_hs", "pT of photon from hadronic shower in materials;p_{T} (GeV/c)", 2000, 0.0f, 20)); list->Add(new TH1F("hY_Photon_hs", "rapidity from hadronic shower in materials;y", 40, -2.0f, 2.0f)); list->Add(new TH1F("hPhi_Photon_hs", "#varphi from hadronic shower in materials;#varphi (rad.);", 180, 0, TMath::TwoPi())); } @@ -387,7 +393,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char* } if (TString(subGroup) == "Photon") { - list->Add(new TH1F("hPt_Photon", "photon pT;p_{T} (GeV/c)", 1000, 0.0f, 10)); + list->Add(new TH1F("hPt_Photon", "photon pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); list->Add(new TH1F("hY_Photon", "photon y;rapidity y", 40, -2.0f, 2.0f)); list->Add(new TH1F("hPhi_Photon", "photon #varphi;#varphi (rad.)", 180, 0, TMath::TwoPi())); } @@ -395,17 +401,17 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char* if (TString(subGroup) == "Pi0Eta") { static constexpr std::string_view parnames[2] = {"Pi0", "Eta"}; for (int i = 0; i < 2; i++) { - list->Add(new TH1F(Form("hPt_%s", parnames[i].data()), Form("%s pT;p_{T} (GeV/c)", parnames[i].data()), 1000, 0.0f, 10)); + list->Add(new TH1F(Form("hPt_%s", parnames[i].data()), Form("%s pT;p_{T} (GeV/c)", parnames[i].data()), 2000, 0.0f, 20)); list->Add(new TH1F(Form("hY_%s", parnames[i].data()), Form("%s y;rapidity y", parnames[i].data()), 40, -2.0f, 2.0f)); list->Add(new TH1F(Form("hPhi_%s", parnames[i].data()), Form("%s #varphi;#varphi (rad.)", parnames[i].data()), 180, 0, TMath::TwoPi())); } } if (TString(subGroup) == "dielectron") { - TH2F* hMvsPt = new TH2F("hMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", 110, 0, 1.1f, 100, 0, 10.f); + TH2F* hMvsPt = new TH2F("hMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", 110, 0, 1.1f, 1000, 0, 10.f); hMvsPt->Sumw2(); list->Add(hMvsPt); } else if (TString(subGroup) == "dimuon") { - TH2F* hMvsPt = new TH2F("hMvsPt", "m_{#mu#mu} vs. p_{T,#mu#mu};m_{#mu#mu} (GeV/c^{2});p_{T,#mu#mu} (GeV/c)", 90, 0.2, 1.1f, 20, 0, 2.f); + TH2F* hMvsPt = new TH2F("hMvsPt", "m_{#mu#mu} vs. p_{T,#mu#mu};m_{#mu#mu} (GeV/c^{2});p_{T,#mu#mu} (GeV/c)", 90, 0.2, 1.1f, 200, 0, 2.f); hMvsPt->Sumw2(); list->Add(hMvsPt); } diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCut.h b/PWGEM/PhotonMeson/Core/V0PhotonCut.h index 3d007fdc62e..149e871a977 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.h @@ -386,17 +386,17 @@ class V0PhotonCut : public TNamed return mMinChi2PerClusterITS < track.itsChi2NCl() && track.itsChi2NCl() < mMaxChi2PerClusterITS; case V0PhotonCuts::kIsWithinBeamPipe: { - // return track.isWithinBeamPipe(); - if (abs(track.y()) > abs(track.x() * TMath::Tan(10.f * TMath::DegToRad())) + 15.f) { - return false; - } + // if (abs(track.y()) > abs(track.x() * TMath::Tan(10.f * TMath::DegToRad())) + 15.f) { + // return false; + // } if (track.x() > 82.9 && abs(track.y()) > abs(track.x() * TMath::Tan(10.f * TMath::DegToRad())) + 5.f) { return false; } const float slope = TMath::Tan(2 * TMath::ATan(TMath::Exp(-0.5))); - return !(track.x() > 82.9 && abs(track.y()) < 40.f && abs(abs(track.z()) - track.x() / slope) < 3.5f && 15.f < abs(track.dcaXY())); + return !(track.x() > 82.9 && abs(track.y()) < 15.f && abs(abs(track.z()) - track.x() / slope) < 7.f && 15.f < abs(track.dcaXY())); + // return !(track.x() > 82.9 && abs(track.y()) < 40.f && abs(abs(track.z()) - 47.f) < 3.f && 15.f < abs(track.dcaXY())); } case V0PhotonCuts::kRequireITSTPC: return isITSTPCTrack(track); diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index 607d30b5144..351ed4d0ae9 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -269,14 +269,14 @@ DECLARE_SOA_COLUMN(Px, px, float); //! px f DECLARE_SOA_COLUMN(Py, py, float); //! py for photon kf DECLARE_SOA_COLUMN(Pz, pz, float); //! pz for photon kf DECLARE_SOA_COLUMN(MGamma, mGamma, float); //! invariant mass of dielectron at SV -DECLARE_SOA_COLUMN(MGammaPV, mGammaPV, float); //! invariant mass of dielectron at PV -DECLARE_SOA_COLUMN(DCAxyV0ToPV, dcaXYv0topv, float); //! DCAxy of V0 to PV -DECLARE_SOA_COLUMN(DCAzV0ToPV, dcaZv0topv, float); //! DCAz of V0 to PV -DECLARE_SOA_COLUMN(CosPA, cospa, float); //! -DECLARE_SOA_COLUMN(PCA, pca, float); //! -DECLARE_SOA_COLUMN(Alpha, alpha, float); //! -DECLARE_SOA_COLUMN(QtArm, qtarm, float); //! -DECLARE_SOA_COLUMN(ChiSquareNDF, chiSquareNDF, float); // Chi2 / NDF of the reconstructed V0 +// DECLARE_SOA_COLUMN(MGammaPV, mGammaPV, float); //! invariant mass of dielectron at PV +DECLARE_SOA_COLUMN(DCAxyV0ToPV, dcaXYv0topv, float); //! DCAxy of V0 to PV +DECLARE_SOA_COLUMN(DCAzV0ToPV, dcaZv0topv, float); //! DCAz of V0 to PV +DECLARE_SOA_COLUMN(CosPA, cospa, float); //! +DECLARE_SOA_COLUMN(PCA, pca, float); //! +DECLARE_SOA_COLUMN(Alpha, alpha, float); //! +DECLARE_SOA_COLUMN(QtArm, qtarm, float); //! +DECLARE_SOA_COLUMN(ChiSquareNDF, chiSquareNDF, float); // Chi2 / NDF of the reconstructed V0 DECLARE_SOA_DYNAMIC_COLUMN(E, e, [](float px, float py, float pz, float m = 0) -> float { return RecoDecay::sqrtSumOfSquares(px, py, pz, m); }); //! energy of v0 photn, mass to be given as argument when getter is called! DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) -> float { return RecoDecay::sqrtSumOfSquares(px, py); }); @@ -289,7 +289,8 @@ DECLARE_SOA_TABLE(V0PhotonsKF, "AOD", "V0PHOTONKF", //! o2::soa::Index<>, v0photonkf::CollisionId, v0photonkf::PosTrackId, v0photonkf::NegTrackId, v0photonkf::Vx, v0photonkf::Vy, v0photonkf::Vz, v0photonkf::Px, v0photonkf::Py, v0photonkf::Pz, - v0photonkf::MGamma, v0photonkf::MGammaPV, + v0photonkf::MGamma, + // v0photonkf::MGammaPV, v0photonkf::DCAxyV0ToPV, v0photonkf::DCAzV0ToPV, v0photonkf::CosPA, v0photonkf::PCA, v0photonkf::Alpha, v0photonkf::QtArm, diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 524c6525b6c..5eecb2d8a2a 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -77,26 +77,32 @@ struct PhotonConversionBuilder { Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; Configurable useMatCorrType{"useMatCorrType", 0, "0: none, 1: TGeo, 2: LUT"}; + // single track cuts + Configurable mincrossedrows{"mincrossedrows", 10, "min crossed rows"}; + Configurable maxchi2tpc{"maxchi2tpc", 4.0, "max chi2/NclsTPC"}; + Configurable maxchi2its{"maxchi2its", 5.0, "max chi2/NclsITS"}; + Configurable maxpt_itsonly{"maxpt_itsonly", 0.15, "max pT for ITSonly tracks at SV"}; + Configurable maxTPCNsigmaEl{"maxTPCNsigmaEl", 4.0, "max. TPC n sigma for electron"}; Configurable dcanegtopv{"dcanegtopv", 0.1, "DCA Neg To PV"}; Configurable dcapostopv{"dcapostopv", 0.1, "DCA Pos To PV"}; + Configurable min_pt_leg{"min_pt_leg", 0.05, "min pT for v0 legs at SV"}; + Configurable maxX{"maxX", 83.1, "max X for track IU"}; + + // v0 cuts Configurable min_v0cospa{"min_v0cospa", 0.99, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0) - Configurable max_dcav0dau{"max_dcav0dau", 1.5, "max distance btween 2 legs"}; + Configurable max_dcav0dau{"max_dcav0dau", 2.0, "max distance btween 2 legs"}; Configurable min_v0radius{"min_v0radius", 1.0, "min v0 radius"}; - Configurable margin_r{"margin_r", 3.0, "margin for r cut in cm"}; + Configurable margin_r_its{"margin_r_its", 3.0, "margin for r cut in cm"}; + Configurable margin_r_tpconly{"margin_r_tpconly", 7.0, "margin for r cut in cm"}; Configurable margin_z{"margin_z", 7.0, "margin for z cut in cm"}; - Configurable max_alpha_ap{"max_alpha_ap", 0.95, "max alpha for AP cut"}; Configurable max_qt_ap{"max_qt_ap", 0.02, "max qT for AP cut"}; - Configurable min_pt_leg{"min_pt_leg", 0.05, "min pT for v0 legs at SV"}; Configurable min_pt_v0{"min_pt_v0", 0.05, "min pT for v0 photons at SV"}; Configurable max_pt_v0_itsonly{"max_pt_v0_itsonly", 0.3, "max pT for v0 photons wth 2 ITSonly tracks at SV"}; Configurable max_eta_v0{"max_eta_v0", 0.9, "max eta for v0 photons at SV"}; - Configurable mincrossedrows{"mincrossedrows", 10, "min crossed rows"}; - Configurable maxchi2tpc{"maxchi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable maxchi2its{"maxchi2its", 5.0, "max chi2/NclsITS"}; - Configurable maxpt_itsonly{"maxpt_itsonly", 0.15, "max pT for ITSonly tracks at SV"}; - Configurable maxTPCNsigmaEl{"maxTPCNsigmaEl", 4.0, "max. TPC n sigma for electron"}; Configurable kfMassConstrain{"kfMassConstrain", -1.f, "mass constrain for the KFParticle mother particle"}; + Configurable max_r_req_its{"max_r_req_its", 16.0, "max Rxy for V0 with ITS hits"}; + Configurable min_r_tpconly{"min_r_tpconly", 32.0, "min Rxy for V0 with TPConly tracks"}; int mRunNumber; float d_bz; @@ -118,10 +124,9 @@ struct PhotonConversionBuilder { {"V0/hCosPA", "cosine of pointing angle;cosine of pointing angle", {HistType::kTH1F, {{100, 0.9f, 1.f}}}}, {"V0/hPCA", "distance between 2 legs at SV;PCA (cm)", {HistType::kTH1F, {{500, 0.0f, 5.f}}}}, {"V0/hDCAxyz", "DCA to PV;DCA_{xy} (cm);DCA_{z} (cm)", {HistType::kTH2F, {{200, -5.f, +5.f}, {200, -5.f, +5.f}}}}, - {"V0/hMee_SVPV", "mee at PV and SV;m_{ee} at PV (GeV/c^{2});m_{ee} at SV (GeV/c^{2})", {HistType::kTH2F, {{100, 0.0f, 0.1f}, {100, 0, 0.1f}}}}, + // {"V0/hMee_SVPV", "mee at PV and SV;m_{ee} at PV (GeV/c^{2});m_{ee} at SV (GeV/c^{2})", {HistType::kTH2F, {{100, 0.0f, 0.1f}, {100, 0, 0.1f}}}}, {"V0/hMeeSV_Rxy", "mee at SV vs. R_{xy};R_{xy} (cm);m_{ee} at SV (GeV/c^{2})", {HistType::kTH2F, {{200, 0.0f, 100.f}, {100, 0, 0.1f}}}}, - {"V0/hMeePV_Rxy", "mee at PV vs. R_{xy};R_{xy} (cm);m_{ee} at PV (GeV/c^{2})", {HistType::kTH2F, {{200, 0.0f, 100.f}, {100, 0, 0.1f}}}}, - {"V0/hPtDiff", "V0 KF pt leg sum vs. gamma pt;p_{T,#gamma} (GeV/c);p_{T,ee} (GeV/c)", {HistType::kTH2F, {{1000, 0.0f, 10.f}, {1000, 0, 10}}}}, + // {"V0/hMeePV_Rxy", "mee at PV vs. R_{xy};R_{xy} (cm);m_{ee} at PV (GeV/c^{2})", {HistType::kTH2F, {{200, 0.0f, 100.f}, {100, 0, 0.1f}}}}, {"V0Leg/hPt", "pT of leg at SV;p_{T,e} (GeV/c)", {HistType::kTH1F, {{1000, 0.0f, 10.0f}}}}, {"V0Leg/hEtaPhi", "#eta vs. #varphi of leg at SV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, TMath::TwoPi()}, {400, -2, +2}}}}, {"V0Leg/hDCAxyz", "DCA xy vs. z to PV;DCA_{xy} (cm);DCA_{z} (cm)", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -10.f, +10.f}}}}, @@ -217,6 +222,10 @@ struct PhotonConversionBuilder { } } + if (track.x() > maxX) { + return false; + } + if (!track.hasITS() && !track.hasTPC()) { return false; } @@ -246,19 +255,41 @@ struct PhotonConversionBuilder { } } + if (!track.hasITS() && track.x() < 0.1) { // TPConly tracks which cannot be propagated to X=83cm during asynch. reco.. + auto track_par_cov = getTrackParCov(track); + o2::base::Propagator::Instance()->propagateToX(track_par_cov, 83.f, d_bz, o2::base::PropagatorImpl::MAX_SIN_PHI, o2::base::PropagatorImpl::MAX_STEP, matCorr); + if (40.0 < track_par_cov.getX() && track_par_cov.getX() < 82.9) { // propagation failed. + return false; + } + } + return true; } template void fillTrackTable(TTrack const& track, TKFParticle const& kfp, float dcaXY, float dcaZ) { + float trackiu_x = 0.0, trackiu_y = 0.0, trackiu_z = 0.0; + if (!track.hasITS() && track.x() < 0.1) { // TPConly tracks which cannot be propagated to X=83cm during asynch. reco.. + auto track_par_cov = getTrackParCov(track); + o2::base::Propagator::Instance()->propagateToX(track_par_cov, 83.f, d_bz, o2::base::PropagatorImpl::MAX_SIN_PHI, o2::base::PropagatorImpl::MAX_STEP, matCorr); + trackiu_x = track_par_cov.getX(); + // trackiu_y = track_par_cov.getY(); + trackiu_y = track.y(); + trackiu_z = track_par_cov.getZ(); + } else { + trackiu_x = track.x(); + trackiu_y = track.y(); + trackiu_z = track.z(); + } + v0legs(track.collisionId(), track.globalIndex(), track.sign(), kfp.GetPx(), kfp.GetPy(), kfp.GetPz(), dcaXY, dcaZ, track.tpcNClsFindable(), track.tpcNClsFindableMinusFound(), track.tpcNClsFindableMinusCrossedRows(), track.tpcChi2NCl(), track.tpcInnerParam(), track.tpcSignal(), track.tpcNSigmaEl(), track.tpcNSigmaPi(), track.itsClusterMap(), track.itsChi2NCl(), track.detectorMap(), - track.x(), track.y(), track.z(), track.tgl(), track.signed1Pt()); + trackiu_x, trackiu_y, trackiu_z, track.tgl(), track.signed1Pt()); } template @@ -277,6 +308,13 @@ struct PhotonConversionBuilder { return; } + if (isITSonlyTrack(pos) && isTPConlyTrack(ele)) { + return; + } + if (isITSonlyTrack(ele) && isTPConlyTrack(pos)) { + return; + } + if (!checkV0leg(pos) || !checkV0leg(ele)) { return; } @@ -285,14 +323,14 @@ struct PhotonConversionBuilder { // Calculate DCA with respect to the collision associated to the v0, not individual tracks gpu::gpustd::array dcaInfo; - auto pTrack = getTrackParCov(pos); - pTrack.setPID(o2::track::PID::Electron); + auto pTrack = getTrackPar(pos); + // pTrack.setPID(o2::track::PID::Electron); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, pTrack, 2.f, matCorr, &dcaInfo); auto posdcaXY = dcaInfo[0]; auto posdcaZ = dcaInfo[1]; - auto nTrack = getTrackParCov(ele); - nTrack.setPID(o2::track::PID::Electron); + auto nTrack = getTrackPar(ele); + // nTrack.setPID(o2::track::PID::Electron); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, nTrack, 2.f, matCorr, &dcaInfo); auto eledcaXY = dcaInfo[0]; auto eledcaZ = dcaInfo[1]; @@ -304,7 +342,8 @@ struct PhotonConversionBuilder { float xyz[3] = {0.f, 0.f, 0.f}; Vtx_recalculation(o2::base::Propagator::Instance(), pos, ele, xyz, matCorr); float rxy_tmp = RecoDecay::sqrtSumOfSquares(xyz[0], xyz[1]); - if (rxy_tmp > std::min(pos.x(), ele.x()) + margin_r * 2.f) { + + if (rxy_tmp > maxX + margin_r_tpconly) { return; } @@ -333,7 +372,33 @@ struct PhotonConversionBuilder { } float rxy = RecoDecay::sqrtSumOfSquares(gammaKF_DecayVtx.GetX(), gammaKF_DecayVtx.GetY()); - if (rxy > std::min(pos.x(), ele.x()) + margin_r || rxy < min_v0radius) { + if (rxy < min_v0radius) { + return; + } + + if (pos.hasITS() && ele.hasITS()) { + if (rxy > std::min(pos.x(), ele.x()) + margin_r_its) { + return; + } + } else if (!pos.hasITS() && ele.hasITS()) { + if (rxy > std::min(83.f, ele.x()) + margin_r_its) { + return; + } + } else if (pos.hasITS() && !ele.hasITS()) { + if (rxy > std::min(pos.x(), 83.f) + margin_r_its) { + return; + } + } else if (!pos.hasITS() && !ele.hasITS()) { + if (rxy > std::min(83.f, 83.f) + margin_r_tpconly) { + return; + } + } + + if ((!pos.hasITS() || !ele.hasITS()) && rxy < max_r_req_its) { // conversion points smaller than max_r_req_its have to be detected with ITS hits. + return; + } + + if ((!pos.hasITS() && !ele.hasITS()) && rxy < min_r_tpconly) { // TPConly tracks can detect conversion points larger than min_r_tpconly. return; } @@ -357,12 +422,11 @@ struct PhotonConversionBuilder { KFParticle kfp_ele_DecayVtx = kfp_ele; // Don't set Primary Vertex kfp_pos_DecayVtx.TransportToPoint(xyz); // Don't set Primary Vertex kfp_ele_DecayVtx.TransportToPoint(xyz); // Don't set Primary Vertex - float ptee = RecoDecay::sqrtSumOfSquares(kfp_pos_DecayVtx.GetPx() + kfp_ele_DecayVtx.GetPx(), kfp_pos_DecayVtx.GetPy() + kfp_ele_DecayVtx.GetPy()); - KFParticle kfp_pos_PV = kfp_pos_DecayVtx; - KFParticle kfp_ele_PV = kfp_ele_DecayVtx; - kfp_pos_PV.SetProductionVertex(KFPV); - kfp_ele_PV.SetProductionVertex(KFPV); + // KFParticle kfp_pos_PV = kfp_pos_DecayVtx; + // KFParticle kfp_ele_PV = kfp_ele_DecayVtx; + // kfp_pos_PV.SetProductionVertex(KFPV); + // kfp_ele_PV.SetProductionVertex(KFPV); float pca_kf = kfp_pos_DecayVtx.GetDistanceFromParticle(kfp_ele_DecayVtx); if (pca_kf > max_dcav0dau) { @@ -405,7 +469,6 @@ struct PhotonConversionBuilder { registry.fill(HIST("V0/hEtaPhi"), v0phi, v0eta); registry.fill(HIST("V0/hCosPA"), cospa_kf); registry.fill(HIST("V0/hPCA"), pca_kf); - registry.fill(HIST("V0/hPtDiff"), v0pt, ptee); // calculate DCAxy,z to PV float v0mom = RecoDecay::sqrtSumOfSquares(gammaKF_DecayVtx.GetPx(), gammaKF_DecayVtx.GetPy(), gammaKF_DecayVtx.GetPz()); @@ -413,7 +476,7 @@ struct PhotonConversionBuilder { float dca_x_v0_to_pv = (gammaKF_DecayVtx.GetX() - gammaKF_DecayVtx.GetPx() * cospa_kf * length / v0mom) - collision.posX(); float dca_y_v0_to_pv = (gammaKF_DecayVtx.GetY() - gammaKF_DecayVtx.GetPy() * cospa_kf * length / v0mom) - collision.posY(); float dca_z_v0_to_pv = (gammaKF_DecayVtx.GetZ() - gammaKF_DecayVtx.GetPz() * cospa_kf * length / v0mom) - collision.posZ(); - float sign_tmp = dca_y_v0_to_pv > 0 ? +1 : -1; + float sign_tmp = dca_x_v0_to_pv * dca_y_v0_to_pv > 0 ? +1.f : -1.f; float dca_xy_v0_to_pv = RecoDecay::sqrtSumOfSquares(dca_x_v0_to_pv, dca_y_v0_to_pv) * sign_tmp; registry.fill(HIST("V0/hDCAxyz"), dca_xy_v0_to_pv, dca_z_v0_to_pv); @@ -433,21 +496,21 @@ struct PhotonConversionBuilder { registry.fill(HIST("V0Leg/hDCAxyz"), posdcaXY, posdcaZ); registry.fill(HIST("V0Leg/hDCAxyz"), eledcaXY, eledcaZ); - ROOT::Math::PxPyPzMVector vpos_pv(kfp_pos_PV.GetPx(), kfp_pos_PV.GetPy(), kfp_pos_PV.GetPz(), o2::constants::physics::MassElectron); - ROOT::Math::PxPyPzMVector vele_pv(kfp_ele_PV.GetPx(), kfp_ele_PV.GetPy(), kfp_ele_PV.GetPz(), o2::constants::physics::MassElectron); - ROOT::Math::PxPyPzMVector v0_pv = vpos_pv + vele_pv; + // ROOT::Math::PxPyPzMVector vpos_pv(kfp_pos_PV.GetPx(), kfp_pos_PV.GetPy(), kfp_pos_PV.GetPz(), o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector vele_pv(kfp_ele_PV.GetPx(), kfp_ele_PV.GetPy(), kfp_ele_PV.GetPz(), o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v0_pv = vpos_pv + vele_pv; ROOT::Math::PxPyPzMVector vpos_sv(kfp_pos_DecayVtx.GetPx(), kfp_pos_DecayVtx.GetPy(), kfp_pos_DecayVtx.GetPz(), o2::constants::physics::MassElectron); ROOT::Math::PxPyPzMVector vele_sv(kfp_ele_DecayVtx.GetPx(), kfp_ele_DecayVtx.GetPy(), kfp_ele_DecayVtx.GetPz(), o2::constants::physics::MassElectron); ROOT::Math::PxPyPzMVector v0_sv = vpos_sv + vele_sv; - registry.fill(HIST("V0/hMee_SVPV"), v0_pv.M(), v0_sv.M()); + // registry.fill(HIST("V0/hMee_SVPV"), v0_pv.M(), v0_sv.M()); registry.fill(HIST("V0/hMeeSV_Rxy"), rxy, v0_sv.M()); - registry.fill(HIST("V0/hMeePV_Rxy"), rxy, v0_pv.M()); + // registry.fill(HIST("V0/hMeePV_Rxy"), rxy, v0_pv.M()); v0photonskf(collision.globalIndex(), v0legs.lastIndex() + 1, v0legs.lastIndex() + 2, gammaKF_DecayVtx.GetX(), gammaKF_DecayVtx.GetY(), gammaKF_DecayVtx.GetZ(), gammaKF_DecayVtx.GetPx(), gammaKF_DecayVtx.GetPy(), gammaKF_DecayVtx.GetPz(), - v0_sv.M(), v0_pv.M(), dca_xy_v0_to_pv, dca_z_v0_to_pv, + v0_sv.M(), dca_xy_v0_to_pv, dca_z_v0_to_pv, cospa_kf, pca_kf, alpha, qt, chi2kf); fFuncTableV0Recalculated(xyz[0], xyz[1], xyz[2]); diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx index 51272b839a6..1ad9a8be8bb 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx @@ -294,9 +294,9 @@ struct skimmerGammaConversion { // LOGF(info, "ele px = %f (original) , %f (KF at init) , %f (KF at PV) , %f (KF at SV)", ele.px(), kfp_ele.GetPx(), kfp_ele_PV.GetPx(), kfp_ele_DecayVtx.GetPx()); // LOGF(info, "pos px = %f (original) , %f (KF at init) , %f (KF at PV) , %f (KF at SV)", pos.px(), kfp_pos.GetPx(), kfp_pos_PV.GetPx(), kfp_pos_DecayVtx.GetPx()); - ROOT::Math::PxPyPzMVector vpos_pv(kfp_pos_PV.GetPx(), kfp_pos_PV.GetPy(), kfp_pos_PV.GetPz(), o2::constants::physics::MassElectron); - ROOT::Math::PxPyPzMVector vele_pv(kfp_ele_PV.GetPx(), kfp_ele_PV.GetPy(), kfp_ele_PV.GetPz(), o2::constants::physics::MassElectron); - ROOT::Math::PxPyPzMVector v0_pv = vpos_pv + vele_pv; + // ROOT::Math::PxPyPzMVector vpos_pv(kfp_pos_PV.GetPx(), kfp_pos_PV.GetPy(), kfp_pos_PV.GetPz(), o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector vele_pv(kfp_ele_PV.GetPx(), kfp_ele_PV.GetPy(), kfp_ele_PV.GetPz(), o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v0_pv = vpos_pv + vele_pv; ROOT::Math::PxPyPzMVector vpos_sv(kfp_pos_DecayVtx.GetPx(), kfp_pos_DecayVtx.GetPy(), kfp_pos_DecayVtx.GetPz(), o2::constants::physics::MassElectron); ROOT::Math::PxPyPzMVector vele_sv(kfp_ele_DecayVtx.GetPx(), kfp_ele_DecayVtx.GetPy(), kfp_ele_DecayVtx.GetPz(), o2::constants::physics::MassElectron); @@ -325,7 +325,7 @@ struct skimmerGammaConversion { v0photonskf(collision.globalIndex(), v0legs.lastIndex() + 1, v0legs.lastIndex() + 2, gammaKF_DecayVtx.GetX(), gammaKF_DecayVtx.GetY(), gammaKF_DecayVtx.GetZ(), gammaKF_DecayVtx.GetPx(), gammaKF_DecayVtx.GetPy(), gammaKF_DecayVtx.GetPz(), - v0_sv.M(), v0_pv.M(), dca_xy_v0_to_pv, dca_z_v0_to_pv, + v0_sv.M(), dca_xy_v0_to_pv, dca_z_v0_to_pv, cospa_kf, pca_kf, alpha, qt, chi2kf); fillTrackTable(pos, kfp_pos_DecayVtx); diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryMuon.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryMuon.cxx index edef3f4f4be..1930b5f713c 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryMuon.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryMuon.cxx @@ -73,8 +73,8 @@ struct skimmerPrimaryMuon { {"hNpairs", "hNpairs;pair type;Number of Pairs", {HistType::kTH1F, {{3, -1.5f, +1.5f}}}}, {"Track/hTPCdEdx_Pin_before", "TPC dE/dx vs. p_{in};p_{in} (GeV/c);TPC dE/dx", {HistType::kTH2F, {{1000, 0.f, 1.f}, {200, 0.f, 200.f}}}}, {"Track/hTPCdEdx_Pin_after", "TPC dE/dx vs. p_{in};p_{in} (GeV/c);TPC dE/dx", {HistType::kTH2F, {{1000, 0.f, 1.f}, {200, 0.f, 200.f}}}}, - {"Track/hTOFbeta_Pin_before", "TOF beta vs. p_{in};p_{in} (GeV/c);TOF #beta", {HistType::kTH2F, {{1000, 0.f, 1.f}, {240, 0.6f, 1.2f}}}}, - {"Track/hTOFbeta_Pin_after", "TOF beta vs. p_{in};p_{in} (GeV/c);TOF #beta", {HistType::kTH2F, {{1000, 0.f, 1.f}, {240, 0.6f, 1.2f}}}}, + {"Track/hTOFbeta_Pin_before", "TOF beta vs. p_{in};p_{in} (GeV/c);TOF #beta", {HistType::kTH2F, {{1000, 0.f, 1.f}, {250, 0.6f, 1.1f}}}}, + {"Track/hTOFbeta_Pin_after", "TOF beta vs. p_{in};p_{in} (GeV/c);TOF #beta", {HistType::kTH2F, {{1000, 0.f, 1.f}, {250, 0.6f, 1.1f}}}}, {"Track/hTPCNsigmaEl_before", "TPC n sigma e vs. p_{in};p_{in} (GeV/c);n #sigma_{e}^{TPC}", {HistType::kTH2F, {{1000, 0.f, 1.f}, {100, -5.f, +5.f}}}}, {"Track/hTOFNsigmaEl_before", "TOF n sigma e vs. p_{in};p_{in} (GeV/c);n #sigma_{e}^{TOF}", {HistType::kTH2F, {{1000, 0.f, 1.f}, {100, -5.f, +5.f}}}}, {"Track/hTPCNsigmaMu_before", "TPC n sigma #mu vs. p_{in};p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", {HistType::kTH2F, {{1000, 0.f, 1.f}, {100, -5.f, +5.f}}}}, @@ -89,12 +89,17 @@ struct skimmerPrimaryMuon { {"Track/hTOFNsigmaPi_after", "TOF n sigma #pi vs. p_{in};p_{in} (GeV/c);n #sigma_{#pi}^{TOF}", {HistType::kTH2F, {{1000, 0.f, 1.f}, {100, -5.f, +5.f}}}}, {"Pair/hMmumuPtmumu", "ULS m_{#mu#mu} vs. p_{T,#mu#mu};m_{#mu#mu} (GeV/c^{2});p_{T,#mu#mu} (GeV/c)", {HistType::kTH2F, {{100, 0.2f, 1.2f}, {120, 0.f, 1.2f}}}}, // for MC primary muon + {"MC/Primary/hP_Pin", "p vs. p_{in};p (GeV/c);p_{in} (GeV/c)", {HistType::kTH2F, {{1000, 0.f, 1.f}, {1000, 0.f, 1.f}}}}, + {"MC/Primary/hRelDiffP", "p vs. rel diff p;p (GeV/c);(p_{in} - p)/p", {HistType::kTH2F, {{1000, 0.f, 1.f}, {200, -1.f, 1.f}}}}, + {"MC/Primary/hTPCdEdx_Pin", "TPC dE/dx vs. p_{in};p_{in} (GeV/c);TPC dE/dx", {HistType::kTH2F, {{1000, 0.f, 1.f}, {200, 0.f, 200.f}}}}, + {"MC/Primary/hTOFbeta_Pin", "TOF beta vs. p_{in};p_{in} (GeV/c);TOF #beta", {HistType::kTH2F, {{1000, 0.f, 1.f}, {250, 0.6f, 1.1f}}}}, {"MC/Primary/hNclsITS", "Ncls ITS;N_{cls}^{ITS}", {HistType::kTH1F, {{8, -0.5f, +7.5f}}}}, {"MC/Primary/hChi2ITS", "chi2 ITS;#chi^{2}/N_{cls}^{ITS}", {HistType::kTH1F, {{100, 0.f, 10.f}}}}, {"MC/Primary/hNclsTPC", "Ncls TPC;N_{cls}^{TPC}", {HistType::kTH1F, {{161, -0.5f, +160.5f}}}}, {"MC/Primary/hNcrTPC", "Ncr TPC;N_{cr}^{TPC}", {HistType::kTH1F, {{161, -0.5f, +160.5f}}}}, {"MC/Primary/hNfTPC", "Nfindable TPC;N_{f}^{TPC}", {HistType::kTH1F, {{161, -0.5f, +160.5f}}}}, {"MC/Primary/hChi2TPC", "chi2 TPC;#chi^{2}/N_{cls}^{TPC}", {HistType::kTH1F, {{100, 0.f, 10.f}}}}, + {"MC/Primary/hChi2TPC_NclsTPC", "chi2 TPC;N_{cls}^{TPC};#chi^{2}/N_{cls}^{TPC}", {HistType::kTH2F, {{161, -0.5, 160.5}, {100, 0.f, 10.f}}}}, {"MC/Primary/hDCAxy_NclsTPC", "DCA xy vs. N_{cls}^{TPC};DCA_{xy} (cm);N_{cls}^{TPC}", {HistType::kTH2F, {{200, -1.f, +1.f}, {161, -0.5f, +160.5f}}}}, {"MC/Primary/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", {HistType::kTH2F, {{200, -1.f, +1.f}, {200, -1.f, +1.f}}}}, {"MC/Primary/hDCA3D", "DCA;DCA_{3D} (cm)", {HistType::kTH1F, {{100, 0.f, +1.f}}}}, @@ -102,13 +107,19 @@ struct skimmerPrimaryMuon { {"MC/Primary/hDCAz_resolution", "DCA z resolution;DCA_{z} resolution (cm)", {HistType::kTH1F, {{100, 0.f, +0.1f}}}}, {"MC/Primary/hDCAxyz_sigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", {HistType::kTH2F, {{200, -10.f, +10.f}, {200, -10.f, +10.f}}}}, {"MC/Primary/hDCA3D_sigma", "DCA;DCA_{3D} (#sigma)", {HistType::kTH1F, {{100, 0.f, +10.f}}}}, + {"MC/Primary/hProdVtx", "#mu production vtx;X_{MC} (cm);Y_{MC} (cm)", {HistType::kTH2F, {{200, -100.f, +100.f}, {200, -100.f, +100.f}}}}, // for MC seconday muon + {"MC/Secondary/hP_Pin", "p vs. p_{in};p (GeV/c);p_{in} (GeV/c)", {HistType::kTH2F, {{1000, 0.f, 1.f}, {1000, 0.f, 1.f}}}}, + {"MC/Secondary/hRelDiffP", "p vs. rel diff p;p (GeV/c);(p_{in} - p)/p", {HistType::kTH2F, {{1000, 0.f, 1.f}, {200, -1.f, 1.f}}}}, + {"MC/Secondary/hTPCdEdx_Pin", "TPC dE/dx vs. p_{in};p_{in} (GeV/c);TPC dE/dx", {HistType::kTH2F, {{1000, 0.f, 1.f}, {200, 0.f, 200.f}}}}, + {"MC/Secondary/hTOFbeta_Pin", "TOF beta vs. p_{in};p_{in} (GeV/c);TOF #beta", {HistType::kTH2F, {{1000, 0.f, 1.f}, {250, 0.6f, 1.1f}}}}, {"MC/Secondary/hNclsITS", "Ncls ITS;N_{cls}^{ITS}", {HistType::kTH1F, {{8, -0.5f, +7.5f}}}}, {"MC/Secondary/hChi2ITS", "chi2 ITS;#chi^{2}/N_{cls}^{ITS}", {HistType::kTH1F, {{100, 0.f, 10.f}}}}, {"MC/Secondary/hNclsTPC", "Ncls TPC;N_{cls}^{TPC}", {HistType::kTH1F, {{161, -0.5f, +160.5f}}}}, {"MC/Secondary/hNcrTPC", "Ncr TPC;N_{cr}^{TPC}", {HistType::kTH1F, {{161, -0.5f, +160.5f}}}}, {"MC/Secondary/hNfTPC", "Nfindable TPC;N_{f}^{TPC}", {HistType::kTH1F, {{161, -0.5f, +160.5f}}}}, {"MC/Secondary/hChi2TPC", "chi2 TPC;#chi^{2}/N_{cls}^{TPC}", {HistType::kTH1F, {{100, 0.f, 10.f}}}}, + {"MC/Secondary/hChi2TPC_NclsTPC", "chi2 TPC;N_{cls}^{TPC};#chi^{2}/N_{cls}^{TPC}", {HistType::kTH2F, {{161, -0.5, 160.5}, {100, 0.f, 10.f}}}}, {"MC/Secondary/hDCAxy_NclsTPC", "DCA xy vs. N_{cls}^{TPC};DCA_{xy} (cm);N_{cls}^{TPC}", {HistType::kTH2F, {{200, -1.f, +1.f}, {161, -0.5f, +160.5f}}}}, {"MC/Secondary/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", {HistType::kTH2F, {{200, -1.f, +1.f}, {200, -1.f, +1.f}}}}, {"MC/Secondary/hDCA3D", "DCA;DCA_{3D} (cm)", {HistType::kTH1F, {{100, 0.f, +1.f}}}}, @@ -116,6 +127,7 @@ struct skimmerPrimaryMuon { {"MC/Secondary/hDCAz_resolution", "DCA z resolution;DCA_{z} resolution (cm)", {HistType::kTH1F, {{100, 0.f, +0.1f}}}}, {"MC/Secondary/hDCAxyz_sigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", {HistType::kTH2F, {{200, -10.f, +10.f}, {200, -10.f, +10.f}}}}, {"MC/Secondary/hDCA3D_sigma", "DCA;DCA_{3D} (#sigma)", {HistType::kTH1F, {{100, 0.f, +10.f}}}}, + {"MC/Secondary/hProdVtx", "#mu production vtx;X_{MC} (cm);Y_{MC} (cm)", {HistType::kTH2F, {{200, -100.f, +100.f}, {200, -100.f, +100.f}}}}, }, }; @@ -204,12 +216,17 @@ struct skimmerPrimaryMuon { if (abs(mctrack.pdgCode()) == 13 && mctrack.has_mothers()) { auto mp = mctrack.template mothers_first_as(); if (abs(mp.pdgCode()) == 221 || abs(mp.pdgCode()) == 223 || abs(mp.pdgCode()) == 333 || abs(mp.pdgCode()) == 113 || abs(mp.pdgCode()) == 331) { + fRegistry.fill(HIST("MC/Primary/hP_Pin"), track.p(), track.tpcInnerParam()); + fRegistry.fill(HIST("MC/Primary/hRelDiffP"), track.p(), (track.tpcInnerParam() - track.p()) / track.p()); + fRegistry.fill(HIST("MC/Primary/hTPCdEdx_Pin"), track.tpcInnerParam(), track.tpcSignal()); + fRegistry.fill(HIST("MC/Primary/hTOFbeta_Pin"), track.tpcInnerParam(), track.beta()); fRegistry.fill(HIST("MC/Primary/hNclsITS"), track.itsNCls()); fRegistry.fill(HIST("MC/Primary/hChi2ITS"), track.itsChi2NCl()); fRegistry.fill(HIST("MC/Primary/hNcrTPC"), track.tpcNClsCrossedRows()); fRegistry.fill(HIST("MC/Primary/hNclsTPC"), track.tpcNClsFound()); fRegistry.fill(HIST("MC/Primary/hNfTPC"), track.tpcNClsFindable()); fRegistry.fill(HIST("MC/Primary/hChi2TPC"), track.tpcChi2NCl()); + fRegistry.fill(HIST("MC/Primary/hChi2TPC_NclsTPC"), track.tpcNClsFound(), track.tpcChi2NCl()); fRegistry.fill(HIST("MC/Primary/hDCAxy_NclsTPC"), track.dcaXY(), track.tpcNClsFound()); fRegistry.fill(HIST("MC/Primary/hDCAxyz"), track.dcaXY(), track.dcaZ()); fRegistry.fill(HIST("MC/Primary/hDCA3D"), sqrt(pow(track.dcaXY(), 2) + pow(track.dcaZ(), 2))); @@ -217,13 +234,19 @@ struct skimmerPrimaryMuon { fRegistry.fill(HIST("MC/Primary/hDCAz_resolution"), sqrt(track.cZZ())); fRegistry.fill(HIST("MC/Primary/hDCAxyz_sigma"), track.dcaXY() / sqrt(track.cYY()), track.dcaZ() / sqrt(track.cZZ())); fRegistry.fill(HIST("MC/Primary/hDCA3D_sigma"), sqrt(pow(track.dcaXY() / sqrt(track.cYY()), 2) + pow(track.dcaZ() / sqrt(track.cZZ()), 2))); + fRegistry.fill(HIST("MC/Primary/hProdVtx"), mctrack.vx(), mctrack.vy()); } else if (abs(mp.pdgCode()) == 211 || abs(mp.pdgCode()) == 321) { + fRegistry.fill(HIST("MC/Secondary/hP_Pin"), track.p(), track.tpcInnerParam()); + fRegistry.fill(HIST("MC/Secondary/hRelDiffP"), track.p(), (track.tpcInnerParam() - track.p()) / track.p()); + fRegistry.fill(HIST("MC/Secondary/hTPCdEdx_Pin"), track.tpcInnerParam(), track.tpcSignal()); + fRegistry.fill(HIST("MC/Secondary/hTOFbeta_Pin"), track.tpcInnerParam(), track.beta()); fRegistry.fill(HIST("MC/Secondary/hNclsITS"), track.itsNCls()); fRegistry.fill(HIST("MC/Secondary/hChi2ITS"), track.itsChi2NCl()); fRegistry.fill(HIST("MC/Secondary/hNcrTPC"), track.tpcNClsCrossedRows()); fRegistry.fill(HIST("MC/Secondary/hNclsTPC"), track.tpcNClsFound()); fRegistry.fill(HIST("MC/Secondary/hNfTPC"), track.tpcNClsFindable()); fRegistry.fill(HIST("MC/Secondary/hChi2TPC"), track.tpcChi2NCl()); + fRegistry.fill(HIST("MC/Secondary/hChi2TPC_NclsTPC"), track.tpcNClsFound(), track.tpcChi2NCl()); fRegistry.fill(HIST("MC/Secondary/hDCAxy_NclsTPC"), track.dcaXY(), track.tpcNClsFound()); fRegistry.fill(HIST("MC/Secondary/hDCAxyz"), track.dcaXY(), track.dcaZ()); fRegistry.fill(HIST("MC/Secondary/hDCA3D"), sqrt(pow(track.dcaXY(), 2) + pow(track.dcaZ(), 2))); @@ -231,6 +254,7 @@ struct skimmerPrimaryMuon { fRegistry.fill(HIST("MC/Secondary/hDCAz_resolution"), sqrt(track.cZZ())); fRegistry.fill(HIST("MC/Secondary/hDCAxyz_sigma"), track.dcaXY() / sqrt(track.cYY()), track.dcaZ() / sqrt(track.cZZ())); fRegistry.fill(HIST("MC/Secondary/hDCA3D_sigma"), sqrt(pow(track.dcaXY() / sqrt(track.cYY()), 2) + pow(track.dcaZ() / sqrt(track.cZZ()), 2))); + fRegistry.fill(HIST("MC/Secondary/hProdVtx"), mctrack.vx(), mctrack.vy()); } } } diff --git a/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx b/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx index fc3b36d835a..0d1cf34a0c4 100644 --- a/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx +++ b/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx @@ -43,7 +43,7 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::photonpair; -using MyCollisions = soa::Join; +using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; using MyV0Photons = soa::Join; @@ -223,7 +223,7 @@ struct MaterialBudget { continue; } - auto photons_coll = photons.sliceBy(perCollision, collision.collisionId()); + auto photons_coll = photons.sliceBy(perCollision, collision.globalIndex()); for (auto& cut : cuts) { for (auto& photon : photons_coll) { @@ -272,8 +272,8 @@ struct MaterialBudget { o2::aod::emphotonhistograms::FillHistClass(list_ev_pair, "", collision); - auto photons1_coll = photons1.sliceBy(perCollision1, collision.collisionId()); - auto photons2_coll = photons2.sliceBy(perCollision2, collision.collisionId()); + auto photons1_coll = photons1.sliceBy(perCollision1, collision.globalIndex()); + auto photons2_coll = photons2.sliceBy(perCollision2, collision.globalIndex()); double value[9] = {0.f}; float phi_cp1 = 0.f, eta_cp1 = 0.f; @@ -337,11 +337,11 @@ struct MaterialBudget { // LOGF(info, "Number of collisions after filtering: %d", collisions.size()); for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, ndepth, -1, collisions, collisions)) { // internally, CombinationsStrictlyUpperIndexPolicy(collisions, collisions) is called. - // LOGF(info, "Mixed event collisionId: (%d, %d) , ngpcm: (%d, %d), ngphos: (%d, %d), ngemc: (%d, %d)", - // collision1.collisionId(), collision2.collisionId(), collision1.ngpcm(), collision2.ngpcm(), collision1.ngphos(), collision2.ngphos(), collision1.ngemc(), collision2.ngemc()); + // LOGF(info, "Mixed event globalIndex: (%d, %d) , ngpcm: (%d, %d), ngphos: (%d, %d), ngemc: (%d, %d)", + // collision1.globalIndex(), collision2.globalIndex(), collision1.ngpcm(), collision2.ngpcm(), collision1.ngphos(), collision2.ngphos(), collision1.ngemc(), collision2.ngemc()); - auto photons_coll1 = photons1.sliceBy(perCollision1, collision1.collisionId()); - auto photons_coll2 = photons2.sliceBy(perCollision2, collision2.collisionId()); + auto photons_coll1 = photons1.sliceBy(perCollision1, collision1.globalIndex()); + auto photons_coll2 = photons2.sliceBy(perCollision2, collision2.globalIndex()); // LOGF(info, "collision1: posZ = %f, numContrib = %d , sel8 = %d | collision2: posZ = %f, numContrib = %d , sel8 = %d", // collision1.posZ(), collision1.numContrib(), collision1.sel8(), collision2.posZ(), collision2.numContrib(), collision2.sel8()); @@ -361,7 +361,7 @@ struct MaterialBudget { if (!IsSelectedPair(g1, g2, cut1, cut2)) { continue; } - // LOGF(info, "Mixed event photon pair: (%d, %d) from events (%d, %d), photon event: (%d, %d)", g1.index(), g2.index(), collision1.index(), collision2.index(), g1.collisionId(), g2.collisionId()); + // LOGF(info, "Mixed event photon pair: (%d, %d) from events (%d, %d), photon event: (%d, %d)", g1.index(), g2.index(), collision1.index(), collision2.index(), g1.globalIndex(), g2.globalIndex()); for (auto& paircut : paircuts) { diff --git a/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx b/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx index e00e2b6a655..50f50a861d1 100644 --- a/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx @@ -230,7 +230,7 @@ struct MaterialBudgetMC { continue; } - auto photons_coll = photons.sliceBy(perCollision, collision.collisionId()); + auto photons_coll = photons.sliceBy(perCollision, collision.globalIndex()); for (auto& cut : cuts) { for (auto& photon : photons_coll) { @@ -298,8 +298,8 @@ struct MaterialBudgetMC { o2::aod::emphotonhistograms::FillHistClass(list_ev_pair, "", collision); - auto photons1_coll = photons1.sliceBy(perCollision1, collision.collisionId()); - auto photons2_coll = photons2.sliceBy(perCollision2, collision.collisionId()); + auto photons1_coll = photons1.sliceBy(perCollision1, collision.globalIndex()); + auto photons2_coll = photons2.sliceBy(perCollision2, collision.globalIndex()); double value[9] = {0.f}; float phi_cp1 = 0.f, eta_cp1 = 0.f; diff --git a/PWGEM/PhotonMeson/Tasks/PhotonHBT.cxx b/PWGEM/PhotonMeson/Tasks/PhotonHBT.cxx index 5fb510613e5..05ea3174187 100644 --- a/PWGEM/PhotonMeson/Tasks/PhotonHBT.cxx +++ b/PWGEM/PhotonMeson/Tasks/PhotonHBT.cxx @@ -241,8 +241,8 @@ struct PhotonHBT { reinterpret_cast(fMainList->FindObject("Event")->FindObject(pairnames[pairtype].data())->FindObject("hCollisionCounter"))->Fill(4.0); // |Zvtx| < 10 cm o2::aod::emphotonhistograms::FillHistClass(list_ev_pair, "", collision); - auto photons1_coll = photons1.sliceBy(perCollision1, collision.collisionId()); - auto photons2_coll = photons2.sliceBy(perCollision2, collision.collisionId()); + auto photons1_coll = photons1.sliceBy(perCollision1, collision.globalIndex()); + auto photons2_coll = photons2.sliceBy(perCollision2, collision.globalIndex()); if constexpr (pairtype == PairType::kPCMPCM || pairtype == PairType::kPHOSPHOS || pairtype == PairType::kEMCEMC) { for (auto& cut : cuts1) { @@ -324,11 +324,11 @@ struct PhotonHBT { THashList* list_pair_ss = static_cast(fMainList->FindObject("Pair")->FindObject(pairnames[pairtype].data())); // LOGF(info, "Number of collisions after filtering: %d", collisions.size()); for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, ndepth, -1, collisions, collisions)) { // internally, CombinationsStrictlyUpperIndexPolicy(collisions, collisions) is called. - // LOGF(info, "Mixed event collisionId: (%d, %d) , counter = %d, ngpcm: (%d, %d), ngphos: (%d, %d), ngemc: (%d, %d)", - // collision1.collisionId(), collision2.collisionId(), nev, collision1.ngpcm(), collision2.ngpcm(), collision1.ngphos(), collision2.ngphos(), collision1.ngemc(), collision2.ngemc()); + // LOGF(info, "Mixed event globalIndex: (%d, %d) , counter = %d, ngpcm: (%d, %d), ngphos: (%d, %d), ngemc: (%d, %d)", + // collision1.globalIndex(), collision2.globalIndex(), nev, collision1.ngpcm(), collision2.ngpcm(), collision1.ngphos(), collision2.ngphos(), collision1.ngemc(), collision2.ngemc()); - auto photons_coll1 = photons1.sliceBy(perCollision1, collision1.collisionId()); - auto photons_coll2 = photons2.sliceBy(perCollision2, collision2.collisionId()); + auto photons_coll1 = photons1.sliceBy(perCollision1, collision1.globalIndex()); + auto photons_coll2 = photons2.sliceBy(perCollision2, collision2.globalIndex()); // LOGF(info, "collision1: posZ = %f, numContrib = %d , sel8 = %d | collision2: posZ = %f, numContrib = %d , sel8 = %d", // collision1.posZ(), collision1.numContrib(), collision1.sel8(), collision2.posZ(), collision2.numContrib(), collision2.sel8()); @@ -336,7 +336,7 @@ struct PhotonHBT { for (auto& cut2 : cuts2) { for (auto& paircut : paircuts) { for (auto& [g1, g2] : combinations(soa::CombinationsFullIndexPolicy(photons_coll1, photons_coll2))) { - // LOGF(info, "Mixed event photon pair: (%d, %d) from events (%d, %d), photon event: (%d, %d)", g1.index(), g2.index(), collision1.index(), collision2.index(), g1.collisionId(), g2.collisionId()); + // LOGF(info, "Mixed event photon pair: (%d, %d) from events (%d, %d), photon event: (%d, %d)", g1.index(), g2.index(), collision1.index(), collision2.index(), g1.globalIndex(), g2.globalIndex()); if ((pairtype == PairType::kPCMPCM || pairtype == PairType::kPHOSPHOS || pairtype == PairType::kEMCEMC) && (TString(cut1.GetName()) != TString(cut2.GetName()))) { continue; diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGamma.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGamma.cxx index faf20554f33..bf6a17708bf 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGamma.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGamma.cxx @@ -513,8 +513,8 @@ struct Pi0EtaToGammaGamma { // LOGF(info, "Number of collisions after filtering: %d", collisions.size()); for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, ndepth, -1, collisions, collisions)) { // internally, CombinationsStrictlyUpperIndexPolicy(collisions, collisions) is called. - // LOGF(info, "Mixed event collisionId: (%d, %d) , ngpcm: (%d, %d), ngphos: (%d, %d), ngemc: (%d, %d)", - // collision1.collisionId(), collision2.collisionId(), collision1.ngpcm(), collision2.ngpcm(), collision1.ngphos(), collision2.ngphos(), collision1.ngemc(), collision2.ngemc()); + // LOGF(info, "Mixed event globalIndex: (%d, %d) , ngpcm: (%d, %d), ngphos: (%d, %d), ngemc: (%d, %d)", + // collision1.globalIndex(), collision2.globalIndex(), collision1.ngpcm(), collision2.ngpcm(), collision1.ngphos(), collision2.ngphos(), collision1.ngemc(), collision2.ngemc()); auto photons_coll1 = photons1.sliceBy(perCollision1, collision1.globalIndex()); auto photons_coll2 = photons2.sliceBy(perCollision2, collision2.globalIndex()); @@ -525,7 +525,7 @@ struct Pi0EtaToGammaGamma { for (auto& cut2 : cuts2) { for (auto& paircut : paircuts) { for (auto& [g1, g2] : combinations(soa::CombinationsFullIndexPolicy(photons_coll1, photons_coll2))) { - // LOGF(info, "Mixed event photon pair: (%d, %d) from events (%d, %d), photon event: (%d, %d)", g1.index(), g2.index(), collision1.index(), collision2.index(), g1.collisionId(), g2.collisionId()); + // LOGF(info, "Mixed event photon pair: (%d, %d) from events (%d, %d), photon event: (%d, %d)", g1.index(), g2.index(), collision1.index(), collision2.index(), g1.globalIndex(), g2.globalIndex()); if ((pairtype == PairType::kPCMPCM || pairtype == PairType::kPHOSPHOS || pairtype == PairType::kEMCEMC) && (TString(cut1.GetName()) != TString(cut2.GetName()))) { continue; diff --git a/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx b/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx index a411c4c1dc0..fc22b3a3283 100644 --- a/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx +++ b/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx @@ -256,8 +256,8 @@ struct TagAndProbe { reinterpret_cast(list_ev_pair->FindObject("hCollisionCounter"))->Fill(4.0); // |Zvtx| < 10 cm o2::aod::emphotonhistograms::FillHistClass(list_ev_pair, "", collision); - auto photons1_coll = photons1.sliceBy(perCollision1, collision.collisionId()); - auto photons2_coll = photons2.sliceBy(perCollision2, collision.collisionId()); + auto photons1_coll = photons1.sliceBy(perCollision1, collision.globalIndex()); + auto photons2_coll = photons2.sliceBy(perCollision2, collision.globalIndex()); for (auto& g1 : photons1_coll) { @@ -334,11 +334,11 @@ struct TagAndProbe { // LOGF(info, "Number of collisions after filtering: %d", collisions.size()); for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, ndepth, -1, collisions, collisions)) { // internally, CombinationsStrictlyUpperIndexPolicy(collisions, collisions) is called. - // LOGF(info, "Mixed event collisionId: (%d, %d) , ngpcm: (%d, %d), ngphos: (%d, %d), ngemc: (%d, %d)", - // collision1.collisionId(), collision2.collisionId(), collision1.ngpcm(), collision2.ngpcm(), collision1.ngphos(), collision2.ngphos(), collision1.ngemc(), collision2.ngemc()); + // LOGF(info, "Mixed event globalIndex: (%d, %d) , ngpcm: (%d, %d), ngphos: (%d, %d), ngemc: (%d, %d)", + // collision1.globalIndex(), collision2.globalIndex(), collision1.ngpcm(), collision2.ngpcm(), collision1.ngphos(), collision2.ngphos(), collision1.ngemc(), collision2.ngemc()); - auto photons_coll1 = photons1.sliceBy(perCollision1, collision1.collisionId()); - auto photons_coll2 = photons2.sliceBy(perCollision2, collision2.collisionId()); + auto photons_coll1 = photons1.sliceBy(perCollision1, collision1.globalIndex()); + auto photons_coll2 = photons2.sliceBy(perCollision2, collision2.globalIndex()); // LOGF(info, "collision1: posZ = %f, numContrib = %d , sel8 = %d | collision2: posZ = %f, numContrib = %d , sel8 = %d", // collision1.posZ(), collision1.numContrib(), collision1.sel8(), collision2.posZ(), collision2.numContrib(), collision2.sel8()); @@ -357,7 +357,7 @@ struct TagAndProbe { } } for (auto& g2 : photons_coll2) { - // LOGF(info, "Mixed event photon pair: (%d, %d) from events (%d, %d), photon event: (%d, %d)", g1.index(), g2.index(), collision1.index(), collision2.index(), g1.collisionId(), g2.collisionId()); + // LOGF(info, "Mixed event photon pair: (%d, %d) from events (%d, %d), photon event: (%d, %d)", g1.index(), g2.index(), collision1.index(), collision2.index(), g1.globalIndex(), g2.globalIndex()); for (auto& paircut : paircuts) { if (!paircut.IsSelected(g1, g2)) { diff --git a/PWGEM/PhotonMeson/Tasks/TaggingPi0.cxx b/PWGEM/PhotonMeson/Tasks/TaggingPi0.cxx index 6646f303633..ad7ed63220d 100644 --- a/PWGEM/PhotonMeson/Tasks/TaggingPi0.cxx +++ b/PWGEM/PhotonMeson/Tasks/TaggingPi0.cxx @@ -401,8 +401,8 @@ struct TaggingPi0 { // LOGF(info, "Number of collisions after filtering: %d", collisions.size()); for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, ndepth, -1, collisions, collisions)) { // internally, CombinationsStrictlyUpperIndexPolicy(collisions, collisions) is called. - // LOGF(info, "Mixed event collisionId: (%d, %d) , counter = %d, ngpcm: (%d, %d), ngphos: (%d, %d), ngemc: (%d, %d)", - // collision1.collisionId(), collision2.collisionId(), nev, collision1.ngpcm(), collision2.ngpcm(), collision1.ngphos(), collision2.ngphos(), collision1.ngemc(), collision2.ngemc()); + // LOGF(info, "Mixed event globalIndex: (%d, %d) , counter = %d, ngpcm: (%d, %d), ngphos: (%d, %d), ngemc: (%d, %d)", + // collision1.globalIndex(), collision2.globalIndex(), nev, collision1.ngpcm(), collision2.ngpcm(), collision1.ngphos(), collision2.ngphos(), collision1.ngemc(), collision2.ngemc()); auto photons_coll1 = photons1.sliceBy(perCollision1, collision1.globalIndex()); auto photons_coll2 = photons2.sliceBy(perCollision2, collision2.globalIndex()); @@ -413,7 +413,7 @@ struct TaggingPi0 { for (auto& cut2 : cuts2) { for (auto& paircut : paircuts) { for (auto& [g1, g2] : combinations(soa::CombinationsFullIndexPolicy(photons_coll1, photons_coll2))) { - // LOGF(info, "Mixed event photon pair: (%d, %d) from events (%d, %d), photon event: (%d, %d)", g1.index(), g2.index(), collision1.index(), collision2.index(), g1.collisionId(), g2.collisionId()); + // LOGF(info, "Mixed event photon pair: (%d, %d) from events (%d, %d), photon event: (%d, %d)", g1.index(), g2.index(), collision1.index(), collision2.index(), g1.globalIndex(), g2.globalIndex()); if ((pairtype == PairType::kPCMPCM || pairtype == PairType::kPHOSPHOS || pairtype == PairType::kEMCEMC) && (TString(cut1.GetName()) != TString(cut2.GetName()))) { continue; diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx index 368f4a7b178..f247032e60f 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx @@ -224,7 +224,7 @@ struct DalitzEEQC { Configurable ndepth{"ndepth", 10, "depth for event mixing"}; 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"}; - ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 7.0f, 80.0f, 90.0f, 100.0f, 999.f}, "Mixing bins - centrality"}; + ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 999.f}, "Mixing bins - centrality"}; using BinningType = ColumnBinningPolicy; BinningType colBinning{{ConfVtxBins, ConfCentBins}, true}; Filter collisionFilter_common = nabs(o2::aod::collision::posZ) < 10.f && o2::aod::collision::numContrib > (uint16_t)0 && o2::aod::evsel::sel8 == true; diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx index 77efd467b2d..9b329e827f1 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx @@ -86,7 +86,7 @@ struct DalitzEEQCMC { for (auto& cut : fDalitzEECuts) { std::string_view cutname = cut.GetName(); THashList* list = reinterpret_cast(fMainList->FindObject("Track")->FindObject(cutname.data())); - o2::aod::emphotonhistograms::DefineHistograms(list, "Track"); + o2::aod::emphotonhistograms::DefineHistograms(list, "Track", "mc"); } // for DalitzEEs @@ -207,6 +207,10 @@ struct DalitzEEQCMC { if (std::find(used_trackIds.begin(), used_trackIds.end(), track.globalIndex()) == used_trackIds.end()) { o2::aod::emphotonhistograms::FillHistClass(list_track_cut, "", track); used_trackIds.emplace_back(track.globalIndex()); + auto mctrack = track.template emmcparticle_as(); + reinterpret_cast(fMainList->FindObject("Track")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaPtOverPtGen"))->Fill(mctrack.pt(), (track.pt() - mctrack.pt()) / mctrack.pt()); + reinterpret_cast(fMainList->FindObject("Track")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaEta"))->Fill(mctrack.pt(), track.eta() - mctrack.eta()); + reinterpret_cast(fMainList->FindObject("Track")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaPhi"))->Fill(mctrack.pt(), track.phi() - mctrack.phi()); } } } // end of LF diff --git a/PWGEM/PhotonMeson/Tasks/dalitzMuMuQC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzMuMuQC.cxx index e0e4205b193..30ba51e986d 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzMuMuQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzMuMuQC.cxx @@ -224,7 +224,7 @@ struct DalitzMuMuQC { Configurable ndepth{"ndepth", 10, "depth for event mixing"}; 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"}; - ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 7.0f, 80.0f, 90.0f, 100.0f, 999.f}, "Mixing bins - centrality"}; + ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 999.f}, "Mixing bins - centrality"}; using BinningType = ColumnBinningPolicy; BinningType colBinning{{ConfVtxBins, ConfCentBins}, true}; Filter collisionFilter_common = nabs(o2::aod::collision::posZ) < 10.f && o2::aod::collision::numContrib > (uint16_t)0 && o2::aod::evsel::sel8 == true; diff --git a/PWGEM/PhotonMeson/Tasks/dalitzMuMuQCMC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzMuMuQCMC.cxx index b9065ec6901..f936c95a462 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzMuMuQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzMuMuQCMC.cxx @@ -86,7 +86,7 @@ struct DalitzMuMuQCMC { for (auto& cut : fDalitzMuMuCuts) { std::string_view cutname = cut.GetName(); THashList* list = reinterpret_cast(fMainList->FindObject("Track")->FindObject(cutname.data())); - o2::aod::emphotonhistograms::DefineHistograms(list, "Track", "Mu"); + o2::aod::emphotonhistograms::DefineHistograms(list, "Track", "Mu,mc"); } // for DalitzMuMus @@ -203,6 +203,10 @@ struct DalitzMuMuQCMC { if (std::find(used_trackIds.begin(), used_trackIds.end(), track.globalIndex()) == used_trackIds.end()) { o2::aod::emphotonhistograms::FillHistClass(list_track_cut, "", track); used_trackIds.emplace_back(track.globalIndex()); + auto mctrack = track.template emmcparticle_as(); + reinterpret_cast(fMainList->FindObject("Track")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaPtOverPtGen"))->Fill(mctrack.pt(), (track.pt() - mctrack.pt()) / mctrack.pt()); + reinterpret_cast(fMainList->FindObject("Track")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaEta"))->Fill(mctrack.pt(), track.eta() - mctrack.eta()); + reinterpret_cast(fMainList->FindObject("Track")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaPhi"))->Fill(mctrack.pt(), track.phi() - mctrack.phi()); } } } // end of LF diff --git a/PWGEM/PhotonMeson/Tasks/emcalPi0QC.cxx b/PWGEM/PhotonMeson/Tasks/emcalPi0QC.cxx index 0295fe909b2..4a00e8f3953 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalPi0QC.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalPi0QC.cxx @@ -62,6 +62,7 @@ struct Photon { { eta = eta_tmp; phi = phi_tmp; + onDCal = (phi < 6 && phi > 4); energy = energy_tmp; theta = 2 * std::atan2(std::exp(-eta), 1); px = energy * std::sin(theta) * std::cos(phi); @@ -79,6 +80,7 @@ struct Photon { float pz; float eta; float phi; + bool onDCal; // Checks whether photon is in phi region of the DCal, otherwise: EMCal float energy; float theta; int id; @@ -141,9 +143,13 @@ struct Pi0QCTask { Configurable mMinNCellsCut{"MinNCellsCut", 1, "apply min cluster number of cell cut"}; Configurable mMinOpenAngleCut{"OpeningAngleCut", 0.0202, "apply min opening angle cut"}; Configurable mClusterDefinition{"clusterDefinition", "kV3Default", "cluster definition to be selected, e.g. V3Default"}; + Configurable mSplitEMCalDCal{"SplitEMCalDCal", 0, "Create and fill inv mass histograms for photons on EMCal and DCal individually"}; std::vector mVetoBCIDs; std::vector mSelectBCIDs; + ConfigurableAxis pTBinning{"pTBinning", {500, 0.0f, 50.0f}, "Binning used along pT axis for inv mass histograms"}; + ConfigurableAxis invmassBinning{"invmassBinning", {400, 0.0f, 0.8f}, "Binning used for inv mass axis in inv mass - pT histograms"}; + // define cluster filter. It selects only those clusters which are of the type // specified in the string mClusterDefinition,e.g. kV3Default, which is V3 clusterizer with default // clusterization parameters @@ -194,9 +200,18 @@ struct Pi0QCTask { mHistManager.add("clusterDistanceToBadChannel", "Distance to bad channel", o2HistType::kTH1F, {{100, 0, 100}}); // meson related histograms - mHistManager.add("invMassVsPt", "invariant mass and pT of meson candidates", o2HistType::kTH2F, {{400, 0, 0.8}, {energyAxis}}); - mHistManager.add("invMassVsPtBackground", "invariant mass and pT of background meson candidates", o2HistType::kTH2F, {{400, 0, 0.8}, {energyAxis}}); - mHistManager.add("invMassVsPtMixedBackground", "invariant mass and pT of mixed background meson candidates", o2HistType::kTH2F, {{400, 0, 0.8}, {energyAxis}}); + mHistManager.add("invMassVsPt", "invariant mass and pT of meson candidates", o2HistType::kTH2F, {invmassBinning, pTBinning}); + mHistManager.add("invMassVsPtBackground", "invariant mass and pT of background meson candidates", o2HistType::kTH2F, {invmassBinning, pTBinning}); + mHistManager.add("invMassVsPtMixedBackground", "invariant mass and pT of mixed background meson candidates", o2HistType::kTH2F, {invmassBinning, pTBinning}); + + if (mSplitEMCalDCal) { + mHistManager.add("invMassVsPt_EMCal", "invariant mass and pT of meson candidates with both clusters on EMCal", o2HistType::kTH2F, {invmassBinning, pTBinning}); + mHistManager.add("invMassVsPtBackground_EMCal", "invariant mass and pT of background meson candidates with both clusters on EMCal", o2HistType::kTH2F, {invmassBinning, pTBinning}); + mHistManager.add("invMassVsPtMixedBackground_EMCal", "invariant mass and pT of mixed background meson candidates with both clusters on EMCal", o2HistType::kTH2F, {invmassBinning, pTBinning}); + mHistManager.add("invMassVsPt_DCal", "invariant mass and pT of meson candidates with both clusters on DCal", o2HistType::kTH2F, {invmassBinning, pTBinning}); + mHistManager.add("invMassVsPtBackground_DCal", "invariant mass and pT of background meson candidates with both clusters on DCal", o2HistType::kTH2F, {invmassBinning, pTBinning}); + mHistManager.add("invMassVsPtMixedBackground_DCal", "invariant mass and pT of mixed background meson candidates with both clusters on DCal", o2HistType::kTH2F, {invmassBinning, pTBinning}); + } if (mVetoBCID->length()) { std::stringstream parser(mVetoBCID.value); @@ -228,10 +243,10 @@ struct Pi0QCTask { mHistManager.fill(HIST("eventsAll"), 1); LOG(debug) << "processCollisions"; // do event selection if mDoEventSel is specified - // currently the event selection is hard coded to kINT7 + // currently the event selection is hard coded to kTVXinEMC // but other selections are possible that are defined in TriggerAliases.h - if (mDoEventSel && (!collision.alias_bit(kINT7))) { - LOG(debug) << "Event not selected becaus it is not kINT7, skipping"; + if (mDoEventSel && (!collision.alias_bit(kTVXinEMC))) { + LOG(debug) << "Event not selected becaus it is not kTVXinEMC, skipping"; return; } mHistManager.fill(HIST("eventVertexZAll"), collision.posZ()); @@ -407,6 +422,14 @@ struct Pi0QCTask { Meson meson(mPhotons[ig1], mPhotons[ig2]); if (meson.getOpeningAngle() > mMinOpenAngleCut) { mHistManager.fill(HIST("invMassVsPt"), meson.getMass(), meson.getPt()); + + if (mSplitEMCalDCal) { + if (!mPhotons[ig1].onDCal && !mPhotons[ig2].onDCal) { + mHistManager.fill(HIST("invMassVsPt_EMCal"), meson.getMass(), meson.getPt()); + } else if (mPhotons[ig1].onDCal && mPhotons[ig2].onDCal) { + mHistManager.fill(HIST("invMassVsPt_DCal"), meson.getMass(), meson.getPt()); + } + } } // calculate background candidates (rotation background) @@ -457,9 +480,23 @@ struct Pi0QCTask { // Fill histograms if (mesonRotated1.getOpeningAngle() > mMinOpenAngleCut) { mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated1.getMass(), mesonRotated1.getPt()); + if (mSplitEMCalDCal) { + if (!mPhotons[ig1].onDCal && !mPhotons[ig2].onDCal && !mPhotons[ig3].onDCal) { + mHistManager.fill(HIST("invMassVsPtBackground_EMCal"), mesonRotated1.getMass(), mesonRotated1.getPt()); + } else if (mPhotons[ig1].onDCal && mPhotons[ig2].onDCal && mPhotons[ig3].onDCal) { + mHistManager.fill(HIST("invMassVsPtBackground_DCal"), mesonRotated1.getMass(), mesonRotated1.getPt()); + } + } } if (mesonRotated2.getOpeningAngle() > mMinOpenAngleCut) { mHistManager.fill(HIST("invMassVsPtBackground"), mesonRotated2.getMass(), mesonRotated2.getPt()); + if (mSplitEMCalDCal) { + if (!mPhotons[ig1].onDCal && !mPhotons[ig2].onDCal && !mPhotons[ig3].onDCal) { + mHistManager.fill(HIST("invMassVsPtBackground_EMCal"), mesonRotated2.getMass(), mesonRotated2.getPt()); + } else if (mPhotons[ig1].onDCal && mPhotons[ig2].onDCal && mPhotons[ig3].onDCal) { + mHistManager.fill(HIST("invMassVsPtBackground_DCal"), mesonRotated2.getMass(), mesonRotated2.getPt()); + } + } } } } @@ -471,6 +508,13 @@ struct Pi0QCTask { Meson meson(gamma, evtMix.vecEvtMix[i][ig1]); if (meson.getOpeningAngle() > mMinOpenAngleCut) { mHistManager.fill(HIST("invMassVsPtMixedBackground"), meson.getMass(), meson.getPt()); + if (mSplitEMCalDCal) { + if (!gamma.onDCal && !evtMix.vecEvtMix[i][ig1].onDCal) { + mHistManager.fill(HIST("invMassVsPtMixedBackground_EMCal"), meson.getMass(), meson.getPt()); + } else if (gamma.onDCal && evtMix.vecEvtMix[i][ig1].onDCal) { + mHistManager.fill(HIST("invMassVsPtMixedBackground_DCal"), meson.getMass(), meson.getPt()); + } + } } } } diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx index b3e68613763..8c773a63d6e 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx +++ b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx @@ -35,7 +35,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using V0DatasAdditional = soa::Join; +using V0DatasAdditional = soa::Join; using V0LegsWithMC = soa::Join; // using collisionEvSelIt = soa::Join::iterator; @@ -608,7 +608,7 @@ struct GammaConversions { } } - Preslice perCollision = aod::v0photonkf::collisionId; + Preslice perCollision = aod::v0photonkf::emreducedeventId; void processRec(aod::EMReducedEvents::iterator const& theCollision, V0DatasAdditional const& theV0s, aod::V0Legs const& theAllTracks) @@ -617,7 +617,7 @@ struct GammaConversions { "hCollisionZ", theCollision.posZ()); - auto theV0s_per_coll = theV0s.sliceBy(perCollision, theCollision.collisionId()); + auto theV0s_per_coll = theV0s.sliceBy(perCollision, theCollision.globalIndex()); for (auto& lV0 : theV0s_per_coll) { float lV0CosinePA = lV0.cospa(); @@ -644,7 +644,7 @@ struct GammaConversions { "hCollisionZ", theCollision.posZ()); - auto theV0s_per_coll = theV0s.sliceBy(perCollision, theCollision.collisionId()); + auto theV0s_per_coll = theV0s.sliceBy(perCollision, theCollision.globalIndex()); for (auto& lV0 : theV0s) { float lV0CosinePA = lV0.cospa(); diff --git a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx index bebbcf202ee..2f43896b1de 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx @@ -154,7 +154,7 @@ struct PCMQC { reinterpret_cast(fMainList->FindObject("Event")->FindObject("hZvtx_after"))->Fill(collision.posZ()); o2::aod::emphotonhistograms::FillHistClass(list_ev, "", collision); - auto V0Photons_coll = v0photons.sliceBy(perCollision, collision.collisionId()); + auto V0Photons_coll = v0photons.sliceBy(perCollision, collision.globalIndex()); for (const auto& cut : fPCMCuts) { THashList* list_v0_cut = static_cast(list_v0->FindObject(cut.GetName())); THashList* list_v0leg_cut = static_cast(list_v0leg->FindObject(cut.GetName())); diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index a086a35d202..c34d0d1bb30 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -160,7 +160,7 @@ struct PCMQCMC { reinterpret_cast(fMainList->FindObject("Event")->FindObject("hCollisionCounter"))->Fill(4.0); reinterpret_cast(fMainList->FindObject("Event")->FindObject("hZvtx_after"))->Fill(collision.posZ()); o2::aod::emphotonhistograms::FillHistClass(list_ev, "", collision); - auto V0Photons_coll = v0photons.sliceBy(perCollision, collision.collisionId()); + auto V0Photons_coll = v0photons.sliceBy(perCollision, collision.globalIndex()); for (const auto& cut : fPCMCuts) { THashList* list_v0_cut = static_cast(list_v0->FindObject(cut.GetName())); @@ -219,9 +219,9 @@ struct PCMQCMC { for (auto& leg : {pos, ele}) { o2::aod::emphotonhistograms::FillHistClass(list_v0leg_cut, "", leg); auto mcleg = leg.template emmcparticle_as(); - reinterpret_cast(fMainList->FindObject("V0Leg")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaPtOverPtGen"))->Fill(mcleg.pt(), (v0.pt() - mcleg.pt()) / mcleg.pt()); - reinterpret_cast(fMainList->FindObject("V0Leg")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaEta"))->Fill(mcleg.pt(), v0.eta() - mcleg.eta()); - reinterpret_cast(fMainList->FindObject("V0Leg")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaPhi"))->Fill(mcleg.pt(), v0.phi() - mcleg.phi()); + reinterpret_cast(fMainList->FindObject("V0Leg")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaPtOverPtGen"))->Fill(mcleg.pt(), (leg.pt() - mcleg.pt()) / mcleg.pt()); + reinterpret_cast(fMainList->FindObject("V0Leg")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaEta"))->Fill(mcleg.pt(), leg.eta() - mcleg.eta()); + reinterpret_cast(fMainList->FindObject("V0Leg")->FindObject(cut.GetName())->FindObject("hPtGen_DeltaPhi"))->Fill(mcleg.pt(), leg.phi() - mcleg.phi()); } } } // end of v0 loop diff --git a/PWGEM/PhotonMeson/Utils/PCMUtilities.h b/PWGEM/PhotonMeson/Utils/PCMUtilities.h index 9841e67957b..599ae087fbe 100644 --- a/PWGEM/PhotonMeson/Utils/PCMUtilities.h +++ b/PWGEM/PhotonMeson/Utils/PCMUtilities.h @@ -59,8 +59,8 @@ void Vtx_recalculation(o2::base::Propagator* prop, T1 lTrackPos, T2 lTrackNeg, f o2::track::TrackParametrizationWithError trackPosInformation = getTrackParCov(lTrackPos); // first get an object that stores Track information (positive) o2::track::TrackParametrizationWithError trackNegInformation = getTrackParCov(lTrackNeg); // first get an object that stores Track information (negative) - trackPosInformation.setPID(o2::track::PID::Electron); - trackNegInformation.setPID(o2::track::PID::Electron); + // trackPosInformation.setPID(o2::track::PID::Electron); + // trackNegInformation.setPID(o2::track::PID::Electron); o2::track::TrackAuxPar helixPos(trackPosInformation, bz); // This object is a descendant of a CircleXY and stores cirlce information with respect to the magnetic field. This object uses functions and information of the o2::track::TrackParametrizationWithError object (positive) o2::track::TrackAuxPar helixNeg(trackNegInformation, bz); // This object is a descendant of a CircleXY and stores cirlce information with respect to the magnetic field. This object uses functions and information of the o2::track::TrackParametrizationWithError object (negative) @@ -71,8 +71,8 @@ void Vtx_recalculation(o2::base::Propagator* prop, T1 lTrackPos, T2 lTrackNeg, f // I am unsure about the Z calculation but this is how it is done in AliPhysics as far as I understand o2::track::TrackParametrizationWithError trackPosInformationCopy = o2::track::TrackParametrizationWithError(trackPosInformation); o2::track::TrackParametrizationWithError trackNegInformationCopy = o2::track::TrackParametrizationWithError(trackNegInformation); - trackPosInformationCopy.setPID(o2::track::PID::Electron); - trackNegInformationCopy.setPID(o2::track::PID::Electron); + // trackPosInformationCopy.setPID(o2::track::PID::Electron); + // trackNegInformationCopy.setPID(o2::track::PID::Electron); // I think this calculation gets the closest point on the track to the conversion point // This alpha is a different alpha than the usual alpha and I think it is the angle between X axis and conversion point diff --git a/PWGHF/Core/HfMlResponseDsToKKPi.h b/PWGHF/Core/HfMlResponseDsToKKPi.h new file mode 100644 index 00000000000..08ce699b37f --- /dev/null +++ b/PWGHF/Core/HfMlResponseDsToKKPi.h @@ -0,0 +1,196 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file HfMlResponseDsToKKPi.h +/// \brief Class to compute the ML response for Ds∓ → K∓ K∓ π± analysis selections +/// \author Samuele Cattaruzzi + +#ifndef PWGHF_CORE_HFMLRESPONSEDSTOKKPI_H_ +#define PWGHF_CORE_HFMLRESPONSEDSTOKKPI_H_ + +#include + +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/HfMlResponse.h" + +// Fill the map of available input features +// the key is the feature's name (std::string) +// the value is the corresponding value in EnumInputFeatures +#define FILL_MAP_DS(FEATURE) \ + { \ +#FEATURE, static_cast < uint8_t>(InputFeaturesDsToKKPi::FEATURE) \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER from OBJECT +#define CHECK_AND_FILL_VEC_DS_FULL(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesDsToKKPi::FEATURE): { \ + inputFeatures.emplace_back(OBJECT.GETTER()); \ + break; \ + } + +// Specific case of CHECK_AND_FILL_VEC_DS_FULL(OBJECT, FEATURE, GETTER) +// where OBJECT is named candidate and FEATURE = GETTER +#define CHECK_AND_FILL_VEC_DS(GETTER) \ + case static_cast(InputFeaturesDsToKKPi::GETTER): { \ + inputFeatures.emplace_back(candidate.GETTER()); \ + break; \ + } + +// Variation of CHECK_AND_FILL_VEC_DS_FULL(OBJECT, FEATURE, GETTER) +// where GETTER is a method of hfHelper +#define CHECK_AND_FILL_VEC_DS_HFHELPER(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesDsToKKPi::FEATURE): { \ + inputFeatures.emplace_back(hfHelper.GETTER(OBJECT)); \ + break; \ + } + +// Variation of CHECK_AND_FILL_VEC_DS_HFHELPER(OBJECT, FEATURE, GETTER) +// where GETTER1 and GETTER2 are methods of hfHelper, and the variable +// is filled depending on whether it is a DsToKKPi or a DsToPiKK +#define CHECK_AND_FILL_VEC_DS_HFHELPER_SIGNED(OBJECT, FEATURE, GETTER1, GETTER2) \ + case static_cast(InputFeaturesDsToKKPi::FEATURE): { \ + if (caseDsToKKPi) { \ + inputFeatures.emplace_back(hfHelper.GETTER1(OBJECT)); \ + } else { \ + inputFeatures.emplace_back(hfHelper.GETTER2(OBJECT)); \ + } \ + break; \ + } + +namespace o2::analysis +{ +enum class InputFeaturesDsToKKPi : uint8_t { + chi2PCA = 0, + decayLength, + decayLengthXY, + decayLengthNormalised, + decayLengthXYNormalised, + maxNormalisedDeltaIP, + cpa, + cpaXY, + ptProng0, + ptProng1, + ptProng2, + impactParameterXY0, + impactParameterXY1, + impactParameterXY2, + nSigTpcTofPi0, + nSigTpcTofPi1, + nSigTpcTofPi2, + nSigTpcTofKa0, + nSigTpcTofKa1, + nSigTpcTofKa2, + cos3PiK, + deltaMassPhi +}; + +template +class HfMlResponseDsToKKPi : public HfMlResponse +{ + public: + /// Default constructor + HfMlResponseDsToKKPi() = default; + /// Default destructor + virtual ~HfMlResponseDsToKKPi() = default; + + HfHelper hfHelper; + + /// Method to get the input features vector needed for ML inference + /// \param candidate is the Ds candidate + /// \param prong0 is the candidate's prong0 + /// \param prong1 is the candidate's prong1 + /// \param prong2 is the candidate's prong2 + /// \param caseDsToKKPi used to divide the case DsToKKPi from DsToPiKK + /// \return inputFeatures vector + template + std::vector getInputFeatures(T1 const& candidate, + T2 const& prong0, T2 const& prong1, T2 const& prong2, bool const& caseDsToKKPi) + { + std::vector inputFeatures; + + for (const auto& idx : MlResponse::mCachedIndices) { + switch (idx) { + CHECK_AND_FILL_VEC_DS(chi2PCA); + CHECK_AND_FILL_VEC_DS(decayLength); + CHECK_AND_FILL_VEC_DS(decayLengthXY); + CHECK_AND_FILL_VEC_DS(decayLengthNormalised); + CHECK_AND_FILL_VEC_DS(decayLengthXYNormalised); + CHECK_AND_FILL_VEC_DS(maxNormalisedDeltaIP); + CHECK_AND_FILL_VEC_DS(cpa); + CHECK_AND_FILL_VEC_DS(cpaXY); + CHECK_AND_FILL_VEC_DS(ptProng0); + CHECK_AND_FILL_VEC_DS(ptProng1); + CHECK_AND_FILL_VEC_DS(ptProng2); + CHECK_AND_FILL_VEC_DS_FULL(candidate, impactParameterXY0, impactParameter0); + CHECK_AND_FILL_VEC_DS_FULL(candidate, impactParameterXY1, impactParameter1); + CHECK_AND_FILL_VEC_DS_FULL(candidate, impactParameterXY2, impactParameter2); + // Combined PID variables + CHECK_AND_FILL_VEC_DS_FULL(prong0, nSigTpcTofPi0, tpcTofNSigmaPi); + CHECK_AND_FILL_VEC_DS_FULL(prong1, nSigTpcTofPi1, tpcTofNSigmaPi); + CHECK_AND_FILL_VEC_DS_FULL(prong2, nSigTpcTofPi2, tpcTofNSigmaPi); + CHECK_AND_FILL_VEC_DS_FULL(prong0, nSigTpcTofKa0, tpcTofNSigmaKa); + CHECK_AND_FILL_VEC_DS_FULL(prong1, nSigTpcTofKa1, tpcTofNSigmaKa); + CHECK_AND_FILL_VEC_DS_FULL(prong2, nSigTpcTofKa2, tpcTofNSigmaKa); + + // Ds specific variables + CHECK_AND_FILL_VEC_DS_HFHELPER_SIGNED(candidate, cos3PiK, cos3PiKDsToKKPi, cos3PiKDsToPiKK); + CHECK_AND_FILL_VEC_DS_HFHELPER_SIGNED(candidate, deltaMassPhi, deltaMassPhiDsToKKPi, deltaMassPhiDsToPiKK); + } + } + + return inputFeatures; + } + + protected: + /// Method to fill the map of available input features + void setAvailableInputFeatures() + { + MlResponse::mAvailableInputFeatures = { + FILL_MAP_DS(chi2PCA), + FILL_MAP_DS(decayLength), + FILL_MAP_DS(decayLengthXY), + FILL_MAP_DS(decayLengthNormalised), + FILL_MAP_DS(decayLengthXYNormalised), + FILL_MAP_DS(maxNormalisedDeltaIP), + FILL_MAP_DS(cpa), + FILL_MAP_DS(cpaXY), + FILL_MAP_DS(ptProng0), + FILL_MAP_DS(ptProng1), + FILL_MAP_DS(ptProng2), + FILL_MAP_DS(impactParameterXY0), + FILL_MAP_DS(impactParameterXY1), + FILL_MAP_DS(impactParameterXY2), + // Combined PID variables + FILL_MAP_DS(nSigTpcTofPi0), + FILL_MAP_DS(nSigTpcTofPi1), + FILL_MAP_DS(nSigTpcTofPi2), + FILL_MAP_DS(nSigTpcTofKa0), + FILL_MAP_DS(nSigTpcTofKa1), + FILL_MAP_DS(nSigTpcTofKa2), + + // Ds specific variables + FILL_MAP_DS(cos3PiK), + FILL_MAP_DS(deltaMassPhi)}; + } +}; + +} // namespace o2::analysis + +#undef FILL_MAP_DS +#undef CHECK_AND_FILL_VEC_DS_FULL +#undef CHECK_AND_FILL_VEC_DS +#undef CHECK_AND_FILL_VEC_DS_HFHELPER +#undef CHECK_AND_FILL_VEC_DS_HFHELPER_SIGNED + +#endif // PWGHF_CORE_HFMLRESPONSEDSTOKKPI_H_ diff --git a/PWGHF/Core/HfMlResponseXicToPKPi.h b/PWGHF/Core/HfMlResponseXicToPKPi.h new file mode 100644 index 00000000000..82004e2eb36 --- /dev/null +++ b/PWGHF/Core/HfMlResponseXicToPKPi.h @@ -0,0 +1,187 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file HfMlResponseXicToPKPi.h +/// \brief Class to compute the ML response for Xic+ → p K- π+ (based on task for D± → π± K∓ π±) analysis selections +/// \author Cristina Terrevoli + +#ifndef PWGHF_CORE_HFMLRESPONSEXICTOPKPI_H_ +#define PWGHF_CORE_HFMLRESPONSEXICTOPKPI_H_ + +#include +#include +#include + +#include "PWGHF/Core/HfMlResponse.h" + +// Fill the map of available input features +// the key is the feature's name (std::string) +// the value is the corresponding value in EnumInputFeatures +#define FILL_MAP_XIC(FEATURE) \ + { \ +#FEATURE, static_cast < uint8_t>(InputFeaturesXicToPKPi::FEATURE) \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER from OBJECT +#define CHECK_AND_FILL_VEC_XIC_FULL(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesXicToPKPi::FEATURE): { \ + inputFeatures.emplace_back(OBJECT.GETTER()); \ + break; \ + } + +// Specific case of CHECK_AND_FILL_VEC_XIC_FULL(OBJECT, FEATURE, GETTER) +// where OBJECT is named candidate and FEATURE = GETTER +#define CHECK_AND_FILL_VEC_XIC(GETTER) \ + case static_cast(InputFeaturesXicToPKPi::GETTER): { \ + inputFeatures.emplace_back(candidate.GETTER()); \ + break; \ + } + +namespace o2::analysis +{ +enum class InputFeaturesXicToPKPi : uint8_t { + ptProng0 = 0, + ptProng1, + ptProng2, + impactParameterXY0, + impactParameterXY1, + impactParameterXY2, + decayLength, + decayLengthXYNormalised, + cpa, + cpaXY, + tpcNSigmaP0, // 0 + tpcNSigmaKa0, // 0 + tpcNSigmaPi0, // 0 + tpcNSigmaP1, // 1 + tpcNSigmaKa1, // 1 + tpcNSigmaPi1, // 1 + tpcNSigmaP2, // 2 + tpcNSigmaKa2, // 2 + tpcNSigmaPi2, // 2 + tofNSigmaP0, // + tofNSigmaKa0, // + tofNSigmaPi0, // + tofNSigmaP1, + tofNSigmaKa1, + tofNSigmaPi1, + tofNSigmaP2, + tofNSigmaKa2, + tofNSigmaPi2 +}; + +template +class HfMlResponseXicToPKPi : public HfMlResponse +{ + public: + /// Default constructor + HfMlResponseXicToPKPi() = default; + /// Default destructor + virtual ~HfMlResponseXicToPKPi() = default; + + /// Method to get the input features vector needed for ML inference + /// \param candidate is the Xic candidate + /// \param prong0 is the candidate's prong0 + /// \param prong1 is the candidate's prong1 + /// \param prong2 is the candidate's prong2 + /// \return inputFeatures vector + template + std::vector getInputFeatures(T1 const& candidate, + T2 const& prong0, T2 const& prong1, T2 const& prong2) + { + std::vector inputFeatures; + + for (const auto& idx : MlResponse::mCachedIndices) { + switch (idx) { + CHECK_AND_FILL_VEC_XIC(ptProng0); + CHECK_AND_FILL_VEC_XIC(ptProng1); + CHECK_AND_FILL_VEC_XIC(ptProng2); + CHECK_AND_FILL_VEC_XIC_FULL(candidate, impactParameterXY0, impactParameter0); + CHECK_AND_FILL_VEC_XIC_FULL(candidate, impactParameterXY1, impactParameter1); + CHECK_AND_FILL_VEC_XIC_FULL(candidate, impactParameterXY2, impactParameter2); + CHECK_AND_FILL_VEC_XIC(decayLength); + CHECK_AND_FILL_VEC_XIC(decayLengthXYNormalised); + CHECK_AND_FILL_VEC_XIC(cpa); + CHECK_AND_FILL_VEC_XIC(cpaXY); + // TPC PID variables + CHECK_AND_FILL_VEC_XIC_FULL(prong0, tpcNSigmaP0, tpcNSigmaPr); + CHECK_AND_FILL_VEC_XIC_FULL(prong0, tpcNSigmaKa0, tpcNSigmaKa); + CHECK_AND_FILL_VEC_XIC_FULL(prong0, tpcNSigmaPi0, tpcNSigmaPi); + CHECK_AND_FILL_VEC_XIC_FULL(prong1, tpcNSigmaP1, tpcNSigmaPr); + CHECK_AND_FILL_VEC_XIC_FULL(prong1, tpcNSigmaKa1, tpcNSigmaKa); + CHECK_AND_FILL_VEC_XIC_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); + CHECK_AND_FILL_VEC_XIC_FULL(prong2, tpcNSigmaP2, tpcNSigmaPr); + CHECK_AND_FILL_VEC_XIC_FULL(prong2, tpcNSigmaKa2, tpcNSigmaKa); + CHECK_AND_FILL_VEC_XIC_FULL(prong2, tpcNSigmaPi2, tpcNSigmaPi); + // TOF PID variables + CHECK_AND_FILL_VEC_XIC_FULL(prong0, tofNSigmaP0, tofNSigmaPr); + CHECK_AND_FILL_VEC_XIC_FULL(prong0, tofNSigmaKa0, tofNSigmaKa); + CHECK_AND_FILL_VEC_XIC_FULL(prong0, tofNSigmaPi0, tofNSigmaPi); + CHECK_AND_FILL_VEC_XIC_FULL(prong1, tofNSigmaP1, tofNSigmaPr); + CHECK_AND_FILL_VEC_XIC_FULL(prong1, tofNSigmaKa1, tofNSigmaKa); + CHECK_AND_FILL_VEC_XIC_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); + CHECK_AND_FILL_VEC_XIC_FULL(prong2, tofNSigmaP2, tofNSigmaPr); + CHECK_AND_FILL_VEC_XIC_FULL(prong2, tofNSigmaKa2, tofNSigmaKa); + CHECK_AND_FILL_VEC_XIC_FULL(prong2, tofNSigmaPi2, tofNSigmaPi); + } + } + + return inputFeatures; + } + + protected: + /// Method to fill the map of available input features + void setAvailableInputFeatures() + { + MlResponse::mAvailableInputFeatures = { + FILL_MAP_XIC(ptProng0), + FILL_MAP_XIC(ptProng1), + FILL_MAP_XIC(ptProng2), + FILL_MAP_XIC(impactParameterXY0), + FILL_MAP_XIC(impactParameterXY1), + FILL_MAP_XIC(impactParameterXY2), + FILL_MAP_XIC(decayLength), + FILL_MAP_XIC(decayLengthXYNormalised), + FILL_MAP_XIC(cpa), + FILL_MAP_XIC(cpaXY), + // TPC PID variables + FILL_MAP_XIC(tpcNSigmaP0), + FILL_MAP_XIC(tpcNSigmaKa0), + FILL_MAP_XIC(tpcNSigmaPi0), + FILL_MAP_XIC(tpcNSigmaP1), + FILL_MAP_XIC(tpcNSigmaKa1), + FILL_MAP_XIC(tpcNSigmaPi1), + FILL_MAP_XIC(tpcNSigmaP2), + FILL_MAP_XIC(tpcNSigmaKa2), + FILL_MAP_XIC(tpcNSigmaPi2), + // TOF PID variables + FILL_MAP_XIC(tofNSigmaP0), + FILL_MAP_XIC(tofNSigmaKa0), + FILL_MAP_XIC(tofNSigmaPi0), + FILL_MAP_XIC(tofNSigmaP1), + FILL_MAP_XIC(tofNSigmaKa1), + FILL_MAP_XIC(tofNSigmaPi1), + FILL_MAP_XIC(tofNSigmaP2), + FILL_MAP_XIC(tofNSigmaKa2), + FILL_MAP_XIC(tofNSigmaPi2)}; + } +}; + +} // namespace o2::analysis + +#undef FILL_MAP_XIC +#undef CHECK_AND_FILL_VEC_XIC_FULL +#undef CHECK_AND_FILL_VEC_XIC + +#endif // PWGHF_CORE_HFMLRESPONSEXICTOPKPI_H_ diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 9b037afed4a..7cf7ca784b5 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1074,6 +1074,7 @@ DECLARE_SOA_COLUMN(DebugGenXi, debugGenXi, int8_t); DECLARE_SOA_COLUMN(DebugGenLambda, debugGenLambda, int8_t); DECLARE_SOA_COLUMN(OriginRec, originRec, int8_t); DECLARE_SOA_COLUMN(OriginGen, originGen, int8_t); +DECLARE_SOA_COLUMN(PtCharmBaryonGen, ptCharmBaryonGen, float); // mapping of decay types enum DecayType { DecayToXiPi = 0, @@ -1121,7 +1122,7 @@ DECLARE_SOA_TABLE(HfToXiPiMCRec, "AOD", "HFTOXIPIMCREC", //! // table with results of generator level MC matching DECLARE_SOA_TABLE(HfToXiPiMCGen, "AOD", "HFTOXIPIMCGEN", //! - hf_cand_toxipi::FlagMcMatchGen, hf_cand_toxipi::DebugGenCharmBar, hf_cand_toxipi::DebugGenXi, hf_cand_toxipi::DebugGenLambda, hf_cand_toxipi::OriginGen); + hf_cand_toxipi::FlagMcMatchGen, hf_cand_toxipi::DebugGenCharmBar, hf_cand_toxipi::DebugGenXi, hf_cand_toxipi::DebugGenLambda, hf_cand_toxipi::PtCharmBaryonGen, hf_cand_toxipi::OriginGen); // specific chic candidate properties namespace hf_cand_chic diff --git a/PWGHF/DataModel/CandidateSelectionTables.h b/PWGHF/DataModel/CandidateSelectionTables.h index edbb9a74022..b24ef333c8d 100644 --- a/PWGHF/DataModel/CandidateSelectionTables.h +++ b/PWGHF/DataModel/CandidateSelectionTables.h @@ -42,7 +42,7 @@ DECLARE_SOA_COLUMN(IsRecoHfFlag, isRecoHfFlag, int); //! DECLARE_SOA_COLUMN(IsRecoTopol, isRecoTopol, int); //! DECLARE_SOA_COLUMN(IsRecoCand, isRecoCand, int); //! DECLARE_SOA_COLUMN(IsRecoPid, isRecoPid, int); -DECLARE_SOA_COLUMN(MlProbD0, mlProbD0, std::vector); //! +DECLARE_SOA_COLUMN(MlProbD0, mlProbD0, std::vector); //! DECLARE_SOA_COLUMN(MlProbD0bar, mlProbD0bar, std::vector); //! } // namespace hf_sel_candidate_d0 @@ -110,7 +110,7 @@ DECLARE_SOA_TABLE(HfSelD0Alice3Forward, "AOD", "HFSELD0A3F", //! namespace hf_sel_candidate_dplus { -DECLARE_SOA_COLUMN(IsSelDplusToPiKPi, isSelDplusToPiKPi, int); //! +DECLARE_SOA_COLUMN(IsSelDplusToPiKPi, isSelDplusToPiKPi, int); //! DECLARE_SOA_COLUMN(MlProbDplusToPiKPi, mlProbDplusToPiKPi, std::vector); //! } // namespace hf_sel_candidate_dplus @@ -122,16 +122,17 @@ DECLARE_SOA_TABLE(HfMlDplusToPiKPi, "AOD", "HFMLDPLUS", //! namespace hf_sel_candidate_ds { -DECLARE_SOA_COLUMN(IsSelDsToKKPi, isSelDsToKKPi, int); //! -DECLARE_SOA_COLUMN(IsSelDsToPiKK, isSelDsToPiKK, int); //! +DECLARE_SOA_COLUMN(IsSelDsToKKPi, isSelDsToKKPi, int); //! +DECLARE_SOA_COLUMN(IsSelDsToPiKK, isSelDsToPiKK, int); //! DECLARE_SOA_COLUMN(MlProbDsToKKPi, mlProbDsToKKPi, std::vector); //! +DECLARE_SOA_COLUMN(MlProbDsToPiKK, mlProbDsToPiKK, std::vector); //! } // namespace hf_sel_candidate_ds DECLARE_SOA_TABLE(HfSelDsToKKPi, "AOD", "HFSELDS", //! hf_sel_candidate_ds::IsSelDsToKKPi, hf_sel_candidate_ds::IsSelDsToPiKK); DECLARE_SOA_TABLE(HfMlDsToKKPi, "AOD", "HFMLDS", //! - hf_sel_candidate_ds::MlProbDsToKKPi); + hf_sel_candidate_ds::MlProbDsToKKPi, hf_sel_candidate_ds::MlProbDsToPiKK); namespace hf_sel_candidate_lc { @@ -223,7 +224,7 @@ DECLARE_SOA_TABLE(HfSelB0ToDPi, "AOD", "HFSELB0", //! namespace hf_sel_candidate_bs { -DECLARE_SOA_COLUMN(IsSelBsToDsPi, isSelBsToDsPi, int); //! +DECLARE_SOA_COLUMN(IsSelBsToDsPi, isSelBsToDsPi, int); //! DECLARE_SOA_COLUMN(MlProbBsToDsPi, mlProbBsToDsPi, std::vector); //! } // namespace hf_sel_candidate_bs @@ -270,10 +271,14 @@ namespace hf_sel_candidate_xic { DECLARE_SOA_COLUMN(IsSelXicToPKPi, isSelXicToPKPi, int); //! DECLARE_SOA_COLUMN(IsSelXicToPiKP, isSelXicToPiKP, int); //! +DECLARE_SOA_COLUMN(MlProbXicToPKPi, mlProbXicToPKPi, std::vector); //! +DECLARE_SOA_COLUMN(MlProbXicToPiKP, mlProbXicToPiKP, std::vector); //! } // namespace hf_sel_candidate_xic DECLARE_SOA_TABLE(HfSelXicToPKPi, "AOD", "HFSELXIC", //! hf_sel_candidate_xic::IsSelXicToPKPi, hf_sel_candidate_xic::IsSelXicToPiKP); +DECLARE_SOA_TABLE(HfMlXicToPKPi, "AOD", "HFMLXIC", //! + hf_sel_candidate_xic::MlProbXicToPKPi, hf_sel_candidate_xic::MlProbXicToPiKP); namespace hf_sel_candidate_xicc { diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 0b2e582dfa4..14922bb4578 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -137,7 +137,7 @@ o2physics_add_dpl_workflow(candidate-selector-to-xi-pi o2physics_add_dpl_workflow(candidate-selector-xic-to-p-k-pi SOURCES candidateSelectorXicToPKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(candidate-selector-xicc-to-p-k-pi-pi diff --git a/PWGHF/TableProducer/candidateCreatorToXiPi.cxx b/PWGHF/TableProducer/candidateCreatorToXiPi.cxx index 04a4c3024ec..dcf300d35a4 100644 --- a/PWGHF/TableProducer/candidateCreatorToXiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorToXiPi.cxx @@ -90,10 +90,9 @@ struct HfCandidateCreatorToXiPi { using FilteredHfTrackAssocSel = soa::Filtered>; using MyCascTable = soa::Join; // to use strangeness tracking, use aod::TraCascDatas instead of aod::CascDatas using MyV0Table = soa::Join; - using MySkimIdx = soa::Filtered; + using MySkimIdx = HfCascLf2Prongs; Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == 0); // filter to use only HF selected collisions - Filter filterSelectIndexes = (aod::hf_track_index::hfflag == static_cast(1)); Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng > 0); Preslice trackIndicesPerCollision = aod::track_association::collisionId; // aod::hf_track_association::collisionId @@ -101,7 +100,8 @@ struct HfCandidateCreatorToXiPi { Preslice candidatesPerCollision = hf_track_index::collisionId; OutputObj hInvMassCharmBaryon{TH1F("hInvMassCharmBaryon", "Charm baryon invariant mass;inv mass;entries", 500, 2.2, 3.1)}; - OutputObj hFitterExceptions{TH1F("hFitterExceptions", "Charm DCAFitter exceptions;status;entries", 3, 0.0, 3.0)}; + OutputObj hFitterStatus{TH1F("hFitterStatus", "Charm DCAFitter status;status;entries", 3, -0.5, 2.5)}; // 0 --> vertex(es) found, 1 --> exception found, 2 --> no vertex found (but no exception) + OutputObj hCandidateCounter{TH1F("hCandidateCounter", "Candidate counter wrt derived data;status;entries", 4, -0.5, 3.5)}; // 0 --> candidates in derived data table, 1 --> candidates passing testbit selection, 2 --> candidates passing fitter step 3 --> candidates filled in new table void init(InitContext const&) { @@ -110,6 +110,13 @@ struct HfCandidateCreatorToXiPi { ccdb->setLocalObjectValidityChecking(); lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get(ccdbPathLut)); runNumber = 0; + + if (doprocessIdxCombinatorics && doprocessDerivedData) { + LOGF(fatal, "Cannot enable processIdxCombinatorics and processDerivedData at the same time. Please choose one."); + } + if (!doprocessIdxCombinatorics && !doprocessDerivedData) { + LOGF(fatal, "Please enable at least one process, now both processIdxCombinatorics and processDerivedData are false."); + } } void processIdxCombinatorics(SelectedCollisions const& collisions, @@ -239,8 +246,8 @@ struct HfCandidateCreatorToXiPi { auto groupedTrackIndices = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); for (const auto& trackIndexPion : groupedTrackIndices) { - // use bachelor selections from HfTrackIndexSkimCreatorTagSelTracks --> bit =2 is CandidateType::CandV0bachelor - if (!TESTBIT(trackIndexPion.isSelProng(), 2)) { + // use bachelor selections from HfTrackIndexSkimCreatorTagSelTracks --> bit = 4 is CandidateType::CandCascadeBachelor + if (!TESTBIT(trackIndexPion.isSelProng(), 4)) { continue; } @@ -272,13 +279,14 @@ struct HfCandidateCreatorToXiPi { nVtxFromFitterCharmBaryon = df.process(trackCasc, trackParVarPi); } catch (...) { LOG(error) << "Exception caught in charm DCA fitter process call!"; - hFitterExceptions->Fill(1); + hFitterStatus->Fill(1); continue; } if (nVtxFromFitterCharmBaryon == 0) { + hFitterStatus->Fill(2); continue; } - hFitterExceptions->Fill(0); + hFitterStatus->Fill(0); auto vertexCharmBaryonFromFitter = df.getPCACandidate(); auto chi2PCACharmBaryon = df.getChi2AtPCACandidate(); std::array pVecCascAsD; @@ -466,6 +474,14 @@ struct HfCandidateCreatorToXiPi { for (const auto& cand : groupedCandidates) { + hCandidateCounter->Fill(0); + + if (!TESTBIT(cand.hfflag(), aod::hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi)) { + continue; + } + + hCandidateCounter->Fill(1); + auto casc = cand.cascade_as(); auto trackPion = cand.prong0_as(); // pi <-- charm baryon auto trackXiDauCharged = casc.bachelor_as(); // pion <- xi track @@ -527,13 +543,15 @@ struct HfCandidateCreatorToXiPi { nVtxFromFitterCharmBaryon = df.process(trackCasc, trackParVarPi); } catch (...) { LOG(error) << "Exception caught in charm DCA fitter process call!"; - hFitterExceptions->Fill(1); + hFitterStatus->Fill(1); continue; } if (nVtxFromFitterCharmBaryon == 0) { + hFitterStatus->Fill(2); continue; } - hFitterExceptions->Fill(0); + hFitterStatus->Fill(0); + hCandidateCounter->Fill(2); auto vertexCharmBaryonFromFitter = df.getPCACandidate(); auto chi2PCACharmBaryon = df.getChi2AtPCACandidate(); std::array pVecCascAsD; @@ -643,6 +661,7 @@ struct HfCandidateCreatorToXiPi { // fill test histograms hInvMassCharmBaryon->Fill(mCharmBaryon); + hCandidateCounter->Fill(3); // fill the table rowCandidate(collision.globalIndex(), @@ -702,6 +721,7 @@ struct HfCandidateCreatorToXiPiMc { aod::TracksWMc const& tracks, aod::McParticles const& mcParticles) { + float ptCharmBaryonGen = -999.; int indexRec = -1; int indexRecCharmBaryon = -1; int8_t sign = -9; @@ -809,6 +829,7 @@ struct HfCandidateCreatorToXiPiMc { // Match generated particles. for (const auto& particle : mcParticles) { + ptCharmBaryonGen = -999.; flag = 0; sign = -9; debugGenCharmBar = 0; @@ -819,6 +840,7 @@ struct HfCandidateCreatorToXiPiMc { // Omegac → Xi pi if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdgCodeOmegac0, std::array{pdgCodeXiMinus, pdgCodePiPlus}, true, &sign)) { debugGenCharmBar = 1; + ptCharmBaryonGen = particle.pt(); // Xi -> Lambda pi auto cascMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); if (RecoDecay::isMatchedMCGen(mcParticles, cascMC, pdgCodeXiMinus, std::array{pdgCodeLambda, pdgCodePiMinus}, true)) { @@ -840,6 +862,7 @@ struct HfCandidateCreatorToXiPiMc { // Xic → Xi pi if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdgCodeXic0, std::array{pdgCodeXiMinus, pdgCodePiPlus}, true, &sign)) { debugGenCharmBar = 1; + ptCharmBaryonGen = particle.pt(); // Xi- -> Lambda pi auto cascMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); if (RecoDecay::isMatchedMCGen(mcParticles, cascMC, pdgCodeXiMinus, std::array{pdgCodeLambda, pdgCodePiMinus}, true)) { @@ -858,7 +881,7 @@ struct HfCandidateCreatorToXiPiMc { } } - rowMCMatchGen(flag, debugGenCharmBar, debugGenXi, debugGenLambda, origin); + rowMCMatchGen(flag, debugGenCharmBar, debugGenXi, debugGenLambda, ptCharmBaryonGen, origin); } } // close process PROCESS_SWITCH(HfCandidateCreatorToXiPiMc, processMc, "Process MC", false); diff --git a/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx b/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx index 451a3cb157e..9314e7557ee 100644 --- a/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDsToKKPi.cxx @@ -22,7 +22,7 @@ #include "Common/Core/TrackSelectorPID.h" #include "PWGHF/Core/HfHelper.h" -#include "PWGHF/Core/HfMlResponse.h" +#include "PWGHF/Core/HfMlResponseDsToKKPi.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -30,6 +30,12 @@ using namespace o2; using namespace o2::analysis; using namespace o2::framework; +/// Struct to extend TracksPid tables +struct HfCandidateSelectorDsToKKPiExpressions { + Spawns rowTracksPidFullPi; + Spawns rowTracksPidFullKa; +}; + /// Struct for applying Ds to KKpi selection cuts struct HfCandidateSelectorDsToKKPi { Produces hfSelDsToKKPiCandidate; @@ -56,6 +62,7 @@ struct HfCandidateSelectorDsToKKPi { Configurable> cutDirMl{"cutDirMl", std::vector{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"}; Configurable> cutsMl{"cutsMl", {hf_cuts_ml::cuts[0], hf_cuts_ml::nBinsPt, hf_cuts_ml::nCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"}; Configurable nClassesMl{"nClassesMl", (int8_t)hf_cuts_ml::nCutScores, "Number of classes in ML model"}; + Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; // CCDB configuration Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable> modelPathsCCDB{"modelPathsCCDB", std::vector{"EventFiltering/PWGHF/BDTDs"}, "Paths of models on CCDB"}; @@ -64,13 +71,14 @@ struct HfCandidateSelectorDsToKKPi { Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; HfHelper hfHelper; - o2::analysis::HfMlResponse hfMlResponse; - std::vector outputMl = {}; + o2::analysis::HfMlResponseDsToKKPi hfMlResponse; + std::vector outputMlDsToKKPi = {}; + std::vector outputMlDsToPiKK = {}; o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; TrackSelectorKa selectorKaon; - using TracksSel = soa::Join; + using TracksSel = soa::Join; HistogramRegistry registry{"registry"}; @@ -105,8 +113,8 @@ struct HfCandidateSelectorDsToKKPi { } else { hfMlResponse.setModelPathsLocal(onnxFileNames); } + hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); hfMlResponse.init(); - outputMl.assign(((std::vector)cutDirMl).size(), -1.f); // dummy value for ML output } } @@ -211,10 +219,13 @@ struct HfCandidateSelectorDsToKKPi { auto statusDsToKKPi = 0; auto statusDsToPiKK = 0; + outputMlDsToKKPi.clear(); + outputMlDsToPiKK.clear(); + if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DsToKKPi)) { hfSelDsToKKPiCandidate(statusDsToKKPi, statusDsToPiKK); if (applyMl) { - hfMlDsToKKPiCandidate(outputMl); + hfMlDsToKKPiCandidate(outputMlDsToKKPi, outputMlDsToPiKK); } if (activateQA) { registry.fill(HIST("hSelections"), 1, candidate.pt()); @@ -235,7 +246,7 @@ struct HfCandidateSelectorDsToKKPi { if (!selection(candidate)) { hfSelDsToKKPiCandidate(statusDsToKKPi, statusDsToPiKK); if (applyMl) { - hfMlDsToKKPiCandidate(outputMl); + hfMlDsToKKPiCandidate(outputMlDsToKKPi, outputMlDsToPiKK); } continue; } @@ -245,7 +256,7 @@ struct HfCandidateSelectorDsToKKPi { if (!topolDsToKKPi && !topolDsToPiKK) { hfSelDsToKKPiCandidate(statusDsToKKPi, statusDsToPiKK); if (applyMl) { - hfMlDsToKKPiCandidate(outputMl); + hfMlDsToKKPiCandidate(outputMlDsToKKPi, outputMlDsToPiKK); } continue; } @@ -277,7 +288,7 @@ struct HfCandidateSelectorDsToKKPi { if (!pidDsToKKPi && !pidDsToPiKK) { hfSelDsToKKPiCandidate(statusDsToKKPi, statusDsToPiKK); if (applyMl) { - hfMlDsToKKPiCandidate(outputMl); + hfMlDsToKKPiCandidate(outputMlDsToKKPi, outputMlDsToPiKK); } continue; } @@ -293,27 +304,28 @@ struct HfCandidateSelectorDsToKKPi { if (applyMl) { // ML selections - std::vector inputFeatures{candidate.ptProng0(), - trackPos1.dcaXY(), - trackPos1.dcaZ(), - candidate.ptProng1(), - trackNeg.dcaXY(), - trackNeg.dcaZ(), - candidate.ptProng2(), - trackPos2.dcaXY(), - trackPos2.dcaZ()}; - - bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, candidate.pt(), outputMl); - hfMlDsToKKPiCandidate(outputMl); - - if (!isSelectedMl) { + bool isSelectedMlDsToKKPi = false; + bool isSelectedMlDsToPiKK = false; + + if (topolDsToKKPi && pidDsToKKPi) { + std::vector inputFeaturesDsToKKPi = hfMlResponse.getInputFeatures(candidate, trackPos1, trackNeg, trackPos2, true); + isSelectedMlDsToKKPi = hfMlResponse.isSelectedMl(inputFeaturesDsToKKPi, candidate.pt(), outputMlDsToKKPi); + } + if (topolDsToPiKK && pidDsToPiKK) { + std::vector inputFeaturesDsToPiKK = hfMlResponse.getInputFeatures(candidate, trackPos1, trackNeg, trackPos2, false); + isSelectedMlDsToPiKK = hfMlResponse.isSelectedMl(inputFeaturesDsToPiKK, candidate.pt(), outputMlDsToPiKK); + } + + hfMlDsToKKPiCandidate(outputMlDsToKKPi, outputMlDsToPiKK); + + if (!isSelectedMlDsToKKPi && !isSelectedMlDsToPiKK) { hfSelDsToKKPiCandidate(statusDsToKKPi, statusDsToPiKK); continue; } - if (topolDsToKKPi && pidDsToKKPi) { + if (isSelectedMlDsToKKPi) { SETBIT(statusDsToKKPi, aod::SelectionStep::RecoMl); } - if (topolDsToPiKK && pidDsToPiKK) { + if (isSelectedMlDsToPiKK) { SETBIT(statusDsToPiKK, aod::SelectionStep::RecoMl); } if (activateQA) { @@ -328,5 +340,7 @@ struct HfCandidateSelectorDsToKKPi { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; } diff --git a/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx index 65777de8ab6..7eee65c9530 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToPKPi.cxx @@ -15,6 +15,7 @@ /// /// \author Mattia Faggin , University and INFN PADOVA /// \author Vít Kučera , CERN +/// \author Cristina Terrevoli , INFN BARI #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" @@ -22,7 +23,9 @@ #include "Common/Core/TrackSelectorPID.h" +#include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/HfMlResponseXicToPKPi.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -33,29 +36,47 @@ using namespace o2::framework; /// Struct for applying Xic selection cuts struct HfCandidateSelectorXicToPKPi { Produces hfSelXicToPKPiCandidate; + Produces hfMlXicToPKPiCandidate; Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; Configurable ptCandMax{"ptCandMax", 36., "Upper bound of candidate pT"}; Configurable usePid{"usePid", true, "Bool to use or not the PID at filtering level"}; // TPC PID Configurable ptPidTpcMin{"ptPidTpcMin", 0.15, "Lower bound of track pT for TPC PID"}; - Configurable ptPidTpcMax{"ptPidTpcMax", 1., "Upper bound of track pT for TPC PID"}; + Configurable ptPidTpcMax{"ptPidTpcMax", 20., "Upper bound of track pT for TPC PID"}; Configurable nSigmaTpcMax{"nSigmaTpcMax", 3., "Nsigma cut on TPC only"}; Configurable nSigmaTpcCombinedMax{"nSigmaTpcCombinedMax", 5., "Nsigma cut on TPC combined with TOF"}; // TOF PID - Configurable ptPidTofMin{"ptPidTofMin", 0.5, "Lower bound of track pT for TOF PID"}; - Configurable ptPidTofMax{"ptPidTofMax", 4., "Upper bound of track pT for TOF PID"}; + Configurable ptPidTofMin{"ptPidTofMin", 0.15, "Lower bound of track pT for TOF PID"}; + Configurable ptPidTofMax{"ptPidTofMax", 20., "Upper bound of track pT for TOF PID"}; Configurable nSigmaTofMax{"nSigmaTofMax", 3., "Nsigma cut on TOF only"}; Configurable nSigmaTofCombinedMax{"nSigmaTofCombinedMax", 5., "Nsigma cut on TOF combined with TPC"}; // topological cuts Configurable decayLengthXYNormalisedMin{"decayLengthXYNormalisedMin", 3., "Min. normalised decay length XY"}; Configurable> binsPt{"binsPt", std::vector{hf_cuts_xic_to_p_k_pi::vecBinsPt}, "pT bin limits"}; Configurable> cuts{"cuts", {hf_cuts_xic_to_p_k_pi::cuts[0], hf_cuts_xic_to_p_k_pi::nBinsPt, hf_cuts_xic_to_p_k_pi::nCutVars, hf_cuts_xic_to_p_k_pi::labelsPt, hf_cuts_xic_to_p_k_pi::labelsCutVar}, "Xic candidate selection per pT bin"}; - - HfHelper hfHelper; + // ML inference + Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; + Configurable> binsPtMl{"binsPtMl", std::vector{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"}; + Configurable> cutDirMl{"cutDirMl", std::vector{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"}; + Configurable> cutsMl{"cutsMl", {hf_cuts_ml::cuts[0], hf_cuts_ml::nBinsPt, hf_cuts_ml::nCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"}; + Configurable nClassesMl{"nClassesMl", (int8_t)hf_cuts_ml::nCutScores, "Number of classes in ML model"}; + Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; + // CCDB configuration + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable> modelPathsCCDB{"modelPathsCCDB", std::vector{"EventFiltering/PWGHF/BDTXic"}, "Paths of models on CCDB"}; + Configurable> onnxFileNames{"onnxFileNames", std::vector{"ModelHandler_onnx_XicToPKPi.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; + Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + + o2::analysis::HfMlResponseXicToPKPi hfMlResponse; + std::vector outputMlXicToPKPi = {}; + std::vector outputMlXicToPiKP = {}; + o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; TrackSelectorKa selectorKaon; TrackSelectorPr selectorProton; + HfHelper hfHelper; using TracksSel = soa::Join; @@ -69,6 +90,18 @@ struct HfCandidateSelectorXicToPKPi { selectorPion.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedMax, nSigmaTofCombinedMax); selectorKaon = selectorPion; selectorProton = selectorPion; + + if (applyMl) { + hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); + if (loadModelsFromCCDB) { + ccdbApi.init(ccdbUrl); + hfMlResponse.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); + } else { + hfMlResponse.setModelPathsLocal(onnxFileNames); + } + hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); + hfMlResponse.init(); + } } /// Conjugate-independent topological cuts @@ -175,10 +208,20 @@ struct HfCandidateSelectorXicToPKPi { auto statusXicToPKPi = 0; auto statusXicToPiKP = 0; - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::XicToPKPi)) { + outputMlXicToPKPi.clear(); + outputMlXicToPiKP.clear(); + + if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::XicToPKPi)) { hfSelXicToPKPiCandidate(statusXicToPKPi, statusXicToPiKP); + if (applyMl) { + hfMlXicToPKPiCandidate(outputMlXicToPKPi, outputMlXicToPiKP); + } continue; } + SETBIT(statusXicToPKPi, aod::SelectionStep::RecoSkims); + SETBIT(statusXicToPiKP, aod::SelectionStep::RecoSkims); + + auto ptCand = candidate.pt(); auto trackPos1 = candidate.prong0_as(); // positive daughter (negative for the antiparticles) auto trackNeg = candidate.prong1_as(); // negative daughter (positive for the antiparticles) @@ -189,6 +232,9 @@ struct HfCandidateSelectorXicToPKPi { // conjugate-independent topological selection if (!selectionTopol(candidate)) { hfSelXicToPKPiCandidate(statusXicToPKPi, statusXicToPiKP); + if (applyMl) { + hfMlXicToPKPiCandidate(outputMlXicToPKPi, outputMlXicToPiKP); + } continue; } @@ -199,8 +245,17 @@ struct HfCandidateSelectorXicToPKPi { if (!topolXicToPKPi && !topolXicToPiKP) { hfSelXicToPKPiCandidate(statusXicToPKPi, statusXicToPiKP); + if (applyMl) { + hfMlXicToPKPiCandidate(outputMlXicToPKPi, outputMlXicToPiKP); + } continue; } + if (topolXicToPKPi) { + SETBIT(statusXicToPKPi, aod::SelectionStep::RecoTopol); + } + if (topolXicToPiKP) { + SETBIT(statusXicToPiKP, aod::SelectionStep::RecoTopol); + } auto pidXicToPKPi = -1; auto pidXicToPiKP = -1; @@ -239,14 +294,46 @@ struct HfCandidateSelectorXicToPKPi { if (pidXicToPKPi == 0 && pidXicToPiKP == 0) { hfSelXicToPKPiCandidate(statusXicToPKPi, statusXicToPiKP); + if (applyMl) { + hfMlXicToPKPiCandidate(outputMlXicToPKPi, outputMlXicToPiKP); + } continue; } if ((pidXicToPKPi == -1 || pidXicToPKPi == 1) && topolXicToPKPi) { - statusXicToPKPi = 1; // identified as Xic->pKpi + SETBIT(statusXicToPKPi, aod::SelectionStep::RecoPID); } if ((pidXicToPiKP == -1 || pidXicToPiKP == 1) && topolXicToPiKP) { - statusXicToPiKP = 1; // identified as Xic->piKp + SETBIT(statusXicToPiKP, aod::SelectionStep::RecoPID); + } + + if (applyMl) { + // ML selections + bool isSelectedMlXicToPKPi = false; + bool isSelectedMlXicToPiKP = false; + + if (topolXicToPKPi && pidXicToPKPi) { + std::vector inputFeaturesXicToPKPi = hfMlResponse.getInputFeatures(candidate, trackPos1, trackNeg, trackPos2); + isSelectedMlXicToPKPi = hfMlResponse.isSelectedMl(inputFeaturesXicToPKPi, ptCand, outputMlXicToPKPi); + } + if (topolXicToPiKP && pidXicToPiKP) { + std::vector inputFeaturesXicToPiKP = hfMlResponse.getInputFeatures(candidate, trackPos1, trackNeg, trackPos2); + isSelectedMlXicToPiKP = hfMlResponse.isSelectedMl(inputFeaturesXicToPiKP, ptCand, outputMlXicToPiKP); + } + + hfMlXicToPKPiCandidate(outputMlXicToPKPi, outputMlXicToPiKP); + + if (!isSelectedMlXicToPKPi && !isSelectedMlXicToPiKP) { + hfSelXicToPKPiCandidate(statusXicToPKPi, statusXicToPiKP); + continue; + } + + if (isSelectedMlXicToPKPi) { + SETBIT(statusXicToPKPi, aod::SelectionStep::RecoMl); + } + if (isSelectedMlXicToPiKP) { + SETBIT(statusXicToPKPi, aod::SelectionStep::RecoMl); + } } hfSelXicToPKPiCandidate(statusXicToPKPi, statusXicToPiKP); diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 0f431da044a..dcc68082aa1 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -63,6 +63,7 @@ enum CandidateType { Cand3Prong, CandV0bachelor, CandDstar, + CandCascadeBachelor, NCandidateTypes }; @@ -364,11 +365,19 @@ struct HfTrackIndexSkimCreatorTagSelTracks { Configurable> cutsTrack3Prong{"cutsTrack3Prong", {hf_cuts_single_track::cutsTrack[0], hf_cuts_single_track::nBinsPtTrack, hf_cuts_single_track::nCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track selections per pT bin for 3-prong candidates"}; Configurable etaMinTrack3Prong{"etaMinTrack3Prong", -99999., "min. pseudorapidity for 3 prong candidate"}; Configurable etaMaxTrack3Prong{"etaMaxTrack3Prong", 4., "max. pseudorapidity for 3 prong candidate"}; - // bachelor cuts (when using cascades) + // bachelor cuts (V0 + bachelor decays) Configurable ptMinTrackBach{"ptMinTrackBach", 0.3, "min. track pT for bachelor in cascade candidate"}; // 0.5 for PbPb 2015? Configurable> cutsTrackBach{"cutsTrackBach", {hf_cuts_single_track::cutsTrack[0], hf_cuts_single_track::nBinsPtTrack, hf_cuts_single_track::nCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track selections per pT bin for the bachelor of V0-bachelor candidates"}; Configurable etaMinTrackBach{"etaMinTrackBach", -99999., "min. pseudorapidity for bachelor in cascade candidate"}; Configurable etaMaxTrackBach{"etaMaxTrackBach", 0.8, "max. pseudorapidity for bachelor in cascade candidate"}; + // bachelor cuts (cascade + bachelor decays) + Configurable ptMinTrackBachLfCasc{"ptMinTrackBachLfCasc", 0.1, "min. track pT for bachelor in cascade + bachelor decays"}; // 0.5 for PbPb 2015? + Configurable> cutsTrackBachLfCasc{"cutsTrackBachLfCasc", {hf_cuts_single_track::cutsTrack[0], hf_cuts_single_track::nBinsPtTrack, hf_cuts_single_track::nCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track selections per pT bin for the bachelor in cascade + bachelor decays"}; + Configurable etaMinTrackBachLfCasc{"etaMinTrackBachLfCasc", -99999., "min. pseudorapidity for bachelor in cascade + bachelor decays"}; + Configurable etaMaxTrackBachLfCasc{"etaMaxTrackBachLfCasc", 1.1, "max. pseudorapidity for bachelor in cascade + bachelor decays"}; + Configurable useIsGlobalTrackForBachLfCasc{"useIsGlobalTrackForBachLfCasc", false, "check isGlobalTrack status for bachelor in cascade + bachelor decays"}; + Configurable useIsGlobalTrackWoDCAForBachLfCasc{"useIsGlobalTrackWoDCAForBachLfCasc", false, "check isGlobalTrackWoDCA status for bachelor in cascade + bachelor decays"}; + Configurable useIsQualityTrackITSForBachLfCasc{"useIsQualityTrackITSForBachLfCasc", true, "check isQualityTrackITS status for bachelor in cascade + bachelor decays"}; // soft pion cuts for D* Configurable ptMinSoftPionForDstar{"ptMinSoftPionForDstar", 0.05, "min. track pT for soft pion in D* candidate"}; Configurable ptMaxSoftPionForDstar{"ptMaxSoftPionForDstar", 2., "max. track pT for soft pion in D* candidate"}; @@ -413,7 +422,7 @@ struct HfTrackIndexSkimCreatorTagSelTracks { LOGP(fatal, "One and only one process function for the different PID selection strategies can be enabled at a time!"); } - cutsSingleTrack = {cutsTrack2Prong, cutsTrack3Prong, cutsTrackBach, cutsTrackDstar}; + cutsSingleTrack = {cutsTrack2Prong, cutsTrack3Prong, cutsTrackBach, cutsTrackDstar, cutsTrackBachLfCasc}; if (etaMinTrack2Prong == -99999.) { etaMinTrack2Prong.value = -etaMaxTrack2Prong; @@ -427,10 +436,13 @@ struct HfTrackIndexSkimCreatorTagSelTracks { if (etaMinSoftPionForDstar == -99999.) { etaMinSoftPionForDstar.value = -etaMaxSoftPionForDstar; } + if (etaMinTrackBachLfCasc == -99999.) { + etaMinTrackBachLfCasc.value = -etaMaxTrackBachLfCasc; + } if (fillHistograms) { // general tracks - registry.add("hRejTracks", "Tracks;;entries", {HistType::kTH1F, {{20, 0.5, 20.5}}}); + registry.add("hRejTracks", "Tracks;;entries", {HistType::kTH1F, {{25, 0.5, 25.5}}}); registry.add("hPtNoCuts", "all tracks;#it{p}_{T}^{track} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); // 2-prong histograms @@ -441,7 +453,7 @@ struct HfTrackIndexSkimCreatorTagSelTracks { registry.add("hPtCuts3Prong", "tracks selected for 3-prong vertexing;#it{p}_{T}^{track} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("hDCAToPrimXYVsPtCuts3Prong", "tracks selected for 3-prong vertexing;#it{p}_{T}^{track} (GeV/#it{c});DCAxy to prim. vtx. (cm);entries", {HistType::kTH2F, {{360, 0., 36.}, {400, -2., 2.}}}); registry.add("hEtaCuts3Prong", "tracks selected for 3-prong vertexing;#it{#eta};entries", {HistType::kTH1F, {{static_cast(0.6 * (etaMaxTrack3Prong - etaMinTrack3Prong) * 100), -1.2 * etaMinTrack3Prong, 1.2 * etaMaxTrack3Prong}}}); - // bachelor (for cascades) histograms + // bachelor (for V0 + bachelor decays) histograms registry.add("hPtCutsV0bachelor", "tracks selected for V0-bachelor vertexing;#it{p}_{T}^{track} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("hDCAToPrimXYVsPtCutsV0bachelor", "tracks selected for V0-bachelor vertexing;#it{p}_{T}^{track} (GeV/#it{c});DCAxy to prim. vtx. (cm);entries", {HistType::kTH2F, {{360, 0., 36.}, {400, -2., 2.}}}); registry.add("hEtaCutsV0bachelor", "tracks selected for V0-bachelor vertexing;#it{#eta};entries", {HistType::kTH1F, {{static_cast(0.6 * (etaMaxTrackBach - etaMinTrackBach) * 100), -1.2 * etaMinTrackBach, 1.2 * etaMaxTrackBach}}}); @@ -449,9 +461,13 @@ struct HfTrackIndexSkimCreatorTagSelTracks { registry.add("hPtCutsSoftPionForDstar", "tracks selected for D* soft pion;#it{p}_{T}^{track} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("hDCAToPrimXYVsPtCutsSoftPionForDstar", "tracks selected for D* soft pion;#it{p}_{T}^{track} (GeV/#it{c});DCAxy to prim. vtx. (cm);entries", {HistType::kTH2F, {{360, 0., 36.}, {400, -2., 2.}}}); registry.add("hEtaCutsSoftPionForDstar", "tracks selected for D* soft pion;#it{#eta};entries", {HistType::kTH1F, {{static_cast(0.6 * (etaMaxSoftPionForDstar - etaMinSoftPionForDstar) * 100), -1.2 * etaMinSoftPionForDstar, 1.2 * etaMaxSoftPionForDstar}}}); + // bachelor (for cascade + bachelor decays) histograms + registry.add("hPtCutsCascadeBachelor", "tracks selected for cascade-bachelor vertexing;#it{p}_{T}^{track} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("hDCAToPrimXYVsPtCutsCascadeBachelor", "tracks selected for cascade-bachelor vertexing;#it{p}_{T}^{track} (GeV/#it{c});DCAxy to prim. vtx. (cm);entries", {HistType::kTH2F, {{360, 0., 36.}, {400, -2., 2.}}}); + registry.add("hEtaCutsCascadeBachelor", "tracks selected for cascade-bachelor vertexing;#it{#eta};entries", {HistType::kTH1F, {{static_cast(0.6 * (etaMaxTrackBachLfCasc - etaMinTrackBachLfCasc) * 100), -1.2 * etaMinTrackBachLfCasc, 1.2 * etaMaxTrackBachLfCasc}}}); std::string cutNames[nCuts + 1] = {"selected", "rej pT", "rej eta", "rej track quality", "rej dca"}; - std::string candNames[CandidateType::NCandidateTypes] = {"2-prong", "3-prong", "bachelor", "dstar"}; + std::string candNames[CandidateType::NCandidateTypes] = {"2-prong", "3-prong", "bachelor", "dstar", "lfCascBachelor"}; for (int iCandType = 0; iCandType < CandidateType::NCandidateTypes; iCandType++) { for (int iCut = 0; iCut < nCuts + 1; iCut++) { registry.get(HIST("hRejTracks"))->GetXaxis()->SetBinLabel((nCuts + 1) * iCandType + iCut + 1, Form("%s %s", candNames[iCandType].data(), cutNames[iCut].data())); @@ -548,10 +564,10 @@ struct HfTrackIndexSkimCreatorTagSelTracks { return flag; } - /// Single-track cuts for 2-prongs, 3-prongs, or cascades + /// Single-track cuts for 2-prongs, 3-prongs, bachelor+V0, bachelor+cascade decays /// \param trackPt is the track pt /// \param dca is a 2-element array with dca in transverse and longitudinal directions - /// \param candType is the flag to decide which cuts to be applied (either for 2-prong, 3-prong, or cascade decays) + /// \param candType is the flag to decide which cuts to be applied (either for 2-prong, 3-prong, bachelor+V0 or bachelor+cascade decays) /// \return true if track passes all cuts bool isSelectedTrackDCA(const float& trackPt, const std::array& dca, const int candType) { @@ -609,6 +625,12 @@ struct HfTrackIndexSkimCreatorTagSelTracks { registry.fill(HIST("hRejTracks"), (nCuts + 1) * CandidateType::CandDstar + iCut); } } + if (trackPt < ptMinTrackBachLfCasc) { + CLRBIT(statusProng, CandidateType::CandCascadeBachelor); + if (fillHistograms) { + registry.fill(HIST("hRejTracks"), (nCuts + 1) * CandidateType::CandCascadeBachelor + iCut); + } + } iCut = 3; // eta cut @@ -639,6 +661,13 @@ struct HfTrackIndexSkimCreatorTagSelTracks { } } + if (TESTBIT(statusProng, CandidateType::CandCascadeBachelor) && (trackEta > etaMaxTrackBachLfCasc || trackEta < etaMinTrackBachLfCasc)) { + CLRBIT(statusProng, CandidateType::CandCascadeBachelor); + if (fillHistograms) { + registry.fill(HIST("hRejTracks"), (nCuts + 1) * CandidateType::CandCascadeBachelor + iCut); + } + } + // quality cut iCut = 4; bool hasGoodQuality = true; @@ -701,6 +730,35 @@ struct HfTrackIndexSkimCreatorTagSelTracks { } } + // quality cut for bachelor in cascade + bachelor decays + hasGoodQuality = true; + if (doCutQuality.value && TESTBIT(statusProng, CandidateType::CandCascadeBachelor)) { + if (useIsGlobalTrackForBachLfCasc) { + if (!hfTrack.isGlobalTrack()) { + hasGoodQuality = false; + } + } else if (useIsGlobalTrackWoDCAForBachLfCasc) { + if (!hfTrack.isGlobalTrackWoDCA()) { + hasGoodQuality = false; + } + } else if (useIsQualityTrackITSForBachLfCasc) { + if (!hfTrack.isQualityTrackITS()) { + hasGoodQuality = false; + } + } else { // selections for Run2 converted data + UChar_t clustermap = hfTrack.itsClusterMap(); + if (!(TESTBIT(hfTrack.flags(), o2::aod::track::ITSrefit) && (TESTBIT(clustermap, 0) || TESTBIT(clustermap, 1)))) { + hasGoodQuality = false; + } + } + if (!hasGoodQuality) { + CLRBIT(statusProng, CandidateType::CandCascadeBachelor); + if (fillHistograms) { + registry.fill(HIST("hRejTracks"), (nCuts + 1) * CandidateType::CandCascadeBachelor + iCut); + } + } + } + // DCA cut iCut = 5; if (statusProng > 0) { @@ -741,6 +799,12 @@ struct HfTrackIndexSkimCreatorTagSelTracks { registry.fill(HIST("hDCAToPrimXYVsPtCutsSoftPionForDstar"), trackPt, dca[0]); registry.fill(HIST("hRejTracks"), (nCuts + 1) * CandidateType::CandDstar + iCut); } + if (TESTBIT(statusProng, CandidateType::CandCascadeBachelor)) { + registry.fill(HIST("hPtCutsCascadeBachelor"), trackPt); + registry.fill(HIST("hEtaCutsCascadeBachelor"), trackEta); + registry.fill(HIST("hDCAToPrimXYVsPtCutsCascadeBachelor"), trackPt, dca[0]); + registry.fill(HIST("hRejTracks"), (nCuts + 1) * CandidateType::CandCascadeBachelor + iCut); + } } } @@ -3433,7 +3497,7 @@ struct HfTrackIndexSkimCreatorLfCascades { hfFlag = 0; - if (!TESTBIT(trackIdPion1.isSelProng(), CandidateType::CandV0bachelor)) { + if (!TESTBIT(trackIdPion1.isSelProng(), CandidateType::CandCascadeBachelor)) { continue; } @@ -3529,7 +3593,7 @@ struct HfTrackIndexSkimCreatorLfCascades { hfFlag = 0; - if (!TESTBIT(trackIdPion2.isSelProng(), CandidateType::CandV0bachelor)) { + if (!TESTBIT(trackIdPion2.isSelProng(), CandidateType::CandCascadeBachelor)) { continue; } diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 7898c57a154..efc542f76cc 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -34,6 +34,7 @@ #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGHF/Core/SelectorCuts.h" @@ -172,6 +173,7 @@ struct HfTreeCreatorOmegacSt { Configurable minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any X is smaller than this"}; Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations if chi2/chi2old > this"}; Configurable minNoClsTrackedCascade{"minNoClsTrackedCascade", 70, "Minimum number of clusters required for daughters of tracked cascades"}; + Configurable minNoClsTrackedPion{"minNoClsTrackedPion", 70, "Minimum number of clusters required for associated pions"}; Configurable massWindowTrackedOmega{"massWindowTrackedOmega", 0.05, "Inv. mass window for tracked Omega"}; Configurable massWindowXiExclTrackedOmega{"massWindowXiExclTrackedOmega", 0.005, "Inv. mass window for exclusion of Xi for tracked Omega-"}; Configurable massWindowTrackedXi{"massWindowTrackedXi", 0., "Inv. mass window for tracked Xi"}; @@ -190,11 +192,13 @@ struct HfTreeCreatorOmegacSt { Service ccdb; o2::vertexing::DCAFitterN<2> df2; + TrackSelection trackSelector; + bool bzOnly = true; float bz = 0.; int runNumber{0}; - using TracksExt = soa::Join; + using TracksExt = soa::Join; using TracksExtMc = soa::Join; HistogramRegistry registry{ @@ -235,6 +239,19 @@ struct HfTreeCreatorOmegacSt { o2::base::Propagator::Instance(true)->setMatLUT(lut); } + trackSelector.SetTrackType(o2::aod::track::TrackTypeEnum::Track); + trackSelector.SetEtaRange(-.9, .9); + trackSelector.SetRequireITSRefit(true); + trackSelector.SetRequireTPCRefit(true); + trackSelector.SetRequireGoldenChi2(false); + trackSelector.SetMinNCrossedRowsTPC(minNoClsTrackedPion); + trackSelector.SetMinNCrossedRowsOverFindableClustersTPC(0.8f); + trackSelector.SetMaxChi2PerClusterTPC(4.f); + trackSelector.SetRequireHitsInITSLayers(1, {0, 1, 2}); // one hit in any of the first three layers of IB + trackSelector.SetMaxChi2PerClusterITS(36.f); + trackSelector.SetMaxDcaXY(1.f); + trackSelector.SetMaxDcaZ(2.f); + df2.setPropagateToPCA(propToDCA); df2.setMaxR(maxR); df2.setMaxDZIni(maxDZIni); @@ -386,8 +403,16 @@ struct HfTreeCreatorOmegacSt { } for (const auto& track : tracks) { - if (std::abs(track.tpcNSigmaPi()) < maxNSigmaPion) { + const auto trackId = track.globalIndex(); + if (trackId == v0TrackPr.globalIndex() || + trackId == v0TrackPi.globalIndex() || + trackId == bachelor.globalIndex()) { + continue; + } + if (trackSelector.IsSelected(track) && + (std::abs(track.tpcNSigmaPi()) < maxNSigmaPion)) { LOGF(debug, " .. combining with pion candidate %d", track.globalIndex()); + auto trackParCovCasc = getTrackParCov(trackCasc); auto trackParCovPion = getTrackParCov(track); o2::dataformats::DCA impactParameterPion; if (bzOnly) { @@ -396,7 +421,7 @@ struct HfTreeCreatorOmegacSt { o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParCovPion, 2.f, matCorr, &impactParameterPion); } - if (df2.process(trackParCovTrk, trackParCovPion)) { + if (df2.process(trackParCovCasc, trackParCovPion)) { const auto& secondaryVertex = df2.getPCACandidate(); const auto decayLength = RecoDecay::distance(secondaryVertex, primaryVertexPos); const auto decayLengthXY = RecoDecay::distanceXY(secondaryVertex, primaryVertexPos); diff --git a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx index 67022a16f09..b3bd0e93fa5 100644 --- a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx @@ -11,9 +11,10 @@ /// \file treeCreatorXicToPKPi.cxx /// \brief Writer of XiC -> pKpi candidates in the form of flat tables to be stored in TTrees. -/// inspired from file treeCreatorLcToPKPi.cxx +/// inspired from file treeCreatorLcToPKPi.cxx and to treeCreatorDplusToPiKPi.cxx /// \author Himanshu Sharma , INFN Padova +/// \author Cristina Terrevoli , INFN Bari #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" @@ -84,6 +85,47 @@ DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int); DECLARE_SOA_COLUMN(RunNumber, runNumber, int); } // namespace full +DECLARE_SOA_TABLE(HfCandXicLites, "AOD", "HFCANDXICLITE", + hf_cand::Chi2PCA, + full::DecayLength, + full::DecayLengthXY, + full::DecayLengthNormalised, + full::DecayLengthXYNormalised, + full::PtProng0, + full::PtProng1, + full::PtProng2, + hf_cand::ImpactParameter0, + hf_cand::ImpactParameter1, + hf_cand::ImpactParameter2, + full::NSigTpcPi0, + full::NSigTpcKa0, + full::NSigTpcPr0, + full::NSigTofPi0, + full::NSigTofKa0, + full::NSigTofPr0, + full::NSigTpcPi1, + full::NSigTpcKa1, + full::NSigTpcPr1, + full::NSigTofPi1, + full::NSigTofKa1, + full::NSigTofPr1, + full::NSigTpcPi2, + full::NSigTpcKa2, + full::NSigTpcPr2, + full::NSigTofPi2, + full::NSigTofKa2, + full::NSigTofPr2, + full::CandidateSelFlag, + full::M, + full::Pt, + full::Cpa, + full::CpaXY, + full::Eta, + full::Phi, + full::FlagMc, + full::OriginMcRec, + full::IsCandidateSwapped) + DECLARE_SOA_TABLE(HfCandXicFulls, "AOD", "HFCANDXICFULL", full::CollisionId, collision::PosX, @@ -186,8 +228,11 @@ struct HfTreeCreatorXicToPKPi { Produces rowCandidateFull; Produces rowCandidateFullEvents; Produces rowCandidateFullParticles; + Produces rowCandidateLite; - Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to store in the tree"}; + Configurable fillCandidateLiteTable{"fillCandidateLiteTable", false, "Switch to fill lite table with candidate properties"}; + // parameters for production of training samples + Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; HfHelper hfHelper; @@ -218,7 +263,11 @@ struct HfTreeCreatorXicToPKPi { } // Filling candidate properties - rowCandidateFull.reserve(candidates.size()); + if (fillCandidateLiteTable) { + rowCandidateLite.reserve(candidates.size()); + } else { + rowCandidateFull.reserve(candidates.size()); + } for (const auto& candidate : candidates) { auto trackPos1 = candidate.prong0_as(); // positive daughter (negative for the antiparticles) auto trackNeg = candidate.prong1_as(); // negative daughter (positive for the antiparticles) @@ -231,79 +280,122 @@ struct HfTreeCreatorXicToPKPi { float FunctionE) { double pseudoRndm = trackPos1.pt() * 1000. - (int64_t)(trackPos1.pt() * 1000); if (FunctionSelection >= 1 && pseudoRndm < downSampleBkgFactor) { - rowCandidateFull( - candidate.collisionId(), - candidate.posX(), - candidate.posY(), - candidate.posZ(), - candidate.xSecondaryVertex(), - candidate.ySecondaryVertex(), - candidate.zSecondaryVertex(), - candidate.errorDecayLength(), - candidate.errorDecayLengthXY(), - candidate.chi2PCA(), - candidate.rSecondaryVertex(), - candidate.decayLength(), - candidate.decayLengthXY(), - candidate.decayLengthNormalised(), - candidate.decayLengthXYNormalised(), - candidate.impactParameterNormalised0(), - candidate.ptProng0(), - RecoDecay::p(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), - candidate.impactParameterNormalised1(), - candidate.ptProng1(), - RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), - candidate.impactParameterNormalised2(), - candidate.ptProng2(), - RecoDecay::p(candidate.pxProng2(), candidate.pyProng2(), candidate.pzProng2()), - candidate.pxProng0(), - candidate.pyProng0(), - candidate.pzProng0(), - candidate.pxProng1(), - candidate.pyProng1(), - candidate.pzProng1(), - candidate.pxProng2(), - candidate.pyProng2(), - candidate.pzProng2(), - candidate.impactParameter0(), - candidate.impactParameter1(), - candidate.impactParameter2(), - candidate.errorImpactParameter0(), - candidate.errorImpactParameter1(), - candidate.errorImpactParameter2(), - trackPos1.tpcNSigmaPi(), - trackPos1.tpcNSigmaKa(), - trackPos1.tpcNSigmaPr(), - trackPos1.tofNSigmaPi(), - trackPos1.tofNSigmaKa(), - trackPos1.tofNSigmaPr(), - trackNeg.tpcNSigmaPi(), - trackNeg.tpcNSigmaKa(), - trackNeg.tpcNSigmaPr(), - trackNeg.tofNSigmaPi(), - trackNeg.tofNSigmaKa(), - trackNeg.tofNSigmaPr(), - trackPos2.tpcNSigmaPi(), - trackPos2.tpcNSigmaKa(), - trackPos2.tpcNSigmaPr(), - trackPos2.tofNSigmaPi(), - trackPos2.tofNSigmaKa(), - trackPos2.tofNSigmaPr(), - 1 << CandFlag, - FunctionInvMass, - candidate.pt(), - candidate.p(), - candidate.cpa(), - candidate.cpaXY(), - FunctionCt, - candidate.eta(), - candidate.phi(), - FunctionY, - FunctionE, - candidate.flagMcMatchRec(), - candidate.originMcRec(), - candidate.isCandidateSwapped(), - candidate.globalIndex()); + if (fillCandidateLiteTable) { + rowCandidateLite( + candidate.chi2PCA(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.ptProng0(), + candidate.ptProng1(), + candidate.ptProng2(), + candidate.impactParameter0(), + candidate.impactParameter1(), + candidate.impactParameter2(), + trackPos1.tpcNSigmaPi(), + trackPos1.tpcNSigmaKa(), + trackPos1.tpcNSigmaPr(), + trackPos1.tofNSigmaPi(), + trackPos1.tofNSigmaKa(), + trackPos1.tofNSigmaPr(), + trackNeg.tpcNSigmaPi(), + trackNeg.tpcNSigmaKa(), + trackNeg.tpcNSigmaPr(), + trackNeg.tofNSigmaPi(), + trackNeg.tofNSigmaKa(), + trackNeg.tofNSigmaPr(), + trackPos2.tpcNSigmaPi(), + trackPos2.tpcNSigmaKa(), + trackPos2.tpcNSigmaPr(), + trackPos2.tofNSigmaPi(), + trackPos2.tofNSigmaKa(), + trackPos2.tofNSigmaPr(), + 1 << CandFlag, + FunctionInvMass, + candidate.pt(), + candidate.cpa(), + candidate.cpaXY(), + candidate.eta(), + candidate.phi(), + candidate.flagMcMatchRec(), + candidate.originMcRec(), + candidate.isCandidateSwapped()); + } else { + rowCandidateFull( + candidate.collisionId(), + candidate.posX(), + candidate.posY(), + candidate.posZ(), + candidate.xSecondaryVertex(), + candidate.ySecondaryVertex(), + candidate.zSecondaryVertex(), + candidate.errorDecayLength(), + candidate.errorDecayLengthXY(), + candidate.chi2PCA(), + candidate.rSecondaryVertex(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.impactParameterNormalised0(), + candidate.ptProng0(), + RecoDecay::p(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), + candidate.impactParameterNormalised1(), + candidate.ptProng1(), + RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), + candidate.impactParameterNormalised2(), + candidate.ptProng2(), + RecoDecay::p(candidate.pxProng2(), candidate.pyProng2(), candidate.pzProng2()), + candidate.pxProng0(), + candidate.pyProng0(), + candidate.pzProng0(), + candidate.pxProng1(), + candidate.pyProng1(), + candidate.pzProng1(), + candidate.pxProng2(), + candidate.pyProng2(), + candidate.pzProng2(), + candidate.impactParameter0(), + candidate.impactParameter1(), + candidate.impactParameter2(), + candidate.errorImpactParameter0(), + candidate.errorImpactParameter1(), + candidate.errorImpactParameter2(), + trackPos1.tpcNSigmaPi(), + trackPos1.tpcNSigmaKa(), + trackPos1.tpcNSigmaPr(), + trackPos1.tofNSigmaPi(), + trackPos1.tofNSigmaKa(), + trackPos1.tofNSigmaPr(), + trackNeg.tpcNSigmaPi(), + trackNeg.tpcNSigmaKa(), + trackNeg.tpcNSigmaPr(), + trackNeg.tofNSigmaPi(), + trackNeg.tofNSigmaKa(), + trackNeg.tofNSigmaPr(), + trackPos2.tpcNSigmaPi(), + trackPos2.tpcNSigmaKa(), + trackPos2.tpcNSigmaPr(), + trackPos2.tofNSigmaPi(), + trackPos2.tofNSigmaKa(), + trackPos2.tofNSigmaPr(), + 1 << CandFlag, + FunctionInvMass, + candidate.pt(), + candidate.p(), + candidate.cpa(), + candidate.cpaXY(), + FunctionCt, + candidate.eta(), + candidate.phi(), + FunctionY, + FunctionE, + candidate.flagMcMatchRec(), + candidate.originMcRec(), + candidate.isCandidateSwapped(), + candidate.globalIndex()); + } } }; @@ -350,7 +442,11 @@ struct HfTreeCreatorXicToPKPi { } // Filling candidate properties - rowCandidateFull.reserve(candidates.size()); + if (fillCandidateLiteTable) { + rowCandidateLite.reserve(candidates.size()); + } else { + rowCandidateFull.reserve(candidates.size()); + } for (const auto& candidate : candidates) { auto trackPos1 = candidate.prong0_as(); // positive daughter (negative for the antiparticles) auto trackNeg = candidate.prong1_as(); // negative daughter (positive for the antiparticles) @@ -363,82 +459,124 @@ struct HfTreeCreatorXicToPKPi { float FunctionE) { double pseudoRndm = trackPos1.pt() * 1000. - (int64_t)(trackPos1.pt() * 1000); if (FunctionSelection >= 1 && pseudoRndm < downSampleBkgFactor) { - rowCandidateFull( - candidate.collisionId(), - candidate.posX(), - candidate.posY(), - candidate.posZ(), - candidate.xSecondaryVertex(), - candidate.ySecondaryVertex(), - candidate.zSecondaryVertex(), - candidate.errorDecayLength(), - candidate.errorDecayLengthXY(), - candidate.chi2PCA(), - candidate.rSecondaryVertex(), - candidate.decayLength(), - candidate.decayLengthXY(), - candidate.decayLengthNormalised(), - candidate.decayLengthXYNormalised(), - candidate.impactParameterNormalised0(), - candidate.ptProng0(), - RecoDecay::p(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), - candidate.impactParameterNormalised1(), - candidate.ptProng1(), - RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), - candidate.impactParameterNormalised2(), - candidate.ptProng2(), - RecoDecay::p(candidate.pxProng2(), candidate.pyProng2(), candidate.pzProng2()), - candidate.pxProng0(), - candidate.pyProng0(), - candidate.pzProng0(), - candidate.pxProng1(), - candidate.pyProng1(), - candidate.pzProng1(), - candidate.pxProng2(), - candidate.pyProng2(), - candidate.pzProng2(), - candidate.impactParameter0(), - candidate.impactParameter1(), - candidate.impactParameter2(), - candidate.errorImpactParameter0(), - candidate.errorImpactParameter1(), - candidate.errorImpactParameter2(), - trackPos1.tpcNSigmaPi(), - trackPos1.tpcNSigmaKa(), - trackPos1.tpcNSigmaPr(), - trackPos1.tofNSigmaPi(), - trackPos1.tofNSigmaKa(), - trackPos1.tofNSigmaPr(), - trackNeg.tpcNSigmaPi(), - trackNeg.tpcNSigmaKa(), - trackNeg.tpcNSigmaPr(), - trackNeg.tofNSigmaPi(), - trackNeg.tofNSigmaKa(), - trackNeg.tofNSigmaPr(), - trackPos2.tpcNSigmaPi(), - trackPos2.tpcNSigmaKa(), - trackPos2.tpcNSigmaPr(), - trackPos2.tofNSigmaPi(), - trackPos2.tofNSigmaKa(), - trackPos2.tofNSigmaPr(), - 1 << CandFlag, - FunctionInvMass, - candidate.pt(), - candidate.p(), - candidate.cpa(), - candidate.cpaXY(), - FunctionCt, - candidate.eta(), - candidate.phi(), - FunctionY, - FunctionE, - 0., - 0., - 0., - candidate.globalIndex()); + if (fillCandidateLiteTable) { + rowCandidateLite( + candidate.chi2PCA(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.ptProng0(), + candidate.ptProng1(), + candidate.ptProng2(), + candidate.impactParameter0(), + candidate.impactParameter1(), + candidate.impactParameter2(), + trackPos1.tpcNSigmaPi(), + trackPos1.tpcNSigmaKa(), + trackPos1.tpcNSigmaPr(), + trackPos1.tofNSigmaPi(), + trackPos1.tofNSigmaKa(), + trackPos1.tofNSigmaPr(), + trackNeg.tpcNSigmaPi(), + trackNeg.tpcNSigmaKa(), + trackNeg.tpcNSigmaPr(), + trackNeg.tofNSigmaPi(), + trackNeg.tofNSigmaKa(), + trackNeg.tofNSigmaPr(), + trackPos2.tpcNSigmaPi(), + trackPos2.tpcNSigmaKa(), + trackPos2.tpcNSigmaPr(), + trackPos2.tofNSigmaPi(), + trackPos2.tofNSigmaKa(), + trackPos2.tofNSigmaPr(), + 1 << CandFlag, + FunctionInvMass, + candidate.pt(), + candidate.cpa(), + candidate.cpaXY(), + candidate.eta(), + candidate.phi(), + 0., + 0., + 0.); + } else { + rowCandidateFull( + candidate.collisionId(), + candidate.posX(), + candidate.posY(), + candidate.posZ(), + candidate.xSecondaryVertex(), + candidate.ySecondaryVertex(), + candidate.zSecondaryVertex(), + candidate.errorDecayLength(), + candidate.errorDecayLengthXY(), + candidate.chi2PCA(), + candidate.rSecondaryVertex(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.impactParameterNormalised0(), + candidate.ptProng0(), + RecoDecay::p(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), + candidate.impactParameterNormalised1(), + candidate.ptProng1(), + RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), + candidate.impactParameterNormalised2(), + candidate.ptProng2(), + RecoDecay::p(candidate.pxProng2(), candidate.pyProng2(), candidate.pzProng2()), + candidate.pxProng0(), + candidate.pyProng0(), + candidate.pzProng0(), + candidate.pxProng1(), + candidate.pyProng1(), + candidate.pzProng1(), + candidate.pxProng2(), + candidate.pyProng2(), + candidate.pzProng2(), + candidate.impactParameter0(), + candidate.impactParameter1(), + candidate.impactParameter2(), + candidate.errorImpactParameter0(), + candidate.errorImpactParameter1(), + candidate.errorImpactParameter2(), + trackPos1.tpcNSigmaPi(), + trackPos1.tpcNSigmaKa(), + trackPos1.tpcNSigmaPr(), + trackPos1.tofNSigmaPi(), + trackPos1.tofNSigmaKa(), + trackPos1.tofNSigmaPr(), + trackNeg.tpcNSigmaPi(), + trackNeg.tpcNSigmaKa(), + trackNeg.tpcNSigmaPr(), + trackNeg.tofNSigmaPi(), + trackNeg.tofNSigmaKa(), + trackNeg.tofNSigmaPr(), + trackPos2.tpcNSigmaPi(), + trackPos2.tpcNSigmaKa(), + trackPos2.tpcNSigmaPr(), + trackPos2.tofNSigmaPi(), + trackPos2.tofNSigmaKa(), + trackPos2.tofNSigmaPr(), + 1 << CandFlag, + FunctionInvMass, + candidate.pt(), + candidate.p(), + candidate.cpa(), + candidate.cpaXY(), + FunctionCt, + candidate.eta(), + candidate.phi(), + FunctionY, + FunctionE, + 0., + 0., + 0., + candidate.globalIndex()); + } } }; - fillTable(0, candidate.isSelXicToPKPi(), hfHelper.invMassXicToPKPi(candidate), hfHelper.ctXic(candidate), hfHelper.yXic(candidate), hfHelper.eXic(candidate)); fillTable(1, candidate.isSelXicToPiKP(), hfHelper.invMassXicToPiKP(candidate), hfHelper.ctXic(candidate), hfHelper.yXic(candidate), hfHelper.eXic(candidate)); } diff --git a/PWGJE/TableProducer/jettrackderived.cxx b/PWGJE/TableProducer/jettrackderived.cxx index 5fff4fcec48..923881c963b 100644 --- a/PWGJE/TableProducer/jettrackderived.cxx +++ b/PWGJE/TableProducer/jettrackderived.cxx @@ -109,6 +109,7 @@ struct jetspectraDerivedMaker { histos.add("EventProp/collisionVtxZSel8", "Collsion Vertex Z with event selection;#it{Vtx}_{z} [cm];number of entries", HistType::kTH1F, {{nBins, -20, 20}}); histos.add("EventProp/sampledvertexz", "Sampled collsion Vertex Z with event (sel8) selection;#it{Vtx}_{z} [cm];number of entries", HistType::kTH1F, {{nBins, -20, 20}}); histos.add("EventProp/NumContrib", "Number of contributors to vertex of collision; number of contributors to vtx; number of entries", HistType::kTH1F, {{nBins, 0, 600}}); + histos.add("EventProp/rejectedCollId", "CollisionId of collisions that did not pass the event selection; collisionId; number of entries", HistType::kTH1F, {{10, 0, 5}}); const AxisSpec axisPercentileFT0A{binsPercentile, "Centrality FT0A"}; const AxisSpec axisPercentileFT0C{binsPercentile, "Centrality FT0C"}; @@ -128,80 +129,82 @@ struct jetspectraDerivedMaker { { // here we already fill some event histos for cross checks if (!collision.sel8()) { + histos.fill(HIST("EventProp/rejectedCollId"), 2); return false; } if (abs(collision.posZ()) > ValVtx) { + histos.fill(HIST("EventProp/rejectedCollId"), 3); return false; } histos.fill(HIST("EventProp/collisionVtxZ"), collision.posZ()); // test fill // Last thing, check the sampling if (fractionOfEvents < 1.f && (static_cast(rand_r(&randomSeed)) / static_cast(RAND_MAX)) > fractionOfEvents) { // Skip events that are not sampled + histos.fill(HIST("EventProp/rejectedCollId"), 4); return false; } histos.fill(HIST("EventProp/sampledvertexz"), collision.posZ()); histos.fill(HIST("EventProp/NumContrib"), collision.numContrib()); - return true; - - if (fillMultiplicity) { - histos.fill(HIST("Centrality/FT0M"), collision.centFT0M()); + if (fillMultiplicity == true) { histos.fill(HIST("Centrality/FT0A"), collision.centFT0A()); - histos.fill(HIST("Mult/FT0M"), collision.multFT0M()); + histos.fill(HIST("Centrality/FT0C"), collision.centFT0C()); + histos.fill(HIST("Mult/FT0C"), collision.multFT0C()); histos.fill(HIST("Mult/FT0A"), collision.multFT0A()); histos.fill(HIST("Mult/NTracksPV"), collision.multNTracksPV()); } + return true; } Produces tableTrack; using CollisionCandidate = soa::Join; using TrackCandidates = soa::Join; unsigned int randomSeed = 0; - void processData(CollisionCandidate::iterator const& collision, - TrackCandidates const& tracks, - aod::BCs const&) + void processData(CollisionCandidate const& collisions, + TrackCandidates const& tracks) { - if (!isEventSelected(collision)) { - return; + for (const auto& collision : collisions) { + if (!isEventSelected(collision)) { + histos.fill(HIST("EventProp/rejectedCollId"), 1); + } } + tableTrack.reserve(tracks.size()); for (const auto& trk : tracks) { - if (!trk.has_collision() || !(collision.globalIndex() == trk.collisionId())) { - return; - } - if (!customTrackCuts.IsSelected(trk)) { - return; + if (!customTrackCuts.IsSelected(trk)) { // we fill all tracks that have a collision(rejected or not) and pass this check ! + continue; + } else { + tableTrack(trk.collisionId(), + trk.trackTime(), + trk.signed1Pt(), trk.eta(), trk.phi(), trk.pt(), + trk.sigma1Pt(), + trk.alpha(), + trk.x(), trk.y(), trk.z(), + trk.snp(), + trk.tgl(), + trk.isPVContributor(), + trk.hasTRD(), + trk.hasITS(), + trk.hasTPC(), + trk.isGlobalTrack(), + trk.isGlobalTrackWoDCA(), + trk.isGlobalTrackWoPtEta(), + trk.flags(), + trk.trackType(), + trk.length(), + trk.tpcChi2NCl(), trk.itsChi2NCl(), trk.tofChi2(), + trk.tpcNClsShared(), + trk.tpcNClsFindable(), + trk.tpcNClsFindableMinusFound(), + trk.tpcNClsFindableMinusCrossedRows(), + trk.itsClusterMap(), + trk.itsNCls(), + trk.tpcFractionSharedCls(), + trk.tpcNClsFound(), + trk.tpcNClsCrossedRows(), + trk.tpcCrossedRowsOverFindableCls(), + trk.tpcFoundOverFindableCls(), + trk.dcaXY(), + trk.dcaZ()); } - tableTrack(trk.collisionId(), - trk.trackTime(), - trk.signed1Pt(), trk.eta(), trk.phi(), trk.pt(), - trk.sigma1Pt(), - trk.alpha(), - trk.x(), trk.y(), trk.z(), - trk.snp(), - trk.tgl(), - trk.isPVContributor(), - trk.hasTRD(), - trk.hasITS(), - trk.hasTPC(), - trk.isGlobalTrack(), - trk.isGlobalTrackWoDCA(), - trk.isGlobalTrackWoPtEta(), - trk.flags(), - trk.trackType(), - trk.length(), - trk.tpcChi2NCl(), trk.itsChi2NCl(), trk.tofChi2(), - trk.tpcNClsShared(), - trk.tpcNClsFindable(), - trk.tpcNClsFindableMinusFound(), - trk.tpcNClsFindableMinusCrossedRows(), - trk.itsClusterMap(), - trk.itsNCls(), - trk.tpcFractionSharedCls(), - trk.tpcNClsFound(), - trk.tpcNClsCrossedRows(), - trk.tpcCrossedRowsOverFindableCls(), - trk.tpcFoundOverFindableCls(), - trk.dcaXY(), - trk.dcaZ()); } } diff --git a/PWGJE/Tasks/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index 745ac543e91..6534cc97114 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -92,6 +92,10 @@ if(FastJet_FOUND) SOURCES trackJetqa.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-hadron-recoil + SOURCES jetHadronRecoil.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-nsubjettiness SOURCES nSubjettiness.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore diff --git a/PWGJE/Tasks/emctmmonitor.cxx b/PWGJE/Tasks/emctmmonitor.cxx index af3891a8622..2fa9f597690 100644 --- a/PWGJE/Tasks/emctmmonitor.cxx +++ b/PWGJE/Tasks/emctmmonitor.cxx @@ -116,6 +116,7 @@ struct TrackMatchingMonitor { const o2Axis clusterptAxis{makePtBinning(), "#it{p}_{T}"}; const o2Axis etaAxis{160, -0.8, 0.8, "#eta"}; const o2Axis phiAxis{72, 0, 2 * 3.14159, "#varphi (rad)"}; + const o2Axis smAxis{20, -0.5, 19.5, "SM"}; o2Axis timeAxis{mClusterTimeBinning, "t_{cl} (ns)"}; int MaxMatched = 20; // maximum number of matched tracks, hardcoded in emcalCorrectionTask.cxx! @@ -138,20 +139,20 @@ struct TrackMatchingMonitor { mHistManager.add("MatchedTrackEtaPhi", "#eta vs #varphi of all selected matched tracks", o2HistType::kTH2F, {etaAxis, phiAxis}); // eta vs phi of all selected matched tracks mHistManager.add("MatchedTrackEtaPhi_Neg", "#eta vs #varphi of all selected negative matched tracks", o2HistType::kTH2F, {etaAxis, phiAxis}); // eta vs phi of all selected negative matched tracks mHistManager.add("MatchedTrackEtaPhi_Pos", "#eta vs #varphi of all selected positive matched tracks", o2HistType::kTH2F, {etaAxis, phiAxis}); // eta vs phi of all selected positive matched tracks - mHistManager.add("clusterTM_dEtadPhi", "cluster trackmatching dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest track - mHistManager.add("clusterTM_dEtadPhi_ASide", "cluster trackmatching in A-Side dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest track in A-Aside - mHistManager.add("clusterTM_dEtadPhi_CSide", "cluster trackmatching in C-Side tracks dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest track in C-Side - mHistManager.add("clusterTM_PosdEtadPhi", "cluster trackmatching positive tracks dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest positive track - mHistManager.add("clusterTM_NegdEtadPhi", "cluster trackmatching negative tracks dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest negative track - mHistManager.add("clusterTM_PosdEtadPhi_Pl0_75", "cluster trackmatching positive tracks, p < 0.75 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest positive track with p < 0.75 GeV/c - mHistManager.add("clusterTM_NegdEtadPhi_Pl0_75", "cluster trackmatching negative tracks, p < 0.75 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest negative track with p < 0.75 GeV/c - mHistManager.add("clusterTM_PosdEtadPhi_0_75leqPl1_25", "cluster trackmatching positive tracks, 0.75 <= p < 1.25 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest positive track with 0.75 <= p < 1.25 GeV/c - mHistManager.add("clusterTM_NegdEtadPhi_0_75leqPl1_25", "cluster trackmatching negative tracks, 0.75 <= p < 1.25 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest negative track with 0.75 <= p < 1.25 GeV/c - mHistManager.add("clusterTM_PosdEtadPhi_Pgeq1_25", "cluster trackmatching positive tracks, p >= 1.25 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest positive track with p >= 1.25 GeV/c - mHistManager.add("clusterTM_NegdEtadPhi_Pgeq1_25", "cluster trackmatching negative tracks, p >= 1.25 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, nmatchedtrack}); // dEta dPhi of the Nth clostest negative track with p >= 1.25 GeV/c - mHistManager.add("clusterTM_dEtaPt", "cluster trackmatching dEta/#it{p}_{T};d#it{#eta};#it{p}_{T} (GeV/#it{c})", o2HistType::kTH3F, {dEtaAxis, clusterptAxis, nmatchedtrack}); // dEta vs pT of the Nth clostest track - mHistManager.add("clusterTM_PosdPhiPt", "cluster trackmatching positive tracks dPhi/#it{p}_{T}", o2HistType::kTH3F, {dPhiAxis, clusterptAxis, nmatchedtrack}); // dPhi vs pT of the Nth clostest positive track - mHistManager.add("clusterTM_NegdPhiPt", "cluster trackmatching negative tracks dPh/#it{p}_{T}", o2HistType::kTH3F, {dPhiAxis, clusterptAxis, nmatchedtrack}); // dPhi vs pT of the Nth clostest negative track + mHistManager.add("clusterTM_dEtadPhi", "cluster trackmatching dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM + mHistManager.add("clusterTM_dEtadPhi_ASide", "cluster trackmatching in A-Side dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM in A-Aside + mHistManager.add("clusterTM_dEtadPhi_CSide", "cluster trackmatching in C-Side tracks dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM in C-Side + mHistManager.add("clusterTM_PosdEtadPhi", "cluster trackmatching positive tracks dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM positive track + mHistManager.add("clusterTM_NegdEtadPhi", "cluster trackmatching negative tracks dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM negative track + mHistManager.add("clusterTM_PosdEtadPhi_Pl0_75", "cluster trackmatching positive tracks, p < 0.75 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM positive track with p < 0.75 GeV/c + mHistManager.add("clusterTM_NegdEtadPhi_Pl0_75", "cluster trackmatching negative tracks, p < 0.75 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM negative track with p < 0.75 GeV/c + mHistManager.add("clusterTM_PosdEtadPhi_0_75leqPl1_25", "cluster trackmatching positive tracks, 0.75 <= p < 1.25 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM positive track with 0.75 <= p < 1.25 GeV/c + mHistManager.add("clusterTM_NegdEtadPhi_0_75leqPl1_25", "cluster trackmatching negative tracks, 0.75 <= p < 1.25 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM negative track with 0.75 <= p < 1.25 GeV/c + mHistManager.add("clusterTM_PosdEtadPhi_Pgeq1_25", "cluster trackmatching positive tracks, p >= 1.25 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM positive track with p >= 1.25 GeV/c + mHistManager.add("clusterTM_NegdEtadPhi_Pgeq1_25", "cluster trackmatching negative tracks, p >= 1.25 dEta/dPhi", o2HistType::kTH3F, {dEtaAxis, dPhiAxis, smAxis}); // dEta dPhi per SM negative track with p >= 1.25 GeV/c + mHistManager.add("clusterTM_dEtaPt", "cluster trackmatching dEta/#it{p}_{T};d#it{#eta};#it{p}_{T} (GeV/#it{c})", o2HistType::kTH3F, {dEtaAxis, clusterptAxis, smAxis}); // dEta vs pT per SM + mHistManager.add("clusterTM_PosdPhiPt", "cluster trackmatching positive tracks dPhi/#it{p}_{T}", o2HistType::kTH3F, {dPhiAxis, clusterptAxis, smAxis}); // dPhi vs pT per SM positive track + mHistManager.add("clusterTM_NegdPhiPt", "cluster trackmatching negative tracks dPh/#it{p}_{T}", o2HistType::kTH3F, {dPhiAxis, clusterptAxis, smAxis}); // dPhi vs pT per SM negative track mHistManager.add("clusterTM_dEtaTN", "cluster trackmatching dEta/TN;d#it{#eta};#it{N}_{matched tracks}", o2HistType::kTH2F, {dEtaAxis, nmatchedtrack}); // dEta compared to the Nth closest track mHistManager.add("clusterTM_dPhiTN", "cluster trackmatching dPhi/TN;d#it{#varphi} (rad);#it{N}_{matched tracks}", o2HistType::kTH2F, {dPhiAxis, nmatchedtrack}); // dPhi compared to the Nth closest track mHistManager.add("clusterTM_dRTN", "cluster trackmatching dR/TN;d#it{R};#it{N}_{matched tracks}", o2HistType::kTH2F, {dRAxis, nmatchedtrack}); // dR compared to the Nth closest track @@ -291,6 +292,7 @@ struct TrackMatchingMonitor { // using globTracks = o2::soa::Join; // In this example the counter t is just used to only look at the closest match double dEta, dPhi, pT, abs_p, trackEta, trackPhi, NSigmaEl; + auto supermoduleID = mGeometry->SuperModuleNumberFromEtaPhi(cluster.eta(), cluster.phi()); pT = cluster.energy() / cosh(cluster.eta()); if (M02highPt > 0. && cluster.m02() >= maxM02HighPt && pT >= M02highPt) { // high pT M02 cut continue; @@ -327,6 +329,11 @@ struct TrackMatchingMonitor { if (hasTRD && !(match.track_as().hasTRD())) { // request TRD hit cut continue; } + // only fill these for the first matched track: + if (t == 0) { + mHistManager.fill(HIST("clusterTM_dEtadPhi"), dEta, dPhi, supermoduleID); + mHistManager.fill(HIST("clusterTM_dEtaPt"), dEta, pT, supermoduleID); + } double eOverP = cluster.energy() / abs_p; mHistManager.fill(HIST("clusterTM_dEtaTN"), dEta, t); mHistManager.fill(HIST("clusterTM_dPhiTN"), dPhi, t); @@ -343,35 +350,39 @@ struct TrackMatchingMonitor { mHistManager.fill(HIST("clusterTM_NSigma_cut"), NSigmaEl, match.track_as().pt(), t); } // A- and C-side - if (match.track_as().eta() > 0.0) { - mHistManager.fill(HIST("clusterTM_dEtadPhi_ASide"), dEta, dPhi, t); - } else if (match.track_as().eta() < 0.0) { - mHistManager.fill(HIST("clusterTM_dEtadPhi_CSide"), dEta, dPhi, t); + if (match.track_as().eta() > 0.0 && t == 0) { + mHistManager.fill(HIST("clusterTM_dEtadPhi_ASide"), dEta, dPhi, supermoduleID); + } else if (match.track_as().eta() < 0.0 && t == 0) { + mHistManager.fill(HIST("clusterTM_dEtadPhi_CSide"), dEta, dPhi, supermoduleID); } // positive and negative tracks seperate, with three different track momentum ranges if (match.track_as().sign() == 1) { - mHistManager.fill(HIST("clusterTM_PosdEtadPhi"), dEta, dPhi, t); - mHistManager.fill(HIST("clusterTM_PosdPhiPt"), dPhi, pT, t); mHistManager.fill(HIST("clusterTM_NSigma_pos"), NSigmaEl, match.track_as().pt(), t); mHistManager.fill(HIST("MatchedTrackEtaPhi_Pos"), trackEta, trackPhi); - if (abs_p < 0.75) { - mHistManager.fill(HIST("clusterTM_PosdEtadPhi_Pl0_75"), dEta, dPhi, t); - } else if (abs_p >= 1.25) { - mHistManager.fill(HIST("clusterTM_PosdEtadPhi_Pgeq1_25"), dEta, dPhi, t); - } else { - mHistManager.fill(HIST("clusterTM_PosdEtadPhi_0_75leqPl1_25"), dEta, dPhi, t); + if (t == 0) { + mHistManager.fill(HIST("clusterTM_PosdPhiPt"), dPhi, pT, supermoduleID); + mHistManager.fill(HIST("clusterTM_PosdEtadPhi"), dEta, dPhi, supermoduleID); + if (abs_p < 0.75) { + mHistManager.fill(HIST("clusterTM_PosdEtadPhi_Pl0_75"), dEta, dPhi, supermoduleID); + } else if (abs_p >= 1.25) { + mHistManager.fill(HIST("clusterTM_PosdEtadPhi_Pgeq1_25"), dEta, dPhi, supermoduleID); + } else { + mHistManager.fill(HIST("clusterTM_PosdEtadPhi_0_75leqPl1_25"), dEta, dPhi, supermoduleID); + } } } else if (match.track_as().sign() == -1) { - mHistManager.fill(HIST("clusterTM_NegdEtadPhi"), dEta, dPhi, t); - mHistManager.fill(HIST("clusterTM_NegdPhiPt"), dPhi, pT, t); mHistManager.fill(HIST("clusterTM_NSigma_neg"), NSigmaEl, match.track_as().pt(), t); mHistManager.fill(HIST("MatchedTrackEtaPhi_Neg"), trackEta, trackPhi); - if (abs_p < 0.75) { - mHistManager.fill(HIST("clusterTM_NegdEtadPhi_Pl0_75"), dEta, dPhi, t); - } else if (abs_p >= 1.25) { - mHistManager.fill(HIST("clusterTM_NegdEtadPhi_Pgeq1_25"), dEta, dPhi, t); - } else { - mHistManager.fill(HIST("clusterTM_NegdEtadPhi_0_75leqPl1_25"), dEta, dPhi, t); + if (t == 0) { + mHistManager.fill(HIST("clusterTM_NegdPhiPt"), dPhi, pT, supermoduleID); + mHistManager.fill(HIST("clusterTM_NegdEtadPhi"), dEta, dPhi, supermoduleID); + if (abs_p < 0.75) { + mHistManager.fill(HIST("clusterTM_NegdEtadPhi_Pl0_75"), dEta, dPhi, supermoduleID); + } else if (abs_p >= 1.25) { + mHistManager.fill(HIST("clusterTM_NegdEtadPhi_Pgeq1_25"), dEta, dPhi, supermoduleID); + } else { + mHistManager.fill(HIST("clusterTM_NegdEtadPhi_0_75leqPl1_25"), dEta, dPhi, supermoduleID); + } } } if (tpcNsigmaElectron->at(0) <= NSigmaEl && NSigmaEl <= tpcNsigmaElectron->at(1)) { // E/p for e+/e- diff --git a/PWGJE/Tasks/jetHadronRecoil.cxx b/PWGJE/Tasks/jetHadronRecoil.cxx new file mode 100644 index 00000000000..a4c886aa700 --- /dev/null +++ b/PWGJE/Tasks/jetHadronRecoil.cxx @@ -0,0 +1,179 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// h+jet analysis task +// +// Authors: Daniel Jones + +#include +#include + +#include "TRandom3.h" + +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/HistogramRegistry.h" + +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/runDataProcessing.h" +#include "EventFiltering/filterTables.h" + +#include "PWGJE/Core/FastJetUtilities.h" +#include "PWGJE/Core/JetFinder.h" +#include "PWGJE/DataModel/Jet.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct hJetAnalysis { + + Configurable pt_TTref_min{"pt_TTref_min", 5, "reference minimum trigger track pt"}; + Configurable pt_TTref_max{"pt_TTref_max", 7, "reference maximum trigger track pt"}; + Configurable pt_TTsig_min{"pt_TTsig_min", 20, "signal minimum trigger track pt"}; + Configurable pt_TTsig_max{"pt_TTsig_max", 50, "signal maximum trigger track pt"}; + Configurable frac_sig{"frac_sig", 0.5, "fraction of events to use for signal"}; + Configurable jetR{"jetR", 0.4, "jet resolution parameter"}; + + TRandom3* rand = new TRandom3(0); + + Filter jetCuts = aod::jet::r == nround(jetR.node() * 100.0f); + + HistogramRegistry registry{"registry", + {{"hNtrig", "number of triggers;trigger type;entries", {HistType::kTH1F, {{2, 0, 2}}}}, + {"hPtTrack", "Track p_{T};p_{T};entries", {HistType::kTH1F, {{100, 0, 100}}}}, + {"hEtaTrack", "Track #eta;#eta;entries", {HistType::kTH1F, {{20, -1, 1}}}}, + {"hPhiTrack", "Track #phi;#phi;entries", {HistType::kTH1F, {{200, -3.2, 6.4}}}}, + {"hReferencePtDPhi", "jet p_{T} vs DPhi;p_{T,jet};#Delta#phi", {HistType::kTH2F, {{150, 0, 150}, {100, M_PI - 0.6, M_PI}}}}, + {"hSignalPtDPhi", "jet p_{T} vs DPhi;p_{T,jet};#Delta#phi", {HistType::kTH2F, {{150, 0, 150}, {100, M_PI - 0.6, M_PI}}}}, + {"hReferencePt", "jet p_{T};p_{T,jet};entries", {HistType::kTH1F, {{150, 0, 150}}}}, + {"hSignalPt", "jet p_{T};p_{T,jet};entries", {HistType::kTH1F, {{150, 0, 150}}}}, + {"hSignalLeadingTrack", "leading track p_{T};p_{T,jet};#Delta#phi;leading track p_{T}", {HistType::kTH3F, {{150, 0, 150}, {100, M_PI - 0.6, M_PI}, {150, 0, 150}}}}, + {"hReferenceLeadingTrack", "leading track p_{T};p_{T,jet};#Delta#phi;leading track p_{T}", {HistType::kTH3F, {{150, 0, 150}, {100, M_PI - 0.6, M_PI}, {150, 0, 150}}}}, + {"hJetSignalMultiplicity", "jet multiplicity;N_{jets};entries", {HistType::kTH1F, {{10, 0, 10}}}}, + {"hJetReferenceMultiplicity", "jet multiplicity;N_{jets};entries", {HistType::kTH1F, {{10, 0, 10}}}}, + {"hJetSignalConstituentMultiplicity", "jet constituent multiplicity;p_{T,jet};#Delta#phi;N_{constituents}", {HistType::kTH3F, {{150, 0, 150}, {100, M_PI - 0.6, M_PI}, {50, 0, 50}}}}, + {"hJetReferenceConstituentMultiplicity", "jet constituent multiplicity;p_{T,jet};#Delta#phi;N_{constituents}", {HistType::kTH3F, {{150, 0, 150}, {100, M_PI - 0.6, M_PI}, {50, 0, 50}}}}, + {"hJetSignalConstituentPt", "jet constituent p_{T};p_{T,jet};#Delta#phi;p_{T,constituent}", {HistType::kTH3F, {{150, 0, 150}, {100, M_PI - 0.6, M_PI}, {150, 0, 150}}}}, + {"hJetReferenceConstituentPt", "jet constituent p_{T};p_{T,jet};#Delta#phi;p_{T,constituent}", {HistType::kTH3F, {{150, 0, 150}, {100, M_PI - 0.6, M_PI}, {150, 0, 150}}}}}}; + + void init(InitContext const&) {} + + float dPhi(float phi1, float phi2) + { + float dPhi = phi1 - phi2; + if (dPhi < -M_PI) + dPhi += 2 * M_PI; + if (dPhi > M_PI) + dPhi -= 2 * M_PI; + return dPhi; + } + + template + void fillHistograms(T const& jets, U const& tracks) + { + bool is_sig_col; + std::vector phi_TT_ar; + double phi_TT; + int trig_number; + int n_TT = 0; + double leadingPT = 0; + + float dice = rand->Rndm(); + if (dice < frac_sig) + is_sig_col = true; + else + is_sig_col = false; + + for (auto& track : tracks) { + if (is_sig_col && track.pt() < pt_TTsig_max && track.pt() > pt_TTsig_min) { + phi_TT_ar.push_back(track.phi()); + n_TT++; + } + if (!is_sig_col && track.pt() < pt_TTref_max && track.pt() > pt_TTref_min) { + phi_TT_ar.push_back(track.pt()); + n_TT++; + } + registry.fill(HIST("hPtTrack"), track.pt()); + registry.fill(HIST("hEtaTrack"), track.eta()); + registry.fill(HIST("hPhiTrack"), track.phi()); + } + + if (n_TT > 0) { + trig_number = rand->Integer(n_TT); + phi_TT = phi_TT_ar[trig_number]; + if (is_sig_col) { + registry.fill(HIST("hNtrig"), 1.5); + registry.fill(HIST("hJetSignalMultiplicity"), jets.size()); + } + if (!is_sig_col) { + registry.fill(HIST("hNtrig"), 0.5); + registry.fill(HIST("hJetReferenceMultiplicity"), jets.size()); + } + } + + for (auto& jet : jets) { + if (n_TT > 0) { + float dphi = dPhi(jet.phi(), phi_TT); + if (is_sig_col && std::abs(dphi) > M_PI - 0.6) { + registry.fill(HIST("hSignalPtDPhi"), jet.pt(), dphi); + registry.fill(HIST("hSignalPt"), jet.pt()); + registry.fill(HIST("hJetSignalConstituentMultiplicity"), jet.pt(), dphi, jet.tracks().size()); + for (auto& constituent : jet.template tracks_as()) { + if (constituent.pt() > leadingPT) { + leadingPT = constituent.pt(); + } + registry.fill(HIST("hJetSignalConstituentPt"), jet.pt(), dphi, constituent.pt()); + } + registry.fill(HIST("hSignalLeadingTrack"), jet.pt(), dphi, leadingPT); + } + if (!is_sig_col && std::abs(dphi) > M_PI - 0.6) { + registry.fill(HIST("hReferencePtDPhi"), jet.pt(), dphi); + registry.fill(HIST("hReferencePt"), jet.pt()); + registry.fill(HIST("hJetReferenceConstituentMultiplicity"), jet.pt(), dphi, jet.tracks().size()); + for (auto& constituent : jet.template tracks_as()) { + if (constituent.pt() > leadingPT) { + leadingPT = constituent.pt(); + } + registry.fill(HIST("hJetReferenceConstituentPt"), jet.pt(), dphi, constituent.pt()); + } + registry.fill(HIST("hReferenceLeadingTrack"), jet.pt(), dphi, leadingPT); + } + } + } + } + + void processData(aod::JCollision const&, soa::Filtered> const& jets, aod::JTracks const& tracks) + { + fillHistograms(jets, tracks); + } + PROCESS_SWITCH(hJetAnalysis, processData, "process data", true); + + void processMCD(aod::JCollision const&, soa::Filtered> const& jets, aod::JTracks const& tracks) + { + fillHistograms(jets, tracks); + } + PROCESS_SWITCH(hJetAnalysis, processMCD, "process MC detector level", false); + + void processMCP(aod::JMcCollision const&, soa::Filtered> const& jets, aod::JMcParticles const& particles) + { + fillHistograms(jets, particles); + } + PROCESS_SWITCH(hJetAnalysis, processMCP, "process MC particle level", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"hJetAnalysis"})}; } diff --git a/PWGJE/Tasks/jetfinderQA.cxx b/PWGJE/Tasks/jetfinderQA.cxx index 93a8fc61b64..e27fee89222 100644 --- a/PWGJE/Tasks/jetfinderQA.cxx +++ b/PWGJE/Tasks/jetfinderQA.cxx @@ -77,16 +77,16 @@ struct JetFinderQATask { if (doprocessJetsData || doprocessJetsMCD || doprocessJetsMCDWeighted) { registry.add("h_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_jet_eta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_jet_phi", "jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_jet_phi", "jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_jet_ntracks", "jet N tracks;N_{jet tracks};entries", {HistType::kTH1F, {{200, -0.5, 199.5}}}); registry.add("h3_jet_r_jet_pt_jet_eta", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_jet_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); - registry.add("h3_jet_r_jet_eta_jet_phi", "#it{R}_{jet};#eta_{jet};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_jet_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_eta_jet_phi", "#it{R}_{jet};#eta_{jet};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_jet_ntracks", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});N_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -0.5, 99.5}}}); registry.add("h3_jet_r_jet_pt_jet_area", "#it{R}_{jet}; #it{p}_{T,jet} (GeV/#it{c}); #it{Area}_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, 0., 1.}}}); registry.add("h3_jet_r_jet_pt_track_pt", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_leadingtrack_pt", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c}); #it{p}_{T,leading track} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0.0, 200.0}, {200, 0.0, 200.0}}}); registry.add("h_jet_phat", "jet #hat{p};#hat{p} (GeV/#it{c});entries", {HistType::kTH1F, {{350, 0, 350}}}); registry.add("h_jet_ptcut", "p_{T} cut;p_{T,jet} (GeV/#it{c});N;entries", {HistType::kTH2F, {{200, 0, 200}, {20, 0, 5}}}); @@ -95,15 +95,15 @@ struct JetFinderQATask { if (doprocessJetsMCP || doprocessJetsMCPWeighted) { registry.add("h_jet_pt_part", "jet pT;#it{p}_{T,jet}^{part}(GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_jet_eta_part", "jet #eta;#eta_{jet}^{part};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_jet_phi_part", "jet #varphi;#varphi_{jet}^{part};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_jet_phi_part", "jet #varphi;#varphi_{jet}^{part};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_jet_ntracks_part", "jet N tracks;N_{jet tracks}^{part};entries", {HistType::kTH1F, {{100, -0.5, 99.5}}}); registry.add("h3_jet_r_part_jet_pt_part_jet_eta_part", ";#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#eta_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_part_jet_pt_part_jet_phi_part", ";#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); - registry.add("h3_jet_r_part_jet_eta_part_jet_phi_part", ";#it{R}_{jet}^{part};#eta_{jet}^{part};#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_part_jet_pt_part_jet_phi_part", ";#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); + registry.add("h3_jet_r_part_jet_eta_part_jet_phi_part", ";#it{R}_{jet}^{part};#eta_{jet}^{part};#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_part_jet_pt_part_jet_ntracks_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});N_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -0.5, 99.5}}}); registry.add("h3_jet_r_part_jet_pt_part_track_pt_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#it{p}_{T,jet tracks}^{part} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_part_jet_pt_part_track_eta_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#eta_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_part_jet_pt_part_track_phi_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_part_jet_pt_part_track_phi_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h_jet_phat_part", "jet #hat{p};#hat{p} (GeV/#it{c});entries", {HistType::kTH1F, {{350, 0, 350}}}); registry.add("h_jet_ptcut_part", "p_{T} cut;p_{T,jet}^{part} (GeV/#it{c});N;entries", {HistType::kTH2F, {{200, 0, 200}, {20, 0, 5}}}); } @@ -111,13 +111,13 @@ struct JetFinderQATask { if (doprocessJetsMCPMCDMatched || doprocessJetsMCPMCDMatchedWeighted) { registry.add("h3_jet_r_jet_pt_part_jet_pt", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_eta_part_jet_eta", "#it{R}_{jet};#eta_{jet}^{part};#eta_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_phi_part_jet_phi", "#it{R}_{jet};#varphi_{jet}^{part};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_phi_part_jet_phi", "#it{R}_{jet};#varphi_{jet}^{part};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_ntracks_part_jet_ntracks", "#it{R}_{jet};N_{jet tracks}^{part};N_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -0.5, 99.5}, {100, -0.5, 99.5}}}); registry.add("h3_jet_r_jet_pt_part_jet_pt_diff", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c}); (#it{p}_{T,jet}^{part} (GeV/#it{c}) - #it{p}_{T,jet} (GeV/#it{c})) / #it{p}_{T,jet}^{part} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0.0, 200}, {1000, -5.0, 5.0}}}); registry.add("h3_jet_r_jet_pt_part_jet_eta_diff", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c}); (#eta_{jet}^{part} - #eta_{jet}) / #eta_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0.0, 200}, {1000, -5.0, 5.0}}}); registry.add("h3_jet_r_jet_pt_part_jet_phi_diff", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c}); (#varphi_{jet}^{part} - #varphi_{jet}) / #varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0.0, 200}, {1000, -5.0, 5.0}}}); registry.add("h3_jet_pt_part_jet_eta_part_jet_eta", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); #eta_{jet}^{part}; #eta_{jet}", {HistType::kTH3F, {{200, 0.0, 200}, {100, -1.0, 1.0}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_pt_part_jet_phi_part_jet_phi", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); #varphi_{jet}^{part}; #varphi_{jet}", {HistType::kTH3F, {{200, 0.0, 200}, {80, -1.0, 7.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_pt_part_jet_phi_part_jet_phi", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); #varphi_{jet}^{part}; #varphi_{jet}", {HistType::kTH3F, {{200, 0.0, 200}, {160, -1.0, 7.}, {160, -1.0, 7.}}}); registry.add("h3_jet_pt_part_jet_ntracks_part_jet_ntracks", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); N_{jet tracks}^{part}; N_{jet tracks}", {HistType::kTH3F, {{200, 0.0, 200}, {100, -0.5, 99.5}, {100, -0.5, 99.5}}}); } @@ -125,40 +125,40 @@ struct JetFinderQATask { registry.add("h_collision_trigger_events", "event status;event status;entries", {HistType::kTH1F, {{6, 0.0, 6.0}}}); registry.add("h_track_pt_MB", "track pT for MB events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); registry.add("h_track_eta_MB", "track #eta for MB events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi_MB", "track #varphi for MB events;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi_MB", "track #varphi for MB events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_track_pt_Triggered_Low", "track pT for low #it{p}_{T} Triggered events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); registry.add("h_track_eta_Triggered_Low", "track #eta for low #it{p}_{T} Triggered events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi_Triggered_Low", "track #varphi for low #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi_Triggered_Low", "track #varphi for low #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_track_pt_Triggered_High", "track pT for high #it{p}_{T} Triggered events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); registry.add("h_track_eta_Triggered_High", "track #eta for high #it{p}_{T} Triggered events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi_Triggered_High", "track #varphi for high #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi_Triggered_High", "track #varphi for high #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_track_pt_Triggered_Both", "track pT for both #it{p}_{T} Triggered events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); registry.add("h_track_eta_Triggered_Both", "track #eta for both #it{p}_{T} Triggered events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi_Triggered_Both", "track #varphi for both #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi_Triggered_Both", "track #varphi for both #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_collision", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {4, -0.5, 3.5}}}); registry.add("h3_jet_r_jet_eta_collision", "#it{R}_{jet};#eta_{jet};collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {4, -0.5, 3.5}}}); - registry.add("h3_jet_r_jet_phi_collision", "#it{R}_{jet};#varphi_{jet};collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {80, -1.0, 7.}, {4, -0.5, 3.5}}}); + registry.add("h3_jet_r_jet_phi_collision", "#it{R}_{jet};#varphi_{jet};collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {160, -1.0, 7.}, {4, -0.5, 3.5}}}); registry.add("h2_jet_r_jet_pT_triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); registry.add("h2_jet_r_jet_pT_triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); registry.add("h2_jet_r_jet_pT_triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_pt_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_track_pt_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_track_pt_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_track_pt_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); } if (doprocessTracks) { registry.add("h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); registry.add("h_track_pt", "track pT;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_track_eta", "track #eta;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi", "track #varphi;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi", "track #varphi;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); } if (doprocessMCCollisionsWeighted) { diff --git a/PWGJE/Tasks/jetfinderfullQA.cxx b/PWGJE/Tasks/jetfinderfullQA.cxx index 82a51a80f05..85cc7e7060d 100644 --- a/PWGJE/Tasks/jetfinderfullQA.cxx +++ b/PWGJE/Tasks/jetfinderfullQA.cxx @@ -85,52 +85,52 @@ struct JetFinderFullQATask { if (doprocessJetsData || doprocessJetsMCD || doprocessJetsMCDWeighted) { registry.add("h_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_jet_eta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_jet_phi", "jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_jet_phi", "jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_jet_ntracks", "jet N tracks;N_{jet tracks};entries", {HistType::kTH1F, {{200, -0.5, 199.5}}}); registry.add("h_jet_nclusters", "jet N clusters;N_{jet clusters};entries", {HistType::kTH1F, {{200, -0.5, 199.5}}}); registry.add("h3_jet_r_jet_pt_jet_eta", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_jet_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); - registry.add("h3_jet_r_jet_eta_jet_phi", "#it{R}_{jet};#eta_{jet};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_jet_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_eta_jet_phi", "#it{R}_{jet};#eta_{jet};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_jet_ntracks", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});N_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -0.5, 99.5}}}); registry.add("h3_jet_r_jet_pt_jet_nclusters", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});N_{jet clusters}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -0.5, 99.5}}}); registry.add("h3_jet_r_jet_pt_jet_area", "#it{R}_{jet}; #it{p}_{T,jet} (GeV/#it{c}); #it{Area}_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, 0., 1.}}}); registry.add("h3_jet_r_jet_pt_track_pt", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_cluster_pt", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,cluster} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_cluster_eta", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{cluster}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_cluster_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{cluster}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_cluster_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{cluster}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_cluster_energy", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});E_{cluster} (GeV)", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.0}}}); } if (doprocessJetsMCP || doprocessJetsMCPWeighted) { registry.add("h_jet_pt_part", "jet pT;#it{p}_{T,jet}^{part}(GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_jet_eta_part", "jet #eta;#eta_{jet}^{part};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_jet_phi_part", "jet #varphi;#varphi_{jet}^{part};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_jet_phi_part", "jet #varphi;#varphi_{jet}^{part};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_jet_ntracks_part", "jet N tracks;N_{jet tracks}^{part};entries", {HistType::kTH1F, {{100, -0.5, 99.5}}}); registry.add("h3_jet_r_part_jet_pt_part_jet_eta_part", ";#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#eta_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_part_jet_pt_part_jet_phi_part", ";#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); - registry.add("h3_jet_r_part_jet_eta_part_jet_phi_part", ";#it{R}_{jet}^{part};#eta_{jet}^{part};#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_part_jet_pt_part_jet_phi_part", ";#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); + registry.add("h3_jet_r_part_jet_eta_part_jet_phi_part", ";#it{R}_{jet}^{part};#eta_{jet}^{part};#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_part_jet_pt_part_jet_ntracks_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});N_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -0.5, 99.5}}}); registry.add("h3_jet_r_part_jet_pt_part_track_pt_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#it{p}_{T,jet tracks}^{part} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_part_jet_pt_part_track_eta_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#eta_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_part_jet_pt_part_track_phi_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_part_jet_pt_part_track_phi_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); } if (doprocessJetsMCPMCDMatched || doprocessJetsMCPMCDMatchedWeighted) { registry.add("h3_jet_r_jet_pt_part_jet_pt", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_eta_part_jet_eta", "#it{R}_{jet};#eta_{jet}^{part};#eta_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_phi_part_jet_phi", "#it{R}_{jet};#varphi_{jet}^{part};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_phi_part_jet_phi", "#it{R}_{jet};#varphi_{jet}^{part};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_ntracks_part_jet_ntracks", "#it{R}_{jet};N_{jet tracks}^{part};N_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -0.5, 99.5}, {100, -0.5, 99.5}}}); registry.add("h3_jet_r_cluster_pt_part_cluster_pt", "#it{R}_{jet};#it{p}_{T,cluster}^{part} (GeV/#it{c});#it{p}_{T,cluster} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_cluster_eta_part_cluster_eta", "#it{R}_{jet};#eta_{cluster}^{part};#eta_{cluster}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_cluster_phi_part_cluster_phi", "#it{R}_{jet};#varphi_{cluster}^{part};#varphi_{cluster}", {HistType::kTH3F, {{jetRadiiBins, ""}, {80, -1.0, 7.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_cluster_phi_part_cluster_phi", "#it{R}_{jet};#varphi_{cluster}^{part};#varphi_{cluster}", {HistType::kTH3F, {{jetRadiiBins, ""}, {160, -1.0, 7.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_cluster_energy_part_cluster_energy", "#it{R}_{jet};#E_{cluster}^{part};#E_{cluster}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.0}}}); registry.add("h3_jet_r_jet_pt_part_jet_pt_diff", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c}); (#it{p}_{T,jet}^{part} (GeV/#it{c}) - #it{p}_{T,jet} (GeV/#it{c})) / #it{p}_{T,jet}^{part} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0.0, 200}, {1000, -5.0, 5.0}}}); registry.add("h3_jet_r_jet_pt_part_jet_eta_diff", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c}); (#eta_{jet}^{part} - #eta_{jet}) / #eta_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0.0, 200}, {1000, -5.0, 5.0}}}); registry.add("h3_jet_r_jet_pt_part_jet_phi_diff", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c}); (#varphi_{jet}^{part} - #varphi_{jet}) / #varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0.0, 200}, {1000, -5.0, 5.0}}}); registry.add("h3_jet_pt_part_jet_eta_part_jet_eta", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); #eta_{jet}^{part}; #eta_{jet}", {HistType::kTH3F, {{200, 0.0, 200}, {100, -1.0, 1.0}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_pt_part_jet_phi_part_jet_phi", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); #varphi_{jet}^{part}; #varphi_{jet}", {HistType::kTH3F, {{200, 0.0, 200}, {80, -1.0, 7.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_pt_part_jet_phi_part_jet_phi", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); #varphi_{jet}^{part}; #varphi_{jet}", {HistType::kTH3F, {{200, 0.0, 200}, {160, -1.0, 7.}, {160, -1.0, 7.}}}); registry.add("h3_jet_pt_part_jet_ntracks_part_jet_ntracks", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); N_{jet tracks}^{part}; N_{jet tracks}", {HistType::kTH3F, {{200, 0.0, 200}, {100, -0.5, 99.5}, {100, -0.5, 99.5}}}); } @@ -138,10 +138,10 @@ struct JetFinderFullQATask { registry.add("h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); registry.add("h_track_pt", "track pT;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_track_eta", "track #eta;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi", "track #varphi;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi", "track #varphi;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_cluster_pt", "cluster pT;#it{p}_{T,cluster} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_cluster_eta", "cluster #eta;#eta_{cluster};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_cluster_phi", "cluster #varphi;#varphi_{cluster};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_cluster_phi", "cluster #varphi;#varphi_{cluster};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_cluster_energy", "cluster E;E_{cluster} (GeV);entries", {HistType::kTH1F, {{200, 0., 200.}}}); } diff --git a/PWGJE/Tasks/jetfinderhfQA.cxx b/PWGJE/Tasks/jetfinderhfQA.cxx index 52594d6d62a..1a64ff6d627 100644 --- a/PWGJE/Tasks/jetfinderhfQA.cxx +++ b/PWGJE/Tasks/jetfinderhfQA.cxx @@ -98,19 +98,19 @@ struct JetFinderHFQATask { if (doprocessJetsData || doprocessJetsMCD || doprocessJetsMCDWeighted) { registry.add("h_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_jet_eta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_jet_phi", "jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_jet_phi", "jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_jet_ntracks", "jet N tracks;N_{jet tracks};entries", {HistType::kTH1F, {{200, -0.5, 199.5}}}); registry.add("h3_jet_r_jet_pt_jet_eta", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_jet_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); - registry.add("h3_jet_r_jet_eta_jet_phi", "#it{R}_{jet};#eta_{jet};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_jet_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_eta_jet_phi", "#it{R}_{jet};#eta_{jet};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_jet_ntracks", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});N_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -0.5, 99.5}}}); registry.add("h3_jet_r_jet_pt_jet_area", "#it{R}_{jet}; #it{p}_{T,jet} (GeV/#it{c}); #it{Area}_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, 0., 1.}}}); registry.add("h3_jet_r_jet_pt_track_pt", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_candidate_pt", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_candidate_eta", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_candidate_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_candidate_phi", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_candidate_y", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});y_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); registry.add("h3_candidate_invmass_jet_pt_candidate_pt", ";#it{m}_{inv, candidate} (GeV/#it{c}^{2}); #it{p}_{T,jet} (GeV/#it{c}) ;#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{500, 0.0, 5.0}, {200, 0.0, 200.0}, {200, 0.0, 200.0}}}); registry.add("h3_candidatebar_invmass_jet_pt_candidate_pt", ";#it{m}_{inv, candidate bar} (GeV/#it{c}^{2}); #it{p}_{T,jet} (GeV/#it{c}) ;#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{500, 0.0, 5.0}, {200, 0.0, 200.0}, {200, 0.0, 200.0}}}); @@ -119,35 +119,35 @@ struct JetFinderHFQATask { if (doprocessJetsMCP || doprocessJetsMCPWeighted) { registry.add("h_jet_pt_part", "jet pT;#it{p}_{T,jet}^{part}(GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_jet_eta_part", "jet #eta;#eta_{jet}^{part};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_jet_phi_part", "jet #varphi;#varphi_{jet}^{part};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_jet_phi_part", "jet #varphi;#varphi_{jet}^{part};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_jet_ntracks_part", "jet N tracks;N_{jet tracks}^{part};entries", {HistType::kTH1F, {{100, -0.5, 99.5}}}); registry.add("h3_jet_r_part_jet_pt_part_jet_eta_part", ";#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#eta_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_part_jet_pt_part_jet_phi_part", ";#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); - registry.add("h3_jet_r_part_jet_eta_part_jet_phi_part", ";#it{R}_{jet}^{part};#eta_{jet}^{part};#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_part_jet_pt_part_jet_phi_part", ";#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); + registry.add("h3_jet_r_part_jet_eta_part_jet_phi_part", ";#it{R}_{jet}^{part};#eta_{jet}^{part};#varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_part_jet_pt_part_jet_ntracks_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});N_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -0.5, 99.5}}}); registry.add("h3_jet_r_part_jet_pt_part_track_pt_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#it{p}_{T,jet tracks}^{part} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_part_jet_pt_part_track_eta_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#eta_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_part_jet_pt_part_track_phi_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_part_jet_pt_part_track_phi_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi_{jet tracks}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_part_jet_pt_part_candidate_pt_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#it{p}_{T,candidate}^{part} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_part_jet_pt_part_candidate_eta_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#eta_{candidate}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_part_jet_pt_part_candidate_phi_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi{candidate}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_part_jet_pt_part_candidate_phi_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});#varphi{candidate}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_part_jet_pt_part_candidate_y_part", "#it{R}_{jet}^{part};#it{p}_{T,jet}^{part} (GeV/#it{c});y_{candidate}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); } if (doprocessJetsMCPMCDMatched || doprocessJetsMCPMCDMatchedWeighted) { registry.add("h3_jet_r_jet_pt_part_jet_pt", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c});#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_eta_part_jet_eta", "#it{R}_{jet};#eta_{jet}^{part};#eta_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_phi_part_jet_phi", "#it{R}_{jet};#varphi_{jet}^{part};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_phi_part_jet_phi", "#it{R}_{jet};#varphi_{jet}^{part};#varphi_{jet}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_ntracks_part_jet_ntracks", "#it{R}_{jet};N_{jet tracks}^{part};N_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -0.5, 99.5}, {100, -0.5, 99.5}}}); registry.add("h3_jet_r_candidate_pt_part_candidate_pt", "#it{R}_{jet};#it{p}_{T,candidate}^{part} (GeV/#it{c});#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_candidate_eta_part_candidate_eta", "#it{R}_{jet};#eta_{candidate}^{part};#eta_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_candidate_phi_part_candidate_phi", "#it{R}_{jet};#varphi_{candidate}^{part};#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {80, -1.0, 7.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_candidate_phi_part_candidate_phi", "#it{R}_{jet};#varphi_{candidate}^{part};#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {160, -1.0, 7.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_candidate_y_part_candidate_y", "#it{R}_{jet};#y_{candidate}^{part};#y_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {100, -1.0, 1.0}}}); registry.add("h3_jet_r_jet_pt_part_jet_pt_diff", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c}); (#it{p}_{T,jet}^{part} (GeV/#it{c}) - #it{p}_{T,jet} (GeV/#it{c})) / #it{p}_{T,jet}^{part} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0.0, 200}, {1000, -5.0, 5.0}}}); registry.add("h3_jet_r_jet_pt_part_jet_eta_diff", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c}); (#eta_{jet}^{part} - #eta_{jet}) / #eta_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0.0, 200}, {1000, -5.0, 5.0}}}); registry.add("h3_jet_r_jet_pt_part_jet_phi_diff", "#it{R}_{jet};#it{p}_{T,jet}^{part} (GeV/#it{c}); (#varphi_{jet}^{part} - #varphi_{jet}) / #varphi_{jet}^{part}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0.0, 200}, {1000, -5.0, 5.0}}}); registry.add("h3_jet_pt_part_jet_eta_part_jet_eta", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); #eta_{jet}^{part}; #eta_{jet}", {HistType::kTH3F, {{200, 0.0, 200}, {100, -1.0, 1.0}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_pt_part_jet_phi_part_jet_phi", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); #varphi_{jet}^{part}; #varphi_{jet}", {HistType::kTH3F, {{200, 0.0, 200}, {80, -1.0, 7.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_pt_part_jet_phi_part_jet_phi", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); #varphi_{jet}^{part}; #varphi_{jet}", {HistType::kTH3F, {{200, 0.0, 200}, {160, -1.0, 7.}, {160, -1.0, 7.}}}); registry.add("h3_jet_pt_part_jet_ntracks_part_jet_ntracks", ";#it{p}_{T,jet}^{part} (GeV/#it{c}); N_{jet tracks}^{part}; N_{jet tracks}", {HistType::kTH3F, {{200, 0.0, 200}, {100, -0.5, 99.5}, {100, -0.5, 99.5}}}); } @@ -155,49 +155,49 @@ struct JetFinderHFQATask { registry.add("h_collision_trigger_events", "event status;event status;entries", {HistType::kTH1F, {{6, 0.0, 6.0}}}); registry.add("h_track_pt_MB", "track pT for MB events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); registry.add("h_track_eta_MB", "track #eta for MB events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi_MB", "track #varphi for MB events;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi_MB", "track #varphi for MB events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_track_pt_Triggered_Low", "track pT for low #it{p}_{T} Triggered events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); registry.add("h_track_eta_Triggered_Low", "track #eta for low #it{p}_{T} Triggered events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi_Triggered_Low", "track #varphi for low #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi_Triggered_Low", "track #varphi for low #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_track_pt_Triggered_High", "track pT for high #it{p}_{T} Triggered events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); registry.add("h_track_eta_Triggered_High", "track #eta for high #it{p}_{T} Triggered events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi_Triggered_High", "track #varphi for high #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi_Triggered_High", "track #varphi for high #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h_track_pt_Triggered_Both", "track pT for both #it{p}_{T} Triggered events;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0.0, 200.0}}}); registry.add("h_track_eta_Triggered_Both", "track #eta for both #it{p}_{T} Triggered events;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi_Triggered_Both", "track #varphi for both #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi_Triggered_Both", "track #varphi for both #it{p}_{T} Triggered events;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_collision", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {4, -0.5, 3.5}}}); registry.add("h3_jet_r_jet_eta_collision", "#it{R}_{jet};#eta_{jet};collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {100, -1.0, 1.0}, {4, -0.5, 3.5}}}); - registry.add("h3_jet_r_jet_phi_collision", "#it{R}_{jet};#varphi_{jet};collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {80, -1.0, 7.}, {4, -0.5, 3.5}}}); + registry.add("h3_jet_r_jet_phi_collision", "#it{R}_{jet};#varphi_{jet};collision trigger status", {HistType::kTH3F, {{jetRadiiBins, ""}, {160, -1.0, 7.}, {4, -0.5, 3.5}}}); registry.add("h2_jet_r_jet_pT_triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); registry.add("h2_jet_r_jet_pT_triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); registry.add("h2_jet_r_jet_pT_triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c})", {HistType::kTH2F, {{jetRadiiBins, ""}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_pt_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_track_pt_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_track_pt_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_track_pt_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,jet tracks} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_track_eta_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_track_phi_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_track_phi_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{jet tracks}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_candidate_pt_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_candidate_eta_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_candidate_phi_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_candidate_phi_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_candidate_y_MB", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});y_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); registry.add("h3_jet_r_jet_pt_candidate_pt_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_candidate_eta_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_candidate_phi_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_candidate_phi_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_candidate_y_Triggered_Low", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});y_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); registry.add("h3_jet_r_jet_pt_candidate_pt_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_candidate_eta_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_candidate_phi_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_candidate_phi_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_candidate_y_Triggered_High", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});y_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); registry.add("h3_jet_r_jet_pt_candidate_pt_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#it{p}_{T,candidate} (GeV/#it{c})", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {200, 0., 200.}}}); registry.add("h3_jet_r_jet_pt_candidate_eta_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#eta_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); - registry.add("h3_jet_r_jet_pt_candidate_phi_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {80, -1.0, 7.}}}); + registry.add("h3_jet_r_jet_pt_candidate_phi_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});#varphi_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {160, -1.0, 7.}}}); registry.add("h3_jet_r_jet_pt_candidate_y_Triggered_Both", "#it{R}_{jet};#it{p}_{T,jet} (GeV/#it{c});y_{candidate}", {HistType::kTH3F, {{jetRadiiBins, ""}, {200, 0., 200.}, {100, -1.0, 1.0}}}); } @@ -205,7 +205,7 @@ struct JetFinderHFQATask { registry.add("h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); registry.add("h_track_pt", "track pT;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_track_eta", "track #eta;#eta_{track};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_track_phi", "track #varphi;#varphi_{track};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("h_track_phi", "track #varphi;#varphi_{track};entries", {HistType::kTH1F, {{160, -1.0, 7.}}}); } if (doprocessMCCollisionsWeighted) { diff --git a/PWGJE/Tasks/trackJetqa.cxx b/PWGJE/Tasks/trackJetqa.cxx index f2d495c1c30..f13a87dd4a9 100644 --- a/PWGJE/Tasks/trackJetqa.cxx +++ b/PWGJE/Tasks/trackJetqa.cxx @@ -127,6 +127,8 @@ struct TrackJetQa { histos.add("TrackPar/dcaZ", "distance of closest approach in #it{z};#it{p}_{T} [GeV/c];#it{dcaZ} [cm];", {HistType::kTH2F, {{nBins, 0, 200}, {200, -0.15, 0.15}}}); histos.add("TrackPar/length", "track length in cm;#it{p}_{T} [GeV/c];#it{Length} [cm];", {HistType::kTH2F, {{nBins, 0, 200}, {200, 0, 1000}}}); histos.add("TrackPar/Sigma1Pt", "uncertainty over #it{p}_{T};#it{p}_{T} [GeV/c];#it{p}_{T}*#it{sigma1}{p}_{T};", {HistType::kTH2F, {{nBins, 0, 200}, {100, 0, 1}}}); + histos.add("TrackPar/Sigma1Pt_hasTRD", "uncertainty over #it{p}_{T} for tracks with TRD;#it{p}_{T} [GeV/c];#it{p}_{T}*#it{sigma1}{p}_{T};", {HistType::kTH2F, {{nBins, 0, 200}, {100, 0, 1}}}); + histos.add("TrackPar/Sigma1Pt_hasNoTRD", "uncertainty over #it{p}_{T} for tracks without TRD;#it{p}_{T} [GeV/c];#it{p}_{T}*#it{sigma1}{p}_{T};", {HistType::kTH2F, {{nBins, 0, 200}, {100, 0, 1}}}); histos.add("TrackPar/Sigma1Pt_Layer1", "uncertainty over #it{p}_{T} with only 1st ITS layer active;#it{p}_{T} [GeV/c];#it{p}_{T}*#it{sigma1}{p}_{T};", {HistType::kTH2F, {{nBins, 0, 200}, {100, 0, 1}}}); histos.add("TrackPar/Sigma1Pt_Layer2", "uncertainty over #it{p}_{T} with only 2nd ITS layer active;#it{p}_{T} [GeV/c];#it{p}_{T}*#it{sigma1}{p}_{T};", {HistType::kTH2F, {{nBins, 0, 200}, {100, 0, 1}}}); histos.add("TrackPar/Sigma1Pt_Layers12", "uncertainty over #it{p}_{T} with only 1st and 2nd ITS layers active;#it{p}_{T} [GeV/c];#it{p}_{T}*#it{sigma1}{p}_{T};", {HistType::kTH2F, {{nBins, 0, 200}, {100, 0, 1}}}); @@ -142,6 +144,8 @@ struct TrackJetQa { histos.add("EventProp/collisionVtxZ", "Collsion Vertex Z;#it{Vtx}_{z} [cm];number of entries", HistType::kTH1F, {{nBins, -20, 20}}); histos.add("EventProp/collisionVtxZnoSel", "Collsion Vertex Z without event selection;#it{Vtx}_{z} [cm];number of entries", HistType::kTH1F, {{nBins, -20, 20}}); histos.add("EventProp/collisionVtxZSel8", "Collsion Vertex Z with event selection;#it{Vtx}_{z} [cm];number of entries", HistType::kTH1F, {{nBins, -20, 20}}); + histos.add("EventProp/rejectedCollId", "CollisionId of collisions that did not pass the event selection; collisionId; number of entries", HistType::kTH1F, {{10, 0, 5}}); + // Common axes const AxisSpec axisPercentileFT0M{binsPercentile, "Centrality FT0M"}; const AxisSpec axisPercentileFT0A{binsPercentile, "Centrality FT0A"}; @@ -185,16 +189,18 @@ struct TrackJetQa { } template - void fillEventQa(eventInfo const& collision) + bool fillEventQa(eventInfo const& collision) { // fill event property variables histos.fill(HIST("EventProp/collisionVtxZnoSel"), collision.posZ()); if (!collision.sel8()) { - return; + histos.fill(HIST("EventProp/rejectedCollId"), 2); + return false; } histos.fill(HIST("EventProp/collisionVtxZSel8"), collision.posZ()); if (fabs(collision.posZ()) > ValVtx) { - return; + histos.fill(HIST("EventProp/rejectedCollId"), 3); + return false; } histos.fill(HIST("EventProp/collisionVtxZ"), collision.posZ()); if (fillMultiplicity) { @@ -204,28 +210,33 @@ struct TrackJetQa { histos.fill(HIST("Mult/FT0A"), collision.multFT0A()); histos.fill(HIST("Mult/FT0C"), collision.multFT0C()); } + return true; } template - void fillTrackQa(Tracks const& track) + bool fillTrackQa(Tracks const& track) { // check track selection if ((globalTrack == true) && (!track.isGlobalTrack())) { - return; + return false; } if ((globalTrackWoDCA == true) && (!track.isGlobalTrackWoDCA())) { - return; + return false; } if ((globalTrackWoPtEta == true) && (!track.isGlobalTrackWoPtEta())) { - return; + return false; } if ((customTrack == true) && (!customTrackCuts.IsSelected(track))) { - return; + return false; } // fill kinematic variables histos.fill(HIST("Kine/pt"), track.pt()); if (track.hasTRD()) { histos.fill(HIST("Kine/pt_TRD"), track.pt()); + histos.fill(HIST("TrackPar/Sigma1Pt_hasTRD"), track.pt(), track.sigma1Pt() * track.pt()); + } + if (!track.hasTRD()) { + histos.fill(HIST("TrackPar/Sigma1Pt_hasNoTRD"), track.pt(), track.sigma1Pt() * track.pt()); } histos.fill(HIST("Kine/eta"), track.pt(), track.eta()); histos.fill(HIST("Kine/phi"), track.pt(), track.phi()); @@ -300,29 +311,41 @@ struct TrackJetQa { histos.fill(HIST("TPC/tpcCrossedRowsOverFindableCls"), track.pt(), track.tpcCrossedRowsOverFindableCls()); histos.fill(HIST("TPC/tpcFractionSharedCls"), track.pt(), track.tpcFractionSharedCls()); histos.fill(HIST("TPC/tpcChi2NCl"), track.pt(), track.tpcChi2NCl()); + + return true; } // Preslice> trackPerColl = aod::track::collisionId; Preslice trackPerColl = aod::track::collisionId; // SliceCache cacheTrk; - void processFull(soa::Join const& collisions, - soa::Join const& tracks) + using CollisionCandidate = soa::Join; + using TrackCandidates = soa::Join; + + void processFull(CollisionCandidate const& collisions, + TrackCandidates const& tracks) { for (const auto& collision : collisions) { - fillEventQa(collision); - if (fillMultiplicity) { - histos.fill(HIST("Centrality/FT0M"), collision.centFT0M()); - histos.fill(HIST("Mult/FT0M"), collision.multFT0M()); - histos.fill(HIST("Mult/MultCorrelations"), collision.centFT0A(), collision.centFT0C(), collision.multFT0A(), collision.multFT0C(), collision.multNTracksPV()); - } - auto tracksInCollision = tracks.sliceBy(trackPerColl, collision.globalIndex()); + if (fillEventQa(collision)) { - for (const auto& track : tracksInCollision) { - fillTrackQa(track); if (fillMultiplicity) { - histos.fill(HIST("TrackEventPar/Sigma1PtFT0Mcent"), collision.centFT0M(), track.pt(), track.sigma1Pt()); - histos.fill(HIST("TrackEventPar/MultCorrelations"), track.sigma1Pt(), track.pt(), collision.centFT0A(), collision.centFT0C(), collision.multFT0A(), collision.multFT0C(), collision.multNTracksPV()); + histos.fill(HIST("Centrality/FT0M"), collision.centFT0M()); + histos.fill(HIST("Mult/FT0M"), collision.multFT0M()); + histos.fill(HIST("Mult/MultCorrelations"), collision.centFT0A(), collision.centFT0C(), collision.multFT0A(), collision.multFT0C(), collision.multNTracksPV()); + } + auto tracksInCollision = tracks.sliceBy(trackPerColl, collision.globalIndex()); + + for (const auto& track : tracksInCollision) { + if (track.has_collision() && (collision.globalIndex() == track.collisionId())) { // double check + if (fillTrackQa(track)) { + if (fillMultiplicity) { + histos.fill(HIST("TrackEventPar/Sigma1PtFT0Mcent"), collision.centFT0M(), track.pt(), track.sigma1Pt()); + histos.fill(HIST("TrackEventPar/MultCorrelations"), track.sigma1Pt(), track.pt(), collision.centFT0A(), collision.centFT0C(), collision.multFT0A(), collision.multFT0C(), collision.multNTracksPV()); + } + } + } } + } else { + histos.fill(HIST("EventProp/rejectedCollId"), 1); } } } diff --git a/PWGLF/DataModel/LFResonanceTables.h b/PWGLF/DataModel/LFResonanceTables.h index e2237723580..b321c8ff9a0 100644 --- a/PWGLF/DataModel/LFResonanceTables.h +++ b/PWGLF/DataModel/LFResonanceTables.h @@ -76,6 +76,7 @@ DECLARE_SOA_COLUMN(V0CosPA, v0CosPA, float); //! V0 Cosine of Po DECLARE_SOA_COLUMN(CascCosPA, cascCosPA, float); //! Cascade Cosine of Pointing Angle DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! The invariant mass of V0 candidate, assuming lambda DECLARE_SOA_COLUMN(MAntiLambda, mAntiLambda, float); //! The invariant mass of V0 candidate, assuming antilambda +DECLARE_SOA_COLUMN(MK0Short, mK0Short, float); //! The invariant mass of V0 candidate, assuming k0s DECLARE_SOA_COLUMN(MXi, mXi, float); //! The invariant mass of Xi candidate DECLARE_SOA_COLUMN(TransRadius, transRadius, float); //! Transverse radius of the decay vertex DECLARE_SOA_COLUMN(CascTransRadius, casctransRadius, float); //! Transverse radius of the decay vertex from cascade @@ -143,6 +144,7 @@ DECLARE_SOA_TABLE(ResoV0s, "AOD", "RESOV0S", resodaughter::DaughDCA, resodaughter::MLambda, resodaughter::MAntiLambda, + resodaughter::MK0Short, resodaughter::TransRadius, resodaughter::DecayVtxX, resodaughter::DecayVtxY, diff --git a/PWGLF/DataModel/LFStrangenessPIDTables.h b/PWGLF/DataModel/LFStrangenessPIDTables.h index 531d124af71..af9dd2e44db 100644 --- a/PWGLF/DataModel/LFStrangenessPIDTables.h +++ b/PWGLF/DataModel/LFStrangenessPIDTables.h @@ -45,6 +45,10 @@ namespace v0data // lengths as stored in the AO2D for TOF calculations DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length +DECLARE_SOA_COLUMN(PosTOFSignal, posTOFSignal, float); //! positive track signal +DECLARE_SOA_COLUMN(NegTOFSignal, negTOFSignal, float); //! negative track signal +DECLARE_SOA_COLUMN(PosTOFEventTime, posTOFEventTime, float); //! positive track event time +DECLARE_SOA_COLUMN(NegTOFEventTime, negTOFEventTime, float); //! negative track event time // delta-times DECLARE_SOA_COLUMN(PosTOFDeltaTLaPi, posTOFDeltaTLaPi, float); //! positive track TOFDeltaT from pion <- lambda expectation @@ -63,12 +67,14 @@ DECLARE_SOA_COLUMN(PosNSigmaK0Pi, posNSigmaK0Pi, float); //! positive track NSig DECLARE_SOA_COLUMN(NegNSigmaK0Pi, negNSigmaK0Pi, float); //! positive track NSigma from pion <- k0short expectation } // namespace v0data -DECLARE_SOA_TABLE(V0TOF, "AOD", "V0TOF", // raw information table (for debug, etc) +DECLARE_SOA_TABLE(V0TOFs, "AOD", "V0TOF", // raw information table (for debug, etc) v0data::PosTOFLength, v0data::NegTOFLength, + v0data::PosTOFSignal, v0data::NegTOFSignal, + v0data::PosTOFEventTime, v0data::NegTOFEventTime, v0data::PosTOFDeltaTLaPi, v0data::PosTOFDeltaTLaPr, v0data::NegTOFDeltaTLaPi, v0data::NegTOFDeltaTLaPr, v0data::PosTOFDeltaTK0Pi, v0data::NegTOFDeltaTK0Pi); -DECLARE_SOA_TABLE(V0TOFPID, "AOD", "V0TOFPID", // nsigma table (for analysis) +DECLARE_SOA_TABLE(V0TOFPIDs, "AOD", "V0TOFPID", // nsigma table (for analysis) v0data::PosNSigmaLaPi, v0data::PosNSigmaLaPr, v0data::NegNSigmaLaPi, v0data::NegNSigmaLaPr, v0data::PosNSigmaK0Pi, v0data::NegNSigmaK0Pi); @@ -80,6 +86,12 @@ namespace cascdata DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length DECLARE_SOA_COLUMN(BachTOFLength, bachTOFLength, float); //! bachelor track length +DECLARE_SOA_COLUMN(PosTOFSignal, posTOFSignal, float); //! positive track signal +DECLARE_SOA_COLUMN(NegTOFSignal, negTOFSignal, float); //! negative track signal +DECLARE_SOA_COLUMN(BachTOFSignal, bachTOFSignal, float); //! bachelor track signal +DECLARE_SOA_COLUMN(PosTOFEventTime, posTOFEventTime, float); //! positive track event time +DECLARE_SOA_COLUMN(NegTOFEventTime, negTOFEventTime, float); //! negative track event time +DECLARE_SOA_COLUMN(BachTOFEventTime, bachTOFEventTime, float); //! bachelor track event time // delta-times DECLARE_SOA_COLUMN(PosTOFDeltaTXiPi, posTOFDeltaTXiPi, float); //! positive track TOFDeltaT from pion <- lambda <- xi expectation @@ -106,15 +118,17 @@ DECLARE_SOA_COLUMN(NegNSigmaOmPr, negNSigmaOmPr, float); //! negative tr DECLARE_SOA_COLUMN(BachNSigmaOmKa, bachNSigmaOmKa, float); //! bachelor track NSigma from kaon <- omega expectation } // namespace cascdata -DECLARE_SOA_TABLE(CascTOF, "AOD", "CascTOF", // raw information table (for debug, etc) +DECLARE_SOA_TABLE(CascTOFs, "AOD", "CascTOF", // raw information table (for debug, etc) cascdata::PosTOFLength, cascdata::NegTOFLength, cascdata::BachTOFLength, + cascdata::PosTOFSignal, cascdata::NegTOFSignal, cascdata::BachTOFSignal, + cascdata::PosTOFEventTime, cascdata::NegTOFEventTime, cascdata::BachTOFEventTime, cascdata::PosTOFDeltaTXiPi, cascdata::PosTOFDeltaTXiPr, cascdata::NegTOFDeltaTXiPi, cascdata::NegTOFDeltaTXiPr, cascdata::BachTOFDeltaTXiPi, cascdata::PosTOFDeltaTOmPi, cascdata::PosTOFDeltaTOmPr, cascdata::NegTOFDeltaTOmPi, cascdata::NegTOFDeltaTOmPr, cascdata::BachTOFDeltaTOmPi); -DECLARE_SOA_TABLE(CascTOFPID, "AOD", "CASCTOFPID", // nsigma table (for analysis) +DECLARE_SOA_TABLE(CascTOFPIDs, "AOD", "CASCTOFPID", // nsigma table (for analysis) cascdata::PosNSigmaXiPi, cascdata::PosNSigmaXiPr, cascdata::NegNSigmaXiPi, cascdata::NegNSigmaXiPr, cascdata::BachNSigmaXiPi, diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index f3f611b98d1..3e0a42829d6 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -900,10 +900,11 @@ DECLARE_SOA_TABLE(CascTags, "AOD", "CASCTAGS", namespace mcv0label { DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! MC particle for V0 +DECLARE_SOA_INDEX_COLUMN_FULL(McMotherParticle, mcMotherParticle, int, McParticles, "_Mother"); //! } // namespace mcv0label DECLARE_SOA_TABLE(McV0Labels, "AOD", "MCV0LABEL", //! Table joinable with V0Data containing the MC labels - mcv0label::McParticleId); + mcv0label::McParticleId, mcv0label::McMotherParticleId); using McV0Label = McV0Labels::iterator; // Definition of labels for V0s // Full table, joinable with V0 (CAUTION: NOT WITH V0DATA) @@ -920,11 +921,12 @@ using McFullV0Label = McFullV0Labels::iterator; namespace mccasclabel { DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! MC particle for Cascade +DECLARE_SOA_INDEX_COLUMN_FULL(McMotherParticle, mcMotherParticle, int, McParticles, "_Mother"); //! DECLARE_SOA_COLUMN(IsBachBaryonCandidate, isBachBaryonCandidate, bool); //! will this be built or not? } // namespace mccasclabel DECLARE_SOA_TABLE(McCascLabels, "AOD", "MCCASCLABEL", //! Table joinable with CascData containing the MC labels - mccasclabel::McParticleId); + mccasclabel::McParticleId, mccasclabel::McMotherParticleId); DECLARE_SOA_TABLE(McCascBBTags, "AOD", "MCCASCBBTAG", //! Table joinable with CascData containing yes / no for BB correlation mccasclabel::IsBachBaryonCandidate); using McCascLabel = McCascLabels::iterator; diff --git a/PWGLF/DataModel/QC/strangenessTablesQC.h b/PWGLF/DataModel/QC/strangenessTablesQC.h new file mode 100644 index 00000000000..042fbd3f2be --- /dev/null +++ b/PWGLF/DataModel/QC/strangenessTablesQC.h @@ -0,0 +1,119 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \brief QA task for Cascade analysis using derived data +/// +/// \author Roman Nepeivoda (roman.nepeivoda@cern.ch) + +#ifndef PWGLF_DATAMODEL_STRANGENESSTABLESQC_H_ +#define PWGLF_DATAMODEL_STRANGENESSTABLESQC_H_ + +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +namespace o2::aod +{ +namespace cascadesQC +{ +DECLARE_SOA_COLUMN(CascCosPA, casccosPA, float); //! +DECLARE_SOA_COLUMN(V0CosPA, v0cosPA, float); //! needs to be changed to double +DECLARE_SOA_COLUMN(CascRadius, cascradius, float); //! +DECLARE_SOA_COLUMN(V0Radius, v0radius, float); //! V0 decay radius (2D, centered at zero) +DECLARE_SOA_COLUMN(Sign, sign, int); //! +DECLARE_SOA_COLUMN(YXi, yXi, float); //! +DECLARE_SOA_COLUMN(YOmega, yOmega, float); //! +DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! cascade decay length +DECLARE_SOA_COLUMN(LifetimeXi, lifetimeXi, float); //! +DECLARE_SOA_COLUMN(LifetimeOmega, lifetimeOmega, float); //! +DECLARE_SOA_COLUMN(LifetimeV0, lifetimeV0, float); //! +DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0daughters, float); //! DCA between V0 daughters +DECLARE_SOA_COLUMN(DCACascDaughters, dcacascdaughters, float); //! +DECLARE_SOA_COLUMN(DCAV0toPV, dcav0topv, float); //! +DECLARE_SOA_COLUMN(DCAbachtoPV, dcabachtopv, float); //! +DECLARE_SOA_COLUMN(DCAPosToPV, dcapostopv, float); //! DCA positive prong to PV +DECLARE_SOA_COLUMN(DCANegToPV, dcanegtopv, float); //! DCA negative prong to PV +DECLARE_SOA_COLUMN(PosNSigmaV0Pion, posNSigmaV0Pion, float); //! +DECLARE_SOA_COLUMN(PosNSigmaV0Proton, posNSigmaV0Proton, float); //! +DECLARE_SOA_COLUMN(NegNSigmaV0Pion, negNSigmaV0Pion, float); //! +DECLARE_SOA_COLUMN(NegNSigmaV0Proton, negNSigmaV0Proton, float); //! +DECLARE_SOA_COLUMN(BachNSigmaV0Pion, bachNSigmaV0Pion, float); //! +DECLARE_SOA_COLUMN(BachNSigmaV0Kaon, bachNSigmaV0Kaon, float); //! +DECLARE_SOA_COLUMN(Pt, pt, float); //! +DECLARE_SOA_COLUMN(Eta, eta, float); //! +DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! +DECLARE_SOA_COLUMN(MOmega, mOmega, float); //! +DECLARE_SOA_COLUMN(MXi, mXi, float); //! + +} // namespace cascadesQC + +DECLARE_SOA_TABLE(CascadesQC, "AOD", "CASCADESQC", o2::soa::Index<>, + cascadesQC::Sign, cascadesQC::YXi, cascadesQC::YOmega, + cascadesQC::CascCosPA, cascadesQC::V0CosPA, + cascadesQC::CascRadius, cascadesQC::V0Radius, + cascadesQC::DecayLength, cascadesQC::LifetimeXi, cascadesQC::LifetimeOmega, cascadesQC::LifetimeV0, + cascadesQC::DCAV0Daughters, cascadesQC::DCACascDaughters, cascadesQC::DCAV0toPV, + cascadesQC::DCAbachtoPV, cascadesQC::DCAPosToPV, cascadesQC::DCANegToPV, + cascadesQC::PosNSigmaV0Pion, cascadesQC::PosNSigmaV0Proton, + cascadesQC::NegNSigmaV0Pion, cascadesQC::NegNSigmaV0Proton, + cascadesQC::BachNSigmaV0Pion, cascadesQC::BachNSigmaV0Kaon, + cascadesQC::Pt, cascadesQC::Eta, + cascadesQC::MLambda, cascadesQC::MOmega, cascadesQC::MXi); + +namespace vZerosQC +{ +DECLARE_SOA_COLUMN(V0CosPA, v0cosPA, float); //! needs to be changed to double +DECLARE_SOA_COLUMN(YK0Short, yK0Short, float); //! V0 y with K0short hypothesis +DECLARE_SOA_COLUMN(YLambda, yLambda, float); //! V0 y with lambda or antilambda hypothesis +DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0daughters, float); //! DCA between V0 daughters +DECLARE_SOA_COLUMN(DCAV0toPV, dcav0topv, float); //! DCA V0 to PV +DECLARE_SOA_COLUMN(DCAPosToPV, dcapostopv, float); //! DCA positive prong to PV +DECLARE_SOA_COLUMN(DCANegToPV, dcanegtopv, float); //! DCA negative prong to PV +DECLARE_SOA_COLUMN(V0Radius, v0radius, float); //! V0 decay radius (2D, centered at zero) +DECLARE_SOA_COLUMN(PosNSigmaV0Pion, posNSigmaV0Pion, float); //! number of TPC sigmas for a pos daughter to be a pion +DECLARE_SOA_COLUMN(PosNSigmaV0Proton, posNSigmaV0Proton, float); //! number of TPC sigmas for a pos daughter to be a proton +DECLARE_SOA_COLUMN(NegNSigmaV0Pion, negNSigmaV0Pion, float); //! number of TPC sigmas for a neg daughter to be a pion +DECLARE_SOA_COLUMN(NegNSigmaV0Proton, negNSigmaV0Proton, float); //! number of TPC sigmas for a neg daughter to be a proton +DECLARE_SOA_COLUMN(LifetimeLambda, lifetimeLambda, float); //! lifetime with lambda mass assumption +DECLARE_SOA_COLUMN(LifetimeK0s, lifetimeK0s, float); //! lifetime with K0s mass assumption +DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! V0 decay length +DECLARE_SOA_COLUMN(PosITSNhits, posITSNhits, int); //! number of ITS hits of pos daughter +DECLARE_SOA_COLUMN(NegITSNhits, negITSNhits, int); //! number of ITS hits of neg daughter +DECLARE_SOA_COLUMN(Pt, pt, float); //! transverse momentum in GeV/c +DECLARE_SOA_COLUMN(Eta, eta, float); //! pseudorapidity of V0 +DECLARE_SOA_COLUMN(PosEta, poseta, float); //! pseudorapidity of V0 pos daughter +DECLARE_SOA_COLUMN(NegEta, negeta, float); //! pseudorapidity of V0 neg daughter +DECLARE_SOA_COLUMN(PosPhi, posphi, float); //! +DECLARE_SOA_COLUMN(NegPhi, negphi, float); //! +DECLARE_SOA_COLUMN(MK0Short, mK0Short, float); //! inv mass with K0s assumption +DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! inv mass with lambda assumption +DECLARE_SOA_COLUMN(MAntiLambda, mAntiLambda, float); //! inv mass with anti-lambda assumption +} // namespace vZerosQC + +DECLARE_SOA_TABLE(VZerosQC, "AOD", "VZEROSQC", o2::soa::Index<>, + vZerosQC::YK0Short, vZerosQC::YLambda, + vZerosQC::DCAV0Daughters, vZerosQC::DCAV0toPV, + vZerosQC::DCAPosToPV, vZerosQC::DCANegToPV, + vZerosQC::V0Radius, vZerosQC::V0CosPA, + vZerosQC::PosNSigmaV0Pion, vZerosQC::PosNSigmaV0Proton, + vZerosQC::NegNSigmaV0Pion, vZerosQC::NegNSigmaV0Proton, + vZerosQC::DecayLength, vZerosQC::LifetimeLambda, vZerosQC::LifetimeK0s, + vZerosQC::PosITSNhits, vZerosQC::NegITSNhits, + vZerosQC::Pt, vZerosQC::Eta, + vZerosQC::MK0Short, vZerosQC::MLambda, vZerosQC::MAntiLambda, + vZerosQC::PosEta, vZerosQC::NegEta, + vZerosQC::PosPhi, vZerosQC::NegPhi); +} // namespace o2::aod + +#endif // PWGLF_DATAMODEL_STRANGENESSTABLESQC_H_ diff --git a/PWGLF/TableProducer/CMakeLists.txt b/PWGLF/TableProducer/CMakeLists.txt index 34078a45cf4..e5c2e28f318 100644 --- a/PWGLF/TableProducer/CMakeLists.txt +++ b/PWGLF/TableProducer/CMakeLists.txt @@ -9,6 +9,8 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. +add_subdirectory(QC) + # General purpose o2physics_add_dpl_workflow(tpcpid SOURCES lfTPCPID.cxx @@ -16,6 +18,7 @@ o2physics_add_dpl_workflow(tpcpid COMPONENT_NAME Analysis) # Strangeness + o2physics_add_dpl_workflow(lambdakzerobuilder SOURCES lambdakzerobuilder.cxx PUBLIC_LINK_LIBRARIES O2::DCAFitter O2Physics::AnalysisCore diff --git a/PWGLF/TableProducer/LFResonanceInitializer.cxx b/PWGLF/TableProducer/LFResonanceInitializer.cxx index f1ed4939d6b..d313b748f3a 100644 --- a/PWGLF/TableProducer/LFResonanceInitializer.cxx +++ b/PWGLF/TableProducer/LFResonanceInitializer.cxx @@ -472,7 +472,7 @@ struct reso2initializer { v0.phi(), childIDs, v0.v0cosPA(), - v0.dcaV0daughters(), v0.mLambda(), v0.mAntiLambda(), + v0.dcaV0daughters(), v0.mLambda(), v0.mAntiLambda(), v0.mK0Short(), v0.v0radius(), v0.x(), v0.y(), v0.z()); if constexpr (isMC) { fillMCV0(v0); diff --git a/PWGLF/TableProducer/QC/CMakeLists.txt b/PWGLF/TableProducer/QC/CMakeLists.txt new file mode 100644 index 00000000000..f8e4e1bcdd6 --- /dev/null +++ b/PWGLF/TableProducer/QC/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright 2019-2020 CERN and copyright holders of ALICE O2. +# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +# All rights not expressly granted are reserved. +# +# This software is distributed under the terms of the GNU General Public +# License v3 (GPL Version 3), copied verbatim in the file "COPYING". +# +# In applying this license CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization +# or submit itself to any jurisdiction. + +o2physics_add_dpl_workflow(strangenessqc + SOURCES strangenessQC.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/TableProducer/QC/strangenessQC.cxx b/PWGLF/TableProducer/QC/strangenessQC.cxx new file mode 100644 index 00000000000..ad0875357e0 --- /dev/null +++ b/PWGLF/TableProducer/QC/strangenessQC.cxx @@ -0,0 +1,241 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// +/// \brief V0 and Cascade derived table producer for strangeness in pb-pb QC task +/// +/// In case of questions please write to: +/// \author Roman Nepeivoda (roman.nepeivoda@cern.ch) + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Common/DataModel/EventSelection.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/PIDResponse.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/QC/strangenessTablesQC.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct strangenessQC { + // Tables to produce + Produces cascadesQC; + Produces vZerosQC; + + // Histogram registries + HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rGeneral{"generalInfo", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + + // Configurable for event selection + Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; + Configurable sel8{"sel8", true, "Apply sel8 event selection"}; + + // Configurable parameters for V0 selection + Configurable v0setting_dcav0dau{"v0setting_dcav0dau", 1, "DCA V0 Daughters"}; + Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.1, "DCA Pos To PV"}; + Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.1, "DCA Neg To PV"}; + Configurable v0setting_cospa{"v0setting_cospa", 0.97, "V0 CosPA"}; // should be double! + Configurable v0setting_radius{"v0setting_radius", 1, "v0radius"}; + Configurable v0setting_rapidity{"v0setting_rapidity", 0.5, "rapidity"}; + + // Configurable parameters for cascade selection + Configurable cascadesetting_cospa{"cascadesetting_cospa", 0.98, "Casc CosPA"}; // should be double! + Configurable cascadesetting_v0cospa{"cascadesetting_v0cospa", 0.98, "Casc V0 CosPA"}; // should be double! + Configurable cascadesetting_dcacascdau{"cascadesetting_dcacascdau", 1.0, "DCA cascade daughters"}; + Configurable cascadesetting_dcav0dau{"cascadesetting_dcav0dau", 1.0, "DCA Cascade's V0 Daughters"}; + Configurable cascadesetting_dcabachtopv{"cascadesetting_dcabachtopv", 0.1, "DCA bachelor to PV"}; + Configurable cascadesetting_dcapostopv{"cascadesetting_dcapostopv", 0.2, "DCA Casc. V0's pos to PV"}; + Configurable cascadesetting_dcanegtopv{"cascadesetting_dcanegtopv", 0.2, "DCA Casc V0's neg to PV"}; + Configurable cascadesetting_mindcav0topv{"cascadesetting_mindcav0topv", 0.01, "minimum V0 DCA to PV"}; + Configurable cascadesetting_cascradius{"cascadesetting_cascradius", 1.0, "cascradius"}; + Configurable cascadesetting_v0masswindow{"cascadesetting_v0masswindow", 0.01, "v0 mass window"}; + Configurable cascadesetting_v0radius{"cascadesetting_v0radius", 0.9, "v0 radius"}; + Configurable cascadesetting_rapidity{"cascadesetting_rapidity", 0.5, "rapidity"}; + + // PDG data base + Service pdgDB; + + void init(InitContext const&) + { + // Axes + AxisSpec vertexZAxis = {100, -15., 15., "vrtx_{Z} [cm]"}; + + // Histograms + // Event selection + rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); + + // Cut summary + rGeneral.add("selectionSummary", "selectionSummary", HistType::kTH1F, {{19, -0.5, 18.5}}); + TString CutLabelSummary[19] = {"cutzvertex", "v0_dcav0dau", "v0_dcapostopv", "v0_dcanegtopv", "v0_cospa", "v0_radius", "v0_rapidity", + "casc_cospa", "casc_v0cospa", "casc_dcacascdau", "casc_dcav0dau", "casc_dcabachtopv", "casc_dcapostopv", "casc_dcanegtopv", "casc_mindcav0topv", "casc_cascradius", "casc_v0masswindow", "casc_v0radius", "casc_rapidity"}; + for (Int_t n = 1; n <= rGeneral.get(HIST("selectionSummary"))->GetNbinsX(); n++) { + rGeneral.get(HIST("selectionSummary"))->GetXaxis()->SetBinLabel(n, CutLabelSummary[n - 1]); + } + rGeneral.get(HIST("selectionSummary"))->SetBinContent(1, cutzvertex); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(2, v0setting_dcav0dau); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(3, v0setting_dcapostopv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(4, v0setting_dcanegtopv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(5, v0setting_cospa); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(6, v0setting_radius); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(7, v0setting_rapidity); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(8, cascadesetting_cospa); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(9, cascadesetting_v0cospa); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(10, cascadesetting_dcacascdau); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(11, cascadesetting_dcav0dau); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(12, cascadesetting_dcabachtopv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(13, cascadesetting_dcapostopv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(14, cascadesetting_dcanegtopv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(15, cascadesetting_mindcav0topv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(16, cascadesetting_cascradius); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(17, cascadesetting_v0masswindow); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(18, cascadesetting_v0radius); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(19, cascadesetting_rapidity); + } + + // Event selection + Filter eventFilter = (sel8 && o2::aod::evsel::sel8 == true); + Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); + + // Filters on V0s + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && + nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && + aod::v0data::dcaV0daughters < v0setting_dcav0dau && + aod::v0data::v0cosPA > v0setting_cospa); + + // Filters on Cascades + Filter preFilterCascades = (nabs(aod::cascdata::dcabachtopv) > cascadesetting_dcabachtopv && + aod::cascdata::dcaV0daughters < cascadesetting_dcav0dau && + nabs(aod::cascdata::dcapostopv) > cascadesetting_dcapostopv && + nabs(aod::cascdata::dcanegtopv) > cascadesetting_dcanegtopv && + aod::cascdata::dcacascdaughters < cascadesetting_dcacascdau); + + // Defining the type of the daughter tracks + using DaughterTracks = soa::Join; + + void processData(soa::Filtered>::iterator const& collision, + soa::Filtered const& Cascades, + soa::Filtered const& V0s, + aod::V0Datas const&, // it's needed to access the full table of V0s (not the filtered one) to make sure all the V0s related to cascades are present + aod::V0sLinked const&, + DaughterTracks const&) + { + // Fill the event counter + rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); + + // v0-s loop + for (const auto& v0 : V0s) { + // Decay radius check + if (v0.v0radius() < v0setting_radius) { + continue; + } + // Rapidity check + if (TMath::Abs(v0.yK0Short()) > v0setting_rapidity && + TMath::Abs(v0.yLambda()) > v0setting_rapidity) { + continue; + } + + const auto& posDau = v0.posTrack_as(); + const auto& negDau = v0.negTrack_as(); + + int posITSNhits = 0, negITSNhits = 0; + for (unsigned int i = 0; i < 7; i++) { + if (posDau.itsClusterMap() & (1 << i)) { + posITSNhits++; + } + if (negDau.itsClusterMap() & (1 << i)) { + negITSNhits++; + } + } + + float decayLength = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * RecoDecay::sqrtSumOfSquares(v0.px(), v0.py(), v0.pz()); + float cTauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * pdgDB->Mass(3122); + float cTauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * pdgDB->Mass(310); + + vZerosQC(v0.yK0Short(), v0.yLambda(), + v0.dcaV0daughters(), v0.dcav0topv(), + v0.dcapostopv(), v0.dcanegtopv(), + v0.v0radius(), v0.v0cosPA(), + posDau.tpcNSigmaPi(), posDau.tpcNSigmaPr(), + negDau.tpcNSigmaPi(), negDau.tpcNSigmaPr(), + decayLength, cTauLambda, cTauK0s, + posITSNhits, negITSNhits, + v0.pt(), v0.eta(), + v0.mK0Short(), v0.mLambda(), v0.mAntiLambda(), + posDau.eta(), negDau.eta(), + posDau.phi(), negDau.phi()); + } + + // cascades loop + for (const auto& casc : Cascades) { + const auto& v0index = casc.v0_as(); + if (!(v0index.has_v0Data())) + continue; // skip those cascades for which V0 doesn't exist + + // Rapidity check + if (TMath::Abs(casc.yXi()) > cascadesetting_rapidity && + TMath::Abs(casc.yOmega()) > cascadesetting_rapidity) { + continue; + } + + float casc_v0cospa = casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); + float casc_cospa = casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()); + float casc_dcav0topv = casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()); + + // Cut on dynamic columns + if (casc.v0radius() < cascadesetting_v0radius || + casc.cascradius() < cascadesetting_cascradius || + casc_v0cospa < cascadesetting_v0cospa || + casc_cospa < cascadesetting_cospa || + TMath::Abs(casc_dcav0topv) < cascadesetting_mindcav0topv) { + continue; + } + + // Cut on v0 invariant mass + if (TMath::Abs(casc.mLambda() - pdgDB->Mass(3122)) > cascadesetting_v0masswindow) + continue; + + const auto& v0Casc = v0index.v0Data(); // de-reference index to correct v0data in case it exists + const auto& bachDau = casc.bachelor_as(); + const auto& posDau = v0Casc.posTrack_as(); + const auto& negDau = v0Casc.negTrack_as(); + + float cascDecayLength = std::hypot(casc.x() - collision.posX(), casc.y() - collision.posY(), casc.z() - collision.posZ()); + float cascTotalMomentum = std::hypot(casc.px(), casc.py(), casc.pz()); + float CtauXi = cascDecayLength / (cascTotalMomentum + 1e-13) * pdgDB->Mass(3312); + float CtauOmega = cascDecayLength / (cascTotalMomentum + 1e-13) * pdgDB->Mass(3334); + + float v0DecayLength = std::hypot(casc.xlambda() - casc.x(), casc.ylambda() - casc.y(), casc.zlambda() - casc.z()); + float v0TotalMomentum = std::hypot(casc.pxpos() + casc.pxneg(), casc.pypos() + casc.pyneg(), casc.pzpos() + casc.pzneg()); + float CtauV0 = v0DecayLength / (v0TotalMomentum + 1e-13) * pdgDB->Mass(3122); + + cascadesQC(casc.sign(), casc.yXi(), casc.yOmega(), + casc_cospa, casc_v0cospa, + casc.cascradius(), casc.v0radius(), + cascDecayLength, CtauXi, CtauOmega, CtauV0, + casc.dcaV0daughters(), casc.dcacascdaughters(), casc_dcav0topv, + casc.dcabachtopv(), casc.dcapostopv(), casc.dcanegtopv(), + posDau.tpcNSigmaPi(), posDau.tpcNSigmaPr(), + negDau.tpcNSigmaPi(), negDau.tpcNSigmaPr(), + bachDau.tpcNSigmaPi(), bachDau.tpcNSigmaKa(), + casc.pt(), casc.eta(), + casc.mLambda(), casc.mOmega(), casc.mXi()); + } + } + PROCESS_SWITCH(strangenessQC, processData, "Process Run 3 data", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"lf-strangenessqc"})}; +} diff --git a/PWGLF/TableProducer/cascadebuilder.cxx b/PWGLF/TableProducer/cascadebuilder.cxx index 4001268388a..24788cdb725 100644 --- a/PWGLF/TableProducer/cascadebuilder.cxx +++ b/PWGLF/TableProducer/cascadebuilder.cxx @@ -2070,5 +2070,6 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; } diff --git a/PWGLF/TableProducer/cascademcbuilder.cxx b/PWGLF/TableProducer/cascademcbuilder.cxx index 9fb9bf0144e..13d132fc357 100644 --- a/PWGLF/TableProducer/cascademcbuilder.cxx +++ b/PWGLF/TableProducer/cascademcbuilder.cxx @@ -73,11 +73,11 @@ struct cascademcbuilder { // Loop over those that actually have the corresponding V0 associated to them auto v0 = casc.v0_as(); if (!(v0.has_v0Data())) { - casclabels(-1); + casclabels(-1, -1); continue; // skip those cascades for which V0 doesn't exist (but: should never happen) } auto v0data = v0.v0Data(); // de-reference index to correct v0data in case it exists - int lLabel = -1; + int lLabel = -1, lMotherLabel = -1; // Acquire all three daughter tracks, please auto lBachTrack = casc.bachelor_as(); @@ -132,6 +132,7 @@ struct cascademcbuilder { if (lV0Mother.has_mothers()) { for (auto& lV0GrandMother : lV0Mother.mothers_as()) { pdgCodeMother = lV0GrandMother.pdgCode(); + lMotherLabel = lV0GrandMother.globalIndex(); } } } @@ -144,7 +145,7 @@ struct cascademcbuilder { } // end association check // Construct label table (note: this will be joinable with CascDatas) casclabels( - lLabel); + lLabel, lMotherLabel); if (populateCascMCCores) { cascmccores( pdgCode, pdgCodeMother, pdgCodeV0, isPhysicalPrimary, @@ -165,7 +166,6 @@ struct cascademcbuilder { for (auto& casc : casctable) { // Loop over those that actually have the corresponding V0 associated to them auto v0 = casc.v0_as(); - // auto v0 = casc.v0(); int lLabel = -1; // Acquire all three daughter tracks, please diff --git a/PWGLF/TableProducer/cascadepid.cxx b/PWGLF/TableProducer/cascadepid.cxx index 6646528b498..c8b3a6f09fb 100644 --- a/PWGLF/TableProducer/cascadepid.cxx +++ b/PWGLF/TableProducer/cascadepid.cxx @@ -77,8 +77,8 @@ using LabeledTracksExtra = soa::Join; struct cascadepid { // TOF pid for strangeness (recalculated with topology) - Produces casctof; // raw table for checks - Produces casctofpid; // table with Nsigmas + Produces casctof; // raw table for checks + Produces casctofpid; // table with Nsigmas Service ccdb; @@ -250,6 +250,8 @@ struct cascadepid { if (fillRawPID) { casctof(posTrack.length(), negTrack.length(), bachTrack.length(), + posTrack.tofSignal(), negTrack.tofSignal(), bachTrack.tofSignal(), + posTrack.tofEvTime(), negTrack.tofEvTime(), bachTrack.tofEvTime(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); } diff --git a/PWGLF/TableProducer/lambdakzeromcbuilder.cxx b/PWGLF/TableProducer/lambdakzeromcbuilder.cxx index 52fd19a7ec4..118210b66ca 100644 --- a/PWGLF/TableProducer/lambdakzeromcbuilder.cxx +++ b/PWGLF/TableProducer/lambdakzeromcbuilder.cxx @@ -54,7 +54,7 @@ struct lambdakzeromcbuilder { void process(aod::V0Datas const& v0table, aod::McTrackLabels const&, aod::McParticles const& particlesMC) { for (auto& v0 : v0table) { - int lLabel = -1; + int lLabel = -1, lMotherLabel = -1; int pdgCode = -1, pdgCodeMother = -1, pdgCodePositive = -1, pdgCodeNegative = -1; bool isPhysicalPrimary = false; float xmc = -999.0f, ymc = -999.0f, zmc = -999.0f; @@ -91,6 +91,7 @@ struct lambdakzeromcbuilder { if (lNegMother.has_mothers()) { for (auto& lNegGrandMother : lNegMother.mothers_as()) { pdgCodeMother = lNegGrandMother.pdgCode(); + lMotherLabel = lNegGrandMother.globalIndex(); } } } @@ -100,7 +101,7 @@ struct lambdakzeromcbuilder { } // end association check // Construct label table (note: this will be joinable with V0Datas!) v0labels( - lLabel); + lLabel, lMotherLabel); if (populateV0MCCores) { v0mccores( pdgCode, pdgCodeMother, pdgCodePositive, pdgCodeNegative, diff --git a/PWGLF/TableProducer/lambdakzeropid.cxx b/PWGLF/TableProducer/lambdakzeropid.cxx index 7b6d1834184..0d353634411 100644 --- a/PWGLF/TableProducer/lambdakzeropid.cxx +++ b/PWGLF/TableProducer/lambdakzeropid.cxx @@ -77,8 +77,8 @@ using LabeledTracksExtra = soa::Join; struct lambdakzeropid { // TOF pid for strangeness (recalculated with topology) - Produces v0tof; // raw table for checks - Produces v0tofpid; // table with Nsigmas + Produces v0tof; // raw table for checks + Produces v0tofpid; // table with Nsigmas Service ccdb; @@ -298,6 +298,8 @@ struct lambdakzeropid { if (fillRawPID) { v0tof(posTrackRow.length(), negTrackRow.length(), + posTrackRow.tofSignal(), negTrackRow.tofSignal(), + posTrackRow.tofEvTime(), negTrackRow.tofEvTime(), deltaTimePositiveLambdaPi, deltaTimePositiveLambdaPr, deltaTimeNegativeLambdaPi, deltaTimeNegativeLambdaPr, deltaTimePositiveK0ShortPi, deltaTimeNegativeK0ShortPi); diff --git a/PWGLF/TableProducer/nucleiSpectra.cxx b/PWGLF/TableProducer/nucleiSpectra.cxx index 76631200928..90f5758daed 100644 --- a/PWGLF/TableProducer/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/nucleiSpectra.cxx @@ -288,12 +288,12 @@ struct nucleiSpectra { for (int iPID{0}; iPID < 2; ++iPID) { nuclei::hDCAxy[iPID][iS][iC] = spectra.add(fmt::format("hDCAxy{}_{}_{}", nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("DCAxy {} {} {}", nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data(), HistType::kTH3D, {centAxis, ptAxes[iS], dcaxyAxes[iS]}); nuclei::hDCAz[iPID][iS][iC] = spectra.add(fmt::format("hDCAz{}_{}_{}", nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("DCAz {} {} {}", nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data(), HistType::kTH3D, {centAxis, ptAxes[iS], dcazAxes[iS]}); - nuclei::hDeltaP[iPID][iS] = spectra.add(fmt::format("hDeltaP{}_{}", nuclei::pidName[iPID], nuclei::names[iS]).data(), fmt::format("#Delta#it{{p}}/#it{{p}} {} {}", nuclei::pidName[iPID], nuclei::names[iS]).data(), HistType::kTH2D, {{232, 0.2, 6., "#it{{p}} (GeV/#it{{c}})"}, {200, -1, 1, "(#it{{p}}_{{IU}} - #it{{p}}_{{TPC}}) / #it{{p}}"}}); } nuclei::hTOFmass[iS][iC] = spectra.add(fmt::format("h{}TOFmass{}", nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("TOF mass - {} PDG mass", nuclei::names[iS]).data(), HistType::kTH3D, {centAxis, ptAxes[iS], tofMassAxis}); nuclei::hTOFmassEta[iS][iC] = spectra.add(fmt::format("h{}TOFmassEta{}", nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("TOF mass - {} PDG mass", nuclei::names[iS]).data(), HistType::kTH3D, {etaAxis, ptAxes[iS], tofMassAxis}); nuclei::hMomRes[iS][iC] = spectra.add(fmt::format("h{}MomRes{}", nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("Momentum resolution {}", nuclei::names[iS]).data(), HistType::kTH3D, {centAxis, ptAxes[iS], ptResAxis}); nuclei::hGenNuclei[iS][iC] = spectra.add(fmt::format("h{}Gen{}", nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("Generated {}", nuclei::names[iS]).data(), HistType::kTH2D, {centAxis, ptAxes[iS]}); + nuclei::hDeltaP[iC][iS] = spectra.add(fmt::format("hDeltaP{}_{}", nuclei::matter[iC], nuclei::names[iS]).data(), fmt::format("#Delta#it{{p}}/#it{{p}} {} {}", nuclei::matter[iC], nuclei::names[iS]).data(), HistType::kTH2D, {{232, 0.2, 6., "#it{{p}} (GeV/#it{{c}})"}, {200, -1.0, 1.0, "(#it{{p}}_{{IU}} - #it{{p}}_{{TPC}}) / #it{{p}}"}}); } } diff --git a/PWGLF/TableProducer/strangederivedbuilder.cxx b/PWGLF/TableProducer/strangederivedbuilder.cxx index 78075a4b870..465eb8db4fd 100644 --- a/PWGLF/TableProducer/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/strangederivedbuilder.cxx @@ -332,11 +332,11 @@ struct strangederivedbuilder { //__________________________________________________ // mark mcParticles for referencing for (auto const& v0 : V0s) - if (v0.has_mcParticle()) - motherReference[v0.mcParticleId()] = 0; + if (v0.has_mcMotherParticle()) + motherReference[v0.mcMotherParticleId()] = 0; for (auto const& ca : Cascades) - if (ca.has_mcParticle()) - motherReference[ca.mcParticleId()] = 0; + if (ca.has_mcMotherParticle()) + motherReference[ca.mcMotherParticleId()] = 0; //__________________________________________________ // Figure out the numbering of the new mcMother table // assume filling per order @@ -349,9 +349,9 @@ struct strangederivedbuilder { //__________________________________________________ // populate track references for (auto const& v0 : V0s) - v0mothers(motherReference[v0.mcParticleId()]); // joinable with V0Datas + v0mothers(motherReference[v0.mcMotherParticleId()]); // joinable with V0Datas for (auto const& ca : Cascades) - cascmothers(motherReference[ca.mcParticleId()]); // joinable with CascDatas + cascmothers(motherReference[ca.mcMotherParticleId()]); // joinable with CascDatas //__________________________________________________ // populate motherMCParticles for (auto const& tr : mcParticles) { diff --git a/PWGLF/TableProducer/v0qaanalysis.cxx b/PWGLF/TableProducer/v0qaanalysis.cxx index a0ad2811e0b..d0838a1234e 100644 --- a/PWGLF/TableProducer/v0qaanalysis.cxx +++ b/PWGLF/TableProducer/v0qaanalysis.cxx @@ -37,7 +37,8 @@ void customize(std::vector& workflowOptions) #include "Framework/runDataProcessing.h" using DauTracks = soa::Join; -using DauTracksMC = soa::Join; +using DauTracksMC = soa::Join; +using V0Collisions = soa::Join; struct LfV0qaanalysis { @@ -48,6 +49,21 @@ struct LfV0qaanalysis { void init(InitContext const&) { + int nProc = 0; + if (doprocessData) { + nProc += 1; + } + if (doprocessMCReco) { + nProc += 1; + } + if (doprocessMCGen) { + nProc += 1; + } + if (nProc == 0) { + LOG(fatal) << "Enable at least one process function"; + } + LOG(info) << "Number of process functions enabled: " << nProc; + registry.add("hNEvents", "hNEvents", {HistType::kTH1I, {{4, 0.f, 4.f}}}); registry.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(1, "all"); registry.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(2, "sel8"); @@ -62,17 +78,26 @@ struct LfV0qaanalysis { registry.get(HIST("hNEventsMCGen"))->GetXaxis()->SetBinLabel(2, "zvertex_true"); registry.get(HIST("hNEventsMCGen"))->GetXaxis()->SetBinLabel(3, "INELgt0_true"); registry.get(HIST("hNEventsMCGen"))->GetXaxis()->SetBinLabel(4, "sel8_true"); - registry.add("hNEventsMC_AllColl", "hNEventsMC_AllColl", {HistType::kTH1I, {{1, 0.f, 1.f}}}); - registry.add("hNEventsMC_RecoColl", "hNEventsMC_RecoColl", {HistType::kTH1I, {{1, 0.f, 1.f}}}); - registry.add("Reconstructed_MCRecoColl_K0Short", "Reconstructed_MCRecoColl_K0Short", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); - registry.add("Reconstructed_MCRecoColl_Lambda", "Reconstructed_MCRecoColl_Lambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); - registry.add("Reconstructed_MCRecoColl_AntiLambda", "Reconstructed_MCRecoColl_AntiLambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); - registry.add("Generated_MCRecoColl_K0Short", "Generated_MCRecoColl_K0Short", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); - registry.add("Generated_MCRecoColl_Lambda", "Generated_MCRecoColl_Lambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); - registry.add("Generated_MCRecoColl_AntiLambda", "Generated_MCRecoColl_AntiLambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); - registry.add("Generated_MCAllColl_K0Short", "Generated_MCAllColl_K0Short", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); - registry.add("Generated_MCAllColl_Lambda", "Generated_MCAllColl_Lambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); - registry.add("Generated_MCAllColl_AntiLambda", "Generated_MCAllColl_AntiLambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("hNEventsMC_AllColl", "hNEventsMC_AllColl", {HistType::kTH1I, {{2, 0.f, 2.f}}}); + registry.add("hNEventsMC_RecoColl", "hNEventsMC_RecoColl", {HistType::kTH1I, {{2, 0.f, 2.f}}}); + registry.add("Reconstructed_MCRecoColl_INEL_K0Short", "Reconstructed_MCRecoColl_INEL_K0Short", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Reconstructed_MCRecoColl_INEL_Lambda", "Reconstructed_MCRecoColl_INEL_Lambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Reconstructed_MCRecoColl_INEL_AntiLambda", "Reconstructed_MCRecoColl_INEL_AntiLambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Reconstructed_MCRecoColl_INELgt0_K0Short", "Reconstructed_MCRecoColl_INELgt0_K0Short", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Reconstructed_MCRecoColl_INELgt0_Lambda", "Reconstructed_MCRecoColl_INELgt0_Lambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Reconstructed_MCRecoColl_INELgt0_AntiLambda", "Reconstructed_MCRecoColl_INELgt0_AntiLambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCRecoColl_INEL_K0Short", "Generated_MCRecoColl_INEL_K0Short", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCRecoColl_INEL_Lambda", "Generated_MCRecoColl_INEL_Lambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCRecoColl_INEL_AntiLambda", "Generated_MCRecoColl_INEL_AntiLambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCAllColl_INEL_K0Short", "Generated_MCAllColl_INEL_K0Short", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCAllColl_INEL_Lambda", "Generated_MCAllColl_INEL_Lambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCAllColl_INEL_AntiLambda", "Generated_MCAllColl_INEL_AntiLambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCRecoColl_INELgt0_K0Short", "Generated_MCRecoColl_INELgt0_K0Short", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCRecoColl_INELgt0_Lambda", "Generated_MCRecoColl_INELgt0_Lambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCRecoColl_INELgt0_AntiLambda", "Generated_MCRecoColl_INELgt0_AntiLambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCAllColl_INELgt0_K0Short", "Generated_MCAllColl_INELgt0_K0Short", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCAllColl_INELgt0_Lambda", "Generated_MCAllColl_INELgt0_Lambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); + registry.add("Generated_MCAllColl_INELgt0_AntiLambda", "Generated_MCAllColl_INELgt0_AntiLambda", {HistType::kTH2F, {{250, 0.f, 25.f}, {100, -1.f, +1.f}}}); } } @@ -137,8 +162,9 @@ struct LfV0qaanalysis { Filter preFilterV0 = nabs(aod::v0data::dcapostopv) > dcapostopv&& nabs(aod::v0data::dcanegtopv) > dcanegtopv&& aod::v0data::dcaV0daughters < dcav0dau; - void processData(soa::Join::iterator const& collision, - soa::Filtered const& V0s, DauTracks const& tracks) + void processData(V0Collisions::iterator const& collision, + soa::Filtered const& V0s, + DauTracks const& tracks) { // Apply event selection @@ -219,7 +245,7 @@ struct LfV0qaanalysis { registry.fill(HIST("hNEvents"), 0.5); if (!AcceptEvent(collision)) { - return; + continue; } if (!collision.has_mcCollision()) { continue; @@ -228,6 +254,13 @@ struct LfV0qaanalysis { registry.fill(HIST("hNEventsMC_RecoColl"), 0.5); + // Event flags + int evFlag = 0; + if (collision.isInelGt0()) { + evFlag = 1; + registry.fill(HIST("hNEventsMC_RecoColl"), 1.5); + } + auto v0sThisCollision = V0s.sliceBy(perCol, collision.globalIndex()); for (auto& v0 : v0sThisCollision) { // loop over V0s @@ -239,13 +272,22 @@ struct LfV0qaanalysis { // Highest numerator of efficiency if (v0mcparticle.isPhysicalPrimary()) { if (v0mcparticle.pdgCode() == 310) { - registry.fill(HIST("Reconstructed_MCRecoColl_K0Short"), v0mcparticle.pt(), v0mcparticle.y()); // K0s + registry.fill(HIST("Reconstructed_MCRecoColl_INEL_K0Short"), v0mcparticle.pt(), v0mcparticle.y()); // K0s + if (evFlag == 1) { + registry.fill(HIST("Reconstructed_MCRecoColl_INELgt0_K0Short"), v0mcparticle.pt(), v0mcparticle.y()); // K0s + } } if (v0mcparticle.pdgCode() == 3122) { - registry.fill(HIST("Reconstructed_MCRecoColl_Lambda"), v0mcparticle.pt(), v0mcparticle.y()); // Lambda + registry.fill(HIST("Reconstructed_MCRecoColl_INEL_Lambda"), v0mcparticle.pt(), v0mcparticle.y()); // Lambda + if (evFlag == 1) { + registry.fill(HIST("Reconstructed_MCRecoColl_INELgt0_Lambda"), v0mcparticle.pt(), v0mcparticle.y()); // Lambda + } } if (v0mcparticle.pdgCode() == -3122) { - registry.fill(HIST("Reconstructed_MCRecoColl_AntiLambda"), v0mcparticle.pt(), v0mcparticle.y()); // AntiLambda + registry.fill(HIST("Reconstructed_MCRecoColl_INEL_AntiLambda"), v0mcparticle.pt(), v0mcparticle.y()); // AntiLambda + if (evFlag == 1) { + registry.fill(HIST("Reconstructed_MCRecoColl_INELgt0_AntiLambda"), v0mcparticle.pt(), v0mcparticle.y()); // AntiLambda + } } } @@ -266,12 +308,6 @@ struct LfV0qaanalysis { } } - // Event flags - int evFlag = 0; - if (collision.isInelGt0()) { - evFlag = 1; - } - float ctauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; float ctauAntiLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0Bar; float ctauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; @@ -308,12 +344,24 @@ struct LfV0qaanalysis { if (!mcParticle.isPhysicalPrimary()) { continue; } - if (mcParticle.pdgCode() == 310) - registry.fill(HIST("Generated_MCRecoColl_K0Short"), mcParticle.pt(), mcParticle.y()); // K0s - if (mcParticle.pdgCode() == 3122) - registry.fill(HIST("Generated_MCRecoColl_Lambda"), mcParticle.pt(), mcParticle.y()); // Lambda - if (mcParticle.pdgCode() == -3122) - registry.fill(HIST("Generated_MCRecoColl_AntiLambda"), mcParticle.pt(), mcParticle.y()); // AntiLambda + if (mcParticle.pdgCode() == 310) { + registry.fill(HIST("Generated_MCRecoColl_INEL_K0Short"), mcParticle.pt(), mcParticle.y()); // K0s + if (evFlag == 1) { + registry.fill(HIST("Generated_MCRecoColl_INELgt0_K0Short"), mcParticle.pt(), mcParticle.y()); // K0s + } + } + if (mcParticle.pdgCode() == 3122) { + registry.fill(HIST("Generated_MCRecoColl_INEL_Lambda"), mcParticle.pt(), mcParticle.y()); // Lambda + if (evFlag == 1) { + registry.fill(HIST("Generated_MCRecoColl_INELgt0_Lambda"), mcParticle.pt(), mcParticle.y()); // Lambda + } + } + if (mcParticle.pdgCode() == -3122) { + registry.fill(HIST("Generated_MCRecoColl_INEL_AntiLambda"), mcParticle.pt(), mcParticle.y()); // AntiLambda + if (evFlag == 1) { + registry.fill(HIST("Generated_MCRecoColl_INELgt0_AntiLambda"), mcParticle.pt(), mcParticle.y()); // AntiLambda + } + } } } } @@ -335,12 +383,15 @@ struct LfV0qaanalysis { const auto particlesInMCCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mccollision.globalIndex(), cache2); - if (!isTrueINELgt0(particlesInMCCollision)) { - continue; - } - registry.fill(HIST("hNEventsMCGen"), 2.5); registry.fill(HIST("hNEventsMC_AllColl"), 0.5); + bool isINELgt0true = false; + if (isTrueINELgt0(particlesInMCCollision)) { + isINELgt0true = true; + registry.fill(HIST("hNEventsMCGen"), 2.5); + registry.fill(HIST("hNEventsMC_AllColl"), 1.5); + } + for (auto& mcParticle : particlesInMCCollision) { if (std::abs(mcParticle.pdgCode()) == 211) { // simulated sel8 @@ -352,12 +403,27 @@ struct LfV0qaanalysis { } } - if (mcParticle.pdgCode() == 310) - registry.fill(HIST("Generated_MCAllColl_K0Short"), mcParticle.pt(), mcParticle.y()); // K0s - if (mcParticle.pdgCode() == 3122) - registry.fill(HIST("Generated_MCAllColl_Lambda"), mcParticle.pt(), mcParticle.y()); // Lambda - if (mcParticle.pdgCode() == -3122) - registry.fill(HIST("Generated_MCAllColl_AntiLambda"), mcParticle.pt(), mcParticle.y()); // AntiLambda + if (!mcParticle.isPhysicalPrimary()) { + continue; + } + if (mcParticle.pdgCode() == 310) { + registry.fill(HIST("Generated_MCAllColl_INEL_K0Short"), mcParticle.pt(), mcParticle.y()); // K0s + if (isINELgt0true) { + registry.fill(HIST("Generated_MCAllColl_INELgt0_K0Short"), mcParticle.pt(), mcParticle.y()); // K0s + } + } + if (mcParticle.pdgCode() == 3122) { + registry.fill(HIST("Generated_MCAllColl_INEL_Lambda"), mcParticle.pt(), mcParticle.y()); // Lambda + if (isINELgt0true) { + registry.fill(HIST("Generated_MCAllColl_INELgt0_Lambda"), mcParticle.pt(), mcParticle.y()); // Lambda + } + } + if (mcParticle.pdgCode() == -3122) { + registry.fill(HIST("Generated_MCAllColl_INEL_AntiLambda"), mcParticle.pt(), mcParticle.y()); // AntiLambda + if (isINELgt0true) { + registry.fill(HIST("Generated_MCAllColl_INELgt0_AntiLambda"), mcParticle.pt(), mcParticle.y()); // AntiLambda + } + } } if (isFT0A && isFT0C) { diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index 0746d4640ab..79f7074cbd7 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -225,3 +225,8 @@ o2physics_add_dpl_workflow(helium-flow SOURCES helium_flow.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(f1protoncorrelation + SOURCES f1protoncorrelation.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/LFNucleiBATask.cxx b/PWGLF/Tasks/LFNucleiBATask.cxx index 8d81ef2794f..5361d582e4d 100644 --- a/PWGLF/Tasks/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/LFNucleiBATask.cxx @@ -367,10 +367,20 @@ struct LFNucleiBATask { if (enablePr) { histos.add("tracks/proton/h1ProtonSpectra", "#it{p}_{T} (p)", HistType::kTH1F, {ptAxis}); histos.add("tracks/proton/h1antiProtonSpectra", "#it{p}_{T} (#bar{p})", HistType::kTH1F, {ptAxis}); + + histos.add("tracks/proton/h2ProtonYvsPt", "#it{y} vs #it{p}_{T} (p)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/proton/h2antiProtonYvsPt", "#it{y} vs #it{p}_{T} (#bar{p})", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/proton/h2ProtonEtavsPt", "#it{#eta} vs #it{p}_{T} (p)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/proton/h2antiProtonEtavsPt", "#it{#eta} vs #it{p}_{T} (#bar{p})", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); } if (enableDe) { histos.add("tracks/deuteron/h1DeuteronSpectra", "#it{p}_{T} (d)", HistType::kTH1F, {ptAxis}); histos.add("tracks/deuteron/h1antiDeuteronSpectra", "#it{p}_{T} (#bar{d})", HistType::kTH1F, {ptAxis}); + + histos.add("tracks/deuteron/h2DeuteronYvsPt", "#it{y} vs #it{p}_{T} (d)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/deuteron/h2antiDeuteronYvsPt", "#it{y} vs #it{p}_{T} (#bar{d})", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/deuteron/h2DeuteronEtavsPt", "it{#eta} vs #it{p}_{T} (d)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/deuteron/h2antiDeuteronEtavsPt", "it{#eta} vs #it{p}_{T} (#bar{d})", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); } if (enableTr) { histos.add("tracks/triton/h1TritonSpectra", "#it{p}_{T} (t)", HistType::kTH1F, {ptAxis}); @@ -380,8 +390,18 @@ struct LFNucleiBATask { histos.add("tracks/helium/h1HeliumSpectra", "#it{p}_{T} (He)", HistType::kTH1F, {ptAxis}); histos.add("tracks/helium/h1antiHeliumSpectra", "#it{p}_{T} (#bar{He})", HistType::kTH1F, {ptAxis}); + histos.add("tracks/helium/h2HeliumYvsPt", "#it{y} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/helium/h2HeliumYvsPt_Z2", "#it{y} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/helium/h2HeliumEtavsPt", "it{#eta} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/helium/h2HeliumEtavsPt_Z2", "it{#eta} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/helium/h1HeliumSpectra_Z2", "#it{p}_{T} (He)", HistType::kTH1F, {ptAxis}); histos.add("tracks/helium/h1antiHeliumSpectra_Z2", "#it{p}_{T} (#bar{He})", HistType::kTH1F, {ptAxis}); + + histos.add("tracks/helium/h2antiHeliumYvsPt", "#it{y} vs #it{p}_{T} (#bar{He})", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/helium/h2antiHeliumYvsPt_Z2", "#it{y} vs #it{p}_{T} (#bar{He})", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/helium/h2antiHeliumEtavsPt", "it{#eta} vs #it{p}_{T} (#bar{He})", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); + histos.add("tracks/helium/h2antiHeliumEtavsPt_Z2", "it{#eta} vs #it{p}_{T} (#bar{He})", HistType::kTH2F, {{96, -1.2, 1.2}, {ptAxis}}); } if (enableAl) { histos.add("tracks/alpha/h1AlphaSpectra", "#it{p}_{T} (#alpha)", HistType::kTH1F, {ptAxis}); @@ -450,6 +470,14 @@ struct LFNucleiBATask { histos.add("tracks/helium/h1antiHeliumSpectraTruePrim_Z2", "#it{p}_{T} (He)", HistType::kTH1F, {ptAxis}); histos.add("tracks/helium/h1antiHeliumSpectraTrueSec_Z2", "#it{p}_{T} (He)", HistType::kTH1F, {ptAxis}); histos.add("tracks/helium/h1antiHeliumSpectraTrueTransport_Z2", "#it{p}_{T} (He)", HistType::kTH1F, {ptAxis}); + if (enablePtSpectra) { + histos.add("tracks/eff/helium/hPtHeTrue", "Track #it{p}_{T} (He); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/helium/hPtantiHeTrue", "Track #it{p}_{T} (#bar{He}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + if (doTOFplots) { + histos.add("tracks/eff/helium/hPtHeTOFTrue", "Track #it{p}_{T} (He); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/helium/hPtantiHeTOFTrue", "Track #it{p}_{T} (#bar{He}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + } + } } if (enableAl) { histos.add("tracks/alpha/h1AlphaSpectraTrue", "#it{p}_{T} (#alpha)", HistType::kTH1F, {ptAxis}); @@ -2361,6 +2389,9 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/proton/h2pVsTPCmomentumPr"), track.tpcInnerParam(), track.p()); } histos.fill(HIST("tracks/proton/h1ProtonSpectra"), track.pt()); + histos.fill(HIST("tracks/proton/h2ProtonYvsPt"), track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Proton)), track.pt()); + histos.fill(HIST("tracks/proton/h2ProtonEtavsPt"), track.eta(), track.pt()); + if (enablePIDplot) histos.fill(HIST("tracks/proton/h2TPCsignVsTPCmomentumProton"), track.tpcInnerParam(), track.tpcSignal()); if (enableNucleiHardCut && (std::abs(track.tpcNSigmaPi()) > 2) && (std::abs(track.tpcNSigmaKa()) > 2) && (std::abs(track.tpcNSigmaDe()) > 2)) { @@ -2373,6 +2404,9 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/proton/h2pVsTPCmomentumantiPr"), track.tpcInnerParam(), track.p()); } histos.fill(HIST("tracks/proton/h1antiProtonSpectra"), track.pt()); + histos.fill(HIST("tracks/proton/h2antiProtonYvsPt"), track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Proton)), track.pt()); + histos.fill(HIST("tracks/proton/h2antiProtonEtavsPt"), track.eta(), track.pt()); + if (enablePIDplot) histos.fill(HIST("tracks/proton/h2TPCsignVsTPCmomentumantiProton"), track.tpcInnerParam(), track.tpcSignal()); if (enableNucleiHardCut && (std::abs(track.tpcNSigmaPi()) > 2) && (std::abs(track.tpcNSigmaKa()) > 2) && (std::abs(track.tpcNSigmaDe()) > 2)) { @@ -2383,7 +2417,6 @@ struct LFNucleiBATask { } if (enableDe) { - // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut)) { if ((std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe) && deRapCut) { if (track.sign() > 0) { if (enablePtSpectra) { @@ -2391,6 +2424,7 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/deuteron/h2pVsTPCmomentumDe"), track.tpcInnerParam(), track.p()); } histos.fill(HIST("tracks/deuteron/h1DeuteronSpectra"), track.pt()); + histos.fill(HIST("tracks/deuteron/h2DeuteronYvsPt"), track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron)), track.pt()); if (enablePIDplot) histos.fill(HIST("tracks/deuteron/h2TPCsignVsTPCmomentumDeuteron"), track.tpcInnerParam(), track.tpcSignal()); if (enableNucleiHardCut && (std::abs(track.tpcNSigmaPi()) > 2) && (std::abs(track.tpcNSigmaKa()) > 2) && (std::abs(track.tpcNSigmaPr()) > 1) && (std::abs(track.tpcNSigmaTr()) > 1) && (std::abs(track.tpcNSigmaDe()) < nsigmaTPCStrongCut)) { @@ -2402,6 +2436,7 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/deuteron/h2pVsTPCmomentumantiDe"), track.tpcInnerParam(), track.p()); } histos.fill(HIST("tracks/deuteron/h1antiDeuteronSpectra"), track.pt()); + histos.fill(HIST("tracks/deuteron/h2antiDeuteronYvsPt"), track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron)), track.pt()); if (enablePIDplot) histos.fill(HIST("tracks/deuteron/h2TPCsignVsTPCmomentumantiDeuteron"), track.tpcInnerParam(), track.tpcSignal()); if (enableNucleiHardCut && (std::abs(track.tpcNSigmaPi()) > 2) && (std::abs(track.tpcNSigmaKa()) > 2) && (std::abs(track.tpcNSigmaPr()) > 1) && (std::abs(track.tpcNSigmaTr()) > 1) && (std::abs(track.tpcNSigmaDe()) < nsigmaTPCStrongCut)) { @@ -2412,7 +2447,6 @@ struct LFNucleiBATask { } if (enableTr) { - // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaTr()) < nsigmaTPCTr)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Triton))) < yCut)) { if ((isTriton) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Triton))) < yCut)) { if (track.sign() > 0) { if (enablePtSpectra) { @@ -2440,7 +2474,6 @@ struct LFNucleiBATask { } } if (enableHe) { - // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut)) { if ((std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe) && heRapCut) { if (track.sign() > 0) { if (enablePtSpectra) { @@ -2449,6 +2482,11 @@ struct LFNucleiBATask { } histos.fill(HIST("tracks/helium/h1HeliumSpectra"), hePt); histos.fill(HIST("tracks/helium/h1HeliumSpectra_Z2"), 2 * hePt); + histos.fill(HIST("tracks/helium/h2HeliumYvsPt"), track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3)), 2 * hePt); + histos.fill(HIST("tracks/helium/h2HeliumYvsPt_Z2"), track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3)), 2 * hePt); + histos.fill(HIST("tracks/helium/h2HeliumEtavsPt"), track.eta(), 2 * hePt); + histos.fill(HIST("tracks/helium/h2HeliumEtavsPt_Z2"), track.eta(), 2 * hePt); + if (enablePIDplot) histos.fill(HIST("tracks/helium/h2TPCsignVsTPCmomentumHelium"), track.tpcInnerParam(), track.tpcSignal()); if (enableNucleiHardCut && (std::abs(track.tpcNSigmaKa()) > 2) && (std::abs(track.tpcNSigmaPr()) > 2) && (std::abs(track.tpcNSigmaTr()) > 1) && (std::abs(track.tpcNSigmaHe()) < nsigmaTPCStrongCut)) { @@ -2461,6 +2499,10 @@ struct LFNucleiBATask { } histos.fill(HIST("tracks/helium/h1antiHeliumSpectra"), antihePt); histos.fill(HIST("tracks/helium/h1antiHeliumSpectra_Z2"), 2 * antihePt); + histos.fill(HIST("tracks/helium/h2antiHeliumYvsPt"), track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3)), 2 * hePt); + histos.fill(HIST("tracks/helium/h2antiHeliumYvsPt_Z2"), track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3)), 2 * hePt); + histos.fill(HIST("tracks/helium/h2antiHeliumEtavsPt"), track.eta(), 2 * hePt); + histos.fill(HIST("tracks/helium/h2antiHeliumEtavsPt_Z2"), track.eta(), 2 * hePt); if (enablePIDplot) histos.fill(HIST("tracks/helium/h2TPCsignVsTPCmomentumantiHelium"), track.tpcInnerParam(), track.tpcSignal()); if (enableNucleiHardCut && (std::abs(track.tpcNSigmaKa()) > 2) && (std::abs(track.tpcNSigmaPr()) > 2) && (std::abs(track.tpcNSigmaTr()) > 1) && (std::abs(track.tpcNSigmaHe()) < nsigmaTPCStrongCut)) { @@ -2470,7 +2512,6 @@ struct LFNucleiBATask { } } if (enableAl) { - // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaAl()) < nsigmaTPCAl)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Alpha))) < yCut) { if ((std::abs(track.tpcNSigmaAl()) < nsigmaTPCAl) && TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Alpha))) < yCut) { if (track.sign() > 0) { histos.fill(HIST("tracks/alpha/h1AlphaSpectra"), track.pt()); @@ -2716,7 +2757,6 @@ struct LFNucleiBATask { } } if (enableDe) { - // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut)) { if ((std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe) && deRapCut) { if (track.sign() > 0) { if (enablePtSpectra) @@ -2788,7 +2828,6 @@ struct LFNucleiBATask { } if (enableTr) { - // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaTr()) < nsigmaTPCTr)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Triton))) < yCut)) { if ((isTriton) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Triton))) < yCut)) { if (track.sign() > 0) { if (enablePtSpectra) @@ -3028,6 +3067,12 @@ struct LFNucleiBATask { if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe) { histos.fill(HIST("tracks/helium/h1HeliumSpectraTrueWPID"), hePt); histos.fill(HIST("tracks/helium/h1HeliumSpectraTrueWPID_Z2"), 2 * hePt); + if (enablePtSpectra) { + histos.fill(HIST("tracks/eff/helium/hPtHeTrue"), 2 * hePt); + if (track.hasTOF() & doTOFplots) { + histos.fill(HIST("tracks/eff/helium/hPtHeTOFTrue"), 2 * hePt); + } + } } if (isPhysPrim) { histos.fill(HIST("tracks/helium/h1HeliumSpectraTruePrim"), hePt); @@ -3062,6 +3107,12 @@ struct LFNucleiBATask { if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe) { histos.fill(HIST("tracks/helium/h1antiHeliumSpectraTrueWPID"), antihePt); histos.fill(HIST("tracks/helium/h1antiHeliumSpectraTrueWPID_Z2"), 2 * antihePt); + if (enablePtSpectra) { + histos.fill(HIST("tracks/eff/helium/hPtantiHeTrue"), 2 * hePt); + if (track.hasTOF() & doTOFplots) { + histos.fill(HIST("tracks/eff/helium/hPtantiHeTOFTrue"), 2 * hePt); + } + } } if (isPhysPrim) { histos.fill(HIST("tracks/helium/h1antiHeliumSpectraTruePrim"), antihePt); diff --git a/PWGLF/Tasks/QC/CMakeLists.txt b/PWGLF/Tasks/QC/CMakeLists.txt index 50fd9b6e814..c3a0f98b06c 100644 --- a/PWGLF/Tasks/QC/CMakeLists.txt +++ b/PWGLF/Tasks/QC/CMakeLists.txt @@ -68,3 +68,8 @@ o2physics_add_dpl_workflow(efficiencyqa SOURCES efficiencyQA.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(strangenessqcpp + SOURCES strangenessQCPP.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/QC/efficiencyQA.cxx b/PWGLF/Tasks/QC/efficiencyQA.cxx index 92bfc626de0..7a6b34970e6 100644 --- a/PWGLF/Tasks/QC/efficiencyQA.cxx +++ b/PWGLF/Tasks/QC/efficiencyQA.cxx @@ -63,26 +63,14 @@ float invMass2Body(std::array& momA, std::array const& momB, } // namespace struct ProbeTrack { - ProbeTrack(uint64_t const& idx, uint64_t const& idxTpc, uint64_t const& idxTag, float const& p, float const& pt, float const& eta, float const& phi, float const& mass, uint8_t const& map, float const& xv, float const& yv, float const& zv) : globalIndex{idx}, - globalIndexTpc{idxTpc}, - p{p}, - pt{pt}, - eta{eta}, - phi{phi}, - massTagProbe{mass}, - vtx0{xv}, - vtx1{yv}, - vtx2{zv}, - detectorMap{map}, - globalIndexTag{idxTag} - { - } uint64_t globalIndex; uint64_t globalIndexTpc; float p; float pt; - float eta; - float phi; + float pProp; + float ptProp; + float etaProp; + float phiProp; float massTagProbe; float vtx0; float vtx1; @@ -117,6 +105,7 @@ struct efficiencyQA { Configurable v0cosPaMin{"v0cosPaMin", 0.99f, "minimum cosine of pointing angle of V0"}; Configurable findTpcLeg{"findTpcLeg", false, "toggle search of missing tpc segment"}; + Configurable propToTPCinnerWall{"propToTPCinnerWall", false, "toggle propagation of tracks to the TPC inner wall"}; Configurable refitVertex{"refitVertex", false, "toggle refit of decay vertex using tag and tpc prolongation"}; Configurable ptWindow{"ptWindow", 0.05f, "pt window to search tpc segment"}; Configurable etaWindow{"etaWindow", 0.3f, "eta window to search tpc segment"}; @@ -202,6 +191,11 @@ struct efficiencyQA { hPiRecMass = histos.add("piRecMass", ";;#it{p}_{T} (GeV/#it{c});#it{M}(#pi^{+} + #pi^{-}) (GeV/#it{c}^{2})", HistType::kTH3F, {recAxis, ptAxis, massK0sAxis}); hTagCuts = histos.add("tagCuts", ";;#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {recAxis, ptAxis}); + histos.add("massTagTpc", ";#it{p} (GeV/#it{c});#it{M}(#pi^{+} + #pi^{-}) (GeV/#it{c}^{2})", HistType::kTH2F, {ptAxis, massK0sAxis}); + histos.add("ptItsTpcSel", ";#it{p} (GeV/#it{c});#it{p}_{T}^{TPC} - #it{p}_{T}^{ITS} (GeV/#it{c})", HistType::kTH2F, {ptAxis, ptResAxis}); + histos.add("etaItsTpcSel", ";#it{p} (GeV/#it{c});#eta^{TPC} - #eta^{ITS}", HistType::kTH2F, {ptAxis, ptResAxis}); + histos.add("phiItsTpcSel", ";#it{p} (GeV/#it{c});#phi^{TPC} - #phi^{ITS} (rad)", HistType::kTH2F, {ptAxis, ptResAxis}); + std::string binLabelsTag[]{"hasITS && hasTPC", "tracking", "PID", "v0 mass", "dcaV0dau", "cosPA", "dcaXYZ", "V0radius"}; for (int iB{0}; iB < 8; ++iB) { hTagCuts->GetXaxis()->SetBinLabel(iB + 1, binLabelsTag[iB].data()); @@ -403,14 +397,27 @@ struct efficiencyQA { histos.fill(HIST("massV0"), massV0); - uint64_t idxTpc{0}; - uint8_t map{0}; + auto trackPt = probeTrack.sign() * std::hypot(momProbe[0], momProbe[1]); + auto trackP = probeTrack.sign() * std::hypot(trackPt, momProbe[2]); + + ProbeTrack probe; + probe.globalIndex = probeTrack.globalIndex(); + probe.globalIndexTpc = 0; + probe.globalIndexTag = tagTrack.globalIndex(); + probe.detectorMap = 0; + probe.p = trackP; + probe.pt = trackPt; + probe.massTagProbe = massV0; + probe.vtx0 = vtx[0]; + probe.vtx1 = vtx[1]; + probe.vtx2 = vtx[2]; + if (probeTrack.hasITS() && !probeTrack.hasTPC() && findTpcLeg) { auto acceptIts = !(probeTrack.itsChi2NCl() > 36. || probeTrack.itsNCls() < 4); if (!acceptIts) { continue; } - map = probeTrack.detectorMap(); + probe.detectorMap = probeTrack.detectorMap(); std::array momTpc; for (auto& tpcTrack : tpcTracks) { @@ -430,16 +437,35 @@ struct efficiencyQA { gpu::gpustd::array dcaInfo; auto tpcTrackCov = getTrackParCov(tpcTrack); - o2::base::Propagator::Instance()->propagateToDCABxByBz({static_cast(vtx[0]), static_cast(vtx[1]), static_cast(vtx[2])}, tpcTrackCov, 2.f, fitter.getMatCorrType(), &dcaInfo); + if (propToTPCinnerWall) { + o2::base::Propagator::Instance()->PropagateToXBxByBz(probeTrackCov, 70.f, 1.f, 2.f, fitter.getMatCorrType()); + o2::base::Propagator::Instance()->PropagateToXBxByBz(tpcTrackCov, 70.f, 1.f, 2.f, fitter.getMatCorrType()); + } else { + o2::base::Propagator::Instance()->propagateToDCABxByBz({static_cast(vtx[0]), static_cast(vtx[1]), static_cast(vtx[2])}, tpcTrackCov, 2.f, fitter.getMatCorrType(), &dcaInfo); + } + // tpcTrackCov.update({probeTrack.y(), probeTrack.z()}, {std::pow(probeTrack.sigmaY(), 2), probeTrack.rhoZY() * probeTrack.sigmaY() * probeTrack.sigmaZ(), std::pow(probeTrack.sigmaZ(), 2)}); + // o2::base::Propagator::Instance()->propagateToDCABxByBz({static_cast(vtx[0]), static_cast(vtx[1]), static_cast(vtx[2])}, tpcTrackCov, 2.f, fitter.getMatCorrType(), &dcaInfo); - bool acceptTrackPt = std::abs(tpcTrackCov.getPt() - propTrackProbe.getPt()) < ptWindow; - bool acceptTrackEta = std::abs(tpcTrackCov.getEta() - propTrackProbe.getEta()) < etaWindow; - bool acceptTrackPhi = std::abs(tpcTrackCov.getPhi() - propTrackProbe.getPhi()) < phiWindow; + probe.pProp = probeTrackCov.getP(); + probe.ptProp = probeTrackCov.getPt(); + probe.etaProp = probeTrackCov.getEta(); + probe.phiProp = probeTrackCov.getPhi(); + + bool acceptTrackPt = std::abs(tpcTrackCov.getPt() - probeTrackCov.getPt()) < ptWindow; + bool acceptTrackEta = std::abs(tpcTrackCov.getEta() - probeTrackCov.getEta()) < etaWindow; + bool acceptTrackPhi = std::abs(tpcTrackCov.getPhi() - probeTrackCov.getPhi()) < phiWindow; bool acceptTpcTrack = acceptTrackPt && acceptTrackEta && acceptTrackPhi; // LOGF(debug, "idx = %lld, Dpt = %f, Deta = %f, Dphi = %f", tpcTrack.globalIndex(), std::abs(tpcTrackCov.getPt() - propTrackProbe.getPt()), std::abs(tpcTrackCov.getEta() - propTrackProbe.getEta()), std::abs(tpcTrackCov.getPhi() - propTrackProbe.getPhi())); if (acceptTpcTrack) { + histos.fill(HIST("ptItsTpcSel"), trackP, tpcTrackCov.getPt() - probeTrackCov.getPt()); + histos.fill(HIST("etaItsTpcSel"), trackP, tpcTrackCov.getEta() - probeTrackCov.getEta()); + histos.fill(HIST("phiItsTpcSel"), trackP, tpcTrackCov.getPhi() - probeTrackCov.getPhi()); + + if (propToTPCinnerWall) { + o2::base::Propagator::Instance()->propagateToDCABxByBz({static_cast(vtx[0]), static_cast(vtx[1]), static_cast(vtx[2])}, tpcTrackCov, 2.f, fitter.getMatCorrType(), &dcaInfo); + } tpcTrackCov.getPxPyPzGlo(momTpc); auto massTpcLeg = invMass2Body(v0Mom, momTag, momTpc, piMass, piMass); auto massDiff = std::abs(massTpcLeg - o2::constants::physics::MassKaonNeutral); @@ -477,25 +503,25 @@ struct efficiencyQA { continue; } } - idxTpc = tpcTrack.globalIndex(); + + histos.fill(HIST("massTagTpc"), trackP, massTpcLeg); + probe.globalIndexTpc = tpcTrack.globalIndex(); + break; } } } } - auto trackPt = probeTrack.sign() * std::hypot(momProbe[0], momProbe[1]); - auto trackP = probeTrack.sign() * std::hypot(trackPt, momProbe[2]); - hPiRecMass->Fill(0., trackPt, massV0); - if (idxTpc > 0) { + if (probe.globalIndexTpc > 0) { hPiRecMass->Fill(7., trackPt, massV0); } fillHistTrack(probeTrack, hPiRecMass, trackPt, massV0); if (std::abs(massV0 - o2::constants::physics::MassKaonNeutral) < massMax) { - probeTracks.emplace_back(probeTrack.globalIndex(), idxTpc, tagTrack.globalIndex(), trackP, trackPt, propTrackProbe.getEta(), propTrackProbe.getPhi(), massV0, map, vtx[0], vtx[1], vtx[2]); + probeTracks.push_back(probe); hPiRec->Fill(0., trackPt); fillHistTrack(probeTrack, hPiRec, trackPt); - if (idxTpc > 0) { + if (probe.globalIndexTpc > 0) { hPiRec->Fill(7., trackPt); } } @@ -541,20 +567,29 @@ struct efficiencyQA { auto trackCov = getTrackParCov(tpcTrack); gpu::gpustd::array dcaInfo; - o2::base::Propagator::Instance()->propagateToDCABxByBz({probeTrack.vtx0, probeTrack.vtx1, probeTrack.vtx2}, trackCov, 2.f, fitter.getMatCorrType(), &dcaInfo); + if (propToTPCinnerWall) { + o2::base::Propagator::Instance()->PropagateToXBxByBz(trackCov, 70.f, 1.f, 2.f, fitter.getMatCorrType()); + } else { + o2::base::Propagator::Instance()->propagateToDCABxByBz({probeTrack.vtx0, probeTrack.vtx1, probeTrack.vtx2}, trackCov, 2.f, fitter.getMatCorrType(), &dcaInfo); + } + + histos.fill(HIST("pTpcIts"), probeTrack.p, trackCov.getP() - probeTrack.pProp); + histos.fill(HIST("ptTpcIts"), probeTrack.p, trackCov.getPt() - probeTrack.ptProp); + histos.fill(HIST("etaTpcIts"), probeTrack.p, trackCov.getEta() - probeTrack.etaProp); + histos.fill(HIST("phiTpcIts"), probeTrack.p, trackCov.getPhi() - probeTrack.phiProp); + histos.fill(HIST("ptEtaPhiTpcIts"), trackCov.getPt() - probeTrack.ptProp, trackCov.getEta() - probeTrack.etaProp, trackCov.getPhi() - probeTrack.phiProp); + + if (propToTPCinnerWall) { + o2::base::Propagator::Instance()->propagateToDCABxByBz({probeTrack.vtx0, probeTrack.vtx1, probeTrack.vtx2}, trackCov, 2.f, fitter.getMatCorrType(), &dcaInfo); + } std::array v0Mom, momTpc; trackCov.getPxPyPzGlo(momTpc); auto massTpcLeg = invMass2Body(v0Mom, momTag, momTpc, piMass, piMass); - histos.fill(HIST("pTpcIts"), probeTrack.p, trackCov.getP() - probeTrack.p * probeTrack.p / std::abs(probeTrack.p)); - histos.fill(HIST("ptTpcIts"), probeTrack.p, trackCov.getPt() - probeTrack.pt * probeTrack.pt / std::abs(probeTrack.pt)); - histos.fill(HIST("etaTpcIts"), probeTrack.p, trackCov.getEta() - probeTrack.eta); - histos.fill(HIST("phiTpcIts"), probeTrack.p, trackCov.getPhi() - probeTrack.phi); histos.fill(HIST("massTpc"), probeTrack.p, massTpcLeg); histos.fill(HIST("massTpcIts"), probeTrack.p, massTpcLeg - probeTrack.massTagProbe); - histos.fill(HIST("ptEtaPhiTpcIts"), trackCov.getPt() - probeTrack.pt * probeTrack.pt / std::abs(probeTrack.pt), trackCov.getEta() - probeTrack.eta, trackCov.getPhi() - probeTrack.phi); - LOGF(debug, "MC::DEBUG: idx = %lld, p = %f, Dpt = %f, Deta = %f, Dphi = %f", tpcTrack.globalIndex(), probeTrack.pt, std::abs(trackCov.getPt() - probeTrack.pt * probeTrack.pt / std::abs(probeTrack.pt)), std::abs(trackCov.getEta() - probeTrack.eta), std::abs(trackCov.getPhi() - probeTrack.phi)); + LOGF(debug, "MC::DEBUG: idx = %lld, p = %f, Dpt = %f, Deta = %f, Dphi = %f", tpcTrack.globalIndex(), probeTrack.pt, std::abs(trackCov.getPt() - probeTrack.pt * probeTrack.pt / std::abs(probeTrack.pt)), std::abs(trackCov.getEta() - probeTrack.etaProp), std::abs(trackCov.getPhi() - probeTrack.phiProp)); int nCand = 0; try { diff --git a/PWGLF/Tasks/QC/lfpropStudy.cxx b/PWGLF/Tasks/QC/lfpropStudy.cxx index a9e9b127660..72e67623825 100644 --- a/PWGLF/Tasks/QC/lfpropStudy.cxx +++ b/PWGLF/Tasks/QC/lfpropStudy.cxx @@ -34,8 +34,9 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using TracksLabeled = soa::Join; -using Tracks = soa::Join; +using TracksType = soa::Join; +using TracksCovMatType = soa::Join; +using TracksLabeledType = soa::Join; struct lfpropStudy { @@ -56,209 +57,558 @@ struct lfpropStudy { { histos.add("hEventCounter", "hEventCounter", kTH1F, {{1, 0.0f, 1.0f}}); + const AxisSpec AxisPx{axisMom, "#it{p}_{x} (GeV/#it{c})"}; + const AxisSpec AxisPy{axisMom, "#it{p}_{y} (GeV/#it{c})"}; + const AxisSpec AxisPz{axisMom, "#it{p}_{z} (GeV/#it{c})"}; + const AxisSpec AxisPt{axisMom, "#it{p}_{T} (GeV/#it{c})"}; + // momentum - histos.add("hPxEl", "hPxEl", kTH1F, {axisMom}); - histos.add("hPyEl", "hPyEl", kTH1F, {axisMom}); - histos.add("hPzEl", "hPzEl", kTH1F, {axisMom}); - histos.add("hPtEl", "hPtEl", kTH1F, {axisMom}); - histos.add("hPxPi", "hPxPi", kTH1F, {axisMom}); - histos.add("hPyPi", "hPyPi", kTH1F, {axisMom}); - histos.add("hPzPi", "hPzPi", kTH1F, {axisMom}); - histos.add("hPtPi", "hPtPi", kTH1F, {axisMom}); - histos.add("hPxKa", "hPxKa", kTH1F, {axisMom}); - histos.add("hPyKa", "hPyKa", kTH1F, {axisMom}); - histos.add("hPzKa", "hPzKa", kTH1F, {axisMom}); - histos.add("hPtKa", "hPtKa", kTH1F, {axisMom}); - histos.add("hPxPr", "hPxPr", kTH1F, {axisMom}); - histos.add("hPyPr", "hPyPr", kTH1F, {axisMom}); - histos.add("hPzPr", "hPzPr", kTH1F, {axisMom}); - histos.add("hPtPr", "hPtPr", kTH1F, {axisMom}); - histos.add("hPxDe", "hPxDe", kTH1F, {axisMom}); - histos.add("hPyDe", "hPyDe", kTH1F, {axisMom}); - histos.add("hPzDe", "hPzDe", kTH1F, {axisMom}); - histos.add("hPtDe", "hPtDe", kTH1F, {axisMom}); - histos.add("hPxTr", "hPxTr", kTH1F, {axisMom}); - histos.add("hPyTr", "hPyTr", kTH1F, {axisMom}); - histos.add("hPzTr", "hPzTr", kTH1F, {axisMom}); - histos.add("hPtTr", "hPtTr", kTH1F, {axisMom}); - histos.add("hPxHe", "hPxHe", kTH1F, {axisMom}); - histos.add("hPyHe", "hPyHe", kTH1F, {axisMom}); - histos.add("hPzHe", "hPzHe", kTH1F, {axisMom}); - histos.add("hPtHe", "hPtHe", kTH1F, {axisMom}); - histos.add("hPxAl", "hPxAl", kTH1F, {axisMom}); - histos.add("hPyAl", "hPyAl", kTH1F, {axisMom}); - histos.add("hPzAl", "hPzAl", kTH1F, {axisMom}); - histos.add("hPtAl", "hPtAl", kTH1F, {axisMom}); + histos.add("IU/hPx", "IU Px All", kTH1F, {AxisPx}); + histos.add("IU/hPy", "IU Py All", kTH1F, {AxisPy}); + histos.add("IU/hPz", "IU Pz All", kTH1F, {AxisPz}); + histos.add("IU/hPt", "IU Pt All", kTH1F, {AxisPt}); + histos.add("IU/El/hPx", "IU Px El", kTH1F, {AxisPx}); + histos.add("IU/El/hPy", "IU Py El", kTH1F, {AxisPy}); + histos.add("IU/El/hPz", "IU Pz El", kTH1F, {AxisPz}); + histos.add("IU/El/hPt", "IU Pt El", kTH1F, {AxisPt}); + histos.add("IU/Mu/hPx", "IU Px Mu", kTH1F, {AxisPx}); + histos.add("IU/Mu/hPy", "IU Py Mu", kTH1F, {AxisPy}); + histos.add("IU/Mu/hPz", "IU Pz Mu", kTH1F, {AxisPz}); + histos.add("IU/Mu/hPt", "IU Pt Mu", kTH1F, {AxisPt}); + histos.add("IU/Pi/hPx", "IU Px Pi", kTH1F, {AxisPx}); + histos.add("IU/Pi/hPy", "IU Py Pi", kTH1F, {AxisPy}); + histos.add("IU/Pi/hPz", "IU Pz Pi", kTH1F, {AxisPz}); + histos.add("IU/Pi/hPt", "IU Pt Pi", kTH1F, {AxisPt}); + histos.add("IU/Ka/hPx", "IU Px Ka", kTH1F, {AxisPx}); + histos.add("IU/Ka/hPy", "IU Py Ka", kTH1F, {AxisPy}); + histos.add("IU/Ka/hPz", "IU Pz Ka", kTH1F, {AxisPz}); + histos.add("IU/Ka/hPt", "IU Pt Ka", kTH1F, {AxisPt}); + histos.add("IU/Pr/hPx", "IU Px Pr", kTH1F, {AxisPx}); + histos.add("IU/Pr/hPy", "IU Py Pr", kTH1F, {AxisPy}); + histos.add("IU/Pr/hPz", "IU Pz Pr", kTH1F, {AxisPz}); + histos.add("IU/Pr/hPt", "IU Pt Pr", kTH1F, {AxisPt}); + histos.add("IU/De/hPx", "IU Px De", kTH1F, {AxisPx}); + histos.add("IU/De/hPy", "IU Py De", kTH1F, {AxisPy}); + histos.add("IU/De/hPz", "IU Pz De", kTH1F, {AxisPz}); + histos.add("IU/De/hPt", "IU Pt De", kTH1F, {AxisPt}); + histos.add("IU/Tr/hPx", "IU Px Tr", kTH1F, {AxisPx}); + histos.add("IU/Tr/hPy", "IU Py Tr", kTH1F, {AxisPy}); + histos.add("IU/Tr/hPz", "IU Pz Tr", kTH1F, {AxisPz}); + histos.add("IU/Tr/hPt", "IU Pt Tr", kTH1F, {AxisPt}); + histos.add("IU/He/hPx", "IU Px He", kTH1F, {AxisPx}); + histos.add("IU/He/hPy", "IU Py He", kTH1F, {AxisPy}); + histos.add("IU/He/hPz", "IU Pz He", kTH1F, {AxisPz}); + histos.add("IU/He/hPt", "IU Pt He", kTH1F, {AxisPt}); + histos.add("IU/Al/hPx", "IU Px Al", kTH1F, {AxisPx}); + histos.add("IU/Al/hPy", "IU Py Al", kTH1F, {AxisPy}); + histos.add("IU/Al/hPz", "IU Pz Al", kTH1F, {AxisPz}); + histos.add("IU/Al/hPt", "IU Pt Al", kTH1F, {AxisPt}); + + histos.add("hPx", "Propagated Px All", kTH1F, {AxisPx}); + histos.add("hPy", "Propagated Py All", kTH1F, {AxisPy}); + histos.add("hPz", "Propagated Pz All", kTH1F, {AxisPz}); + histos.add("hPt", "Propagated Pt All", kTH1F, {AxisPt}); + histos.add("El/hPx", "Propagated Px El", kTH1F, {AxisPx}); + histos.add("El/hPy", "Propagated Py El", kTH1F, {AxisPy}); + histos.add("El/hPz", "Propagated Pz El", kTH1F, {AxisPz}); + histos.add("El/hPt", "Propagated Pt El", kTH1F, {AxisPt}); + histos.add("Mu/hPx", "Propagated Px Mu", kTH1F, {AxisPx}); + histos.add("Mu/hPy", "Propagated Py Mu", kTH1F, {AxisPy}); + histos.add("Mu/hPz", "Propagated Pz Mu", kTH1F, {AxisPz}); + histos.add("Mu/hPt", "Propagated Pt Mu", kTH1F, {AxisPt}); + histos.add("Pi/hPx", "Propagated Px Pi", kTH1F, {AxisPx}); + histos.add("Pi/hPy", "Propagated Py Pi", kTH1F, {AxisPy}); + histos.add("Pi/hPz", "Propagated Pz Pi", kTH1F, {AxisPz}); + histos.add("Pi/hPt", "Propagated Pt Pi", kTH1F, {AxisPt}); + histos.add("Ka/hPx", "Propagated Px Ka", kTH1F, {AxisPx}); + histos.add("Ka/hPy", "Propagated Py Ka", kTH1F, {AxisPy}); + histos.add("Ka/hPz", "Propagated Pz Ka", kTH1F, {AxisPz}); + histos.add("Ka/hPt", "Propagated Pt Ka", kTH1F, {AxisPt}); + histos.add("Pr/hPx", "Propagated Px Pr", kTH1F, {AxisPx}); + histos.add("Pr/hPy", "Propagated Py Pr", kTH1F, {AxisPy}); + histos.add("Pr/hPz", "Propagated Pz Pr", kTH1F, {AxisPz}); + histos.add("Pr/hPt", "Propagated Pt Pr", kTH1F, {AxisPt}); + histos.add("De/hPx", "Propagated Px De", kTH1F, {AxisPx}); + histos.add("De/hPy", "Propagated Py De", kTH1F, {AxisPy}); + histos.add("De/hPz", "Propagated Pz De", kTH1F, {AxisPz}); + histos.add("De/hPt", "Propagated Pt De", kTH1F, {AxisPt}); + histos.add("Tr/hPx", "Propagated Px Tr", kTH1F, {AxisPx}); + histos.add("Tr/hPy", "Propagated Py Tr", kTH1F, {AxisPy}); + histos.add("Tr/hPz", "Propagated Pz Tr", kTH1F, {AxisPz}); + histos.add("Tr/hPt", "Propagated Pt Tr", kTH1F, {AxisPt}); + histos.add("He/hPx", "Propagated Px He", kTH1F, {AxisPx}); + histos.add("He/hPy", "Propagated Py He", kTH1F, {AxisPy}); + histos.add("He/hPz", "Propagated Pz He", kTH1F, {AxisPz}); + histos.add("He/hPt", "Propagated Pt He", kTH1F, {AxisPt}); + histos.add("Al/hPx", "Propagated Px Al", kTH1F, {AxisPx}); + histos.add("Al/hPy", "Propagated Py Al", kTH1F, {AxisPy}); + histos.add("Al/hPz", "Propagated Pz Al", kTH1F, {AxisPz}); + histos.add("Al/hPt", "Propagated Pt Al", kTH1F, {AxisPt}); + + const AxisSpec AxisDCAxy{axisDCAxy, "DCA_{xy} (cm)"}; + const AxisSpec AxisDCAz{axisDCAz, "DCA_{z} (cm)"}; // DCA - histos.add("hDCAxyEl", "hDCAxyEl", kTH1F, {axisDCAxy}); - histos.add("hDCAzEl", "hDCAzEl", kTH1F, {axisDCAz}); - histos.add("hDCAxyPi", "hDCAxyPi", kTH1F, {axisDCAxy}); - histos.add("hDCAzPi", "hDCAzPi", kTH1F, {axisDCAz}); - histos.add("hDCAxyKa", "hDCAxyKa", kTH1F, {axisDCAxy}); - histos.add("hDCAzKa", "hDCAzKa", kTH1F, {axisDCAz}); - histos.add("hDCAxyPr", "hDCAxyPr", kTH1F, {axisDCAxy}); - histos.add("hDCAzPr", "hDCAzPr", kTH1F, {axisDCAz}); - histos.add("hDCAxyDe", "hDCAxyDe", kTH1F, {axisDCAxy}); - histos.add("hDCAzDe", "hDCAzDe", kTH1F, {axisDCAz}); - histos.add("hDCAxyTr", "hDCAxyTr", kTH1F, {axisDCAxy}); - histos.add("hDCAzTr", "hDCAzTr", kTH1F, {axisDCAz}); - histos.add("hDCAxyHe", "hDCAxyHe", kTH1F, {axisDCAxy}); - histos.add("hDCAzHe", "hDCAzHe", kTH1F, {axisDCAz}); - histos.add("hDCAxyAl", "hDCAxyAl", kTH1F, {axisDCAxy}); - histos.add("hDCAzAl", "hDCAzAl", kTH1F, {axisDCAz}); + histos.add("IU/hDCAxy", "IU DCAxy All", kTH1F, {AxisDCAxy}); + histos.add("IU/hDCAz", "IU DCAz All", kTH1F, {AxisDCAz}); + histos.add("IU/El/hDCAxy", "IU DCAxy El", kTH1F, {AxisDCAxy}); + histos.add("IU/El/hDCAz", "IU DCAz El", kTH1F, {AxisDCAz}); + histos.add("IU/Mu/hDCAxy", "IU DCAxy Mu", kTH1F, {AxisDCAxy}); + histos.add("IU/Mu/hDCAz", "IU DCAz Mu", kTH1F, {AxisDCAz}); + histos.add("IU/Pi/hDCAxy", "IU DCAxy Pi", kTH1F, {AxisDCAxy}); + histos.add("IU/Pi/hDCAz", "IU DCAz Pi", kTH1F, {AxisDCAz}); + histos.add("IU/Ka/hDCAxy", "IU DCAxy Ka", kTH1F, {AxisDCAxy}); + histos.add("IU/Ka/hDCAz", "IU DCAz Ka", kTH1F, {AxisDCAz}); + histos.add("IU/Pr/hDCAxy", "IU DCAxy Pr", kTH1F, {AxisDCAxy}); + histos.add("IU/Pr/hDCAz", "IU DCAz Pr", kTH1F, {AxisDCAz}); + histos.add("IU/De/hDCAxy", "IU DCAxy De", kTH1F, {AxisDCAxy}); + histos.add("IU/De/hDCAz", "IU DCAz De", kTH1F, {AxisDCAz}); + histos.add("IU/Tr/hDCAxy", "IU DCAxy Tr", kTH1F, {AxisDCAxy}); + histos.add("IU/Tr/hDCAz", "IU DCAz Tr", kTH1F, {AxisDCAz}); + histos.add("IU/He/hDCAxy", "IU DCAxy He", kTH1F, {AxisDCAxy}); + histos.add("IU/He/hDCAz", "IU DCAz He", kTH1F, {AxisDCAz}); + histos.add("IU/Al/hDCAxy", "IU DCAxy Al", kTH1F, {AxisDCAxy}); + histos.add("IU/Al/hDCAz", "IU DCAz Al", kTH1F, {AxisDCAz}); + + histos.add("hDCAxy", "Propagated DCAxy All", kTH1F, {AxisDCAxy}); + histos.add("hDCAz", "Propagated DCAz All", kTH1F, {AxisDCAz}); + histos.add("El/hDCAxy", "Propagated DCAxy El", kTH1F, {AxisDCAxy}); + histos.add("El/hDCAz", "Propagated DCAz El", kTH1F, {AxisDCAz}); + histos.add("Mu/hDCAxy", "Propagated DCAxy Mu", kTH1F, {AxisDCAxy}); + histos.add("Mu/hDCAz", "Propagated DCAz Mu", kTH1F, {AxisDCAz}); + histos.add("Pi/hDCAxy", "Propagated DCAxy Pi", kTH1F, {AxisDCAxy}); + histos.add("Pi/hDCAz", "Propagated DCAz Pi", kTH1F, {AxisDCAz}); + histos.add("Ka/hDCAxy", "Propagated DCAxy Ka", kTH1F, {AxisDCAxy}); + histos.add("Ka/hDCAz", "Propagated DCAz Ka", kTH1F, {AxisDCAz}); + histos.add("Pr/hDCAxy", "Propagated DCAxy Pr", kTH1F, {AxisDCAxy}); + histos.add("Pr/hDCAz", "Propagated DCAz Pr", kTH1F, {AxisDCAz}); + histos.add("De/hDCAxy", "Propagated DCAxy De", kTH1F, {AxisDCAxy}); + histos.add("De/hDCAz", "Propagated DCAz De", kTH1F, {AxisDCAz}); + histos.add("Tr/hDCAxy", "Propagated DCAxy Tr", kTH1F, {AxisDCAxy}); + histos.add("Tr/hDCAz", "Propagated DCAz Tr", kTH1F, {AxisDCAz}); + histos.add("He/hDCAxy", "Propagated DCAxy He", kTH1F, {AxisDCAxy}); + histos.add("He/hDCAz", "Propagated DCAz He", kTH1F, {AxisDCAz}); + histos.add("Al/hDCAxy", "Propagated DCAxy Al", kTH1F, {AxisDCAxy}); + histos.add("Al/hDCAz", "Propagated DCAz Al", kTH1F, {AxisDCAz}); } - void processData(soa::Filtered>::iterator const& collision, Tracks const& Tracks) + template + void fillPerTrack(const T& track) { - histos.fill(HIST("hEventCounter"), 0.5); - for (auto& track : Tracks) { + histos.fill(HIST("hPx"), track.px()); + histos.fill(HIST("hPy"), track.py()); + histos.fill(HIST("hPz"), track.pz()); + histos.fill(HIST("hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxy"), track.dcaXY()); + histos.fill(HIST("hDCAz"), track.dcaZ()); + + switch (track.pidForTracking()) { + case o2::track::PID::Electron: + histos.fill(HIST("El/hPx"), track.px()); + histos.fill(HIST("El/hPy"), track.py()); + histos.fill(HIST("El/hPz"), track.pz()); + histos.fill(HIST("El/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("El/hDCAxy"), track.dcaXY()); + histos.fill(HIST("El/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Muon: + histos.fill(HIST("Mu/hPx"), track.px()); + histos.fill(HIST("Mu/hPy"), track.py()); + histos.fill(HIST("Mu/hPz"), track.pz()); + histos.fill(HIST("Mu/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Mu/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Mu/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Pion: + histos.fill(HIST("Pi/hPx"), track.px()); + histos.fill(HIST("Pi/hPy"), track.py()); + histos.fill(HIST("Pi/hPz"), track.pz()); + histos.fill(HIST("Pi/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Pi/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Pi/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Kaon: + histos.fill(HIST("Ka/hPx"), track.px()); + histos.fill(HIST("Ka/hPy"), track.py()); + histos.fill(HIST("Ka/hPz"), track.pz()); + histos.fill(HIST("Ka/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Ka/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Ka/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Proton: + histos.fill(HIST("Pr/hPx"), track.px()); + histos.fill(HIST("Pr/hPy"), track.py()); + histos.fill(HIST("Pr/hPz"), track.pz()); + histos.fill(HIST("Pr/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Pr/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Pr/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Deuteron: + histos.fill(HIST("De/hPx"), track.px()); + histos.fill(HIST("De/hPy"), track.py()); + histos.fill(HIST("De/hPz"), track.pz()); + histos.fill(HIST("De/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("De/hDCAxy"), track.dcaXY()); + histos.fill(HIST("De/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Triton: + histos.fill(HIST("Tr/hPx"), track.px()); + histos.fill(HIST("Tr/hPy"), track.py()); + histos.fill(HIST("Tr/hPz"), track.pz()); + histos.fill(HIST("Tr/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Tr/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Tr/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Helium3: + histos.fill(HIST("He/hPx"), track.px()); + histos.fill(HIST("He/hPy"), track.py()); + histos.fill(HIST("He/hPz"), track.pz()); + histos.fill(HIST("He/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("He/hDCAxy"), track.dcaXY()); + histos.fill(HIST("He/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Alpha: + histos.fill(HIST("Al/hPx"), track.px()); + histos.fill(HIST("Al/hPy"), track.py()); + histos.fill(HIST("Al/hPz"), track.pz()); + histos.fill(HIST("Al/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Al/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Al/hDCAz"), track.dcaZ()); + break; + default: + LOG(fatal) << "Unknown PID: " << track.pidForTracking(); + } + } + + template + void fillPerTrackIU(const T& track) + { + histos.fill(HIST("IU/hPx"), track.px()); + histos.fill(HIST("IU/hPy"), track.py()); + histos.fill(HIST("IU/hPz"), track.pz()); + histos.fill(HIST("IU/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/hDCAz"), track.dcaZ()); + switch (track.pidForTracking()) { + case o2::track::PID::Electron: + histos.fill(HIST("IU/El/hPx"), track.px()); + histos.fill(HIST("IU/El/hPy"), track.py()); + histos.fill(HIST("IU/El/hPz"), track.pz()); + histos.fill(HIST("IU/El/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/El/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/El/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Muon: + histos.fill(HIST("IU/Mu/hPx"), track.px()); + histos.fill(HIST("IU/Mu/hPy"), track.py()); + histos.fill(HIST("IU/Mu/hPz"), track.pz()); + histos.fill(HIST("IU/Mu/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Mu/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Mu/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Pion: + histos.fill(HIST("IU/Pi/hPx"), track.px()); + histos.fill(HIST("IU/Pi/hPy"), track.py()); + histos.fill(HIST("IU/Pi/hPz"), track.pz()); + histos.fill(HIST("IU/Pi/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Pi/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Pi/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Kaon: + histos.fill(HIST("IU/Ka/hPx"), track.px()); + histos.fill(HIST("IU/Ka/hPy"), track.py()); + histos.fill(HIST("IU/Ka/hPz"), track.pz()); + histos.fill(HIST("IU/Ka/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Ka/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Ka/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Proton: + histos.fill(HIST("IU/Pr/hPx"), track.px()); + histos.fill(HIST("IU/Pr/hPy"), track.py()); + histos.fill(HIST("IU/Pr/hPz"), track.pz()); + histos.fill(HIST("IU/Pr/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Pr/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Pr/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Deuteron: + histos.fill(HIST("IU/De/hPx"), track.px()); + histos.fill(HIST("IU/De/hPy"), track.py()); + histos.fill(HIST("IU/De/hPz"), track.pz()); + histos.fill(HIST("IU/De/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/De/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/De/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Triton: + histos.fill(HIST("IU/Tr/hPx"), track.px()); + histos.fill(HIST("IU/Tr/hPy"), track.py()); + histos.fill(HIST("IU/Tr/hPz"), track.pz()); + histos.fill(HIST("IU/Tr/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Tr/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Tr/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Helium3: + histos.fill(HIST("IU/He/hPx"), track.px()); + histos.fill(HIST("IU/He/hPy"), track.py()); + histos.fill(HIST("IU/He/hPz"), track.pz()); + histos.fill(HIST("IU/He/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/He/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/He/hDCAz"), track.dcaZ()); + break; + case o2::track::PID::Alpha: + histos.fill(HIST("IU/Al/hPx"), track.px()); + histos.fill(HIST("IU/Al/hPy"), track.py()); + histos.fill(HIST("IU/Al/hPz"), track.pz()); + histos.fill(HIST("IU/Al/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Al/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Al/hDCAz"), track.dcaZ()); + break; + default: + LOG(fatal) << "Unknown PID: " << track.pidForTracking(); + } + } + + void processData(soa::Filtered>::iterator const& collision, + TracksType const& tracks) + { + histos.fill(HIST("hEventCounter"), 0.5); + for (auto& track : tracks) { // track selection if (d_noITS && track.hasITS()) continue; // optional: only look at tracks which start outside the ITS - if (track.trackType() == aod::track::TrackIU) - continue; // only look at tracks which were propagated if (track.tpcNClsCrossedRows() < d_TPCrowsMin || track.tpcCrossedRowsOverFindableCls() < d_TPCrowsOverFindMin) continue; - - if (track.pidForTracking() == o2::track::PID::Electron) { - histos.fill(HIST("hPxEl"), track.px()); - histos.fill(HIST("hPyEl"), track.py()); - histos.fill(HIST("hPzEl"), track.pz()); - histos.fill(HIST("hPtEl"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyEl"), track.dcaXY()); - histos.fill(HIST("hDCAzEl"), track.dcaZ()); - } else if (track.pidForTracking() == o2::track::PID::Pion) { - histos.fill(HIST("hPxPi"), track.px()); - histos.fill(HIST("hPyPi"), track.py()); - histos.fill(HIST("hPzPi"), track.pz()); - histos.fill(HIST("hPtPi"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyPi"), track.dcaXY()); - histos.fill(HIST("hDCAzPi"), track.dcaZ()); - } else if (track.pidForTracking() == o2::track::PID::Kaon) { - histos.fill(HIST("hPxKa"), track.px()); - histos.fill(HIST("hPyKa"), track.py()); - histos.fill(HIST("hPzKa"), track.pz()); - histos.fill(HIST("hPtKa"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyKa"), track.dcaXY()); - histos.fill(HIST("hDCAzKa"), track.dcaZ()); - } else if (track.pidForTracking() == o2::track::PID::Proton) { - histos.fill(HIST("hPxPr"), track.px()); - histos.fill(HIST("hPyPr"), track.py()); - histos.fill(HIST("hPzPr"), track.pz()); - histos.fill(HIST("hPtPr"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyPr"), track.dcaXY()); - histos.fill(HIST("hDCAzPr"), track.dcaZ()); - } else if (track.pidForTracking() == o2::track::PID::Deuteron) { - histos.fill(HIST("hPxDe"), track.px()); - histos.fill(HIST("hPyDe"), track.py()); - histos.fill(HIST("hPzDe"), track.pz()); - histos.fill(HIST("hPtDe"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyDe"), track.dcaXY()); - histos.fill(HIST("hDCAzDe"), track.dcaZ()); - } else if (track.pidForTracking() == o2::track::PID::Triton) { - histos.fill(HIST("hPxTr"), track.px()); - histos.fill(HIST("hPyTr"), track.py()); - histos.fill(HIST("hPzTr"), track.pz()); - histos.fill(HIST("hPtTr"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyTr"), track.dcaXY()); - histos.fill(HIST("hDCAzTr"), track.dcaZ()); - } else if (track.pidForTracking() == o2::track::PID::Helium3) { - histos.fill(HIST("hPxHe"), track.px()); - histos.fill(HIST("hPyHe"), track.py()); - histos.fill(HIST("hPzHe"), track.pz()); - histos.fill(HIST("hPtHe"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyHe"), track.dcaXY()); - histos.fill(HIST("hDCAzHe"), track.dcaZ()); - } else if (track.pidForTracking() == o2::track::PID::Alpha) { - histos.fill(HIST("hPxAl"), track.px()); - histos.fill(HIST("hPyAl"), track.py()); - histos.fill(HIST("hPzAl"), track.pz()); - histos.fill(HIST("hPtAl"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyAl"), track.dcaXY()); - histos.fill(HIST("hDCAzAl"), track.dcaZ()); + if (track.trackType() == aod::track::TrackIU) { // only look at tracks which were propagated + fillPerTrackIU(track); + continue; } + fillPerTrack(track); } } PROCESS_SWITCH(lfpropStudy, processData, "process data", true); - void processMC(soa::Filtered>::iterator const& collision, TracksLabeled const& Tracks, aod::McParticles const& particlesMC) + void processDataNoColl(TracksType const& tracks) + { + histos.fill(HIST("hEventCounter"), 0.5); + for (auto& track : tracks) { + // track selection + if (d_noITS && track.hasITS()) + continue; // optional: only look at tracks which start outside the ITS + if (track.tpcNClsCrossedRows() < d_TPCrowsMin || track.tpcCrossedRowsOverFindableCls() < d_TPCrowsOverFindMin) + continue; + if (track.trackType() == aod::track::TrackIU) { // only look at tracks which were propagated + fillPerTrackIU(track); + continue; + } + fillPerTrack(track); + } + } + PROCESS_SWITCH(lfpropStudy, processDataNoColl, "process data without collisions association", false); + + void processDataCovMat(soa::Filtered>::iterator const& collision, + TracksCovMatType const& tracks) { histos.fill(HIST("hEventCounter"), 0.5); - for (auto& track : Tracks) { + for (auto& track : tracks) { + // track selection + if (d_noITS && track.hasITS()) + continue; // optional: only look at tracks which start outside the ITS + if (track.tpcNClsCrossedRows() < d_TPCrowsMin || track.tpcCrossedRowsOverFindableCls() < d_TPCrowsOverFindMin) + continue; + if (track.trackType() == aod::track::TrackIU) { // only look at tracks which were propagated + fillPerTrackIU(track); + continue; + } + fillPerTrack(track); + } + } + PROCESS_SWITCH(lfpropStudy, processDataCovMat, "process data with Cov. Mat.", false); + void processMC(soa::Filtered>::iterator const& collision, + TracksLabeledType const& tracks, + aod::McParticles const& particlesMC) + { + histos.fill(HIST("hEventCounter"), 0.5); + for (auto& track : tracks) { if (!track.has_mcParticle() || track.mcParticleId() <= -1 || track.mcParticleId() > particlesMC.size()) continue; if (d_noITS && track.hasITS()) continue; // optional: only look at tracks which start outside the ITS - if (track.trackType() == aod::track::TrackIU) - continue; // only look at tracks which were propagated + if (track.tpcNClsCrossedRows() < d_TPCrowsMin || track.tpcCrossedRowsOverFindableCls() < d_TPCrowsOverFindMin) + continue; + if (track.trackType() == aod::track::TrackIU) { // only look at tracks which were propagated + histos.fill(HIST("IU/hPx"), track.px()); + histos.fill(HIST("IU/hPy"), track.py()); + histos.fill(HIST("IU/hPz"), track.pz()); + histos.fill(HIST("IU/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/hDCAz"), track.dcaZ()); + + switch (std::abs(track.mcParticle().pdgCode())) { + case kElectron: + histos.fill(HIST("IU/El/hPx"), track.px()); + histos.fill(HIST("IU/El/hPy"), track.py()); + histos.fill(HIST("IU/El/hPz"), track.pz()); + histos.fill(HIST("IU/El/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/El/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/El/hDCAz"), track.dcaZ()); + break; + case kMuonPlus: + histos.fill(HIST("IU/Mu/hPx"), track.px()); + histos.fill(HIST("IU/Mu/hPy"), track.py()); + histos.fill(HIST("IU/Mu/hPz"), track.pz()); + histos.fill(HIST("IU/Mu/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Mu/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Mu/hDCAz"), track.dcaZ()); + break; + case kPiPlus: + histos.fill(HIST("IU/Pi/hPx"), track.px()); + histos.fill(HIST("IU/Pi/hPy"), track.py()); + histos.fill(HIST("IU/Pi/hPz"), track.pz()); + histos.fill(HIST("IU/Pi/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Pi/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Pi/hDCAz"), track.dcaZ()); + break; + case kKPlus: + histos.fill(HIST("IU/Ka/hPx"), track.px()); + histos.fill(HIST("IU/Ka/hPy"), track.py()); + histos.fill(HIST("IU/Ka/hPz"), track.pz()); + histos.fill(HIST("IU/Ka/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Ka/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Ka/hDCAz"), track.dcaZ()); + break; + case kProton: + histos.fill(HIST("IU/Pr/hPx"), track.px()); + histos.fill(HIST("IU/Pr/hPy"), track.py()); + histos.fill(HIST("IU/Pr/hPz"), track.pz()); + histos.fill(HIST("IU/Pr/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Pr/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Pr/hDCAz"), track.dcaZ()); + break; + case 1000010020: + histos.fill(HIST("IU/De/hPx"), track.px()); + histos.fill(HIST("IU/De/hPy"), track.py()); + histos.fill(HIST("IU/De/hPz"), track.pz()); + histos.fill(HIST("IU/De/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/De/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/De/hDCAz"), track.dcaZ()); + break; + case 1000010030: + histos.fill(HIST("IU/Tr/hPx"), track.px()); + histos.fill(HIST("IU/Tr/hPy"), track.py()); + histos.fill(HIST("IU/Tr/hPz"), track.pz()); + histos.fill(HIST("IU/Tr/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Tr/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Tr/hDCAz"), track.dcaZ()); + break; + case 1000020030: + histos.fill(HIST("IU/He/hPx"), track.px()); + histos.fill(HIST("IU/He/hPy"), track.py()); + histos.fill(HIST("IU/He/hPz"), track.pz()); + histos.fill(HIST("IU/He/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/He/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/He/hDCAz"), track.dcaZ()); + break; + case 1000020040: + histos.fill(HIST("IU/Al/hPx"), track.px()); + histos.fill(HIST("IU/Al/hPy"), track.py()); + histos.fill(HIST("IU/Al/hPz"), track.pz()); + histos.fill(HIST("IU/Al/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("IU/Al/hDCAxy"), track.dcaXY()); + histos.fill(HIST("IU/Al/hDCAz"), track.dcaZ()); + break; + default: + continue; + } + continue; + } + + histos.fill(HIST("hPx"), track.px()); + histos.fill(HIST("hPy"), track.py()); + histos.fill(HIST("hPz"), track.pz()); + histos.fill(HIST("hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("hDCAxy"), track.dcaXY()); + histos.fill(HIST("hDCAz"), track.dcaZ()); - if (track.mcParticle().pdgCode() == kElectron) { - histos.fill(HIST("hPxEl"), track.px()); - histos.fill(HIST("hPyEl"), track.py()); - histos.fill(HIST("hPzEl"), track.pz()); - histos.fill(HIST("hPtEl"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyEl"), track.dcaXY()); - histos.fill(HIST("hDCAzEl"), track.dcaZ()); - } else if (track.mcParticle().pdgCode() == kPiPlus) { - histos.fill(HIST("hPxPi"), track.px()); - histos.fill(HIST("hPyPi"), track.py()); - histos.fill(HIST("hPzPi"), track.pz()); - histos.fill(HIST("hPtPi"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyPi"), track.dcaXY()); - histos.fill(HIST("hDCAzPi"), track.dcaZ()); - } else if (track.mcParticle().pdgCode() == kKPlus) { - histos.fill(HIST("hPxKa"), track.px()); - histos.fill(HIST("hPyKa"), track.py()); - histos.fill(HIST("hPzKa"), track.pz()); - histos.fill(HIST("hPtKa"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyKa"), track.dcaXY()); - histos.fill(HIST("hDCAzKa"), track.dcaZ()); - } else if (track.mcParticle().pdgCode() == kProton) { - histos.fill(HIST("hPxPr"), track.px()); - histos.fill(HIST("hPyPr"), track.py()); - histos.fill(HIST("hPzPr"), track.pz()); - histos.fill(HIST("hPtPr"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyPr"), track.dcaXY()); - histos.fill(HIST("hDCAzPr"), track.dcaZ()); - } else if (track.mcParticle().pdgCode() == 1000010020) { - histos.fill(HIST("hPxDe"), track.px()); - histos.fill(HIST("hPyDe"), track.py()); - histos.fill(HIST("hPzDe"), track.pz()); - histos.fill(HIST("hPtDe"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyDe"), track.dcaXY()); - histos.fill(HIST("hDCAzDe"), track.dcaZ()); - } else if (track.mcParticle().pdgCode() == 1000010030) { - histos.fill(HIST("hPxTr"), track.px()); - histos.fill(HIST("hPyTr"), track.py()); - histos.fill(HIST("hPzTr"), track.pz()); - histos.fill(HIST("hPtTr"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyTr"), track.dcaXY()); - histos.fill(HIST("hDCAzTr"), track.dcaZ()); - } else if (track.mcParticle().pdgCode() == 1000020030) { - histos.fill(HIST("hPxHe"), track.px()); - histos.fill(HIST("hPyHe"), track.py()); - histos.fill(HIST("hPzHe"), track.pz()); - histos.fill(HIST("hPtHe"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyHe"), track.dcaXY()); - histos.fill(HIST("hDCAzHe"), track.dcaZ()); - } else if (track.mcParticle().pdgCode() == 1000020040) { - histos.fill(HIST("hPxAl"), track.px()); - histos.fill(HIST("hPyAl"), track.py()); - histos.fill(HIST("hPzAl"), track.pz()); - histos.fill(HIST("hPtAl"), sqrt(track.px() * track.px() + track.py() * track.py())); - histos.fill(HIST("hDCAxyAl"), track.dcaXY()); - histos.fill(HIST("hDCAzAl"), track.dcaZ()); + switch (std::abs(track.mcParticle().pdgCode())) { + case kElectron: + histos.fill(HIST("El/hPx"), track.px()); + histos.fill(HIST("El/hPy"), track.py()); + histos.fill(HIST("El/hPz"), track.pz()); + histos.fill(HIST("El/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("El/hDCAxy"), track.dcaXY()); + histos.fill(HIST("El/hDCAz"), track.dcaZ()); + break; + case kMuonPlus: + histos.fill(HIST("Mu/hPx"), track.px()); + histos.fill(HIST("Mu/hPy"), track.py()); + histos.fill(HIST("Mu/hPz"), track.pz()); + histos.fill(HIST("Mu/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Mu/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Mu/hDCAz"), track.dcaZ()); + break; + case kPiPlus: + histos.fill(HIST("Pi/hPx"), track.px()); + histos.fill(HIST("Pi/hPy"), track.py()); + histos.fill(HIST("Pi/hPz"), track.pz()); + histos.fill(HIST("Pi/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Pi/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Pi/hDCAz"), track.dcaZ()); + break; + case kKPlus: + histos.fill(HIST("Ka/hPx"), track.px()); + histos.fill(HIST("Ka/hPy"), track.py()); + histos.fill(HIST("Ka/hPz"), track.pz()); + histos.fill(HIST("Ka/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Ka/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Ka/hDCAz"), track.dcaZ()); + break; + case kProton: + histos.fill(HIST("Pr/hPx"), track.px()); + histos.fill(HIST("Pr/hPy"), track.py()); + histos.fill(HIST("Pr/hPz"), track.pz()); + histos.fill(HIST("Pr/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Pr/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Pr/hDCAz"), track.dcaZ()); + break; + case 1000010020: + histos.fill(HIST("De/hPx"), track.px()); + histos.fill(HIST("De/hPy"), track.py()); + histos.fill(HIST("De/hPz"), track.pz()); + histos.fill(HIST("De/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("De/hDCAxy"), track.dcaXY()); + histos.fill(HIST("De/hDCAz"), track.dcaZ()); + break; + case 1000010030: + histos.fill(HIST("Tr/hPx"), track.px()); + histos.fill(HIST("Tr/hPy"), track.py()); + histos.fill(HIST("Tr/hPz"), track.pz()); + histos.fill(HIST("Tr/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Tr/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Tr/hDCAz"), track.dcaZ()); + break; + case 1000020030: + histos.fill(HIST("He/hPx"), track.px()); + histos.fill(HIST("He/hPy"), track.py()); + histos.fill(HIST("He/hPz"), track.pz()); + histos.fill(HIST("He/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("He/hDCAxy"), track.dcaXY()); + histos.fill(HIST("He/hDCAz"), track.dcaZ()); + break; + case 1000020040: + histos.fill(HIST("Al/hPx"), track.px()); + histos.fill(HIST("Al/hPy"), track.py()); + histos.fill(HIST("Al/hPz"), track.pz()); + histos.fill(HIST("Al/hPt"), sqrt(track.px() * track.px() + track.py() * track.py())); + histos.fill(HIST("Al/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Al/hDCAz"), track.dcaZ()); + break; + default: + continue; } } } PROCESS_SWITCH(lfpropStudy, processMC, "process MC", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; -} +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGLF/Tasks/QC/strangenessQCPP.cxx b/PWGLF/Tasks/QC/strangenessQCPP.cxx new file mode 100644 index 00000000000..6dab146b363 --- /dev/null +++ b/PWGLF/Tasks/QC/strangenessQCPP.cxx @@ -0,0 +1,457 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// +/// \brief strangeness in pb-pb QC task +/// +/// In case of questions please write to: +/// \author Roman Nepeivoda (roman.nepeivoda@cern.ch) + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Common/DataModel/EventSelection.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/PIDResponse.h" +#include "PWGLF/DataModel/QC/strangenessTablesQC.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct strangenessQCPP { + // Histogram registries + HistogramRegistry rGeneral{"generalInfo", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry rVzero{"vzero", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rCascade{"cascade", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rK0S{"k0S", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rLambda{"lambda", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rAntiLambda{"antiLambda", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rOmega{"omega", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rAntiOmega{"antiomega", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rXi{"xi", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rAntiXi{"antixi", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + // Configurable parameters for V0 selection + Configurable v0setting_dcav0dau{"v0setting_dcav0dau", 1, "DCA V0 Daughters"}; + Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.1, "DCA Pos To PV"}; + Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.1, "DCA Neg To PV"}; + Configurable v0setting_cospa{"v0setting_cospa", 0.97, "V0 CosPA"}; // should be double! + Configurable v0setting_radius{"v0setting_radius", 1, "v0radius"}; + Configurable v0setting_rapidity{"v0setting_rapidity", 0.5, "rapidity"}; + + static constexpr float defaultLifetimeCuts[1][2] = {{25., 20.}}; + Configurable> lifetimecut{"lifetimecut", {defaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0S"}}, "lifetimecut"}; + + // V0 PID configurables + Configurable NSigmaV0Pion{"NSigmaV0Pion", 6, "NSigmaV0Pion"}; + Configurable NSigmaV0Proton{"NSigmaV0Proton", 6, "NSigmaV0Proton"}; + + // Configurable parameters for cascade selection + Configurable cascadesetting_cospa{"cascadesetting_cospa", 0.98, "Casc CosPA"}; // should be double! + Configurable cascadesetting_v0cospa{"cascadesetting_v0cospa", 0.98, "Casc V0 CosPA"}; // should be double! + Configurable cascadesetting_dcacascdau{"cascadesetting_dcacascdau", 1.0, "DCA cascade daughters"}; + Configurable cascadesetting_dcav0dau{"cascadesetting_dcav0dau", 1.0, "DCA Cascade's V0 Daughters"}; + Configurable cascadesetting_dcabachtopv{"cascadesetting_dcabachtopv", 0.1, "DCA bachelor to PV"}; + Configurable cascadesetting_dcapostopv{"cascadesetting_dcapostopv", 0.2, "DCA Casc. V0's pos to PV"}; + Configurable cascadesetting_dcanegtopv{"cascadesetting_dcanegtopv", 0.2, "DCA Casc V0's neg to PV"}; + Configurable cascadesetting_mindcav0topv{"cascadesetting_mindcav0topv", 0.01, "minimum V0 DCA to PV"}; + Configurable cascadesetting_cascradius{"cascadesetting_cascradius", 1.0, "cascradius"}; + Configurable cascadesetting_v0masswindow{"cascadesetting_v0masswindow", 0.01, "v0 mass window"}; + Configurable cascadesetting_v0radius{"cascadesetting_v0radius", 0.9, "v0 radius"}; + Configurable cascadesetting_rapidity{"cascadesetting_rapidity", 0.5, "rapidity"}; + + // Cascade PID configurables + Configurable NSigmaCascPion{"NSigmaCascPion", 6, "NSigmaCascPion"}; + Configurable NSigmaCascProton{"NSigmaCascProton", 6, "NSigmaCascProton"}; + Configurable NSigmaCascKaon{"NSigmaCascKaon", 6, "NSigmaCascKaon"}; + + // General axes configurables + ConfigurableAxis binPt{"binPt", {100, 0.0f, 10.0f}, ""}; + ConfigurableAxis binPtsmall{"binPtsmall", {50, 0.0f, 10.0f}, ""}; + ConfigurableAxis binCosPA{"binCosPA", {200, 0.8f, 1.0f}, ""}; + ConfigurableAxis binEtaSmall{"binEtaSmall", {2, -1.0f, 1.0f}, ""}; + ConfigurableAxis binEta{"binEta", {100, -1.0f, 1.0f}, ""}; + ConfigurableAxis binPhi{"binPhi", {(int)TMath::Pi() * 10 / 2, 0.0f, 2. * TMath::Pi()}, ""}; + ConfigurableAxis binRadius{"binRadius", {100, 0.0f, 50.0f}, ""}; + ConfigurableAxis binRadiussmall{"binRadiussmall", {30, 0.0f, 30.0f}, ""}; + ConfigurableAxis binITSMapDaughters{"binITSMapDaughters", {8, -0.5f, 7.5f}, ""}; + + // V0 axes configurables + ConfigurableAxis binV0PA{"binV0PA", {1000, 0.f, 1.0f}, ""}; + ConfigurableAxis binV0Radius{"binV0Radius", {100, 0.0f, 10.0f}, ""}; + ConfigurableAxis binV0DecayLength{"binV0DecayLength", {100, 0.0f, 10.0f}, ""}; + ConfigurableAxis binV0DCANegToPV{"binV0DCANegToPV", {100, -1.0f, 1.0f}, ""}; + ConfigurableAxis binV0DCAPosToPV{"binV0DCAPosToPV", {100, -1.0f, 1.0f}, ""}; + ConfigurableAxis binV0DCAV0Dau{"binV0DCAV0Dau", {55, 0.0f, 2.20f}, ""}; + ConfigurableAxis binCtauK0s{"binCtauK0s", {65, 0.0f, 13.0f}, ""}; + ConfigurableAxis binCtauLambda{"binCtauLambda", {100, 0.0f, 40.0f}, ""}; + ConfigurableAxis binCtauAntiLambda{"binCtauAntiLambda", {100, 0.0f, 40.0f}, ""}; + ConfigurableAxis binDecayLengthK0s{"binDecayLengthK0s", {100, 0.0f, 40.0f}, ""}; + ConfigurableAxis binDecayLengthLambda{"binDecayLengthLambda", {100, 0.0f, 80.0f}, ""}; + ConfigurableAxis binDecayLengthAntiLambda{"binDecayLengthAntiLambda", {100, 0.0f, 80.0f}, ""}; + ConfigurableAxis binV0DCAV0ToPVK0S{"binV0DCAV0ToPVK0S", {250, 0.0f, 0.25f}, ""}; + ConfigurableAxis binV0DCAV0ToPVLambda{"binV0DCAV0ToPVLambda", {250, 0.0f, 0.25f}, ""}; + ConfigurableAxis binV0DCAV0ToPVAntiLambda{"binV0DCAV0ToPVAntiLambda", {250, 0.0f, 0.25f}, ""}; + ConfigurableAxis binInvMassK0S{"binInvMassK0S", {200, 0.4f, 0.6f}, ""}; + ConfigurableAxis binInvMassLambda{"binInvMassLambda", {200, 1.07f, 1.17f}, ""}; + ConfigurableAxis binInvMassAntiLambda{"binInvMassAntiLambda", {200, 1.07f, 1.17f}, ""}; + ConfigurableAxis binResponsePionFromLambda{"binResponsePionFromLambda", {200, -20.f, 20.f}, ""}; + ConfigurableAxis binResponseProtonFromLambda{"binResponseProtonFromLambda", {200, -20.f, 20.f}, ""}; + + // Cascade axes configurables + ConfigurableAxis binCascSign{"binCascSign", {2, -1.5f, 1.5f}, ""}; + ConfigurableAxis binInvMassCasc{"binInvMassCasc", {1000, 0.f, 1.0f}, ""}; + ConfigurableAxis binCascDecayLength{"binCascDecayLength", {100, 0.0f, 10.0f}, ""}; + ConfigurableAxis binCascRadius{"binCascRadius", {100, 0.0f, 10.0f}, ""}; + ConfigurableAxis binCascRapidity{"binCascRapidity", {200, -2.0f, 2.0f}, ""}; + ConfigurableAxis binCascCtau{"binCascCtau", {100, 0.0f, 100.0f}, ""}; + ConfigurableAxis binDcaCascDaughters{"binDcaCascDaughters", {110, 0.0f, 2.2f}, ""}; + ConfigurableAxis binDcaV0ToPV{"binDcaV0ToPV", {200, 0.0f, 2.f}, ""}; + ConfigurableAxis binDcaBachToPV{"binDcaBachToPV", {80, -0.2f, 0.2f}, ""}; + ConfigurableAxis binInvMassXi{"binInvMassXi", {80, 1.28f, 1.36f}, ""}; + ConfigurableAxis binInvMassOmega{"binInvMassOmega", {80, 1.63f, 1.71f}, ""}; + + // PDG data base + Service pdgDB; + + void init(InitContext const&) + { + // General axes + const AxisSpec axisPt{binPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec axisPtsmall{binPtsmall, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec axisCosPA{binCosPA, "Cos(PA)"}; + const AxisSpec axisEta{binEta, "Eta"}; + const AxisSpec axisPhi{binPhi, "Phi"}; + const AxisSpec axisEtaSmall{binEtaSmall, "Eta"}; + const AxisSpec axisRadius{binRadius, "Radius"}; + const AxisSpec axisRadiussmall{binRadiussmall, "Radius"}; + const AxisSpec axisITSMapDaughters{binITSMapDaughters, "ITS Map Daughters"}; + + // V0 axes + const AxisSpec axisV0PA{binV0PA, "Pointing Angle"}; + const AxisSpec axisV0Radius{binV0Radius, "V0 Radius (cm)"}; + const AxisSpec axisV0DecayLength{binV0DecayLength, "V0 Decay Length (cm)"}; + const AxisSpec axisV0DCANegToPV{binV0DCANegToPV, "V0 DCA Neg To PV (cm)"}; + const AxisSpec axisV0DCAPosToPV{binV0DCAPosToPV, "V0 DCA Pos To PV (cm)"}; + const AxisSpec axisV0DCAV0Dau{binV0DCAV0Dau, "V0 DCA V0 Daughters (cm)"}; + const AxisSpec axisCtauK0s{binCtauK0s, "K0s c#tau (cm)"}; + const AxisSpec axisCtauLambda{binCtauLambda, "Lambda c#tau (cm)"}; + const AxisSpec axisCtauAntiLambda{binCtauAntiLambda, "AntiLambda c#tau (cm)"}; + const AxisSpec axisDecayLengthK0s{binDecayLengthK0s, "Decay length K0s (cm)"}; + const AxisSpec axisDecayLengthLambda{binDecayLengthLambda, "Decay length Lambda (cm)"}; + const AxisSpec axisDecayLengthAntiLambda{binDecayLengthAntiLambda, "Decay length AntiLambda (cm)"}; + const AxisSpec axisV0DCAV0ToPVK0S{binV0DCAV0ToPVK0S, "DCAV0ToPV K0s"}; + const AxisSpec axisV0DCAV0ToPVLambda{binV0DCAV0ToPVLambda, "DCAV0ToPV Lambda"}; + const AxisSpec axisV0DCAV0ToPVAntiLambda{binV0DCAV0ToPVAntiLambda, "DCAV0ToPV AntiLambda"}; + const AxisSpec axisInvMassK0S{binInvMassK0S, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + const AxisSpec axisInvMassLambda{binInvMassLambda, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + const AxisSpec axisInvMassAntiLambda{binInvMassAntiLambda, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + const AxisSpec axisInvMassCasc{binInvMassCasc, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + const AxisSpec axisResponsePionFromLambda{binResponsePionFromLambda, "Response Pion From Lambda"}; + const AxisSpec axisResponseProtonFromLambda{binResponseProtonFromLambda, "Response Proton From Lambda"}; + + // Cascade axes + const AxisSpec axisSign{binCascSign, "Casc sign"}; + const AxisSpec axisCascDecayLength{binCascDecayLength, "Casc Decay Length (cm)"}; + const AxisSpec axisCascRadius{binCascRadius, "Casc Radius (cm)"}; + const AxisSpec axisCascRapidity{binCascRapidity, "y"}; + const AxisSpec axisCascCTau{binCascCtau, "y"}; + const AxisSpec axisDcaCascDaughters{binDcaCascDaughters, "DCA Cascade Daughters (cm)"}; + const AxisSpec axisDcaV0ToPV{binDcaV0ToPV, "DCA V0 to PV (cm)"}; + const AxisSpec axisDcaBachToPV{binDcaBachToPV, "DCA Bach to PV (cm)"}; + const AxisSpec axisInvMassXi{binInvMassXi, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + const AxisSpec axisInvMassOmega{binInvMassOmega, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + + // Histograms + // Candidate counter + rGeneral.add("nCandidates", "nCandidates", {HistType::kTH1F, {{2, -0.5f, 1.5f}}}); + + // V0 general histograms + rVzero.add("CosPA", "CosPA", kTH1F, {axisCosPA}); + rVzero.add("V0Radius", "V0Radius", kTH1D, {axisV0Radius}); + rVzero.add("DecayLength", "DecayLength", kTH1F, {axisV0DecayLength}); + rVzero.add("V0DCANegToPV", "V0DCANegToPV", kTH1F, {axisV0DCANegToPV}); + rVzero.add("V0DCAPosToPV", "V0DCAPosToPV", kTH1F, {axisV0DCAPosToPV}); + rVzero.add("V0DCAV0Daughters", "V0DCAV0Daughters", kTH1F, {axisV0DCAV0Dau}); + + // K0s histograms + rK0S.add("CtauK0s", "CtauK0s", kTH1F, {axisCtauK0s}); + rK0S.add("DecayLengthK0s", "DecayLengthK0s", kTH1F, {axisDecayLengthK0s}); + rK0S.add("V0DCAV0ToPVK0S", "V0DCAV0ToPVK0S", kTH1F, {axisV0DCAV0ToPVK0S}); + rK0S.add("InvMassK0S", "InvMassK0S", kTH3F, {axisPt, axisInvMassK0S, axisEtaSmall}); + rK0S.add("InvMassK0SVsPtVsPA", "InvMassK0SVsPtVsPA", kTH3F, {axisPt, axisV0PA, axisInvMassK0S}); + rK0S.add("InvMassK0S_Radius", "InvMassK0S_Radius", kTH2F, {axisRadius, axisInvMassK0S}); + rK0S.add("InvMassK0S_EtaDaughters", "InvMassK0S_EtaDaughters", kTH3F, {axisEta, axisEta, axisInvMassK0S}); + rK0S.add("InvMassK0S_PhiDaughters", "InvMassK0S_PhiDaughters", kTH3F, {axisPhi, axisPhi, axisInvMassK0S}); + rK0S.add("InvMassK0S_ITSMapDaughters", "InvMassK0S_ITSMapDaughters", kTH3F, {axisITSMapDaughters, axisITSMapDaughters, axisInvMassK0S}); + rK0S.add("InvMassK0S_PtRadius", "InvMassK0S_PtRadius", kTH3F, {axisPtsmall, axisRadiussmall, axisInvMassK0S}); + + // Lambda histograms + rLambda.add("CtauLambda", "CtauLambda", kTH1F, {axisCtauLambda}); + rLambda.add("DecayLengthLambda", "DecayLengthLambda", kTH1F, {axisDecayLengthLambda}); + rLambda.add("V0DCAV0ToPVLambda", "V0DCAV0ToPVLambda", kTH1F, {axisV0DCAV0ToPVLambda}); + rLambda.add("InvMassLambda", "InvMassLambda", kTH3F, {axisPt, axisInvMassLambda, axisEtaSmall}); + rLambda.add("InvMassLambdaVsPtVsPA", "InvMassLambdaVsPtVsPA", kTH3F, {axisPt, axisV0PA, axisInvMassLambda}); + rLambda.add("InvMassLambda_Radius", "InvMassLambda_Radius", kTH2F, {axisRadius, axisInvMassLambda}); + rLambda.add("InvMassLambda_EtaDaughters", "InvMassLambda_EtaDaughters", kTH3F, {axisEta, axisEta, axisInvMassLambda}); + rLambda.add("InvMassLambda_Ctau", "InvMassLambda_Ctau", kTH2F, {axisCtauLambda, axisInvMassLambda}); + rLambda.add("InvMassLambda_PhiDaughters", "InvMassLambda_PhiDaughters", kTH3F, {axisPhi, axisPhi, axisInvMassLambda}); + rLambda.add("InvMassLambda_ITSMapDaughters", "InvMassLambda_ITSMapDaughters", kTH3F, {axisITSMapDaughters, axisITSMapDaughters, axisInvMassLambda}); + rLambda.add("InvMassLambda_PtRadius", "InvMassLambda_PtRadius", kTH3F, {axisPtsmall, axisRadiussmall, axisInvMassLambda}); + rLambda.add("ResponsePionFromLambda", "ResponsePionFromLambda", kTH2F, {axisPt, axisResponsePionFromLambda}); + rLambda.add("ResponseProtonFromLambda", "ResponseProtonFromLambda", kTH2F, {axisPt, axisResponseProtonFromLambda}); + + // Anti-Lambda histograms + rAntiLambda.add("CtauAntiLambda", "CtauAntiLambda", kTH1F, {axisCtauAntiLambda}); + rAntiLambda.add("DecayLengthAntiLambda", "DecayLengthAntiLambda", kTH1F, {axisDecayLengthAntiLambda}); + rAntiLambda.add("V0DCAV0ToPVAntiLambda", "V0DCAV0ToPVAntiLambda", kTH1F, {axisV0DCAV0ToPVAntiLambda}); + rAntiLambda.add("InvMassAntiLambda", "InvMassAntiLambda", kTH3F, {axisPt, axisInvMassAntiLambda, axisEtaSmall}); + rAntiLambda.add("InvMassAntiLambdaVsPtVsPA", "InvMassAntiLambdaVsPtVsPA", kTH3F, {axisPt, axisV0PA, axisInvMassAntiLambda}); + rAntiLambda.add("InvMassAntiLambda_Radius", "InvMassAntiLambda_Radius", kTH2F, {axisRadius, axisInvMassAntiLambda}); + rAntiLambda.add("InvMassAntiLambda_EtaDaughters", "InvMassAntiLambda_EtaDaughters", kTH3F, {axisEta, axisEta, axisInvMassAntiLambda}); + rAntiLambda.add("InvMassAntiLambda_Ctau", "InvMassAntiLambda_Ctau", kTH2F, {axisCtauAntiLambda, axisInvMassAntiLambda}); + rAntiLambda.add("InvMassAntiLambda_PhiDaughters", "InvMassAntiLambda_PhiDaughters", kTH3F, {axisPhi, axisPhi, axisInvMassAntiLambda}); + rAntiLambda.add("InvMassAntiLambda_ITSMapDaughters", "InvMassAntiLambda_ITSMapDaughters", kTH3F, {axisITSMapDaughters, axisITSMapDaughters, axisInvMassAntiLambda}); + rAntiLambda.add("InvMassAntiLambda_PtRadius", "InvMassAntiLambda_PtRadius", kTH3F, {axisPtsmall, axisRadiussmall, axisInvMassAntiLambda}); + + // Cascade general histograms + rCascade.add("V0Radius", "V0Radius", {HistType::kTH2D, {axisV0Radius, axisSign}}); + rCascade.add("CascCosPA", "CascCosPA", {HistType::kTH2F, {axisCosPA, axisSign}}); + rCascade.add("V0CosPA", "V0CosPA", {HistType::kTH2F, {axisCosPA, axisSign}}); + rCascade.add("CascDecayLength", "CascDecayLength", {HistType::kTH2F, {axisCascDecayLength, axisSign}}); + rCascade.add("CascRadius", "CascRadius", {HistType::kTH2F, {axisCascRadius, axisSign}}); + rCascade.add("CascyXi", "CascyXi", {HistType::kTH2F, {axisCascRapidity, axisSign}}); + rCascade.add("CascyOmega", "CascyOmega", {HistType::kTH2F, {axisCascRapidity, axisSign}}); + rCascade.add("CascCtauXi", "CascCtauXi", {HistType::kTH2F, {axisCascCTau, axisSign}}); + rCascade.add("CascCtauOmega", "CascCtauOmega", {HistType::kTH2F, {axisCascCTau, axisSign}}); + rCascade.add("V0Ctau", "V0Ctau", {HistType::kTH2F, {axisCascCTau, axisSign}}); + rCascade.add("CascPt", "CascPt", {HistType::kTH2F, {binPt, axisSign}}); + rCascade.add("DcaV0Daughters", "DcaV0Daughters", {HistType::kTH2F, {axisV0DCAV0Dau, axisSign}}); + rCascade.add("DcaCascDaughters", "DcaCascDaughters", {HistType::kTH2F, {axisDcaCascDaughters, axisSign}}); + rCascade.add("DcaV0ToPV", "DcaV0ToPV", {HistType::kTH2F, {axisDcaV0ToPV, axisSign}}); + rCascade.add("DcaBachToPV", "DcaBachToPV", {HistType::kTH2F, {axisDcaBachToPV, axisSign}}); + rCascade.add("DcaPosToPV", "DcaPosToPV", {HistType::kTH2F, {axisV0DCAPosToPV, axisSign}}); + rCascade.add("DcaNegToPV", "DcaNegToPV", {HistType::kTH2F, {axisV0DCANegToPV, axisSign}}); + rCascade.add("InvMassLambdaDaughter", "InvMassLambdaDaughter", {HistType::kTH2F, {axisInvMassLambda, axisSign}}); + // rCascade.add("V0CosPAToXi", "V0CosPAToXi", {HistType::kTH2F, {{100, 0.9f, 1.0f}, axisSign}}); + + // Xi histograms + rXi.add("InvMassXiMinus", "InvMassXiMinus", {HistType::kTH3F, {axisPt, axisInvMassXi, axisEta}}); + rXi.add("InvMassXiMinus_Radius", "InvMassXiMinus_Radius", {HistType::kTH2F, {axisPt, axisInvMassXi}}); + + // Anti-Xi histograms + rAntiXi.add("InvMassXiPlus", "InvMassXiPlus", {HistType::kTH3F, {axisPt, axisInvMassXi, axisEta}}); + rAntiXi.add("InvMassXiPlus_Radius", "InvMassXiPlus_Radius", {HistType::kTH2F, {axisPt, axisInvMassXi}}); + + // Omega histograms + rOmega.add("InvMassOmegaMinus", "InvMassOmegaMinus", {HistType::kTH3F, {axisPt, axisInvMassOmega, axisEta}}); + + // Anti-Omega histograms + rAntiOmega.add("InvMassOmegaPlus", "InvMassOmegaPlus", {HistType::kTH3F, {axisPt, axisInvMassOmega, axisEta}}); + + // Cut summary + rGeneral.add("selectionSummary", "selectionSummary", HistType::kTH1F, {{18, -0.5, 17.5}}); + TString CutLabelSummary[18] = {"v0_dcav0dau", "v0_dcapostopv", "v0_dcanegtopv", "v0_cospa", "v0_radius", "v0_rapidity", + "casc_cospa", "casc_v0cospa", "casc_dcacascdau", "casc_dcav0dau", "casc_dcabachtopv", "casc_dcapostopv", "casc_dcanegtopv", "casc_mindcav0topv", "casc_cascradius", "casc_v0masswindow", "casc_v0radius", "casc_rapidity"}; + for (Int_t n = 1; n <= rGeneral.get(HIST("selectionSummary"))->GetNbinsX(); n++) { + rGeneral.get(HIST("selectionSummary"))->GetXaxis()->SetBinLabel(n, CutLabelSummary[n - 1]); + } + rGeneral.get(HIST("selectionSummary"))->SetBinContent(1, v0setting_dcav0dau); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(2, v0setting_dcapostopv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(3, v0setting_dcanegtopv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(4, v0setting_cospa); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(5, v0setting_radius); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(6, v0setting_rapidity); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(7, cascadesetting_cospa); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(8, cascadesetting_v0cospa); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(9, cascadesetting_dcacascdau); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(10, cascadesetting_dcav0dau); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(11, cascadesetting_dcabachtopv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(12, cascadesetting_dcapostopv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(13, cascadesetting_dcanegtopv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(14, cascadesetting_mindcav0topv); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(15, cascadesetting_cascradius); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(16, cascadesetting_v0masswindow); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(17, cascadesetting_v0radius); + rGeneral.get(HIST("selectionSummary"))->SetBinContent(18, cascadesetting_rapidity); + } + + template + void fillV0Histograms(TV0 const& v0) + { + rVzero.fill(HIST("CosPA"), v0.v0cosPA()); + rVzero.fill(HIST("V0Radius"), v0.v0radius()); + rVzero.fill(HIST("V0DCANegToPV"), v0.dcanegtopv()); + rVzero.fill(HIST("V0DCAPosToPV"), v0.dcapostopv()); + rVzero.fill(HIST("V0DCAV0Daughters"), v0.dcaV0daughters()); + rVzero.fill(HIST("DecayLength"), v0.decayLength()); + } + + template + void fillCascadeHistograms(TCascade const& casc) + { + rCascade.fill(HIST("V0Radius"), casc.v0radius(), casc.sign()); + rCascade.fill(HIST("CascCosPA"), casc.casccosPA(), casc.sign()); + rCascade.fill(HIST("V0CosPA"), casc.v0cosPA(), casc.sign()); + rCascade.fill(HIST("CascRadius"), casc.cascradius(), casc.sign()); + rCascade.fill(HIST("CascDecayLength"), casc.decayLength(), casc.sign()); + rCascade.fill(HIST("CascPt"), casc.pt(), casc.sign()); + rCascade.fill(HIST("DcaV0Daughters"), casc.dcaV0daughters(), casc.sign()); + rCascade.fill(HIST("DcaCascDaughters"), casc.dcacascdaughters(), casc.sign()); + rCascade.fill(HIST("DcaV0ToPV"), casc.dcav0topv(), casc.sign()); + rCascade.fill(HIST("DcaBachToPV"), casc.dcabachtopv(), casc.sign()); + rCascade.fill(HIST("DcaPosToPV"), casc.dcapostopv(), casc.sign()); + rCascade.fill(HIST("DcaNegToPV"), casc.dcanegtopv(), casc.sign()); + rCascade.fill(HIST("InvMassLambdaDaughter"), casc.mLambda(), casc.sign()); + rCascade.fill(HIST("V0Ctau"), casc.lifetimeV0(), casc.sign()); + } + + // Filters on V0s + Filter preFilterV0 = (nabs(aod::vZerosQC::dcapostopv) > v0setting_dcapostopv && + nabs(aod::vZerosQC::dcanegtopv) > v0setting_dcanegtopv && + aod::vZerosQC::dcaV0daughters < v0setting_dcav0dau && + aod::vZerosQC::v0cosPA > v0setting_cospa && + aod::vZerosQC::v0radius > v0setting_radius); + + // Filters on Cascades + Filter preFilterCascades = (nabs(aod::cascadesQC::dcabachtopv) > cascadesetting_dcabachtopv && + aod::cascadesQC::dcaV0daughters < cascadesetting_dcav0dau && + nabs(aod::cascadesQC::dcapostopv) > cascadesetting_dcapostopv && + nabs(aod::cascadesQC::dcanegtopv) > cascadesetting_dcanegtopv && + aod::cascadesQC::dcacascdaughters < cascadesetting_dcacascdau && + aod::cascadesQC::dcaV0daughters < cascadesetting_dcav0dau && + aod::cascadesQC::v0radius > cascadesetting_v0radius && + aod::cascadesQC::cascradius > cascadesetting_cascradius && + nabs(aod::cascadesQC::dcav0topv) > cascadesetting_mindcav0topv && + aod::cascadesQC::v0cosPA > cascadesetting_v0cospa && + aod::cascadesQC::casccosPA > cascadesetting_cospa); + + void processV0(soa::Filtered const& v0s) + { + for (const auto& v0 : v0s) { + // Fill the candidate counter + rGeneral.fill(HIST("nCandidates"), 0); + + // K0Short + if (TMath::Abs(v0.yK0Short()) < v0setting_rapidity && + v0.lifetimeK0s() < lifetimecut->get("lifetimecutK0S") && + TMath::Abs(v0.posNSigmaV0Pion()) < NSigmaV0Pion && TMath::Abs(v0.negNSigmaV0Pion()) < NSigmaV0Pion) { + fillV0Histograms(v0); + rK0S.fill(HIST("DecayLengthK0s"), v0.decayLength()); + rK0S.fill(HIST("CtauK0s"), v0.lifetimeK0s()); + rK0S.fill(HIST("InvMassK0S"), v0.pt(), v0.mK0Short(), v0.eta()); + rK0S.fill(HIST("InvMassK0SVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mK0Short()); + rK0S.fill(HIST("V0DCAV0ToPVK0S"), v0.dcav0topv()); + rK0S.fill(HIST("InvMassK0S_Radius"), v0.v0radius(), v0.mK0Short()); + rK0S.fill(HIST("InvMassK0S_PtRadius"), v0.pt(), v0.v0radius(), v0.mK0Short()); + rK0S.fill(HIST("InvMassK0S_EtaDaughters"), v0.poseta(), v0.negeta(), v0.mK0Short()); + rK0S.fill(HIST("InvMassK0S_PhiDaughters"), v0.posphi(), v0.negphi(), v0.mK0Short()); + rK0S.fill(HIST("InvMassK0S_ITSMapDaughters"), v0.posITSNhits(), v0.negITSNhits(), v0.mK0Short()); + } + + // Lambda + if (TMath::Abs(v0.yLambda()) < v0setting_rapidity && + v0.lifetimeLambda() < lifetimecut->get("lifetimecutLambda") && + TMath::Abs(v0.posNSigmaV0Proton()) < NSigmaV0Proton && TMath::Abs(v0.negNSigmaV0Pion()) < NSigmaV0Pion) { + fillV0Histograms(v0); + rLambda.fill(HIST("DecayLengthLambda"), v0.decayLength()); + rLambda.fill(HIST("CtauLambda"), v0.lifetimeLambda()); + rLambda.fill(HIST("InvMassLambda"), v0.pt(), v0.mLambda(), v0.eta()); + rLambda.fill(HIST("InvMassLambdaVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mLambda()); + rLambda.fill(HIST("V0DCAV0ToPVLambda"), v0.dcav0topv()); + rLambda.fill(HIST("InvMassLambda_Radius"), v0.v0radius(), v0.mLambda()); + rLambda.fill(HIST("InvMassLambda_PtRadius"), v0.pt(), v0.v0radius(), v0.mLambda()); + rLambda.fill(HIST("InvMassLambda_EtaDaughters"), v0.poseta(), v0.negeta(), v0.mLambda()); + rLambda.fill(HIST("InvMassLambda_PhiDaughters"), v0.posphi(), v0.negphi(), v0.mLambda()); + rLambda.fill(HIST("InvMassLambda_Ctau"), v0.lifetimeLambda(), v0.mLambda()); + rLambda.fill(HIST("InvMassLambda_ITSMapDaughters"), v0.posITSNhits(), v0.negITSNhits(), v0.mLambda()); + if (v0.v0cosPA() > 0.999 && v0.dcaV0daughters() < 1 && TMath::Abs(v0.mK0Short() - pdgDB->Mass(310)) > 0.012 && TMath::Abs(v0.mAntiLambda() - o2::constants::physics::MassLambda0) > 0.08 && TMath::Abs(v0.mLambda() - o2::constants::physics::MassLambda0) < 0.002) { + rLambda.fill(HIST("ResponsePionFromLambda"), v0.pt(), v0.negNSigmaV0Pion()); + rLambda.fill(HIST("ResponseProtonFromLambda"), v0.pt(), v0.posNSigmaV0Proton()); + } + } + + // AntiLambda + if (TMath::Abs(v0.yLambda()) < v0setting_rapidity && + v0.lifetimeLambda() < lifetimecut->get("lifetimecutLambda") && + TMath::Abs(v0.posNSigmaV0Pion()) < NSigmaV0Pion && TMath::Abs(v0.negNSigmaV0Proton()) < NSigmaV0Proton) { + fillV0Histograms(v0); + rAntiLambda.fill(HIST("DecayLengthAntiLambda"), v0.decayLength()); + rAntiLambda.fill(HIST("CtauAntiLambda"), v0.lifetimeLambda()); + rAntiLambda.fill(HIST("InvMassAntiLambda"), v0.pt(), v0.mAntiLambda(), v0.eta()); + rAntiLambda.fill(HIST("InvMassAntiLambdaVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mAntiLambda()); + rAntiLambda.fill(HIST("V0DCAV0ToPVAntiLambda"), v0.dcav0topv()); + rAntiLambda.fill(HIST("InvMassAntiLambda_Radius"), v0.v0radius(), v0.mAntiLambda()); + rAntiLambda.fill(HIST("InvMassAntiLambda_PtRadius"), v0.pt(), v0.v0radius(), v0.mAntiLambda()); + rAntiLambda.fill(HIST("InvMassAntiLambda_EtaDaughters"), v0.poseta(), v0.negeta(), v0.mAntiLambda()); + rAntiLambda.fill(HIST("InvMassAntiLambda_PhiDaughters"), v0.posphi(), v0.negphi(), v0.mAntiLambda()); + rAntiLambda.fill(HIST("InvMassAntiLambda_Ctau"), v0.lifetimeLambda(), v0.mAntiLambda()); + rAntiLambda.fill(HIST("InvMassAntiLambda_ITSMapDaughters"), v0.posITSNhits(), v0.negITSNhits(), v0.mAntiLambda()); + } + } + } + PROCESS_SWITCH(strangenessQCPP, processV0, "Process V0 candidates", true); + + void processCascade(soa::Filtered const& cascades) + { + for (const auto& casc : cascades) { + // Fill the candidate counter + rGeneral.fill(HIST("nCandidates"), 1); + + if (casc.sign() < 0) { + // Check lambda daughters` PID + if (TMath::Abs(casc.posNSigmaV0Proton()) < NSigmaCascProton && TMath::Abs(casc.negNSigmaV0Pion()) < NSigmaCascPion) { + // Xi + if (TMath::Abs(casc.yXi()) < cascadesetting_rapidity && TMath::Abs(casc.bachNSigmaV0Pion()) < NSigmaCascPion) { + fillCascadeHistograms(casc); + rXi.fill(HIST("InvMassXiMinus"), casc.pt(), casc.mXi(), casc.eta()); + rXi.fill(HIST("InvMassXiMinus_Radius"), casc.cascradius(), casc.mXi()); + rCascade.fill(HIST("CascyXi"), casc.yXi(), casc.sign()); + rCascade.fill(HIST("CascCtauXi"), casc.lifetimeXi(), casc.sign()); + } + // Omega + if (TMath::Abs(casc.yOmega()) < cascadesetting_rapidity && TMath::Abs(casc.bachNSigmaV0Kaon()) < NSigmaCascKaon) { + fillCascadeHistograms(casc); + rOmega.fill(HIST("InvMassOmegaMinus"), casc.pt(), casc.mOmega(), casc.eta()); + rCascade.fill(HIST("CascCtauOmega"), casc.lifetimeOmega(), casc.sign()); + rCascade.fill(HIST("CascyOmega"), casc.yOmega(), casc.sign()); + } + } + } else { + // Check anti-lambda daughters` PID + if (TMath::Abs(casc.posNSigmaV0Pion()) < NSigmaCascPion && TMath::Abs(casc.negNSigmaV0Proton()) < NSigmaCascProton) { + // Anti-Xi + if (TMath::Abs(casc.yXi()) < cascadesetting_rapidity && TMath::Abs(casc.bachNSigmaV0Pion()) < NSigmaCascPion) { + fillCascadeHistograms(casc); + rAntiXi.fill(HIST("InvMassXiPlus"), casc.pt(), casc.mXi(), casc.eta()); + rAntiXi.fill(HIST("InvMassXiPlus_Radius"), casc.cascradius(), casc.mXi()); + rCascade.fill(HIST("CascyXi"), casc.yXi(), casc.sign()); + rCascade.fill(HIST("CascCtauXi"), casc.lifetimeXi(), casc.sign()); + } + // Anti-Omega + if (TMath::Abs(casc.yOmega()) < cascadesetting_rapidity && TMath::Abs(casc.bachNSigmaV0Kaon()) < NSigmaCascKaon) { + fillCascadeHistograms(casc); + rAntiOmega.fill(HIST("InvMassOmegaPlus"), casc.pt(), casc.mOmega(), casc.eta()); + rCascade.fill(HIST("CascCtauOmega"), casc.lifetimeOmega(), casc.sign()); + rCascade.fill(HIST("CascyOmega"), casc.yOmega(), casc.sign()); + } + } + } + } + } + PROCESS_SWITCH(strangenessQCPP, processCascade, "Process cascade candidates", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"lf-strangenessqcpp"})}; +} \ No newline at end of file diff --git a/PWGLF/Tasks/QC/v0cascadesqa.cxx b/PWGLF/Tasks/QC/v0cascadesqa.cxx index 30d2a5bad0c..023b54a338f 100644 --- a/PWGLF/Tasks/QC/v0cascadesqa.cxx +++ b/PWGLF/Tasks/QC/v0cascadesqa.cxx @@ -31,7 +31,7 @@ #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/Multiplicity.h" #include -//#include +// #include using namespace o2; using namespace o2::framework; @@ -74,6 +74,7 @@ struct v0cascadesQA { ConfigurableAxis binInvMassAntiLambda{"binInvMassAntiLambda", {200, 1.07f, 1.17f}, ""}; ConfigurableAxis binResponsePionFromLambda{"binResponsePionFromLambda", {200, -20.f, 20.f}, ""}; ConfigurableAxis binResponseProtonFromLambda{"binResponseProtonFromLambda", {200, -20.f, 20.f}, ""}; + ConfigurableAxis binEtaSmall{"binEtaSmall", {2, -1.0f, 1.0f}, ""}; ConfigurableAxis binEta{"binEta", {100, -1.0f, 1.0f}, ""}; ConfigurableAxis binPhi{"binPhi", {(int)TMath::Pi() * 10 / 2, 0.0f, 2. * TMath::Pi()}, ""}; ConfigurableAxis binRadius{"binRadius", {100, 0.0f, 50.0f}, ""}; @@ -128,12 +129,12 @@ struct v0cascadesQA { {"DcaPosToPV", "DcaPosToPV", {HistType::kTH2F, {{80, -0.2f, 0.2f}, {2, -2, 2}}}}, {"DcaNegToPV", "DcaNegToPV", {HistType::kTH2F, {{80, -0.2f, 0.2f}, {2, -2, 2}}}}, {"InvMassLambdaDaughter", "InvMassLambdaDaughter", {HistType::kTH2F, {{100, 1.1f, 1.13f}, {2, -2, 2}}}}, - {"InvMassXiPlus", "InvMassXiPlus", {HistType::kTH2F, {{100, 0.f, 10.f}, {80, 1.28f, 1.36f}}}}, - {"InvMassXiMinus", "InvMassXiMinus", {HistType::kTH2F, {{100, 0.f, 10.f}, {80, 1.28f, 1.36f}}}}, + {"InvMassXiPlus", "InvMassXiPlus", {HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.28f, 1.36f}, {2, -1.0f, 1.0f}}}}, + {"InvMassXiMinus", "InvMassXiMinus", {HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.28f, 1.36f}, {2, -1.0f, 1.0f}}}}, {"InvMassXiPlus_Radius", "InvMassXiPlus_Radius", {HistType::kTH2F, {{100, 0.f, 50.f}, {80, 1.28f, 1.36f}}}}, {"InvMassXiMinus_Radius", "InvMassXiMinus_Radius", {HistType::kTH2F, {{100, 0.f, 50.f}, {80, 1.28f, 1.36f}}}}, - {"InvMassOmegaPlus", "InvMassOmegaPlus", {HistType::kTH2F, {{100, 0.f, 10.f}, {80, 1.63f, 1.71f}}}}, - {"InvMassOmegaMinus", "InvMassOmegaMinus", {HistType::kTH2F, {{100, 0.f, 10.f}, {80, 1.63f, 1.71f}}}}, + {"InvMassOmegaPlus", "InvMassOmegaPlus", {HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.63f, 1.71f}, {2, -1.0f, 1.0f}}}}, + {"InvMassOmegaMinus", "InvMassOmegaMinus", {HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.63f, 1.71f}, {2, -1.0f, 1.0f}}}}, }, OutputObjHandlingPolicy::AnalysisObject, false, @@ -167,6 +168,7 @@ struct v0cascadesQA { const AxisSpec axisResponseProtonFromLambda{binResponseProtonFromLambda, "Response Proton From Lambda"}; const AxisSpec axisEta{binEta, "Eta"}; const AxisSpec axisPhi{binPhi, "Phi"}; + const AxisSpec axisEtaSmall{binEtaSmall, "Eta"}; const AxisSpec axisRadius{binRadius, "Radius"}; const AxisSpec axisRadiussmall{binRadiussmall, "Radius"}; const AxisSpec axisITSMapDaughters{binITSMapDaughters, "ITS Map Daughters"}; @@ -186,9 +188,9 @@ struct v0cascadesQA { histos_V0.add("V0DCAV0ToPVK0S", "V0DCAV0ToPVK0S", kTH1F, {axisV0DCAV0ToPVK0S}); histos_V0.add("V0DCAV0ToPVLambda", "V0DCAV0ToPVLambda", kTH1F, {axisV0DCAV0ToPVLambda}); histos_V0.add("V0DCAV0ToPVAntiLambda", "V0DCAV0ToPVAntiLambda", kTH1F, {axisV0DCAV0ToPVAntiLambda}); - histos_V0.add("InvMassK0S", "InvMassK0S", kTH2F, {axisPt, axisInvMassK0S}); - histos_V0.add("InvMassLambda", "InvMassLambda", kTH2F, {axisPt, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda", "InvMassAntiLambda", kTH2F, {axisPt, axisInvMassAntiLambda}); + histos_V0.add("InvMassK0S", "InvMassK0S", kTH3F, {axisPt, axisInvMassK0S, axisEtaSmall}); + histos_V0.add("InvMassLambda", "InvMassLambda", kTH3F, {axisPt, axisInvMassLambda, axisEtaSmall}); + histos_V0.add("InvMassAntiLambda", "InvMassAntiLambda", kTH3F, {axisPt, axisInvMassAntiLambda, axisEtaSmall}); histos_V0.add("ResponsePionFromLambda", "ResponsePionFromLambda", kTH2F, {axisPt, axisResponsePionFromLambda}); histos_V0.add("ResponseProtonFromLambda", "ResponseProtonFromLambda", kTH2F, {axisPt, axisResponseProtonFromLambda}); if (doextraanalysis) { @@ -404,7 +406,7 @@ struct v0cascadesQA { histos_V0.fill(HIST("CtauK0s"), CtauK0s); histos_V0.fill(HIST("DecayLengthK0s"), decayLength); - histos_V0.fill(HIST("InvMassK0S"), v0.pt(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0S"), v0.pt(), v0.mK0Short(), v0.eta()); histos_V0.fill(HIST("InvMassK0SVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mK0Short()); histos_V0.fill(HIST("V0DCAV0ToPVK0S"), v0.dcav0topv()); if (doextraanalysis) { @@ -423,7 +425,7 @@ struct v0cascadesQA { histos_V0.fill(HIST("DecayLengthLambda"), decayLength); histos_V0.fill(HIST("CtauLambda"), CtauLambda); - histos_V0.fill(HIST("InvMassLambda"), v0.pt(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda"), v0.pt(), v0.mLambda(), v0.eta()); if (doextraanalysis) histos_V0.fill(HIST("InvMassLambdaVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mLambda()); histos_V0.fill(HIST("V0DCAV0ToPVLambda"), v0.dcav0topv()); @@ -448,7 +450,7 @@ struct v0cascadesQA { histos_V0.fill(HIST("DecayLengthAntiLambda"), decayLength); histos_V0.fill(HIST("CtauAntiLambda"), CtauLambda); - histos_V0.fill(HIST("InvMassAntiLambda"), v0.pt(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda"), v0.pt(), v0.mAntiLambda(), v0.eta()); if (doextraanalysis) histos_V0.fill(HIST("InvMassAntiLambdaVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mAntiLambda()); histos_V0.fill(HIST("V0DCAV0ToPVAntiLambda"), v0.dcav0topv()); @@ -617,21 +619,21 @@ struct v0cascadesQA { if (casc.sign() < 0) { if (TMath::Abs(posdau.tpcNSigmaPr()) < NSigmaCascProton && TMath::Abs(negdau.tpcNSigmaPi()) < NSigmaCascPion) { if (TMath::Abs(casc.yXi()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaPi()) < NSigmaCascPion) { - histos_Casc.fill(HIST("InvMassXiMinus"), casc.pt(), casc.mXi()); + histos_Casc.fill(HIST("InvMassXiMinus"), casc.pt(), casc.mXi(), casc.eta()); histos_Casc.fill(HIST("InvMassXiMinus_Radius"), casc.cascradius(), casc.mXi()); } if (TMath::Abs(casc.yOmega()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaKa()) < NSigmaCascKaon) { - histos_Casc.fill(HIST("InvMassOmegaMinus"), casc.pt(), casc.mOmega()); + histos_Casc.fill(HIST("InvMassOmegaMinus"), casc.pt(), casc.mOmega(), casc.eta()); } } } else { if (TMath::Abs(posdau.tpcNSigmaPi()) < NSigmaCascPion && TMath::Abs(negdau.tpcNSigmaPr()) < NSigmaCascProton) { if (TMath::Abs(casc.yXi()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaPi()) < NSigmaCascPion) { - histos_Casc.fill(HIST("InvMassXiPlus"), casc.pt(), casc.mXi()); + histos_Casc.fill(HIST("InvMassXiPlus"), casc.pt(), casc.mXi(), casc.eta()); histos_Casc.fill(HIST("InvMassXiPlus_Radius"), casc.cascradius(), casc.mXi()); } if (TMath::Abs(casc.yOmega()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaKa()) < NSigmaCascKaon) { - histos_Casc.fill(HIST("InvMassOmegaPlus"), casc.pt(), casc.mOmega()); + histos_Casc.fill(HIST("InvMassOmegaPlus"), casc.pt(), casc.mOmega(), casc.eta()); } } } diff --git a/PWGLF/Tasks/f1protoncorrelation.cxx b/PWGLF/Tasks/f1protoncorrelation.cxx new file mode 100644 index 00000000000..a42c879ca50 --- /dev/null +++ b/PWGLF/Tasks/f1protoncorrelation.cxx @@ -0,0 +1,265 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \brief this is a starting point for the Resonances tutorial +/// \author sourav kundu +/// \since 02/11/2023 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/runDataProcessing.h" +#include "PWGLF/DataModel/ReducedF1ProtonTables.h" +#include "CommonConstants/PhysicsConstants.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +struct f1protoncorrelation { + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // PID selection + Configurable nsigmaCutTPC{"nsigmacutTPC", 3.0, "Value of the TPC Nsigma cut"}; + Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Value of the TOF Nsigma cut"}; + // PID selection + Configurable strategyPIDPion{"strategyPIDPion", 0, "PID strategy Pion"}; + Configurable strategyPIDKaon{"strategyPIDKaon", 0, "PID strategy Kaon"}; + Configurable maxMomentumPion{"maxMomentumPion", 4.0, "Maximum momentum Pion"}; + Configurable maxMomentumKaon{"maxMomentumKaon", 4.0, "Maximum momentum Kaon"}; + Configurable momentumTOFPion{"momentumTOFPion", 0.8, "Pion momentum TOF"}; + Configurable momentumTOFKaon{"momentumTOFKaon", 0.8, "Kaon momentum TOF"}; + Configurable momentumTOFProton{"momentumTOFProton", 0.7, "Proton momentum TOF"}; + Configurable lowPtF1{"lowPtF1", 1.0, "PT cut F1"}; + // Event Mixing + Configurable nEvtMixing{"nEvtMixing", 1, "Number of events to mix"}; + ConfigurableAxis CfgVtxBins{"CfgVtxBins", {10, -10, 10}, "Mixing bins - z-vertex"}; + ConfigurableAxis CfgMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0.0, 30.0, 40.0, 50.0, 60.0, 80.0, 200.0}, "Mixing bins - number of contributor"}; + + // Initialize the ananlysis task + void init(o2::framework::InitContext&) + { + // register histograms + histos.add("hNsigmaProtonTPCSE", "Nsigma Proton TPC distribution same event", kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 1.0f}}); + histos.add("hNsigmaProtonTPCME", "Nsigma Proton TPC distribution mixed event", kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 1.0f}}); + histos.add("h2SameEventPtCorrelation", "Pt correlation of F1 and proton", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {100, 0.0, 10.0}}); + histos.add("h2SameEventInvariantMassUnlike_mass104", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2MixEventInvariantMassUnlike_mass104", "Unlike Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2SameEventInvariantMassLike_mass104", "Like Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2MixEventInvariantMassLike_mass104", "Like Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2SameEventInvariantMassUnlike_mass103", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2MixEventInvariantMassUnlike_mass103", "Unlike Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2SameEventInvariantMassLike_mass103", "Like Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2MixEventInvariantMassLike_mass103", "Like Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2SameEventInvariantMassUnlike_mass102", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2MixEventInvariantMassUnlike_mass102", "Unlike Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2SameEventInvariantMassLike_mass102", "Like Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2MixEventInvariantMassLike_mass102", "Like Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2SameEventInvariantMassUnlike_mass101", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2MixEventInvariantMassUnlike_mass101", "Unlike Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2SameEventInvariantMassLike_mass101", "Like Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2MixEventInvariantMassLike_mass101", "Like Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + } + + // get kstar + TLorentzVector trackSum, PartOneCMS, PartTwoCMS, trackRelK; + float getkstar(const TLorentzVector part1, + const TLorentzVector part2) + { + // const TLorentzVector trackSum = part1 + part2; + trackSum = part1 + part2; + const float beta = trackSum.Beta(); + const float betax = beta * std::cos(trackSum.Phi()) * std::sin(trackSum.Theta()); + const float betay = beta * std::sin(trackSum.Phi()) * std::sin(trackSum.Theta()); + const float betaz = beta * std::cos(trackSum.Theta()); + // TLorentzVector PartOneCMS(part1); + // TLorentzVector PartTwoCMS(part2); + PartOneCMS.SetXYZM(part1.Px(), part1.Py(), part1.Pz(), part1.M()); + PartTwoCMS.SetXYZM(part2.Px(), part2.Py(), part2.Pz(), part2.M()); + const ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-betax, -betay, -betaz); + PartOneCMS = boostPRF(PartOneCMS); + PartTwoCMS = boostPRF(PartTwoCMS); + // const TLorentzVector trackRelK = PartOneCMS - PartTwoCMS; + trackRelK = PartOneCMS - PartTwoCMS; + return 0.5 * trackRelK.P(); + } + + TLorentzVector F1, Proton, F1ProtonPair, Pion, Kaon; + // Process the data in same event + void process(aod::RedF1PEvents::iterator const& collision, aod::F1Tracks const& f1tracks, aod::ProtonTracks const& protontracks) + { + for (auto f1track : f1tracks) { + F1.SetXYZM(f1track.f1Px(), f1track.f1Py(), f1track.f1Pz(), f1track.f1Mass()); + if (f1track.f1MassKaonKshort() > 1.04 || F1.Pt() < lowPtF1) { + continue; + } + Pion.SetXYZM(f1track.f1d1Px(), f1track.f1d1Py(), f1track.f1d1Pz(), 0.139); + Kaon.SetXYZM(f1track.f1d2Px(), f1track.f1d2Py(), f1track.f1d2Pz(), 0.493); + if (Pion.P() > maxMomentumPion || Kaon.P() > maxMomentumKaon) { + continue; + } + if (strategyPIDPion == 1 && Pion.P() > momentumTOFPion && f1track.f1d1TOFHit() != 1) { + continue; + } + if (strategyPIDKaon == 1 && Kaon.P() > momentumTOFKaon && f1track.f1d2TOFHit() != 1) { + continue; + } + for (auto protontrack : protontracks) { + Proton.SetXYZM(protontrack.protonPx(), protontrack.protonPy(), protontrack.protonPz(), 0.938); + if (Proton.P() < momentumTOFProton && TMath::Abs(protontrack.protonNsigmaTPC()) > 3) { + continue; + } + if (Proton.P() >= momentumTOFProton && protontrack.protonTOFHit() != 1 && TMath::Abs(protontrack.protonNsigmaTOF()) > 3) { + continue; + } + if ((f1track.f1PionIndex() == protontrack.f1ProtonIndex()) || (f1track.f1KaonIndex() == protontrack.f1ProtonIndex()) || (f1track.f1KshortPositiveIndex() == protontrack.f1ProtonIndex()) || (f1track.f1KshortNegativeIndex() == protontrack.f1ProtonIndex())) { + continue; + } + auto relative_momentum = getkstar(F1, Proton); + histos.fill(HIST("h2SameEventPtCorrelation"), relative_momentum, F1.Pt(), Proton.Pt()); + if (f1track.f1MassKaonKshort() < 1.04) { + if (f1track.f1SignalStat() == 1) { + histos.fill(HIST("h2SameEventInvariantMassUnlike_mass104"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + histos.fill(HIST("hNsigmaProtonTPCSE"), protontrack.protonNsigmaTPC(), relative_momentum); + } + if (f1track.f1SignalStat() == -1) { + histos.fill(HIST("h2SameEventInvariantMassLike_mass104"), relative_momentum, F1.Pt(), F1.M()); + } + } + if (f1track.f1MassKaonKshort() < 1.03) { + if (f1track.f1SignalStat() == 1) { + histos.fill(HIST("h2SameEventInvariantMassUnlike_mass103"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + } + if (f1track.f1SignalStat() == -1) { + histos.fill(HIST("h2SameEventInvariantMassLike_mass103"), relative_momentum, F1.Pt(), F1.M()); + } + } + if (f1track.f1MassKaonKshort() < 1.02) { + if (f1track.f1SignalStat() == 1) { + histos.fill(HIST("h2SameEventInvariantMassUnlike_mass102"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + } + if (f1track.f1SignalStat() == -1) { + histos.fill(HIST("h2SameEventInvariantMassLike_mass102"), relative_momentum, F1.Pt(), F1.M()); + } + } + if (f1track.f1MassKaonKshort() < 1.01) { + if (f1track.f1SignalStat() == 1) { + histos.fill(HIST("h2SameEventInvariantMassUnlike_mass101"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + } + if (f1track.f1SignalStat() == -1) { + histos.fill(HIST("h2SameEventInvariantMassLike_mass101"), relative_momentum, F1.Pt(), F1.M()); + } + } + } + } + } + + // Processing Event Mixing + // using BinningTypeVtxZT0M = ColumnBinningPolicy; + // for (auto& [collision1, tracks1, collision2, tracks2] : pairs) { + // Pair pairs{colBinning, nEvtMixing, -1, &cache}; // -1 is the number of the bin to skip + // + // tracks1 is an aod::Tracks table of f1tracks belonging to collision collision1 (aod::Collision::iterator) + // tracks2 is an aod::Tracks table of protontracks belonging to collision collision2 (aod::Collision::iterator) + SliceCache cache; + using BinningType = ColumnBinningPolicy; + BinningType colBinning{{CfgVtxBins, CfgMultBins}, true}; + Preslice tracksPerCollisionPresliceF1 = aod::f1protondaughter::redF1PEventId; + Preslice tracksPerCollisionPresliceP = aod::f1protondaughter::redF1PEventId; + void processME(aod::RedF1PEvents& collisions, aod::F1Tracks& f1tracks, aod::ProtonTracks& protontracks) + { + for (auto& [collision1, collision2] : selfCombinations(colBinning, nEvtMixing, -1, collisions, collisions)) { + // LOGF(info, "Mixed event collisions: (%d, %d)", collision1.index(), collision2.index()); + if (collision1.index() == collision2.index()) { + continue; + } + if (f1tracks.size() == 0 || protontracks.size() == 0) { + continue; + } + auto groupF1 = f1tracks.sliceBy(tracksPerCollisionPresliceF1, collision1.globalIndex()); + auto groupProton = protontracks.sliceBy(tracksPerCollisionPresliceP, collision2.globalIndex()); + // auto groupF1 = f1tracks.sliceByCached(aod::f1protondaughter::redF1PEventId, collision1.globalIndex(), cache); + // auto groupProton = protontracks.sliceByCached(aod::f1protondaughter::redF1PEventId, collision2.globalIndex(), cache); + // for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(f1tracks, protontracks))) { + for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(groupF1, groupProton))) { + // LOGF(info, "Mixed event collision1 track1: (%d, %d)", collision1.index(), t1.index()); + F1.SetXYZM(t1.f1Px(), t1.f1Py(), t1.f1Pz(), t1.f1Mass()); + if (t1.f1MassKaonKshort() > 1.04 || F1.Pt() < lowPtF1) { + continue; + } + Pion.SetXYZM(t1.f1d1Px(), t1.f1d1Py(), t1.f1d1Pz(), 0.139); + Kaon.SetXYZM(t1.f1d2Px(), t1.f1d2Py(), t1.f1d2Pz(), 0.493); + if (Pion.P() > maxMomentumPion || Kaon.P() > maxMomentumKaon) { + continue; + } + if (strategyPIDPion == 1 && Pion.P() > momentumTOFPion && t1.f1d1TOFHit() != 1) { + continue; + } + if (strategyPIDKaon == 1 && Kaon.P() > momentumTOFKaon && t1.f1d2TOFHit() != 1) { + continue; + } + Proton.SetXYZM(t2.protonPx(), t2.protonPy(), t2.protonPz(), 0.938); + if (Proton.P() < momentumTOFProton && TMath::Abs(t2.protonNsigmaTPC()) > 3) { + continue; + } + if (Proton.P() >= momentumTOFProton && t2.protonTOFHit() != 1 && TMath::Abs(t2.protonNsigmaTOF()) > 3) { + continue; + } + auto relative_momentum = getkstar(F1, Proton); + if (t1.f1MassKaonKshort() < 1.04) { + if (t1.f1SignalStat() == 1) { + histos.fill(HIST("h2MixEventInvariantMassUnlike_mass104"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + histos.fill(HIST("hNsigmaProtonTPCME"), t2.protonNsigmaTPC(), relative_momentum); + } + if (t1.f1SignalStat() == -1) { + histos.fill(HIST("h2MixEventInvariantMassLike_mass104"), relative_momentum, F1.Pt(), F1.M()); + } + } + if (t1.f1MassKaonKshort() < 1.03) { + if (t1.f1SignalStat() == 1) { + histos.fill(HIST("h2MixEventInvariantMassUnlike_mass103"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + } + if (t1.f1SignalStat() == -1) { + histos.fill(HIST("h2MixEventInvariantMassLike_mass103"), relative_momentum, F1.Pt(), F1.M()); + } + } + if (t1.f1MassKaonKshort() < 1.02) { + if (t1.f1SignalStat() == 1) { + histos.fill(HIST("h2MixEventInvariantMassUnlike_mass102"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + } + if (t1.f1SignalStat() == -1) { + histos.fill(HIST("h2MixEventInvariantMassLike_mass102"), relative_momentum, F1.Pt(), F1.M()); + } + } + if (t1.f1MassKaonKshort() < 1.01) { + if (t1.f1SignalStat() == 1) { + histos.fill(HIST("h2MixEventInvariantMassUnlike_mass101"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + } + if (t1.f1SignalStat() == -1) { + histos.fill(HIST("h2MixEventInvariantMassLike_mass101"), relative_momentum, F1.Pt(), F1.M()); + } + } + } + } + } + PROCESS_SWITCH(f1protoncorrelation, processME, "Process EventMixing for combinatorial background", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGLF/Tasks/hStrangeCorrelation.cxx b/PWGLF/Tasks/hStrangeCorrelation.cxx index 941502cf10e..47812555c6c 100644 --- a/PWGLF/Tasks/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/hStrangeCorrelation.cxx @@ -62,6 +62,7 @@ struct correlateStrangeness { Configurable skipUnderOverflowInTHn{"skipUnderOverflowInTHn", false, "skip under/overflow in THns"}; Configurable mixingParameter{"mixingParameter", 10, "how many events are mixed"}; Configurable doMCassociation{"doMCassociation", false, "fill everything only for MC associated"}; + Configurable doAutocorrelationRejection{"doAutocorrelationRejection", true, "reject pairs where trigger Id is the same as daughter particle Id"}; // Axes - configurable for smaller sizes ConfigurableAxis axisMult{"axisMult", {VARIABLE_WIDTH, 0.0f, 0.01f, 1.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 70.0f, 100.0f}, "Mixing bins - multiplicity"}; @@ -159,11 +160,16 @@ struct correlateStrangeness { //---] removing autocorrelations [--- auto postrack = assoc.posTrack_as(); auto negtrack = assoc.negTrack_as(); - if (trigg.globalIndex() == postrack.globalIndex()) - continue; - if (trigg.globalIndex() == negtrack.globalIndex()) - continue; - // TODO: add histogram checking how many pairs are rejected (should be small!) + if (doAutocorrelationRejection) { + if (trigg.globalIndex() == postrack.globalIndex()) { + histos.fill(HIST("hNumberOfRejectedPairsV0"), 0.5); + continue; + } + if (trigg.globalIndex() == negtrack.globalIndex()) { + histos.fill(HIST("hNumberOfRejectedPairsV0"), 0.5); + continue; + } + } float deltaphi = ComputeDeltaPhi(trigg.phi(), assoc.phi()); float deltaeta = trigg.eta() - assoc.eta(); @@ -224,13 +230,20 @@ struct correlateStrangeness { auto postrack = assocV0.posTrack_as(); auto negtrack = assocV0.negTrack_as(); auto bachtrack = assoc.bachelor_as(); - if (trigg.globalIndex() == postrack.globalIndex()) - continue; - if (trigg.globalIndex() == negtrack.globalIndex()) - continue; - if (trigg.globalIndex() == bachtrack.globalIndex()) - continue; - // TODO: add histogram checking how many pairs are rejected (should be small!) + if (doAutocorrelationRejection) { + if (trigg.globalIndex() == postrack.globalIndex()) { + histos.fill(HIST("hNumberOfRejectedPairsCascades"), 0.5); + continue; + } + if (trigg.globalIndex() == negtrack.globalIndex()) { + histos.fill(HIST("hNumberOfRejectedPairsCascades"), 0.5); + continue; + } + if (trigg.globalIndex() == bachtrack.globalIndex()) { + histos.fill(HIST("hNumberOfRejectedPairsCascades"), 0.5); + continue; + } + } float deltaphi = ComputeDeltaPhi(trigg.phi(), assoc.phi()); float deltaeta = trigg.eta() - assoc.eta(); @@ -286,9 +299,12 @@ struct correlateStrangeness { auto assoc = assocTrack.track_as(); //---] removing autocorrelations [--- - if (trigg.globalIndex() == assoc.globalIndex()) - continue; - // TODO: add histogram checking how many pairs are rejected (should be small!) + if (doAutocorrelationRejection) { + if (trigg.globalIndex() == assoc.globalIndex()) { + histos.fill(HIST("hNumberOfRejectedPairsPions"), 0.5); + continue; + } + } float deltaphi = ComputeDeltaPhi(trigg.phi(), assoc.phi()); float deltaeta = trigg.eta() - assoc.eta(); @@ -562,6 +578,10 @@ struct correlateStrangeness { // Some QA plots histos.add("hTrackEtaVsPtVsPhi", "hTrackEtaVsPtVsPhi", kTH3F, {axisPtQA, axisEta, axisPhi}); + histos.add("hNumberOfRejectedPairsV0", "hNumberOfRejectedPairsV0", kTH1F, {{1, 0, 1}}); + histos.add("hNumberOfRejectedPairsCascades", "hNumberOfRejectedPairsCascades", kTH1F, {{1, 0, 1}}); + histos.add("hNumberOfRejectedPairsPions", "hNumberOfRejectedPairsPions", kTH1F, {{1, 0, 1}}); + histos.add("sameEvent/TriggerParticlesV0", "TriggersV0", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesCascade", "TriggersCascade", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesPion", "TriggersPion", kTH2F, {axisPtQA, axisMult}); diff --git a/PWGLF/Tasks/lambda1520SpherocityAnalysis.cxx b/PWGLF/Tasks/lambda1520SpherocityAnalysis.cxx index c600c1fafb1..4535d908a24 100644 --- a/PWGLF/Tasks/lambda1520SpherocityAnalysis.cxx +++ b/PWGLF/Tasks/lambda1520SpherocityAnalysis.cxx @@ -59,6 +59,7 @@ struct lambdaAnalysis { Configurable cUseOnlyTOFTrackPr{"cUseOnlyTOFTrackPr", false, "Use only TOF track for PID selection"}; // Use only TOF track for Proton PID selection Configurable cUseOnlyTOFTrackKa{"cUseOnlyTOFTrackKa", false, "Use only TOF track for PID selection"}; // Use only TOF track for Kaon PID selection Configurable cUseTpcAndTof{"cUseTpcAndTof", true, "Use TPC and TOF PID selection"}; // TPC And TOF tracks + Configurable cUseTpcOnly{"cUseTpcOnly", false, "Use TPC Only tracks (No TOF Veto)"}; // TPC only selection // Proton Configurable cMaxTPCnSigmaProton{"cMaxTPCnSigmaProton", 3.0, "TPC nSigma cut for Proton"}; // TPC Configurable cMaxTOFnSigmaProton{"cMaxTOFnSigmaProton", 3.0, "TOF nSigma cut for Proton"}; // TOF @@ -87,7 +88,7 @@ struct lambdaAnalysis { // Define Axis. const AxisSpec axisSp(nBinsSp, 0., 1., "S_{0}"); const AxisSpec axisCent(105, 0, 105, "FT0M (%)"); - const AxisSpec axisPtQA(40, 0., 2., "p_{T} (GeV/c)"); + const AxisSpec axisPtQA(100, 0., 2., "p_{T} (GeV/c)"); const AxisSpec axisPt(nBinsPt, 0., 10., "p_{T} (GeV/c)"); const AxisSpec axisEta(40, -1, 1, "#eta"); const AxisSpec axisDCAz(500, -0.5, 0.5, {"DCA_{z} (cm)"}); @@ -95,7 +96,7 @@ struct lambdaAnalysis { const AxisSpec axisTPCNCls(200, 0, 200, {"TPCNCls"}); const AxisSpec axisTPCNsigma(120, -6, 6, {"n#sigma^{TPC}"}); const AxisSpec axisTOFNsigma(120, -6, 6, {"n#sigma^{TOF}"}); - const AxisSpec axisInvM(nBinsInvM, 1.44, 2.04, {"M_{inv} (GeV/c^{2})"}); + const AxisSpec axisInvM(nBinsInvM, 1.44, 2.44, {"M_{inv} (GeV/c^{2})"}); // Create Histograms. // Event @@ -115,17 +116,19 @@ struct lambdaAnalysis { histos.add("QAafter/Proton/hPt", "p_{T}-spectra Protons", kTH1F, {axisPt}); histos.add("QAafter/Proton/hDcaZ", "dca_{z} Protons", kTH2F, {axisPtQA, axisDCAz}); histos.add("QAafter/Proton/hDcaXY", "dca_{xy} Protons", kTH2F, {axisPtQA, axisDCAxy}); - histos.add("QAafter/Proton/hTPCNsigma", "n#sigma^{TPC} only Protons", kTH2F, {axisPtQA, axisTPCNsigma}); - histos.add("QAafter/Proton/hTPCNsigmaTOF", "n#sigma^{TPC} Protons", kTH2F, {axisPtQA, axisTPCNsigma}); - histos.add("QAafter/Proton/hTOFNsigma", "n#sigma^{TOF} Protons", kTH2F, {axisPtQA, axisTOFNsigma}); - histos.add("QAafter/Proton/hTpcTofNsigma", "n#sigma^{TPC} vs n#sigma^{TOF} Protons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); + histos.add("QAafter/Proton/hTPCNsigmaFull", "n#sigma(TPC) Protons", kTH2F, {axisPtQA, axisTPCNsigma}); + histos.add("QAafter/Proton/hTPCNsigma", "n#sigma(TPC) Protons", kTH2F, {axisPtQA, axisTPCNsigma}); + histos.add("QAafter/Proton/hTPCNsigmaTOF", "n#sigma(TPC) Protons", kTH2F, {axisPtQA, axisTPCNsigma}); + histos.add("QAafter/Proton/hTOFNsigma", "n#sigma(TOF) Protons", kTH2F, {axisPtQA, axisTOFNsigma}); + histos.add("QAafter/Proton/hTpcTofNsigma", "n#sigma(TOF) vs n#sigma(TPC) Protons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); histos.add("QAafter/Kaon/hPt", "p_{T}-spectra Kaons", kTH1F, {axisPt}); histos.add("QAafter/Kaon/hDcaZ", "dca_{z} Kaons", kTH2F, {axisPtQA, axisDCAz}); histos.add("QAafter/Kaon/hDcaXY", "dca_{xy} Kaons", kTH2F, {axisPtQA, axisDCAxy}); - histos.add("QAafter/Kaon/hTPCNsigma", "n#sigma^{TPC} only Kaons", kTH2F, {axisPtQA, axisTPCNsigma}); - histos.add("QAafter/Kaon/hTPCNsigmaTOF", "n#sigma^{TPC} Kaons", kTH2F, {axisPtQA, axisTPCNsigma}); - histos.add("QAafter/Kaon/hTOFNsigma", "n#sigma^{TOF} Kaons", kTH2F, {axisPtQA, axisTOFNsigma}); - histos.add("QAafter/Kaon/hTpcTofNsigma", "n#sigma^{TPC} vs n#sigma^{TOF} Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); + histos.add("QAafter/Kaon/hTPCNsigmaFull", "n#sigma(TPC) Kaons", kTH2F, {axisPtQA, axisTPCNsigma}); + histos.add("QAafter/Kaon/hTPCNsigma", "n#sigma(TPC) Kaons", kTH2F, {axisPtQA, axisTPCNsigma}); + histos.add("QAafter/Kaon/hTPCNsigmaTOF", "n#sigma(TPC) Kaons", kTH2F, {axisPtQA, axisTPCNsigma}); + histos.add("QAafter/Kaon/hTOFNsigma", "n#sigma(TOF) Kaons", kTH2F, {axisPtQA, axisTOFNsigma}); + histos.add("QAafter/Kaon/hTpcTofNsigma", "n#sigma(TOF) vs n#sigma(TPC) Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); // Analysis // Lambda Invariant Mass @@ -134,11 +137,13 @@ struct lambdaAnalysis { histos.add("Analysis/hInvMassLS2", "Like Signs M_{inv} #bar{p} K^{-}", kTH1D, {axisInvM}); histos.add("Analysis/hInvMassR", "Rotated Spectra", kTH1D, {axisInvM}); histos.add("Analysis/hInvMassMix", "Mixed Events M_{inv}", kTH1D, {axisInvM}); + histos.add("Analysis/hInvMassMixLS", "Mixed Events M_{inv}", kTH1D, {axisInvM}); histos.add("Analysis/h4InvMass", "THn #Lambda(1520)", kTHnSparseD, {axisInvM, axisPt, axisSp, axisCent}); histos.add("Analysis/h4InvMassLS1", "THn Like Signs p K^{+}", kTHnSparseD, {axisInvM, axisPt, axisSp, axisCent}); histos.add("Analysis/h4InvMassLS2", "THn Like Signs #bar{p} K^{-}", kTHnSparseD, {axisInvM, axisPt, axisSp, axisCent}); histos.add("Analysis/h4InvMassR", "THn Rotated", kTHnSparseD, {axisInvM, axisPt, axisSp, axisCent}); histos.add("Analysis/h4InvMassMix", "THn Mixed Events", kTHnSparseD, {axisInvM, axisPt, axisSp, axisCent}); + histos.add("Analysis/h4InvMassMixLS", "THn Mixed Events", kTHnSparseD, {axisInvM, axisPt, axisSp, axisCent}); // MC if (doprocessMC) { @@ -192,7 +197,7 @@ struct lambdaAnalysis { auto tpcPIDcut = static_cast>(protonTPCPIDcut); int nitr = static_cast(tpcPIDpt.size()); - if (candidate.hasTOF()) { + if (!cUseTpcOnly && candidate.hasTOF()) { if (std::abs(candidate.tofNSigmaPr()) < cMaxTOFnSigmaProton) { tofPIDPassed = true; } @@ -207,12 +212,18 @@ struct lambdaAnalysis { } } else { tofPIDPassed = true; - for (int i = 0; i < nitr - 1; ++i) { - if (candidate.pt() >= tpcPIDpt[i] && candidate.pt() < tpcPIDpt[i + 1] && std::abs(candidate.tpcNSigmaPr()) < tpcPIDcut[i]) { + if (cUseTpcOnly) { + if (std::abs(candidate.tpcNSigmaPr()) < cMaxTPCnSigmaProton) { tpcPIDPassed = true; } - if (!cUseTpcAndTof && candidate.pt() >= tpcPIDpt[nitr - 1] && std::abs(candidate.tpcNSigmaPr()) < tpcPIDcut[nitr - 2]) { - tpcPIDPassed = true; + } else { + for (int i = 0; i < nitr - 1; ++i) { + if (candidate.pt() >= tpcPIDpt[i] && candidate.pt() < tpcPIDpt[i + 1] && std::abs(candidate.tpcNSigmaPr()) < tpcPIDcut[i]) { + tpcPIDPassed = true; + } + if (!cUseTpcAndTof && candidate.pt() >= tpcPIDpt[nitr - 1] && std::abs(candidate.tpcNSigmaPr()) < tpcPIDcut[nitr - 2]) { + tpcPIDPassed = true; + } } } } @@ -229,7 +240,7 @@ struct lambdaAnalysis { auto tpcPIDcut = static_cast>(kaonTPCPIDcut); int nitr = static_cast(tpcPIDpt.size()); - if (candidate.hasTOF()) { + if (!cUseTpcOnly && candidate.hasTOF()) { if (std::abs(candidate.tofNSigmaKa()) < cMaxTOFnSigmaKaon) { tofPIDPassed = true; } @@ -244,12 +255,18 @@ struct lambdaAnalysis { } } else { tofPIDPassed = true; - for (int i = 0; i < nitr - 1; ++i) { - if (candidate.pt() >= tpcPIDpt[i] && candidate.pt() < tpcPIDpt[i + 1] && std::abs(candidate.tpcNSigmaKa()) < tpcPIDcut[i]) { + if (cUseTpcOnly) { + if (std::abs(candidate.tpcNSigmaKa()) < cMaxTPCnSigmaKaon) { tpcPIDPassed = true; } - if (!cUseTpcAndTof && candidate.pt() >= tpcPIDpt[nitr - 1] && std::abs(candidate.tpcNSigmaKa()) < tpcPIDcut[nitr - 2]) { - tpcPIDPassed = true; + } else { + for (int i = 0; i < nitr - 1; ++i) { + if (candidate.pt() >= tpcPIDpt[i] && candidate.pt() < tpcPIDpt[i + 1] && std::abs(candidate.tpcNSigmaKa()) < tpcPIDcut[i]) { + tpcPIDPassed = true; + } + if (!cUseTpcAndTof && candidate.pt() >= tpcPIDpt[nitr - 1] && std::abs(candidate.tpcNSigmaKa()) < tpcPIDcut[nitr - 2]) { + tpcPIDPassed = true; + } } } } @@ -308,7 +325,8 @@ struct lambdaAnalysis { histos.fill(HIST("QAafter/Proton/hPt"), trkPr.pt()); histos.fill(HIST("QAafter/Proton/hDcaZ"), trkPr.pt(), trkPr.dcaZ()); histos.fill(HIST("QAafter/Proton/hDcaXY"), trkPr.pt(), trkPr.dcaXY()); - if (trkPr.hasTOF()) { + histos.fill(HIST("QAafter/Proton/hTPCNsigmaFull"), trkPr.pt(), trkPr.tpcNSigmaPr()); + if (!cUseTpcOnly && trkPr.hasTOF()) { histos.fill(HIST("QAafter/Proton/hTPCNsigmaTOF"), trkPr.pt(), trkPr.tpcNSigmaPr()); histos.fill(HIST("QAafter/Proton/hTOFNsigma"), trkPr.pt(), trkPr.tofNSigmaPr()); histos.fill(HIST("QAafter/Proton/hTpcTofNsigma"), trkPr.tpcNSigmaPr(), trkPr.tofNSigmaPr()); @@ -318,7 +336,8 @@ struct lambdaAnalysis { histos.fill(HIST("QAafter/Kaon/hPt"), trkKa.pt()); histos.fill(HIST("QAafter/Kaon/hDcaZ"), trkKa.pt(), trkKa.dcaZ()); histos.fill(HIST("QAafter/Kaon/hDcaXY"), trkKa.pt(), trkKa.dcaXY()); - if (trkKa.hasTOF()) { + histos.fill(HIST("QAafter/Kaon/hTPCNsigmaFull"), trkKa.pt(), trkKa.tpcNSigmaKa()); + if (!cUseTpcOnly && trkKa.hasTOF()) { histos.fill(HIST("QAafter/Kaon/hTPCNsigmaTOF"), trkKa.pt(), trkKa.tpcNSigmaKa()); histos.fill(HIST("QAafter/Kaon/hTOFNsigma"), trkKa.pt(), trkKa.tofNSigmaKa()); histos.fill(HIST("QAafter/Kaon/hTpcTofNsigma"), trkKa.tpcNSigmaKa(), trkKa.tofNSigmaKa()); @@ -401,6 +420,9 @@ struct lambdaAnalysis { if (trkPr.sign() * trkKa.sign() < 0) { histos.fill(HIST("Analysis/hInvMassMix"), p.M()); histos.fill(HIST("Analysis/h4InvMassMix"), p.M(), p.Pt(), sph, mult); + } else { + histos.fill(HIST("Analysis/hInvMassMixLS"), p.M()); + histos.fill(HIST("Analysis/h4InvMassMixLS"), p.M(), p.Pt(), sph, mult); } } } diff --git a/PWGLF/Tasks/nuclei_in_jets.cxx b/PWGLF/Tasks/nuclei_in_jets.cxx index 820f95c6b5f..1608c60c32c 100644 --- a/PWGLF/Tasks/nuclei_in_jets.cxx +++ b/PWGLF/Tasks/nuclei_in_jets.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -88,29 +89,44 @@ struct nuclei_in_jets { Configurable max_chi2_TPC{"max_chi2_TPC", 4.0f, "maximum TPC chi^2/Ncls"}; Configurable max_chi2_ITS{"max_chi2_ITS", 36.0f, "maximum ITS chi^2/Ncls"}; Configurable min_pt{"min_pt", 0.2f, "minimum pt of the tracks"}; - Configurable min_eta{"min_eta", -0.8f, "minimum_eta"}; - Configurable max_eta{"max_eta", +0.8f, "maximum_eta"}; + Configurable min_eta{"min_eta", -0.8f, "minimum eta"}; + Configurable max_eta{"max_eta", +0.8f, "maximum eta"}; + Configurable min_y{"min_y", -0.5f, "minimum y"}; + Configurable max_y{"max_y", +0.5f, "maximum y"}; Configurable max_dcaxy{"max_dcaxy", 0.1f, "Maximum DCAxy"}; Configurable max_dcaz{"max_dcaz", 0.1f, "Maximum DCAz"}; Configurable min_nsigmaTPC{"min_nsigmaTPC", -3.0f, "Minimum nsigma TPC"}; Configurable max_nsigmaTPC{"max_nsigmaTPC", +3.0f, "Maximum nsigma TPC"}; + Configurable min_nsigmaTOF{"min_nsigmaTOF", -3.0f, "Minimum nsigma TOF"}; + Configurable max_nsigmaTOF{"max_nsigmaTOF", +3.5f, "Maximum nsigma TOF"}; Configurable require_primVtx_contributor{"require_primVtx_contributor", true, "require that the track is a PV contributor"}; + Configurable> param_proton_jet{"param_proton_jet", {0.93827208816, 0.18, 0.5, 1}, "Parameters for reweighting protons in jets"}; + Configurable> param_deuteron_jet{"param_deuteron_jet", {1.87561294257, 0.18, 0.5, 1}, "Parameters for reweighting deuterons in jets"}; + Configurable> param_helium3_jet{"param_helium3_jet", {2.80839160743, 0.18, 0.5, 1}, "Parameters for reweighting helium3 in jets"}; + Configurable> param_proton_ue{"param_proton_ue", {0.93827208816, 0.18, 0.5, 1}, "Parameters for reweighting protons in ue"}; + Configurable> param_deuteron_ue{"param_deuteron_ue", {1.87561294257, 0.18, 0.5, 1}, "Parameters for reweighting deuterons in ue"}; + Configurable> param_helium3_ue{"param_helium3_ue", {2.80839160743, 0.18, 0.5, 1}, "Parameters for reweighting helium3 in ue"}; // List of Particles - enum particle { proton, - deuteron, - helium }; + enum nucleus { proton, + deuteron, + helium }; + + enum region { jet, + underlying_event }; void init(InitContext const&) { // Global Properties and QC - registryQC.add("number_of_events_data", "number of events in data", HistType::kTH1F, {{5, 0, 5, "1 = all events, 2 = selected events, 3 = events with pt>pt_threshold, 4 = events with pt>pt_threshold and particle of interest"}}); - registryQC.add("jet_plus_ue_multiplicity", "jet + underlying-event multiplicity", HistType::kTH1F, {{300, 0, 300, "#it{N}_{ch}"}}); - registryQC.add("jet_multiplicity", "jet multiplicity", HistType::kTH1F, {{300, 0, 300, "#it{N}_{ch}"}}); - registryQC.add("ue_multiplicity", "underlying-event multiplicity", HistType::kTH1F, {{300, 0, 300, "#it{N}_{ch}"}}); + registryQC.add("number_of_events_data", "number of events in data", HistType::kTH1F, {{10, 0, 10, "counter"}}); + registryQC.add("number_of_events_mc", "number of events in mc", HistType::kTH1F, {{10, 0, 10, "counter"}}); + registryQC.add("jet_plus_ue_multiplicity", "jet + underlying-event multiplicity", HistType::kTH1F, {{100, 0, 100, "#it{N}_{ch}"}}); + registryQC.add("jet_multiplicity", "jet multiplicity", HistType::kTH1F, {{100, 0, 100, "#it{N}_{ch}"}}); + registryQC.add("ue_multiplicity", "underlying-event multiplicity", HistType::kTH1F, {{100, 0, 100, "#it{N}_{ch}"}}); registryQC.add("pt_leading", "pt leading", HistType::kTH1F, {{500, 0, 50, "#it{p}_{T} (GeV/#it{c})"}}); registryQC.add("eta_phi_jet", "DeltaEta DeltaPhi jet", HistType::kTH2F, {{500, -0.5, 0.5, "#Delta#eta"}, {500, 0.0, TMath::Pi(), "#Delta#phi"}}); registryQC.add("eta_phi_ue", "DeltaEta DeltaPhi UE", HistType::kTH2F, {{500, -0.5, 0.5, "#Delta#eta"}, {500, 0.0, TMath::Pi(), "#Delta#phi"}}); + registryQC.add("r_max_jet", "R Max jet", HistType::kTH1F, {{400, 0.0, 0.8, "#it{R}_{max}"}}); registryQC.add("r_jet", "R jet", HistType::kTH1F, {{400, 0.0, 0.8, "#it{R}"}}); registryQC.add("r_ue", "R ue", HistType::kTH1F, {{400, 0.0, 0.8, "#it{R}"}}); @@ -129,6 +145,33 @@ struct nuclei_in_jets { // Antihelium-3 registryData.add("antihelium3_jet_tpc", "antihelium3_jet_tpc", HistType::kTH3F, {{40, 1.0, 7.0, "#it{p}_{T} (GeV/#it{c})"}, {200, -10.0, 10.0, "n#sigma_{TPC}"}, {10, 0, 100, "#it{N}_{ch}"}}); registryData.add("antihelium3_ue_tpc", "antihelium3_ue_tpc", HistType::kTH3F, {{40, 1.0, 7.0, "#it{p}_{T} (GeV/#it{c})"}, {200, -10.0, 10.0, "n#sigma_{TPC}"}, {10, 0, 100, "#it{N}_{ch}"}}); + + // Input Antiproton Distribution + registryMC.add("antiproton_input", "antiproton_input", HistType::kTH1F, {{1000, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antiproton_weighted_jet", "antiproton_weighted_jet", HistType::kTH1F, {{1000, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antiproton_weighted_ue", "antiproton_weighted_ue", HistType::kTH1F, {{1000, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"}}); + + // Generated + registryMC.add("antiproton_jet_gen", "antiproton_jet_gen", HistType::kTH1F, {{100, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antideuteron_jet_gen", "antideuteron_jet_gen", HistType::kTH1F, {{50, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antihelium3_jet_gen", "antihelium3_jet_gen", HistType::kTH1F, {{40, 1.0, 7.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antiproton_ue_gen", "antiproton_ue_gen", HistType::kTH1F, {{100, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antideuteron_ue_gen", "antideuteron_ue_gen", HistType::kTH1F, {{50, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antihelium3_ue_gen", "antihelium3_ue_gen", HistType::kTH1F, {{40, 1.0, 7.0, "#it{p}_{T} (GeV/#it{c})"}}); + + // Reconstructed TPC + registryMC.add("antiproton_jet_rec_tpc", "antiproton_jet_rec_tpc", HistType::kTH1F, {{100, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antideuteron_jet_rec_tpc", "antideuteron_jet_rec_tpc", HistType::kTH1F, {{50, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antihelium3_jet_rec_tpc", "antihelium3_jet_rec_tpc", HistType::kTH1F, {{40, 1.0, 7.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antiproton_ue_rec_tpc", "antiproton_ue_rec_tpc", HistType::kTH1F, {{100, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antideuteron_ue_rec_tpc", "antideuteron_ue_rec_tpc", HistType::kTH1F, {{50, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antihelium3_ue_rec_tpc", "antihelium3_ue_rec_tpc", HistType::kTH1F, {{40, 1.0, 7.0, "#it{p}_{T} (GeV/#it{c})"}}); + + // Reconstructed TOF + registryMC.add("antiproton_jet_rec_tof", "antiproton_jet_rec_tof", HistType::kTH1F, {{100, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antideuteron_jet_rec_tof", "antideuteron_jet_rec_tof", HistType::kTH1F, {{50, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antiproton_ue_rec_tof", "antiproton_ue_rec_tof", HistType::kTH1F, {{100, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); + registryMC.add("antideuteron_ue_rec_tof", "antideuteron_ue_rec_tof", HistType::kTH1F, {{50, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}}); } // Single-Track Selection for the Particle of Interest @@ -158,6 +201,20 @@ struct nuclei_in_jets { if (TMath::Abs(track.dcaZ()) > max_dcaz) return false; + // Rapidity Cut + double mass(0); + if (particle_of_interest == nucleus::proton) + mass = 0.93827208816; // Proton + if (particle_of_interest == nucleus::deuteron) + mass = 1.87561294257; // Deuteron + if (particle_of_interest == nucleus::helium) + mass = 2.80839160743; // Helium-3 + + TLorentzVector lorentzVect; + lorentzVect.SetXYZM(track.px(), track.py(), track.pz(), mass); + if (lorentzVect.Rapidity() < min_y || lorentzVect.Rapidity() > max_y) + return false; + return true; } @@ -207,7 +264,7 @@ struct nuclei_in_jets { return false; // Proton ID - if (particle_of_interest == particle::proton) { + if (particle_of_interest == nucleus::proton) { if (pt < 1.0 && TMath::Abs(nsigmaTPCPr) < 8.0) return true; if (pt >= 1.0 && nsigmaTPCPr > min_nsigmaTPC && nsigmaTPCPr < max_nsigmaTPC && track.hasTOF() && TMath::Abs(nsigmaTOFPr) < 10.0) @@ -216,7 +273,7 @@ struct nuclei_in_jets { } // Deuteron ID - if (particle_of_interest == particle::deuteron) { + if (particle_of_interest == nucleus::deuteron) { if (pt < 1.0 && TMath::Abs(nsigmaTPCDe) < 8.0) return true; if (pt >= 1.0 && nsigmaTPCDe > min_nsigmaTPC && nsigmaTPCDe < max_nsigmaTPC && track.hasTOF() && TMath::Abs(nsigmaTOFDe) < 10.0) @@ -225,7 +282,7 @@ struct nuclei_in_jets { } // Helium-3 ID - if (particle_of_interest == particle::helium) { + if (particle_of_interest == nucleus::helium) { if ((0.5 * pt) >= 1.0 && TMath::Abs(nsigmaTPCHe) < 8.0) return true; return false; @@ -246,17 +303,67 @@ struct nuclei_in_jets { return x_min; } + float Weight(float pt, int event_region, int nucleus_of_interest) + { + + auto par_proton_jet = static_cast>(param_proton_jet); + auto par_deuteron_jet = static_cast>(param_deuteron_jet); + auto par_helium3_jet = static_cast>(param_helium3_jet); + auto par_proton_ue = static_cast>(param_proton_ue); + auto par_deuteron_ue = static_cast>(param_deuteron_ue); + auto par_helium3_ue = static_cast>(param_helium3_ue); + + float dNdpt_proton_jet = GetTsallis(par_proton_jet[0], par_proton_jet[1], par_proton_jet[2], par_proton_jet[3], pt); + float dNdpt_proton_ue = GetTsallis(par_proton_ue[0], par_proton_ue[1], par_proton_ue[2], par_proton_ue[3], pt); + float dNdpt_deuteron_jet = GetTsallis(par_deuteron_jet[0], par_deuteron_jet[1], par_deuteron_jet[2], par_deuteron_jet[3], pt); + float dNdpt_deuteron_ue = GetTsallis(par_deuteron_ue[0], par_deuteron_ue[1], par_deuteron_ue[2], par_deuteron_ue[3], pt); + float dNdpt_helium3_jet = GetTsallis(par_helium3_jet[0], par_helium3_jet[1], par_helium3_jet[2], par_helium3_jet[3], pt); + float dNdpt_helium3_ue = GetTsallis(par_helium3_ue[0], par_helium3_ue[1], par_helium3_ue[2], par_helium3_ue[3], pt); + + if (nucleus_of_interest == nucleus::proton && event_region == region::jet) + return dNdpt_proton_jet; + if (nucleus_of_interest == nucleus::proton && event_region == region::underlying_event) + return dNdpt_proton_ue; + if (nucleus_of_interest == nucleus::deuteron && event_region == region::jet) + return dNdpt_deuteron_jet; + if (nucleus_of_interest == nucleus::deuteron && event_region == region::underlying_event) + return dNdpt_deuteron_ue; + if (nucleus_of_interest == nucleus::helium && event_region == region::jet) + return dNdpt_helium3_jet; + if (nucleus_of_interest == nucleus::helium && event_region == region::underlying_event) + return dNdpt_helium3_ue; + + return 1; + } + + float GetTsallis(float mass, float temp, float q, float norm, float pt) + { + + float p0 = norm; + float p1 = 1.0 / (q - 1.0); + float p2 = temp; + float p3 = mass; + + float dNdpt = (pt * p0 * (p1 - 1.0) * (p1 - 2.0)) / (p1 * p2 * (p1 * p2 + p3 * (p1 - 2.0))) * TMath::Power((1.0 + (TMath::Sqrt(p3 * p3 + pt * pt) - p3) / (p1 * p2)), -p1); + + return dNdpt; + } + // Process Data void processData(SelectedCollisions::iterator const& collision, FullTracks const& tracks) { - // Event Counter (before event selection) + + // Seed + gRandom->SetSeed(0); + + // Event Counter: before event selection registryQC.fill(HIST("number_of_events_data"), 0.5); // Event Selection if (!collision.sel8()) return; - // Event Counter (after event selection) + // Event Counter: after event selection registryQC.fill(HIST("number_of_events_data"), 1.5); // Reduced Event @@ -296,9 +403,10 @@ struct nuclei_in_jets { particle_ID.push_back(i); } - // Skip Events with no trigger Particle + // Event Counter: Skip Events with no trigger Particle (pmax=0) if (pt_max == 0) return; + registryQC.fill(HIST("number_of_events_data"), 2.5); // Histogram with pt_leading registryQC.fill(HIST("pt_leading"), pt_max); @@ -306,29 +414,25 @@ struct nuclei_in_jets { // Number of Stored Particles int nParticles = static_cast(particle_ID.size()); - // Selection of Events with pt > pt_leading - if (nParticles < 2) + // Event Counter: Skip Events with less than 2 Particles + if (nParticles < 3) return; + registryQC.fill(HIST("number_of_events_data"), 3.5); + + // Event Counter: Skip Events with pt pt_max selection) - registryQC.fill(HIST("number_of_events_data"), 2.5); - - // Skip Events with no Particle of Interest + // Event Counter: Skip Events with no Particle of Interest if (!containsParticleOfInterest) return; - - // Event Counter (events with pt > pt_max that contain particle of interest) - registryQC.fill(HIST("number_of_events_data"), 3.5); + registryQC.fill(HIST("number_of_events_data"), 5.5); // Momentum of the Leading Particle auto const& leading_track = tracks.iteratorAt(leading_ID); TVector3 p_leading(leading_track.px(), leading_track.py(), leading_track.pz()); - // Instruction to be removed - registryQC.fill(HIST("number_of_events_data"), 4.5); - // Array of Particles inside Jet std::vector jet_particle_ID; jet_particle_ID.push_back(leading_ID); @@ -405,16 +509,53 @@ struct nuclei_in_jets { // Multiplicity inside Jet + UE int nParticlesJetUE = static_cast(jet_particle_ID.size()); + // Event Counter: Skip Events with only 1 Particle inside jet cone + if (nParticlesJetUE < 2) + return; + registryQC.fill(HIST("number_of_events_data"), 6.5); + + // Find Maximum Distance from Jet Axis + float Rmax(0); + + for (int i = 0; i < nParticlesJetUE; i++) { + + const auto& jet_track = tracks.iteratorAt(jet_particle_ID[i]); + TVector3 p_i(jet_track.px(), jet_track.py(), jet_track.pz()); + + float deltaEta = p_i.Eta() - p_leading.Eta(); + float deltaPhi = TVector2::Phi_0_2pi(p_i.Phi() - p_leading.Phi()); + float R = TMath::Sqrt(deltaEta * deltaEta + deltaPhi * deltaPhi); + if (R > Rmax) + Rmax = R; + } + + // Event Counter: Skip Events with Rmax=0 + if (Rmax == 0) + return; + registryQC.fill(HIST("number_of_events_data"), 7.5); + + registryQC.fill(HIST("r_max_jet"), Rmax); + + // Event Counter: Skip Events with jet not fully inside acceptance + float eta_jet_axis = p_leading.Eta(); + if ((TMath::Abs(eta_jet_axis) + Rmax) > max_eta) + return; + registryQC.fill(HIST("number_of_events_data"), 8.5); + // Fill Jet Multiplicity - registryQC.fill(HIST("jet_plus_ue_multiplicity"), static_cast(jet_particle_ID.size())); + registryQC.fill(HIST("jet_plus_ue_multiplicity"), nParticlesJetUE); // Perpendicular Cones for UE Estimate - TVector3 z_positive(0.0, 0.0, 1.0); - TVector3 z_negative(0.0, 0.0, -1.0); - TVector3 v1 = (z_positive.Cross(p_leading)).Unit(); - TVector3 v2 = (z_negative.Cross(p_leading)).Unit(); - TVector3 v3 = (p_leading.Cross(v1)).Unit(); - TVector3 v4 = (p_leading.Cross(v2)).Unit(); + TVector3 z(0.0, 0.0, p_leading.Mag()); + TVector3 ue_axis = z.Cross(p_leading); + + double dEta(200); + do { + double angle = gRandom->Uniform(0.0, TMath::TwoPi()); + ue_axis.Rotate(angle, p_leading); + double eta_ue_axis = ue_axis.Eta(); + dEta = (TMath::Abs(eta_ue_axis) + Rmax); + } while (dEta > max_eta); // Store UE std::vector ue_particle_ID; @@ -429,43 +570,24 @@ struct nuclei_in_jets { const auto& ue_track = tracks.iteratorAt(particle_ID[i]); // Variables - float deltaEta1 = ue_track.eta() - v1.Eta(); - float deltaEta2 = ue_track.eta() - v2.Eta(); - float deltaEta3 = ue_track.eta() - v3.Eta(); - float deltaEta4 = ue_track.eta() - v4.Eta(); - - float deltaPhi1 = TVector2::Phi_0_2pi(ue_track.phi() - v1.Phi()); - float deltaPhi2 = TVector2::Phi_0_2pi(ue_track.phi() - v2.Phi()); - float deltaPhi3 = TVector2::Phi_0_2pi(ue_track.phi() - v3.Phi()); - float deltaPhi4 = TVector2::Phi_0_2pi(ue_track.phi() - v4.Phi()); - - float dr1 = TMath::Sqrt(deltaEta1 * deltaEta1 + deltaPhi1 * deltaPhi1); - float dr2 = TMath::Sqrt(deltaEta2 * deltaEta2 + deltaPhi2 * deltaPhi2); - float dr3 = TMath::Sqrt(deltaEta3 * deltaEta3 + deltaPhi3 * deltaPhi3); - float dr4 = TMath::Sqrt(deltaEta4 * deltaEta4 + deltaPhi4 * deltaPhi4); - - registryQC.fill(HIST("eta_phi_ue"), deltaEta1, deltaPhi1); - registryQC.fill(HIST("eta_phi_ue"), deltaEta2, deltaPhi2); - registryQC.fill(HIST("eta_phi_ue"), deltaEta3, deltaPhi3); - registryQC.fill(HIST("eta_phi_ue"), deltaEta4, deltaPhi4); - registryQC.fill(HIST("r_ue"), TMath::Sqrt(deltaEta1 * deltaEta1 + deltaPhi1 * deltaPhi1)); - registryQC.fill(HIST("r_ue"), TMath::Sqrt(deltaEta2 * deltaEta2 + deltaPhi2 * deltaPhi2)); - registryQC.fill(HIST("r_ue"), TMath::Sqrt(deltaEta3 * deltaEta3 + deltaPhi3 * deltaPhi3)); - registryQC.fill(HIST("r_ue"), TMath::Sqrt(deltaEta4 * deltaEta4 + deltaPhi4 * deltaPhi4)); + float deltaEta = ue_track.eta() - ue_axis.Eta(); + float deltaPhi = TVector2::Phi_0_2pi(ue_track.phi() - ue_axis.Phi()); + float dr = TMath::Sqrt(deltaEta * deltaEta + deltaPhi * deltaPhi); // Store Particles in the UE - if (dr1 < max_jet_radius || dr2 < max_jet_radius || dr3 < max_jet_radius || dr4 < max_jet_radius) { + if (dr < Rmax) { + registryQC.fill(HIST("eta_phi_ue"), deltaEta, deltaPhi); + registryQC.fill(HIST("r_ue"), dr); ue_particle_ID.push_back(particle_ID[i]); } } // UE Multiplicity int nParticlesUE = static_cast(ue_particle_ID.size()); - - registryQC.fill(HIST("ue_multiplicity"), static_cast(ue_particle_ID.size()) / 4.0); + registryQC.fill(HIST("ue_multiplicity"), nParticlesUE); // Jet Multiplicity - float jet_Nch = static_cast(jet_particle_ID.size()) - static_cast(ue_particle_ID.size()) / 4.0; + int jet_Nch = nParticlesJetUE - nParticlesUE; registryQC.fill(HIST("jet_multiplicity"), jet_Nch); // Loop over particles inside Jet @@ -476,8 +598,10 @@ struct nuclei_in_jets { float deltaEta = p_i.Eta() - p_leading.Eta(); float deltaPhi = TVector2::Phi_0_2pi(p_i.Phi() - p_leading.Phi()); - registryQC.fill(HIST("eta_phi_jet"), deltaEta, deltaPhi); - registryQC.fill(HIST("r_jet"), TMath::Sqrt(deltaEta * deltaEta + deltaPhi * deltaPhi)); + if (deltaEta != 0 && deltaPhi != 0) { + registryQC.fill(HIST("eta_phi_jet"), deltaEta, deltaPhi); + registryQC.fill(HIST("r_jet"), TMath::Sqrt(deltaEta * deltaEta + deltaPhi * deltaPhi)); + } // Track Selection if (!passedTrackSelection(jet_track)) @@ -494,7 +618,7 @@ struct nuclei_in_jets { float pt = jet_track.pt(); // Antiproton - if (particle_of_interest == particle::proton) { + if (particle_of_interest == nucleus::proton) { if (pt < 1.0) registryData.fill(HIST("antiproton_jet_tpc"), pt, nsigmaTPCPr, jet_Nch); if (pt >= 1.0 && nsigmaTPCPr > min_nsigmaTPC && nsigmaTPCPr < max_nsigmaTPC && jet_track.hasTOF()) @@ -502,7 +626,7 @@ struct nuclei_in_jets { } // Antideuteron - if (particle_of_interest == particle::deuteron) { + if (particle_of_interest == nucleus::deuteron) { if (pt < 1.0) registryData.fill(HIST("antideuteron_jet_tpc"), pt, nsigmaTPCDe, jet_Nch); if (pt >= 1.0 && nsigmaTPCDe > min_nsigmaTPC && nsigmaTPCDe < max_nsigmaTPC && jet_track.hasTOF()) @@ -510,7 +634,7 @@ struct nuclei_in_jets { } // Antihelium3 - if (particle_of_interest == particle::helium) { + if (particle_of_interest == nucleus::helium) { registryData.fill(HIST("antihelium3_jet_tpc"), 2.0 * pt, nsigmaTPCHe, jet_Nch); } } @@ -535,7 +659,7 @@ struct nuclei_in_jets { float pt = ue_track.pt(); // Antiproton - if (particle_of_interest == particle::proton) { + if (particle_of_interest == nucleus::proton) { if (pt < 1.0) registryData.fill(HIST("antiproton_ue_tpc"), pt, nsigmaTPCPr, jet_Nch); if (pt >= 1.0 && nsigmaTPCPr > min_nsigmaTPC && nsigmaTPCPr < max_nsigmaTPC && ue_track.hasTOF()) @@ -543,7 +667,7 @@ struct nuclei_in_jets { } // Antideuteron - if (particle_of_interest == particle::deuteron) { + if (particle_of_interest == nucleus::deuteron) { if (pt < 1.0) registryData.fill(HIST("antideuteron_ue_tpc"), pt, nsigmaTPCDe, jet_Nch); if (pt >= 1.0 && nsigmaTPCDe > min_nsigmaTPC && nsigmaTPCDe < max_nsigmaTPC && ue_track.hasTOF()) @@ -551,13 +675,136 @@ struct nuclei_in_jets { } // Antihelium3 - if (particle_of_interest == particle::helium) { + if (particle_of_interest == nucleus::helium) { registryData.fill(HIST("antihelium3_ue_tpc"), 2.0 * pt, nsigmaTPCHe, jet_Nch); } } } // end processData PROCESS_SWITCH(nuclei_in_jets, processData, "Process data", true); + + // MC + void processMC(soa::Join::iterator const& collision, MCTracks const& mcTracks, aod::McParticles& mcParticles, aod::McCollisions const& mcCollisions) + { + + // Event Counter (before event sel) + registryQC.fill(HIST("number_of_events_mc"), 0.5); + + // Event Selection + if (!collision.sel8()) + return; + + // Event Counter (after event sel) + registryQC.fill(HIST("number_of_events_mc"), 1.5); + + for (auto& particle : mcParticles) { + + if (!particle.isPhysicalPrimary()) + continue; + if ((particle.pdgCode() != -2212) && (particle.pdgCode() != -1000010020) && (particle.pdgCode() != -1000020030)) + continue; + if (particle.y() < min_y || particle.y() > max_y) + continue; + + // Reweighting + float wpr_jet = Weight(particle.pt(), region::jet, nucleus::proton); + float wpr_ue = Weight(particle.pt(), region::underlying_event, nucleus::proton); + float wde_jet = Weight(particle.pt(), region::jet, nucleus::deuteron); + float wde_ue = Weight(particle.pt(), region::underlying_event, nucleus::deuteron); + float whe_jet = Weight(particle.pt(), region::jet, nucleus::helium); + float whe_ue = Weight(particle.pt(), region::underlying_event, nucleus::helium); + + // Fill Histograms + if (particle.pdgCode() == -2212) { + registryMC.fill(HIST("antiproton_input"), particle.pt()); + registryMC.fill(HIST("antiproton_weighted_jet"), particle.pt(), wpr_jet); + registryMC.fill(HIST("antiproton_weighted_ue"), particle.pt(), wpr_ue); + registryMC.fill(HIST("antiproton_jet_gen"), particle.pt(), wpr_jet); + registryMC.fill(HIST("antiproton_ue_gen"), particle.pt(), wpr_ue); + } + if (particle.pdgCode() == -1000010020) { + registryMC.fill(HIST("antideuteron_jet_gen"), particle.pt(), wde_jet); + registryMC.fill(HIST("antideuteron_ue_gen"), particle.pt(), wde_ue); + } + if (particle.pdgCode() == -1000020030) { + registryMC.fill(HIST("antihelium3_jet_gen"), particle.pt(), whe_jet); + registryMC.fill(HIST("antihelium3_ue_gen"), particle.pt(), whe_ue); + } + } + + for (auto track : mcTracks) { + + // Get MC Particle + if (!track.has_mcParticle()) + continue; + + const auto particle = track.mcParticle(); + if (!particle.isPhysicalPrimary()) + continue; + if ((particle.pdgCode() != -2212) && (particle.pdgCode() != -1000010020) && (particle.pdgCode() != -1000020030)) + continue; + + if (!track.passedITSRefit()) + continue; + if (!track.passedTPCRefit()) + continue; + + // Track Selection + if (!passedTrackSelection(track)) + continue; + if (require_primVtx_contributor && !(track.isPVContributor())) + continue; + + // Reweighting + float wpr_jet = Weight(particle.pt(), region::jet, nucleus::proton); + float wpr_ue = Weight(particle.pt(), region::underlying_event, nucleus::proton); + float wde_jet = Weight(particle.pt(), region::jet, nucleus::deuteron); + float wde_ue = Weight(particle.pt(), region::underlying_event, nucleus::deuteron); + float whe_jet = Weight(particle.pt(), region::jet, nucleus::helium); + float whe_ue = Weight(particle.pt(), region::underlying_event, nucleus::helium); + + // Variables + float nsigmaTPCPr = track.tpcNSigmaPr(); + float nsigmaTOFPr = track.tofNSigmaPr(); + float nsigmaTPCDe = track.tpcNSigmaDe(); + float nsigmaTOFDe = track.tofNSigmaDe(); + float nsigmaTPCHe = track.tpcNSigmaHe(); + float pt = track.pt(); + + // Antiproton + if (particle.pdgCode() != -2212) { + if (pt < 1.0 && nsigmaTPCPr > min_nsigmaTPC && nsigmaTPCPr < max_nsigmaTPC) { + registryMC.fill(HIST("antiproton_jet_rec_tpc"), pt, wpr_jet); + registryMC.fill(HIST("antiproton_ue_rec_tpc"), pt, wpr_ue); + } + if (pt >= 1.0 && nsigmaTPCPr > min_nsigmaTPC && nsigmaTPCPr < max_nsigmaTPC && track.hasTOF() && nsigmaTOFPr > min_nsigmaTOF && nsigmaTOFPr < max_nsigmaTOF) { + registryMC.fill(HIST("antiproton_jet_rec_tof"), pt, wpr_jet); + registryMC.fill(HIST("antiproton_ue_rec_tof"), pt, wpr_ue); + } + } + + // Antideuteron + if (particle.pdgCode() != -1000010020) { + if (pt < 1.0 && nsigmaTPCDe > min_nsigmaTPC && nsigmaTPCDe < max_nsigmaTPC) { + registryMC.fill(HIST("antideuteron_jet_rec_tpc"), pt, wde_jet); + registryMC.fill(HIST("antideuteron_ue_rec_tpc"), pt, wde_ue); + } + if (pt >= 1.0 && nsigmaTPCDe > min_nsigmaTPC && nsigmaTPCDe < max_nsigmaTPC && track.hasTOF() && nsigmaTOFDe > min_nsigmaTOF && nsigmaTOFDe < max_nsigmaTOF) { + registryMC.fill(HIST("antideuteron_jet_rec_tof"), pt, wde_jet); + registryMC.fill(HIST("antideuteron_ue_rec_tof"), pt, wde_ue); + } + } + + // Antihelium-3 + if (particle.pdgCode() != -1000020030) { + if (nsigmaTPCHe > min_nsigmaTPC && nsigmaTPCHe < max_nsigmaTPC) { + registryMC.fill(HIST("antihelium3_jet_rec_tpc"), 2.0 * pt, whe_jet); + registryMC.fill(HIST("antihelium3_ue_rec_tpc"), 2.0 * pt, whe_ue); + } + } + } + } + PROCESS_SWITCH(nuclei_in_jets, processMC, "process MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGMM/Mult/Core/include/Axes.h b/PWGMM/Mult/Core/include/Axes.h index 6f676b99309..97af3af6423 100644 --- a/PWGMM/Mult/Core/include/Axes.h +++ b/PWGMM/Mult/Core/include/Axes.h @@ -33,7 +33,8 @@ AxisSpec PtAxisEff = {{0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0 AxisSpec PtAxis_wide = {1041, -0.05, 104.05, ptAxisName.data()}; // Smaller wider-binned Pt AxisSpec FT0CAxis = {1001, -0.5, 1000.5, "FT0C amplitude (arb. units)"}; // FT0C amplitudes AxisSpec FT0AAxis = {3001, -0.5, 3000.5, "FT0A amplitude (arb. units)"}; // FT0A amplitudes -AxisSpec FDDAxis = {3001, -0.5, 3000.5, "FDD amplitude (arb. units)"}; // FDD amplitudes +AxisSpec FDAAxis = {3001, -0.5, 3000.5, "FDA amplitude (arb. units)"}; // FDD amplitudes +AxisSpec FDCAxis = {3001, -0.5, 3000.5, "FDC amplitude (arb. units)"}; // FDD amplitudes AxisSpec RapidityAxis = {102, -10.2, 10.2, "Y"}; // Rapidity AxisSpec ScaleAxis = {121, -0.5, 120.5, "Event scale (GeV)"}; // Event scale AxisSpec MPIAxis = {51, -0.5, 50.5, "N_{MPI}"}; // N_{MPI} diff --git a/PWGMM/Mult/Tasks/dndeta.cxx b/PWGMM/Mult/Tasks/dndeta.cxx index 2b01721338e..ab6fea3300e 100644 --- a/PWGMM/Mult/Tasks/dndeta.cxx +++ b/PWGMM/Mult/Tasks/dndeta.cxx @@ -104,7 +104,7 @@ struct MultiplicityCounter { binnedRegistry.add({EventTimeRes.data(), " ; t (ms); centrality", {HistType::kTH2F, {{1001, -0.1, 100.1}, CentAxis}}}); } - if (doprocessCounting || doprocessCountingNoAmb) { + if (doprocessCountingAmbiguous || doprocessCounting) { inclusiveRegistry.add({EventSelection.data(), ";status;events", {HistType::kTH1F, {{static_cast(EvSelBins::kRejected), 0.5, static_cast(EvSelBins::kRejected) + 0.5}}}}); auto hstat = inclusiveRegistry.get(HIST(EventSelection)); auto* x = hstat->GetXaxis(); @@ -122,7 +122,7 @@ struct MultiplicityCounter { inclusiveRegistry.add({PtEta.data(), " ; p_{T} (GeV/c); #eta", {HistType::kTH2F, {PtAxis, EtaAxis}}}); inclusiveRegistry.add({DCAXYPt.data(), " ; p_{T} (GeV/c) ; DCA_{XY} (cm)", {HistType::kTH2F, {PtAxis, DCAAxis}}}); inclusiveRegistry.add({DCAZPt.data(), " ; p_{T} (GeV/c) ; DCA_{Z} (cm)", {HistType::kTH2F, {PtAxis, DCAAxis}}}); - if (doprocessCounting) { + if (doprocessCountingAmbiguous) { inclusiveRegistry.add({ReassignedDCAXYPt.data(), " ; p_{T} (GeV/c) ; DCA_{XY} (cm)", {HistType::kTH2F, {PtAxis, DCAAxis}}}); inclusiveRegistry.add({ReassignedDCAZPt.data(), " ; p_{T} (GeV/c) ; DCA_{Z} (cm)", {HistType::kTH2F, {PtAxis, DCAAxis}}}); inclusiveRegistry.add({ExtraDCAXYPt.data(), " ; p_{T} (GeV/c) ; DCA_{XY} (cm)", {HistType::kTH2F, {PtAxis, DCAAxis}}}); @@ -135,7 +135,7 @@ struct MultiplicityCounter { } } - if (doprocessCountingCentralityFT0C || doprocessCountingCentralityFT0M || doprocessCountingCentralityFT0CNoAmb || doprocessCountingCentralityFT0MNoAmb) { + if (doprocessCountingAmbiguousCentralityFT0C || doprocessCountingAmbiguousCentralityFT0M || doprocessCountingCentralityFT0C || doprocessCountingCentralityFT0M) { binnedRegistry.add({EventSelection.data(), ";status;centrality;events", {HistType::kTH2F, {{3, 0.5, 3.5}, CentAxis}}}); auto hstat = binnedRegistry.get(HIST(EventSelection)); auto* x = hstat->GetXaxis(); @@ -149,7 +149,7 @@ struct MultiplicityCounter { binnedRegistry.add({PtEta.data(), " ; p_{T} (GeV/c); #eta; centrality", {HistType::kTHnSparseF, {PtAxis, EtaAxis, CentAxis}}}); binnedRegistry.add({DCAXYPt.data(), " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", {HistType::kTHnSparseF, {PtAxis, DCAAxis, CentAxis}}}); binnedRegistry.add({DCAZPt.data(), " ; p_{T} (GeV/c) ; DCA_{Z} (cm); centrality", {HistType::kTHnSparseF, {PtAxis, DCAAxis, CentAxis}}}); - if (doprocessCountingCentralityFT0C || doprocessCountingCentralityFT0M) { + if (doprocessCountingAmbiguousCentralityFT0C || doprocessCountingAmbiguousCentralityFT0M) { binnedRegistry.add({ReassignedDCAXYPt.data(), " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", {HistType::kTHnSparseF, {PtAxis, DCAAxis, CentAxis}}}); binnedRegistry.add({ReassignedDCAZPt.data(), " ; p_{T} (GeV/c) ; DCA_{Z} (cm); centrality", {HistType::kTHnSparseF, {PtAxis, DCAAxis, CentAxis}}}); binnedRegistry.add({ExtraDCAXYPt.data(), " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", {HistType::kTHnSparseF, {PtAxis, DCAAxis, CentAxis}}}); @@ -162,7 +162,7 @@ struct MultiplicityCounter { } } - if (doprocessGen || doprocessGenNoAmb) { + if (doprocessGenAmbiguous || doprocessGen) { inclusiveRegistry.add({NtrkZvtxGen.data(), "; N_{trk}; Z_{vtx} (cm); events", {HistType::kTH2F, {MultAxis, ZAxis}}}); inclusiveRegistry.add({NtrkZvtxGen_t.data(), "; N_{part}; Z_{vtx} (cm); events", {HistType::kTH2F, {MultAxis, ZAxis}}}); inclusiveRegistry.add({EtaZvtxGen.data(), "; #eta; Z_{vtx} (cm); tracks", {HistType::kTH2F, {EtaAxis, ZAxis}}}); @@ -182,7 +182,7 @@ struct MultiplicityCounter { inclusiveRegistry.add({EfficiencyMult.data(), " ; N_{gen}; Z_{vtx} (cm)", {HistType::kTH2F, {MultAxis, ZAxis}}}); inclusiveRegistry.add({SplitMult.data(), " ; N_{gen} ; Z_{vtx} (cm)", {HistType::kTH2F, {MultAxis, ZAxis}}}); if (responseStudy) { - inclusiveRegistry.add({MultiResponse.data(), " ; N_{gen}; N_{rec}; N_{PV cont}; N_{FT0A}; N_{FT0C}; N_{FDA}; N_{FDC}; Z_{vtx} (cm)", {HistType::kTHnSparseF, {MultAxis, MultAxis, MultAxis, FT0AAxis, FT0CAxis, FDDAxis, FDDAxis, ZAxis}}}); + inclusiveRegistry.add({MultiResponse.data(), " ; N_{gen}; N_{rec}; N_{PV cont}; N_{FT0A}; N_{FT0C}; N_{FDA}; N_{FDC}; Z_{vtx} (cm)", {HistType::kTHnSparseF, {MultAxis, MultAxis, MultAxis, FT0AAxis, FT0CAxis, FDAAxis, FDCAxis, ZAxis}}}); } } @@ -196,8 +196,8 @@ struct MultiplicityCounter { x->SetBinLabel(static_cast(EvEffBins::kSelectedPVgt0), EvEffBinLabels[static_cast(EvEffBins::kSelectedPVgt0)].data()); } - if (doprocessGenFT0C || doprocessGenFT0M || doprocessGenFT0Chi || doprocessGenFT0Mhi || - doprocessGenFT0CNoAmb || doprocessGenFT0MNoAmb || doprocessGenFT0ChiNoAmb || doprocessGenFT0MhiNoAmb) { + if (doprocessGenAmbiguousFT0C || doprocessAmbiguousGenFT0M || doprocessGenAmbiguousFT0Chi || doprocessGenAmbiguousFT0Mhi || + doprocessGenFT0CNoAmb || doprocessGenFT0M || doprocessGenFT0Chi || doprocessGenFT0Mhi) { binnedRegistry.add({NtrkZvtxGen.data(), "; N_{trk}; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {MultAxis, ZAxis, CentAxis}}}); binnedRegistry.add({NtrkZvtxGen_t.data(), "; N_{part}; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {MultAxis, ZAxis, CentAxis}}}); binnedRegistry.add({EtaZvtxGen.data(), "; #eta; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {EtaAxis, ZAxis, CentAxis}}}); @@ -218,7 +218,7 @@ struct MultiplicityCounter { binnedRegistry.add({EfficiencyMult.data(), " ; N_{gen}; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {MultAxis, ZAxis, CentAxis}}}); binnedRegistry.add({SplitMult.data(), " ; N_{gen} ; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {MultAxis, ZAxis, CentAxis}}}); if (responseStudy) { - binnedRegistry.add({MultiResponse.data(), " ; N_{gen}; N_{rec}, N_{PV cont}; N_{FT0A}; N_{FT0C}; N_{FDA}; N_{FDC}; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {MultAxis, MultAxis, MultAxis, FT0AAxis, FT0CAxis, FDDAxis, FDDAxis, ZAxis, CentAxis}}}); + binnedRegistry.add({MultiResponse.data(), " ; N_{gen}; N_{rec}, N_{PV cont}; N_{FT0A}; N_{FT0C}; N_{FDA}; N_{FDC}; Z_{vtx} (cm); centrality", {HistType::kTHnSparseF, {MultAxis, MultAxis, MultAxis, FT0AAxis, FT0CAxis, FDAAxis, FDCAxis, ZAxis, CentAxis}}}); } } @@ -232,7 +232,7 @@ struct MultiplicityCounter { x->SetBinLabel(static_cast(EvEffBins::kSelectedPVgt0), EvEffBinLabels[static_cast(EvEffBins::kSelectedPVgt0)].data()); } - if (doprocessTrackEfficiency || doprocessTrackEfficiencyNoAmb) { + if (doprocessTrackEfficiencyAmbiguous || doprocessTrackEfficiency) { inclusiveRegistry.add({PtGen.data(), " ; p_{T} (GeV/c)", {HistType::kTH1F, {PtAxisEff}}}); inclusiveRegistry.add({PtGenNoEtaCut.data(), " ; p_{T} (GeV/c)", {HistType::kTH1F, {PtAxisEff}}}); inclusiveRegistry.add({PtEfficiency.data(), " ; p_{T} (GeV/c)", {HistType::kTH1F, {PtAxisEff}}}); @@ -363,6 +363,33 @@ struct MultiplicityCounter { // PV contributors for INEL>0 (PV) collision sample definition Partition pvContribTracksIUEta1 = (nabs(aod::track::eta) < 1.0f) && ((aod::track::flags & (uint32_t)o2::aod::track::PVContributor) == (uint32_t)o2::aod::track::PVContributor); + template + int countTracks(T const& tracks, float z, float c) + { + auto Ntrks = 0; + for (auto& track : tracks) { + if (std::abs(track.eta()) < estimatorEta) { + ++Ntrks; + } + if constexpr (fillHistos) { + if constexpr (hasRecoCent()) { + binnedRegistry.fill(HIST(EtaZvtx), track.eta(), z, c); + binnedRegistry.fill(HIST(PhiEta), track.phi(), track.eta(), c); + binnedRegistry.fill(HIST(PtEta), track.pt(), track.eta(), c); + binnedRegistry.fill(HIST(DCAXYPt), track.pt(), track.dcaXY(), c); + binnedRegistry.fill(HIST(DCAZPt), track.pt(), track.dcaZ(), c); + } else { + inclusiveRegistry.fill(HIST(EtaZvtx), track.eta(), z); + inclusiveRegistry.fill(HIST(PhiEta), track.phi(), track.eta()); + inclusiveRegistry.fill(HIST(PtEta), track.pt(), track.eta()); + inclusiveRegistry.fill(HIST(DCAXYPt), track.pt(), track.dcaXY()); + inclusiveRegistry.fill(HIST(DCAZPt), track.pt(), track.dcaZ()); + } + } + } + return Ntrks; + } + template void processCountingGeneral( typename C::iterator const& collision, @@ -390,31 +417,14 @@ struct MultiplicityCounter { usedTracksIds.clear(); auto groupPVContrib = pvContribTracksIUEta1->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto INELgt0PV = groupPVContrib.size() > 0; - auto Ntrks = 0; - for (auto& track : tracks) { - if (std::abs(track.eta()) < estimatorEta) { - ++Ntrks; - } - if constexpr (hasRecoCent()) { - binnedRegistry.fill(HIST(EtaZvtx), track.eta(), z, c); - binnedRegistry.fill(HIST(PhiEta), track.phi(), track.eta(), c); - binnedRegistry.fill(HIST(PtEta), track.pt(), track.eta(), c); - binnedRegistry.fill(HIST(DCAXYPt), track.pt(), track.dcaXY(), c); - binnedRegistry.fill(HIST(DCAZPt), track.pt(), track.dcaZ(), c); - } else { - inclusiveRegistry.fill(HIST(EtaZvtx), track.eta(), z); - inclusiveRegistry.fill(HIST(PhiEta), track.phi(), track.eta()); - inclusiveRegistry.fill(HIST(PtEta), track.pt(), track.eta()); - inclusiveRegistry.fill(HIST(DCAXYPt), track.pt(), track.dcaXY()); - inclusiveRegistry.fill(HIST(DCAZPt), track.pt(), track.dcaZ()); - } - } + auto Ntrks = countTracks(tracks, z, c); if constexpr (hasRecoCent()) { binnedRegistry.fill(HIST(NtrkZvtx), Ntrks, z, c); } else { - if (Ntrks > 0 || groupPVContrib.size() > 0) { - if (groupPVContrib.size() > 0) { + if (Ntrks > 0 || INELgt0PV) { + if (INELgt0PV) { inclusiveRegistry.fill(HIST(EventSelection), static_cast(EvSelBins::kSelectedPVgt0)); } if (Ntrks > 0) { @@ -424,7 +434,7 @@ struct MultiplicityCounter { if (Ntrks > 0) { inclusiveRegistry.fill(HIST(EtaZvtx_gt0), track.eta(), z); } - if (groupPVContrib.size() > 0) { + if (INELgt0PV) { inclusiveRegistry.fill(HIST(EtaZvtx_PVgt0), track.eta(), z); } } @@ -440,55 +450,29 @@ struct MultiplicityCounter { } } - template - void processCountingGeneralwAmbiguous( - typename C::iterator const& collision, - FiTracks const& tracks, - soa::SmallGroups const& atracks) + template + int countTracksAmbiguous(T const& tracks, AT const& atracks, float z, float c) { - float c = -1; - if constexpr (hasRecoCent()) { - if constexpr (C::template contains()) { - c = collision.centFT0C(); - } else if (C::template contains()) { - c = collision.centFT0M(); + auto Ntrks = 0; + for (auto& track : atracks) { + auto otrack = track.template track_as(); + // same filtering for ambiguous as for general + if (!otrack.hasITS()) { + continue; } - binnedRegistry.fill(HIST(EventSelection), 1., c); - } else { - inclusiveRegistry.fill(HIST(EventSelection), static_cast(EvSelBins::kAll)); - } - - if (!useEvSel || (collision.sel8() && collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { - if constexpr (hasRecoCent()) { - binnedRegistry.fill(HIST(EventSelection), 2., c); - } else { - inclusiveRegistry.fill(HIST(EventSelection), static_cast(EvSelBins::kSelected)); + if ((otrack.trackCutFlag() & trackSelectionITS) == 0) { + continue; } - auto z = collision.posZ(); - usedTracksIds.clear(); - - auto groupPVContrib = pvContribTracksIUEta1->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - - auto Ntrks = 0; - - for (auto& track : atracks) { - auto otrack = track.track_as(); - // same filtering for ambiguous as for general - if (!otrack.hasITS()) { + if (otrack.hasTPC()) { + if ((otrack.trackCutFlag() & trackSelectionTPC) == 0) { continue; } - if ((otrack.trackCutFlag() & trackSelectionITS) == 0) { - continue; - } - if (otrack.hasTPC()) { - if ((otrack.trackCutFlag() & trackSelectionTPC) == 0) { - continue; - } - } - usedTracksIds.emplace_back(track.trackId()); - if (std::abs(otrack.eta()) < estimatorEta) { - ++Ntrks; - } + } + usedTracksIds.emplace_back(track.trackId()); + if (std::abs(otrack.eta()) < estimatorEta) { + ++Ntrks; + } + if (fillHistos) { if constexpr (hasRecoCent()) { binnedRegistry.fill(HIST(EtaZvtx), otrack.eta(), z, c); binnedRegistry.fill(HIST(PhiEta), otrack.phi(), otrack.eta(), c); @@ -502,46 +486,52 @@ struct MultiplicityCounter { inclusiveRegistry.fill(HIST(DCAXYPt), otrack.pt(), track.bestDCAXY()); inclusiveRegistry.fill(HIST(DCAZPt), otrack.pt(), track.bestDCAZ()); } - if (!otrack.has_collision()) { - if constexpr (hasRecoCent()) { - binnedRegistry.fill(HIST(ExtraEtaZvtx), otrack.eta(), z, c); - binnedRegistry.fill(HIST(ExtraPhiEta), otrack.phi(), otrack.eta(), c); - binnedRegistry.fill(HIST(ExtraDCAXYPt), otrack.pt(), track.bestDCAXY(), c); - binnedRegistry.fill(HIST(ExtraDCAZPt), otrack.pt(), track.bestDCAZ(), c); - } else { - inclusiveRegistry.fill(HIST(ExtraEtaZvtx), otrack.eta(), z); - inclusiveRegistry.fill(HIST(ExtraPhiEta), otrack.phi(), otrack.eta()); - inclusiveRegistry.fill(HIST(ExtraDCAXYPt), otrack.pt(), track.bestDCAXY()); - inclusiveRegistry.fill(HIST(ExtraDCAZPt), otrack.pt(), track.bestDCAZ()); - } - } else if (otrack.collisionId() != track.bestCollisionId()) { - usedTracksIdsDF.emplace_back(track.trackId()); + } + if (otrack.collisionId() != track.bestCollisionId()) { + usedTracksIdsDF.emplace_back(track.trackId()); + if constexpr (fillHistos) { if constexpr (hasRecoCent()) { binnedRegistry.fill(HIST(ReassignedEtaZvtx), otrack.eta(), z, c); binnedRegistry.fill(HIST(ReassignedPhiEta), otrack.phi(), otrack.eta(), c); - binnedRegistry.fill(HIST(ReassignedZvtxCorr), otrack.collision_as().posZ(), z, c); + binnedRegistry.fill(HIST(ReassignedZvtxCorr), otrack.template collision_as().posZ(), z, c); binnedRegistry.fill(HIST(ReassignedDCAXYPt), otrack.pt(), track.bestDCAXY(), c); binnedRegistry.fill(HIST(ReassignedDCAZPt), otrack.pt(), track.bestDCAZ(), c); } else { inclusiveRegistry.fill(HIST(ReassignedEtaZvtx), otrack.eta(), z); inclusiveRegistry.fill(HIST(ReassignedPhiEta), otrack.phi(), otrack.eta()); - inclusiveRegistry.fill(HIST(ReassignedZvtxCorr), otrack.collision_as().posZ(), z); + inclusiveRegistry.fill(HIST(ReassignedZvtxCorr), otrack.template collision_as().posZ(), z); inclusiveRegistry.fill(HIST(ReassignedDCAXYPt), otrack.pt(), track.bestDCAXY()); inclusiveRegistry.fill(HIST(ReassignedDCAZPt), otrack.pt(), track.bestDCAZ()); } } + } else if (!otrack.has_collision()) { + if constexpr (fillHistos) { + if constexpr (hasRecoCent()) { + binnedRegistry.fill(HIST(ExtraEtaZvtx), otrack.eta(), z, c); + binnedRegistry.fill(HIST(ExtraPhiEta), otrack.phi(), otrack.eta(), c); + binnedRegistry.fill(HIST(ExtraDCAXYPt), otrack.pt(), track.bestDCAXY(), c); + binnedRegistry.fill(HIST(ExtraDCAZPt), otrack.pt(), track.bestDCAZ(), c); + } else { + inclusiveRegistry.fill(HIST(ExtraEtaZvtx), otrack.eta(), z); + inclusiveRegistry.fill(HIST(ExtraPhiEta), otrack.phi(), otrack.eta()); + inclusiveRegistry.fill(HIST(ExtraDCAXYPt), otrack.pt(), track.bestDCAXY()); + inclusiveRegistry.fill(HIST(ExtraDCAZPt), otrack.pt(), track.bestDCAZ()); + } + } } + } - for (auto& track : tracks) { - if (std::find(usedTracksIds.begin(), usedTracksIds.end(), track.globalIndex()) != usedTracksIds.end()) { - continue; - } - if (std::find(usedTracksIdsDF.begin(), usedTracksIdsDF.end(), track.globalIndex()) != usedTracksIdsDF.end()) { - continue; - } - if (std::abs(track.eta()) < estimatorEta) { - ++Ntrks; - } + for (auto& track : tracks) { + if (std::find(usedTracksIds.begin(), usedTracksIds.end(), track.globalIndex()) != usedTracksIds.end()) { + continue; + } + if (std::find(usedTracksIdsDF.begin(), usedTracksIdsDF.end(), track.globalIndex()) != usedTracksIdsDF.end()) { + continue; + } + if (std::abs(track.eta()) < estimatorEta) { + ++Ntrks; + } + if constexpr (fillHistos) { if constexpr (hasRecoCent()) { binnedRegistry.fill(HIST(EtaZvtx), track.eta(), z, c); binnedRegistry.fill(HIST(PhiEta), track.phi(), track.eta(), c); @@ -556,11 +546,46 @@ struct MultiplicityCounter { inclusiveRegistry.fill(HIST(DCAZPt), track.pt(), track.dcaZ()); } } + } + return Ntrks; + } + + template + void processCountingGeneralwAmbiguous( + typename C::iterator const& collision, + FiTracks const& tracks, + soa::SmallGroups const& atracks) + { + float c = -1; + if constexpr (hasRecoCent()) { + if constexpr (C::template contains()) { + c = collision.centFT0C(); + } else if (C::template contains()) { + c = collision.centFT0M(); + } + binnedRegistry.fill(HIST(EventSelection), 1., c); + } else { + inclusiveRegistry.fill(HIST(EventSelection), static_cast(EvSelBins::kAll)); + } + + if (!useEvSel || (collision.sel8() && collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { + if constexpr (hasRecoCent()) { + binnedRegistry.fill(HIST(EventSelection), 2., c); + } else { + inclusiveRegistry.fill(HIST(EventSelection), static_cast(EvSelBins::kSelected)); + } + auto z = collision.posZ(); + usedTracksIds.clear(); + + auto groupPVContrib = pvContribTracksIUEta1->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto INELgt0PV = groupPVContrib.size() > 0; + + auto Ntrks = countTracksAmbiguous(tracks, atracks, z, c); if constexpr (hasRecoCent()) { binnedRegistry.fill(HIST(NtrkZvtx), Ntrks, z, c); } else { - if (Ntrks > 0 || groupPVContrib.size() > 0) { - if (groupPVContrib.size() > 0) { + if (Ntrks > 0 || INELgt0PV) { + if (INELgt0PV) { inclusiveRegistry.fill(HIST(EventSelection), static_cast(EvSelBins::kSelectedPVgt0)); } if (Ntrks > 0) { @@ -570,7 +595,7 @@ struct MultiplicityCounter { if (Ntrks > 0) { inclusiveRegistry.fill(HIST(EtaZvtx_gt0), track.track_as().eta(), z); } - if (groupPVContrib.size() > 0) { + if (INELgt0PV) { inclusiveRegistry.fill(HIST(EtaZvtx_PVgt0), track.track_as().eta(), z); } } @@ -584,7 +609,7 @@ struct MultiplicityCounter { if (Ntrks > 0) { inclusiveRegistry.fill(HIST(EtaZvtx_gt0), track.eta(), z); } - if (groupPVContrib.size() > 0) { + if (INELgt0PV) { inclusiveRegistry.fill(HIST(EtaZvtx_PVgt0), track.eta(), z); } } @@ -600,7 +625,7 @@ struct MultiplicityCounter { } } - void processCounting( + void processCountingAmbiguous( ExCols::iterator const& collision, FiTracks const& tracks, soa::SmallGroups const& atracks) @@ -608,19 +633,19 @@ struct MultiplicityCounter { processCountingGeneralwAmbiguous(collision, tracks, atracks); } - PROCESS_SWITCH(MultiplicityCounter, processCounting, "Count tracks", false); + PROCESS_SWITCH(MultiplicityCounter, processCountingAmbiguous, "Count tracks", false); - void processCountingNoAmb( + void processCounting( ExCols::iterator const& collision, FiTracks const& tracks) { processCountingGeneral(collision, tracks); } - PROCESS_SWITCH(MultiplicityCounter, processCountingNoAmb, "Count tracks w/o ambiguous", false); + PROCESS_SWITCH(MultiplicityCounter, processCounting, "Count tracks w/o ambiguous", false); using ExColsCentFT0C = soa::Join; - void processCountingCentralityFT0C( + void processCountingAmbiguousCentralityFT0C( ExColsCentFT0C::iterator const& collision, FiTracks const& tracks, soa::SmallGroups const& atracks) @@ -628,19 +653,19 @@ struct MultiplicityCounter { processCountingGeneralwAmbiguous(collision, tracks, atracks); } - PROCESS_SWITCH(MultiplicityCounter, processCountingCentralityFT0C, "Count tracks in FT0C centrality bins", false); + PROCESS_SWITCH(MultiplicityCounter, processCountingAmbiguousCentralityFT0C, "Count tracks in FT0C centrality bins", false); - void processCountingCentralityFT0CNoAmb( + void processCountingCentralityFT0C( ExColsCentFT0C::iterator const& collision, FiTracks const& tracks) { processCountingGeneral(collision, tracks); } - PROCESS_SWITCH(MultiplicityCounter, processCountingCentralityFT0CNoAmb, "Count tracks in FT0C centrality bins w/o ambiguous", false); + PROCESS_SWITCH(MultiplicityCounter, processCountingCentralityFT0C, "Count tracks in FT0C centrality bins w/o ambiguous", false); using ExColsCentFT0M = soa::Join; - void processCountingCentralityFT0M( + void processCountingAmbiguousCentralityFT0M( ExColsCentFT0M::iterator const& collision, FiTracks const& tracks, soa::SmallGroups const& atracks) @@ -648,16 +673,16 @@ struct MultiplicityCounter { processCountingGeneralwAmbiguous(collision, tracks, atracks); } - PROCESS_SWITCH(MultiplicityCounter, processCountingCentralityFT0M, "Count tracks in FT0M centrality bins", false); + PROCESS_SWITCH(MultiplicityCounter, processCountingAmbiguousCentralityFT0M, "Count tracks in FT0M centrality bins", false); - void processCountingCentralityFT0MNoAmb( + void processCountingCentralityFT0M( ExColsCentFT0M::iterator const& collision, FiTracks const& tracks) { processCountingGeneral(collision, tracks); } - PROCESS_SWITCH(MultiplicityCounter, processCountingCentralityFT0MNoAmb, "Count tracks in FT0M centrality bins w/o ambiguous", false); + PROCESS_SWITCH(MultiplicityCounter, processCountingCentralityFT0M, "Count tracks in FT0M centrality bins w/o ambiguous", false); using Particles = soa::Filtered; using LabeledTracksEx = soa::Join; @@ -665,6 +690,16 @@ struct MultiplicityCounter { using ParticlesI = soa::Filtered>; expressions::Filter primaries = ncheckbit(aod::mcparticle::flags, (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); + bool isChargedParticle(int code) + { + auto p = pdg->GetParticle(code); + auto charge = 0.; + if (p != nullptr) { + charge = p->Charge(); + } + return std::abs(charge) >= 3.; + } + template void processTrackEfficiencyIndexedGeneral( typename soa::Join::iterator const& collision, @@ -681,12 +716,7 @@ struct MultiplicityCounter { auto sample = particles.sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); for (auto& particle : sample) { - auto charge = 0.; - auto p = pdg->GetParticle(particle.pdgCode()); - if (p != nullptr) { - charge = p->Charge(); - } - if (std::abs(charge) < 3.) { + if (!isChargedParticle(particle.pdgCode())) { continue; } inclusiveRegistry.fill(HIST(PtGenIdxNoEtaCut), particle.pt()); @@ -858,12 +888,7 @@ struct MultiplicityCounter { } for (auto& particle : particlesPerCol) { - auto charge = 0.; - auto p = pdg->GetParticle(particle.pdgCode()); - if (p != nullptr) { - charge = p->Charge(); - } - if (std::abs(charge) < 3.) { + if (!isChargedParticle(particle.pdgCode())) { continue; } inclusiveRegistry.fill(HIST(PtGenNoEtaCut), particle.pt()); @@ -933,12 +958,7 @@ struct MultiplicityCounter { } for (auto& particle : particlesPerCol) { - auto charge = 0.; - auto p = pdg->GetParticle(particle.pdgCode()); - if (p != nullptr) { - charge = p->Charge(); - } - if (std::abs(charge) < 3.) { + if (!isChargedParticle(particle.pdgCode())) { continue; } inclusiveRegistry.fill(HIST(PtGenNoEtaCut), particle.pt()); @@ -957,7 +977,7 @@ struct MultiplicityCounter { } } - void processTrackEfficiency( + void processTrackEfficiencyAmbiguous( soa::Join::iterator const& collision, aod::McCollisions const& mccollisions, Particles const& mcParticles, FiLTracks const& filtracks, @@ -966,9 +986,9 @@ struct MultiplicityCounter { processTrackEfficiencyGeneralAmbiguous(collision, mccollisions, mcParticles, filtracks, atracks); } - PROCESS_SWITCH(MultiplicityCounter, processTrackEfficiency, "Calculate tracking efficiency vs pt", false); + PROCESS_SWITCH(MultiplicityCounter, processTrackEfficiencyAmbiguous, "Calculate tracking efficiency vs pt", false); - void processTrackEfficiencyNoAmb( + void processTrackEfficiency( soa::Join::iterator const& collision, aod::McCollisions const& mccollisions, Particles const& mcParticles, FiLTracks const& filtracks) @@ -976,7 +996,7 @@ struct MultiplicityCounter { processTrackEfficiencyGeneral(collision, mccollisions, mcParticles, filtracks); } - PROCESS_SWITCH(MultiplicityCounter, processTrackEfficiencyNoAmb, "Calculate tracking efficiency vs pt w/o ambiguous", false); + PROCESS_SWITCH(MultiplicityCounter, processTrackEfficiency, "Calculate tracking efficiency vs pt w/o ambiguous", false); template void fillFIT(CIT const& collision, std::vector& ft0as, std::vector& ft0cs, std::vector& fddas, std::vector& fddcs) @@ -1015,52 +1035,46 @@ struct MultiplicityCounter { } } - template - void countParticles(Ps const& particles, MCIT const& mcCollision, int const nCharged, HistogramRegistry& binnedRegistry, HistogramRegistry& inclusiveRegistry, float c_gen, - bool const atLeastOne, - bool const atLeastOne_gt0, - bool const atLeastOne_PVgt0) + template + void fillParticleHistos(Ps const& particles, float z, + int const nCharged, float c, + bool const atLeastOne, bool const atLeastOne_gt0, bool const atLeastOne_PVgt0) { for (auto& particle : particles) { - auto p = pdg->GetParticle(particle.pdgCode()); - auto charge = 0.; - if (p != nullptr) { - charge = p->Charge(); - } - if (std::abs(charge) < 3.) { + if (!isChargedParticle(particle.pdgCode())) { continue; } - if constexpr (hasRecoCent) { - binnedRegistry.fill(HIST(EtaZvtxGen_t), particle.eta(), mcCollision.posZ(), c_gen); - binnedRegistry.fill(HIST(PtEtaGen), particle.pt(), particle.eta(), c_gen); + if constexpr (hasCent) { + binnedRegistry.fill(HIST(EtaZvtxGen_t), particle.eta(), z, c); + binnedRegistry.fill(HIST(PtEtaGen), particle.pt(), particle.eta(), c); } else { - inclusiveRegistry.fill(HIST(EtaZvtxGen_t), particle.eta(), mcCollision.posZ()); + inclusiveRegistry.fill(HIST(EtaZvtxGen_t), particle.eta(), z); inclusiveRegistry.fill(HIST(PtEtaGen), particle.pt(), particle.eta()); } if (nCharged > 0) { - if constexpr (hasRecoCent) { - binnedRegistry.fill(HIST(EtaZvtxGen_gt0t), particle.eta(), mcCollision.posZ(), c_gen); + if constexpr (hasCent) { + binnedRegistry.fill(HIST(EtaZvtxGen_gt0t), particle.eta(), z, c); } else { - inclusiveRegistry.fill(HIST(EtaZvtxGen_gt0t), particle.eta(), mcCollision.posZ()); + inclusiveRegistry.fill(HIST(EtaZvtxGen_gt0t), particle.eta(), z); } } if (atLeastOne) { - if constexpr (hasRecoCent) { - binnedRegistry.fill(HIST(EtaZvtxGen), particle.eta(), mcCollision.posZ(), c_gen); + if constexpr (hasCent) { + binnedRegistry.fill(HIST(EtaZvtxGen), particle.eta(), z, c); if (atLeastOne_gt0) { - binnedRegistry.fill(HIST(EtaZvtxGen_gt0), particle.eta(), mcCollision.posZ(), c_gen); + binnedRegistry.fill(HIST(EtaZvtxGen_gt0), particle.eta(), z, c); } if (atLeastOne_PVgt0) { - binnedRegistry.fill(HIST(EtaZvtxGen_PVgt0), particle.eta(), mcCollision.posZ(), c_gen); + binnedRegistry.fill(HIST(EtaZvtxGen_PVgt0), particle.eta(), z, c); } - binnedRegistry.fill(HIST(PhiEtaGen), particle.phi(), particle.eta(), c_gen); + binnedRegistry.fill(HIST(PhiEtaGen), particle.phi(), particle.eta(), c); } else { - inclusiveRegistry.fill(HIST(EtaZvtxGen), particle.eta(), mcCollision.posZ()); + inclusiveRegistry.fill(HIST(EtaZvtxGen), particle.eta(), z); if (atLeastOne_gt0) { - inclusiveRegistry.fill(HIST(EtaZvtxGen_gt0), particle.eta(), mcCollision.posZ()); + inclusiveRegistry.fill(HIST(EtaZvtxGen_gt0), particle.eta(), z); } if (atLeastOne_PVgt0) { - inclusiveRegistry.fill(HIST(EtaZvtxGen_PVgt0), particle.eta(), mcCollision.posZ()); + inclusiveRegistry.fill(HIST(EtaZvtxGen_PVgt0), particle.eta(), z); } inclusiveRegistry.fill(HIST(PhiEtaGen), particle.phi(), particle.eta()); } @@ -1068,6 +1082,22 @@ struct MultiplicityCounter { } } + template + int countParticles(Ps const& particles) + { + auto nCharged = 0; + for (auto& particle : particles) { + if (!isChargedParticle(particle.pdgCode())) { + continue; + } + if (std::abs(particle.eta()) >= estimatorEta) { + continue; + } + nCharged++; + } + return nCharged; + } + template void processGenGeneralAmbiguous( typename MC::iterator const& mcCollision, @@ -1080,21 +1110,7 @@ struct MultiplicityCounter { c_gen = mcCollision.centrality(); } - auto nCharged = 0; - for (auto& particle : particles) { - auto charge = 0.; - auto p = pdg->GetParticle(particle.pdgCode()); - if (p != nullptr) { - charge = p->Charge(); - } - if (std::abs(charge) < 3.) { - continue; - } - if (std::abs(particle.eta()) >= estimatorEta) { - continue; - } - nCharged++; - } + auto nCharged = countParticles(particles); if constexpr (hasRecoCent()) { binnedRegistry.fill(HIST(NtrkZvtxGen_t), nCharged, mcCollision.posZ(), c_gen); binnedRegistry.fill(HIST(Efficiency), static_cast(EvEffBins::kGen), c_gen); @@ -1116,7 +1132,6 @@ struct MultiplicityCounter { auto moreThanOne = 0; LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), collisions.size()); - auto Nrec = 0; std::vector NrecPerCol; std::vector c_recPerCol; std::vector NPVPerCol; @@ -1140,8 +1155,13 @@ struct MultiplicityCounter { inclusiveRegistry.fill(HIST(Efficiency), static_cast(EvEffBins::kRec)); } if (!useEvSel || (collision.sel8() && collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { - Nrec = 0; + auto z = collision.posZ(); ++moreThanOne; + if constexpr (hasRecoCent() && !hasSimCent()) { + if (!atLeastOne) { + c_gen = c_rec; // if there is no generator centrality info, fall back to reco (from the first reco collision) + } + } atLeastOne = true; auto groupPVcontrib = pvContribTracksIUEta1->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); @@ -1155,28 +1175,8 @@ struct MultiplicityCounter { } auto perCollisionASample = atracks.sliceBy(perColU, collision.globalIndex()); - for (auto const& track : perCollisionASample) { - auto otrack = track.template track_as(); - usedTracksIds.emplace_back(track.trackId()); - if (otrack.collisionId() != track.bestCollisionId()) { - usedTracksIdsDFMC.emplace_back(track.trackId()); - } - if (std::abs(otrack.eta()) < estimatorEta) { - ++Nrec; - } - } auto perCollisionSample = tracks.sliceBy(perCol, collision.globalIndex()); - for (auto const& track : perCollisionSample) { - if (std::find(usedTracksIds.begin(), usedTracksIds.end(), track.globalIndex()) != usedTracksIds.end()) { - continue; - } - if (std::find(usedTracksIdsDFMC.begin(), usedTracksIdsDFMC.end(), track.globalIndex()) != usedTracksIdsDFMC.end()) { - continue; - } - if (std::abs(track.eta()) < estimatorEta) { - ++Nrec; - } - } + auto Nrec = countTracksAmbiguous(perCollisionSample, perCollisionASample, z, c_rec); NrecPerCol.emplace_back(Nrec); NPVPerCol.emplace_back(collision.numContrib()); if (responseStudy) { @@ -1239,7 +1239,8 @@ struct MultiplicityCounter { } } - countParticles()>(particles, mcCollision, nCharged, binnedRegistry, inclusiveRegistry, c_gen, atLeastOne, atLeastOne_gt0, atLeastOne_PVgt0); + auto zmc = mcCollision.posZ(); + fillParticleHistos()>(particles, zmc, nCharged, c_gen, atLeastOne, atLeastOne_gt0, atLeastOne_PVgt0); } template @@ -1254,21 +1255,7 @@ struct MultiplicityCounter { c_gen = mcCollision.centrality(); } - auto nCharged = 0; - for (auto& particle : particles) { - auto charge = 0.; - auto p = pdg->GetParticle(particle.pdgCode()); - if (p != nullptr) { - charge = p->Charge(); - } - if (std::abs(charge) < 3.) { - continue; - } - if (std::abs(particle.eta()) >= estimatorEta) { - continue; - } - nCharged++; - } + auto nCharged = countParticles(particles); if constexpr (hasRecoCent()) { binnedRegistry.fill(HIST(NtrkZvtxGen_t), nCharged, mcCollision.posZ(), c_gen); binnedRegistry.fill(HIST(Efficiency), static_cast(EvEffBins::kGen), c_gen); @@ -1290,7 +1277,6 @@ struct MultiplicityCounter { auto moreThanOne = 0; LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), collisions.size()); - auto Nrec = 0; std::vector NrecPerCol; std::vector c_recPerCol; std::vector NPVPerCol; @@ -1314,8 +1300,13 @@ struct MultiplicityCounter { inclusiveRegistry.fill(HIST(Efficiency), static_cast(EvEffBins::kRec)); } if (!useEvSel || (collision.sel8() && collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { - Nrec = 0; + auto z = collision.posZ(); ++moreThanOne; + if constexpr (hasRecoCent() && !hasSimCent()) { + if (!atLeastOne) { + c_gen = c_rec; // if there is no generator centrality info, fall back to reco (from the first reco collision) + } + } atLeastOne = true; auto groupPVcontrib = pvContribTracksIUEta1->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); @@ -1329,11 +1320,7 @@ struct MultiplicityCounter { } auto perCollisionSample = tracks.sliceBy(perCol, collision.globalIndex()); - for (auto const& track : perCollisionSample) { - if (std::abs(track.eta()) < estimatorEta) { - ++Nrec; - } - } + auto Nrec = countTracks(perCollisionSample, z, c_rec); NrecPerCol.emplace_back(Nrec); NPVPerCol.emplace_back(collision.numContrib()); if (responseStudy) { @@ -1395,12 +1382,12 @@ struct MultiplicityCounter { inclusiveRegistry.fill(HIST(NotFoundZvtx), mcCollision.posZ()); } } - - countParticles()>(particles, mcCollision, nCharged, binnedRegistry, inclusiveRegistry, c_gen, atLeastOne, atLeastOne_gt0, atLeastOne_PVgt0); + auto zmc = mcCollision.posZ(); + fillParticleHistos()>(particles, zmc, nCharged, c_gen, atLeastOne, atLeastOne_gt0, atLeastOne_PVgt0); } using MC = aod::McCollisions; // soa::Join; - void processGen( + void processGenAmbiguous( MC::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, Particles const& particles, FiTracks const& tracks, FiReTracks const& atracks, aod::FT0s const&, aod::FDDs const&) @@ -1408,9 +1395,9 @@ struct MultiplicityCounter { processGenGeneralAmbiguous(mcCollision, collisions, particles, tracks, atracks); } - PROCESS_SWITCH(MultiplicityCounter, processGen, "Process generator-level info", false); + PROCESS_SWITCH(MultiplicityCounter, processGenAmbiguous, "Process generator-level info", false); - void processGenNoAmb( + void processGen( MC::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, Particles const& particles, FiTracks const& tracks, aod::FT0s const&, aod::FDDs const&) @@ -1418,9 +1405,9 @@ struct MultiplicityCounter { processGenGeneral(mcCollision, collisions, particles, tracks); } - PROCESS_SWITCH(MultiplicityCounter, processGenNoAmb, "Process generator-level info w/o ambiguous", false); + PROCESS_SWITCH(MultiplicityCounter, processGen, "Process generator-level info w/o ambiguous", false); - void processGenFT0C( + void processGenAmbiguousFT0C( MC::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, Particles const& particles, FiTracks const& tracks, FiReTracks const& atracks, aod::FT0s const&, aod::FDDs const&) @@ -1428,7 +1415,7 @@ struct MultiplicityCounter { processGenGeneralAmbiguous(mcCollision, collisions, particles, tracks, atracks); } - PROCESS_SWITCH(MultiplicityCounter, processGenFT0C, "Process generator-level info (FT0C centrality)", false); + PROCESS_SWITCH(MultiplicityCounter, processGenAmbiguousFT0C, "Process generator-level info (FT0C centrality)", false); void processGenFT0CNoAmb( MC::iterator const& mcCollision, @@ -1440,7 +1427,7 @@ struct MultiplicityCounter { PROCESS_SWITCH(MultiplicityCounter, processGenFT0CNoAmb, "Process generator-level info (FT0C centrality) w/o ambiguous", false); - void processGenFT0M( + void processAmbiguousGenFT0M( MC::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, Particles const& particles, FiTracks const& tracks, FiReTracks const& atracks, aod::FT0s const&, aod::FDDs const&) @@ -1448,9 +1435,9 @@ struct MultiplicityCounter { processGenGeneralAmbiguous(mcCollision, collisions, particles, tracks, atracks); } - PROCESS_SWITCH(MultiplicityCounter, processGenFT0M, "Process generator-level info (FT0M centrality)", false); + PROCESS_SWITCH(MultiplicityCounter, processAmbiguousGenFT0M, "Process generator-level info (FT0M centrality)", false); - void processGenFT0MNoAmb( + void processGenFT0M( MC::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, Particles const& particles, FiTracks const& tracks, aod::FT0s const&, aod::FDDs const&) @@ -1458,11 +1445,11 @@ struct MultiplicityCounter { processGenGeneral(mcCollision, collisions, particles, tracks); } - PROCESS_SWITCH(MultiplicityCounter, processGenFT0MNoAmb, "Process generator-level info (FT0M centrality) w/o ambiguous", false); + PROCESS_SWITCH(MultiplicityCounter, processGenFT0M, "Process generator-level info (FT0M centrality) w/o ambiguous", false); using MChi = soa::Join; - void processGenFT0Chi( + void processGenAmbiguousFT0Chi( MChi::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, Particles const& particles, FiTracks const& tracks, FiReTracks const& atracks, aod::FT0s const&, aod::FDDs const&) @@ -1470,9 +1457,9 @@ struct MultiplicityCounter { processGenGeneralAmbiguous(mcCollision, collisions, particles, tracks, atracks); } - PROCESS_SWITCH(MultiplicityCounter, processGenFT0Chi, "Process generator-level info (FT0C centrality, HI)", false); + PROCESS_SWITCH(MultiplicityCounter, processGenAmbiguousFT0Chi, "Process generator-level info (FT0C centrality, HI)", false); - void processGenFT0ChiNoAmb( + void processGenFT0Chi( MChi::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, Particles const& particles, FiTracks const& tracks, aod::FT0s const&, aod::FDDs const&) @@ -1480,9 +1467,9 @@ struct MultiplicityCounter { processGenGeneral(mcCollision, collisions, particles, tracks); } - PROCESS_SWITCH(MultiplicityCounter, processGenFT0ChiNoAmb, "Process generator-level info (FT0C centrality, HI) w/o ambiguous", false); + PROCESS_SWITCH(MultiplicityCounter, processGenFT0Chi, "Process generator-level info (FT0C centrality, HI) w/o ambiguous", false); - void processGenFT0Mhi( + void processGenAmbiguousFT0Mhi( MChi::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, Particles const& particles, FiTracks const& tracks, FiReTracks const& atracks, aod::FT0s const&, aod::FDDs const&) @@ -1490,9 +1477,9 @@ struct MultiplicityCounter { processGenGeneralAmbiguous(mcCollision, collisions, particles, tracks, atracks); } - PROCESS_SWITCH(MultiplicityCounter, processGenFT0Mhi, "Process generator-level info (FT0M centrality, HI)", false); + PROCESS_SWITCH(MultiplicityCounter, processGenAmbiguousFT0Mhi, "Process generator-level info (FT0M centrality, HI)", false); - void processGenFT0MhiNoAmb( + void processGenFT0Mhi( MChi::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, Particles const& particles, FiTracks const& tracks, aod::FT0s const&, aod::FDDs const&) @@ -1500,7 +1487,7 @@ struct MultiplicityCounter { processGenGeneral(mcCollision, collisions, particles, tracks); } - PROCESS_SWITCH(MultiplicityCounter, processGenFT0MhiNoAmb, "Process generator-level info (FT0M centrality, HI) w/o ambiguous", false); + PROCESS_SWITCH(MultiplicityCounter, processGenFT0Mhi, "Process generator-level info (FT0M centrality, HI) w/o ambiguous", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGUD/Core/UPCCutparHolder.cxx b/PWGUD/Core/UPCCutparHolder.cxx index 7ed7e656fbd..b785e1e1573 100644 --- a/PWGUD/Core/UPCCutparHolder.cxx +++ b/PWGUD/Core/UPCCutparHolder.cxx @@ -33,8 +33,8 @@ void UPCCutparHolder::setITSNClusLow(int ITSNClusLow) { fITSNClusLow = ITSNClusL void UPCCutparHolder::setITSNClusHigh(int ITSNClusHigh) { fITSNClusHigh = ITSNClusHigh; } void UPCCutparHolder::setITSChi2Low(float ITSChi2Low) { fITSChi2Low = ITSChi2Low; } void UPCCutparHolder::setITSChi2High(float ITSChi2High) { fITSChi2High = ITSChi2High; } -void UPCCutparHolder::setTPCNClusCRLow(int TPCNClusCRLow) { fTPCNClusCRLow = TPCNClusCRLow; } -void UPCCutparHolder::setTPCNClusCRHigh(int TPCNClusCRHigh) { fTPCNClusCRHigh = TPCNClusCRHigh; } +void UPCCutparHolder::setTPCNClsLow(int TPCNClsLow) { fTPCNClsLow = TPCNClsLow; } +void UPCCutparHolder::setTPCNClsHigh(int TPCNClsHigh) { fTPCNClsHigh = TPCNClsHigh; } void UPCCutparHolder::setTPCChi2Low(float TPCChi2Low) { fTPCChi2Low = TPCChi2Low; } void UPCCutparHolder::setTPCChi2High(float TPCChi2High) { fTPCChi2High = TPCChi2High; } void UPCCutparHolder::setCheckMaxDcaXY(bool checkMaxDcaXY) { fCheckMaxDcaXY = checkMaxDcaXY; } @@ -68,8 +68,8 @@ int UPCCutparHolder::getITSNClusLow() const { return fITSNClusLow; } int UPCCutparHolder::getITSNClusHigh() const { return fITSNClusHigh; } float UPCCutparHolder::getITSChi2Low() const { return fITSChi2Low; } float UPCCutparHolder::getITSChi2High() const { return fITSChi2High; } -int UPCCutparHolder::getTPCNClusCRLow() const { return fTPCNClusCRLow; } -int UPCCutparHolder::getTPCNClusCRHigh() const { return fTPCNClusCRHigh; } +int UPCCutparHolder::getTPCNClsLow() const { return fTPCNClsLow; } +int UPCCutparHolder::getTPCNClsHigh() const { return fTPCNClsHigh; } float UPCCutparHolder::getTPCChi2Low() const { return fTPCChi2Low; } float UPCCutparHolder::getTPCChi2High() const { return fTPCChi2High; } bool UPCCutparHolder::getCheckMaxDcaXY() const { return fCheckMaxDcaXY; } diff --git a/PWGUD/Core/UPCCutparHolder.h b/PWGUD/Core/UPCCutparHolder.h index ded4094a86e..abe58117454 100644 --- a/PWGUD/Core/UPCCutparHolder.h +++ b/PWGUD/Core/UPCCutparHolder.h @@ -72,8 +72,8 @@ class UPCCutparHolder fITSNClusHigh{ITSNClusHigh}, fITSChi2Low{ITSChi2Low}, fITSChi2High{ITSChi2High}, - fTPCNClusCRLow{TPCNClusCRLow}, - fTPCNClusCRHigh{TPCNClusCRHigh}, + fTPCNClsLow{TPCNClusCRLow}, + fTPCNClsHigh{TPCNClusCRHigh}, fTPCChi2Low{TPCChi2Low}, fTPCChi2High{TPCChi2High}, fCheckMaxDcaXY{checkMaxDcaXY}, @@ -107,8 +107,8 @@ class UPCCutparHolder void setITSNClusHigh(int ITSNClusHigh); void setITSChi2Low(float ITSChi2Low); void setITSChi2High(float ITSChi2High); - void setTPCNClusCRLow(int TPCNClusCRLow); - void setTPCNClusCRHigh(int TPCNClusCRHigh); + void setTPCNClsLow(int TPCNClusCRLow); + void setTPCNClsHigh(int TPCNClusCRHigh); void setTPCChi2Low(float TPCChi2Low); void setTPCChi2High(float TPCChi2High); void setCheckMaxDcaXY(bool checkMaxDcaXY); @@ -142,8 +142,8 @@ class UPCCutparHolder int getITSNClusHigh() const; float getITSChi2Low() const; float getITSChi2High() const; - int getTPCNClusCRLow() const; - int getTPCNClusCRHigh() const; + int getTPCNClsLow() const; + int getTPCNClsHigh() const; float getTPCChi2Low() const; float getTPCChi2High() const; bool getCheckMaxDcaXY() const; @@ -195,10 +195,10 @@ class UPCCutparHolder float fITSChi2Low{0.}; // Minimal Chi2 in ITS per cluster float fITSChi2High{5.}; // Maximal Chi2 in ITS per cluster // quality: TPC - int fTPCNClusCRLow{70}; // Minimal number of TPC clusters (crossed rows) - int fTPCNClusCRHigh{161}; // Maximal number of TPC clusters (crossed rows) - float fTPCChi2Low{0.}; // Minimal Chi2 in TPC per cluster - float fTPCChi2High{4.}; // Maximal Chi2 in TPC per cluster + int fTPCNClsLow{60}; // Minimal number of TPC clusters + int fTPCNClsHigh{161}; // Maximal number of TPC clusters + float fTPCChi2Low{0.}; // Minimal Chi2 in TPC per cluster + float fTPCChi2High{4.}; // Maximal Chi2 in TPC per cluster // quality: DCA bool fCheckMaxDcaXY{true}; // Apply cut on maximal DCA_xy float fDcaZLow{-3.}; // Minimal DCA_z for barrel tracks @@ -209,8 +209,8 @@ class UPCCutparHolder bool fProduceITSITS{false}; // Produce candidates using only ITS-TPC tracks as well // tracks from collisions: consider only tracks from collisions with N tracks less or equal than fMaxNContrib - int fMaxNContrib{2}; // Central barrel: consider tracks from collisions with N contributors <= maxNContrib - int fAmbigSwitch{0}; // Central barrel: 0 -- loop over all tracks, 1 -- loop only over tracks with vertices + int fMaxNContrib{999999}; // Central barrel: consider tracks from collisions with N contributors <= maxNContrib + int fAmbigSwitch{0}; // Central barrel: 0 -- loop over all tracks, 1 -- loop only over tracks with vertices ClassDefNV(UPCCutparHolder, 1); }; diff --git a/PWGUD/Core/UPCHelpers.h b/PWGUD/Core/UPCHelpers.h index e898a1ec341..fff78b297f7 100644 --- a/PWGUD/Core/UPCHelpers.h +++ b/PWGUD/Core/UPCHelpers.h @@ -59,6 +59,7 @@ enum BarrelSels { kBarrelSelTPCChi2, kBarrelSelDCAXY, kBarrelSelDCAZ, + kAmbiguous, kNBarrelSels }; @@ -87,6 +88,10 @@ struct FITInfo { int32_t BGFDDApf = 0; int32_t BBFDDCpf = 0; int32_t BGFDDCpf = 0; + int32_t distClosestBcTOR = 999; + int32_t distClosestBcTSC = 999; + int32_t distClosestBcTVX = 999; + int32_t distClosestBcV0A = 999; }; template @@ -102,6 +107,9 @@ void applyFwdCuts(UPCCutparHolder& upcCuts, const ForwardTracks::iterator& track template void applyBarrelCuts(UPCCutparHolder& upcCuts, const BarrelTracks::iterator& track, TSelectorsArray& barrelSelectors) { + barrelSelectors[kAmbiguous] = true; + if (upcCuts.getAmbigSwitch()) + barrelSelectors[kAmbiguous] = track.isPVContributor(); barrelSelectors[kBarrelSelHasTOF] = true; if (upcCuts.getRequireTOF()) barrelSelectors[kBarrelSelHasTOF] = track.hasTOF(); // require TOF match if needed @@ -113,7 +121,7 @@ void applyBarrelCuts(UPCCutparHolder& upcCuts, const BarrelTracks::iterator& tra barrelSelectors[kBarrelSelITSChi2] = track.itsChi2NCl() > upcCuts.getITSChi2Low() && track.itsChi2NCl() < upcCuts.getITSChi2High(); // check TPC cuts - barrelSelectors[kBarrelSelTPCNCls] = track.tpcNClsCrossedRows() > static_cast(upcCuts.getTPCNClusCRLow()) && track.tpcNClsCrossedRows() < static_cast(upcCuts.getTPCNClusCRHigh()); + barrelSelectors[kBarrelSelTPCNCls] = track.tpcNClsFound() > static_cast(upcCuts.getTPCNClsLow()) && track.tpcNClsFound() < static_cast(upcCuts.getTPCNClsHigh()); barrelSelectors[kBarrelSelTPCChi2] = track.tpcChi2NCl() > upcCuts.getTPCChi2Low() && track.tpcChi2NCl() < upcCuts.getTPCChi2High(); // check DCA diff --git a/PWGUD/DataModel/UDTables.h b/PWGUD/DataModel/UDTables.h index 98d3bc32a99..77ad6e9d5f8 100644 --- a/PWGUD/DataModel/UDTables.h +++ b/PWGUD/DataModel/UDTables.h @@ -134,6 +134,12 @@ DECLARE_SOA_DYNAMIC_COLUMN(BBFV0A, bbFV0A, DECLARE_SOA_DYNAMIC_COLUMN(BGFV0A, bgFV0A, [](int32_t bgFV0Apf) -> bool { return TESTBIT(bgFV0Apf, 16); }); +DECLARE_SOA_COLUMN(DBcTOR, dBcTOR, int32_t); //! distance to closest TOR +DECLARE_SOA_COLUMN(DBcTSC, dBcTSC, int32_t); //! distance to closest TVX & (TSC | TCE) +DECLARE_SOA_COLUMN(DBcTVX, dBcTVX, int32_t); //! distance to closest TVX +DECLARE_SOA_COLUMN(DBcV0A, dBcV0A, int32_t); //! distance to closest V0A +DECLARE_SOA_COLUMN(DBcT0A, dBcT0A, int32_t); //! distance to closest T0A + DECLARE_SOA_INDEX_COLUMN(Collision, collision); DECLARE_SOA_INDEX_COLUMN(UDMcCollision, udMcCollision); @@ -175,6 +181,13 @@ DECLARE_SOA_TABLE(UDCollisionsSels, "AOD", "UDCOLLISIONSEL", udcollision::BBFV0A, udcollision::BGFV0A, udcollision::BBFDDA, udcollision::BBFDDC, udcollision::BGFDDA, udcollision::BGFDDC); +DECLARE_SOA_TABLE(UDCollisionsSelsExtra, "AOD", "UDCOLSELEXTRA", + udcollision::DBcTOR, + udcollision::DBcTSC, + udcollision::DBcTVX, + udcollision::DBcV0A, + udcollision::DBcT0A); + DECLARE_SOA_TABLE(UDCollsLabels, "AOD", "UDCOLLSLABEL", udcollision::CollisionId); @@ -184,6 +197,7 @@ DECLARE_SOA_TABLE(UDMcCollsLabels, "AOD", "UDMCCOLLSLABEL", using UDCollision = UDCollisions::iterator; using SGCollision = SGCollisions::iterator; using UDCollisionsSel = UDCollisionsSels::iterator; +using UDCollisionsSelExtra = UDCollisionsSelsExtra::iterator; using UDCollsLabel = UDCollsLabels::iterator; using UDMcCollsLabel = UDMcCollsLabels::iterator; diff --git a/PWGUD/TableProducer/UPCCandidateProducer.cxx b/PWGUD/TableProducer/UPCCandidateProducer.cxx index 75cc1664aaf..8f679010bf3 100644 --- a/PWGUD/TableProducer/UPCCandidateProducer.cxx +++ b/PWGUD/TableProducer/UPCCandidateProducer.cxx @@ -15,6 +15,7 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" #include "CommonConstants/LHCConstants.h" +#include "DataFormatsFIT/Triggers.h" #include "PWGUD/Core/UPCCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.h" @@ -44,6 +45,7 @@ struct UpcCandProducer { Produces eventCandidates; Produces eventCandidatesSels; + Produces eventCandidatesSelsExtra; std::vector fwdSelectors; std::vector barrelSelectors; @@ -57,14 +59,23 @@ struct UpcCandProducer { MutableConfigurable inputCuts{"UPCCuts", {}, "UPC event cuts"}; // candidate producer flags - Configurable fFilterFT0{"filterFT0", 0, "Filter candidates by FT0"}; - Configurable fFilterFV0{"filterFV0", 0, "Filter candidates by FV0"}; + Configurable fFilterFT0{"filterFT0", -1, "Filter candidates by FT0 TOR(central) or T0A(fwd)"}; + Configurable fFilterTSC{"filterTSC", -1, "Filter candidates by FT0 TSC"}; + Configurable fFilterTVX{"filterTVX", -1, "Filter candidates by FT0 TVX"}; + Configurable fFilterFV0{"filterFV0", -1, "Filter candidates by FV0A"}; + + Configurable fBcWindowMCH{"bcWindowMCH", 20, "Time window for MCH-MID to MCH-only matching for Muon candidates"}; + Configurable fBcWindowITSTPC{"bcWindowITSTPC", 20, "Time window for TOF/ITS-TPC to ITS-TPC matching for Central candidates"}; + + Configurable fMuonTrackTShift{"muonTrackTShift", 0, "Time shift for Muon tracks"}; + Configurable fBarrelTrackTShift{"barrelTrackTShift", 0, "Time shift for Central Barrel tracks"}; + + Configurable fNFwdProngs{"nFwdProngs", 0, "Matched forward tracks per candidate"}; + Configurable fNBarProngs{"nBarProngs", 2, "Matched barrel tracks per candidate"}; + Configurable fFilterRangeFT0{"filterRangeFT0", 0, "BC range (+/-) for filtration by FT0 signals"}; Configurable fSearchITSTPC{"searchITSTPC", 0, "Search for ITS-TPC tracks near candidates"}; Configurable fSearchRangeITSTPC{"searchRangeITSTPC", 50, "BC range for ITS-TPC tracks search wrt TOF tracks"}; - Configurable fNFwdProngs{"nFwdProngs", 0, "Matched forward tracks per candidate"}; - Configurable fNBarProngs{"nBarProngs", 2, "Matched barrel tracks per candidate"}; - Configurable fMuonTrackTShift{"muonTrackTShift", 0, "Time shift for Muon tracks"}; // QA histograms HistogramRegistry histRegistry{"HistRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -87,6 +98,9 @@ struct UpcCandProducer { upcCuts = (UPCCutparHolder)inputCuts; + const AxisSpec axisBcDist{201, 0.5, 200.5, ""}; + histRegistry.add("hDistToITSTPC", "", kTH1F, {axisBcDist}); + const AxisSpec axisSelFwd{upchelpers::kNFwdSels, 0., static_cast(upchelpers::kNFwdSels), ""}; histRegistry.add("MuonsSelCounter", "", kTH1F, {axisSelFwd}); histRegistry.get(HIST("MuonsSelCounter"))->GetXaxis()->SetBinLabel(upchelpers::kFwdSelAll + 1, "All"); @@ -142,46 +156,51 @@ struct UpcCandProducer { bool applyBarCuts(const BarrelTracks::iterator& track) { - histRegistry.fill(HIST("BarrelsSelCounter"), upchelpers::kBarrelSelAll, 1); - // using any cuts at all? - if (!upcCuts.getUseBarCuts()) { + if (!upcCuts.getUseBarCuts()) return true; + if (upcCuts.getAmbigSwitch() == 1 && !track.isPVContributor()) + return false; + if (upcCuts.getRequireTOF() && !track.hasTOF()) + return false; + if (track.pt() < upcCuts.getBarPtLow()) + return false; + if (track.pt() > upcCuts.getBarPtHigh()) + return false; + if (track.eta() < upcCuts.getBarEtaLow()) + return false; + if (track.eta() > upcCuts.getBarEtaHigh()) + return false; + if (track.itsNCls() < static_cast(upcCuts.getITSNClusLow())) + return false; + if (track.itsNCls() > static_cast(upcCuts.getITSNClusHigh())) + return false; + if (track.itsChi2NCl() < upcCuts.getITSChi2Low()) + return false; + if (track.itsChi2NCl() > upcCuts.getITSChi2High()) + return false; + if (track.tpcNClsFound() < static_cast(upcCuts.getTPCNClsLow())) + return false; + if (track.tpcNClsFound() > static_cast(upcCuts.getTPCNClsHigh())) + return false; + if (track.tpcChi2NCl() < upcCuts.getTPCChi2Low()) + return false; + if (track.tpcChi2NCl() > upcCuts.getTPCChi2High()) + return false; + if (track.dcaZ() < upcCuts.getDcaZLow()) + return false; + if (track.dcaZ() > upcCuts.getDcaZHigh()) + return false; + if (upcCuts.getCheckMaxDcaXY()) { + float dca = track.dcaXY(); + float maxDCA = 0.0105f + 0.0350f / pow(track.pt(), 1.1f); + if (dca > maxDCA) + return false; } - - upchelpers::applyBarrelCuts(upcCuts, track, barrelSelectors); - - if (barrelSelectors[upchelpers::kBarrelSelHasTOF]) - histRegistry.fill(HIST("BarrelsSelCounter"), upchelpers::kBarrelSelHasTOF, 1); - if (barrelSelectors[upchelpers::kBarrelSelPt]) - histRegistry.fill(HIST("BarrelsSelCounter"), upchelpers::kBarrelSelPt, 1); - if (barrelSelectors[upchelpers::kBarrelSelEta]) - histRegistry.fill(HIST("BarrelsSelCounter"), upchelpers::kBarrelSelEta, 1); - if (barrelSelectors[upchelpers::kBarrelSelITSNCls]) - histRegistry.fill(HIST("BarrelsSelCounter"), upchelpers::kBarrelSelITSNCls, 1); - if (barrelSelectors[upchelpers::kBarrelSelITSChi2]) - histRegistry.fill(HIST("BarrelsSelCounter"), upchelpers::kBarrelSelITSChi2, 1); - if (barrelSelectors[upchelpers::kBarrelSelTPCNCls]) - histRegistry.fill(HIST("BarrelsSelCounter"), upchelpers::kBarrelSelTPCNCls, 1); - if (barrelSelectors[upchelpers::kBarrelSelTPCChi2]) - histRegistry.fill(HIST("BarrelsSelCounter"), upchelpers::kBarrelSelTPCChi2, 1); - if (barrelSelectors[upchelpers::kBarrelSelDCAXY]) - histRegistry.fill(HIST("BarrelsSelCounter"), upchelpers::kBarrelSelDCAXY, 1); - if (barrelSelectors[upchelpers::kBarrelSelDCAZ]) - histRegistry.fill(HIST("BarrelsSelCounter"), upchelpers::kBarrelSelDCAZ, 1); - - bool pass = barrelSelectors[upchelpers::kBarrelSelPt] && - barrelSelectors[upchelpers::kBarrelSelEta] && - barrelSelectors[upchelpers::kBarrelSelITSNCls] && - barrelSelectors[upchelpers::kBarrelSelITSChi2] && - barrelSelectors[upchelpers::kBarrelSelTPCNCls] && - barrelSelectors[upchelpers::kBarrelSelTPCChi2] && - barrelSelectors[upchelpers::kBarrelSelDCAXY] && - barrelSelectors[upchelpers::kBarrelSelDCAZ]; - return pass; + return true; } - uint64_t findClosestBC(uint64_t globalBC, std::map& bcs) + auto findClosestBC(uint64_t globalBC, std::map& bcs) { auto it = bcs.lower_bound(globalBC); auto bc1 = it->first; @@ -211,6 +230,27 @@ struct UpcCandProducer { return (dbc1 <= dbc2) ? it1 : it2; } + auto findClosestTrackBCiterNotEq(uint64_t globalBC, std::vector& bcs) + { + auto it = std::find_if( + bcs.begin(), + bcs.end(), + [globalBC](const auto& v) { + return v.first > globalBC; + }); + auto bc1 = it->first; + auto it1 = it; + if (it != bcs.begin()) + --it; + if (it->first == globalBC) + --it; + auto it2 = it; + auto bc2 = it->first; + auto dbc1 = bc1 >= globalBC ? bc1 - globalBC : globalBC - bc1; + auto dbc2 = bc2 >= globalBC ? bc2 - globalBC : globalBC - bc2; + return (dbc1 <= dbc2) ? it1 : it2; + } + void skimMCInfo(o2::aod::McCollisions const& mcCollisions, o2::aod::McParticles const& mcParticles, BCsWithBcSels const& bcs) @@ -326,18 +366,18 @@ struct UpcCandProducer { void fillBarrelTracks(BarrelTracks const& tracks, std::vector const& trackIDs, int32_t candID, - uint64_t bc, + uint64_t globalBC, + uint64_t closestBcITSTPC, const o2::aod::McTrackLabels* mcTrackLabels, std::unordered_map& ambBarrelTrBCs) { for (auto trackID : trackIDs) { const auto& track = tracks.iteratorAt(trackID); double trTime = track.trackTime() - std::round(track.trackTime() / o2::constants::lhc::LHCBunchSpacingNS) * o2::constants::lhc::LHCBunchSpacingNS; - int64_t colId = -1; - if (ambBarrelTrBCs.find(trackID) == ambBarrelTrBCs.end()) { - colId = track.collisionId(); - } - udTracks(candID, track.px(), track.py(), track.pz(), track.sign(), bc, trTime, track.trackTimeRes()); + int64_t colId = track.collisionId() >= 0 ? track.collisionId() : -1; + if (!track.hasTOF() && closestBcITSTPC != std::numeric_limits::max()) + trTime = (static_cast(globalBC) - static_cast(closestBcITSTPC)) * o2::constants::lhc::LHCBunchSpacingNS; // track time relative to TOF track + udTracks(candID, track.px(), track.py(), track.pz(), track.sign(), globalBC, trTime, track.trackTimeRes()); udTracksExtra(track.tpcInnerParam(), track.itsClusterMap(), track.tpcNClsFindable(), track.tpcNClsFindableMinusFound(), track.tpcNClsFindableMinusCrossedRows(), track.tpcNClsShared(), track.trdPattern(), track.itsChi2NCl(), track.tpcChi2NCl(), track.trdChi2(), track.tofChi2(), track.tpcSignal(), track.tofSignal(), track.trdSignal(), track.length(), track.tofExpMom(), track.detectorMap()); @@ -522,8 +562,10 @@ struct UpcCandProducer { v.emplace_back(std::make_pair(bc, std::vector({trkId}))); } - void collectBarrelTracks(std::vector& bcsMatchedTrIdsA, - std::vector& bcsMatchedTrIdsB, + // trackType == 0 -> hasTOF + // trackType == 1 -> hasITS and not hasTOF + void collectBarrelTracks(std::vector& bcsMatchedTrIds, + int trackType, BCsWithBcSels const& bcs, o2::aod::Collisions const& collisions, BarrelTracks const& barrelTracks, @@ -531,34 +573,31 @@ struct UpcCandProducer { std::unordered_map& ambBarrelTrBCs) { for (const auto& trk : barrelTracks) { + if (!trk.hasTPC()) + continue; + if (trackType == 0 && !trk.hasTOF()) + continue; + if (trackType == 1 && !(trk.hasITS() && !trk.hasTOF())) + continue; if (!applyBarCuts(trk)) continue; int64_t trkId = trk.globalIndex(); int32_t nContrib = -1; uint64_t trackBC = 0; - auto ambIter = ambBarrelTrBCs.find(trkId); - if (ambIter == ambBarrelTrBCs.end()) { + if (trk.has_collision()) { const auto& col = trk.collision(); nContrib = col.numContrib(); trackBC = col.bc_as().globalBC(); } else { - trackBC = ambIter->second; + auto ambIter = ambBarrelTrBCs.find(trkId); + if (ambIter != ambBarrelTrBCs.end()) + trackBC = ambIter->second; } - int64_t tint = TMath::FloorNint(trk.trackTime() / o2::constants::lhc::LHCBunchSpacingNS); + int64_t tint = TMath::FloorNint(trk.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + static_cast(fBarrelTrackTShift)); uint64_t bc = trackBC + tint; - if (bc > fMaxBC) - continue; - bool checkNContrib = nContrib <= upcCuts.getMaxNContrib(); - if (!checkNContrib) + if (nContrib > upcCuts.getMaxNContrib()) continue; - bool needITSITS = upcCuts.getProduceITSITS() && (trk.hasTOF() || (trk.hasITS() && trk.hasTPC())); - bool needAllTOF = !upcCuts.getProduceITSITS() && !upcCuts.getRequireITSTPC() && trk.hasTOF(); - bool needTOFWithITS = !upcCuts.getProduceITSITS() && upcCuts.getRequireITSTPC() && trk.hasTOF() && trk.hasITS() && trk.hasTPC(); - bool addToA = needITSITS || needAllTOF || needTOFWithITS; - if (addToA) - addTrack(bcsMatchedTrIdsA, bc, trkId); - if (fSearchITSTPC == 1 && !trk.hasTOF() && trk.hasITS() && trk.hasTPC()) - addTrack(bcsMatchedTrIdsB, bc, trkId); + addTrack(bcsMatchedTrIds, bc, trkId); } } @@ -645,89 +684,206 @@ struct UpcCandProducer { o2::aod::FV0As const& fv0as, const o2::aod::McTrackLabels* mcBarrelTrackLabels) { - fMaxBC = bcs.iteratorAt(bcs.size() - 1).globalBC(); // restrict ITS-TPC track search to [0, fMaxBC] - // pairs of global BCs and vectors of matched track IDs: std::vector bcsMatchedTrIdsTOF; std::vector bcsMatchedTrIdsITSTPC; // trackID -> index in amb. track table std::unordered_map ambBarrelTrBCs; - collectAmbTrackBCs<0>(ambBarrelTrBCs, ambBarrelTracks); + if (upcCuts.getAmbigSwitch() != 1) + collectAmbTrackBCs<0>(ambBarrelTrBCs, ambBarrelTracks); - collectBarrelTracks(bcsMatchedTrIdsTOF, bcsMatchedTrIdsITSTPC, + collectBarrelTracks(bcsMatchedTrIdsTOF, + 0, bcs, collisions, barrelTracks, ambBarrelTracks, ambBarrelTrBCs); - uint32_t nBCsWithITSTPC = bcsMatchedTrIdsITSTPC.size(); + collectBarrelTracks(bcsMatchedTrIdsITSTPC, + 1, + bcs, collisions, + barrelTracks, ambBarrelTracks, ambBarrelTrBCs); std::sort(bcsMatchedTrIdsTOF.begin(), bcsMatchedTrIdsTOF.end(), [](const auto& left, const auto& right) { return left.first < right.first; }); std::sort(bcsMatchedTrIdsITSTPC.begin(), bcsMatchedTrIdsITSTPC.end(), [](const auto& left, const auto& right) { return left.first < right.first; }); - if (nBCsWithITSTPC > 0 && fSearchITSTPC == 1) { - std::unordered_set matchedTracks; - for (auto& pair : bcsMatchedTrIdsTOF) { - uint64_t bc = pair.first; - auto& trackIds = pair.second; - uint32_t nTOFtracks = trackIds.size(); - if (nTOFtracks > fNBarProngs) // too many TOF tracks?! - continue; - if (nTOFtracks == fNBarProngs) { // check for ITS-TPC tracks - std::vector tracks; - tracks.reserve(fNBarProngs * 2); // precautions - int32_t res = searchTracks(bc, fSearchRangeITSTPC, 0, tracks, bcsMatchedTrIdsITSTPC, matchedTracks, true); - if (res < 0) { // too many tracks nearby -> rejecting - trackIds.push_back(0); - continue; - } - } - if (nTOFtracks < fNBarProngs && !upcCuts.getRequireTOF()) { // add ITS-TPC track if needed - uint32_t tracksToFind = fNBarProngs - nTOFtracks; - std::vector tracks; - tracks.reserve(fNBarProngs * 2); // precautions - int32_t res = searchTracks(bc, fSearchRangeITSTPC, tracksToFind, tracks, bcsMatchedTrIdsITSTPC, matchedTracks, true); - if (res < 0) // too many or not enough tracks nearby -> rejecting - continue; - trackIds.insert(trackIds.end(), tracks.begin(), tracks.end()); - } - } + std::map mapGlobalBcWithTOR{}; + std::map mapGlobalBcWithTVX{}; + std::map mapGlobalBcWithTSC{}; + for (auto ft0 : ft0s) { + uint64_t globalBC = ft0.bc_as().globalBC(); + int32_t globalIndex = ft0.globalIndex(); + if (!(std::abs(ft0.timeA()) > 2.f && std::abs(ft0.timeC()) > 2.f)) + mapGlobalBcWithTOR[globalBC] = globalIndex; + if (TESTBIT(ft0.triggerMask(), o2::fit::Triggers::bitVertex)) // TVX + mapGlobalBcWithTVX[globalBC] = globalIndex; + if (TESTBIT(ft0.triggerMask(), o2::fit::Triggers::bitVertex) && + (TESTBIT(ft0.triggerMask(), o2::fit::Triggers::bitCen) || + TESTBIT(ft0.triggerMask(), o2::fit::Triggers::bitSCen))) // TVX & (TSC | TCE) + mapGlobalBcWithTSC[globalBC] = globalIndex; } - bcsMatchedTrIdsITSTPC.clear(); + std::map mapGlobalBcWithV0A{}; + for (auto fv0a : fv0as) { + if (std::abs(fv0a.time()) > 15.f) + continue; + uint64_t globalBC = fv0a.bc_as().globalBC(); + mapGlobalBcWithV0A[globalBC] = fv0a.globalIndex(); + } + + auto nTORs = mapGlobalBcWithTOR.size(); + auto nTSCs = mapGlobalBcWithTSC.size(); + auto nTVXs = mapGlobalBcWithTVX.size(); + auto nFV0As = mapGlobalBcWithV0A.size(); + auto nBcsWithITSTPC = bcsMatchedTrIdsITSTPC.size(); // todo: calculate position of UD collision? float dummyX = 0.; float dummyY = 0.; float dummyZ = 0.; - std::vector> indexBCglId; - indexBCglId.reserve(bcs.size()); - for (const auto& bc : bcs) { - if (bc.has_foundFT0() || bc.has_foundFV0() || bc.has_foundFDD()) - indexBCglId.emplace_back(std::make_pair(bc.globalBC(), bc.globalIndex())); - } - int32_t runNumber = bcs.iteratorAt(0).runNumber(); - // storing n-prong matches + auto updateFitInfo = [&](uint64_t globalBC, upchelpers::FITInfo& fitInfo) { + fitInfo.timeFT0A = -999.f; + fitInfo.timeFT0C = -999.f; + fitInfo.timeFV0A = -999.f; + fitInfo.ampFT0A = 0.f; + fitInfo.ampFT0C = 0.f; + fitInfo.ampFV0A = 0.f; + fitInfo.BBFT0Apf = -999; + fitInfo.BBFV0Apf = -999; + fitInfo.distClosestBcTOR = 999; + fitInfo.distClosestBcTSC = 999; + fitInfo.distClosestBcTVX = 999; + fitInfo.distClosestBcV0A = 999; + if (nTORs > 0) { + uint64_t closestBcTOR = findClosestBC(globalBC, mapGlobalBcWithTOR); + fitInfo.distClosestBcTOR = globalBC - static_cast(closestBcTOR); + if (std::abs(fitInfo.distClosestBcTOR) <= fFilterFT0) + return false; + auto ft0Id = mapGlobalBcWithTOR.at(closestBcTOR); + auto ft0 = ft0s.iteratorAt(ft0Id); + fitInfo.timeFT0A = ft0.timeA(); + fitInfo.timeFT0C = ft0.timeC(); + const auto& t0AmpsA = ft0.amplitudeA(); + const auto& t0AmpsC = ft0.amplitudeC(); + for (auto amp : t0AmpsA) + fitInfo.ampFT0A += amp; + for (auto amp : t0AmpsC) + fitInfo.ampFT0C += amp; + } + if (nTSCs > 0) { + uint64_t closestBcTSC = findClosestBC(globalBC, mapGlobalBcWithTSC); + fitInfo.distClosestBcTSC = globalBC - static_cast(closestBcTSC); + if (std::abs(fitInfo.distClosestBcTSC) <= fFilterTSC) + return false; + } + if (nTVXs > 0) { + uint64_t closestBcTVX = findClosestBC(globalBC, mapGlobalBcWithTVX); + fitInfo.distClosestBcTVX = globalBC - static_cast(closestBcTVX); + if (std::abs(fitInfo.distClosestBcTVX) <= fFilterTVX) + return false; + } + if (nFV0As > 0) { + uint64_t closestBcV0A = findClosestBC(globalBC, mapGlobalBcWithV0A); + fitInfo.distClosestBcV0A = globalBC - static_cast(closestBcV0A); + if (std::abs(fitInfo.distClosestBcV0A) <= fFilterFV0) + return false; + auto fv0aId = mapGlobalBcWithV0A.at(closestBcV0A); + auto fv0a = fv0as.iteratorAt(fv0aId); + fitInfo.timeFV0A = fv0a.time(); + const auto& v0Amps = fv0a.amplitude(); + for (auto amp : v0Amps) + fitInfo.ampFV0A += amp; + } + return true; + }; + + // candidates with TOF int32_t candID = 0; - for (const auto& item : bcsMatchedTrIdsTOF) { - auto& barrelTrackIDs = item.second; - uint16_t numContrib = barrelTrackIDs.size(); - // sanity check - if (numContrib != fNBarProngs) + for (auto& pair : bcsMatchedTrIdsTOF) { + auto globalBC = pair.first; + auto& barrelTrackIDs = pair.second; + int32_t nTOFs = barrelTrackIDs.size(); + if (nTOFs > fNBarProngs) // too many tracks continue; - // fetching FT0, FDD, FV0 information - // if there is no relevant signal, dummy info will be used - uint64_t bc = item.first; + auto closestBcITSTPC = std::numeric_limits::max(); + if (nTOFs < fNBarProngs && nBcsWithITSTPC > 0) { // adding ITS-TPC tracks + auto itClosestBcITSTPC = findClosestTrackBCiter(globalBC, bcsMatchedTrIdsITSTPC); + if (itClosestBcITSTPC == bcsMatchedTrIdsITSTPC.end()) + continue; + closestBcITSTPC = itClosestBcITSTPC->first; + int64_t distClosestBcITSTPC = globalBC - static_cast(closestBcITSTPC); + histRegistry.fill(HIST("hDistToITSTPC"), std::abs(distClosestBcITSTPC)); + if (std::abs(distClosestBcITSTPC) > fBcWindowITSTPC) + continue; + auto& itstpcTracks = itClosestBcITSTPC->second; + int32_t nITSTPCs = itstpcTracks.size(); + if ((nTOFs + nITSTPCs) != fNBarProngs) + continue; + barrelTrackIDs.insert(barrelTrackIDs.end(), itstpcTracks.begin(), itstpcTracks.end()); + itClosestBcITSTPC->second.clear(); // BC is matched to BC with TOF, removing tracks, but leaving BC + } upchelpers::FITInfo fitInfo{}; - processFITInfo(fitInfo, bc, indexBCglId, bcs, ft0s, fdds, fv0as); - if (fFilterFT0) { - if (!checkFT0(fitInfo, true)) + if (!updateFitInfo(globalBC, fitInfo)) + continue; + uint16_t numContrib = fNBarProngs; + int8_t netCharge = 0; + float RgtrwTOF = 0.; + for (auto id : barrelTrackIDs) { + const auto& tr = barrelTracks.iteratorAt(id); + netCharge += tr.sign(); + if (tr.hasTOF()) { + RgtrwTOF++; + } + } + RgtrwTOF = RgtrwTOF / static_cast(numContrib); + // store used tracks + fillBarrelTracks(barrelTracks, barrelTrackIDs, candID, globalBC, closestBcITSTPC, mcBarrelTrackLabels, ambBarrelTrBCs); + eventCandidates(globalBC, runNumber, dummyX, dummyY, dummyZ, numContrib, netCharge, RgtrwTOF); + eventCandidatesSels(fitInfo.ampFT0A, fitInfo.ampFT0C, fitInfo.timeFT0A, fitInfo.timeFT0C, fitInfo.triggerMaskFT0, + fitInfo.ampFDDA, fitInfo.ampFDDC, fitInfo.timeFDDA, fitInfo.timeFDDC, fitInfo.triggerMaskFDD, + fitInfo.ampFV0A, fitInfo.timeFV0A, fitInfo.triggerMaskFV0A, + fitInfo.BBFT0Apf, fitInfo.BBFT0Cpf, fitInfo.BGFT0Apf, fitInfo.BGFT0Cpf, + fitInfo.BBFV0Apf, fitInfo.BGFV0Apf, + fitInfo.BBFDDApf, fitInfo.BBFDDCpf, fitInfo.BGFDDApf, fitInfo.BGFDDCpf); + eventCandidatesSelsExtra(fitInfo.distClosestBcTOR, + fitInfo.distClosestBcTSC, + fitInfo.distClosestBcTVX, + fitInfo.distClosestBcV0A, 999); + candID++; + } + + // candidates without TOF + for (auto& pair : bcsMatchedTrIdsITSTPC) { + auto globalBC = pair.first; + auto& barrelTrackIDs = pair.second; + int32_t nThisITSTPCs = barrelTrackIDs.size(); + if (nThisITSTPCs > fNBarProngs || nThisITSTPCs == 0) // too many tracks / already matched to TOF + continue; + auto closestBcITSTPC = std::numeric_limits::max(); + if (nThisITSTPCs < fNBarProngs) { // adding ITS-TPC tracks + auto itClosestBcITSTPC = findClosestTrackBCiterNotEq(globalBC, bcsMatchedTrIdsITSTPC); + if (itClosestBcITSTPC == bcsMatchedTrIdsITSTPC.end()) + continue; + closestBcITSTPC = itClosestBcITSTPC->first; + int64_t distClosestBcITSTPC = globalBC - static_cast(closestBcITSTPC); + histRegistry.fill(HIST("hDistToITSTPC"), std::abs(distClosestBcITSTPC)); + if (std::abs(distClosestBcITSTPC) > fBcWindowITSTPC) + continue; + auto& itstpcTracks = itClosestBcITSTPC->second; + int32_t nITSTPCs = itstpcTracks.size(); + if ((nThisITSTPCs + nITSTPCs) != fNBarProngs) continue; + barrelTrackIDs.insert(barrelTrackIDs.end(), itstpcTracks.begin(), itstpcTracks.end()); + itClosestBcITSTPC->second.clear(); } + upchelpers::FITInfo fitInfo{}; + if (!updateFitInfo(globalBC, fitInfo)) + continue; + uint16_t numContrib = fNBarProngs; int8_t netCharge = 0; float RgtrwTOF = 0.; for (auto id : barrelTrackIDs) { @@ -739,19 +895,25 @@ struct UpcCandProducer { } RgtrwTOF = RgtrwTOF / static_cast(numContrib); // store used tracks - fillBarrelTracks(barrelTracks, barrelTrackIDs, candID, bc, mcBarrelTrackLabels, ambBarrelTrBCs); - eventCandidates(bc, runNumber, dummyX, dummyY, dummyZ, numContrib, netCharge, RgtrwTOF); + fillBarrelTracks(barrelTracks, barrelTrackIDs, candID, globalBC, closestBcITSTPC, mcBarrelTrackLabels, ambBarrelTrBCs); + eventCandidates(globalBC, runNumber, dummyX, dummyY, dummyZ, numContrib, netCharge, RgtrwTOF); eventCandidatesSels(fitInfo.ampFT0A, fitInfo.ampFT0C, fitInfo.timeFT0A, fitInfo.timeFT0C, fitInfo.triggerMaskFT0, fitInfo.ampFDDA, fitInfo.ampFDDC, fitInfo.timeFDDA, fitInfo.timeFDDC, fitInfo.triggerMaskFDD, fitInfo.ampFV0A, fitInfo.timeFV0A, fitInfo.triggerMaskFV0A, fitInfo.BBFT0Apf, fitInfo.BBFT0Cpf, fitInfo.BGFT0Apf, fitInfo.BGFT0Cpf, fitInfo.BBFV0Apf, fitInfo.BGFV0Apf, fitInfo.BBFDDApf, fitInfo.BBFDDCpf, fitInfo.BGFDDApf, fitInfo.BGFDDCpf); + eventCandidatesSelsExtra(fitInfo.distClosestBcTOR, + fitInfo.distClosestBcTSC, + fitInfo.distClosestBcTVX, + fitInfo.distClosestBcV0A, + 999); + barrelTrackIDs.clear(); candID++; } - indexBCglId.clear(); ambBarrelTrBCs.clear(); + bcsMatchedTrIdsITSTPC.clear(); bcsMatchedTrIdsTOF.clear(); } @@ -791,7 +953,13 @@ struct UpcCandProducer { bcs, collisions, fwdTracks, ambFwdTracks, ambFwdTrBCs); - collectBarrelTracks(bcsMatchedTrIdsTOF, bcsMatchedTrIdsITSTPC, + collectBarrelTracks(bcsMatchedTrIdsTOF, + 0, + bcs, collisions, + barrelTracks, ambBarrelTracks, ambBarrelTrBCs); + + collectBarrelTracks(bcsMatchedTrIdsITSTPC, + 1, bcs, collisions, barrelTracks, ambBarrelTracks, ambBarrelTrBCs); @@ -904,7 +1072,7 @@ struct UpcCandProducer { RgtrwTOF = RgtrwTOF / static_cast(numContrib); // store used tracks fillFwdTracks(fwdTracks, fwdTrackIDs, candID, bc, bc, mcFwdTrackLabels); - fillBarrelTracks(barrelTracks, barrelTrackIDs, candID, bc, mcBarrelTrackLabels, ambBarrelTrBCs); + fillBarrelTracks(barrelTracks, barrelTrackIDs, candID, bc, bc, mcBarrelTrackLabels, ambBarrelTrBCs); eventCandidates(bc, runNumber, dummyX, dummyY, dummyZ, numContrib, netCharge, RgtrwTOF); eventCandidatesSels(fitInfo.ampFT0A, fitInfo.ampFT0C, fitInfo.timeFT0A, fitInfo.timeFT0C, fitInfo.triggerMaskFT0, fitInfo.ampFDDA, fitInfo.ampFDDC, fitInfo.timeFDDA, fitInfo.timeFDDC, fitInfo.triggerMaskFDD, @@ -957,7 +1125,7 @@ struct UpcCandProducer { std::map mapGlobalBcWithT0{}; for (auto ft0 : ft0s) { - if (std::abs(ft0.timeA()) > 2.) + if (std::abs(ft0.timeA()) > 2.f) continue; uint64_t globalBC = ft0.bc_as().globalBC(); mapGlobalBcWithT0[globalBC] = ft0.globalIndex(); @@ -965,7 +1133,7 @@ struct UpcCandProducer { std::map mapGlobalBcWithV0A{}; for (auto fv0a : fv0as) { - if (std::abs(fv0a.time()) > 15.) + if (std::abs(fv0a.time()) > 15.f) continue; uint64_t globalBC = fv0a.bc_as().globalBC(); mapGlobalBcWithV0A[globalBC] = fv0a.globalIndex(); @@ -995,7 +1163,7 @@ struct UpcCandProducer { auto itClosestBcMCH = findClosestTrackBCiter(globalBC, bcsMatchedTrIdsMCH); closestBcMCH = itClosestBcMCH->first; int64_t distClosestBcMCH = globalBC - static_cast(closestBcMCH); - if (std::abs(distClosestBcMCH) > 20) + if (std::abs(distClosestBcMCH) > fBcWindowMCH) continue; auto& mchTracks = itClosestBcMCH->second; int32_t nMCHs = mchTracks.size(); diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index 1e0d98ed180..cdf9c2d6786 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -53,3 +53,8 @@ o2physics_add_dpl_workflow(upc-mft SOURCES upcMft.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsBase O2::DetectorsCommonDataFormats COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(upc-veto + SOURCES upcVetoAnalysis.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase + COMPONENT_NAME Analysis) diff --git a/PWGUD/Tasks/upcVetoAnalysis.cxx b/PWGUD/Tasks/upcVetoAnalysis.cxx new file mode 100644 index 00000000000..565a7725446 --- /dev/null +++ b/PWGUD/Tasks/upcVetoAnalysis.cxx @@ -0,0 +1,233 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" + +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/LHCConstants.h" +#include "DataFormatsFIT/Triggers.h" +#include "DataFormatsParameters/GRPLHCIFData.h" + +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct UpcVetoAnalysis { + int32_t fRun{0}; + + float ampLo{0.f}; + float ampHi{20000.f}; + float damp{100.f}; + int32_t nAmpThr; + int32_t nBCRanges{5}; + + std::bitset bcPatternB; + + HistogramRegistry hr{"hr", {}, OutputObjHandlingPolicy::AnalysisObject}; + + void getBCPattern(const o2::aod::BCs::iterator& bc) + { + fRun = bc.runNumber(); + o2::ccdb::CcdbApi ccdb_api; + ccdb_api.init("http://alice-ccdb.cern.ch"); + std::map metadata, headers; + headers = ccdb_api.retrieveHeaders(Form("RCT/Info/RunInformation/%i", fRun), metadata, -1); + int64_t ts = std::atol(headers["SOR"].c_str()); + LOGP(info, "ts={}", ts); + auto grplhcif = ccdb_api.retrieveFromTFileAny("GLO/Config/GRPLHCIF", metadata, ts); + bcPatternB = grplhcif->getBunchFilling().getBCPattern(); + } + + auto findClosestBCIter(int64_t globalBC, std::vector& bcs) + { + auto it = std::lower_bound(bcs.begin(), bcs.end(), globalBC); + auto bc1 = *it; + auto it1 = it; + if (it != bcs.begin()) + --it; + auto it2 = it; + auto bc2 = *it; + auto dbc1 = bc1 >= globalBC ? bc1 - globalBC : globalBC - bc1; + auto dbc2 = bc2 >= globalBC ? bc2 - globalBC : globalBC - bc2; + return (dbc1 <= dbc2) ? it1 : it2; + } + + template + T2 findMaxInRange(int32_t range, + int64_t cent, + const typename std::vector::iterator startIt, + std::vector& vPosi, + std::vector& vVals) + { + auto pos = cent; + auto it = startIt; + T2 max = -999; + while (pos - cent < range && it != vPosi.end()) { + auto idx = it - vPosi.begin(); + if (vVals[idx] > max) + max = vVals[idx]; + ++it; + pos = *it; + } + it = startIt; + pos = cent; + while (cent - pos < range && it >= vPosi.begin()) { + --it; + pos = *it; + auto idx = it - vPosi.begin(); + if (vVals[idx] > max) + max = vVals[idx]; + } + return max; + } + + void init(InitContext&) + { + const AxisSpec axisTrigCounter{1, 0., 1., ""}; + hr.add("hCounterTCE", "", kTH1F, {axisTrigCounter}); + + nAmpThr = (ampHi - ampLo) / damp; + const AxisSpec axisCounters{100, 0.5, 100.5, ""}; + const AxisSpec axisAmp{nAmpThr, ampLo, ampHi, ""}; + const AxisSpec axisAmp2{1000, ampLo, ampHi * 10.f, ""}; + const AxisSpec axisBCRanges{nBCRanges, 10., 60.}; + hr.add("hSelBCsTOR", "", kTH1F, {axisCounters}); + hr.add("hSelBCsTSC", "", kTH1F, {axisCounters}); + hr.add("hSelBCsTVX", "", kTH1F, {axisCounters}); + hr.add("hSelBCsV0A", "", kTH1F, {axisCounters}); + hr.add("hSelBCAmpT0M", "", kTH2F, {axisAmp, axisBCRanges}); + hr.add("hSelBCAmpV0A", "", kTH2F, {axisAmp, axisBCRanges}); + hr.add("hAmpT0M", "", kTH1F, {axisAmp}); + hr.add("hAmpV0A", "", kTH1F, {axisAmp}); + } + + void process(const o2::aod::BCs& bcs, + const o2::aod::FT0s& ft0s, + const o2::aod::FV0As& fv0as) + { + const o2::aod::BCs::iterator& fbc = bcs.begin(); + if (fbc.runNumber() != fRun) + getBCPattern(fbc); + + auto nBCs = bcs.size(); + + std::vector gbcs(nBCs, -1); + std::vector gbcsWithTOR; + std::vector gbcsWithT0; + std::vector gbcsWithTSC; + std::vector gbcsWithTVX; + std::vector gbcsWithV0A; + std::vector ampsT0M; + std::vector ampsV0A; + + int64_t nBCsPat = 0; + for (const o2::aod::BCs::iterator& bc : bcs) { + if (bcPatternB[bc.globalBC() % 3564] == 0) + continue; + gbcs[bc.globalIndex()] = bc.globalBC(); + nBCsPat++; + hr.get(HIST("hSelBCsV0A"))->AddBinContent(1, 1); + hr.get(HIST("hSelBCsTOR"))->AddBinContent(1, 1); + hr.get(HIST("hSelBCsTSC"))->AddBinContent(1, 1); + hr.get(HIST("hSelBCsTVX"))->AddBinContent(1, 1); + } + + for (int32_t i = 1; i <= nBCRanges; ++i) { + auto bcRange = i * 10; + hr.get(HIST("hSelBCAmpT0M"))->Fill(0.f, bcRange, nBCsPat); + hr.get(HIST("hSelBCAmpV0A"))->Fill(0.f, bcRange, nBCsPat); + } + + for (const o2::aod::FV0As::iterator& fv0a : fv0as) { + int64_t globalBC = gbcs[fv0a.bc().globalIndex()]; + if (globalBC == -1) + continue; + if (std::abs(fv0a.time()) > 15.f) + continue; + gbcsWithV0A.push_back(globalBC); + const auto& amps = fv0a.amplitude(); + auto amp = std::accumulate(amps.begin(), amps.end(), 0.f); + ampsV0A.push_back(amp); + hr.get(HIST("hAmpV0A"))->Fill(amp); + } + + for (const o2::aod::FT0s::iterator& ft0 : ft0s) { + if (TESTBIT(ft0.triggerMask(), o2::fit::Triggers::bitVertex) && + TESTBIT(ft0.triggerMask(), o2::fit::Triggers::bitCen)) + hr.get(HIST("hCounterTCE"))->Fill(0); + int64_t globalBC = gbcs[ft0.bc().globalIndex()]; + if (globalBC == -1) + continue; + gbcsWithT0.push_back(globalBC); + const auto& ampsA = ft0.amplitudeA(); + const auto& ampsC = ft0.amplitudeC(); + auto ampA = std::accumulate(ampsA.begin(), ampsA.end(), 0.f); + auto ampC = std::accumulate(ampsC.begin(), ampsC.end(), 0.f); + ampsT0M.push_back(ampA + ampC); + hr.get(HIST("hAmpT0M"))->Fill(ampA + ampC); + if (!(std::abs(ft0.timeA()) > 2.f && std::abs(ft0.timeC()) > 2.f)) // TOR + gbcsWithTOR.push_back(globalBC); + if (TESTBIT(ft0.triggerMask(), o2::fit::Triggers::bitVertex)) // TVX + gbcsWithTVX.push_back(globalBC); + if (TESTBIT(ft0.triggerMask(), o2::fit::Triggers::bitVertex) && + (TESTBIT(ft0.triggerMask(), o2::fit::Triggers::bitCen) || + TESTBIT(ft0.triggerMask(), o2::fit::Triggers::bitSCen))) // TVX & (TSC | TCE) + gbcsWithTSC.push_back(globalBC); + } + + for (auto gbc : gbcs) { + if (gbc == -1) + continue; + auto bcV0Ait = findClosestBCIter(gbc, gbcsWithV0A); + auto bcTORit = findClosestBCIter(gbc, gbcsWithTOR); + auto bcT0Mit = findClosestBCIter(gbc, gbcsWithT0); + auto bcTSCit = findClosestBCIter(gbc, gbcsWithTSC); + auto bcTVXit = findClosestBCIter(gbc, gbcsWithTVX); + auto bcV0A = bcV0Ait != gbcsWithV0A.end() ? *bcV0Ait : gbc + 999; + auto bcTOR = bcTORit != gbcsWithTOR.end() ? *bcTORit : gbc + 999; + auto bcTSC = bcTSCit != gbcsWithTSC.end() ? *bcTSCit : gbc + 999; + auto bcTVX = bcTVXit != gbcsWithTVX.end() ? *bcTVXit : gbc + 999; + auto bcDistV0A = std::abs(gbc - bcV0A); + auto bcDistTOR = std::abs(gbc - bcTOR); + auto bcDistTSC = std::abs(gbc - bcTSC); + auto bcDistTVX = std::abs(gbc - bcTVX); + for (int32_t vetoBC = 1; vetoBC <= 99; ++vetoBC) { + if (bcDistV0A < vetoBC) + hr.get(HIST("hSelBCsV0A"))->AddBinContent(vetoBC + 1, 1); + if (bcDistTOR < vetoBC) + hr.get(HIST("hSelBCsTOR"))->AddBinContent(vetoBC + 1, 1); + if (bcDistTSC < vetoBC) + hr.get(HIST("hSelBCsTSC"))->AddBinContent(vetoBC + 1, 1); + if (bcDistTVX < vetoBC) + hr.get(HIST("hSelBCsTVX"))->AddBinContent(vetoBC + 1, 1); + } + for (int32_t iBCRange = 1; iBCRange <= 5; ++iBCRange) { + auto bcRange = 5 + iBCRange * 10; + auto maxAmpV0A = findMaxInRange(bcRange, gbc, bcV0Ait, gbcsWithV0A, ampsV0A); + auto maxAmpT0M = findMaxInRange(bcRange, gbc, bcT0Mit, gbcsWithT0, ampsT0M); + for (int32_t iamp = 1; iamp <= nAmpThr; ++iamp) { + auto amp = damp * iamp; + if (maxAmpV0A < amp) + hr.get(HIST("hSelBCAmpT0M"))->Fill(amp, bcRange + 1, 1); + if (maxAmpT0M < amp) + hr.get(HIST("hSelBCAmpV0A"))->Fill(amp, bcRange + 1, 1); + } + } + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +}