CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
PackedCandidateTrackValidator Class Reference
Inheritance diagram for PackedCandidateTrackValidator:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 PackedCandidateTrackValidator (const edm::ParameterSet &pset)
 
 ~PackedCandidateTrackValidator () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Private Types

enum  {
  sf_AllTracks = 0, sf_AssociatedToPC = 1, sf_PCIsCharged = 2, sf_PCHasTrack = 3,
  sf_PCIsNotElectron = 4, sf_PCHasHits = 5, sf_PCNdofNot0 = 6, sf_NoMissingInnerHits = 7
}
 

Private Attributes

bool debug_
 
MonitorElementh_diffCharge
 
PackedValueCheck< Float16Helper > h_diffCovDszDsz
 
PackedValueCheck< Float16Helper > h_diffCovDxyDsz
 
PackedValueCheck< Float16Helper > h_diffCovDxyDxy
 
PackedValueCheck< LogIntHelper > h_diffCovLambdaDsz
 
PackedValueCheck< LogIntHelper > h_diffCovLambdaLambda
 
PackedValueCheck< LogIntHelper > h_diffCovPhiDxy
 
PackedValueCheck< LogIntHelper > h_diffCovPhiPhi
 
PackedValueCheck< LogIntHelper > h_diffCovQoverpQoverp
 
MonitorElementh_diffDszError
 
PackedValueCheck< Float16Helper > h_diffDxyAssocPV
 
MonitorElementh_diffDxyError
 
MonitorElementh_diffDxyPV
 
PackedValueCheck< Float16Helper > h_diffDzAssocPV
 
MonitorElementh_diffDzError
 
MonitorElementh_diffDzPV
 
MonitorElementh_diffEta
 
MonitorElementh_diffEtaError
 
MonitorElementh_diffHitPatternHasValidHitInFirstPixelBarrel
 
MonitorElementh_diffHitPatternNumberOfLostInnerHits
 
MonitorElementh_diffHitPatternNumberOfValidHits
 
MonitorElementh_diffHitPatternNumberOfValidPixelHits
 
MonitorElementh_diffHitPatternPixelLayersWithMeasurement
 
MonitorElementh_diffHitPatternStripLayersWithMeasurement
 
MonitorElementh_diffHitPatternTrackerLayersWithMeasurement
 
MonitorElementh_diffIsHighPurity
 
MonitorElementh_diffLostInnerHits
 
MonitorElementh_diffNdof
 
MonitorElementh_diffNormalizedChi2
 
MonitorElementh_diffNumberOfHits
 
MonitorElementh_diffNumberOfPixelHits
 
MonitorElementh_diffNumberOfPixelLayers
 
MonitorElementh_diffNumberOfStripLayers
 
MonitorElementh_diffPhi
 
MonitorElementh_diffPt
 
MonitorElementh_diffPtError
 
MonitorElementh_diffTrackDxyAssocPV
 
MonitorElementh_diffTrackDxyError
 
MonitorElementh_diffTrackDzAssocPV
 
MonitorElementh_diffTrackDzError
 
MonitorElementh_diffVx
 
MonitorElementh_diffVy
 
MonitorElementh_diffVz
 
MonitorElementh_numberHitsOverMax
 
MonitorElementh_numberLayersOverMax
 
MonitorElementh_numberPixelHitsOverMax
 
MonitorElementh_numberPixelLayersOverMax
 
MonitorElementh_numberStripHitsOverMax
 
MonitorElementh_numberStripLayersOverMax
 
MonitorElementh_selectionFlow
 
std::string rootFolder_
 
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_
 
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > trackToPackedCandidateToken_
 
edm::EDGetTokenT< reco::VertexCollectionverticesToken_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 400 of file PackedCandidateTrackValidator.cc.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Constructor & Destructor Documentation

◆ PackedCandidateTrackValidator()

PackedCandidateTrackValidator::PackedCandidateTrackValidator ( const edm::ParameterSet pset)

Definition at line 492 of file PackedCandidateTrackValidator.cc.

493  : tracksToken_(consumes<edm::View<reco::Track>>(iConfig.getUntrackedParameter<edm::InputTag>("tracks"))),
494  verticesToken_(consumes<reco::VertexCollection>(iConfig.getUntrackedParameter<edm::InputTag>("vertices"))),
496  iConfig.getUntrackedParameter<edm::InputTag>("trackToPackedCandidateAssociation"))),
497  rootFolder_(iConfig.getUntrackedParameter<std::string>("rootFolder")),
498  debug_(iConfig.getUntrackedParameter<bool>("debug")),
499  h_diffDxyAssocPV(RangeAbs(0.001)),
500  h_diffDzAssocPV(RangeAbs(0.001)),
501  h_diffCovQoverpQoverp(Range(-1e-6, 0.13), -15, 0), // despite of ceil in pack, there is rounding in double->float
503  Range(-1e-6, 0.13), -20, -5), // despite of ceil in pack, there is rounding in double->float
504  h_diffCovLambdaDsz(RangeAbs(0.13), -17, -4),
505  h_diffCovPhiPhi(RangeAbs(0.13), -15, 0),
506  h_diffCovPhiDxy(RangeAbs(0.13), -17, -4),
507  h_diffCovDxyDxy(RangeAbs(0.001)),
508  h_diffCovDxyDsz(RangeAbs(0.001)),
509  h_diffCovDszDsz(RangeAbs(0.001)) {}
PackedValueCheck< LogIntHelper > h_diffCovLambdaDsz
PackedValueCheck< Float16Helper > h_diffDzAssocPV
PackedValueCheck< Float16Helper > h_diffDxyAssocPV
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_
PixelRecoRange< float > Range
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > trackToPackedCandidateToken_
PackedValueCheck< LogIntHelper > h_diffCovLambdaLambda
PackedValueCheck< LogIntHelper > h_diffCovPhiDxy
PackedValueCheck< Float16Helper > h_diffCovDxyDxy
PackedValueCheck< LogIntHelper > h_diffCovPhiPhi
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
PackedValueCheck< LogIntHelper > h_diffCovQoverpQoverp
PackedValueCheck< Float16Helper > h_diffCovDxyDsz
PackedValueCheck< Float16Helper > h_diffCovDszDsz

◆ ~PackedCandidateTrackValidator()

PackedCandidateTrackValidator::~PackedCandidateTrackValidator ( )
override

Definition at line 511 of file PackedCandidateTrackValidator.cc.

511 {}

Member Function Documentation

◆ analyze()

void PackedCandidateTrackValidator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 818 of file PackedCandidateTrackValidator.cc.

