Skip to content

Commit

Permalink
Merge pull request #45174 from CMSTrackingPOG/dataMCValidation_fixes_…
Browse files Browse the repository at this point in the history
…14_0_X

[14.0.X] Miscellaneous fixes for TRK POG Data/MC validation tool
  • Loading branch information
cmsbuild authored Jun 20, 2024
2 parents 7e7b449 + 0f4aa34 commit 338b0d7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
23 changes: 12 additions & 11 deletions DQM/TrackingMonitorSource/plugins/StandaloneTrackMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1836,17 +1836,18 @@ void StandaloneTrackMonitor::analyze(edm::Event const& iEvent, edm::EventSetup c
theMainVtx = *theClosestVertex;
}
if (theMainVtx.isValid()) {
const math::XYZPoint theMainVtxPos(
theMainVtx.position().x(), theMainVtx.position().y(), theMainVtx.position().z());
const math::XYZPoint myVertex(
mumuTransientVtx.position().x(), mumuTransientVtx.position().y(), mumuTransientVtx.position().z());
const math::XYZPoint deltaVtx(
theMainVtxPos.x() - myVertex.x(), theMainVtxPos.y() - myVertex.y(), theMainVtxPos.z() - myVertex.z());
double cosphi3D =
(Zp.Px() * deltaVtx.x() + Zp.Py() * deltaVtx.y() + Zp.Pz() * deltaVtx.z()) /
(sqrt(Zp.Px() * Zp.Px() + Zp.Py() * Zp.Py() + Zp.Pz() * Zp.Pz()) *
sqrt(deltaVtx.x() * deltaVtx.x() + deltaVtx.y() * deltaVtx.y() + deltaVtx.z() * deltaVtx.z()));
cosPhi3DdileptonH_->Fill(cosphi3D, wfac);
const auto& mainVertexPos = theMainVtx.position();
const auto& myVertexPos = mumuTransientVtx.position();

const double deltaX = myVertexPos.x() - mainVertexPos.x();
const double deltaY = myVertexPos.y() - mainVertexPos.y();
const double deltaZ = myVertexPos.z() - mainVertexPos.z();

const double deltaNorm = sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);
const double zpNorm = sqrt(Zp.Px() * Zp.Px() + Zp.Py() * Zp.Py() + Zp.Pz() * Zp.Pz());

const double cosPhi3D = (Zp.Px() * deltaX + Zp.Py() * deltaY + Zp.Pz() * deltaZ) / (zpNorm * deltaNorm);
cosPhi3DdileptonH_->Fill(cosPhi3D, wfac);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
verbose = False,
trackEtaH = dict(Xbins = 60, Xmin = -3.0, Xmax = 3.0),
trackPtH = dict(Xbins = 100, Xmin = 0.0 ,Xmax = 100.0),
trackPhiH = dict(Xbins = 100, Xmin = 3.15, Xmax = 3.15),
trackPhiH = dict(Xbins = 100, Xmin = -3.15, Xmax = 3.15),
#trackMVAH = dict(Xbins = 100 ,Xmin = -1.0, Xmax = 1.0)
)
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
* selectedPrimaryVertices
* KShortEventSelector
* KshortTracks
* standaloneTrackMonitorK0
* standaloneTrackMonitorK0MC
* KshortMonitor)

standaloneValidationLambdas = cms.Sequence(
Expand Down

0 comments on commit 338b0d7

Please sign in to comment.