Skip to content
Open
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
6 changes: 4 additions & 2 deletions PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include <Framework/HistogramSpec.h>
#include <Framework/InitContext.h>
#include <Framework/runDataProcessing.h>
#include <ReconstructionDataFormats/HelixHelper.h>
#include <ReconstructionDataFormats/PID.h>

#include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h)
Expand All @@ -62,6 +63,8 @@
#include <KFPVertex.h>
#include <KFParticle.h>

#include <GPUROOTCartesianFwd.h>

#include <algorithm>
#include <array>
#include <cmath>
Expand Down Expand Up @@ -349,10 +352,10 @@
}

// In case override, don't proceed, please - no CCDB access required
if (d_bz_input > -990) {

Check failure on line 355 in PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.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.
d_bz = d_bz_input;
o2::parameters::GRPMagField grpmag;
if (std::fabs(d_bz) > 1e-5) {

Check failure on line 358 in PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.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.
grpmag.setL3Current(30000.f / (d_bz / 5.0f));
}
o2::base::Propagator::initFieldFromGRP(&grpmag);
Expand Down Expand Up @@ -383,7 +386,7 @@
}
mRunNumber = bc.runNumber();

if (useMatCorrType == 2) {

Check failure on line 389 in PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.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.
// setMatLUT only after magfield has been initalized (setMatLUT has implicit and problematic init field call if not)
o2::base::Propagator::Instance()->setMatLUT(lut);
}
Expand Down Expand Up @@ -643,10 +646,10 @@
auto phiHelix = RecoDecay::constrainAngle<float, float>(std::atan2(diffY, diffX) - o2::constants::math::PI / 2.);

// Electron
float arcLenghtEle = helixPosEle.rC * 0.9 > propV0LegsRadius ? std::asin(propV0LegsRadius / helixPosEle.rC) * helixPosEle.rC : o2::constants::math::PI / 2.2 * helixPosEle.rC; // This assumes that the photon momentum vector is a tangent of the circle

Check failure on line 649 in PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.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.
auto propTrackEle = getPropMomentumFromTrackHelix(arcLenghtEle, ele, helixPosEle, d_bz / 10., phiHelix - ele.phi());
// Positron
float arcLenghtPos = helixPosPos.rC * 0.9 > propV0LegsRadius ? std::asin(propV0LegsRadius / helixPosPos.rC) * helixPosPos.rC : o2::constants::math::PI / 2.2 * helixPosPos.rC; // This assumes that the photon momentum vector is a tangent of the circle

Check failure on line 652 in PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.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.
auto propTrackPos = getPropMomentumFromTrackHelix(arcLenghtPos, pos, helixPosPos, d_bz / 10., phiHelix - pos.phi());

phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(propTrackPos[0], propTrackPos[1], propTrackPos[2], propTrackEle[0], propTrackEle[1], propTrackEle[2], pos.sign(), ele.sign(), d_bz);
Expand Down Expand Up @@ -681,9 +684,8 @@
phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(kfp_track_posProp.GetPx(), kfp_track_posProp.GetPy(), kfp_track_posProp.GetPz(), kfp_track_eleProp.GetPx(), kfp_track_eleProp.GetPy(), kfp_track_eleProp.GetPz(), pos.sign(), ele.sign(), d_bz);
psipair = o2::aod::pwgem::dilepton::utils::pairutil::getPsiPair(kfp_track_posProp.GetPx(), kfp_track_posProp.GetPy(), kfp_track_posProp.GetPz(), kfp_track_eleProp.GetPx(), kfp_track_eleProp.GetPy(), kfp_track_eleProp.GetPz());
break;
} else {
LOG(debug) << "Propagation to offset" << offsetR << " cm failed for " << (pPropagatedSuccess ? "negative" : "positive") << " track. Trying smaller offset.";
}
LOG(debug) << "Propagation to offset" << offsetR << " cm failed for " << (pPropagatedSuccess ? "negative" : "positive") << " track. Trying smaller offset.";
}
if (modeTrackPropagation == TrackPropMode::kBoth) {
registry.fill(HIST("V0/hPhivPropagationCompare"), phiv, phivFast);
Expand All @@ -691,7 +693,7 @@
}
}

if (phiv == 999.f || psipair == 999.f) {

Check failure on line 696 in PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.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.
LOG(debug) << "Propagation failed for all radii (" << propV0LegsRadius << ", 30, 10 cm). Using default values for phiv and psipair (999.f).";
}

Expand All @@ -704,7 +706,7 @@
KFParticle gammaKF;
gammaKF.SetConstructMethod(2);
gammaKF.Construct(GammaDaughters.data(), 2);
if (kfMassConstrain > -0.1) {

Check failure on line 709 in PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.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.
gammaKF.SetNonlinearMassConstraint(kfMassConstrain);
}
KFPVertex kfpVertex = createKFPVertexFromCollision(collision);
Expand Down Expand Up @@ -840,7 +842,7 @@
return;
}

if (v0photoncandidate.getChi2NDF() > 6e+3) { // protection for uint16.

Check failure on line 845 in PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.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.
return;
}

Expand Down Expand Up @@ -1056,7 +1058,7 @@
auto v0 = v0s.rawIteratorAt(v0Id);
if constexpr (enableFilter) {
auto collision_tmp = v0.template collision_as<TCollisions>(); // collision where this v0 belongs.
if (!(collision_tmp.neeuls() >= 1 || collision_tmp.neeuls() + nv0_map[collision_tmp.globalIndex()] >= 2)) {

Check failure on line 1061 in PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.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.
continue;
}
// LOGF(info, "collision_tmp.globalIndex() = %d, collision_tmp.neeuls() = %d, nv0_map = %d", collision_tmp.globalIndex(), collision_tmp.neeuls(), nv0_map[collision_tmp.globalIndex()]);
Expand Down Expand Up @@ -1121,5 +1123,5 @@
WorkflowSpec defineDataProcessing(ConfigContext const& context)
{
return WorkflowSpec{
adaptAnalysisTask<PhotonConversionBuilder>(context, TaskName{"photon-conversion-builder"})};

Check failure on line 1126 in PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specified task name photon-conversion-builder and the struct name PhotonConversionBuilder produce the same device name photon-conversion-builder. TaskName is redundant.
}
6 changes: 4 additions & 2 deletions PWGEM/PhotonMeson/Utils/PCMUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <Math/Vector2D.h> // IWYU pragma: keep (do not replace with Math/Vector2Dfwd.h)
#include <Math/Vector2Dfwd.h>

#include <GPUROOTCartesianFwd.h>

#include <array>
#include <cmath>

Expand Down Expand Up @@ -113,7 +115,7 @@ template <typename TrackPrecision = float>
std::array<float, 2> CalculateDCAFast(const o2::track::TrackParametrizationWithError<TrackPrecision>& trk, const o2::math_utils::Point3D<float>& vtx, const float magField)
{

std::array<float, 2> dca;
std::array<float, 2> dca{};

// obtain circle from track in x-y plane
const o2::track::TrackAuxPar helixPos(trk, magField);
Expand Down Expand Up @@ -175,7 +177,7 @@ inline std::array<float, 3> getPropMomentumFromTrackHelix(const float s, const T
const auto phi = RecoDecay::constrainAngle<float>(track.phi() + dphi + addPhi);

// Calculate px,y,z at the new propagated vertex
std::array<float, 3> trackP;
std::array<float, 3> trackP{};
trackP[0] = std::cos(phi) * track.pt();
trackP[1] = std::sin(phi) * track.pt();
trackP[2] = track.tgl() * track.pt();
Expand Down
Loading