References funct::abs(), reco::TrackBase::charge(), reco::TrackBase::chi2(), reco::TrackBase::covariance(), debug_, reco::deltaPhi(), reco::TrackBase::dxy(), reco::TrackBase::dxyError(), reco::TrackBase::dz(), reco::TrackBase::dzError(), MillePedeFileConverter_cfg::e, reco::TrackBase::eta(), reco::TrackBase::etaError(), dqm::impl::MonitorElement::Fill(), h_diffCharge, h_diffCovDszDsz, h_diffCovDxyDsz, h_diffCovDxyDxy, h_diffCovLambdaDsz, h_diffCovLambdaLambda, h_diffCovPhiDxy, h_diffCovPhiPhi, h_diffCovQoverpQoverp, h_diffDszError, h_diffDxyAssocPV, h_diffDxyError, h_diffDxyPV, h_diffDzAssocPV, h_diffDzError, h_diffDzPV, h_diffEta, h_diffEtaError, h_diffHitPatternHasValidHitInFirstPixelBarrel, h_diffHitPatternNumberOfLostInnerHits, h_diffHitPatternNumberOfValidHits, h_diffHitPatternNumberOfValidPixelHits, h_diffHitPatternPixelLayersWithMeasurement, h_diffHitPatternStripLayersWithMeasurement, h_diffHitPatternTrackerLayersWithMeasurement, h_diffIsHighPurity, h_diffLostInnerHits, h_diffNdof, h_diffNormalizedChi2, h_diffNumberOfHits, h_diffNumberOfPixelHits, h_diffNumberOfPixelLayers, h_diffNumberOfStripLayers, h_diffPhi, h_diffPt, h_diffPtError, h_diffTrackDxyAssocPV, h_diffTrackDxyError, h_diffTrackDzAssocPV, h_diffTrackDzError, h_diffVx, h_diffVy, h_diffVz, h_numberHitsOverMax, h_numberLayersOverMax, h_numberPixelHitsOverMax, h_numberPixelLayersOverMax, h_numberStripHitsOverMax, h_numberStripLayersOverMax, h_selectionFlow, reco::HitPattern::hasValidHitInPixelLayer(), reco::TrackBase::highPurity, reco::TrackBase::hitPattern(), mps_fire::i, reco::TrackBase::i_dsz, reco::TrackBase::i_dxy, reco::TrackBase::i_lambda, reco::TrackBase::i_phi, reco::TrackBase::i_qoverp, edm::Ref< C, T, F >::id(), iEvent, edm::Ref< C, T, F >::isNull(), dqmiolumiharvest::j, edm::Ref< C, T, F >::key(), reco::HitPattern::MISSING_INNER_HITS, reco::HitPattern::MISSING_OUTER_HITS, reco::TrackBase::momentum(), pat::PackedCandidate::moreLostInnerHits, reco::TrackBase::ndof(), pat::PackedCandidate::noLostInnerHits, reco::TrackBase::normalizedChi2(), reco::HitPattern::numberOfLostHits(), reco::HitPattern::numberOfValidHits(), reco::HitPattern::numberOfValidPixelHits(), pat::PackedCandidate::oneLostInnerHit, reco::TrackBase::phi(), reco::TrackBase::phiError(), GeomDetEnumerators::PixelBarrel, reco::HitPattern::pixelLayersWithMeasurement(), reco::Vertex::position(), reco::TrackBase::pt(), reco::TrackBase::ptError(), MetAnalyzer::pv(), reco::TrackBase::quality(), sf_AllTracks, sf_AssociatedToPC, sf_NoMissingInnerHits, sf_PCHasHits, sf_PCHasTrack, sf_PCIsCharged, sf_PCIsNotElectron, sf_PCNdofNot0, reco::HitPattern::stripLayersWithMeasurement(), HLT_2022v12_cff::track, reco::HitPattern::trackerLayersWithMeasurement(), pat::PackedCandidate::trackPixelHitsMask, tracks, tracksToken_, pat::PackedCandidate::trackStripHitsMask, trackToPackedCandidateToken_, heppy_batch::val, pat::PackedCandidate::validHitInFirstPixelBarrelLayer, AlignmentTracksFromVertexSelector_cfi::vertices, verticesToken_, reco::TrackBase::vx(), reco::TrackBase::vy(), and reco::TrackBase::vz().

