654 const auto&
tracks = *htracks;
666 const auto& trackToPackedCandidate = *hassoc;
669 auto trackPtr =
tracks.ptrAt(
i);
680 if(pcRef->charge() == 0) {
685 const reco::Track *trackPcPtr = pcRef->bestTrack();
692 if(
std::abs(pcRef->pdgId()) == 11) {
704 auto slimmedVertexRef = pcRef->vertexRef();
716 double diffNormalizedChi2 = 0;
717 if(trackPc.
ndof() != 0) {
729 const auto diffPt = diffRelative(trackPc.
pt(), track.
pt());
736 const auto diffDzAssocPV =
h_diffDzAssocPV.fill( pcRef->dzAssociatedPV(), track.
dz(pcVertex.
position()) , [](
double value){
return value*100.;});
738 const auto diffDzPV = diffRelative(pcRef->dz(pv.
position()) , track.
dz(pv.
position()));
744 auto fillCov1 = [&](
auto& hlp,
const int i,
const int j) {
747 auto fillCov2 = [&](
auto& hlp,
const int i,
const int j, std::function<double(double)> modifyPack) {
750 auto fillCov3 = [&](
auto& hlp,
const int i,
const int j, std::function<double(double)> modifyPack, std::function<double(double)> modifyUnpack) {
754 const auto pcPt = pcRef->pt();
764 if(isInRange(diffCovDszDsz.status())) {
769 if(isInRange(diffCovDxyDxy.status())) {
782 const auto pcNumberOfHits = pcRef->numberOfHits();
783 const auto pcNumberOfPixelHits = pcRef->numberOfPixelHits();
784 const auto pcNumberOfStripHits = pcNumberOfHits - pcNumberOfPixelHits;
788 const auto pcNumberOfLayers = pcRef->trackerLayersWithMeasurement();
789 const auto pcNumberOfPixelLayers = pcRef->pixelLayersWithMeasurement();
790 const auto pcNumberOfStripLayers = pcRef->stripLayersWithMeasurement();
810 int diffNumberOfPixelHits = 0;
811 int diffNumberOfHits = 0;
812 int diffNumberOfPixelLayers = 0;
813 int diffNumberOfStripLayers = 0;
814 if(pixelLayerOverflow) {
818 diffNumberOfPixelLayers = pcNumberOfPixelLayers - trackNumberOfPixelLayers;
824 diffNumberOfPixelHits = pcNumberOfPixelHits - trackNumberOfPixelHits;
826 if(stripLayerOverflow) {
830 diffNumberOfStripLayers = pcNumberOfStripLayers - trackNumberOfStripLayers;
832 if(stripOverflow || pixelInducedStripOverflow || pixelOverflow) {
833 int diffNumberOfStripHits = 0;
834 if(stripOverflow || pixelInducedStripOverflow) {
837 else if(pixelOverflow) {
838 diffNumberOfStripHits = (pcNumberOfStripHits - pixelOverflow) - trackNumberOfStripHits;
841 diffNumberOfHits = diffNumberOfPixelHits + diffNumberOfStripHits;
844 diffNumberOfHits = pcNumberOfHits - trackNumberOfHits;
854 int diffLostInnerHits = 0;
856 switch(pcRef->lostInnerHits()) {
859 diffLostInnerHits = -trackLostInnerHits;
862 diffLostInnerHits = 1-trackLostInnerHits;
865 diffLostInnerHits = trackLostInnerHits>=2 ? 0 : 2-trackLostInnerHits;
884 int diffHitPatternHasValidHitInFirstPixelBarrel = 0;
892 if(diffNormalizedChi2 < -1 || diffNormalizedChi2 > 0 || diffCharge != 0 || diffHP != 0
894 || diffDxyAssocPV.outsideExpectedRange()
895 || diffDzAssocPV.outsideExpectedRange()
897 || diffCovQoverpQoverp.outsideExpectedRange() || diffCovLambdaLambda.outsideExpectedRange()
898 || diffCovLambdaDsz.outsideExpectedRange() || diffCovPhiPhi.outsideExpectedRange()
899 || diffCovPhiDxy.outsideExpectedRange() || diffCovDxyDxy.outsideExpectedRange()
900 || diffCovDxyDsz.outsideExpectedRange() || diffCovDszDsz.outsideExpectedRange()
901 || diffNumberOfPixelHits != 0 || diffNumberOfHits != 0 || diffLostInnerHits != 0
902 || diffHitPatternHasValidHitInFirstPixelBarrel != 0
905 edm::LogInfo(
"PackedCandidateTrackValidator") <<
"Track " << i <<
" pt " << track.
pt() <<
" eta " << track.
eta() <<
" phi " << track.
phi() <<
" chi2 " << track.
chi2() <<
" ndof " << track.
ndof()
911 <<
" dxy " << track.
dxy() <<
" dz " << track.
dz()
913 <<
" " << TrackAlgoPrinter(track)
914 <<
" lost inner hits " << trackLostInnerHits
916 <<
" hitpattern " << HitPatternPrinter(track)
918 <<
" 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()
920 <<
" ptError " << trackPc.
ptError() <<
" etaError " << trackPc.
etaError() <<
" phiError " << trackPc.
phiError()
922 <<
" pc.vertex " << pcRef->vertex() <<
" momentum " << pcRef->momentum() <<
" track " << trackPc.
momentum()
924 <<
" dxy " << trackPc.
dxy() <<
" dz " << trackPc.
dz() <<
" pc.dz " << pcRef->dz()
925 <<
" dxyError " << trackPc.
dxyError() <<
" dzError " << trackPc.
dzError()
928 <<
" dxy(assocPV) " << trackPc.
dxy(pcVertex.
position()) <<
" dz(assocPV) " << trackPc.
dz(pcVertex.
position())
930 <<
" (diff PackedCandidate track)" 932 <<
" charge " << diffCharge <<
" " << trackPc.
charge() <<
" " << track.
charge()
935 <<
" numberOfHits " << diffNumberOfHits <<
" " << pcNumberOfHits <<
" " << trackNumberOfHits
936 <<
" numberOfPixelHits " << diffNumberOfPixelHits <<
" " << pcNumberOfPixelHits <<
" " << trackNumberOfPixelHits
937 <<
" numberOfStripHits # " << pcNumberOfStripHits <<
" " << trackNumberOfStripHits
943 <<
" lostInnerHits " << diffLostInnerHits <<
" " << pcRef->lostInnerHits() <<
" #" 944 <<
" phi (5e-4) " << diffPhi <<
" " << trackPc.
phi() <<
" " << track.
phi()
946 <<
" dxy(assocPV) " << diffDxyAssocPV
948 <<
" dz(assocPV) " << diffDzAssocPV
950 <<
" dxy(PV) (0.05) " << diffDxyPV <<
" " << pcRef->dxy(pv.
position()) <<
" " << track.
dxy(pv.
position())
952 <<
" dz(PV) (0.05) " << diffDzPV <<
" " << pcRef->dz(pv.
position()) <<
" " << track.
dz(pv.
position())
954 <<
" cov(qoverp, qoverp) " << diffCovQoverpQoverp
956 <<
" cov(lambda, lambda) " << diffCovLambdaLambda
958 <<
" cov(lambda, dsz) " << diffCovLambdaDsz
960 <<
" cov(phi, phi) " << diffCovPhiPhi
962 <<
" cov(phi, dxy) " << diffCovPhiDxy
964 <<
" cov(dxy, dxy) " << diffCovDxyDxy
966 <<
" cov(dxy, dsz) " << diffCovDxyDsz
968 <<
" 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