Skip to content

Commit

Permalink
add a task for dilepton-track-track efficiency calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
zjxiongOvO committed Dec 3, 2024
1 parent 1cf8f9f commit f841204
Show file tree
Hide file tree
Showing 4 changed files with 393 additions and 1 deletion.
11 changes: 11 additions & 0 deletions PWGDQ/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,17 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h
hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt);
hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi);
}
if (!groupStr.CompareTo("mctruth_quad")) {
hm->AddHistogram(histClass, "hMass_defaultDileptonMass", "", false, 1000, 3.0, 5.0, VarManager::kQuadDefaultDileptonMass);
hm->AddHistogram(histClass, "hPt", "", false, 150, 0.0, 15.0, VarManager::kQuadPt);
hm->AddHistogram(histClass, "hMass_defaultDileptonMass_Pt", "", false, 100, 3.0, 5.0, VarManager::kQuadDefaultDileptonMass, 150, 0.0, 15.0, VarManager::kQuadPt);
hm->AddHistogram(histClass, "hQ", "", false, 150, 0.0, 3.0, VarManager::kQ);
hm->AddHistogram(histClass, "hDeltaR1", "", false, 100, 0.0, 10.0, VarManager::kDeltaR1);
hm->AddHistogram(histClass, "hDeltaR2", "", false, 100, 0.0, 10.0, VarManager::kDeltaR2);
hm->AddHistogram(histClass, "hDiTrackMass", "", false, 300, 0.0, 3.0, VarManager::kDitrackMass);
hm->AddHistogram(histClass, "hMCPt_MCRap", "", false, 200, 0.0, 20.0, VarManager::kMCPt, 100, -2.0, 2.0, VarManager::kMCY);
hm->AddHistogram(histClass, "hMCPhi", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kMCPhi);
}
if (!groupStr.CompareTo("mctruth_track")) {
hm->AddHistogram(histClass, "PtMC", "MC pT", false, 200, 0.0, 20.0, VarManager::kMCPt);
hm->AddHistogram(histClass, "EtaMC", "MC #eta", false, 50, -5.0, 5.0, VarManager::kMCEta);
Expand Down
36 changes: 36 additions & 0 deletions PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,8 @@ class VarManager : public TObject
static void FillPairMC(T1 const& t1, T2 const& t2, float* values = nullptr, PairCandidateType pairType = kDecayToEE);
template <typename T1, typename T2, typename T3>
static void FillTripleMC(T1 const& t1, T2 const& t2, T3 const& t3, float* values = nullptr, PairCandidateType pairType = kTripleCandidateToEEPhoton);
template <int candidateType, typename T1, typename T2, typename T3>
static void FillQaudMC(T1 const& t1, T2 const& t2, T3 const& t3, float* values = nullptr);
template <int pairType, uint32_t collFillMap, uint32_t fillMap, typename C, typename T>
static void FillPairVertexing(C const& collision, T const& t1, T const& t2, bool propToSV = false, float* values = nullptr);
template <uint32_t collFillMap, uint32_t fillMap, typename C, typename T>
Expand Down Expand Up @@ -4527,6 +4529,40 @@ void VarManager::FillDileptonTrackTrack(T1 const& dilepton, T2 const& hadron1, T
}
}

//__________________________________________________________________
template <int candidateType, typename T1, typename T2, typename T3>
void VarManager::FillQaudMC(T1 const& dilepton, T2 const& track1, T3 const& track2, float* values)
{
if (!values) {
values = fgValues;
}

double defaultDileptonMass = 3.096;
double hadronMass1 = o2::constants::physics::MassPionCharged;
double hadronMass2 = o2::constants::physics::MassPionCharged;
if (candidateType == kXtoJpsiPiPi) {
defaultDileptonMass = 3.096;
hadronMass1 = o2::constants::physics::MassPionCharged;
hadronMass2 = o2::constants::physics::MassPionCharged;
}

ROOT::Math::PtEtaPhiMVector v1(dilepton.pt(), dilepton.eta(), dilepton.phi(), defaultDileptonMass);
ROOT::Math::PtEtaPhiMVector v2(track1.pt(), track1.eta(), track1.phi(), hadronMass1);
ROOT::Math::PtEtaPhiMVector v3(track2.pt(), track2.eta(), track2.phi(), hadronMass2);
ROOT::Math::PtEtaPhiMVector v123 = v1 + v2 + v3;
ROOT::Math::PtEtaPhiMVector v23 = v2 + v3;
values[kQuadMass] = v123.M();
values[kQuadDefaultDileptonMass] = v123.M();
values[kQuadPt] = v123.Pt();
values[kQuadEta] = v123.Eta();
values[kQuadPhi] = v123.Phi();
values[kQ] = v123.M() - defaultDileptonMass - v23.M();
values[kDeltaR1] = sqrt(pow(v1.Eta() - v2.Eta(), 2) + pow(v1.Phi() - v2.Phi(), 2));
values[kDeltaR2] = sqrt(pow(v1.Eta() - v3.Eta(), 2) + pow(v1.Phi() - v3.Phi(), 2));
values[kDitrackMass] = v23.M();
values[kDitrackPt] = v23.Pt();
}

