Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFT-MCH refit : Removing remnants of old implementation and adding options #10396

Merged
merged 4 commits into from
Dec 5, 2022
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
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