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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 401 of file PackedCandidateTrackValidator.cc.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

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

Definition at line 493 of file PackedCandidateTrackValidator.cc.

494  : tracksToken_(consumes<edm::View<reco::Track>>(iConfig.getUntrackedParameter<edm::InputTag>("tracks"))),
495  verticesToken_(consumes<reco::VertexCollection>(iConfig.getUntrackedParameter<edm::InputTag>("vertices"))),
497  iConfig.getUntrackedParameter<edm::InputTag>("trackToPackedCandidateAssociation"))),
498  rootFolder_(iConfig.getUntrackedParameter<std::string>("rootFolder")),
499  debug_(iConfig.getUntrackedParameter<bool>("debug")),
500  h_diffDxyAssocPV(RangeAbs(0.001)),
501  h_diffDzAssocPV(RangeAbs(0.001)),
502  h_diffCovQoverpQoverp(Range(-1e-6, 0.13), -15, 0), // despite of ceil in pack, there is rounding in double->float
504  Range(-1e-6, 0.13), -20, -5), // despite of ceil in pack, there is rounding in double->float
505  h_diffCovLambdaDsz(RangeAbs(0.13), -17, -4),
506  h_diffCovPhiPhi(RangeAbs(0.13), -15, 0),
507  h_diffCovPhiDxy(RangeAbs(0.13), -17, -4),
508  h_diffCovDxyDxy(RangeAbs(0.001)),
509  h_diffCovDxyDsz(RangeAbs(0.001)),
510  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_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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 ( )
override

Definition at line 512 of file PackedCandidateTrackValidator.cc.

512 {}

Member Function Documentation

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

Definition at line 819 of file PackedCandidateTrackValidator.cc.

References funct::abs(), reco::TrackBase::charge(), reco::TrackBase::chi2(), reco::TrackBase::covariance(), debug_, DEFINE_FWK_MODULE, reco::deltaPhi(), reco::TrackBase::dszError(), 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(), edm::Event::getByToken(), 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(), 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(), reco::HitPattern::numberOfValidStripHits(), 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(), reco::TrackBase::referencePoint(), sf_AllTracks, sf_AssociatedToPC, sf_NoMissingInnerHits, sf_PCHasHits, sf_PCHasTrack, sf_PCIsCharged, sf_PCIsNotElectron, sf_PCNdofNot0, reco::HitPattern::stripLayersWithMeasurement(), HLT_2018_cff::track, reco::HitPattern::trackerLayersWithMeasurement(), pat::PackedCandidate::trackPixelHitsMask, PDWG_EXOHSCP_cff::tracks, tracksToken_, pat::PackedCandidate::trackStripHitsMask, trackToPackedCandidateToken_, heppy_batch::val, pat::PackedCandidate::validHitInFirstPixelBarrelLayer, pwdgSkimBPark_cfi::vertices, verticesToken_, reco::TrackBase::vx(), reco::TrackBase::vy(), and reco::TrackBase::vz().

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

Implements DQMEDAnalyzer.

Definition at line 526 of file PackedCandidateTrackValidator.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), constexpr, 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::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder().

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

Definition at line 514 of file PackedCandidateTrackValidator.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

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

Member Data Documentation

bool PackedCandidateTrackValidator::debug_
private

Definition at line 417 of file PackedCandidateTrackValidator.cc.

Referenced by analyze().

MonitorElement* PackedCandidateTrackValidator::h_diffCharge
private

Definition at line 438 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

PackedValueCheck<Float16Helper> PackedCandidateTrackValidator::h_diffCovDszDsz
private

Definition at line 459 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

PackedValueCheck<Float16Helper> PackedCandidateTrackValidator::h_diffCovDxyDsz
private

Definition at line 458 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

PackedValueCheck<Float16Helper> PackedCandidateTrackValidator::h_diffCovDxyDxy
private

Definition at line 457 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

PackedValueCheck<LogIntHelper> PackedCandidateTrackValidator::h_diffCovLambdaDsz
private

Definition at line 454 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

PackedValueCheck<LogIntHelper> PackedCandidateTrackValidator::h_diffCovLambdaLambda
private

Definition at line 453 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

PackedValueCheck<LogIntHelper> PackedCandidateTrackValidator::h_diffCovPhiDxy
private

Definition at line 456 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

PackedValueCheck<LogIntHelper> PackedCandidateTrackValidator::h_diffCovPhiPhi
private

Definition at line 455 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

PackedValueCheck<LogIntHelper> PackedCandidateTrackValidator::h_diffCovQoverpQoverp
private

Definition at line 452 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffDszError
private

Definition at line 462 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

PackedValueCheck<Float16Helper> PackedCandidateTrackValidator::h_diffDxyAssocPV
private

Definition at line 444 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffDxyError
private

Definition at line 461 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffDxyPV
private

Definition at line 446 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

PackedValueCheck<Float16Helper> PackedCandidateTrackValidator::h_diffDzAssocPV
private

Definition at line 445 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffDzError
private

Definition at line 463 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffDzPV
private

Definition at line 447 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffEta
private

Definition at line 442 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffEtaError
private

Definition at line 469 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternHasValidHitInFirstPixelBarrel
private

Definition at line 483 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternNumberOfLostInnerHits
private

Definition at line 482 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternNumberOfValidHits
private

Definition at line 481 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternNumberOfValidPixelHits
private

Definition at line 480 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternPixelLayersWithMeasurement
private

Definition at line 477 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternStripLayersWithMeasurement
private

Definition at line 479 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffHitPatternTrackerLayersWithMeasurement
private

Definition at line 478 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffIsHighPurity
private

Definition at line 439 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffLostInnerHits
private

Definition at line 475 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffNdof
private

Definition at line 436 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffNormalizedChi2
private

Definition at line 435 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffNumberOfHits
private

Definition at line 474 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffNumberOfPixelHits
private

Definition at line 473 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffNumberOfPixelLayers
private

Definition at line 471 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffNumberOfStripLayers
private

Definition at line 472 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffPhi
private

Definition at line 443 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffPt
private

Definition at line 441 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffPtError
private

Definition at line 468 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffTrackDxyAssocPV
private

Definition at line 449 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffTrackDxyError
private

Definition at line 465 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffTrackDzAssocPV
private

Definition at line 450 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffTrackDzError
private

Definition at line 466 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffVx
private

Definition at line 431 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffVy
private

Definition at line 432 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_diffVz
private

Definition at line 433 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_numberHitsOverMax
private

Definition at line 490 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_numberLayersOverMax
private

Definition at line 487 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_numberPixelHitsOverMax
private

Definition at line 488 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_numberPixelLayersOverMax
private

Definition at line 485 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_numberStripHitsOverMax
private

Definition at line 489 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_numberStripLayersOverMax
private

Definition at line 486 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* PackedCandidateTrackValidator::h_selectionFlow
private

Definition at line 429 of file PackedCandidateTrackValidator.cc.

Referenced by analyze(), and bookHistograms().

std::string PackedCandidateTrackValidator::rootFolder_
private

Definition at line 416 of file PackedCandidateTrackValidator.cc.

Referenced by bookHistograms().

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

Definition at line 412 of file PackedCandidateTrackValidator.cc.

Referenced by analyze().

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

Definition at line 414 of file PackedCandidateTrackValidator.cc.

Referenced by analyze().

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

Definition at line 413 of file PackedCandidateTrackValidator.cc.

Referenced by analyze().