Skip to content

Commit 76bcfc8

Browse files
authored
Merge pull request #45173 from CMSTrackingPOG/dataMCValidation_fixes_14_1_X
Miscellaneous fixes for TRK POG Data/MC validation tool
2 parents 7c5b19e + e5a0fb2 commit 76bcfc8

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

DQM/TrackingMonitorSource/plugins/StandaloneTrackMonitor.cc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,17 +1836,18 @@ void StandaloneTrackMonitor::analyze(edm::Event const& iEvent, edm::EventSetup c
18361836
theMainVtx = *theClosestVertex;
18371837
}
18381838
if (theMainVtx.isValid()) {
1839-
const math::XYZPoint theMainVtxPos(
1840-
theMainVtx.position().x(), theMainVtx.position().y(), theMainVtx.position().z());
1841-
const math::XYZPoint myVertex(
1842-
mumuTransientVtx.position().x(), mumuTransientVtx.position().y(), mumuTransientVtx.position().z());
1843-
const math::XYZPoint deltaVtx(
1844-
theMainVtxPos.x() - myVertex.x(), theMainVtxPos.y() - myVertex.y(), theMainVtxPos.z() - myVertex.z());
1845-
double cosphi3D =
1846-
(Zp.Px() * deltaVtx.x() + Zp.Py() * deltaVtx.y() + Zp.Pz() * deltaVtx.z()) /
1847-
(sqrt(Zp.Px() * Zp.Px() + Zp.Py() * Zp.Py() + Zp.Pz() * Zp.Pz()) *
1848-
sqrt(deltaVtx.x() * deltaVtx.x() + deltaVtx.y() * deltaVtx.y() + deltaVtx.z() * deltaVtx.z()));
1849-
cosPhi3DdileptonH_->Fill(cosphi3D, wfac);
1839+
const auto& mainVertexPos = theMainVtx.position();
1840+
const auto& myVertexPos = mumuTransientVtx.position();
1841+
1842+
const double deltaX = myVertexPos.x() - mainVertexPos.x();
1843+
const double deltaY = myVertexPos.y() - mainVertexPos.y();
1844+
const double deltaZ = myVertexPos.z() - mainVertexPos.z();
1845+
1846+
const double deltaNorm = sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);
1847+
const double zpNorm = sqrt(Zp.Px() * Zp.Px() + Zp.Py() * Zp.Py() + Zp.Pz() * Zp.Pz());
1848+
1849+
const double cosPhi3D = (Zp.Px() * deltaX + Zp.Py() * deltaY + Zp.Pz() * deltaZ) / (zpNorm * deltaNorm);
1850+
cosPhi3DdileptonH_->Fill(cosPhi3D, wfac);
18501851
}
18511852
}
18521853
}

DQM/TrackingMonitorSource/python/StandaloneTrackMonitor_cfi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
verbose = False,
2525
trackEtaH = dict(Xbins = 60, Xmin = -3.0, Xmax = 3.0),
2626
trackPtH = dict(Xbins = 100, Xmin = 0.0 ,Xmax = 100.0),
27-
trackPhiH = dict(Xbins = 100, Xmin = 3.15, Xmax = 3.15),
27+
trackPhiH = dict(Xbins = 100, Xmin = -3.15, Xmax = 3.15),
2828
#trackMVAH = dict(Xbins = 100 ,Xmin = -1.0, Xmax = 1.0)
2929
)

DQM/TrackingMonitorSource/python/TrackingDataMCValidation_Standalone_cff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
* selectedPrimaryVertices
179179
* KShortEventSelector
180180
* KshortTracks
181-
* standaloneTrackMonitorK0
181+
* standaloneTrackMonitorK0MC
182182
* KshortMonitor)
183183

184184
standaloneValidationLambdas = cms.Sequence(

0 commit comments

Comments
 (0)