Skip to content

Commit

Permalink
MFT-MCH refit : Removing remnants of old implementation and adding op…
Browse files Browse the repository at this point in the history
…tions (AliceO2Group#10396)

* Adding protection to the fwdtrack table columns

* Fixing MFT-MCH refit

* Clang format
  • Loading branch information
mcoquet642 authored and Iouri A. Belikov committed Dec 15, 2022
1 parent 2a329ca commit b591414
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ class MatchGlobalFwd
void fitGlobalMuonTrack(o2::dataformats::GlobalFwdTrack&); ///< Kalman filter fit global Forward track by attaching MFT clusters
bool computeCluster(o2::dataformats::GlobalFwdTrack& track, const MFTCluster& cluster, int& startingLayerID);

void setMFTRadLength(float MFT_x2X0) { mMFTDiskThicknessInX0 = MFT_x2X0 / 5.0; }
void setAlignResiduals(Float_t res) { mAlignResidual = res; }

template <typename T>
bool propagateToNextClusterWithMCS(T& track, double z, int& startingLayerID, const int& newLayerID)
{
Expand Down Expand Up @@ -279,7 +282,8 @@ class MatchGlobalFwd

float mBz = -5.f; ///< nominal Bz in kGauss
float mMatchingPlaneZ = sLastMFTPlaneZ; ///< MCH-MFT matching plane Z position
Float_t mMFTDiskThicknessInX0 = 0.042 / 5;
Float_t mMFTDiskThicknessInX0 = 0.042 / 5; ///< MFT disk thickness in radiation length
Float_t mAlignResidual = 1; ///< Alignment residual for cluster position uncertainty
o2::InteractionRecord mStartIR{0, 0}; ///< IR corresponding to the start of the TF
int mMFTROFrameLengthInBC = 0; ///< MFT RO frame in BC (for MFT cont. mode only)
float mMFTROFrameLengthMUS = -1.; ///< MFT RO frame in \mus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ struct GlobalFwdMatchingParam : public o2::conf::ConfigurableParamHelper<GlobalF
double matchPlaneZ = -77.5; ///< MFT-MCH matching plane z coordinate
bool useMIDMatch = false; ///< Use input from MCH-MID matching
Int_t saveMode = kBestMatch; ///< Global Forward Tracks save mode
float MFTRadLength = 0.042; ///< MFT thickness in radiation length
float alignResidual = 1.; ///< Alignment residual for cluster position uncertainty

bool
isMatchUpstream() const
Expand Down
29 changes: 10 additions & 19 deletions Detectors/GlobalTracking/src/MatchGlobalFwd.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ void MatchGlobalFwd::init()

auto& matchingParam = GlobalFwdMatchingParam::Instance();

setMFTRadLength(matchingParam.MFTRadLength);
LOG(info) << "MFT Radiation Length = " << mMFTDiskThicknessInX0 * 5.;

setAlignResiduals(matchingParam.alignResidual);
LOG(info) << "MFT Align residuals = " << mAlignResidual;

mMatchingPlaneZ = matchingParam.matchPlaneZ;
LOG(info) << "MFTMCH matchingPlaneZ = " << mMatchingPlaneZ;

Expand Down Expand Up @@ -555,34 +561,17 @@ void MatchGlobalFwd::fitGlobalMuonTrack(o2::dataformats::GlobalFwdTrack& gTrack)
const auto& mftTrackOut = mMFTWork[MFTMatchId];
auto ncls = mftTrack.getNumberOfPoints();
auto offset = mftTrack.getExternalClusterIndexOffset();
auto invQPt0 = gTrack.getInvQPt();
auto sigmainvQPtsq = gTrack.getCovariances()(4, 4);

// initialize the starting track parameters and cluster
auto k = TMath::Abs(o2::constants::math::B2C * mBz);
auto Hz = std::copysign(1, mBz);

LOG(debug) << "***************************** Start Fitting new track *****************************";
LOG(debug) << "N Clusters = " << ncls << " Best MFT Track Match ID " << gTrack.getMFTTrackID() << " MCHTrack: X = " << gTrack.getX() << " Y = " << gTrack.getY() << " Z = " << gTrack.getZ() << " Tgl = " << gTrack.getTanl() << " Phi = " << gTrack.getPhi() << " pz = " << gTrack.getPz() << " qpt = " << 1.0 / gTrack.getInvQPt();

gTrack.setX(mftTrackOut.getX());
gTrack.setY(mftTrackOut.getY());
gTrack.setZ(mftTrackOut.getZ());
gTrack.setPhi(mftTrackOut.getPhi());
gTrack.setTanl(mftTrackOut.getTanl());
gTrack.setInvQPt(gTrack.getInvQPt());

LOG(debug) << "MFTTrack: X = " << mftTrackOut.getX()
<< " Y = " << mftTrackOut.getY() << " Z = " << mftTrackOut.getZ()
<< " Tgl = " << mftTrackOut.getTanl()
<< " Phi = " << mftTrackOut.getPhi() << " pz = " << mftTrackOut.getPz()
<< " qpt = " << 1.0 / mftTrackOut.getInvQPt();
LOG(debug) << " initTrack GlobalTrack: q/pt = " << gTrack.getInvQPt() << std::endl;

SMatrix55Sym lastParamCov;
Double_t tanlsigma = TMath::Max(std::abs(mftTrackOut.getTanl()), .5);
Double_t qptsigma = TMath::Max(std::abs(mftTrackOut.getInvQPt()), .5);

auto lastLayer = mMFTMapping.ChipID2Layer[mMFTClusters[offset + ncls - 1].getSensorID()];
LOG(debug) << "Starting by MFTCluster offset " << offset + ncls - 1 << " at lastLayer " << lastLayer;

Expand All @@ -606,8 +595,10 @@ bool MatchGlobalFwd::computeCluster(o2::dataformats::GlobalFwdTrack& track, cons
const auto& clx = cluster.getX();
const auto& cly = cluster.getY();
const auto& clz = cluster.getZ();
const auto& sigmaX2 = cluster.getSigmaY2(); // ALPIDE local Y coordinate => MFT global X coordinate (ALPIDE rows)
const auto& sigmaY2 = cluster.getSigmaZ2(); // ALPIDE local Z coordinate => MFT global Y coordinate (ALPIDE columns)
const auto& sigmaX2 = cluster.getSigmaY2() * mAlignResidual * mAlignResidual;
; // ALPIDE local Y coordinate => MFT global X coordinate (ALPIDE rows)
const auto& sigmaY2 = cluster.getSigmaZ2() * mAlignResidual * mAlignResidual;
; // ALPIDE local Z coordinate => MFT global Y coordinate (ALPIDE columns)

const auto& newLayerID = mMFTMapping.ChipID2Layer[cluster.getSensorID()];
LOG(debug) << "computeCluster: X = " << clx << " Y = " << cly << " Z = " << clz << " nCluster = " << newLayerID;
Expand Down

0 comments on commit b591414

Please sign in to comment.