818  {
820  iEvent.getByToken(tracksToken_, htracks);
821  const auto& tracks = *htracks;
822 
824  iEvent.getByToken(verticesToken_, hvertices);
825  const auto& vertices = *hvertices;
826 
827  if (vertices.empty())
828  return;
829  const reco::Vertex& pv = vertices[0];
830 
832  iEvent.getByToken(trackToPackedCandidateToken_, hassoc);
833  const auto& trackToPackedCandidate = *hassoc;
834 
835  for (size_t i = 0; i < tracks.size(); ++i) {
836  auto trackPtr = tracks.ptrAt(i);
837  const reco::Track& track = *trackPtr;
839 
840  pat::PackedCandidateRef pcRef = trackToPackedCandidate[trackPtr];
841  if (pcRef.isNull()) {
842  continue;
843  }
845 
846  // Filter out neutral PackedCandidates, some of them may have track associated, and for those the charge comparison fails
847  if (pcRef->charge() == 0) {
848  continue;
849  }
851 
852  const reco::Track* trackPcPtr = pcRef->bestTrack();
853  if (!trackPcPtr) {
854  continue;
855  }
857 
858  // Filter out electrons to avoid comparisons to PackedCandidates with GsfTrack
859  if (std::abs(pcRef->pdgId()) == 11) {
860  continue;
861  }
863 
864  // Filter out PackedCandidate-tracks with no hits, as they won't have their details filled
865  const reco::Track& trackPc = *trackPcPtr;
866  if (trackPc.hitPattern().numberOfValidHits() == 0) {
867  continue;
868  }
870 
871  auto slimmedVertexRef = pcRef->vertexRef();
872  const reco::Vertex& pcVertex = vertices[slimmedVertexRef.key()];
873 
874  fillNoFlow(h_diffVx, trackPc.vx() - track.vx());
875  fillNoFlow(h_diffVy, trackPc.vy() - track.vy());
876  fillNoFlow(h_diffVz, trackPc.vz() - track.vz());
877 
878  // PackedCandidate recalculates the ndof in unpacking as
879  // (nhits+npixelhits-5), but some strip hits may have dimension 2.
880  // If PackedCandidate has ndof=0, the resulting normalizedChi2
881  // will be 0 too. Hence, the comparison makes sense only for those
882  // PackedCandidates that have ndof != 0.
883  double diffNormalizedChi2 = 0;
884  if (trackPc.ndof() != 0) {
886  diffNormalizedChi2 = trackPc.normalizedChi2() - track.normalizedChi2();
887  fillNoFlow(h_diffNormalizedChi2, diffNormalizedChi2);
888  }
889  fillNoFlow(h_diffNdof, trackPc.ndof() - track.ndof());
890 
891  auto diffCharge = trackPc.charge() - track.charge();
892  fillNoFlow(h_diffCharge, diffCharge);
893  int diffHP = static_cast<int>(trackPc.quality(reco::TrackBase::highPurity)) -
894  static_cast<int>(track.quality(reco::TrackBase::highPurity));
895  fillNoFlow(h_diffIsHighPurity, diffHP);
896 
897  const auto diffPt = diffRelative(trackPc.pt(), track.pt());
898  const auto diffPhi = reco::deltaPhi(trackPc.phi(), track.phi());
899  fillNoFlow(h_diffPt, diffPt);
900  fillNoFlow(h_diffEta, trackPc.eta() - track.eta());
901  fillNoFlow(h_diffPhi, diffPhi);
902 
903  const auto diffDxyAssocPV =
904  h_diffDxyAssocPV.fill(pcRef->dxy(), track.dxy(pcVertex.position()), [](double value) { return value * 100.; });
905  const auto diffDzAssocPV = h_diffDzAssocPV.fill(
906  pcRef->dzAssociatedPV(), track.dz(pcVertex.position()), [](double value) { return value * 100.; });
907  const auto diffDxyPV = diffRelative(pcRef->dxy(pv.position()), track.dxy(pv.position()));
908  const auto diffDzPV = diffRelative(pcRef->dz(pv.position()), track.dz(pv.position()));
909  fillNoFlow(h_diffDxyPV, diffDxyPV);
910  fillNoFlow(h_diffDzPV, diffDzPV);
911  fillNoFlow(h_diffTrackDxyAssocPV, diffRelative(trackPc.dxy(pcVertex.position()), track.dxy(pcVertex.position())));
912  fillNoFlow(h_diffTrackDzAssocPV, diffRelative(trackPc.dz(pcVertex.position()), track.dz(pcVertex.position())));
913 
914  auto fillCov1 = [&](auto& hlp, const int i, const int j) {
915  return hlp.fill(trackPc.covariance(i, j), track.covariance(i, j));
916  };
917  auto fillCov2 = [&](auto& hlp, const int i, const int j, std::function<double(double)> modifyPack) {
918  return hlp.fill(trackPc.covariance(i, j), track.covariance(i, j), modifyPack);
919  };
920  auto fillCov3 = [&](auto& hlp,
921  const int i,
922  const int j,
923  std::function<double(double)> modifyPack,
924  std::function<double(double)> modifyUnpack) {
925  return hlp.fill(trackPc.covariance(i, j), track.covariance(i, j), modifyPack, modifyUnpack);
926  };
927 
928  const auto pcPt = pcRef->pt();
929  const auto diffCovQoverpQoverp = fillCov3(
933  [=](double val) { return val * pcPt * pcPt; },
934  [=](double val) { return val / pcPt / pcPt; });
935  const auto diffCovLambdaLambda =
937  const auto diffCovLambdaDsz = fillCov1(h_diffCovLambdaDsz, reco::TrackBase::i_lambda, reco::TrackBase::i_dsz);
938  const auto diffCovPhiPhi = fillCov3(
942  [=](double val) { return val * pcPt * pcPt; },
943  [=](double val) { return val / pcPt / pcPt; });
944  const auto diffCovPhiDxy = fillCov1(h_diffCovPhiDxy, reco::TrackBase::i_phi, reco::TrackBase::i_dxy);
945  const auto diffCovDxyDxy = fillCov2(
946  h_diffCovDxyDxy, reco::TrackBase::i_dxy, reco::TrackBase::i_dxy, [](double value) { return value * 10000.; });
947  const auto diffCovDxyDsz = fillCov2(
948  h_diffCovDxyDsz, reco::TrackBase::i_dxy, reco::TrackBase::i_dsz, [](double value) { return value * 10000.; });
949  const auto diffCovDszDsz = fillCov2(
950  h_diffCovDszDsz, reco::TrackBase::i_dsz, reco::TrackBase::i_dsz, [](double value) { return value * 10000.; });
951 
952  if (isInRange(diffCovDszDsz.status())) {
953  fillNoFlow(h_diffDszError, diffRelative(pcRef->dzError(), track.dszError()));
954  fillNoFlow(h_diffDzError, diffRelative(pcRef->dzError(), track.dzError()));
955  fillNoFlow(h_diffTrackDzError, diffRelative(trackPc.dzError(), track.dzError()));
956  }
957  if (isInRange(diffCovDxyDxy.status())) {
958  fillNoFlow(h_diffDxyError, diffRelative(pcRef->dxyError(), track.dxyError()));
959  fillNoFlow(h_diffTrackDxyError, diffRelative(trackPc.dxyError(), track.dxyError()));
960  }
961  fillNoFlow(h_diffPtError, diffRelative(trackPc.ptError(), track.ptError()));
962  fillNoFlow(h_diffEtaError, diffRelative(trackPc.etaError(), track.etaError()));
963 
964  // For the non-HitPattern ones, take into account the PackedCandidate packing precision
965  const auto trackNumberOfHits = track.hitPattern().numberOfValidHits();
966  const auto trackNumberOfPixelHits = track.hitPattern().numberOfValidPixelHits();
967  const auto trackNumberOfStripHits = track.hitPattern().numberOfValidStripHits();
968  const auto pcNumberOfHits = pcRef->numberOfHits();
969  const auto pcNumberOfPixelHits = pcRef->numberOfPixelHits();
970  const auto pcNumberOfStripHits = pcNumberOfHits - pcNumberOfPixelHits;
971  const auto trackNumberOfLayers = track.hitPattern().trackerLayersWithMeasurement();
972  const auto trackNumberOfPixelLayers = track.hitPattern().pixelLayersWithMeasurement();
973  const auto trackNumberOfStripLayers = track.hitPattern().stripLayersWithMeasurement();
974  const auto pcNumberOfLayers = pcRef->trackerLayersWithMeasurement();
975  const auto pcNumberOfPixelLayers = pcRef->pixelLayersWithMeasurement();
976  const auto pcNumberOfStripLayers = pcRef->stripLayersWithMeasurement();
977 
978  // layer number overflow (should be zero)
979  const int pixelLayerOverflow = trackNumberOfPixelLayers > pat::PackedCandidate::trackPixelHitsMask
980  ? trackNumberOfPixelLayers - pat::PackedCandidate::trackPixelHitsMask
981  : 0;
982  const int stripLayerOverflow = trackNumberOfStripLayers > pat::PackedCandidate::trackStripHitsMask
983  ? trackNumberOfStripLayers - pat::PackedCandidate::trackStripHitsMask
984  : 0;
985  const int layerOverflow =
987  ? trackNumberOfLayers -
989  : 0;
990 
991  // hit overflow (should also be zero)
992  const int pixelOverflow =
993  trackNumberOfPixelHits - pcNumberOfPixelLayers > pat::PackedCandidate::trackPixelHitsMask
994  ? trackNumberOfPixelHits - pcNumberOfPixelLayers - pat::PackedCandidate::trackPixelHitsMask
995  : 0;
996  const int stripOverflow =
997  trackNumberOfStripHits - pcNumberOfStripLayers > pat::PackedCandidate::trackStripHitsMask
998  ? trackNumberOfStripHits - pcNumberOfStripLayers - pat::PackedCandidate::trackStripHitsMask
999  : 0;
1000  const int hitsOverflow =
1001  trackNumberOfHits - pcNumberOfLayers >
1003  ? trackNumberOfHits - pcNumberOfLayers -
1005  : 0;
1006  // PackedCandidate counts overflow pixel hits as strip
1007  const int pixelInducedStripOverflow =
1008  (trackNumberOfStripHits + pixelOverflow - pcNumberOfStripLayers) > pat::PackedCandidate::trackStripHitsMask
1009  ? (trackNumberOfStripHits + pixelOverflow - stripOverflow - pcNumberOfStripLayers) -
1011  : 0;
1012  h_numberPixelLayersOverMax->Fill(pixelLayerOverflow);
1013  h_numberStripLayersOverMax->Fill(stripLayerOverflow);
1014  h_numberLayersOverMax->Fill(layerOverflow);
1015  h_numberPixelHitsOverMax->Fill(pixelOverflow);
1016  h_numberStripHitsOverMax->Fill(stripOverflow);
1017  h_numberHitsOverMax->Fill(hitsOverflow);
1018 
1019  int diffNumberOfPixelHits = 0;
1020  int diffNumberOfHits = 0;
1021  int diffNumberOfPixelLayers = 0;
1022  int diffNumberOfStripLayers = 0;
1023  if (pixelLayerOverflow) {
1024  diffNumberOfPixelLayers = pcNumberOfPixelLayers - pat::PackedCandidate::trackPixelHitsMask;
1025  } else {
1026  diffNumberOfPixelLayers = pcNumberOfPixelLayers - trackNumberOfPixelLayers;
1027  }
1028  if (pixelOverflow) {
1029  diffNumberOfPixelHits = pcNumberOfPixelHits - pcNumberOfPixelLayers - pat::PackedCandidate::trackPixelHitsMask;
1030  } else {
1031  diffNumberOfPixelHits = pcNumberOfPixelHits - trackNumberOfPixelHits;
1032  }
1033  if (stripLayerOverflow) {
1034  diffNumberOfStripLayers = pcNumberOfStripLayers - pat::PackedCandidate::trackStripHitsMask;
1035  } else {
1036  diffNumberOfStripLayers = pcNumberOfStripLayers - trackNumberOfStripLayers;
1037  }
1038  if (stripOverflow || pixelInducedStripOverflow || pixelOverflow) {
1039  int diffNumberOfStripHits = 0;
1040  if (stripOverflow || pixelInducedStripOverflow) {
1041  diffNumberOfStripHits = pcNumberOfStripHits - pat::PackedCandidate::trackStripHitsMask;
1042  } else if (pixelOverflow) {
1043  diffNumberOfStripHits = (pcNumberOfStripHits - pixelOverflow) - trackNumberOfStripHits;
1044  }
1045 
1046  diffNumberOfHits = diffNumberOfPixelHits + diffNumberOfStripHits;
1047  } else {
1048  diffNumberOfHits = pcNumberOfHits - trackNumberOfHits;
1049  }
1050 
1051  fillNoFlow(h_diffNumberOfPixelHits, diffNumberOfPixelHits);
1052  fillNoFlow(h_diffNumberOfHits, diffNumberOfHits);
1053  fillNoFlow(h_diffNumberOfPixelLayers, diffNumberOfPixelLayers);
1054  fillNoFlow(h_diffNumberOfStripLayers, diffNumberOfStripLayers);
1055 
1056  int diffLostInnerHits = 0;
1057  const auto trackLostInnerHits = track.hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS);
1058  switch (pcRef->lostInnerHits()) {
1061  diffLostInnerHits = -trackLostInnerHits;
1062  break;
1064  diffLostInnerHits = 1 - trackLostInnerHits;
1065  break;
1067  diffLostInnerHits = trackLostInnerHits >= 2 ? 0 : 2 - trackLostInnerHits;
1068  break;
1069  }
1070  fillNoFlow(h_diffLostInnerHits, diffLostInnerHits);
1071 
1072  // For HitPattern ones, calculate the full diff (i.e. some differences are expected)
1073  auto diffHitPatternPixelLayersWithMeasurement =
1074  trackPc.hitPattern().pixelLayersWithMeasurement() - trackNumberOfPixelLayers;
1075  fillNoFlow(h_diffHitPatternPixelLayersWithMeasurement, diffHitPatternPixelLayersWithMeasurement);
1076  auto diffHitPatternStripLayersWithMeasurement =
1077  trackPc.hitPattern().stripLayersWithMeasurement() - trackNumberOfStripLayers;
1078  fillNoFlow(h_diffHitPatternStripLayersWithMeasurement, diffHitPatternStripLayersWithMeasurement);
1079  auto diffHitPatternTrackerLayersWithMeasurement =
1080  trackPc.hitPattern().trackerLayersWithMeasurement() - trackNumberOfLayers;
1081  fillNoFlow(h_diffHitPatternTrackerLayersWithMeasurement, diffHitPatternTrackerLayersWithMeasurement);
1082  auto diffHitPatternNumberOfValidPixelHits = trackPc.hitPattern().numberOfValidPixelHits() - trackNumberOfPixelHits;
1083  fillNoFlow(h_diffHitPatternNumberOfValidPixelHits, diffHitPatternNumberOfValidPixelHits);
1084  auto diffHitPatternNumberOfValidHits = trackPc.hitPattern().numberOfValidHits() - trackNumberOfHits;
1085  fillNoFlow(h_diffHitPatternNumberOfValidHits, diffHitPatternNumberOfValidHits);
1088  track.hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS));
1089 
1090  // hasValidHitInFirstPixelBarrel is set only if numberOfLostHits(MISSING_INNER_HITS) == 0
1091  int diffHitPatternHasValidHitInFirstPixelBarrel = 0;
1092  if (track.hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS) == 0) {
1094  diffHitPatternHasValidHitInFirstPixelBarrel =
1095  static_cast<int>(
1097  static_cast<int>(track.hitPattern().hasValidHitInPixelLayer(PixelSubdetector::SubDetector::PixelBarrel, 1));
1098  fillNoFlow(h_diffHitPatternHasValidHitInFirstPixelBarrel, diffHitPatternHasValidHitInFirstPixelBarrel);
1099  }
1100 
1101  // Print warning if there are differences outside the expected range
1102  if (debug_ &&
1103  (diffNormalizedChi2 < -1 || diffNormalizedChi2 > 0 || diffCharge != 0 || diffHP != 0 ||
1104  std::abs(diffPhi) > 5e-4 || diffDxyAssocPV.outsideExpectedRange() || diffDzAssocPV.outsideExpectedRange() ||
1105  std::abs(diffDxyPV) > 0.05 || std::abs(diffDzPV) > 0.05 || diffCovQoverpQoverp.outsideExpectedRange() ||
1106  diffCovLambdaLambda.outsideExpectedRange() || diffCovLambdaDsz.outsideExpectedRange() ||
1107  diffCovPhiPhi.outsideExpectedRange() || diffCovPhiDxy.outsideExpectedRange() ||
1108  diffCovDxyDxy.outsideExpectedRange() || diffCovDxyDsz.outsideExpectedRange() ||
1109  diffCovDszDsz.outsideExpectedRange() || diffNumberOfPixelHits != 0 || diffNumberOfHits != 0 ||
1110  diffLostInnerHits != 0 || diffHitPatternHasValidHitInFirstPixelBarrel != 0)) {
1111  edm::LogInfo("PackedCandidateTrackValidator")
1112  << "Track " << i << " pt " << track.pt() << " eta " << track.eta() << " phi " << track.phi() << " chi2 "
1113  << track.chi2() << " ndof " << track.ndof() << "\n"
1114  << " ptError " << track.ptError() << " etaError " << track.etaError() << " phiError " << track.phiError()
1115  << " dxyError " << track.dxyError() << " dzError " << track.dzError() << "\n"
1116  << " refpoint " << track.referencePoint() << " momentum " << track.momentum() << "\n"
1117  << " dxy " << track.dxy() << " dz " << track.dz() << "\n"
1118  << " " << TrackAlgoPrinter(track) << " lost inner hits " << trackLostInnerHits << " lost outer hits "
1119  << track.hitPattern().numberOfLostHits(reco::HitPattern::MISSING_OUTER_HITS) << " hitpattern "
1120  << HitPatternPrinter(track) << " \n"
1121  << " PC " << pcRef.id() << ":" << pcRef.key() << " track pt " << trackPc.pt() << " eta " << trackPc.eta()
1122  << " phi " << trackPc.phi() << " (PC " << pcRef->phi() << ") chi2 " << trackPc.chi2() << " ndof "
1123  << trackPc.ndof() << " pdgId " << pcRef->pdgId() << " mass " << pcRef->mass() << "\n"
1124  << " ptError " << trackPc.ptError() << " etaError " << trackPc.etaError() << " phiError "
1125  << trackPc.phiError() << "\n"
1126  << " pc.vertex " << pcRef->vertex() << " momentum " << pcRef->momentum() << " track " << trackPc.momentum()
1127  << "\n"
1128  << " dxy " << trackPc.dxy() << " dz " << trackPc.dz() << " pc.dz " << pcRef->dz() << " dxyError "
1129  << trackPc.dxyError() << " dzError " << trackPc.dzError() << "\n"
1130  << " dxy(PV) " << trackPc.dxy(pv.position()) << " dz(PV) " << trackPc.dz(pv.position()) << " dxy(assocPV) "
1131  << trackPc.dxy(pcVertex.position()) << " dz(assocPV) " << trackPc.dz(pcVertex.position()) << "\n"
1132  << " (diff PackedCandidate track)"
1133  << " highPurity " << diffHP << " " << trackPc.quality(reco::TrackBase::highPurity) << " "
1134  << track.quality(reco::TrackBase::highPurity) << " charge " << diffCharge << " " << trackPc.charge() << " "
1135  << track.charge() << " normalizedChi2 " << diffNormalizedChi2 << " " << trackPc.normalizedChi2() << " "
1136  << track.normalizedChi2() << "\n "
1137  << " numberOfAllHits " << diffNumberOfHits << " " << pcNumberOfHits << " " << trackNumberOfHits
1138  << " numberOfPixelHits " << diffNumberOfPixelHits << " " << pcNumberOfPixelHits << " "
1139  << trackNumberOfPixelHits << " numberOfStripHits # " << pcNumberOfStripHits << " " << trackNumberOfStripHits
1140  << "\n "
1141  << " hitPattern.numberOfValidPixelHits " << diffHitPatternNumberOfValidPixelHits << " "
1142  << trackPc.hitPattern().numberOfValidPixelHits() << " " << track.hitPattern().numberOfValidPixelHits()
1143  << " hitPattern.numberOfValidHits " << diffHitPatternNumberOfValidHits << " "
1144  << trackPc.hitPattern().numberOfValidHits() << " " << track.hitPattern().numberOfValidHits()
1145  << " hitPattern.hasValidHitInFirstPixelBarrel " << diffHitPatternHasValidHitInFirstPixelBarrel << " "
1147  << track.hitPattern().hasValidHitInPixelLayer(PixelSubdetector::SubDetector::PixelBarrel, 1) << "\n "
1148  << " lostInnerHits " << diffLostInnerHits << " " << pcRef->lostInnerHits() << " #"
1149  << " phi (5e-4) " << diffPhi << " " << trackPc.phi() << " " << track.phi() << "\n "
1150  << " dxy(assocPV) " << diffDxyAssocPV << "\n "
1151  << " dz(assocPV) " << diffDzAssocPV << "\n "
1152  << " dxy(PV) (0.05) " << diffDxyPV << " " << pcRef->dxy(pv.position()) << " " << track.dxy(pv.position())
1153  << "\n "
1154  << " dz(PV) (0.05) " << diffDzPV << " " << pcRef->dz(pv.position()) << " " << track.dz(pv.position()) << "\n "
1155  << " cov(qoverp, qoverp) " << diffCovQoverpQoverp << "\n "
1156  << " cov(lambda, lambda) " << diffCovLambdaLambda << "\n "
1157  << " cov(lambda, dsz) " << diffCovLambdaDsz << "\n "
1158  << " cov(phi, phi) " << diffCovPhiPhi << "\n "
1159  << " cov(phi, dxy) " << diffCovPhiDxy << "\n "
1160  << " cov(dxy, dxy) " << diffCovDxyDxy << "\n "
1161  << " cov(dxy, dsz) " << diffCovDxyDsz << "\n "
1162  << " cov(dsz, dsz) " << diffCovDszDsz;
1163  }
1164  }
1165 }
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
int numberOfValidPixelHits() const
Definition: HitPattern.h:831
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
int numberOfLostHits(HitCategory category) const
Definition: HitPattern.h:891
int numberOfValidHits() const
Definition: HitPattern.h:817
PackedValueCheck< LogIntHelper > h_diffCovLambdaDsz
PackedValueCheck< Float16Helper > h_diffDzAssocPV
PackedValueCheck< Float16Helper > h_diffDxyAssocPV
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:754
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:655
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_
const Point & position() const
position
Definition: Vertex.h:127
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:534
int stripLayersWithMeasurement() const
Definition: HitPattern.h:1005
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > trackToPackedCandidateToken_
key_type key() const
Accessor for product key.
Definition: Ref.h:250
PackedValueCheck< LogIntHelper > h_diffCovLambdaLambda
void Fill(long long x)
double pt() const
track transverse momentum
Definition: TrackBase.h:637
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:590
int charge() const
track electric charge
Definition: TrackBase.h:596
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...
Definition: TrackBase.h:622
int iEvent
Definition: GenABIO.cc:224
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
PackedValueCheck< LogIntHelper > h_diffCovPhiDxy
double dxyError() const
error on dxy
Definition: TrackBase.h:769
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:661
PackedValueCheck< Float16Helper > h_diffCovDxyDxy
double dzError() const
error on dz
Definition: TrackBase.h:778
PackedValueCheck< LogIntHelper > h_diffCovPhiPhi
def pv(vc)
Definition: MetAnalyzer.py:7
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
Definition: value.py:1
bool isNull() const
Checks for null.
Definition: Ref.h:235
Log< level::Info, false > LogInfo
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
auto const & tracks
cannot be loose
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:587
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:593
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
PackedValueCheck< LogIntHelper > h_diffCovQoverpQoverp
PackedValueCheck< Float16Helper > h_diffCovDxyDsz
PackedValueCheck< Float16Helper > h_diffCovDszDsz
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:513
double phiError() const
error on phi
Definition: TrackBase.h:766
double etaError() const
error on eta
Definition: TrackBase.h:763
bool hasValidHitInPixelLayer(enum PixelSubdetector::SubDetector, uint16_t layer) const
Definition: HitPattern.cc:358
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608

