Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PWGEM/Dilepton/Tasks/dileptonPolarization.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specify task name only when it cannot be derived from the struct name. Only append to the default name.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -70,15 +70,15 @@

struct DileptonPolarization {
// Configurables
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 73 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)

Configurable<int> cfgPairType{"cfgPairType", 0, "0:dielectron, 1:dimuon"};
Configurable<int> cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"};
Configurable<bool> cfgDoMix{"cfgDoMix", true, "flag for event mixing"};
// Configurable<int> ndepth{"ndepth", 10000, "depth for event mixing"};
Configurable<uint64_t> ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"};

Check failure on line 79 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis ConfVtxBins{"ConfVtxBins", {10, -10.0f, 10.f}, "Mixing bins - z-vertex"};

Check failure on line 80 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"};

Check failure on line 81 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis ConfEPBins{"ConfEPBins", {1, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"};
ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"};
Configurable<int> cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"};
Expand Down Expand Up @@ -377,7 +377,7 @@
fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/");
fRegistry.addClone("Pair/same/", "Pair/mix/");
fRegistry.add("Pair/same/uls/hEta", "#eta_{ll}", kTH1D, {{2000, -10, 10}}, true);
fRegistry.add("Pair/mix/uls/hBeta", "#beta for Lorentz boost;#beta^{same};(#beta^{mix} - #beta^{same})/#beta^{same}", kTH2D, {{100, 0, 1}, {400, -0.2, 0.2}}, true);
// fRegistry.add("Pair/mix/uls/hBeta", "#beta for Lorentz boost;#beta^{same};(#beta^{mix} - #beta^{same})/#beta^{same}", kTH2D, {{100, 0, 1}, {400, -0.2, 0.2}}, true);
}

template <typename TCollision, typename TDilepton, typename TMixingBin>
Expand Down Expand Up @@ -483,7 +483,7 @@
phiPol = std::fabs(phiPol);
}
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hs"), empair1.mass(), empair1.pt(), empair1.getPairDCA(), empair1.rapidity(), cos_thetaPol, phiPol, quadmom, weight);
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBeta"), empair1.p() / empair1.e(), (empair2.p() / empair2.e() - empair1.p() / empair1.e()) / (empair1.p() / empair1.e()));
// fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBeta"), empair1.p() / empair1.e(), (empair2.p() / empair2.e() - empair1.p() / empair1.e()) / (empair1.p() / empair1.e()));

} // end of pair2 loop
} // end of pair1 loop
Expand Down Expand Up @@ -530,21 +530,21 @@
int zbin = lower_bound(zvtx_bin_edges.begin(), zvtx_bin_edges.end(), collision.posZ()) - zvtx_bin_edges.begin() - 1;
if (zbin < 0) {
zbin = 0;
} else if (static_cast<int>(zvtx_bin_edges.size()) - 2 < zbin) {

Check failure on line 533 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
zbin = static_cast<int>(zvtx_bin_edges.size()) - 2;
}

int centbin = lower_bound(cent_bin_edges.begin(), cent_bin_edges.end(), centrality) - cent_bin_edges.begin() - 1;
if (centbin < 0) {
centbin = 0;
} else if (static_cast<int>(cent_bin_edges.size()) - 2 < centbin) {

Check failure on line 540 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
centbin = static_cast<int>(cent_bin_edges.size()) - 2;
}

int epbin = lower_bound(ep_bin_edges.begin(), ep_bin_edges.end(), ep2) - ep_bin_edges.begin() - 1;
if (epbin < 0) {
epbin = 0;
} else if (static_cast<int>(ep_bin_edges.size()) - 2 < epbin) {

Check failure on line 547 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
epbin = static_cast<int>(ep_bin_edges.size()) - 2;
}

Expand All @@ -559,7 +559,7 @@

if (occbin < 0) {
occbin = 0;
} else if (static_cast<int>(occ_bin_edges.size()) - 2 < occbin) {

Check failure on line 562 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
occbin = static_cast<int>(occ_bin_edges.size()) - 2;
}

