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
12 changes: 8 additions & 4 deletions PWGEM/Dilepton/Core/DileptonSV.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
o2::framework::Configurable<float> cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"};
o2::framework::Configurable<float> cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"};
o2::framework::Configurable<float> cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"};
o2::framework::Configurable<float> cfg_max_diff_chi2_mftmch{"cfg_max_diff_chi2_mftmch", -1.f, "max. diff chi2MatchingMCHMFT between the best and the 2nd best matched candidates"};
o2::framework::Configurable<bool> enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"};
o2::framework::Configurable<float> cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"};
o2::framework::Configurable<float> cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"};
Expand All @@ -352,24 +353,24 @@
std::string prefix = "dfGroup";
o2::framework::Configurable<bool> useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"};
o2::framework::Configurable<bool> useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"};
o2::framework::Configurable<double> maxR{"maxR", 10.f, "reject PCA's above this radius"};
o2::framework::Configurable<double> maxR{"maxR", 20.f, "reject PCA's above this radius"};
o2::framework::Configurable<double> maxDZIni{"maxDZIni", 4.f, "reject (if > 0) PCA candidate if tracks DZ exceeds threshold"};
o2::framework::Configurable<double> minParamChange{"minParamChange", 1e-3, "stop iterations if largest change of any X is smaller than this"};
o2::framework::Configurable<double> minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"};
o2::framework::Configurable<bool> propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"};
o2::framework::Configurable<float> maxLog10Chi2PCA{"maxLog10Chi2PCA", 0, "max. log10(chi2PCA) for dilepton pair"};
o2::framework::Configurable<float> maxLog10Chi2PCA{"maxLog10Chi2PCA", 10, "max. log10(chi2PCA) for dilepton pair"};
} dfGroup; // for DCAFitterN

struct : o2::framework::ConfigurableGroup {
std::string prefix = "fdfGroup";
o2::framework::Configurable<bool> useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"};
o2::framework::Configurable<bool> useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"};
o2::framework::Configurable<double> maxR{"maxR", 10.f, "reject PCA's above this radius"};
o2::framework::Configurable<double> maxR{"maxR", 20.f, "reject PCA's above this radius"};
o2::framework::Configurable<double> maxDXIni{"maxDXIni", 4.f, "reject (if > 0) PCA candidate if tracks DZ exceeds threshold"};
o2::framework::Configurable<double> minParamChange{"minParamChange", 1e-3, "stop iterations if largest change of any X is smaller than this"};
o2::framework::Configurable<double> minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"};
o2::framework::Configurable<bool> propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"};
o2::framework::Configurable<float> maxLog10Chi2PCA{"maxLog10Chi2PCA", 0, "max. log10(chi2PCA) for dilepton pair"};
o2::framework::Configurable<float> maxLog10Chi2PCA{"maxLog10Chi2PCA", 10, "max. log10(chi2PCA) for dilepton pair"};
} fdfGroup; // for FwdDCAFitterN

o2::vertexing::DCAFitterN<2> mDCAFitter;
Expand Down Expand Up @@ -537,13 +538,15 @@
mDCAFitter.setMinRelChi2Change(dfGroup.minRelChi2Change);
mDCAFitter.setUseAbsDCA(dfGroup.useAbsDCA);
mDCAFitter.setWeightedFinalPCA(dfGroup.useWeightedFinalPCA);
mDCAFitter.setMaxChi2(std::pow(10, dfGroup.maxLog10Chi2PCA));

mFwdDCAFitter.setPropagateToPCA(fdfGroup.propagateToPCA);
mFwdDCAFitter.setMaxR(fdfGroup.maxR);
mFwdDCAFitter.setMaxDXIni(fdfGroup.maxDXIni);
mFwdDCAFitter.setMinParamChange(fdfGroup.minParamChange);
mFwdDCAFitter.setMinRelChi2Change(fdfGroup.minRelChi2Change);
mFwdDCAFitter.setUseAbsDCA(fdfGroup.useAbsDCA);
mFwdDCAFitter.setMaxChi2(std::pow(10, fdfGroup.maxLog10Chi2PCA));

if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) {
switch (matCorrType.value) {
Expand Down Expand Up @@ -674,7 +677,7 @@
pair_dca_axis_title = "DCA_{ee}^{3D} (#sigma)";
if (dielectroncuts.cfgDCAType == 1) {
pair_dca_axis_title = "DCA_{ee}^{XY} (#sigma)";
} else if (dielectroncuts.cfgDCAType == 2) {

Check failure on line 680 in PWGEM/Dilepton/Core/DileptonSV.h

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.
pair_dca_axis_title = "DCA_{ee}^{Z} (#sigma)";
}
} else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) {
Expand Down Expand Up @@ -796,7 +799,7 @@
}