◆ bookHistograms()

void PackedCandidateTrackValidator::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 525 of file PackedCandidateTrackValidator.cc.

References dqm::implementation::IBooker::book1D(), h_diffCharge, h_diffCovDszDsz, h_diffCovDxyDsz, h_diffCovDxyDxy, h_diffCovLambdaDsz, h_diffCovLambdaLambda, h_diffCovPhiDxy, h_diffCovPhiPhi, h_diffCovQoverpQoverp, h_diffDszError, h_diffDxyAssocPV, h_diffDxyError, h_diffDxyPV, h_diffDzAssocPV, h_diffDzError, h_diffDzPV, h_diffEta, h_diffEtaError, h_diffHitPatternHasValidHitInFirstPixelBarrel, h_diffHitPatternNumberOfLostInnerHits, h_diffHitPatternNumberOfValidHits, h_diffHitPatternNumberOfValidPixelHits, h_diffHitPatternPixelLayersWithMeasurement, h_diffHitPatternStripLayersWithMeasurement, h_diffHitPatternTrackerLayersWithMeasurement, h_diffIsHighPurity, h_diffLostInnerHits, h_diffNdof, h_diffNormalizedChi2, h_diffNumberOfHits, h_diffNumberOfPixelHits, h_diffNumberOfPixelLayers, h_diffNumberOfStripLayers, h_diffPhi, h_diffPt, h_diffPtError, h_diffTrackDxyAssocPV, h_diffTrackDxyError, h_diffTrackDzAssocPV, h_diffTrackDzError, h_diffVx, h_diffVy, h_diffVz, h_numberHitsOverMax, h_numberLayersOverMax, h_numberPixelHitsOverMax, h_numberPixelLayersOverMax, h_numberStripHitsOverMax, h_numberStripLayersOverMax, h_selectionFlow, rootFolder_, dqm::impl::MonitorElement::setBinLabel(), and dqm::implementation::NavigatorBase::setCurrentFolder().