Expand Down Expand Up @@ -646,5 +646,5 @@
};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<DileptonPolarization>(cfgc, TaskName{"dilepton-polarization"})};

Check failure on line 649 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specified task name dilepton-polarization and the struct name DileptonPolarization produce the same device name dilepton-polarization. TaskName is redundant.
}
27 changes: 11 additions & 16 deletions PWGEM/Dilepton/Utils/EMFwdTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ namespace o2::aod::pwgem::dilepton::utils
class EMFwdTrack
{
public:
EMFwdTrack(float pt, float eta, float phi, float mass, int8_t charge, float dcaX, float dcaY, float cXX, float cXY, float cYY)
EMFwdTrack(float pt, float eta, float phi, float /*mass*/, int8_t charge, float dcaX, float dcaY, float cXX, float cXY, float cYY)
{
fPt = pt;
fSigned1Pt = static_cast<float>(charge) / pt;
fEta = eta;
fPhi = phi;
fMass = mass;
fCharge = charge;
fDCAx = dcaX;
fDCAy = dcaY;
fCXX = cXX;
Expand All @@ -39,31 +37,28 @@ class EMFwdTrack

~EMFwdTrack() {}

float pt() const { return fPt; }
float pt() const { return 1.f / std::fabs(fSigned1Pt); }
float eta() const { return fEta; }
float phi() const { return fPhi; }
float mass() const { return fMass; }
int8_t sign() const { return fCharge; }
int8_t sign() const { return (fSigned1Pt > 0 ? +1 : -1); }
float fwdDcaX() const { return fDCAx; }
float fwdDcaY() const { return fDCAy; }
float fwdDcaXY() const { return std::sqrt(std::pow(fDCAx, 2) + std::pow(fDCAy, 2)); }
float p() const { return fPt * std::cosh(fEta); }
float px() const { return fPt * std::cos(fPhi); }
float py() const { return fPt * std::sin(fPhi); }
float pz() const { return fPt * std::sinh(fEta); }
float e() const { return std::hypot(fPt * std::cosh(fEta), fMass); } // e2 = p2 + m2
float signed1Pt() const { return fCharge * 1.f / fPt; }
float p() const { return 1.f / std::fabs(fSigned1Pt) * std::cosh(fEta); }
float px() const { return 1.f / std::fabs(fSigned1Pt) * std::cos(fPhi); }
float py() const { return 1.f / std::fabs(fSigned1Pt) * std::sin(fPhi); }
float pz() const { return 1.f / std::fabs(fSigned1Pt) * std::sinh(fEta); }
// float e(const float mass) const { return std::hypot(fPt * std::cosh(fEta), mass); } // e2 = p2 + m2
float signed1Pt() const { return fSigned1Pt; }

float cXX() const { return fCXX; }
float cXY() const { return fCXY; }
float cYY() const { return fCYY; }

protected:
float fPt;
float fSigned1Pt;
float fEta;
float fPhi;
float fMass;
int8_t fCharge;
float fDCAx;
float fDCAy;
float fCXX;
Expand Down
32 changes: 15 additions & 17 deletions PWGEM/Dilepton/Utils/EMTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ namespace o2::aod::pwgem::dilepton::utils
class EMTrack
{
public:
EMTrack(float pt, float eta, float phi, float mass, int8_t charge = 0, float dcaXY = 0.f, float dcaZ = 0.f, float CYY = 0, float CZY = 0, float CZZ = 0)
EMTrack(float pt, float eta, float phi, float /*mass*/, int8_t charge = 0, float dcaXY = 0.f, float dcaZ = 0.f, float CYY = 0, float CZY = 0, float CZZ = 0)
{
fPt = pt;
fSigned1Pt = static_cast<float>(charge) / pt;
fEta = eta;
fPhi = phi;
fMass = mass;
fCharge = charge;
fDCAxy = dcaXY;
fDCAz = dcaZ;
fCYY = CYY;
Expand All @@ -44,32 +42,28 @@ class EMTrack

~EMTrack() {}

float pt() const { return fPt; }
float pt() const { return 1.f / std::fabs(fSigned1Pt); }
float eta() const { return fEta; }
float phi() const { return fPhi; }
float mass() const { return fMass; }
int8_t sign() const { return fCharge; }
int8_t sign() const { return (fSigned1Pt > 0 ? +1 : -1); }
float dcaXY() const { return fDCAxy; }
float dcaZ() const { return fDCAz; }

float cYY() const { return fCYY; }
float cZY() const { return fCZY; }
float cZZ() const { return fCZZ; }

float rapidity() const { return std::log((std::sqrt(std::pow(fMass, 2) + std::pow(fPt * std::cosh(fEta), 2)) + fPt * std::sinh(fEta)) / std::sqrt(std::pow(fMass, 2) + std::pow(fPt, 2))); }
float p() const { return fPt * std::cosh(fEta); }
float px() const { return fPt * std::cos(fPhi); }
float py() const { return fPt * std::sin(fPhi); }
float pz() const { return fPt * std::sinh(fEta); }
float e() const { return std::hypot(fPt * std::cosh(fEta), fMass); } // e2 = p2 + m2
float signed1Pt() const { return fCharge * 1.f / fPt; }
float p() const { return 1.f / std::fabs(fSigned1Pt) * std::cosh(fEta); }
float px() const { return 1.f / std::fabs(fSigned1Pt) * std::cos(fPhi); }
float py() const { return 1.f / std::fabs(fSigned1Pt) * std::sin(fPhi); }
float pz() const { return 1.f / std::fabs(fSigned1Pt) * std::sinh(fEta); }
// float e() const { return std::hypot(fPt * std::cosh(fEta), fMass); } // e2 = p2 + m2
float signed1Pt() const { return fSigned1Pt; }

protected:
float fPt;
float fSigned1Pt;
float fEta;
float fPhi;
float fMass;
int8_t fCharge;
float fDCAxy;
float fDCAz;
float fCYY;
Expand Down Expand Up @@ -158,6 +152,7 @@ class EMPair : public EMTrack
public:
EMPair(float pt, float eta, float phi, float mass, int8_t charge = 0) : EMTrack(pt, eta, phi, mass, charge, 0, 0, 0, 0, 0)
{
fMass = mass;
fPairDCA = 999.f;
fVPos = ROOT::Math::PtEtaPhiMVector(0, 0, 0, 0);
fVNeg = ROOT::Math::PtEtaPhiMVector(0, 0, 0, 0);
Expand All @@ -167,6 +162,8 @@ class EMPair : public EMTrack
}

~EMPair() {}
float mass() const { return fMass; }
float rapidity() const { return std::log((std::sqrt(std::pow(fMass, 2) + std::pow(1.f / std::fabs(fSigned1Pt) * std::cosh(fEta), 2)) + 1.f / std::fabs(fSigned1Pt) * std::sinh(fEta)) / std::sqrt(std::pow(fMass, 2) + std::pow(1.f / std::fabs(fSigned1Pt), 2))); }

void setPairDCA(float dca) { fPairDCA = dca; }
float getPairDCA() const { return fPairDCA; }
Expand Down Expand Up @@ -232,6 +229,7 @@ class EMPair : public EMTrack
float phi_cp() const { return std::atan2(fVy, fVx); }

protected:
float fMass;
float fPairDCA;
ROOT::Math::PtEtaPhiMVector fVPos;
ROOT::Math::PtEtaPhiMVector fVNeg;
Expand Down
18 changes: 9 additions & 9 deletions PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h"
#include "PWGEM/PhotonMeson/DataModel/EventTables.h"
#include "PWGEM/PhotonMeson/DataModel/gammaTables.h"
#include "PWGEM/PhotonMeson/Utils/EMPhoton.h"
#include "PWGEM/PhotonMeson/Utils/EventHistograms.h"
#include "PWGEM/PhotonMeson/Utils/NMHistograms.h"
#include "PWGEM/PhotonMeson/Utils/PairUtilities.h"
// Dilepton headers
#include "PWGEM/Dilepton/Utils/EMTrack.h"
#include "PWGEM/Dilepton/Utils/EventMixingHandler.h"

#include "Common/CCDB/TriggerAliases.h"
Expand Down Expand Up @@ -249,8 +249,8 @@ struct Pi0EtaToGammaGamma {
o2::framework::Partition<o2::soa::Filtered<o2::soa::Join<o2::aod::EMPrimaryElectronsFromDalitz, o2::aod::EMPrimaryElectronDaEMEventIds, o2::aod::EMPrimaryElectronsPrefilterBitDerived>>> positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt&& nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track;
o2::framework::Partition<o2::soa::Filtered<o2::soa::Join<o2::aod::EMPrimaryElectronsFromDalitz, o2::aod::EMPrimaryElectronDaEMEventIds, o2::aod::EMPrimaryElectronsPrefilterBitDerived>>> electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt && nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track;

o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::dilepton::utils::EMTrack>* emh1 = nullptr;
o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::dilepton::utils::EMTrack>* emh2 = nullptr;
o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::photonmeson::utils::EMPhoton>* emh1 = nullptr;
o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::photonmeson::utils::EMPhoton>* emh2 = nullptr;
//---------------------------------------------------------------------------

std::vector<int> used_photonIds_per_col; // <ndf, trackId>
Expand Down Expand Up @@ -383,8 +383,8 @@ struct Pi0EtaToGammaGamma {
occ_bin_edges = std::vector<float>(ConfOccupancyBins.value.begin(), ConfOccupancyBins.value.end());
occ_bin_edges.erase(occ_bin_edges.begin());

emh1 = new o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::dilepton::utils::EMTrack>(ndepth);
emh2 = new o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::dilepton::utils::EMTrack>(ndepth);
emh1 = new o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::photonmeson::utils::EMPhoton>(ndepth);
emh2 = new o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::photonmeson::utils::EMPhoton>(ndepth);

o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry);
if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) {
Expand Down Expand Up @@ -843,11 +843,11 @@ struct Pi0EtaToGammaGamma {

std::pair<int, int> tuple_tmp_id2 = std::make_pair(pos2.trackId(), ele2.trackId());
if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) {
emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0));
emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::photonmeson::utils::EMPhoton(g1.pt(), g1.eta(), g1.phi(), 0));
used_photonIds_per_col.emplace_back(g1.globalIndex());
}
if (std::find(used_dileptonIds_per_col.begin(), used_dileptonIds_per_col.end(), tuple_tmp_id2) == used_dileptonIds_per_col.end()) {
emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(v_ee.Pt(), v_ee.Eta(), v_ee.Phi(), v_ee.M()));
emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::photonmeson::utils::EMPhoton(v_ee.Pt(), v_ee.Eta(), v_ee.Phi(), v_ee.M()));
used_dileptonIds_per_col.emplace_back(tuple_tmp_id2);
}
ndiphoton++;
Expand Down Expand Up @@ -922,11 +922,11 @@ struct Pi0EtaToGammaGamma {
fRegistry.fill(HIST("Pair/same/hs"), v12.M(), v12.Pt(), wpair);

if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) {
emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0));
emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::photonmeson::utils::EMPhoton(g1.pt(), g1.eta(), g1.phi(), 0));
used_photonIds_per_col.emplace_back(g1.globalIndex());
}
if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g2.globalIndex()) == used_photonIds_per_col.end()) {
emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g2.pt(), g2.eta(), g2.phi(), 0));
emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::photonmeson::utils::EMPhoton(g2.pt(), g2.eta(), g2.phi(), 0));
used_photonIds_per_col.emplace_back(g2.globalIndex());
}
ndiphoton++;
Expand Down
12 changes: 6 additions & 6 deletions PWGEM/PhotonMeson/Core/TaggingPi0.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h"
#include "PWGEM/PhotonMeson/DataModel/EventTables.h"
#include "PWGEM/PhotonMeson/DataModel/gammaTables.h"
#include "PWGEM/PhotonMeson/Utils/EMPhoton.h"
#include "PWGEM/PhotonMeson/Utils/EventHistograms.h"
#include "PWGEM/PhotonMeson/Utils/PairUtilities.h"
//
#include "PWGEM/Dilepton/Utils/EMTrack.h"
#include "PWGEM/Dilepton/Utils/EventMixingHandler.h"