// event info
if (nmod == 2) {

Check failure on line 802 in PWGEM/Dilepton/Core/DileptonSV.h

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.
o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<2>(&fRegistry);
} else {
o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry);
Expand Down Expand Up @@ -909,11 +912,12 @@
fDimuonCut.SetChi2(0.f, dimuoncuts.cfg_max_chi2);
fDimuonCut.SetChi2MFT(0.f, dimuoncuts.cfg_max_chi2mft);
// fDimuonCut.SetMatchingChi2MCHMFT(0.f, dimuoncuts.cfg_max_matching_chi2_mftmch);
fDimuonCut.SetMaxDiffMatchingChi2MCHMFT(dimuoncuts.cfg_max_diff_chi2_mftmch);
fDimuonCut.SetMaxMatchingChi2MCHMFTPtDep([&](float pt) { return (pt < dimuoncuts.cfg_border_pt_for_chi2mchmft ? dimuoncuts.cfg_max_matching_chi2_mftmch_lowPt : dimuoncuts.cfg_max_matching_chi2_mftmch_highPt); });
fDimuonCut.SetMatchingChi2MCHMID(0.f, dimuoncuts.cfg_max_matching_chi2_mchmid);
fDimuonCut.SetDCAxy(0.f, dimuoncuts.cfg_max_dcaxy);
fDimuonCut.SetRabs(dimuoncuts.cfg_min_rabs, dimuoncuts.cfg_max_rabs);
fDimuonCut.SetMaxPDCARabsDep([&](float rabs) { return (rabs < 26.5 ? 594.f : 324.f); });

Check failure on line 920 in PWGEM/Dilepton/Core/DileptonSV.h

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.
fDimuonCut.SetMaxdPtdEtadPhiwrtMCHMID(dimuoncuts.cfg_max_relDPt_wrt_matchedMCHMID, dimuoncuts.cfg_max_DEta_wrt_matchedMCHMID, dimuoncuts.cfg_max_DPhi_wrt_matchedMCHMID); // this is relevant for global muons
fDimuonCut.SetMFTHitMap(dimuoncuts.requireMFTHitMap, dimuoncuts.requiredMFTDisks);
fDimuonCut.EnableTTCA(dimuoncuts.enableTTCA);
Expand All @@ -925,7 +929,7 @@
int ptbin = lower_bound(dielectroncuts.binsMLSCT.value.begin(), dielectroncuts.binsMLSCT.value.end(), track.pt()) - dielectroncuts.binsMLSCT.value.begin() - 1;
if (ptbin < 0) {
ptbin = 0;
} else if (static_cast<int>(dielectroncuts.binsMLSCT.value.size()) - 2 < ptbin) {

Check failure on line 932 in PWGEM/Dilepton/Core/DileptonSV.h

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.
ptbin = static_cast<int>(dielectroncuts.binsMLSCT.value.size()) - 2;
}

Expand All @@ -944,7 +948,7 @@
{
bool is_good = true;
for (const auto& qn : qvectors[nmod]) {
if (std::fabs(qn[0]) > 20.f || std::fabs(qn[1]) > 20.f) {

Check failure on line 951 in PWGEM/Dilepton/Core/DileptonSV.h

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.
is_good = false;
break;
}
Expand Down Expand Up @@ -1176,7 +1180,7 @@
pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2));
if (dielectroncuts.cfgDCAType == 1) {
pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2));
} else if (dielectroncuts.cfgDCAType == 2) {

Check failure on line 1183 in PWGEM/Dilepton/Core/DileptonSV.h

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.
pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2));
}
} else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) {
Expand Down Expand Up @@ -1548,7 +1552,7 @@
{q2ft0m, q2ft0a, q2ft0c, q2btot, q2bpos, q2bneg, q2fv0a}, // 2nd harmonics
};

if (nmod == 2) {

Check failure on line 1555 in PWGEM/Dilepton/Core/DileptonSV.h

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.
o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<0, 2>(&fRegistry, collision);
} else {
o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<0, -1>(&fRegistry, collision);
Expand Down Expand Up @@ -1611,7 +1615,7 @@
bootstrapweights.push_back(1.0); // to pass as non-empyt dummy to use
}

if (nmod == 2) {

Check failure on line 1618 in PWGEM/Dilepton/Core/DileptonSV.h

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.
o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<1, 2>(&fRegistry, collision);
} else {
o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<1, -1>(&fRegistry, collision);
Expand Down Expand Up @@ -1657,14 +1661,14 @@
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 1664 in PWGEM/Dilepton/Core/DileptonSV.h

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 1671 in PWGEM/Dilepton/Core/DileptonSV.h

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;
}

