Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 90 additions & 31 deletions ALICE3/Tasks/alice3-dilepton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@

#include "Math/Vector4D.h"
// O2 includes
#include "Framework/AnalysisTask.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/runDataProcessing.h"
#include "Framework/HistogramRegistry.h"
#include "CommonConstants/PhysicsConstants.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Framework/AnalysisDataModel.h"
#include "ALICE3/DataModel/OTFTOF.h"
#include "ALICE3/DataModel/OTFRICH.h"
#include "ALICE3/DataModel/OTFTOF.h"
#include "ALICE3/DataModel/tracksAlice3.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "CommonConstants/PhysicsConstants.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"

using namespace o2;
using namespace o2::aod;
Expand Down Expand Up @@ -79,7 +80,7 @@
const AxisSpec axisTrackLengthOuterTOF{300, 0., 300., "Track length (cm)"};
const AxisSpec axisEta{1000, -5, 5, "#it{#eta}"};
const AxisSpec axisDCAxy{1000, 0, 20, "DCA_{xy,ll} (#sigma)"};
const AxisSpec axisPhi{360, 0, TMath::TwoPi(), "#it{#varphi} (rad.)"};

Check failure on line 83 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.

Check failure on line 83 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
const AxisSpec axisProdx{2000, -100, 100, "Prod. Vertex X (cm)"};
const AxisSpec axisPrody{2000, -100, 100, "Prod. Vertex Y (cm)"};
const AxisSpec axisProdz{2000, -100, 100, "Prod. Vertex Z (cm)"};
Expand Down Expand Up @@ -128,6 +129,15 @@
registry.addClone("Reconstructed/Pair/ULS/", "Reconstructed/Pair/LSpp/");
registry.addClone("Reconstructed/Pair/ULS/", "Reconstructed/Pair/LSnn/");

registry.add("ReconstructedFiltered/Pair/ULS/Mass", "Pair Mass", kTH1F, {axisM});
registry.add("ReconstructedFiltered/Pair/ULS/Pt", "Pair Pt", kTH1F, {axisPt});
registry.add("ReconstructedFiltered/Pair/ULS/Eta", "Pair Eta", kTH1F, {axisEta});
registry.add("ReconstructedFiltered/Pair/ULS/Phi", "Pair Phi", kTH1F, {axisPhi});
registry.add("ReconstructedFiltered/Pair/ULS/Mass_Pt", "Pair Mass vs. Pt", kTH2F, {axisM, axisPt}, true);

registry.addClone("ReconstructedFiltered/Pair/ULS/", "ReconstructedFiltered/Pair/LSpp/");
registry.addClone("ReconstructedFiltered/Pair/ULS/", "ReconstructedFiltered/Pair/LSnn/");

HistogramConfigSpec hs_rec{HistType::kTHnSparseF, {axisM, axisPt, axisDCAxy}, 3};
registry.add("Reconstructed/Pair/ULS/hs_rec", "", hs_rec);
registry.add("Reconstructed/Pair/LSpp/hs_rec", "", hs_rec);
Expand Down Expand Up @@ -287,6 +297,69 @@
return HFllType::kUndef;
}

template <typename T1, typename T2>
ROOT::Math::PtEtaPhiMVector buildPairDCA(T1 const& t1, T2 const& t2, float& pair_dca_xy)
{

const float dcaXY_t1 = t1.dcaXY();
const float dcaXY_t2 = t2.dcaXY();
const float dcaXY_res_t1 = sqrt(t1.cYY());

Check failure on line 306 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

Check failure on line 306 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
const float dcaXY_res_t2 = sqrt(t2.cYY());

Check failure on line 307 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

Check failure on line 307 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

pair_dca_xy = sqrt((dcaXY_t2 * dcaXY_t2 / dcaXY_res_t2 + dcaXY_t1 * dcaXY_t1 / dcaXY_res_t1) / 2.);

Check failure on line 309 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

Check failure on line 309 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi
ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
return v12;
}