#include "Common/DataModel/Centrality.h"
Expand Down Expand Up @@ -104,7 +104,7 @@ struct TaggingPi0 {
o2::framework::ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {o2::framework::VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"};
o2::framework::ConfigurableAxis ConfPtBins{"ConfPtBins", {100, 0, 10}, "pT bins for output histograms"};

using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::dilepton::utils::EMTrack>;
using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::photonmeson::utils::EMPhoton>;

EMPhotonEventCut fEMEventCut;
struct : o2::framework::ConfigurableGroup {
Expand Down Expand Up @@ -565,11 +565,11 @@ struct TaggingPi0 {

std::pair<int, int> tuple_tmp_id2 = std::make_pair(pos2.trackId(), ele2.trackId());
if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) {
emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0));
emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::photonmeson::utils::EMPhoton(g1.pt(), g1.eta(), g1.phi(), 0));
used_photonIds_per_col.emplace_back(g1.globalIndex());
}
if (std::find(used_dileptonIds_per_col.begin(), used_dileptonIds_per_col.end(), tuple_tmp_id2) == used_dileptonIds_per_col.end()) {
emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(v_ee.Pt(), v_ee.Eta(), v_ee.Phi(), v_ee.M()));
emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::photonmeson::utils::EMPhoton(v_ee.Pt(), v_ee.Eta(), v_ee.Phi(), v_ee.M()));
used_dileptonIds_per_col.emplace_back(tuple_tmp_id2);
}
ndiphoton++;
Expand All @@ -590,11 +590,11 @@ struct TaggingPi0 {
fRegistry.fill(HIST("Pair/same/hMvsPt"), v12.M(), v1.Pt(), weight);

if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) {
emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0));
emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::photonmeson::utils::EMPhoton(g1.pt(), g1.eta(), g1.phi(), 0));
used_photonIds_per_col.emplace_back(g1.globalIndex());
}
if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g2.globalIndex()) == used_photonIds_per_col.end()) {
emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g2.pt(), g2.eta(), g2.phi(), 0));
emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::photonmeson::utils::EMPhoton(g2.pt(), g2.eta(), g2.phi(), 0));
used_photonIds_per_col.emplace_back(g2.globalIndex());
}
ndiphoton++;
Expand Down
60 changes: 60 additions & 0 deletions PWGEM/PhotonMeson/Utils/EMPhoton.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// 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.