527  {
528  iBooker.setCurrentFolder(rootFolder_);
529 
530  h_selectionFlow = iBooker.book1D("selectionFlow", "Track selection flow", 8, -0.5, 7.5);
531  h_selectionFlow->setBinLabel(1, "All tracks");
532  h_selectionFlow->setBinLabel(2, "Associated to PackedCandidate");
533  h_selectionFlow->setBinLabel(3, "PC is charged"), h_selectionFlow->setBinLabel(4, "PC has track");
534  h_selectionFlow->setBinLabel(5, "PC is not electron");
535  h_selectionFlow->setBinLabel(6, "PC has hits");
536  h_selectionFlow->setBinLabel(7, "PC ndof != 0");
537  h_selectionFlow->setBinLabel(8, "Track: no missing inner hits");
538 
539  constexpr int diffBins = 50;
540 
541  h_diffVx =
542  iBooker.book1D("diffVx", "PackedCandidate::bestTrack() - reco::Track in vx()", diffBins, -0.2, 0.2); // not equal
543  h_diffVy =
544  iBooker.book1D("diffVy", "PackedCandidate::bestTrack() - reco::Track in vy()", diffBins, -0.2, 0.2); // not equal
545  h_diffVz =
546  iBooker.book1D("diffVz", "PackedCandidate::bestTrack() - reco::Track in vz()", diffBins, -0.4, 0.4); // not equal
547 
548  h_diffNormalizedChi2 = iBooker.book1D("diffNormalizedChi2",
549  "PackedCandidate::bestTrack() - reco::Track in normalizedChi2()",
550  30,
551  -1.5,
552  1.5); // expected difference in -1...0
553  h_diffNdof = iBooker.book1D(
554  "diffNdof", "PackedCandidate::bestTrack() - reco::Track in ndof()", 33, -30.5, 2.5); // to monitor the difference
555 
556  h_diffCharge = iBooker.book1D(
557  "diffCharge", "PackedCandidate::bestTrack() - reco::Track in charge()", 5, -2.5, 2.5); // expect equality
558  h_diffIsHighPurity = iBooker.book1D("diffIsHighPurity",
559  "PackedCandidate::bestTrack() - reco::Track in quality(highPurity)",
560  3,
561  -1.5,
562  1.5); // expect equality
563 
564  h_diffPt = iBooker.book1D("diffPt",
565  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in pt()",
566  diffBins,
567  -1.1,
568  1.1); // not equal, keep
569  h_diffEta = iBooker.book1D(
570  "diffEta", "PackedCandidate::bestTrack() - reco::Track in eta()", diffBins, -0.001, 0.001); // not equal, keep
571  h_diffPhi = iBooker.book1D("diffPhi",
572  "PackedCandidate::bestTrack() - reco::Track in phi()",
573  diffBins,
574  -0.0005,
575  0.0005); // expect equality within precision
576 
577  h_diffDxyAssocPV.book(iBooker,
578  "diffDxyAssocPV",
579  "(PackedCandidate::dxy() - reco::Track::dxy(assocPV))/reco::Track",
580  40,
581  -0.001,
582  0.001, // expect equality within precision
583  50,
584  -0.5,
585  0.5);
586  h_diffDzAssocPV.book(iBooker,
587  "diffDzAssocPV",
588  "(PackedCandidate::dzAssociatedPV() - reco::Track::dz(assocPV))/reco::Track",
589  40,
590  -0.001,
591  0.001, // expect equality within precision
592  50,
593  -0.5,
594  0.5);
595  h_diffDxyPV = iBooker.book1D("diffDxyPV",
596  "(PackedCandidate::dxy(PV) - reco::Track::dxy(PV))/reco::Track",
597  diffBins,
598  -0.01,
599  0.01); // expect equality within precision (worse than assocPV)
600  h_diffDzPV = iBooker.book1D("diffDzPV",
601  "(PackedCandidate::dz(PV) - reco::Track::dz(PV))/reco::Track",
602  diffBins,
603  -0.01,
604  0.01); // expect equality wihtin precision (worse than assocPV)
606  iBooker.book1D("diffTrackDxyAssocPV",
607  "(PackedCandidate::bestTrack()::dxy(assocPV)) - reco::Track::dxy(assocPV))/reco::Track",
608  diffBins,
609  -0.01,
610  0.01); // not equal
612  iBooker.book1D("diffTrackDzAssocPV",
613  "(PackedCandidate::bestTrack()::dz(assocPV)) - reco::Track::dz(assocPV))/reco::Track",
614  diffBins,
615  -0.01,
616  0.01); // not equal
617 
618  h_diffCovQoverpQoverp.book(iBooker,
619  "diffCovQoverpQoverp",
620  "(PackedCandidate::bestTrack() - reco::Track)/reco::track in cov(qoverp, qoverp)",
621  40,
622  -0.05,
623  0.15, // expect equality within precision (worst precision is exp(1/128*15) =~ 12 %
624  50,
625  -0.5,
626  0.5);
628  iBooker,
629  "diffCovLambdaLambda",
630  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(lambda, lambda)",
631  40,
632  -0.05,
633  0.15, // expect equality within precision worst precision is exp(1/128*(20-5)) =~ 12 % (multiplied by pt^2 in packing & unpacking)
634  50,
635  -0.5,
636  0.5);
637  h_diffCovLambdaDsz.book(iBooker,
638  "diffCovLambdaDsz",
639  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(lambda, dsz)",
640  60,
641  -0.15,
642  0.15, // expect equality within precision, worst precision is exp(1/128*(17-4) =~ 11 %
643  50,
644  -1,
645  1);
646  h_diffCovPhiPhi.book(
647  iBooker,
648  "diffCovPhiPhi",
649  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(phi, phi)",
650  40,
651  -0.05,
652  0.15, // expect equality within precision worst precision is exp(1/128*(20-5)) =~ 12 % (multiplied by pt^2 in packing & unpacking)
653  50,
654  -0.5,
655  0.5);
656  h_diffCovPhiDxy.book(iBooker,
657  "diffCovPhiDxy",
658  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(phi, dxy)",
659  60,
660  -0.15,
661  0.15, // expect equality within precision, wors precision is exp(1/128)*(17-4) =~ 11 %
662  50,
663  -1,
664  1);
665  h_diffCovDxyDxy.book(iBooker,
666  "diffCovDxyDxy",
667  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(dxy, dxy)",
668  40,
669  -0.001,
670  0.001,
671  50,
672  -0.1,
673  0.1);
674  h_diffCovDxyDsz.book(iBooker,
675  "diffCovDxyDsz",
676  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(dxy, dsz)",
677  40,
678  -0.001,
679  0.001, // expect equality within precision
680  50,
681  -0.5,
682  0.5);
683  h_diffCovDszDsz.book(iBooker,
684  "diffCovDszDsz",
685  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in cov(dsz, dsz)",
686  40,
687  -0.001,
688  0.001, // expect equality within precision
689  50,
690  -0.1,
691  0.1);
692 
693  h_diffDxyError = iBooker.book1D("diffDxyError",
694  "(PackedCandidate::dxyError() - reco::Track::dxyError())/reco::Track",
695  40,
696  -0.001,
697  0.001); // expect equality within precision
698  h_diffDszError = iBooker.book1D("diffDszError",
699  "(PackedCandidate::dzError() - reco::Track::dszError())/reco::Track",
700  40,
701  -0.001,
702  0.001); // ideally, not equal, but for now they are
703  h_diffDzError = iBooker.book1D("diffDzError",
704  "(PackedCandidate::dzError() - reco::Track::dzError())/reco::Track",
705  40,
706  -0.001,
707  0.001); // expect equality within precision (not currently the case)
708 
709  h_diffTrackDxyError = iBooker.book1D("diffTrackDxyError",
710  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in dxyError()",
711  40,
712  -0.001,
713  0.001); // expect equality within precision
714  h_diffTrackDzError = iBooker.book1D("diffTrackDzError",
715  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in dzError()",
716  40,
717  -0.05,
718  0.05); // not equal
719 
720  h_diffPtError = iBooker.book1D("diffPtError",
721  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in ptError()",
722  diffBins,
723  -1.1,
724  1.1); // not equal
725  h_diffEtaError = iBooker.book1D("diffEtaError",
726  "(PackedCandidate::bestTrack() - reco::Track)/reco::Track in etaError()",
727  60,
728  -0.15,
729  0.15); // not equal
730 
732  "diffNumberOfPixelLayers",
733  "PackedCandidate::pixelLayersWithMeasurement() - reco::Track::hitPattern::pixelLayersWithMeasurement()",
734  5,
735  -2.5,
736  2.5); // expect equality
738  "diffNumberOfStripLayers",
739  "PackedCandidate::stripLayersWithMeasurement() - reco::Track::hitPattern::stripLayersWithMeasurement()",
740  5,
741  -2.5,
742  2.5); // expect equality
744  iBooker.book1D("diffNumberOfPixelHits",
745  "PackedCandidate::numberOfPixelHits() - reco::Track::hitPattern::numberOfValidPixelHits()",
746  5,
747  -2.5,
748  2.5); // expect equality
749  h_diffNumberOfHits = iBooker.book1D("diffNumberOfHits",
750  "PackedCandidate::numberHits() - reco::Track::hitPattern::numberOfValidHits()",
751  5,
752  -2.5,
753  2.5); // expect equality
755  iBooker.book1D("diffLostInnerHits",
756  "PackedCandidate::lostInnerHits() - reco::Track::hitPattern::numberOfLostHits(MISSING_INNER_HITS)",
757  5,
758  -2.5,
759  2.5); // expect equality
760 
762  iBooker.book1D("diffHitPatternPixelLayersWithMeasurement",
763  "PackedCandidate::bestTrack() - reco::Track in hitPattern::pixelLayersWithMeasurement()",
764  13,
765  -10.5,
766  2.5); // not equal
768  iBooker.book1D("diffHitPatternStripLayersWithMeasurement",
769  "PackedCandidate::bestTrack() - reco::Track in hitPattern::stripLayersWithMeasurement()",
770  13,
771  -10.5,
772  2.5); // not equal
774  iBooker.book1D("diffHitPatternTrackerLayersWithMeasurement",
775  "PackedCandidate::bestTrack() - reco::Track in hitPattern::trackerLayersWithMeasurement()",
776  13,
777  -10.5,
778  2.5); // not equal
780  iBooker.book1D("diffHitPatternNumberOfValidPixelHits",
781  "PackedCandidate::bestTrack() - reco::Track in hitPattern::numberOfValidPixelHits()",
782  13,
783  -10.5,
784  2.5); // not equal
786  iBooker.book1D("diffHitPatternNumberOfValidHits",
787  "PackedCandidate::bestTrack() - reco::Track in hitPattern::numberOfValidHits()",
788  13,
789  -10.5,
790  2.5); // not equal
792  iBooker.book1D("diffHitPatternNumberOfLostPixelHits",
793  "PackedCandidate::bestTrack() - reco::Track in hitPattern::numberOfLostHits(MISSING_INNER_HITS)",
794  13,
795  -10.5,
796  2.5); // not equal
798  iBooker.book1D("diffHitPatternHasValidHitInFirstPixelBarrel",
799  "PackedCandidate::bestTrack() - reco::Track in hitPattern::hasValidHitInFirstPixelBarrel",
800  3,
801  -1.5,
802  1.5); // expect equality
803 
805  "numberPixelLayersOverMax", "Number of pixel layers over the maximum of PackedCandidate", 10, 0, 10);
807  "numberStripLayersOverMax", "Number of strip layers over the maximum of PackedCandidate", 10, 0, 10);
809  iBooker.book1D("numberLayersOverMax", "Number of layers over the maximum of PackedCandidate", 20, 0, 20);
811  iBooker.book1D("numberPixelHitsOverMax", "Number of pixel hits over the maximum of PackedCandidate", 10, 0, 10);
813  iBooker.book1D("numberStripHitsOverMax", "Number of strip hits over the maximum of PackedCandidate", 10, 0, 10);
815  iBooker.book1D("numberHitsOverMax", "Number of hits over the maximum of PackedCandidate", 20, 0, 20);
816 }
PackedValueCheck< LogIntHelper > h_diffCovLambdaDsz
PackedValueCheck< Float16Helper > h_diffDzAssocPV
PackedValueCheck< Float16Helper > h_diffDxyAssocPV
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
PackedValueCheck< LogIntHelper > h_diffCovLambdaLambda
PackedValueCheck< LogIntHelper > h_diffCovPhiDxy
PackedValueCheck< Float16Helper > h_diffCovDxyDxy
PackedValueCheck< LogIntHelper > h_diffCovPhiPhi
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
PackedValueCheck< LogIntHelper > h_diffCovQoverpQoverp
PackedValueCheck< Float16Helper > h_diffCovDxyDsz
PackedValueCheck< Float16Helper > h_diffCovDszDsz
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ fillDescriptions()

