Skip to content

Commit ebc5d0e

Browse files
committed
[PWGDQ] add code to emulate a shift of the dipole
The shift of the dipole position is emulated by appropriately shifting the MCH clusters in the trac refit, and the tracks starting point when extrapolating through the spectrometer.
1 parent 0ee88ce commit ebc5d0e

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

PWGDQ/Tasks/muonGlobalAlignment.cxx

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ struct muonGlobalAlignment {
150150
Configurable<uint32_t> fMftTracksMultiplicityMax{"cfgMftTracksMultiplicityMax", 0, "Maximum number of MFT tracks to be processed per event (zero means no limit)"};
151151

152152
Configurable<float> fVertexZshift{"cfgVertexZshift", 0.0f, "Correction to the vertex z position"};
153+
Configurable<float> fDipoleZshift{"cfgDipoleZshift", 0.0f, "Correction to the dipole z position"};
153154

154155
//// Variables for MFT alignment corrections
155156
struct : ConfigurableGroup {
@@ -1200,6 +1201,15 @@ struct muonGlobalAlignment {
12001201
if (mchTrack.getZ() < absBack && z > absFront) {
12011202
// extrapolation through the absorber in the upstream direction
12021203
o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchTrack, z);
1204+
} else if (z < absBack) {
1205+
// extrapolation downstream of the absorber, correct for dipole longitudinal shift if needed
1206+
if (fDipoleZshift.value != 0) {
1207+
mchTrack.setZ(mchTrack.getZ() + fDipoleZshift.value);
1208+
o2::mch::TrackExtrap::extrapToZCov(mchTrack, z + fDipoleZshift.value);
1209+
mchTrack.setZ(mchTrack.getZ() - fDipoleZshift.value);
1210+
} else {
1211+
o2::mch::TrackExtrap::extrapToZCov(mchTrack, z);
1212+
}
12031213
} else {
12041214
// all other cases
12051215
o2::mch::TrackExtrap::extrapToZCov(mchTrack, z);
@@ -1389,7 +1399,24 @@ struct muonGlobalAlignment {
13891399
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, -466.f);
13901400
UpdateTrackMomentum(mftTrackProp, mchTrackPar);
13911401
}
1392-
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, z);
1402+
1403+
if (fDipoleZshift.value != 0) {
1404+
// extrapolate to the back of the absorber, taking into account the dipole shift,
1405+
// to avoid that the correction bring the track starting point back into the absorber
1406+
if (fDipoleZshift.value < 0) {
1407+
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, -505.f);
1408+
} else if (fDipoleZshift.value > 0) {
1409+
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, -505.f - fDipoleZshift.value);
1410+
}
1411+
// shift the track starting point
1412+
mftTrackProp.setZ(mftTrackProp.getZ() + fDipoleZshift.value);
1413+
// extrapolate to the final z, corrected for the dipole shift
1414+
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, z + fDipoleZshift.value);
1415+
// remove the shift from the extrapolated track
1416+
mftTrackProp.setZ(mftTrackProp.getZ() - fDipoleZshift.value);
1417+
} else {
1418+
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, z);
1419+
}
13931420

13941421
return MCHtoFwd(mftTrackProp);
13951422
}
@@ -1595,6 +1622,11 @@ struct muonGlobalAlignment {
15951622
transformNew[cluster.deId()].LocalToMaster(local, master);
15961623
}
15971624

1625+
// shift the clusters to correct the longitudinal shift of the dipole
1626+
if (fDipoleZshift.value != 0) {
1627+
master.SetZ(master.z() + fDipoleZshift.value);
1628+
}
1629+
15981630
if (applyCorrections) {
15991631
auto correctionsIt = mMchAlignmentCorrections.find(cluster.deId());
16001632
if (correctionsIt != mMchAlignmentCorrections.end()) {
@@ -1628,6 +1660,12 @@ struct muonGlobalAlignment {
16281660
LOGF(fatal, "Muon track %d has no associated clusters.", mchTrack.globalIndex());
16291661
}
16301662

1663+
// subtract the longitudinal shift of the dipole from the track z
1664+
if (fDipoleZshift.value != 0) {
1665+
auto& trackParam = *(convertedTrack.begin());
1666+
trackParam.setZ(trackParam.getZ() - fDipoleZshift.value);
1667+
}
1668+
16311669
return !removable;
16321670
}
16331671

0 commit comments

Comments
 (0)