template <PairType pairtype, typename TTracks, typename TMCTracks>
void FillPairRecWithPrefilter(TTracks const& tracks1, TTracks const& tracks2, TMCTracks const& mcParticles)
{
std::vector<uint64_t> prefilteredTracks;
if constexpr (pairtype == PairType::kULS) {
for (auto& [t1, t2] : combinations(soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
if (!t1.has_mcParticle() || !t2.has_mcParticle()) {
continue;
}

float pair_dca_xy = 999.f;
ROOT::Math::PtEtaPhiMVector v12 = buildPairDCA(t1, t2, pair_dca_xy);
// prefilter for low-mass pairs
if (v12.M() > 0.10) {
continue;
}
// prefilter small opening angle pairs
if (std::cos(t1.phi() - t2.phi()) < 0.99) {
continue;
}
prefilteredTracks.push_back(t1.globalIndex());
prefilteredTracks.push_back(t2.globalIndex());

} // end of unlike-sign pair loop

for (auto& [t1, t2] : combinations(soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
// Skipping tracks that are in the prefiltered list
if (std::find(prefilteredTracks.begin(), prefilteredTracks.end(), t1.globalIndex()) != prefilteredTracks.end()) {
continue;
}
if (std::find(prefilteredTracks.begin(), prefilteredTracks.end(), t2.globalIndex()) != prefilteredTracks.end()) {
continue;
}

float pair_dca_xy = 999.f;
ROOT::Math::PtEtaPhiMVector v12 = buildPairDCA(t1, t2, pair_dca_xy);

registry.fill(HIST("ReconstructedFiltered/Pair/ULS/Mass"), v12.M());
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/Pt"), v12.Pt());
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/Eta"), v12.Eta());
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 356 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.

Check failure on line 356 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/Mass_Pt"), v12.M(), v12.Pt());
registry.fill(HIST("ReconstructedFiltered/Pair/ULS/hs_rec"), v12.M(), v12.Pt(), pair_dca_xy);
}
}
}

template <PairType pairtype, typename TTracks, typename TMCTracks>
void FillPairRec(TTracks const& tracks1, TTracks const& tracks2, TMCTracks const& mcParticles)
{
Expand Down Expand Up @@ -314,20 +387,13 @@
}
// auto mother = mcparticles.iteratorAt(motherid);

// float dcaXY_t1 = t1.dcaXY();
// float dcaXY_t2 = t2.dcaXY();
// float dcaXY_res_t1 = sqrt(t1.cYY());
// float dcaXY_res_t2 = sqrt(t2.cYY());

float pair_dca_xy = sqrt((pow(t2.dcaXY() / sqrt(t2.cYY()), 2) + pow(t1.dcaXY() / sqrt(t1.cYY()), 2)) / 2.);
ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi
ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
float pair_dca_xy = 999.f;
ROOT::Math::PtEtaPhiMVector v12 = buildPairDCA(t1, t2, pair_dca_xy);

registry.fill(HIST("Reconstructed/Pair/ULS/Mass"), v12.M());
registry.fill(HIST("Reconstructed/Pair/ULS/Pt"), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/ULS/Eta"), v12.Eta());
registry.fill(HIST("Reconstructed/Pair/ULS/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 396 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.

Check failure on line 396 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
registry.fill(HIST("Reconstructed/Pair/ULS/Mass_Pt"), v12.M(), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/ULS/hs_rec"), v12.M(), v12.Pt(), pair_dca_xy);
} // end of unlike-sign pair loop
Expand Down Expand Up @@ -356,29 +422,22 @@
}
// auto mother = mcparticles.iteratorAt(motherid);

// float dcaXY_t1 = t1.dcaXY();
// float dcaXY_t2 = t2.dcaXY();
// float dcaXY_res_t1 = sqrt(t1.cYY());
// float dcaXY_res_t2 = sqrt(t2.cYY());

float pair_dca_xy = sqrt((pow(t2.dcaXY() / sqrt(t2.cYY()), 2) + pow(t1.dcaXY() / sqrt(t1.cYY()), 2)) / 2.);
ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi
ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
float pair_dca_xy = 999.f;
ROOT::Math::PtEtaPhiMVector v12 = buildPairDCA(t1, t2, pair_dca_xy);

if constexpr (pairtype == PairType::kLSpp) {
registry.fill(HIST("Reconstructed/Pair/LSpp/Mass"), v12.M());
registry.fill(HIST("Reconstructed/Pair/LSpp/Pt"), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/LSpp/Eta"), v12.Eta());
registry.fill(HIST("Reconstructed/Pair/LSpp/Mass_Pt"), v12.M(), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/LSpp/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 433 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.

Check failure on line 433 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
registry.fill(HIST("Reconstructed/Pair/LSpp/hs_rec"), v12.M(), v12.Pt(), pair_dca_xy);
} else if constexpr (pairtype == PairType::kLSnn) {
registry.fill(HIST("Reconstructed/Pair/LSnn/Mass"), v12.M());
registry.fill(HIST("Reconstructed/Pair/LSnn/Pt"), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/LSnn/Eta"), v12.Eta());
registry.fill(HIST("Reconstructed/Pair/LSnn/Mass_Pt"), v12.M(), v12.Pt());
registry.fill(HIST("Reconstructed/Pair/LSnn/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 440 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.

Check failure on line 440 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
registry.fill(HIST("Reconstructed/Pair/LSnn/hs_rec"), v12.M(), v12.Pt(), pair_dca_xy);
}
} // end of like-sign pair loop
Expand Down Expand Up @@ -417,7 +476,7 @@
registry.fill(HIST("Generated/Pair/ULS/Mass"), v12.M());
registry.fill(HIST("Generated/Pair/ULS/Pt"), v12.Pt());
registry.fill(HIST("Generated/Pair/ULS/Eta"), v12.Eta());
registry.fill(HIST("Generated/Pair/ULS/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 479 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.

Check failure on line 479 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
registry.fill(HIST("Generated/Pair/ULS/Mass_Pt"), v12.M(), v12.Pt());
} // end of unlike-sign pair loop

Expand Down Expand Up @@ -451,7 +510,7 @@
registry.fill(HIST("Generated/Pair/LSpp/Mass"), v12.M());
registry.fill(HIST("Generated/Pair/LSpp/Pt"), v12.Pt());
registry.fill(HIST("Generated/Pair/LSpp/Eta"), v12.Eta());
registry.fill(HIST("Generated/Pair/LSpp/Phi"), v12.Phi() < 0.f ? v12.Phi() + TMath::TwoPi() : v12.Phi());

Check failure on line 513 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.

Check failure on line 513 in ALICE3/Tasks/alice3-dilepton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
registry.fill(HIST("Generated/Pair/LSpp/Mass_Pt"), v12.M(), v12.Pt());
} else if constexpr (pairtype == PairType::kLSnn) {
registry.fill(HIST("Generated/Pair/LSnn/Mass"), v12.M());
Expand All @@ -464,6 +523,7 @@
} // end of like-sign pair loop
}
}

// Functions for pid
template <typename TTrack>
bool electronIDTOF(TTrack const& track)
Expand Down Expand Up @@ -545,11 +605,10 @@
Partition<MyFilteredTracksMC> posTracks = o2::aod::track::signed1Pt > 0.f;
Partition<MyFilteredTracksMC> negTracks = o2::aod::track::signed1Pt < 0.f;

void processRec(
const o2::aod::Collisions& collisions,
MyFilteredTracksMC const& tracks,
const o2::aod::McCollisions&,
const aod::McParticles& mcParticles)
void processRec(const o2::aod::Collisions& collisions,
MyFilteredTracksMC const& tracks,
const o2::aod::McCollisions&,
const aod::McParticles& mcParticles)
{
for (const auto& collision : collisions) {
registry.fill(HIST("Reconstructed/Event/VtxX"), collision.posX());
Expand Down
Loading