//__________________________________________________________________
template <int pairType, typename T1, typename T2>
float VarManager::calculatePhiV(T1 const& t1, T2 const& t2)
Expand Down
56 changes: 56 additions & 0 deletions PWGDQ/DataModel/ReducedInfoTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,62 @@ DECLARE_SOA_TABLE(DileptonTrackCandidates, "AOD", "RTDILEPTONTRACK", //!

using DileptonTrackCandidate = DileptonTrackCandidates::iterator;

// candidate information
namespace dileptonTrackTrackCandidate
{
// infotmation about the dilepton-track-track
DECLARE_SOA_COLUMN(Mass, mass, float); //!
DECLARE_SOA_COLUMN(Pt, pt, float); //!
DECLARE_SOA_COLUMN(Eta, eta, float); //!
DECLARE_SOA_COLUMN(Phi, phi, float); //!
DECLARE_SOA_COLUMN(Rap, rap, float); //!
DECLARE_SOA_COLUMN(DeltaQ, deltaQ, float); //!
DECLARE_SOA_COLUMN(R1, r1, float); //! distance between the dilepton and the track1 in theta-phi plane
DECLARE_SOA_COLUMN(R2, r2, float); //! distance between the dilepton and the track2 in theta-phi plane
DECLARE_SOA_COLUMN(DileptonMass, dileptonMass, float); //!
DECLARE_SOA_COLUMN(DileptonPt, dileptonPt, float); //!
DECLARE_SOA_COLUMN(DileptonEta, dileptonEta, float); //!
DECLARE_SOA_COLUMN(DileptonPhi, dileptonPhi, float); //!
DECLARE_SOA_COLUMN(DileptonSign, dileptonSign, int); //!
DECLARE_SOA_COLUMN(DiTracksMass, diTracksMass, float); //!
DECLARE_SOA_COLUMN(DiTracksPt, diTracksPt, float); //!
DECLARE_SOA_COLUMN(TrackPt1, trackPt1, float); //!
DECLARE_SOA_COLUMN(TrackPt2, trackPt2, float); //!
DECLARE_SOA_COLUMN(TrackEta1, trackEta1, float); //!
DECLARE_SOA_COLUMN(TrackEta2, trackEta2, float); //!
DECLARE_SOA_COLUMN(TrackPhi1, trackPhi1, float); //!
DECLARE_SOA_COLUMN(TrackPhi2, trackPhi2, float); //!
DECLARE_SOA_COLUMN(TrackSign1, trackSign1, int); //!
DECLARE_SOA_COLUMN(TrackSign2, trackSign2, int); //!
}

DECLARE_SOA_TABLE(DileptonTrackTrackCandidates, "AOD", "RTDQUADPLET", //!
dileptonTrackTrackCandidate::Mass,
dileptonTrackTrackCandidate::Pt,
dileptonTrackTrackCandidate::Eta,
dileptonTrackTrackCandidate::Phi,
dileptonTrackTrackCandidate::Rap,
dileptonTrackTrackCandidate::DeltaQ,
dileptonTrackTrackCandidate::R1,
dileptonTrackTrackCandidate::R2,
dileptonTrackTrackCandidate::DileptonMass,
dileptonTrackTrackCandidate::DileptonPt,
dileptonTrackTrackCandidate::DileptonEta,
dileptonTrackTrackCandidate::DileptonPhi,
dileptonTrackTrackCandidate::DileptonSign,
dileptonTrackTrackCandidate::DiTracksMass,
dileptonTrackTrackCandidate::DiTracksPt,
dileptonTrackTrackCandidate::TrackPt1,
dileptonTrackTrackCandidate::TrackPt2,
dileptonTrackTrackCandidate::TrackEta1,
dileptonTrackTrackCandidate::TrackEta2,
dileptonTrackTrackCandidate::TrackPhi1,
dileptonTrackTrackCandidate::TrackPhi2,
dileptonTrackTrackCandidate::TrackSign1,
dileptonTrackTrackCandidate::TrackSign2);

using DileptonTrackTrackCandidate = DileptonTrackTrackCandidates::iterator;

namespace v0bits
{
DECLARE_SOA_COLUMN(PIDBit, pidbit, uint8_t); //!
Expand Down
Loading

0 comments on commit f841204

Please sign in to comment.