Skip to content

Commit

Permalink
[PWGEM/PhotonMeson] add a column for v0leg moved by vdrifter (#9103)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsekihat authored Dec 22, 2024
1 parent bd6c1b4 commit 0b92bd9
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 19 deletions.
9 changes: 4 additions & 5 deletions PWGEM/Dilepton/Tasks/createResolutionMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ struct CreateResolutionMap {
using SMatrix55 = ROOT::Math::SMatrix<double, 5, 5, ROOT::Math::MatRepSym<double, 5>>;
using SMatrix5 = ROOT::Math::SVector<double, 5>;

Configurable<bool> applyEveSel_at_skimming{"applyEveSel_at_skimming", false, "flag to apply minimal event selection at the skimming level"};
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
Expand All @@ -75,12 +74,12 @@ struct CreateResolutionMap {
ConfigurableAxis ConfPtGenBins{"ConfPtGenBins", {VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.50, 6.00, 6.50, 7.00, 7.50, 8.00, 8.50, 9.00, 9.50, 10.00, 11.00, 12.00, 13.00, 14.00, 15.00, 16.00, 17.00, 18.00, 19.00, 20.00}, "gen. pT bins for output histograms"};

ConfigurableAxis ConfEtaCBGenBins{"ConfEtaCBGenBins", {30, -1.5, +1.5}, "gen. eta bins at midrapidity for output histograms"};
ConfigurableAxis ConfEtaFWDGenBins{"ConfEtaFWDGenBins", {30, -5, -2.0}, "gen. eta bins at forward rapidity for output histograms"};
ConfigurableAxis ConfPhiGenBins{"ConfPhiGenBins", {90, 0, 2.f * M_PI}, "gen. eta bins at forward rapidity for output histograms"};
ConfigurableAxis ConfEtaFWDGenBins{"ConfEtaFWDGenBins", {40, -5.5, -1.5}, "gen. eta bins at forward rapidity for output histograms"};
ConfigurableAxis ConfPhiGenBins{"ConfPhiGenBins", {72, 0, 2.f * M_PI}, "gen. eta bins at forward rapidity for output histograms"};

ConfigurableAxis ConfRelDeltaPtBins{"ConfRelDeltaPtBins", {200, -1.f, +1.f}, "rel. dpt for output histograms"};
ConfigurableAxis ConfDeltaEtaBins{"ConfDeltaEtaBins", {200, -0.1f, +0.1f}, "deta bins for output histograms"};
ConfigurableAxis ConfDeltaPhiBins{"ConfDeltaPhiBins", {200, -0.1f, +0.1f}, "dphi bins for output histograms"};
ConfigurableAxis ConfDeltaEtaBins{"ConfDeltaEtaBins", {100, -0.1f, +0.1f}, "deta bins for output histograms"};
ConfigurableAxis ConfDeltaPhiBins{"ConfDeltaPhiBins", {100, -0.1f, +0.1f}, "dphi bins for output histograms"};

struct : ConfigurableGroup {
std::string prefix = "electroncut_group";
Expand Down
4 changes: 2 additions & 2 deletions PWGEM/Dilepton/Tasks/eventQC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ struct eventQC {
fRegistry.add("Track/hNclsITS", "number of ITS clusters", kTH1F, {{8, -0.5, 7.5}}, false);
fRegistry.add("Track/hChi2ITS", "chi2/number of ITS clusters", kTH1F, {{100, 0, 10}}, false);
fRegistry.add("Track/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false);
fRegistry.add("Track/hChi2TOF", "chi2 of TOF", kTH1F, {{100, 0, 10}}, false);
fRegistry.add("Track/hChi2TOF", "chi2 of TOF", kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false);

if (cfgFillPID) {
fRegistry.add("Track/hTPCdEdx", "TPC dE/dx;p_{pv} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false);
Expand Down Expand Up @@ -290,7 +290,7 @@ struct eventQC {
fRegistry.fill(HIST("Track/hDeltaPin"), track.p(), (track.tpcInnerParam() - track.p()) / track.p());
fRegistry.fill(HIST("Track/hChi2ITS"), track.itsChi2NCl());
fRegistry.fill(HIST("Track/hITSClusterMap"), track.itsClusterMap());
fRegistry.fill(HIST("Track/hChi2TOF"), track.tofChi2());
fRegistry.fill(HIST("Track/hChi2TOF"), track.p(), track.tofChi2());

if (cfgFillPID) {
int nsize = 0;
Expand Down
3 changes: 2 additions & 1 deletion PWGEM/PhotonMeson/DataModel/gammaTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ namespace v0leg
DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //!
DECLARE_SOA_COLUMN(TrackId, trackId, int); //!
DECLARE_SOA_COLUMN(Sign, sign, int8_t); //!
DECLARE_SOA_COLUMN(IsMoved, isMoved, bool); //! moved by drift manager. relevant to TPConly tracks
DECLARE_SOA_COLUMN(Px, px, float); //! Px at SV
DECLARE_SOA_COLUMN(Py, py, float); //! Py at SV
DECLARE_SOA_COLUMN(Pz, pz, float); //! Pz at SV
Expand Down Expand Up @@ -167,7 +168,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITSob, meanClusterSizeITSob, [](uint32
});
} // namespace v0leg
DECLARE_SOA_TABLE(V0Legs, "AOD", "V0LEG", //!
o2::soa::Index<>, v0leg::CollisionId, v0leg::TrackId, v0leg::Sign,
o2::soa::Index<>, v0leg::CollisionId, v0leg::TrackId, v0leg::Sign, v0leg::IsMoved,
v0leg::Px, v0leg::Py, v0leg::Pz,
track::DcaXY, track::DcaZ,
track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared,
Expand Down
36 changes: 26 additions & 10 deletions PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
#include <map>
#include <iterator>
#include <utility>
#include <string>
#include <set>
#include <algorithm>
#include <vector>
#include <unordered_map>

#include "Math/Vector4D.h"

Expand Down Expand Up @@ -367,9 +372,9 @@ struct PhotonConversionBuilder {
}

template <typename TTrack, typename TShiftedTrack, typename TKFParticle>
void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, float dcaXY, float dcaZ)
void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, float dcaXY, float dcaZ, bool isMoved)
{
v0legs(track.collisionId(), track.globalIndex(), track.sign(),
v0legs(track.collisionId(), track.globalIndex(), track.sign(), isMoved,
kfp.GetPx(), kfp.GetPy(), kfp.GetPz(), dcaXY, dcaZ,
track.tpcNClsFindable(), track.tpcNClsFindableMinusFound(), track.tpcNClsFindableMinusCrossedRows(), track.tpcNClsShared(),
track.tpcChi2NCl(), track.tpcInnerParam(), track.tpcSignal(),
Expand Down Expand Up @@ -415,10 +420,17 @@ struct PhotonConversionBuilder {
// Calculate DCA with respect to the collision associated to the v0, not individual tracks
gpu::gpustd::array<float, 2> dcaInfo;

bool is_pos_moved = false;
bool is_ele_moved = false;

auto pTrack = getTrackParCov(pos);
if (moveTPCTracks && isTPConlyTrack(pos) && !mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, pos, pTrack)) {
LOGP(error, "failed correction for positive tpc track");
return;
if (moveTPCTracks && isTPConlyTrack(pos)) {
if (mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, pos, pTrack)) {
is_pos_moved = true;
} else {
LOGP(error, "failed correction for positive tpc track");
return;
}
}
auto pTrackC = pTrack;
pTrackC.setPID(o2::track::PID::Electron);
Expand All @@ -427,9 +439,13 @@ struct PhotonConversionBuilder {
auto posdcaZ = dcaInfo[1];

auto nTrack = getTrackParCov(ele);
if (moveTPCTracks && isTPConlyTrack(ele) && !mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, ele, nTrack)) {
LOGP(error, "failed correction for negative tpc track");
return;
if (moveTPCTracks && isTPConlyTrack(ele)) {
if (mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, ele, nTrack)) {
is_ele_moved = true;
} else {
LOGP(error, "failed correction for negative tpc track");
return;
}
}
auto nTrackC = nTrack;
nTrackC.setPID(o2::track::PID::Electron);
Expand Down Expand Up @@ -669,8 +685,8 @@ struct PhotonConversionBuilder {

v0photonskfcov(gammaKF_PV.GetCovariance(9), gammaKF_PV.GetCovariance(14), gammaKF_PV.GetCovariance(20), gammaKF_PV.GetCovariance(13), gammaKF_PV.GetCovariance(19), gammaKF_PV.GetCovariance(18));

fillTrackTable(pos, pTrack, kfp_pos_DecayVtx, posdcaXY, posdcaZ); // positive leg first
fillTrackTable(ele, nTrack, kfp_ele_DecayVtx, eledcaXY, eledcaZ); // negative leg second
fillTrackTable(pos, pTrack, kfp_pos_DecayVtx, posdcaXY, posdcaZ, is_pos_moved); // positive leg first
fillTrackTable(ele, nTrack, kfp_ele_DecayVtx, eledcaXY, eledcaZ, is_ele_moved); // negative leg second
} // end of fill table
}

Expand Down
7 changes: 6 additions & 1 deletion PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

// runme like: o2-analysis-trackselection -b --aod-file ${sourceFile} --aod-writer-json ${writerFile} | o2-analysis-timestamp -b | o2-analysis-trackextension -b | o2-analysis-lf-lambdakzerobuilder -b | o2-analysis-pid-tpc -b | o2-analysis-em-skimmermc -b

#include <memory>
#include <map>
#include <string>
#include <vector>

// todo: remove reduantant information in GammaConversionsInfoTrue
#include "PWGEM/PhotonMeson/DataModel/gammaTables.h"
#include "PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h"
Expand Down Expand Up @@ -179,7 +184,7 @@ struct skimmerGammaConversion {
void fillTrackTable(TTRACK const& theTrack, TKFP const& kfp)
{
v0legs(theTrack.collisionId(),
theTrack.globalIndex(), theTrack.sign(),
theTrack.globalIndex(), theTrack.sign(), false,
kfp.GetPx(), kfp.GetPy(), kfp.GetPz(), theTrack.dcaXY(), theTrack.dcaZ(),
theTrack.tpcNClsFindable(), theTrack.tpcNClsFindableMinusFound(), theTrack.tpcNClsFindableMinusCrossedRows(), theTrack.tpcNClsShared(),
theTrack.tpcChi2NCl(), theTrack.tpcInnerParam(), theTrack.tpcSignal(),
Expand Down

0 comments on commit 0b92bd9

Please sign in to comment.