From efe01464cf0feaefa94469b48c6ef51071cecbe1 Mon Sep 17 00:00:00 2001 From: Alessandro Rossi Date: Thu, 11 Apr 2019 00:58:27 +0200 Subject: [PATCH] Added Residuals plots and fix monitoring plots for ClusterRepairs --- .../interface/TrackerValidationVariables.h | 6 ++- .../src/TrackerValidationVariables.cc | 13 +++++ .../plugins/SiPixelPhase1RecHits.cc | 2 + .../plugins/SiPixelPhase1TrackResiduals.cc | 17 ++++++- .../python/SiPixelPhase1RecHits_cfi.py | 20 ++++---- .../python/SiPixelPhase1TrackResiduals_cfi.py | 48 ++++++++++++++++++- 6 files changed, 92 insertions(+), 14 deletions(-) diff --git a/Alignment/OfflineValidation/interface/TrackerValidationVariables.h b/Alignment/OfflineValidation/interface/TrackerValidationVariables.h index de24622d1e262..2374ce36e5e38 100644 --- a/Alignment/OfflineValidation/interface/TrackerValidationVariables.h +++ b/Alignment/OfflineValidation/interface/TrackerValidationVariables.h @@ -26,7 +26,7 @@ class TrackerValidationVariables AVHitStruct() : resX(-999.), resY(-999.), resErrX(-999.), resErrY(-999.), resXprime(-999.), resXatTrkY(-999.), resXprimeErr(-999.), resYprime(-999.), resYprimeErr(-999.), phi(-999.), eta(-999.), inside(false), localX(-999.), localY(-999.), localXnorm(-999.), localYnorm(-999.), localAlpha(-999.), localBeta(-999.), - rawDetId(0) {} + rawDetId(0), isOnEdgePixel(false), isOtherBadPixel(false) {} float resX; float resY; float resErrX; @@ -46,6 +46,8 @@ class TrackerValidationVariables float localAlpha; float localBeta; uint32_t rawDetId; + bool isOnEdgePixel; + bool isOtherBadPixel; }; struct AVTrackStruct @@ -68,7 +70,7 @@ class TrackerValidationVariables float dz; int charge; int numberOfValidHits; - int numberOfLostHits; + int numberOfLostHits; std::vector hits; }; diff --git a/Alignment/OfflineValidation/src/TrackerValidationVariables.cc b/Alignment/OfflineValidation/src/TrackerValidationVariables.cc index 214bf20a6e473..4c018ef54e936 100644 --- a/Alignment/OfflineValidation/src/TrackerValidationVariables.cc +++ b/Alignment/OfflineValidation/src/TrackerValidationVariables.cc @@ -29,6 +29,7 @@ #include "DataFormats/Math/interface/deltaPhi.h" #include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "DataFormats/SiStripDetId/interface/SiStripDetId.h" @@ -80,6 +81,12 @@ void TrackerValidationVariables::fillHitQuantities(reco::Track const & track, st if(IntSubDetID == 0) continue; + if (IntSubDetID == PixelSubdetector::PixelBarrel || IntSubDetID == PixelSubdetector::PixelEndcap){ + const SiPixelRecHit* prechit = dynamic_cast(hit);//to be used to get the associated cluster and the cluster probability + if(prechit->isOnEdge()) hitStruct.isOnEdgePixel=true; + if(prechit->hasBadPixels()) hitStruct.isOtherBadPixel=true; + } + auto lPTrk = trajParams[h].position(); // update state auto lVTrk = trajParams[h].direction(); @@ -214,6 +221,12 @@ TrackerValidationVariables::fillHitQuantities(const Trajectory* trajectory, std: unsigned int IntSubDetID = (hit_detId.subdetId()); if(IntSubDetID == 0) continue; + + if (IntSubDetID == PixelSubdetector::PixelBarrel || IntSubDetID == PixelSubdetector::PixelEndcap){ + const SiPixelRecHit* prechit = dynamic_cast(hit.get());//to be used to get the associated cluster and the cluster probability + if(prechit->isOnEdge()) hitStruct.isOnEdgePixel=true; + if(prechit->hasBadPixels()) hitStruct.isOtherBadPixel=true; + } //first calculate residuals in cartesian coordinates in the local module coordinate system diff --git a/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1RecHits.cc b/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1RecHits.cc index 7fd9fb44eaea2..4bb45ef1a70be 100644 --- a/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1RecHits.cc +++ b/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1RecHits.cc @@ -166,6 +166,8 @@ void SiPixelPhase1RecHits::analyze(const edm::Event& iEvent, const edm::EventSet } histo[NRECHITS].executePerEventHarvesting(&iEvent); + histo[NONEDGE].executePerEventHarvesting(&iEvent); + histo[NOTHERBAD].executePerEventHarvesting(&iEvent); } } //namespace diff --git a/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1TrackResiduals.cc b/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1TrackResiduals.cc index 28b4a5e3020e7..b079f5ad420ac 100644 --- a/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1TrackResiduals.cc +++ b/DQM/SiPixelPhase1Track/plugins/SiPixelPhase1TrackResiduals.cc @@ -25,7 +25,11 @@ namespace { class SiPixelPhase1TrackResiduals final : public SiPixelPhase1Base { enum { RESIDUAL_X, - RESIDUAL_Y + RESIDUAL_Y, + RESONEDGE_X, + RESONEDGE_Y, + RESOTHERBAD_X, + RESOTHERBAD_Y }; public: @@ -80,6 +84,17 @@ void SiPixelPhase1TrackResiduals::analyze(const edm::Event& iEvent, const edm::E histo[RESIDUAL_X].fill(it.resXprime, id, &iEvent); histo[RESIDUAL_Y].fill(it.resYprime, id, &iEvent); + + if(it.isOnEdgePixel){ + histo[RESONEDGE_X].fill(it.resXprime, id, &iEvent); + histo[RESONEDGE_Y].fill(it.resYprime, id, &iEvent); + } + + if(it.isOtherBadPixel){ + histo[RESOTHERBAD_X].fill(it.resXprime, id, &iEvent); + histo[RESOTHERBAD_Y].fill(it.resYprime, id, &iEvent); + } + } } diff --git a/DQM/SiPixelPhase1Track/python/SiPixelPhase1RecHits_cfi.py b/DQM/SiPixelPhase1Track/python/SiPixelPhase1RecHits_cfi.py index 9248b2387795a..e4a25af427809 100644 --- a/DQM/SiPixelPhase1Track/python/SiPixelPhase1RecHits_cfi.py +++ b/DQM/SiPixelPhase1Track/python/SiPixelPhase1RecHits_cfi.py @@ -133,25 +133,25 @@ Specification().groupBy("PXBarrel/PXLayer/Event") .reduce("COUNT") .groupBy("PXBarrel/PXLayer/") - .save(nbins=100, xmin=0, xmax=1000), + .save(nbins=100, xmin=0, xmax=500), Specification().groupBy("PXBarrel/Event") .reduce("COUNT") .groupBy("PXBarrel") - .save(nbins=100, xmin=0, xmax=1000), + .save(nbins=100, xmin=0, xmax=500), Specification().groupBy("PXForward/PXDisk/Event") .reduce("COUNT") .groupBy("PXForward/PXDisk/") - .save(nbins=100, xmin=0, xmax=1000), + .save(nbins=100, xmin=0, xmax=500), Specification().groupBy("PXForward/PXDisk/Event") .reduce("COUNT") .groupBy("PXForward") - .save(nbins=100, xmin=0, xmax=1000), + .save(nbins=100, xmin=0, xmax=500), Specification().groupBy("PXAll/Event") .reduce("COUNT") .groupBy("PXAll") - .save(nbins=100, xmin=0, xmax=1000) + .save(nbins=100, xmin=0, xmax=500) ) ) @@ -181,25 +181,25 @@ Specification().groupBy("PXBarrel/PXLayer/Event") .reduce("COUNT") .groupBy("PXBarrel/PXLayer/") - .save(nbins=100, xmin=0, xmax=1000), + .save(nbins=100, xmin=0, xmax=500), Specification().groupBy("PXBarrel/Event") .reduce("COUNT") .groupBy("PXBarrel") - .save(nbins=100, xmin=0, xmax=1000), + .save(nbins=100, xmin=0, xmax=500), Specification().groupBy("PXForward/PXDisk/Event") .reduce("COUNT") .groupBy("PXForward/PXDisk/") - .save(nbins=100, xmin=0, xmax=1000), + .save(nbins=100, xmin=0, xmax=500), Specification().groupBy("PXForward/PXDisk/Event") .reduce("COUNT") .groupBy("PXForward") - .save(nbins=100, xmin=0, xmax=1000), + .save(nbins=100, xmin=0, xmax=500), Specification().groupBy("PXAll/Event") .reduce("COUNT") .groupBy("PXAll") - .save(nbins=100, xmin=0, xmax=1000) + .save(nbins=100, xmin=0, xmax=500) ) ) diff --git a/DQM/SiPixelPhase1Track/python/SiPixelPhase1TrackResiduals_cfi.py b/DQM/SiPixelPhase1Track/python/SiPixelPhase1TrackResiduals_cfi.py index 2ef49ff61b017..b01487f121d50 100644 --- a/DQM/SiPixelPhase1Track/python/SiPixelPhase1TrackResiduals_cfi.py +++ b/DQM/SiPixelPhase1Track/python/SiPixelPhase1TrackResiduals_cfi.py @@ -35,9 +35,55 @@ xlabel = "(y_rec - y_pred) [cm]", ) +SiPixelPhase1TrackResidualsResOnEdgeX = DefaultHistoTrack.clone( + name = "residual_OnEdge_x", + title = "Track Residuals X (OnEdge Clusters)", + range_min = -0.1, range_max = 0.1, range_nbins = 100, + xlabel = "(x_rec - x_pred) [cm]", + dimensions = 1, + specs = VPSet( + Specification().groupBy("PXBarrel/PXLayer").saveAll(), + Specification().groupBy("PXForward/PXDisk").saveAll(), + Specification(PerLayer1D).groupBy("PXBarrel/Shell/PXLayer").save(), + Specification(PerLayer1D).groupBy("PXForward/HalfCylinder/PXRing/PXDisk").save() + ) +) + +SiPixelPhase1TrackResidualsResOnEdgeY = SiPixelPhase1TrackResidualsResOnEdgeX.clone( + name = "residual_OnEdge_y", + title = "Track Residuals Y (OnEdge Clusters)", + xlabel = "(y_rec - y_pred) [cm]", +) + + +SiPixelPhase1TrackResidualsResOtherBadX = DefaultHistoTrack.clone( + name = "residual_OtherBad_x", + title = "Track Residuals X (OtherBad Clusters)", + range_min = -0.1, range_max = 0.1, range_nbins = 100, + xlabel = "(x_rec - x_pred) [cm]", + dimensions = 1, + specs = VPSet( + Specification().groupBy("PXBarrel/PXLayer").saveAll(), + Specification().groupBy("PXForward/PXDisk").saveAll(), + Specification(PerLayer1D).groupBy("PXBarrel/Shell/PXLayer").save(), + Specification(PerLayer1D).groupBy("PXForward/HalfCylinder/PXRing/PXDisk").save() + ) +) + +SiPixelPhase1TrackResidualsResOtherBadY = SiPixelPhase1TrackResidualsResOtherBadX.clone( + name = "residual_OtherBad_y", + title = "Track Residuals Y (OtherBad Clusters)", + xlabel = "(y_rec - y_pred) [cm]", +) + + SiPixelPhase1TrackResidualsConf = cms.VPSet( SiPixelPhase1TrackResidualsResidualsX, - SiPixelPhase1TrackResidualsResidualsY + SiPixelPhase1TrackResidualsResidualsY, + SiPixelPhase1TrackResidualsResOnEdgeX, + SiPixelPhase1TrackResidualsResOnEdgeY, + SiPixelPhase1TrackResidualsResOtherBadX, + SiPixelPhase1TrackResidualsResOtherBadY ) from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer