658 const auto&
tracks = *htracks;
670 const auto& trackToPackedCandidate = *hassoc;
673 auto trackPtr =
tracks.ptrAt(
i);
684 if(pcRef->charge() == 0) {
689 const reco::Track *trackPcPtr = pcRef->bestTrack();
696 if(
std::abs(pcRef->pdgId()) == 11) {
708 auto slimmedVertexRef = pcRef->vertexRef();
720 double diffNormalizedChi2 = 0;
721 if(trackPc.
ndof() != 0) {
733 const auto diffPt = diffRelative(trackPc.
pt(), track.
pt());
740 const auto diffDzAssocPV =
h_diffDzAssocPV.fill( pcRef->dzAssociatedPV(), track.
dz(pcVertex.
position()) , [](
double value){
return value*100.;});
742 const auto diffDzPV = diffRelative(pcRef->dz(pv.
position()) , track.
dz(pv.
position()));
748 auto fillCov1 = [&](
auto& hlp,
const int i,
const int j) {
751 auto fillCov2 = [&](
auto& hlp,
const int i,
const int j, std::function<double(double)> modifyPack) {
754 auto fillCov3 = [&](
auto& hlp,
const int i,
const int j, std::function<double(double)> modifyPack, std::function<double(double)> modifyUnpack) {
758 const auto pcPt = pcRef->pt();
768 if(isInRange(diffCovDszDsz.status())) {
773 if(isInRange(diffCovDxyDxy.status())) {
786 const auto pcNumberOfHits = pcRef->numberOfHits();
787 const auto pcNumberOfPixelHits = pcRef->numberOfPixelHits();
788 const auto pcNumberOfStripHits = pcNumberOfHits - pcNumberOfPixelHits;
792 const auto pcNumberOfLayers = pcRef->trackerLayersWithMeasurement();
793 const auto pcNumberOfPixelLayers = pcRef->pixelLayersWithMeasurement();
794 const auto pcNumberOfStripLayers = pcRef->stripLayersWithMeasurement();
814 int diffNumberOfPixelHits = 0;
815 int diffNumberOfHits = 0;
816 int diffNumberOfPixelLayers = 0;
817 int diffNumberOfStripLayers = 0;
818 if(pixelLayerOverflow) {
822 diffNumberOfPixelLayers = pcNumberOfPixelLayers - trackNumberOfPixelLayers;
828 diffNumberOfPixelHits = pcNumberOfPixelHits - trackNumberOfPixelHits;
830 if(stripLayerOverflow) {
834 diffNumberOfStripLayers = pcNumberOfStripLayers - trackNumberOfStripLayers;
836 if(stripOverflow || pixelInducedStripOverflow || pixelOverflow) {
837 int diffNumberOfStripHits = 0;
838 if(stripOverflow || pixelInducedStripOverflow) {
841 else if(pixelOverflow) {
842 diffNumberOfStripHits = (pcNumberOfStripHits - pixelOverflow) - trackNumberOfStripHits;
845 diffNumberOfHits = diffNumberOfPixelHits + diffNumberOfStripHits;
848 diffNumberOfHits = pcNumberOfHits - trackNumberOfHits;
858 int diffLostInnerHits = 0;
860 switch(pcRef->lostInnerHits()) {
863 diffLostInnerHits = -trackLostInnerHits;
866 diffLostInnerHits = 1-trackLostInnerHits;
869 diffLostInnerHits = trackLostInnerHits>=2 ? 0 : 2-trackLostInnerHits;
888 int diffHitPatternHasValidHitInFirstPixelBarrel = 0;
896 if(diffNormalizedChi2 < -1 || diffNormalizedChi2 > 0 || diffCharge != 0 || diffHP != 0
898 || diffDxyAssocPV.outsideExpectedRange()
899 || diffDzAssocPV.outsideExpectedRange()
901 || diffCovQoverpQoverp.outsideExpectedRange() || diffCovLambdaLambda.outsideExpectedRange()
902 || diffCovLambdaDsz.outsideExpectedRange() || diffCovPhiPhi.outsideExpectedRange()
903 || diffCovPhiDxy.outsideExpectedRange() || diffCovDxyDxy.outsideExpectedRange()
904 || diffCovDxyDsz.outsideExpectedRange() || diffCovDszDsz.outsideExpectedRange()
905 || diffNumberOfPixelHits != 0 || diffNumberOfHits != 0 || diffLostInnerHits != 0
906 || diffHitPatternHasValidHitInFirstPixelBarrel != 0
909 edm::LogInfo(
"PackedCandidateTrackValidator") <<
"Track " << i <<
" pt " << track.
pt() <<
" eta " << track.
eta() <<
" phi " << track.
phi() <<
" chi2 " << track.
chi2() <<
" ndof " << track.
ndof()
915 <<
" dxy " << track.
dxy() <<
" dz " << track.
dz()
917 <<
" " << TrackAlgoPrinter(track)
918 <<
" lost inner hits " << trackLostInnerHits
920 <<
" hitpattern " << HitPatternPrinter(track)
922 <<
" PC " << pcRef.
id() <<
":" << pcRef.
key() <<
" track pt " << trackPc.
pt() <<
" eta " << trackPc.
eta() <<
" phi " << trackPc.
phi() <<
" (PC " << pcRef->phi() <<
") chi2 " << trackPc.
chi2() <<
" ndof " << trackPc.
ndof() <<
" pdgId " << pcRef->pdgId() <<
" mass " << pcRef->mass()
924 <<
" ptError " << trackPc.
ptError() <<
" etaError " << trackPc.
etaError() <<
" phiError " << trackPc.
phiError()
926 <<
" pc.vertex " << pcRef->vertex() <<
" momentum " << pcRef->momentum() <<
" track " << trackPc.
momentum()
928 <<
" dxy " << trackPc.
dxy() <<
" dz " << trackPc.
dz() <<
" pc.dz " << pcRef->dz()
929 <<
" dxyError " << trackPc.
dxyError() <<
" dzError " << trackPc.
dzError()
932 <<
" dxy(assocPV) " << trackPc.
dxy(pcVertex.
position()) <<
" dz(assocPV) " << trackPc.
dz(pcVertex.
position())
934 <<
" (diff PackedCandidate track)" 936 <<
" charge " << diffCharge <<
" " << trackPc.
charge() <<
" " << track.
charge()
939 <<
" numberOfAllHits " << diffNumberOfHits <<
" " << pcNumberOfHits <<
" " << trackNumberOfHits
940 <<
" numberOfPixelHits " << diffNumberOfPixelHits <<
" " << pcNumberOfPixelHits <<
" " << trackNumberOfPixelHits
941 <<
" numberOfStripHits # " << pcNumberOfStripHits <<
" " << trackNumberOfStripHits
947 <<
" lostInnerHits " << diffLostInnerHits <<
" " << pcRef->lostInnerHits() <<
" #" 948 <<
" phi (5e-4) " << diffPhi <<
" " << trackPc.
phi() <<
" " << track.
phi()
950 <<
" dxy(assocPV) " << diffDxyAssocPV
952 <<
" dz(assocPV) " << diffDzAssocPV
954 <<
" dxy(PV) (0.05) " << diffDxyPV <<
" " << pcRef->dxy(pv.
position()) <<
" " << track.
dxy(pv.
position())
956 <<
" dz(PV) (0.05) " << diffDzPV <<
" " << pcRef->dz(pv.
position()) <<
" " << track.
dz(pv.
position())
958 <<
" cov(qoverp, qoverp) " << diffCovQoverpQoverp
960 <<
" cov(lambda, lambda) " << diffCovLambdaLambda
962 <<
" cov(lambda, dsz) " << diffCovLambdaDsz
964 <<
" cov(phi, phi) " << diffCovPhiPhi
966 <<
" cov(phi, dxy) " << diffCovPhiDxy
968 <<
" cov(dxy, dxy) " << diffCovDxyDxy
970 <<
" cov(dxy, dsz) " << diffCovDxyDsz
972 <<
" cov(dsz, dsz) " << diffCovDszDsz;
const Point & referencePoint() const
Reference point on the track.
PackedValueCheck< LogIntHelper > h_diffCovLambdaDsz
PackedValueCheck< Float16Helper > h_diffDzAssocPV
PackedValueCheck< Float16Helper > h_diffDxyAssocPV
bool hasValidHitInPixelLayer(enum PixelSubdetector::SubDetector, uint16_t layer) const
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * h_diffNormalizedChi2
double dxyError() const
error on dxy
MonitorElement * h_diffVy
int numberOfValidHits() const
MonitorElement * h_selectionFlow
MonitorElement * h_diffVz
MonitorElement * h_diffCharge
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > trackToPackedCandidateToken_
double etaError() const
error on eta
int numberOfValidStripHits() const
double phi() const
azimuthal angle of momentum vector
MonitorElement * h_numberHitsOverMax
MonitorElement * h_numberPixelHitsOverMax
key_type key() const
Accessor for product key.
MonitorElement * h_diffNumberOfPixelHits
int pixelLayersWithMeasurement() const
const Vector & momentum() const
track momentum vector
int trackerLayersWithMeasurement() const
const Point & position() const
position
MonitorElement * h_diffTrackDxyAssocPV
ProductID id() const
Accessor for product ID.
MonitorElement * h_diffDzError
PackedValueCheck< LogIntHelper > h_diffCovLambdaLambda
MonitorElement * h_numberStripHitsOverMax
MonitorElement * h_diffLostInnerHits
MonitorElement * h_numberLayersOverMax
double dszError() const
error on dsz
double eta() const
pseudorapidity of momentum vector
MonitorElement * h_diffPhi
PackedValueCheck< LogIntHelper > h_diffCovPhiDxy
double chi2() const
chi-squared of the fit
PackedValueCheck< Float16Helper > h_diffCovDxyDxy
MonitorElement * h_diffTrackDzError
PackedValueCheck< LogIntHelper > h_diffCovPhiPhi
double ndof() const
number of degrees of freedom of the fit
MonitorElement * h_diffDzPV
CovarianceMatrix covariance() const
return track covariance matrix
double pt() const
track transverse momentum
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
double phiError() const
error on phi
MonitorElement * h_diffHitPatternHasValidHitInFirstPixelBarrel
Abs< T >::type abs(const T &t)
MonitorElement * h_diffHitPatternTrackerLayersWithMeasurement
MonitorElement * h_diffIsHighPurity
bool isNull() const
Checks for null.
MonitorElement * h_diffDszError
MonitorElement * h_diffHitPatternPixelLayersWithMeasurement
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...
double dzError() const
error on dz
double deltaPhi(double phi1, double phi2)
double vz() const
z coordinate of the reference point on track
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
MonitorElement * h_diffDxyPV
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
int stripLayersWithMeasurement() const
MonitorElement * h_diffTrackDzAssocPV
MonitorElement * h_diffHitPatternNumberOfLostInnerHits
MonitorElement * h_diffHitPatternNumberOfValidPixelHits
bool quality(const TrackQuality) const
Track quality.
MonitorElement * h_diffNdof
int numberOfLostHits(HitCategory category) const
MonitorElement * h_diffVx
double vy() const
y coordinate of the reference point on track
MonitorElement * h_diffHitPatternNumberOfValidHits
PackedValueCheck< LogIntHelper > h_diffCovQoverpQoverp
PackedValueCheck< Float16Helper > h_diffCovDxyDsz
MonitorElement * h_numberStripLayersOverMax
MonitorElement * h_diffDxyError
MonitorElement * h_diffPt
int numberOfValidPixelHits() const
PackedValueCheck< Float16Helper > h_diffCovDszDsz
int charge() const
track electric charge
MonitorElement * h_numberPixelLayersOverMax
MonitorElement * h_diffNumberOfStripLayers
MonitorElement * h_diffPtError
MonitorElement * h_diffEta
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
MonitorElement * h_diffTrackDxyError
MonitorElement * h_diffNumberOfHits
MonitorElement * h_diffEtaError
MonitorElement * h_diffNumberOfPixelLayers
double vx() const
x coordinate of the reference point on track
MonitorElement * h_diffHitPatternStripLayersWithMeasurement