661 const auto&
tracks = *htracks;
673 const auto& trackToPackedCandidate = *hassoc;
676 auto trackPtr =
tracks.ptrAt(
i);
687 if(pcRef->charge() == 0) {
692 const reco::Track *trackPcPtr = pcRef->bestTrack();
699 if(
std::abs(pcRef->pdgId()) == 11) {
711 auto slimmedVertexRef = pcRef->vertexRef();
723 double diffNormalizedChi2 = 0;
724 if(trackPc.
ndof() != 0) {
736 const auto diffPt = diffRelative(trackPc.
pt(), track.
pt());
743 const auto diffDzAssocPV =
h_diffDzAssocPV.fill( pcRef->dzAssociatedPV(), track.
dz(pcVertex.
position()) , [](
double value){
return value*100.;});
745 const auto diffDzPV = diffRelative(pcRef->dz(pv.
position()) , track.
dz(pv.
position()));
751 auto fillCov1 = [&](
auto& hlp,
const int i,
const int j) {
754 auto fillCov2 = [&](
auto& hlp,
const int i,
const int j, std::function<double(double)> modifyPack) {
757 auto fillCov3 = [&](
auto& hlp,
const int i,
const int j, std::function<double(double)> modifyPack, std::function<double(double)> modifyUnpack) {
761 const auto pcPt = pcRef->pt();
771 if(isInRange(diffCovDszDsz.status())) {
776 if(isInRange(diffCovDxyDxy.status())) {
789 const auto pcNumberOfHits = pcRef->numberOfHits();
790 const auto pcNumberOfPixelHits = pcRef->numberOfPixelHits();
791 const auto pcNumberOfStripHits = pcNumberOfHits - pcNumberOfPixelHits;
795 const auto pcNumberOfLayers = pcRef->trackerLayersWithMeasurement();
796 const auto pcNumberOfPixelLayers = pcRef->pixelLayersWithMeasurement();
797 const auto pcNumberOfStripLayers = pcRef->stripLayersWithMeasurement();
817 int diffNumberOfPixelHits = 0;
818 int diffNumberOfHits = 0;
819 int diffNumberOfPixelLayers = 0;
820 int diffNumberOfStripLayers = 0;
821 if(pixelLayerOverflow) {
825 diffNumberOfPixelLayers = pcNumberOfPixelLayers - trackNumberOfPixelLayers;
831 diffNumberOfPixelHits = pcNumberOfPixelHits - trackNumberOfPixelHits;
833 if(stripLayerOverflow) {
837 diffNumberOfStripLayers = pcNumberOfStripLayers - trackNumberOfStripLayers;
839 if(stripOverflow || pixelInducedStripOverflow || pixelOverflow) {
840 int diffNumberOfStripHits = 0;
841 if(stripOverflow || pixelInducedStripOverflow) {
844 else if(pixelOverflow) {
845 diffNumberOfStripHits = (pcNumberOfStripHits - pixelOverflow) - trackNumberOfStripHits;
848 diffNumberOfHits = diffNumberOfPixelHits + diffNumberOfStripHits;
851 diffNumberOfHits = pcNumberOfHits - trackNumberOfHits;
861 int diffLostInnerHits = 0;
863 switch(pcRef->lostInnerHits()) {
866 diffLostInnerHits = -trackLostInnerHits;
869 diffLostInnerHits = 1-trackLostInnerHits;
872 diffLostInnerHits = trackLostInnerHits>=2 ? 0 : 2-trackLostInnerHits;
891 int diffHitPatternHasValidHitInFirstPixelBarrel = 0;
900 (diffNormalizedChi2 < -1 || diffNormalizedChi2 > 0 || diffCharge != 0 || diffHP != 0
902 || diffDxyAssocPV.outsideExpectedRange()
903 || diffDzAssocPV.outsideExpectedRange()
905 || diffCovQoverpQoverp.outsideExpectedRange() || diffCovLambdaLambda.outsideExpectedRange()
906 || diffCovLambdaDsz.outsideExpectedRange() || diffCovPhiPhi.outsideExpectedRange()
907 || diffCovPhiDxy.outsideExpectedRange() || diffCovDxyDxy.outsideExpectedRange()
908 || diffCovDxyDsz.outsideExpectedRange() || diffCovDszDsz.outsideExpectedRange()
909 || diffNumberOfPixelHits != 0 || diffNumberOfHits != 0 || diffLostInnerHits != 0
910 || diffHitPatternHasValidHitInFirstPixelBarrel != 0
914 edm::LogInfo(
"PackedCandidateTrackValidator") <<
"Track " << i <<
" pt " << track.
pt() <<
" eta " << track.
eta() <<
" phi " << track.
phi() <<
" chi2 " << track.
chi2() <<
" ndof " << track.
ndof()
920 <<
" dxy " << track.
dxy() <<
" dz " << track.
dz()
922 <<
" " << TrackAlgoPrinter(track)
923 <<
" lost inner hits " << trackLostInnerHits
925 <<
" hitpattern " << HitPatternPrinter(track)
927 <<
" 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()
929 <<
" ptError " << trackPc.
ptError() <<
" etaError " << trackPc.
etaError() <<
" phiError " << trackPc.
phiError()
931 <<
" pc.vertex " << pcRef->vertex() <<
" momentum " << pcRef->momentum() <<
" track " << trackPc.
momentum()
933 <<
" dxy " << trackPc.
dxy() <<
" dz " << trackPc.
dz() <<
" pc.dz " << pcRef->dz()
934 <<
" dxyError " << trackPc.
dxyError() <<
" dzError " << trackPc.
dzError()
937 <<
" dxy(assocPV) " << trackPc.
dxy(pcVertex.
position()) <<
" dz(assocPV) " << trackPc.
dz(pcVertex.
position())
939 <<
" (diff PackedCandidate track)" 941 <<
" charge " << diffCharge <<
" " << trackPc.
charge() <<
" " << track.
charge()
944 <<
" numberOfAllHits " << diffNumberOfHits <<
" " << pcNumberOfHits <<
" " << trackNumberOfHits
945 <<
" numberOfPixelHits " << diffNumberOfPixelHits <<
" " << pcNumberOfPixelHits <<
" " << trackNumberOfPixelHits
946 <<
" numberOfStripHits # " << pcNumberOfStripHits <<
" " << trackNumberOfStripHits
952 <<
" lostInnerHits " << diffLostInnerHits <<
" " << pcRef->lostInnerHits() <<
" #" 953 <<
" phi (5e-4) " << diffPhi <<
" " << trackPc.
phi() <<
" " << track.
phi()
955 <<
" dxy(assocPV) " << diffDxyAssocPV
957 <<
" dz(assocPV) " << diffDzAssocPV
959 <<
" dxy(PV) (0.05) " << diffDxyPV <<
" " << pcRef->dxy(pv.
position()) <<
" " << track.
dxy(pv.
position())
961 <<
" dz(PV) (0.05) " << diffDzPV <<
" " << pcRef->dz(pv.
position()) <<
" " << track.
dz(pv.
position())
963 <<
" cov(qoverp, qoverp) " << diffCovQoverpQoverp
965 <<
" cov(lambda, lambda) " << diffCovLambdaLambda
967 <<
" cov(lambda, dsz) " << diffCovLambdaDsz
969 <<
" cov(phi, phi) " << diffCovPhiPhi
971 <<
" cov(phi, dxy) " << diffCovPhiDxy
973 <<
" cov(dxy, dxy) " << diffCovDxyDxy
975 <<
" cov(dxy, dsz) " << diffCovDxyDsz
977 <<
" cov(dsz, dsz) " << diffCovDszDsz;
constexpr double deltaPhi(double phi1, double phi2)
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 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