21 void BinLogX(TH1*
h) {
22 TAxis* axis =
h->GetXaxis();
23 int bins = axis->GetNbins();
25 float from = axis->GetXmin();
26 float to = axis->GetXmax();
28 std::vector<float> new_bins(
bins + 1, 0);
30 for (
int i = 0;
i <=
bins;
i++) {
31 new_bins[
i] = TMath::Power(10, from +
i *
width);
33 axis->Set(
bins, new_bins.data());
36 void BinLogY(TH1*
h) {
37 TAxis* axis =
h->GetYaxis();
38 int bins = axis->GetNbins();
40 float from = axis->GetXmin();
41 float to = axis->GetXmax();
43 std::vector<float> new_bins(
bins + 1, 0);
45 for (
int i = 0;
i <=
bins;
i++) {
46 new_bins[
i] = TMath::Power(10, from +
i *
width);
48 axis->Set(
bins, new_bins.data());
51 template <
typename...
Args>
53 auto h = std::make_unique<TH1F>(std::forward<Args>(
args)...);
56 const auto&
name =
h->GetName();
60 template <
typename...
Args>
62 auto h = std::make_unique<TProfile>(std::forward<Args>(
args)...);
65 const auto&
name =
h->GetName();
69 template <
typename...
Args>
71 auto h = std::make_unique<TH2F>(std::forward<Args>(
args)...);
74 const auto&
name =
h->GetName();
78 template <
typename...
Args>
80 auto h = std::make_unique<TH2F>(std::forward<Args>(
args)...);
83 const auto&
name =
h->GetName();
88 for (
size_t i = 0;
i <
labels.size(); ++
i) {
91 h->disableAlphanumeric();
98 h->disableAlphanumeric();
101 void fillMVAHistos(
const std::vector<dqm::reco::MonitorElement*>& h_mva,
102 const std::vector<dqm::reco::MonitorElement*>& h_mvacut,
103 const std::vector<dqm::reco::MonitorElement*>& h_mva_hp,
104 const std::vector<dqm::reco::MonitorElement*>& h_mvacut_hp,
105 const std::vector<float>& mvas,
106 unsigned int selectsLoose,
107 unsigned int selectsHP) {
110 for (
size_t i = 0;
i < mvas.size(); ++
i) {
111 if (
i <= selectsLoose) {
112 h_mva[
i]->Fill(mvas[
i]);
113 h_mvacut[
i]->Fill(mvas[
i]);
115 if (
i >= 1 &&
i <= selectsHP) {
116 h_mva_hp[
i]->Fill(mvas[
i]);
117 h_mvacut_hp[
i]->Fill(mvas[
i]);
122 void fillMVAHistos(
double xval,
123 const std::vector<dqm::reco::MonitorElement*>& h_mva,
124 const std::vector<dqm::reco::MonitorElement*>& h_mva_hp,
125 const std::vector<float>& mvas,
126 unsigned int selectsLoose,
127 unsigned int selectsHP) {
130 for (
size_t i = 0;
i < mvas.size(); ++
i) {
131 if (
i <= selectsLoose) {
132 h_mva[
i]->Fill(xval, mvas[
i]);
134 if (
i >= 1 &&
i <= selectsHP) {
135 h_mva_hp[
i]->Fill(xval, mvas[
i]);
150 minPt =
pset.getParameter<
double>(
"minPt");
151 maxPt =
pset.getParameter<
double>(
"maxPt");
154 useLogPt =
pset.getUntrackedParameter<
bool>(
"useLogPt",
false);
162 minPu =
pset.getParameter<
double>(
"minPu");
163 maxPu =
pset.getParameter<
double>(
"maxPu");
182 minDz =
pset.getParameter<
double>(
"minDz");
183 maxDz =
pset.getParameter<
double>(
"maxDz");
200 mindr =
pset.getParameter<
double>(
"mindr");
201 maxdr =
pset.getParameter<
double>(
"maxdr");
269 auto initTPselector = [&](
auto&
sel,
auto&
name) {
270 sel = std::make_unique<TrackingParticleSelector>(
273 auto initTrackSelector = [&](
auto&
sel,
auto&
name) {
276 auto initGPselector = [&](
auto&
sel,
auto&
name) {
277 sel = std::make_unique<GenParticleCustomSelector>(
302 std::vector<std::pair<SeedingLayerSetId, std::string>> stripPairSets;
305 for (
size_t i = 0;
i < layerSets.size(); ++
i) {
306 const auto& layerSet = layerSets[
i];
311 <<
". Please increase the maximum in MTVHistoProducerAlgoForTracker.h";
314 for (
size_t j = 0;
j < layerSet.size(); ++
j) {
319 bool isStripMono = !layerSet[
j].empty() && layerSet[
j][0] ==
'M';
323 if (layerSet.size() == 3 &&
isTrackerStrip(std::get<GeomDetEnumerators::SubDetector>(std::get<0>(setId[0])))) {
325 pairId[0] = setId[0];
326 pairId[1] = setId[1];
327 stripPairSets.emplace_back(pairId, layerSet[0] +
"+" + layerSet[1]);
331 if (!inserted.second)
333 <<
" is specified twice, while the set list should be unique.";
337 for (
const auto& setIdName : stripPairSets) {
353 <<
"minPt = " <<
minPt <<
" <= 0 out of range while requesting log scale. Using minPt = 0.1.";
363 <<
"minVertpos = " <<
minVertpos <<
" <= 0 out of range while requesting log scale. Using minVertpos = 0.1.";
385 psetTrack.
addParameter(
"quality", std::vector<std::string>{});
386 psetTrack.
addParameter(
"algorithm", std::vector<std::string>{});
387 psetTrack.
addParameter(
"originalAlgorithm", std::vector<std::string>{});
388 psetTrack.
addParameter(
"algorithmMaskContains", std::vector<std::string>{});
392 return std::make_unique<RecoTrackSelectorBase>(psetTrack);
403 histograms.h_bunchxSIM = ibook.
book1D(
"bunchxSIM",
"bunch crossing", 21, -15.5, 5.5);
408 bool doResolutionPlots) {
419 histograms.h_assocpTvseta.push_back(make2DIfLogY(ibook,
421 "num_assoc(simToReco)_pTvseta",
422 "N of associated tracks (simToReco) in (pT-eta) please",
429 histograms.h_simulpTvseta.push_back(make2DIfLogY(ibook,
432 "N of simulated tracks in (pT-eta) plane",
450 histograms.h_assocpixellayer.push_back(ibook.
book1D(
"num_assoc(simToReco)_pixellayer",
451 "N of associated tracks (simToReco) vs pixel layer",
458 histograms.h_assoc3Dlayer.push_back(ibook.
book1D(
"num_assoc(simToReco)_3Dlayer",
459 "N of associated tracks (simToReco) vs 3D layer",
467 ibook.
book1D(
"num_assoc(simToReco)_pu",
"N of associated tracks (simToReco) vs pu",
nintPu,
minPu,
maxPu));
481 ibook.
book1D(
"num_assoc(simToReco)_dz",
"N of associated tracks (simToReco) vs dz",
nintDz,
minDz,
maxDz));
484 histograms.h_assocvertpos.push_back(make1DIfLogX(ibook,
486 "num_assoc(simToReco)_vertpos",
487 "N of associated tracks (simToReco) vs transverse vert position",
491 histograms.h_simulvertpos.push_back(make1DIfLogX(ibook,
494 "N of simulated tracks vs transverse vert position",
500 "num_assoc(simToReco)_zpos",
"N of associated tracks (simToReco) vs z vert position",
nintZpos,
minZpos,
maxZpos));
504 histograms.h_assocdr.push_back(make1DIfLogX(ibook,
506 "num_assoc(simToReco)_dr",
507 "N of associated tracks (simToReco) vs dR",
512 make1DIfLogX(ibook,
true,
"num_simul_dr",
"N of simulated tracks vs dR",
nintdr, log10(
mindr), log10(
maxdr)));
514 histograms.h_assocdrj.push_back(make1DIfLogX(ibook,
516 "num_assoc(simToReco)_drj",
517 "N of associated tracks (simToReco) vs dR(TP,jet)",
522 ibook,
true,
"num_simul_drj",
"N of simulated tracks vs dR(TP,jet)",
nintdrj, log10(
mindrj), log10(
maxdrj)));
527 "num_assoc(simToReco)_simpvz",
"N of associated tracks (simToReco) vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
529 histograms.nrecHit_vs_nsimHit_sim2rec.push_back(doResolutionPlots ? ibook.
book2D(
"nrecHit_vs_nsimHit_sim2rec",
530 "nrecHit vs nsimHit (Sim2RecAssoc)",
541 histograms.h_duplicates_oriAlgo_vs_oriAlgo.push_back(ibook.
book2D(
"duplicates_oriAlgo_vs_oriAlgo",
542 "Duplicate tracks: originalAlgo vs originalAlgo",
549 setBinLabelsAlgo(
histograms.h_duplicates_oriAlgo_vs_oriAlgo.back(), 1);
550 setBinLabelsAlgo(
histograms.h_duplicates_oriAlgo_vs_oriAlgo.back(), 2);
555 "num_assoc(simToReco)_dxypv",
"N of associated tracks (simToReco) vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
560 ibook.
book1D(
"num_assoc(simToReco)_dzpv",
"N of associated tracks (simToReco) vs dz(PV)",
nintDz,
minDz,
maxDz));
564 histograms.h_assocdxypvzoomed.push_back(ibook.
book1D(
"num_assoc(simToReco)_dxypv_zoomed",
565 "N of associated tracks (simToReco) vs dxy(PV)",
572 histograms.h_assocdzpvzoomed.push_back(ibook.
book1D(
"num_assoc(simToReco)_dzpv_zoomed",
573 "N of associated tracks (simToReco) vs dz(PV)",
581 "num_assoc(simToReco)_dzpvcut",
"N of associated tracks (simToReco) vs dz(PV)",
nintDzpvCum, 0,
maxDzpvCum));
585 "num_simul2_dzpvcut",
"N of simulated tracks (associated to any track) from sim PV",
nintDzpvCum, 0,
maxDzpvCum));
587 histograms.h_assoc_dzpvsigcut.push_back(ibook.
book1D(
"num_assoc(simToReco)_dzpvsigcut",
588 "N of associated tracks (simToReco) vs dz(PV)/dzError",
595 ibook.
book1D(
"num_simul2_dzpvsigcut",
596 "N of simulated tracks (associated to any track) from sim PV/dzError",
604 bool doResolutionPlots) {
608 histograms.h_charge.push_back(ibook.
book1D(
"charge",
"charge", 3, -1.5, 1.5));
612 histograms.h_nchi2.push_back(ibook.
book1D(
"chi2",
"normalized #chi^{2}", 200, 0, 20));
613 histograms.h_nchi2_prob.push_back(ibook.
book1D(
"chi2_prob",
"normalized #chi^{2} probability", 100, 0, 1));
624 histograms.h_algo.back()->disableAlphanumeric();
633 "num_duplicate_eta",
"N of associated (recoToSim) duplicate tracks vs eta",
nintEta,
minEta,
maxEta));
636 "num_chargemisid_eta",
"N of associated (recoToSim) charge misIDed tracks vs eta",
nintEta,
minEta,
maxEta));
649 histograms.h_misidpT.push_back(make1DIfLogX(ibook,
651 "num_chargemisid_pT",
652 "N of associated (recoToSim) charge misIDed tracks vs pT",
659 histograms.h_recopTvseta.push_back(make2DIfLogY(ibook,
662 "N of reco track in (pT-eta) plane",
669 histograms.h_reco2pTvseta.push_back(make2DIfLogY(ibook,
672 "N of selected reco track in (pT-eta) plane",
679 histograms.h_assoc2pTvseta.push_back(make2DIfLogY(ibook,
681 "num_assoc(recoToSim)_pTvseta",
682 "N of associated (recoToSim) tracks in (pT-eta) plane",
689 histograms.h_looperpTvseta.push_back(make2DIfLogY(ibook,
691 "num_duplicate_pTvseta",
692 "N of associated (recoToSim) duplicate tracks in (pT-eta) plane",
703 "num_chargemisid_pTvseta",
704 "N of associated (recoToSim) charge misIDed tracks in (pT-eta) plane",
711 histograms.h_pileuppTvseta.push_back(make2DIfLogY(ibook,
713 "num_pileup_pTvseta",
714 "N of associated (recoToSim) pileup tracks in (pT-eta) plane",
726 "num_duplicate_hit",
"N of associated (recoToSim) duplicate tracks vs hit",
nintHit,
minHit,
maxHit));
729 "num_chargemisid_hit",
"N of associated (recoToSim) charge misIDed tracks vs hit",
nintHit,
minHit,
maxHit));
741 "N of associated (recoToSim) charge misIDed tracks vs layer",
750 histograms.h_assoc2pixellayer.push_back(ibook.
book1D(
"num_assoc(recoToSim)_pixellayer",
751 "N of associated (recoToSim) tracks vs pixellayer",
755 histograms.h_looperpixellayer.push_back(ibook.
book1D(
"num_duplicate_pixellayer",
756 "N of associated (recoToSim) duplicate tracks vs pixellayer",
762 ibook.
book1D(
"num_chargemisid_pixellayer",
763 "N of associated (recoToSim) charge misIDed tracks vs pixellayer",
767 histograms.h_pileuppixellayer.push_back(ibook.
book1D(
"num_pileup_pixellayer",
768 "N of associated (recoToSim) pileup tracks vs pixellayer",
775 histograms.h_assoc23Dlayer.push_back(ibook.
book1D(
"num_assoc(recoToSim)_3Dlayer",
776 "N of associated (recoToSim) tracks vs 3D layer",
781 "N of associated (recoToSim) duplicate tracks vs 3D layer",
787 "N of associated (recoToSim) charge misIDed tracks vs 3D layer",
797 ibook.
book1D(
"num_assoc(recoToSim)_pu",
"N of associated (recoToSim) tracks vs pu",
nintPu,
minPu,
maxPu));
799 ibook.
book1D(
"num_duplicate_pu",
"N of associated (recoToSim) duplicate tracks vs pu",
nintPu,
minPu,
maxPu));
802 "num_chargemisid_pu",
"N of associated (recoToSim) charge misIDed tracks vs pu",
nintPu,
minPu,
maxPu));
810 "num_duplicate_phi",
"N of associated (recoToSim) duplicate tracks vs phi",
nintPhi,
minPhi,
maxPhi));
813 "num_chargemisid_phi",
"N of associated (recoToSim) charge misIDed tracks vs phi",
nintPhi,
minPhi,
maxPhi));
824 "num_chargemisid_dxy",
"N of associated (recoToSim) charge misIDed tracks vs dxy",
nintDxy,
minDxy,
maxDxy));
830 ibook.
book1D(
"num_assoc(recoToSim)_dz",
"N of associated (recoToSim) tracks vs dz",
nintDz,
minDz,
maxDz));
832 ibook.
book1D(
"num_duplicate_dz",
"N of associated (recoToSim) looper tracks vs dz",
nintDz,
minDz,
maxDz));
835 "num_chargemisid_versus_dz",
"N of associated (recoToSim) charge misIDed tracks vs dz",
nintDz,
minDz,
maxDz));
839 histograms.h_recovertpos.push_back(make1DIfLogX(ibook,
842 "N of reconstructed tracks vs transverse ref point position",
849 "num_assoc(recoToSim)_vertpos",
850 "N of associated (recoToSim) tracks vs transverse ref point position",
857 "num_duplicate_vertpos",
858 "N of associated (recoToSim) looper tracks vs transverse ref point position",
865 "num_pileup_vertpos",
866 "N of associated (recoToSim) pileup tracks vs transverse ref point position",
872 "num_reco_zpos",
"N of reconstructed tracks vs transverse ref point position",
nintZpos,
minZpos,
maxZpos));
874 "N of associated (recoToSim) tracks vs transverse ref point position",
879 ibook.
book1D(
"num_duplicate_zpos",
880 "N of associated (recoToSim) looper tracks vs transverse ref point position",
885 ibook.
book1D(
"num_pileup_zpos",
886 "N of associated (recoToSim) pileup tracks vs transverse ref point position",
892 make1DIfLogX(ibook,
true,
"num_reco_dr",
"N of reconstructed tracks vs dR",
nintdr, log10(
mindr), log10(
maxdr)));
893 histograms.h_assoc2dr.push_back(make1DIfLogX(ibook,
895 "num_assoc(recoToSim)_dr",
896 "N of associated tracks (recoToSim) vs dR",
900 histograms.h_looperdr.push_back(make1DIfLogX(ibook,
903 "N of associated (recoToSim) looper tracks vs dR",
907 histograms.h_pileupdr.push_back(make1DIfLogX(ibook,
910 "N of associated (recoToSim) pileup tracks vs dR",
916 ibook,
true,
"num_reco_drj",
"N of reconstructed tracks vs dR(track,jet)",
nintdrj, log10(
mindrj), log10(
maxdrj)));
917 histograms.h_assoc2drj.push_back(make1DIfLogX(ibook,
919 "num_assoc(recoToSim)_drj",
920 "N of associated tracks (recoToSim) vs dR(track,jet)",
924 histograms.h_looperdrj.push_back(make1DIfLogX(ibook,
927 "N of associated (recoToSim) looper tracks vs dR(track,jet)",
931 histograms.h_pileupdrj.push_back(make1DIfLogX(ibook,
934 "N of associated (recoToSim) pileup tracks vs dR(track,jet)",
942 "num_assoc(recoToSim)_simpvz",
"N of associated tracks (recoToSim) vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
944 "num_duplicate_simpvz",
"N of associated (recoToSim) looper tracks vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
946 "num_pileup_simpvz",
"N of associated (recoToSim) pileup tracks vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
951 "N of associated (recoToSim) tracks vs normalized #chi^{2}",
956 "N of associated (recoToSim) looper tracks vs normalized #chi^{2}",
962 ibook.
book1D(
"num_chargemisid_chi2",
963 "N of associated (recoToSim) charge misIDed tracks vs normalized #chi^{2}",
968 "N of associated (recoToSim) pileup tracks vs normalized #chi^{2}",
974 ibook.
book1D(
"num_reco_chi2prob",
"N of reco track vs normalized #chi^{2}", 100, 0., 1.));
976 "num_assoc(recoToSim)_chi2prob",
"N of associated (recoToSim) tracks vs normalized #chi^{2}", 100, 0., 1.));
978 "num_duplicate_chi2prob",
"N of associated (recoToSim) looper tracks vs normalized #chi^{2}", 100, 0., 1.));
981 ibook.
book1D(
"num_chargemisid_chi2prob",
982 "N of associated (recoToSim) charge misIDed tracks vs normalized #chi^{2}",
987 "num_pileup_chi2prob",
"N of associated (recoToSim) pileup tracks vs normalized #chi^{2}", 100, 0., 1.));
992 ibook.
book1D(
"num_reco_seedingLayerSet",
"N of reco track vs. seedingLayerSet",
size, 0,
size));
993 histograms.h_assoc2_seedingLayerSet.push_back(
994 ibook.
book1D(
"num_assoc(recoToSim)_seedingLayerSet",
995 "N of associated track (recoToSim) tracks vs. seedingLayerSet",
1000 "num_duplicate_seedingLayerSet",
"N of reco associated (recoToSim) looper vs. seedingLayerSet",
size, 0,
size));
1002 "num_pileup_seedingLayerSet",
"N of reco associated (recoToSim) pileup vs. seedingLayerSet",
size, 0,
size));
1012 auto bookResolutionPlots1D = [&](std::vector<dqm::reco::MonitorElement*>& vec,
auto&&...
params) {
1013 vec.push_back(doResolutionPlots ? ibook.
book1D(std::forward<decltype(
params)>(
params)...) :
nullptr);
1015 auto bookResolutionPlots2D = [&](std::vector<dqm::reco::MonitorElement*>& vec,
bool logx,
auto&&...
params) {
1016 vec.push_back(doResolutionPlots ? make2DIfLogX(ibook, logx, std::forward<decltype(
params)>(
params)...) :
nullptr);
1018 auto bookResolutionPlotsProfile2D = [&](std::vector<dqm::reco::MonitorElement*>& vec,
auto&&...
params) {
1022 bookResolutionPlots1D(
histograms.h_eta,
"eta",
"pseudorapidity residue", 1000, -0.1, 0.1);
1023 bookResolutionPlots1D(
histograms.h_pt,
"pullPt",
"pull of p_{t}", 100, -10, 10);
1024 bookResolutionPlots1D(
histograms.h_pullTheta,
"pullTheta",
"pull of #theta parameter", 250, -25, 25);
1025 bookResolutionPlots1D(
histograms.h_pullPhi,
"pullPhi",
"pull of #phi parameter", 250, -25, 25);
1026 bookResolutionPlots1D(
histograms.h_pullDxy,
"pullDxy",
"pull of dxy parameter", 250, -25, 25);
1027 bookResolutionPlots1D(
histograms.h_pullDz,
"pullDz",
"pull of dz parameter", 250, -25, 25);
1028 bookResolutionPlots1D(
histograms.h_pullQoverp,
"pullQoverp",
"pull of qoverp parameter", 250, -25, 25);
1039 histograms.h_assocFraction.push_back(ibook.
book1D(
"assocFraction",
"fraction of shared hits", 200, 0, 2));
1040 histograms.h_assocSharedHit.push_back(ibook.
book1D(
"assocSharedHit",
"number of shared hits", 41, -0.5, 40.5));
1047 bookResolutionPlots2D(
1049 bookResolutionPlots2D(
1053 "Number of selected reco tracks vs. number of selected sim tracks;TrackingParticles;Reco tracks",
1067 histograms.chi2_vs_drj.push_back(makeProfileIfLogX(
1068 ibook,
true,
"chi2mean_vs_drj",
"mean #chi^{2} vs dR(track,jet)",
nintdrj, log10(
mindrj), log10(
maxdrj), 0, 20));
1073 "assoc_chi2prob_vs_eta",
"mean #chi^{2} probability vs #eta",
nintEta,
minEta,
maxEta, 100, 0., 1.,
" "));
1074 histograms.assoc_chi2_vs_pt.push_back(makeProfileIfLogX(
1076 histograms.assoc_chi2prob_vs_pt.push_back(makeProfileIfLogX(
1078 histograms.assoc_chi2_vs_drj.push_back(makeProfileIfLogX(ibook,
1080 "assoc_chi2mean_vs_drj",
1081 "mean #chi^{2} vs dR(track,jet)",
1087 histograms.assoc_chi2prob_vs_drj.push_back(makeProfileIfLogX(ibook,
1089 "assoc_chi2prob_vs_drj",
1090 "mean #chi^{2} probability vs dR(track,jet)",
1117 "mean # Layers with measurement vs eta",
1126 "mean # PXL Layers with measurement vs eta",
1135 "mean # STRIP Layers with measurement vs eta",
1143 histograms.nSTRIPlayersWith1dMeas_vs_eta.push_back(ibook.
bookProfile(
"STRIPlayersWith1dMeas_vs_eta",
1144 "mean # STRIP Layers with 1D measurement vs eta",
1152 histograms.nSTRIPlayersWith2dMeas_vs_eta.push_back(ibook.
bookProfile(
"STRIPlayersWith2dMeas_vs_eta",
1153 "mean # STRIP Layers with 2D measurement vs eta",
1185 bookResolutionPlots2D(
histograms.ptres_vs_eta,
1196 bookResolutionPlots2D(
histograms.ptres_vs_phi,
1199 "p_{t} res vs #phi",
1207 bookResolutionPlots2D(
histograms.ptres_vs_pt,
1218 bookResolutionPlots2D(
histograms.cotThetares_vs_eta,
1220 "cotThetares_vs_eta",
1221 "cotThetares_vs_eta",
1229 bookResolutionPlots2D(
histograms.cotThetares_vs_pt,
1231 "cotThetares_vs_pt",
1232 "cotThetares_vs_pt",
1240 bookResolutionPlots2D(
histograms.phires_vs_eta,
1251 bookResolutionPlots2D(
histograms.phires_vs_pt,
1262 bookResolutionPlots2D(
histograms.phires_vs_phi,
1273 bookResolutionPlots2D(
histograms.dxyres_vs_eta,
1284 bookResolutionPlots2D(
histograms.dxyres_vs_pt,
1295 bookResolutionPlots2D(
histograms.dxyres_vs_phi,
1306 bookResolutionPlots2D(
histograms.dzres_vs_eta,
1317 bookResolutionPlots2D(
histograms.dzres_vs_pt,
1328 bookResolutionPlots2D(
histograms.dzres_vs_phi,
1339 bookResolutionPlotsProfile2D(
histograms.ptmean_vs_eta_phi,
1340 "ptmean_vs_eta_phi",
1341 "mean p_{t} vs #eta and #phi",
1351 bookResolutionPlotsProfile2D(
histograms.phimean_vs_eta_phi,
1352 "phimean_vs_eta_phi",
1353 "mean #phi vs #eta and #phi",
1365 bookResolutionPlots2D(
1367 bookResolutionPlots2D(
1369 bookResolutionPlots2D(
1371 bookResolutionPlots2D(
1373 bookResolutionPlots2D(
1375 bookResolutionPlots2D(
1377 bookResolutionPlots2D(
1379 bookResolutionPlots2D(
1381 bookResolutionPlots2D(
1383 bookResolutionPlots2D(
1389 bookResolutionPlots2D(
1391 bookResolutionPlots2D(
1393 bookResolutionPlots2D(
histograms.thetapull_vs_phi,
1396 "#theta pull vs #phi",
1404 bookResolutionPlots2D(
histograms.nrecHit_vs_nsimHit_rec2sim,
1406 "nrecHit_vs_nsimHit_rec2sim",
1407 "nrecHit vs nsimHit (Rec2simAssoc)",
1420 "num_assoc(recoToSim)_dxypv",
"N of associated (recoToSim) tracks vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
1422 "num_duplicate_dxypv",
"N of associated (recoToSim) looper tracks vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
1425 "N of associated (recoToSim) charge misIDed tracks vs dxy(PV)",
1430 "num_pileup_dxypv",
"N of associated (recoToSim) pileup tracks vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
1434 ibook.
book1D(
"num_assoc(recoToSim)_dzpv",
"N of associated (recoToSim) tracks vs dz(PV)",
nintDz,
minDz,
maxDz));
1436 ibook.
book1D(
"num_duplicate_dzpv",
"N of associated (recoToSim) looper tracks vs dz(PV)",
nintDz,
minDz,
maxDz));
1438 histograms.h_misiddzpv.push_back(ibook.
book1D(
"num_chargemisid_versus_dzpv",
1439 "N of associated (recoToSim) charge misIDed tracks vs dz(PV)",
1444 ibook.
book1D(
"num_pileup_dzpv",
"N of associated (recoToSim) pileup tracks vs dz(PV)",
nintDz,
minDz,
maxDz));
1448 histograms.h_assoc2dxypvzoomed.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dxypv_zoomed",
1449 "N of associated (recoToSim) tracks vs dxy(PV)",
1453 histograms.h_looperdxypvzoomed.push_back(ibook.
book1D(
"num_duplicate_dxypv_zoomed",
1454 "N of associated (recoToSim) looper tracks vs dxy(PV)",
1459 histograms.h_misiddxypvzoomed.push_back(ibook.
book1D(
"num_chargemisid_dxypv_zoomed",
1460 "N of associated (recoToSim) charge misIDed tracks vs dxy(PV)",
1464 histograms.h_pileupdxypvzoomed.push_back(ibook.
book1D(
"num_pileup_dxypv_zoomed",
1465 "N of associated (recoToSim) pileup tracks vs dxy(PV)",
1472 histograms.h_assoc2dzpvzoomed.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dzpv_zoomed",
1473 "N of associated (recoToSim) tracks vs dz(PV)",
1477 histograms.h_looperdzpvzoomed.push_back(ibook.
book1D(
"num_duplicate_dzpv_zoomed",
1478 "N of associated (recoToSim) looper tracks vs dz(PV)",
1483 histograms.h_misiddzpvzoomed.push_back(ibook.
book1D(
"num_chargemisid_versus_dzpv_zoomed",
1484 "N of associated (recoToSim) charge misIDed tracks vs dz(PV)",
1488 histograms.h_pileupdzpvzoomed.push_back(ibook.
book1D(
"num_pileup_dzpv_zoomed",
1489 "N of associated (recoToSim) pileup tracks vs dz(PV)",
1497 "num_assoc(recoToSim)_dzpvcut",
"N of associated (recoToSim) tracks vs dz(PV)",
nintDzpvCum, 0,
maxDzpvCum));
1499 "num_pileup_dzpvcut",
"N of associated (recoToSim) pileup tracks vs dz(PV)",
nintDzpvCum, 0,
maxDzpvCum));
1503 histograms.h_assoc2_dzpvsigcut.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dzpvsigcut",
1504 "N of associated (recoToSim) tracks vs dz(PV)/dzError",
1508 histograms.h_pileup_dzpvsigcut.push_back(ibook.
book1D(
"num_pileup_dzpvsigcut",
1509 "N of associated (recoToSim) pileup tracks vs dz(PV)/dzError",
1539 histograms.h_seedsFitFailedFraction.push_back(
1540 ibook.
book1D(
"seeds_fitFailedFraction",
"Fraction of seeds for which the fit failed", 100, 0, 1));
1557 histograms.h_assoc2_mvacut_hp.emplace_back();
1558 histograms.h_simul2_mvacut_hp.emplace_back();
1560 histograms.h_assoc2_mva_vs_pt.emplace_back();
1562 histograms.h_assoc2_mva_vs_pt_hp.emplace_back();
1563 histograms.h_fake_mva_vs_pt_hp.emplace_back();
1564 histograms.h_assoc2_mva_vs_eta.emplace_back();
1566 histograms.h_assoc2_mva_vs_eta_hp.emplace_back();
1567 histograms.h_fake_mva_vs_eta_hp.emplace_back();
1569 for (
size_t i = 1;
i <= nMVAs; ++
i) {
1570 auto istr = std::to_string(
i);
1574 histograms.h_reco_mva_hp.back().emplace_back();
1575 histograms.h_assoc2_mva_hp.back().emplace_back();
1577 histograms.h_reco_mvacut_hp.back().emplace_back();
1578 histograms.h_assoc_mvacut_hp.back().emplace_back();
1579 histograms.h_assoc2_mvacut_hp.back().emplace_back();
1580 histograms.h_simul2_mvacut_hp.back().emplace_back();
1582 histograms.h_assoc2_mva_vs_pt_hp.back().emplace_back();
1583 histograms.h_fake_mva_vs_pt_hp.back().emplace_back();
1584 histograms.h_assoc2_mva_vs_eta_hp.back().emplace_back();
1585 histograms.h_fake_mva_vs_eta_hp.back().emplace_back();
1587 pfix =
" (not loose-selected)";
1591 "num_reco_mva" + istr +
"_hp",
"N of reco track after vs MVA" + istr + pfix2,
nintMVA,
minMVA,
maxMVA));
1593 ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr +
"_hp",
1594 "N of associated tracks (recoToSim) vs MVA" + istr + pfix2,
1599 histograms.h_reco_mvacut_hp.back().push_back(ibook.
book1D(
"num_reco_mva" + istr +
"cut" +
"_hp",
1600 "N of reco track vs cut on MVA" + istr + pfix2,
1604 histograms.h_assoc_mvacut_hp.back().push_back(
1605 ibook.
book1D(
"num_assoc(simToReco)_mva" + istr +
"cut_hp",
1606 "N of associated tracks (simToReco) vs cut on MVA" + istr + pfix2,
1610 histograms.h_assoc2_mvacut_hp.back().push_back(
1611 ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr +
"cut_hp",
1612 "N of associated tracks (recoToSim) vs cut on MVA" + istr + pfix2,
1616 histograms.h_simul2_mvacut_hp.back().push_back(
1617 ibook.
book1D(
"num_simul2_mva" + istr +
"cut_hp",
1618 "N of simulated tracks (associated to any track) vs cut on MVA" + istr + pfix2,
1623 histograms.h_assoc2_mva_vs_pt_hp.back().push_back(
1624 makeProfileIfLogX(ibook,
1626 (
"mva_assoc(recoToSim)_mva" + istr +
"_pT_hp").c_str(),
1627 (
"MVA" + istr +
" of associated tracks (recoToSim) vs. track p_{T}" + pfix2).c_str(),
1633 histograms.h_fake_mva_vs_pt_hp.back().push_back(
1634 makeProfileIfLogX(ibook,
1636 (
"mva_fake_mva" + istr +
"pT_hp").c_str(),
1637 (
"MVA" + istr +
" of non-associated tracks (recoToSim) vs. track p_{T}" + pfix2).c_str(),
1643 histograms.h_assoc2_mva_vs_eta_hp.back().push_back(
1644 ibook.
bookProfile(
"mva_assoc(recoToSim)_mva" + istr +
"_eta_hp",
1645 "MVA" + istr +
" of associated tracks (recoToSim) vs. track #eta" + pfix2,
1652 histograms.h_fake_mva_vs_eta_hp.back().push_back(
1653 ibook.
bookProfile(
"mva_fake_mva" + istr +
"eta_hp",
1654 "MVA" + istr +
" of non-associated tracks (recoToSim) vs. track #eta" + pfix2,
1665 histograms.h_assoc2_mva.back().push_back(ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr,
1666 "N of associated tracks (recoToSim) vs MVA" + istr + pfix,
1672 "num_reco_mva" + istr +
"cut",
"N of reco track vs cut on MVA" + istr + pfix,
nintMVA,
minMVA,
maxMVA));
1674 ibook.
book1D(
"num_assoc(simToReco)_mva" + istr +
"cut",
1675 "N of associated tracks (simToReco) vs cut on MVA" + istr + pfix,
1680 ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr +
"cut",
1681 "N of associated tracks (recoToSim) vs cut on MVA" + istr + pfix,
1686 ibook.
book1D(
"num_simul2_mva" + istr +
"cut",
1687 "N of simulated tracks (associated to any track) vs cut on MVA" + istr + pfix,
1692 histograms.h_assoc2_mva_vs_pt.back().push_back(
1693 makeProfileIfLogX(ibook,
1695 (
"mva_assoc(recoToSim)_mva" + istr +
"_pT").c_str(),
1696 (
"MVA" + istr +
" of associated tracks (recoToSim) vs. track p_{T}" + pfix).c_str(),
1702 histograms.h_fake_mva_vs_pt.back().push_back(
1703 makeProfileIfLogX(ibook,
1705 (
"mva_fake_mva" + istr +
"_pT").c_str(),
1706 (
"MVA" + istr +
" of non-associated tracks (recoToSim) vs. track p_{T}" + pfix).c_str(),
1712 histograms.h_assoc2_mva_vs_eta.back().push_back(
1713 ibook.
bookProfile(
"mva_assoc(recoToSim)_mva" + istr +
"_eta",
1714 "MVA" + istr +
" of associated tracks (recoToSim) vs. track #eta" + pfix,
1721 histograms.h_fake_mva_vs_eta.back().push_back(
1723 "MVA" + istr +
" of non-associated tracks (recoToSim) vs. track #eta" + pfix,
1758 int nSimPixelLayers,
1759 int nSimStripMonoAndStereoLayers,
1767 const std::vector<float>& mvas,
1768 unsigned int selectsLoose,
1769 unsigned int selectsHP)
const {
1771 const auto eta =
getEta(momentumTP.eta());
1772 const auto phi = momentumTP.phi();
1774 const auto nSim3DLayers = nSimPixelLayers + nSimStripMonoAndStereoLayers;
1776 const auto vertexTPwrtBS = vertexTP - bsPosition;
1777 const auto vertxy =
std::sqrt(vertexTPwrtBS.perp2());
1778 const auto vertz = vertexTPwrtBS.z();
1786 for (
size_t i = 0;
i < mvas.size(); ++
i) {
1787 if (
i <= selectsLoose) {
1791 if (
i >= 1 &&
i <= selectsHP) {
1883 const double dzpvsigcut = dzpvcut /
track->dzError();
1888 if (simPVPosition) {
1889 const auto simpvz = simPVPosition->z();
1915 for (
unsigned int i = 0;
i < v_dEdx.size();
i++) {
1933 bool isChargeMatched,
1934 int numAssocRecoTracks,
1937 double sharedFraction,
1940 const std::vector<float>& mvas,
1941 unsigned int selectsLoose,
1942 unsigned int selectsHP)
const {
1949 const auto phi =
track.momentum().phi();
1951 const auto dxy =
track.dxy(bsPosition);
1952 const auto dz =
track.dz(bsPosition);
1953 const auto dxypv = pvPosition ?
track.dxy(*pvPosition) : 0.0;
1954 const auto dzpv = pvPosition ?
track.dz(*pvPosition) : 0.0;
1955 const auto dzpvsig = pvPosition ? dzpv /
track.dzError() : 0.0;
1957 const auto nlayers =
track.hitPattern().trackerLayersWithMeasurement();
1958 const auto nPixelLayers =
track.hitPattern().pixelLayersWithMeasurement();
1959 const auto n3DLayers = nPixelLayers +
track.hitPattern().numberOfValidStripLayersWithMonoAndStereo();
1960 const auto refPointWrtBS =
track.referencePoint() - bsPosition;
1961 const auto vertxy =
std::sqrt(refPointWrtBS.perp2());
1962 const auto vertz = refPointWrtBS.z();
1963 const auto chi2 =
track.normalizedChi2();
1964 const auto chi2prob = TMath::Prob(
track.chi2(), (
int)
track.ndof());
1967 const auto simpvz = simPVPosition ? simPVPosition->z() : 0.0;
1986 if (fillSeedingLayerSets)
1997 if (simPVPosition) {
2017 if (!mvas.empty()) {
2047 if (dRJet <= 99999) {
2055 if (fillSeedingLayerSets)
2066 if (simPVPosition) {
2075 if (!mvas.empty()) {
2132 if (numAssocRecoTracks > 1) {
2146 if (fillSeedingLayerSets)
2154 if (simPVPosition) {
2164 if (!isSigMatched) {
2178 if (fillSeedingLayerSets)
2189 if (simPVPosition) {
2200 if (!mvas.empty()) {
2241 const auto pxbHits =
track.hitPattern().numberOfValidPixelBarrelHits();
2242 const auto pxfHits =
track.hitPattern().numberOfValidPixelEndcapHits();
2243 const auto tibHits =
track.hitPattern().numberOfValidStripTIBHits();
2244 const auto tidHits =
track.hitPattern().numberOfValidStripTIDHits();
2245 const auto tobHits =
track.hitPattern().numberOfValidStripTOBHits();
2246 const auto tecHits =
track.hitPattern().numberOfValidStripTECHits();
2254 histograms.nSTRIPhits_vs_eta[
count]->Fill(
eta, tibHits + tidHits + tobHits + tecHits);
2259 const auto btlHits =
track.hitPattern().numberOfValidTimingBTLHits();
2260 const auto etlHits =
track.hitPattern().numberOfValidTimingETLHits();
2265 int LayersAll =
track.hitPattern().stripLayersWithMeasurement();
2266 int Layers2D =
track.hitPattern().numberOfValidStripLayersWithMonoAndStereo();
2267 int Layers1D = LayersAll - Layers2D;
2279 int numRecoTracksSelected,
2280 int numSimTracksSelected)
const {
2284 histograms.nrec_vs_nsim[
count]->Fill(numSimTracksSelected, numRecoTracksSelected);
2298 double qoverpSim = chargeTP /
sqrt(momentumTP.x() * momentumTP.x() + momentumTP.y() * momentumTP.y() +
2299 momentumTP.z() * momentumTP.z());
2300 double lambdaSim =
M_PI / 2 - momentumTP.theta();
2301 double phiSim = momentumTP.phi();
2307 double qoverpRec(0);
2308 double qoverpErrorRec(0);
2310 double ptErrorRec(0);
2311 double lambdaRec(0);
2312 double lambdaErrorRec(0);
2314 double phiErrorRec(0);
2336 getRecoMomentum(
track, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec, lambdaRec, lambdaErrorRec, phiRec, phiErrorRec);
2339 double ptError = ptErrorRec;
2340 double ptres = ptRec -
sqrt(momentumTP.perp2());
2341 double etares =
track.eta() - momentumTP.Eta();
2343 double dxyRec =
track.dxy(bsPosition);
2344 double dzRec =
track.dz(bsPosition);
2346 const auto phiRes = phiRec - phiSim;
2347 const auto dxyRes = dxyRec - dxySim;
2348 const auto dzRes = dzRec - dzSim;
2349 const auto cotThetaRes = 1 /
tan(
M_PI * 0.5 - lambdaRec) - 1 /
tan(
M_PI * 0.5 - lambdaSim);
2352 double qoverpPull = (qoverpRec - qoverpSim) / qoverpErrorRec;
2353 double thetaPull = (lambdaRec - lambdaSim) / lambdaErrorRec;
2354 double phiPull = phiRes / phiErrorRec;
2355 double dxyPull = dxyRes /
track.dxyError();
2356 double dzPull = dzRes /
track.dzError();
2359 double contrib_Qoverp = ((qoverpRec - qoverpSim) / qoverpErrorRec) * ((qoverpRec - qoverpSim) / qoverpErrorRec) / 5;
2360 double contrib_dxy = ((dxyRec - dxySim) /
track.dxyError()) * ((dxyRec - dxySim) /
track.dxyError()) / 5;
2361 double contrib_dz = ((dzRec - dzSim) /
track.dzError()) * ((dzRec - dzSim) /
track.dzError()) / 5;
2362 double contrib_theta = ((lambdaRec - lambdaSim) / lambdaErrorRec) * ((lambdaRec - lambdaSim) / lambdaErrorRec) / 5;
2363 double contrib_phi = ((phiRec - phiSim) / phiErrorRec) * ((phiRec - phiSim) / phiErrorRec) / 5;
2369 <<
"ptREC=" << ptRec <<
"\n"
2370 <<
"etaREC=" <<
track.eta() <<
"\n"
2371 <<
"qoverpREC=" << qoverpRec <<
"\n"
2372 <<
"dxyREC=" << dxyRec <<
"\n"
2373 <<
"dzREC=" << dzRec <<
"\n"
2374 <<
"thetaREC=" <<
track.theta() <<
"\n"
2375 <<
"phiREC=" << phiRec <<
"\n"
2378 <<
"qoverpError()=" << qoverpErrorRec <<
"\n"
2379 <<
"dxyError()=" <<
track.dxyError() <<
"\n"
2380 <<
"dzError()=" <<
track.dzError() <<
"\n"
2381 <<
"thetaError()=" << lambdaErrorRec <<
"\n"
2382 <<
"phiError()=" << phiErrorRec <<
"\n"
2385 <<
"ptSIM=" <<
sqrt(momentumTP.perp2()) <<
"\n"
2386 <<
"etaSIM=" << momentumTP.Eta() <<
"\n"
2387 <<
"qoverpSIM=" << qoverpSim <<
"\n"
2388 <<
"dxySIM=" << dxySim <<
"\n"
2389 <<
"dzSIM=" << dzSim <<
"\n"
2390 <<
"thetaSIM=" <<
M_PI / 2 - lambdaSim <<
"\n"
2391 <<
"phiSIM=" << phiSim <<
"\n"
2394 <<
"contrib_Qoverp=" << contrib_Qoverp <<
"\n"
2395 <<
"contrib_dxy=" << contrib_dxy <<
"\n"
2396 <<
"contrib_dz=" << contrib_dz <<
"\n"
2397 <<
"contrib_theta=" << contrib_theta <<
"\n"
2398 <<
"contrib_phi=" << contrib_phi <<
"\n"
2401 <<
"chi2PULL=" << contrib_Qoverp + contrib_dxy + contrib_dz + contrib_theta + contrib_phi <<
"\n";
2410 const auto etaSim =
getEta(momentumTP.eta());
2411 const auto ptSim =
getPt(
sqrt(momentumTP.perp2()));
2466 double& qoverpError,
2468 double& lambdaError,
2472 ptError =
track.ptError();
2473 qoverp =
track.qoverp();
2474 qoverpError =
track.qoverpError();
2475 lambda =
track.lambda();
2476 lambdaError =
track.lambdaError();
2486 double& qoverpError,
2488 double& lambdaError,
2518 if (
track.seedRef().isNull() || !
track.seedRef().isAvailable())
2525 LogDebug(
"TrackValidator") <<
"Got seed with " <<
nhits <<
" hits, but I have a hard-coded maximum of "
2527 <<
", classifying the seed as 'unknown'. Please increase the maximum in "
2528 "MTVHistoProducerAlgoForTracker.h if needed.";
2536 throw cms::Exception(
"LogicError") <<
"Encountered seed hit detId " << detId.
rawId() <<
" not from Tracker, but "
2541 bool subdetStrip =
false;
2583 return found->second;
2595 int numVertices)
const {
2657 int seedsTotal)
const {
2659 histograms.h_seedsFitFailedFraction[
count]->Fill(static_cast<double>(seedsFitFailed) / seedsTotal);