Expand Down
12 changes: 8 additions & 4 deletions PWGEM/Dilepton/Core/DileptonSVMC.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ struct DileptonSVMC {
o2::framework::Configurable<float> cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"};
o2::framework::Configurable<float> cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"};
o2::framework::Configurable<float> cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"};
o2::framework::Configurable<float> cfg_max_diff_chi2_mftmch{"cfg_max_diff_chi2_mftmch", -1.f, "max. diff chi2MatchingMCHMFT between the best and the 2nd best matched candidates"};
o2::framework::Configurable<bool> enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"};
o2::framework::Configurable<float> cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"};
o2::framework::Configurable<float> cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"};
Expand All @@ -327,24 +328,24 @@ struct DileptonSVMC {
std::string prefix = "dfGroup";
o2::framework::Configurable<bool> useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"};
o2::framework::Configurable<bool> useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"};
o2::framework::Configurable<double> maxR{"maxR", 10.f, "reject PCA's above this radius"};
o2::framework::Configurable<double> maxR{"maxR", 20.f, "reject PCA's above this radius"};
o2::framework::Configurable<double> maxDZIni{"maxDZIni", 4.f, "reject (if > 0) PCA candidate if tracks DZ exceeds threshold"};
o2::framework::Configurable<double> minParamChange{"minParamChange", 1e-3, "stop iterations if largest change of any X is smaller than this"};
o2::framework::Configurable<double> minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"};
o2::framework::Configurable<bool> propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"};
o2::framework::Configurable<float> maxLog10Chi2PCA{"maxLog10Chi2PCA", 0, "max. log10(chi2PCA) for dilepton pair"};
o2::framework::Configurable<float> maxLog10Chi2PCA{"maxLog10Chi2PCA", 10, "max. log10(chi2PCA) for dilepton pair"};
} dfGroup; // for DCAFitterN

struct : o2::framework::ConfigurableGroup {
std::string prefix = "fdfGroup";
o2::framework::Configurable<bool> useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"};
o2::framework::Configurable<bool> useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"};
o2::framework::Configurable<double> maxR{"maxR", 10.f, "reject PCA's above this radius"};
o2::framework::Configurable<double> maxR{"maxR", 20.f, "reject PCA's above this radius"};
o2::framework::Configurable<double> maxDXIni{"maxDXIni", 4.f, "reject (if > 0) PCA candidate if tracks DZ exceeds threshold"};
o2::framework::Configurable<double> minParamChange{"minParamChange", 1e-3, "stop iterations if largest change of any X is smaller than this"};
o2::framework::Configurable<double> minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"};
o2::framework::Configurable<bool> propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"};
o2::framework::Configurable<float> maxLog10Chi2PCA{"maxLog10Chi2PCA", 0, "max. log10(chi2PCA) for dilepton pair"};
o2::framework::Configurable<float> maxLog10Chi2PCA{"maxLog10Chi2PCA", 10, "max. log10(chi2PCA) for dilepton pair"};
} fdfGroup; // for FwdDCAFitterN

o2::vertexing::DCAFitterN<2> mDCAFitter;
Expand Down Expand Up @@ -676,13 +677,15 @@ struct DileptonSVMC {
mDCAFitter.setMinRelChi2Change(dfGroup.minRelChi2Change);
mDCAFitter.setUseAbsDCA(dfGroup.useAbsDCA);
mDCAFitter.setWeightedFinalPCA(dfGroup.useWeightedFinalPCA);
mDCAFitter.setMaxChi2(std::pow(10, dfGroup.maxLog10Chi2PCA));

mFwdDCAFitter.setPropagateToPCA(fdfGroup.propagateToPCA);
mFwdDCAFitter.setMaxR(fdfGroup.maxR);
mFwdDCAFitter.setMaxDXIni(fdfGroup.maxDXIni);
mFwdDCAFitter.setMinParamChange(fdfGroup.minParamChange);
mFwdDCAFitter.setMinRelChi2Change(fdfGroup.minRelChi2Change);
mFwdDCAFitter.setUseAbsDCA(fdfGroup.useAbsDCA);
mFwdDCAFitter.setMaxChi2(std::pow(10, fdfGroup.maxLog10Chi2PCA));

if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) {
switch (matCorrType.value) {
Expand Down Expand Up @@ -864,6 +867,7 @@ struct DileptonSVMC {
fDimuonCut.SetChi2(0.f, dimuoncuts.cfg_max_chi2);
fDimuonCut.SetChi2MFT(0.f, dimuoncuts.cfg_max_chi2mft);
// fDimuonCut.SetMatchingChi2MCHMFT(0.f, dimuoncuts.cfg_max_matching_chi2_mftmch);
fDimuonCut.SetMaxDiffMatchingChi2MCHMFT(dimuoncuts.cfg_max_diff_chi2_mftmch);
fDimuonCut.SetMaxMatchingChi2MCHMFTPtDep([&](float pt) { return (pt < dimuoncuts.cfg_border_pt_for_chi2mchmft ? dimuoncuts.cfg_max_matching_chi2_mftmch_lowPt : dimuoncuts.cfg_max_matching_chi2_mftmch_highPt); });
fDimuonCut.SetMatchingChi2MCHMID(0.f, dimuoncuts.cfg_max_matching_chi2_mchmid);
fDimuonCut.SetDCAxy(0.f, dimuoncuts.cfg_max_dcaxy);
Expand Down
Loading