Skip to content

Commit 55b9ef9

Browse files
authored
[Common] update refit global muon in fwdtrackPropagation.cxx (#10703)
1 parent ff66d0a commit 55b9ef9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Common/TableProducer/fwdtrackPropagation.cxx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct FwdTrackPropagation {
6969
Configurable<float> maxMatchingChi2MCHMFT{"maxMatchingChi2MCHMFT", 50.f, "max. chi2 for MCH-MFT matching"};
7070
Configurable<float> maxChi2{"maxChi2", 1e+6, "max. chi2 for muon tracking"};
7171
Configurable<bool> refitGlobalMuon{"refitGlobalMuon", false, "flag to refit global muon"};
72+
Configurable<bool> applyEtaCutToSAinGL{"applyEtaCutToSAinGL", false, "flag to apply eta cut to samuon in global muon"};
7273

7374
HistogramRegistry fRegistry{"fRegistry"};
7475
static constexpr std::string_view muon_types[5] = {"MFTMCHMID/", "MFTMCHMIDOtherMatch/", "MFTMCH/", "MCHMID/", "MCH/"};
@@ -148,7 +149,7 @@ struct FwdTrackPropagation {
148149
fRegistry.add("MCHMID/hDCAyResolutionvsPt", "DCA_{y} vs. p_{T};p_{T} (GeV/c);DCA_{y} resolution (#mum);", kTH2F, {{100, 0, 10.f}, {500, 0, 5e+5}}, false);
149150
}
150151

151-
bool isSelected(const float pt, const float eta, const float rAtAbsorberEnd, const float pDCA, const float chi2, const uint8_t trackType)
152+
bool isSelected(const float pt, const float eta, const float rAtAbsorberEnd, const float pDCA, const float chi2, const uint8_t trackType, const float etaMatchedMCHMID)
152153
{
153154
if (pt < minPt || maxPt < pt) {
154155
return false;
@@ -166,6 +167,9 @@ struct FwdTrackPropagation {
166167
if (eta < minEtaGL || maxEtaGL < eta) {
167168
return false;
168169
}
170+
if (applyEtaCutToSAinGL && (etaMatchedMCHMID < minEtaSA || maxEtaSA < etaMatchedMCHMID)) {
171+
return false;
172+
}
169173
} else if (trackType == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack)) {
170174
if (eta < minEtaSA || maxEtaSA < eta) {
171175
return false;
@@ -251,18 +255,18 @@ struct FwdTrackPropagation {
251255

252256
const auto& mfttrack = fwdtrack.template matchMFTTrack_as<TMFTTracks>();
253257
nClustersMFT = mfttrack.nClusters();
258+
chi2mft = mfttrack.chi2();
254259
if (refitGlobalMuon) {
255260
eta = mfttrack.eta();
256261
phi = mfttrack.phi();
257262
o2::math_utils::bringTo02Pi(phi);
258-
pt = propmuonAtPV.getP() * std::sin(2.f * std::atan(std::exp(-eta)));
263+
pt = propmuonAtPV_Matched.getP() * std::sin(2.f * std::atan(std::exp(-eta)));
259264

260265
x = mfttrack.x();
261266
y = mfttrack.y();
262267
z = mfttrack.z();
263268
tgl = mfttrack.tgl();
264269
}
265-
chi2mft = mfttrack.chi2();
266270
} else if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
267271
o2::dataformats::GlobalFwdTrack propmuonAtRabs = propagateMuon(fwdtrack, collision, propagationPoint::kToRabs); // this is necessary only for MuonStandaloneTrack
268272
float xAbs = propmuonAtRabs.getX();
@@ -272,7 +276,7 @@ struct FwdTrackPropagation {
272276
return;
273277
}
274278

275-
if (!isSelected(pt, eta, rAtAbsorberEnd, pDCA, fwdtrack.chi2(), fwdtrack.trackType())) {
279+
if (!isSelected(pt, eta, rAtAbsorberEnd, pDCA, fwdtrack.chi2(), fwdtrack.trackType(), etaMatchedMCHMID)) {
276280
return;
277281
}
278282

0 commit comments

Comments
 (0)