/// \class to store minimal photon info
/// \author daiki.sekihata@cern.ch

#ifndef PWGEM_PHOTONMESON_UTILS_EMPHOTON_H_
#define PWGEM_PHOTONMESON_UTILS_EMPHOTON_H_

#include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h)
#include <Math/Vector4Dfwd.h>

#include <cmath>
#include <cstdint>

#include <math.h>

namespace o2::aod::pwgem::photonmeson::utils
{
class EMPhoton
{
public:
EMPhoton(float pt, float eta, float phi, float mass)
{
fPt = pt;
fEta = eta;
fPhi = phi;
fMass = mass;
}

~EMPhoton() {}

float pt() const { return fPt; }
float eta() const { return fEta; }
float phi() const { return fPhi; }

float p() const { return fPt * std::cosh(fEta); }
float px() const { return fPt * std::cos(fPhi); }
float py() const { return fPt * std::sin(fPhi); }
float pz() const { return fPt * std::sinh(fEta); }
float mass() const { return fMass; }
float rapidity() const { return std::log((std::sqrt(std::pow(fMass, 2) + std::pow(fPt * std::cosh(fEta), 2)) + fPt * std::sinh(fEta)) / std::sqrt(std::pow(fMass, 2) + std::pow(fPt, 2))); }

protected:
float fPt;
float fEta;
float fPhi;
float fMass;
};

} // namespace o2::aod::pwgem::photonmeson::utils
#endif // PWGEM_PHOTONMESON_UTILS_EMPHOTON_H_
Loading