Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
7f7c6b0
Merged AMv2.3 from repository jfernan2 with cms-merge-topic
delanocamposs Feb 28, 2026
a99796d
bitshift bug fix KMTF.cc
delanocamposs Mar 13, 2026
584d706
New typedef for 5 dimensional covariance matrix
delanocamposs Mar 13, 2026
76a32a8
new class version for KMTFTrack.h update version 4.
delanocamposs Mar 13, 2026
e98e4a9
initial development commits
delanocamposs Mar 13, 2026
e514aeb
symmetrix matrix fix
delanocamposs Mar 14, 2026
e5b0f3c
matrix vector fix
delanocamposs Mar 16, 2026
afc1d61
revert matrix vector argument to upper triangle only
delanocamposs Mar 16, 2026
edee2c8
verbose = 1
delanocamposs Mar 17, 2026
d62af54
testing new z prop wheel-based logic
delanocamposs Mar 17, 2026
8ed52d9
more verbose print statements
delanocamposs Mar 17, 2026
e84f5c7
printout changes
delanocamposs Mar 18, 2026
2c29220
fix initial covariances
delanocamposs Apr 6, 2026
4b648c6
kSlope point resolution
delanocamposs Apr 6, 2026
93259fa
previous propagation residuals
delanocamposs Apr 6, 2026
d9dbe79
latest
delanocamposs Apr 7, 2026
63e041e
reverting back to using kSlope in measurement space for residual
delanocamposs Apr 9, 2026
1c15a25
tests
delanocamposs Apr 13, 2026
13ff919
testing
delanocamposs Apr 15, 2026
629bb34
testing
delanocamposs Apr 16, 2026
2172930
updates
delanocamposs Apr 16, 2026
3bc97b4
add new members and accessors for new gain values
delanocamposs Apr 27, 2026
66d9d59
fixed point arithmetic for zNew and kSlope. updateLUT function pulls …
delanocamposs Apr 27, 2026
fc06842
packed gain theta view LUT root file
delanocamposs Apr 28, 2026
a04c22f
small cleanup
delanocamposs Apr 28, 2026
a40c085
cleanup printouts
delanocamposs Apr 28, 2026
51bb165
fix wraparound bug
delanocamposs Apr 28, 2026
044560b
5D vertex constraint offline/LUT updates
delanocamposs Apr 29, 2026
2992c40
kSlopeNew fixed point arithmetic computation
delanocamposs Apr 29, 2026
3b34903
Barrel Stub Processor cleanup
delanocamposs Apr 29, 2026
b3e632e
update ThetaGain function
delanocamposs May 1, 2026
b6abb60
add phi bitmask split on certain theta gains. updated theta gain root…
delanocamposs May 4, 2026
0dda464
new smoothed Theta Gain LUT
delanocamposs May 11, 2026
6053c53
Track functionality to hold z, kSlope at Muon station 1 and Vertex. U…
delanocamposs May 15, 2026
51afa8f
KMTFPattern saves granular eta instead of coarse. Also saved z, kSlope.
delanocamposs May 15, 2026
c69d405
fix prinouts for KMTFPatterns
delanocamposs May 20, 2026
655f3b8
SetPtEtaPhiDispl now stores etaDisp
delanocamposs May 20, 2026
7c6a54a
z, kSlope saturation changes
delanocamposs May 21, 2026
94cacf4
saturate KSlope properly and add edm::LogWarnings
delanocamposs May 29, 2026
1a30c37
provide z0, new eta to SAMuon
delanocamposs May 29, 2026
6d0b693
update LSB comment
delanocamposs May 29, 2026
1f016b7
LogInfo
delanocamposs May 29, 2026
e591530
add back srcDT, srcDTTheta
delanocamposs May 29, 2026
f704d8b
Merged KMTF-upgrade-develop from repository delanocamposs with cms-me…
Jun 1, 2026
2872974
Merged Kalman_26 from repository zhenbinwu with cms-merge-topic
Jun 1, 2026
6782bb3
Code format
Jun 1, 2026
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
188 changes: 181 additions & 7 deletions DataFormats/L1TMuonPhase2/interface/KMTFTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,40 @@ namespace l1t {
class KMTFTrack;
typedef std::vector<KMTFTrack> KMTFTrackCollection;
typedef BXVector<KMTFTrack> KMTFTrackBxCollection;
typedef math::Error<5>::type CovarianceMatrix5dim;
typedef math::Error<2>::type CovarianceMatrix2dim;

class KMTFTrack : public reco::LeafCandidate {
public:
KMTFTrack()
: reco::LeafCandidate(-1, reco::LeafCandidate::PolarLorentzVector(0.1, 0.0, 0.0, 0.105)),
unconstrainedP4_(reco::LeafCandidate::PolarLorentzVector(0.1, 0.0, 0.0, 0.105)),
covariance_(std::vector<double>(6, 0.0)),
covariance_(std::vector<double>(15, 0.0)),
covarianceNB_(std::vector<double>(3, 0.0)),
curvVertex_(0),
ptC_(0),
phiVertex_(0),
dxy_(0),
zVertex_(0),
kSlopeVertex_(0),
curvMuon_(0),
ptU_(0),
phiMuon_(0),
phiBMuon_(0),
zMuon_(0),
kSlopeMuon_(0),
curv_(0),
phi_(0),
phiB_(0),
z_(0),
kSlope_(0),
coarseEta_(0),
approxPromptChi2_(0),
approxPromptErrChi2_(0),
approxDispChi2_(0),
approxDispErrChi2_(0),
hitPattern_(0),
thetaDigiPattern_(0),
step_(1),
sector_(0),
wheel_(0),
Expand All @@ -46,27 +56,35 @@ namespace l1t {

~KMTFTrack() override = default;

KMTFTrack(const l1t::MuonStubRef& seed, int phi, int phiB)
KMTFTrack(const l1t::MuonStubRef& seed, int phi, int phiB, int z, int kSlope)
: reco::LeafCandidate(-1, reco::LeafCandidate::PolarLorentzVector(0.1, 0.0, 0.0, 0.105)),
unconstrainedP4_(reco::LeafCandidate::PolarLorentzVector(0.1, 0.0, 0.0, 0.105)),
covariance_(std::vector<double>(6, 0.0)),
covariance_(std::vector<double>(15, 0.0)),
covarianceNB_(std::vector<double>(3, 0.0)),
curvVertex_(0),
ptC_(0),
phiVertex_(0),
dxy_(0),
zVertex_(0),
kSlopeVertex_(0),
curvMuon_(0),
ptU_(0),
phiMuon_(0),
phiBMuon_(0),
zMuon_(0),
kSlopeMuon_(0),
curv_(0),
phi_(phi),
phiB_(phiB),
z_(z),
kSlope_(kSlope),
coarseEta_(0),
approxPromptChi2_(0),
approxPromptErrChi2_(0),
approxDispChi2_(0),
approxDispErrChi2_(0),
hitPattern_(0),
thetaDigiPattern_(0),
step_(seed->depthRegion()),
sector_(seed->phiRegion()),
wheel_(seed->etaRegion()),
Expand All @@ -80,6 +98,7 @@ namespace l1t {
residuals_.push_back(0);
residuals_.push_back(0);
residuals_.push_back(0);
residuals_.push_back(0);
}

reco::LeafCandidate::PolarLorentzVector displacedP4() const { return unconstrainedP4_; }
Expand All @@ -92,13 +111,21 @@ namespace l1t {
int phiAtMuon() const { return phiMuon_; }
//unconstrained phiB at station 1
int phiBAtMuon() const { return phiBMuon_; }
//unconstrained z at station 1
int zAtMuon() const { return zMuon_; }
//unconstrained kSLope at station 1
int kSlopeAtMuon() const { return kSlopeMuon_; }

//constrained pt
int ptPrompt() const { return ptC_; }
//Constrained curvature at vertex
int curvatureAtVertex() const { return curvVertex_; }
//constrained phi at the vertex
int phiAtVertex() const { return phiVertex_; }
//constrained z at the vertex
int zAtVertex() const { return zVertex_; }
//constrained kSlope at the vertex
int kSlopeAtVertex() const { return kSlopeVertex_; }
//Impact parameter as calculated from the muon track
int dxy() const { return dxy_; }
//Unconstrained curvature at the Muon systen
Expand All @@ -107,6 +134,10 @@ namespace l1t {
int positionAngle() const { return phi_; }
//Unconstrained bending angle at the Muon systen
int bendingAngle() const { return phiB_; }

//global z and slope of stub
int zPosition() const { return z_; }
int kSlope() const { return kSlope_; }
//Coarse eta caluclated only using phi segments
int coarseEta() const { return coarseEta_; }
//Approximate Chi2 metrics
Expand All @@ -116,6 +147,7 @@ namespace l1t {
int approxDispErrChi2() const { return approxDispErrChi2_; }

int hitPattern() const { return hitPattern_; }
int thetaDigiPattern() const { return thetaDigiPattern_; }
//step;
int step() const { return step_; }
//sector;
Expand Down Expand Up @@ -156,8 +188,37 @@ namespace l1t {
return kalmanGain0_;
}

const std::vector<float>& ThetaGain1D(unsigned int step) const {
switch (step) {
case 3:
return ThetaGain1D3_;
case 2:
return ThetaGain1D2_;
case 1:
return ThetaGain1D1_;
case 0:
return ThetaGain1D0_;
}
return ThetaGain1D0_;
}

const std::vector<float>& ThetaGain(unsigned int step) const {
switch (step) {
case 3:
return ThetaGain3_;
case 2:
return ThetaGain2_;
case 1:
return ThetaGain1_;
case 0:
return ThetaGain0_;
}
return ThetaGain0_;
}

//get covariance
const std::vector<double>& covariance() const { return covariance_; }
const std::vector<double>& covarianceNB() const { return covarianceNB_; }

//get residual
int residual(uint i) const { return residuals_[i]; }
Expand Down Expand Up @@ -188,23 +249,29 @@ namespace l1t {
}

//Set coordinates general
void setCoordinates(int step, int curv, int phi, int phiB) {
void setCoordinates(int step, int curv, int phi, int phiB, int z, int kSlope) {
step_ = step;
curv_ = curv;
phiB_ = phiB;
phi_ = phi;
z_ = z;
kSlope_ = kSlope;
}

void setCoordinatesAtVertex(int curv, int phi, int dxy) {
void setCoordinatesAtVertex(int curv, int phi, int dxy, int z, int kSlope) {
curvVertex_ = curv;
phiVertex_ = phi;
dxy_ = dxy;
zVertex_ = z;
kSlopeVertex_ = kSlope;
}

void setCoordinatesAtMuon(int curv, int phi, int phiB) {
void setCoordinatesAtMuon(int curv, int phi, int phiB, int z, int kSlope) {
curvMuon_ = curv;
phiMuon_ = phi;
phiBMuon_ = phiB;
zMuon_ = z;
kSlopeMuon_ = kSlope;
}

void setPt(int ptC, int ptU) {
Expand All @@ -215,6 +282,7 @@ namespace l1t {
void setCoarseEta(int eta) { coarseEta_ = eta; }

void setHitPattern(int pattern) { hitPattern_ = pattern; }
void setThetaDigiPattern(int theta_pattern) { thetaDigiPattern_ = theta_pattern; }

void setApproxChi2(int chi, int chiErr, bool prompt) {
if (prompt) {
Expand Down Expand Up @@ -305,14 +373,101 @@ namespace l1t {
}
}

void setThetaGain1D(unsigned int step,
unsigned int K,
int priorThetaPattern,
int seedStation,
int priorPhiPattern,
float G31,
float G32,
float G41,
float G42) {
std::vector<float>* v1 = nullptr;
switch (step) {
case 3:
v1 = &ThetaGain1D3_;
break;
case 2:
v1 = &ThetaGain1D2_;
break;
case 1:
v1 = &ThetaGain1D1_;
break;
case 0:
v1 = &ThetaGain1D0_;
break;
default:
throw cms::Exception("WrongCondition") << "1D: Critical ERROR on setting the Theta gain\n";
}
v1->push_back(static_cast<float>(K));
v1->push_back(static_cast<float>(priorThetaPattern));
v1->push_back(static_cast<float>(seedStation));
v1->push_back(static_cast<float>(priorPhiPattern));
v1->push_back(G31);
v1->push_back(G32);
v1->push_back(G41);
v1->push_back(G42);
}

void setThetaGain(unsigned int step,
unsigned int K,
int priorThetaPattern,
int seedStation,
int priorPhiPattern,
float G32,
float G33,
float G42,
float G43) {
std::vector<float>* v2 = nullptr;
switch (step) {
case 3:
v2 = &ThetaGain3_;
break;
case 2:
v2 = &ThetaGain2_;
break;
case 1:
v2 = &ThetaGain1_;
break;
case 0:
v2 = &ThetaGain0_;
break;
default:
throw cms::Exception("WrongCondition") << "Critical ERROR on setting the Theta gain\n";
}
v2->push_back(static_cast<float>(K));
v2->push_back(static_cast<float>(priorThetaPattern));
v2->push_back(static_cast<float>(seedStation));
v2->push_back(static_cast<float>(priorPhiPattern));
v2->push_back(G32);
v2->push_back(G33);
v2->push_back(G42);
v2->push_back(G43);
}

//set covariance
void setCovariance(const CovarianceMatrix& c) {
void setCovariance(const CovarianceMatrix5dim& c) {
covariance_[0] = c(0, 0);
covariance_[1] = c(0, 1);
covariance_[2] = c(1, 1);
covariance_[3] = c(0, 2);
covariance_[4] = c(1, 2);
covariance_[5] = c(2, 2);
covariance_[6] = c(0, 3);
covariance_[7] = c(1, 3);
covariance_[8] = c(2, 3);
covariance_[9] = c(3, 3);
covariance_[10] = c(0, 4);
covariance_[11] = c(1, 4);
covariance_[12] = c(2, 4);
covariance_[13] = c(3, 4);
covariance_[14] = c(4, 4);
}

void setCovarianceNB(const CovarianceMatrix2dim& c) {
covarianceNB_[0] = c(0, 0);
covarianceNB_[1] = c(0, 1);
covarianceNB_[2] = c(1, 1);
}

//set fine eta
Expand All @@ -329,24 +484,31 @@ namespace l1t {

//Covariance matrix for studies
std::vector<double> covariance_;
std::vector<double> covarianceNB_;
l1t::MuonStubRefVector stubs_;

//vertex coordinates
int curvVertex_;
int ptC_;
int phiVertex_;
int dxy_;
int zVertex_;
int kSlopeVertex_;

//muon coordinates
int curvMuon_;
int ptU_;
int phiMuon_;
int phiBMuon_;
int zMuon_;
int kSlopeMuon_;

//generic coordinates
int curv_;
int phi_;
int phiB_;
int z_;
int kSlope_;
//common coordinates
int coarseEta_;

Expand All @@ -358,6 +520,8 @@ namespace l1t {

//phi bitmask
int hitPattern_;
//bitmask pattern based on theta digi presence
int thetaDigiPattern_;

//propagation step
int step_;
Expand Down Expand Up @@ -393,6 +557,16 @@ namespace l1t {
std::vector<float> kalmanGain3_;

std::vector<int> residuals_;

std::vector<float> ThetaGain1D0_;
std::vector<float> ThetaGain1D1_;
std::vector<float> ThetaGain1D2_;
std::vector<float> ThetaGain1D3_;

std::vector<float> ThetaGain0_;
std::vector<float> ThetaGain1_;
std::vector<float> ThetaGain2_;
std::vector<float> ThetaGain3_;
};

} // namespace l1t
Expand Down
4 changes: 3 additions & 1 deletion DataFormats/L1TMuonPhase2/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
<class name="edm::Wrapper<std::vector<l1t::SAMuon > >"/>
<class name="edm::Ref<l1t::SAMuonCollection>" splitLevel="0"/>

<class name="l1t::KMTFTrack" ClassVersion="3">
<class name="l1t::KMTFTrack" ClassVersion="5">
<version ClassVersion="5" checksum="251130338"/>
<version ClassVersion="4" checksum="251130338"/>
Comment on lines +29 to +30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one new class version should be added. Very likely you also need to rebase on top of 20_0_0_pre1 (hopefully available early next week) because the checksum for version 3 will be changed for that.

<version ClassVersion="3" checksum="502486181"/>
</class>
<class name="std::vector<l1t::KMTFTrack>"/>
Expand Down

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the intended location of this file or is it planned to live elsewhere like cms-data?

Binary file not shown.
Loading