35 plotMuons_(conf_.getParameter<
bool>(
"ifPlotMuons")),
36 pixelHitsPerLeg_(conf_.getParameter<
int>(
"pixelHitsPerLeg")),
37 totalHitsPerLeg_(conf_.getParameter<
int>(
"totalHitsPerLeg")),
38 d0Cut_(conf_.getParameter<double>(
"d0Cut")),
39 dzCut_(conf_.getParameter<double>(
"dzCut")),
40 ptCut_(conf_.getParameter<double>(
"ptCut")),
41 norchiCut_(conf_.getParameter<double>(
"norchiCut")) {}
183 if (splitTracks->size() == 2) {
185 edm::LogInfo(
"TrackSplittingMonitor") <<
"Split Track size: " << splitTracks->size();
195 double nRechits1 = 0;
196 double nRechitinBPIX1 = 0;
197 for (
auto const& iHit : track1.
recHits()) {
198 if (iHit->isValid()) {
200 int type = iHit->geographicalId().subdetId();
207 double nRechits2 = 0;
208 double nRechitinBPIX2 = 0;
209 for (
auto const& iHit : track2.
recHits()) {
210 if (iHit->isValid()) {
212 int type = iHit->geographicalId().subdetId();
220 double d01 = track1.
d0();
221 double dz1 = track1.
dz();
222 double d02 = track2.
d0();
223 double dz2 = track2.
dz();
226 double pt1 = track1.
pt();
227 double pt2 = track2.
pt();
245 edm::LogInfo(
"TrackSplittingMonitor") <<
" Setected after all cuts ?";
247 double ddxyVal = d01 - d02;
248 double ddzVal = dz1 - dz2;
249 double dphiVal = track1.
phi() - track2.
phi();
250 double dthetaVal = track1.
theta() - track2.
theta();
251 double dptVal =
pt1 -
pt2;
252 double dcurvVal = (1 /
pt1) - (1 /
pt2);
254 double d01ErrVal = track1.
d0Error();
255 double d02ErrVal = track2.
d0Error();
256 double dz1ErrVal = track1.
dzError();
257 double dz2ErrVal = track2.
dzError();
258 double phi1ErrVal = track1.
phiError();
259 double phi2ErrVal = track2.
phiError();
262 double pt1ErrVal = track1.
ptError();
263 double pt2ErrVal = track2.
ptError();
276 sqrt(theta1ErrVal * theta1ErrVal + theta2ErrVal * theta2ErrVal));
284 bool topGlobalMuonFlag =
false;
285 bool bottomGlobalMuonFlag =
false;
286 int topGlobalMuon = -1;
287 int bottomGlobalMuon = -1;
288 double topGlobalMuonNorchi2 = 1e10;
289 double bottomGlobalMuonNorchi2 = 1e10;
292 for (std::vector<reco::Muon>::const_iterator gmI =
splitMuons->begin(); gmI !=
splitMuons->end(); gmI++) {
293 if (gmI->isTrackerMuon() && gmI->isStandAloneMuon() && gmI->isGlobalMuon()) {
297 if (gmI->innerTrack() == trackerTrackRef1) {
298 if (gmI->globalTrack()->normalizedChi2() < topGlobalMuonNorchi2) {
299 topGlobalMuonFlag =
true;
300 topGlobalMuonNorchi2 = gmI->globalTrack()->normalizedChi2();
301 topGlobalMuon = gmCtr;
304 if (gmI->innerTrack() == trackerTrackRef2) {
305 if (gmI->globalTrack()->normalizedChi2() < bottomGlobalMuonNorchi2) {
306 bottomGlobalMuonFlag =
true;
307 bottomGlobalMuonNorchi2 = gmI->globalTrack()->normalizedChi2();
308 bottomGlobalMuon = gmCtr;
315 if (bottomGlobalMuonFlag && topGlobalMuonFlag) {
322 double ddxyValGlb = glb1->d0() - glb2->d0();
323 double ddzValGlb = glb1->dz() - glb2->dz();
324 double dphiValGlb = glb1->phi() - glb2->phi();
325 double dthetaValGlb = glb1->theta() - glb2->theta();
326 double dptValGlb = glb1->pt() - glb2->pt();
327 double dcurvValGlb = (1 / glb1->pt()) - (1 / glb2->pt());
329 double d01ErrValGlb = glb1->d0Error();
330 double d02ErrValGlb = glb2->d0Error();
331 double dz1ErrValGlb = glb1->dzError();
332 double dz2ErrValGlb = glb2->dzError();
333 double phi1ErrValGlb = glb1->phiError();
334 double phi2ErrValGlb = glb2->phiError();
335 double theta1ErrValGlb = glb1->thetaError();
336 double theta2ErrValGlb = glb2->thetaError();
337 double pt1ErrValGlb = glb1->ptError();
338 double pt2ErrValGlb = glb2->ptError();
348 sqrt(d01ErrValGlb * d01ErrValGlb + d02ErrValGlb * d02ErrValGlb));
350 sqrt(dz1ErrValGlb * dz1ErrValGlb + dz2ErrValGlb * dz2ErrValGlb));
352 dphiValGlb /
sqrt(phi1ErrValGlb * phi1ErrValGlb + phi2ErrValGlb * phi2ErrValGlb));
354 dthetaValGlb /
sqrt(theta1ErrValGlb * theta1ErrValGlb + theta2ErrValGlb * theta2ErrValGlb));
356 sqrt(pt1ErrValGlb * pt1ErrValGlb + pt2ErrValGlb * pt2ErrValGlb));
372 "Validates track parameters resolution by splitting cosmics tracks at the PCA and comparing the parameters of " 377 desc.add<
bool>(
"ifPlotMuons",
true);
378 desc.add<
int>(
"pixelHitsPerLeg", 1);
379 desc.add<
int>(
"totalHitsPerLeg", 6);
380 desc.add<
double>(
"d0Cut", 12.0);
381 desc.add<
double>(
"dzCut", 25.0);
382 desc.add<
double>(
"ptCut", 4.0);
383 desc.add<
double>(
"norchiCut", 100.0);
384 desc.add<
int>(
"ddxyBin", 100);
385 desc.add<
double>(
"ddxyMin", -200.0);
386 desc.add<
double>(
"ddxyMax", 200.0);
387 desc.add<
int>(
"ddzBin", 100);
388 desc.add<
double>(
"ddzMin", -400.0);
389 desc.add<
double>(
"ddzMax", 400.0);
390 desc.add<
int>(
"dphiBin", 100);
391 desc.add<
double>(
"dphiMin", -0.01);
392 desc.add<
double>(
"dphiMax", 0.01);
393 desc.add<
int>(
"dthetaBin", 100);
394 desc.add<
double>(
"dthetaMin", -0.01);
395 desc.add<
double>(
"dthetaMax", 0.01);
396 desc.add<
int>(
"dptBin", 100);
397 desc.add<
double>(
"dptMin", -5.0);
398 desc.add<
double>(
"dptMax", 5.0);
399 desc.add<
int>(
"dcurvBin", 100);
400 desc.add<
double>(
"dcurvMin", -0.005);
401 desc.add<
double>(
"dcurvMax", 0.005);
402 desc.add<
int>(
"normBin", 100);
403 desc.add<
double>(
"normMin", -5.);
404 desc.add<
double>(
"normMax", 5.);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
MonitorElement * dthetaAbsoluteResiduals_global_
static constexpr double sqrt2
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
MonitorElement * dcurvNormalizedResiduals_global_
const CSCGeometry * cscGeometry
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
virtual void setCurrentFolder(std::string const &fullpath)
static constexpr double cmToUm
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
MonitorElement * dthetaAbsoluteResiduals_tracker_
MonitorElement * ddzNormalizedResiduals_global_
double thetaError() const
error on theta
MonitorElement * ddxyNormalizedResiduals_tracker_
MonitorElement * dcurvAbsoluteResiduals_tracker_
const DTGeometry * dtGeometry
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
MonitorElement * ddzAbsoluteResiduals_global_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
const RPCGeometry * rpcGeometry
MonitorElement * dphiNormalizedResiduals_global_
double pt() const
track transverse momentum
auto recHits() const
Access to reconstructed hits on the track.
MonitorElement * dthetaNormalizedResiduals_tracker_
const edm::EDGetTokenT< std::vector< reco::Muon > > splitMuonsToken_
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
MonitorElement * ddxyNormalizedResiduals_global_
MonitorElement * dthetaNormalizedResiduals_global_
double dzError() const
error on dz
const MagneticField * theMagField
MonitorElement * dphiNormalizedResiduals_tracker_
const TrackerGeometry * theGeometry
MonitorElement * dcurvAbsoluteResiduals_global_
MonitorElement * dphiAbsoluteResiduals_tracker_
Abs< T >::type abs(const T &t)
double phi() const
azimuthal angle of momentum vector
MonitorElement * ddzNormalizedResiduals_tracker_
#define DEFINE_FWK_MODULE(type)
MonitorElement * dptAbsoluteResiduals_global_
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
MonitorElement * dptAbsoluteResiduals_tracker_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const int pixelHitsPerLeg_
Log< level::Info, false > LogInfo
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
TrackSplittingMonitor(const edm::ParameterSet &)
const int totalHitsPerLeg_
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * ddzAbsoluteResiduals_tracker_
static constexpr double radToUrad
double theta() const
polar angle
const edm::EDGetTokenT< std::vector< reco::Track > > splitTracksToken_
MonitorElement * ddxyAbsoluteResiduals_global_
MonitorElement * dcurvNormalizedResiduals_tracker_
MonitorElement * dphiAbsoluteResiduals_global_
MonitorElement * dptNormalizedResiduals_tracker_
MonitorElement * dptNormalizedResiduals_global_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
double d0Error() const
error on d0
double phiError() const
error on phi
MonitorElement * ddxyAbsoluteResiduals_tracker_
const edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)