void PackedCandidateTrackValidator::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 513 of file PackedCandidateTrackValidator.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_2022v12_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

513  {
515 
516  desc.addUntracked<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
517  desc.addUntracked<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
518  desc.addUntracked<edm::InputTag>("trackToPackedCandidateAssociation", edm::InputTag("packedPFCandidates"));
519  desc.addUntracked<std::string>("rootFolder", "Tracking/PackedCandidate");
520  desc.addUntracked<bool>("debug", false);
521 
522  descriptions.add("packedCandidateTrackValidator", desc);
523 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ debug_

bool PackedCandidateTrackValidator::debug_
private

Definition at line 416 of file PackedCandidateTrackValidator.cc.

Referenced by analyze().

◆ h_diffCharge

MonitorElement* PackedCandidateTrackValidator::h_diffCharge
private

Definition at line 437 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffCovDszDsz

PackedValueCheck<Float16Helper> PackedCandidateTrackValidator::h_diffCovDszDsz
private

Definition at line 458 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffCovDxyDsz

PackedValueCheck<Float16Helper> PackedCandidateTrackValidator::h_diffCovDxyDsz
private

Definition at line 457 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffCovDxyDxy

PackedValueCheck<Float16Helper> PackedCandidateTrackValidator::h_diffCovDxyDxy
private

Definition at line 456 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffCovLambdaDsz

PackedValueCheck<LogIntHelper> PackedCandidateTrackValidator::h_diffCovLambdaDsz
private

Definition at line 453 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffCovLambdaLambda

PackedValueCheck<LogIntHelper> PackedCandidateTrackValidator::h_diffCovLambdaLambda
private

Definition at line 452 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffCovPhiDxy

PackedValueCheck<LogIntHelper> PackedCandidateTrackValidator::h_diffCovPhiDxy
private

Definition at line 455 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffCovPhiPhi

PackedValueCheck<LogIntHelper> PackedCandidateTrackValidator::h_diffCovPhiPhi
private

Definition at line 454 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffCovQoverpQoverp

PackedValueCheck<LogIntHelper> PackedCandidateTrackValidator::h_diffCovQoverpQoverp
private

Definition at line 451 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffDszError

MonitorElement* PackedCandidateTrackValidator::h_diffDszError
private

Definition at line 461 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffDxyAssocPV

PackedValueCheck<Float16Helper> PackedCandidateTrackValidator::h_diffDxyAssocPV
private

Definition at line 443 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffDxyError

MonitorElement* PackedCandidateTrackValidator::h_diffDxyError
private

Definition at line 460 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffDxyPV

MonitorElement* PackedCandidateTrackValidator::h_diffDxyPV
private

Definition at line 445 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffDzAssocPV

PackedValueCheck<Float16Helper> PackedCandidateTrackValidator::h_diffDzAssocPV
private

Definition at line 444 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffDzError

MonitorElement* PackedCandidateTrackValidator::h_diffDzError
private

Definition at line 462 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffDzPV

MonitorElement* PackedCandidateTrackValidator::h_diffDzPV
private

Definition at line 446 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffEta

MonitorElement* PackedCandidateTrackValidator::h_diffEta
private

Definition at line 441 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffEtaError

MonitorElement* PackedCandidateTrackValidator::h_diffEtaError
private

Definition at line 468 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffHitPatternHasValidHitInFirstPixelBarrel

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternHasValidHitInFirstPixelBarrel
private

Definition at line 482 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffHitPatternNumberOfLostInnerHits

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternNumberOfLostInnerHits
private

Definition at line 481 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffHitPatternNumberOfValidHits

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternNumberOfValidHits
private

Definition at line 480 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffHitPatternNumberOfValidPixelHits

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternNumberOfValidPixelHits
private

Definition at line 479 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffHitPatternPixelLayersWithMeasurement

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternPixelLayersWithMeasurement
private

Definition at line 476 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffHitPatternStripLayersWithMeasurement

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternStripLayersWithMeasurement
private

Definition at line 478 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffHitPatternTrackerLayersWithMeasurement

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternTrackerLayersWithMeasurement
private

Definition at line 477 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffIsHighPurity

MonitorElement* PackedCandidateTrackValidator::h_diffIsHighPurity
private

Definition at line 438 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffLostInnerHits

MonitorElement* PackedCandidateTrackValidator::h_diffLostInnerHits
private

Definition at line 474 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffNdof

MonitorElement* PackedCandidateTrackValidator::h_diffNdof
private

Definition at line 435 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffNormalizedChi2

MonitorElement* PackedCandidateTrackValidator::h_diffNormalizedChi2
private

Definition at line 434 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffNumberOfHits

MonitorElement* PackedCandidateTrackValidator::h_diffNumberOfHits
private

Definition at line 473 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffNumberOfPixelHits

MonitorElement* PackedCandidateTrackValidator::h_diffNumberOfPixelHits
private

Definition at line 472 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffNumberOfPixelLayers

MonitorElement* PackedCandidateTrackValidator::h_diffNumberOfPixelLayers
private

Definition at line 470 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffNumberOfStripLayers

MonitorElement* PackedCandidateTrackValidator::h_diffNumberOfStripLayers
private

Definition at line 471 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffPhi

MonitorElement* PackedCandidateTrackValidator::h_diffPhi
private

Definition at line 442 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffPt

MonitorElement* PackedCandidateTrackValidator::h_diffPt
private

Definition at line 440 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffPtError

MonitorElement* PackedCandidateTrackValidator::h_diffPtError
private

Definition at line 467 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffTrackDxyAssocPV

MonitorElement* PackedCandidateTrackValidator::h_diffTrackDxyAssocPV
private

Definition at line 448 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffTrackDxyError

MonitorElement* PackedCandidateTrackValidator::h_diffTrackDxyError
private

Definition at line 464 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffTrackDzAssocPV

MonitorElement* PackedCandidateTrackValidator::h_diffTrackDzAssocPV
private

Definition at line 449 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffTrackDzError

MonitorElement* PackedCandidateTrackValidator::h_diffTrackDzError
private

Definition at line 465 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffVx

MonitorElement* PackedCandidateTrackValidator::h_diffVx
private

Definition at line 430 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffVy

MonitorElement* PackedCandidateTrackValidator::h_diffVy
private

Definition at line 431 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_diffVz

MonitorElement* PackedCandidateTrackValidator::h_diffVz
private

Definition at line 432 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_numberHitsOverMax

MonitorElement* PackedCandidateTrackValidator::h_numberHitsOverMax
private

Definition at line 489 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_numberLayersOverMax

MonitorElement* PackedCandidateTrackValidator::h_numberLayersOverMax
private

Definition at line 486 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_numberPixelHitsOverMax

MonitorElement* PackedCandidateTrackValidator::h_numberPixelHitsOverMax
private

Definition at line 487 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_numberPixelLayersOverMax

MonitorElement* PackedCandidateTrackValidator::h_numberPixelLayersOverMax
private

Definition at line 484 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_numberStripHitsOverMax

MonitorElement* PackedCandidateTrackValidator::h_numberStripHitsOverMax
private

Definition at line 488 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_numberStripLayersOverMax

MonitorElement* PackedCandidateTrackValidator::h_numberStripLayersOverMax
private

Definition at line 485 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ h_selectionFlow

MonitorElement* PackedCandidateTrackValidator::h_selectionFlow
private

Definition at line 428 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

◆ rootFolder_

std::string PackedCandidateTrackValidator::rootFolder_
private

Definition at line 415 of file PackedCandidateTrackValidator.cc.

Referenced by bookHistograms().

◆ tracksToken_

edm::EDGetTokenT<edm::View<reco::Track> > PackedCandidateTrackValidator::tracksToken_
private

Definition at line 411 of file PackedCandidateTrackValidator.cc.

Referenced by analyze().

◆ trackToPackedCandidateToken_

edm::EDGetTokenT<edm::Association<pat::PackedCandidateCollection> > PackedCandidateTrackValidator::trackToPackedCandidateToken_
private

Definition at line 413 of file PackedCandidateTrackValidator.cc.

Referenced by analyze().

◆ verticesToken_

edm::EDGetTokenT<reco::VertexCollection> PackedCandidateTrackValidator::verticesToken_
private

Definition at line 412 of file PackedCandidateTrackValidator.cc.

Referenced by analyze().