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_dzpvcut_pt.push_back(ibook.
book1D(
"num_assoc(simToReco)_dzpvcut_pt",
588 "#sump_{T} of associated tracks (simToReco) vs dz(PV)",
595 ibook.
book1D(
"num_simul2_dzpvcut_pt",
596 "#sump_{T} of simulated tracks (associated to any track) from sim PV",
600 histograms.h_assoc_dzpvcut_pt.back()->enableSumw2();
601 histograms.h_simul_dzpvcut_pt.back()->enableSumw2();
602 histograms.h_simul2_dzpvcut_pt.back()->enableSumw2();
604 histograms.h_assoc_dzpvsigcut.push_back(ibook.
book1D(
"num_assoc(simToReco)_dzpvsigcut",
605 "N of associated tracks (simToReco) vs dz(PV)/dzError",
612 ibook.
book1D(
"num_simul2_dzpvsigcut",
613 "N of simulated tracks (associated to any track) from sim PV/dzError",
619 ibook.
book1D(
"num_assoc(simToReco)_dzpvsigcut_pt",
620 "#sump_{T} of associated tracks (simToReco) vs dz(PV)/dzError",
627 ibook.
book1D(
"num_simul2_dzpvsigcut_pt",
628 "#sump_{T} of simulated tracks (associated to any track) from sim PV/dzError",
632 histograms.h_assoc_dzpvsigcut_pt.back()->enableSumw2();
633 histograms.h_simul_dzpvsigcut_pt.back()->enableSumw2();
634 histograms.h_simul2_dzpvsigcut_pt.back()->enableSumw2();
639 bool doResolutionPlots) {
643 histograms.h_charge.push_back(ibook.
book1D(
"charge",
"charge", 3, -1.5, 1.5));
647 histograms.h_nchi2.push_back(ibook.
book1D(
"chi2",
"normalized #chi^{2}", 200, 0, 20));
648 histograms.h_nchi2_prob.push_back(ibook.
book1D(
"chi2_prob",
"normalized #chi^{2} probability", 100, 0, 1));
659 histograms.h_algo.back()->disableAlphanumeric();
668 "num_duplicate_eta",
"N of associated (recoToSim) duplicate tracks vs eta",
nintEta,
minEta,
maxEta));
671 "num_chargemisid_eta",
"N of associated (recoToSim) charge misIDed tracks vs eta",
nintEta,
minEta,
maxEta));
684 histograms.h_misidpT.push_back(make1DIfLogX(ibook,
686 "num_chargemisid_pT",
687 "N of associated (recoToSim) charge misIDed tracks vs pT",
694 histograms.h_recopTvseta.push_back(make2DIfLogY(ibook,
697 "N of reco track in (pT-eta) plane",
704 histograms.h_reco2pTvseta.push_back(make2DIfLogY(ibook,
707 "N of selected reco track in (pT-eta) plane",
714 histograms.h_assoc2pTvseta.push_back(make2DIfLogY(ibook,
716 "num_assoc(recoToSim)_pTvseta",
717 "N of associated (recoToSim) tracks in (pT-eta) plane",
724 histograms.h_looperpTvseta.push_back(make2DIfLogY(ibook,
726 "num_duplicate_pTvseta",
727 "N of associated (recoToSim) duplicate tracks in (pT-eta) plane",
738 "num_chargemisid_pTvseta",
739 "N of associated (recoToSim) charge misIDed tracks in (pT-eta) plane",
746 histograms.h_pileuppTvseta.push_back(make2DIfLogY(ibook,
748 "num_pileup_pTvseta",
749 "N of associated (recoToSim) pileup tracks in (pT-eta) plane",
761 "num_duplicate_hit",
"N of associated (recoToSim) duplicate tracks vs hit",
nintHit,
minHit,
maxHit));
764 "num_chargemisid_hit",
"N of associated (recoToSim) charge misIDed tracks vs hit",
nintHit,
minHit,
maxHit));
776 "N of associated (recoToSim) charge misIDed tracks vs layer",
785 histograms.h_assoc2pixellayer.push_back(ibook.
book1D(
"num_assoc(recoToSim)_pixellayer",
786 "N of associated (recoToSim) tracks vs pixellayer",
790 histograms.h_looperpixellayer.push_back(ibook.
book1D(
"num_duplicate_pixellayer",
791 "N of associated (recoToSim) duplicate tracks vs pixellayer",
797 ibook.
book1D(
"num_chargemisid_pixellayer",
798 "N of associated (recoToSim) charge misIDed tracks vs pixellayer",
802 histograms.h_pileuppixellayer.push_back(ibook.
book1D(
"num_pileup_pixellayer",
803 "N of associated (recoToSim) pileup tracks vs pixellayer",
810 histograms.h_assoc23Dlayer.push_back(ibook.
book1D(
"num_assoc(recoToSim)_3Dlayer",
811 "N of associated (recoToSim) tracks vs 3D layer",
816 "N of associated (recoToSim) duplicate tracks vs 3D layer",
822 "N of associated (recoToSim) charge misIDed tracks vs 3D layer",
832 ibook.
book1D(
"num_assoc(recoToSim)_pu",
"N of associated (recoToSim) tracks vs pu",
nintPu,
minPu,
maxPu));
834 ibook.
book1D(
"num_duplicate_pu",
"N of associated (recoToSim) duplicate tracks vs pu",
nintPu,
minPu,
maxPu));
837 "num_chargemisid_pu",
"N of associated (recoToSim) charge misIDed tracks vs pu",
nintPu,
minPu,
maxPu));
845 "num_duplicate_phi",
"N of associated (recoToSim) duplicate tracks vs phi",
nintPhi,
minPhi,
maxPhi));
848 "num_chargemisid_phi",
"N of associated (recoToSim) charge misIDed tracks vs phi",
nintPhi,
minPhi,
maxPhi));
859 "num_chargemisid_dxy",
"N of associated (recoToSim) charge misIDed tracks vs dxy",
nintDxy,
minDxy,
maxDxy));
865 ibook.
book1D(
"num_assoc(recoToSim)_dz",
"N of associated (recoToSim) tracks vs dz",
nintDz,
minDz,
maxDz));
867 ibook.
book1D(
"num_duplicate_dz",
"N of associated (recoToSim) looper tracks vs dz",
nintDz,
minDz,
maxDz));
870 "num_chargemisid_versus_dz",
"N of associated (recoToSim) charge misIDed tracks vs dz",
nintDz,
minDz,
maxDz));
874 histograms.h_recovertpos.push_back(make1DIfLogX(ibook,
877 "N of reconstructed tracks vs transverse ref point position",
884 "num_assoc(recoToSim)_vertpos",
885 "N of associated (recoToSim) tracks vs transverse ref point position",
892 "num_duplicate_vertpos",
893 "N of associated (recoToSim) looper tracks vs transverse ref point position",
900 "num_pileup_vertpos",
901 "N of associated (recoToSim) pileup tracks vs transverse ref point position",
907 "num_reco_zpos",
"N of reconstructed tracks vs transverse ref point position",
nintZpos,
minZpos,
maxZpos));
909 "N of associated (recoToSim) tracks vs transverse ref point position",
914 ibook.
book1D(
"num_duplicate_zpos",
915 "N of associated (recoToSim) looper tracks vs transverse ref point position",
920 ibook.
book1D(
"num_pileup_zpos",
921 "N of associated (recoToSim) pileup tracks vs transverse ref point position",
927 make1DIfLogX(ibook,
true,
"num_reco_dr",
"N of reconstructed tracks vs dR",
nintdr, log10(
mindr), log10(
maxdr)));
928 histograms.h_assoc2dr.push_back(make1DIfLogX(ibook,
930 "num_assoc(recoToSim)_dr",
931 "N of associated tracks (recoToSim) vs dR",
935 histograms.h_looperdr.push_back(make1DIfLogX(ibook,
938 "N of associated (recoToSim) looper tracks vs dR",
942 histograms.h_pileupdr.push_back(make1DIfLogX(ibook,
945 "N of associated (recoToSim) pileup tracks vs dR",
951 ibook,
true,
"num_reco_drj",
"N of reconstructed tracks vs dR(track,jet)",
nintdrj, log10(
mindrj), log10(
maxdrj)));
952 histograms.h_assoc2drj.push_back(make1DIfLogX(ibook,
954 "num_assoc(recoToSim)_drj",
955 "N of associated tracks (recoToSim) vs dR(track,jet)",
959 histograms.h_looperdrj.push_back(make1DIfLogX(ibook,
962 "N of associated (recoToSim) looper tracks vs dR(track,jet)",
966 histograms.h_pileupdrj.push_back(make1DIfLogX(ibook,
969 "N of associated (recoToSim) pileup tracks vs dR(track,jet)",
977 "num_assoc(recoToSim)_simpvz",
"N of associated tracks (recoToSim) vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
979 "num_duplicate_simpvz",
"N of associated (recoToSim) looper tracks vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
981 "num_pileup_simpvz",
"N of associated (recoToSim) pileup tracks vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
986 "N of associated (recoToSim) tracks vs normalized #chi^{2}",
991 "N of associated (recoToSim) looper tracks vs normalized #chi^{2}",
997 ibook.
book1D(
"num_chargemisid_chi2",
998 "N of associated (recoToSim) charge misIDed tracks vs normalized #chi^{2}",
1003 "N of associated (recoToSim) pileup tracks vs normalized #chi^{2}",
1009 ibook.
book1D(
"num_reco_chi2prob",
"N of reco track vs normalized #chi^{2}", 100, 0., 1.));
1011 "num_assoc(recoToSim)_chi2prob",
"N of associated (recoToSim) tracks vs normalized #chi^{2}", 100, 0., 1.));
1013 "num_duplicate_chi2prob",
"N of associated (recoToSim) looper tracks vs normalized #chi^{2}", 100, 0., 1.));
1016 ibook.
book1D(
"num_chargemisid_chi2prob",
1017 "N of associated (recoToSim) charge misIDed tracks vs normalized #chi^{2}",
1022 "num_pileup_chi2prob",
"N of associated (recoToSim) pileup tracks vs normalized #chi^{2}", 100, 0., 1.));
1027 ibook.
book1D(
"num_reco_seedingLayerSet",
"N of reco track vs. seedingLayerSet",
size, 0,
size));
1028 histograms.h_assoc2_seedingLayerSet.push_back(
1029 ibook.
book1D(
"num_assoc(recoToSim)_seedingLayerSet",
1030 "N of associated track (recoToSim) tracks vs. seedingLayerSet",
1035 "num_duplicate_seedingLayerSet",
"N of reco associated (recoToSim) looper vs. seedingLayerSet",
size, 0,
size));
1037 "num_pileup_seedingLayerSet",
"N of reco associated (recoToSim) pileup vs. seedingLayerSet",
size, 0,
size));
1047 auto bookResolutionPlots1D = [&](std::vector<dqm::reco::MonitorElement*>& vec,
auto&&...
params) {
1048 vec.push_back(doResolutionPlots ? ibook.
book1D(std::forward<decltype(
params)>(
params)...) :
nullptr);
1050 auto bookResolutionPlots2D = [&](std::vector<dqm::reco::MonitorElement*>& vec,
bool logx,
auto&&...
params) {
1051 vec.push_back(doResolutionPlots ? make2DIfLogX(ibook, logx, std::forward<decltype(
params)>(
params)...) :
nullptr);
1053 auto bookResolutionPlotsProfile2D = [&](std::vector<dqm::reco::MonitorElement*>& vec,
auto&&...
params) {
1057 bookResolutionPlots1D(
histograms.h_eta,
"eta",
"pseudorapidity residue", 1000, -0.1, 0.1);
1058 bookResolutionPlots1D(
histograms.h_pt,
"pullPt",
"pull of p_{t}", 100, -10, 10);
1059 bookResolutionPlots1D(
histograms.h_pullTheta,
"pullTheta",
"pull of #theta parameter", 250, -25, 25);
1060 bookResolutionPlots1D(
histograms.h_pullPhi,
"pullPhi",
"pull of #phi parameter", 250, -25, 25);
1061 bookResolutionPlots1D(
histograms.h_pullDxy,
"pullDxy",
"pull of dxy parameter", 250, -25, 25);
1062 bookResolutionPlots1D(
histograms.h_pullDz,
"pullDz",
"pull of dz parameter", 250, -25, 25);
1063 bookResolutionPlots1D(
histograms.h_pullQoverp,
"pullQoverp",
"pull of qoverp parameter", 250, -25, 25);
1074 histograms.h_assocFraction.push_back(ibook.
book1D(
"assocFraction",
"fraction of shared hits", 200, 0, 2));
1075 histograms.h_assocSharedHit.push_back(ibook.
book1D(
"assocSharedHit",
"number of shared hits", 41, -0.5, 40.5));
1082 bookResolutionPlots2D(
1084 bookResolutionPlots2D(
1088 "Number of selected reco tracks vs. number of selected sim tracks;TrackingParticles;Reco tracks",
1102 histograms.chi2_vs_drj.push_back(makeProfileIfLogX(
1103 ibook,
true,
"chi2mean_vs_drj",
"mean #chi^{2} vs dR(track,jet)",
nintdrj, log10(
mindrj), log10(
maxdrj), 0, 20));
1108 "assoc_chi2prob_vs_eta",
"mean #chi^{2} probability vs #eta",
nintEta,
minEta,
maxEta, 100, 0., 1.,
" "));
1109 histograms.assoc_chi2_vs_pt.push_back(makeProfileIfLogX(
1111 histograms.assoc_chi2prob_vs_pt.push_back(makeProfileIfLogX(
1113 histograms.assoc_chi2_vs_drj.push_back(makeProfileIfLogX(ibook,
1115 "assoc_chi2mean_vs_drj",
1116 "mean #chi^{2} vs dR(track,jet)",
1122 histograms.assoc_chi2prob_vs_drj.push_back(makeProfileIfLogX(ibook,
1124 "assoc_chi2prob_vs_drj",
1125 "mean #chi^{2} probability vs dR(track,jet)",
1152 "mean # Layers with measurement vs eta",
1161 "mean # PXL Layers with measurement vs eta",
1170 "mean # STRIP Layers with measurement vs eta",
1178 histograms.nSTRIPlayersWith1dMeas_vs_eta.push_back(ibook.
bookProfile(
"STRIPlayersWith1dMeas_vs_eta",
1179 "mean # STRIP Layers with 1D measurement vs eta",
1187 histograms.nSTRIPlayersWith2dMeas_vs_eta.push_back(ibook.
bookProfile(
"STRIPlayersWith2dMeas_vs_eta",
1188 "mean # STRIP Layers with 2D measurement vs eta",
1220 bookResolutionPlots2D(
histograms.ptres_vs_eta,
1231 bookResolutionPlots2D(
histograms.ptres_vs_phi,
1234 "p_{t} res vs #phi",
1242 bookResolutionPlots2D(
histograms.ptres_vs_pt,
1253 bookResolutionPlots2D(
histograms.cotThetares_vs_eta,
1255 "cotThetares_vs_eta",
1256 "cotThetares_vs_eta",
1264 bookResolutionPlots2D(
histograms.cotThetares_vs_pt,
1266 "cotThetares_vs_pt",
1267 "cotThetares_vs_pt",
1275 bookResolutionPlots2D(
histograms.phires_vs_eta,
1286 bookResolutionPlots2D(
histograms.phires_vs_pt,
1297 bookResolutionPlots2D(
histograms.phires_vs_phi,
1308 bookResolutionPlots2D(
histograms.dxyres_vs_eta,
1319 bookResolutionPlots2D(
histograms.dxyres_vs_pt,
1330 bookResolutionPlots2D(
histograms.dxyres_vs_phi,
1341 bookResolutionPlots2D(
histograms.dzres_vs_eta,
1352 bookResolutionPlots2D(
histograms.dzres_vs_pt,
1363 bookResolutionPlots2D(
histograms.dzres_vs_phi,
1374 bookResolutionPlotsProfile2D(
histograms.ptmean_vs_eta_phi,
1375 "ptmean_vs_eta_phi",
1376 "mean p_{t} vs #eta and #phi",
1386 bookResolutionPlotsProfile2D(
histograms.phimean_vs_eta_phi,
1387 "phimean_vs_eta_phi",
1388 "mean #phi vs #eta and #phi",
1400 bookResolutionPlots2D(
1402 bookResolutionPlots2D(
1404 bookResolutionPlots2D(
1406 bookResolutionPlots2D(
1408 bookResolutionPlots2D(
1410 bookResolutionPlots2D(
1412 bookResolutionPlots2D(
1414 bookResolutionPlots2D(
1416 bookResolutionPlots2D(
1418 bookResolutionPlots2D(
1424 bookResolutionPlots2D(
1426 bookResolutionPlots2D(
1428 bookResolutionPlots2D(
histograms.thetapull_vs_phi,
1431 "#theta pull vs #phi",
1439 bookResolutionPlots2D(
histograms.nrecHit_vs_nsimHit_rec2sim,
1441 "nrecHit_vs_nsimHit_rec2sim",
1442 "nrecHit vs nsimHit (Rec2simAssoc)",
1455 "num_assoc(recoToSim)_dxypv",
"N of associated (recoToSim) tracks vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
1457 "num_duplicate_dxypv",
"N of associated (recoToSim) looper tracks vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
1460 "N of associated (recoToSim) charge misIDed tracks vs dxy(PV)",
1465 "num_pileup_dxypv",
"N of associated (recoToSim) pileup tracks vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
1469 ibook.
book1D(
"num_assoc(recoToSim)_dzpv",
"N of associated (recoToSim) tracks vs dz(PV)",
nintDz,
minDz,
maxDz));
1471 ibook.
book1D(
"num_duplicate_dzpv",
"N of associated (recoToSim) looper tracks vs dz(PV)",
nintDz,
minDz,
maxDz));
1473 histograms.h_misiddzpv.push_back(ibook.
book1D(
"num_chargemisid_versus_dzpv",
1474 "N of associated (recoToSim) charge misIDed tracks vs dz(PV)",
1479 ibook.
book1D(
"num_pileup_dzpv",
"N of associated (recoToSim) pileup tracks vs dz(PV)",
nintDz,
minDz,
maxDz));
1483 histograms.h_assoc2dxypvzoomed.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dxypv_zoomed",
1484 "N of associated (recoToSim) tracks vs dxy(PV)",
1488 histograms.h_looperdxypvzoomed.push_back(ibook.
book1D(
"num_duplicate_dxypv_zoomed",
1489 "N of associated (recoToSim) looper tracks vs dxy(PV)",
1494 histograms.h_misiddxypvzoomed.push_back(ibook.
book1D(
"num_chargemisid_dxypv_zoomed",
1495 "N of associated (recoToSim) charge misIDed tracks vs dxy(PV)",
1499 histograms.h_pileupdxypvzoomed.push_back(ibook.
book1D(
"num_pileup_dxypv_zoomed",
1500 "N of associated (recoToSim) pileup tracks vs dxy(PV)",
1507 histograms.h_assoc2dzpvzoomed.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dzpv_zoomed",
1508 "N of associated (recoToSim) tracks vs dz(PV)",
1512 histograms.h_looperdzpvzoomed.push_back(ibook.
book1D(
"num_duplicate_dzpv_zoomed",
1513 "N of associated (recoToSim) looper tracks vs dz(PV)",
1518 histograms.h_misiddzpvzoomed.push_back(ibook.
book1D(
"num_chargemisid_versus_dzpv_zoomed",
1519 "N of associated (recoToSim) charge misIDed tracks vs dz(PV)",
1523 histograms.h_pileupdzpvzoomed.push_back(ibook.
book1D(
"num_pileup_dzpv_zoomed",
1524 "N of associated (recoToSim) pileup tracks vs dz(PV)",
1532 "num_assoc(recoToSim)_dzpvcut",
"N of associated (recoToSim) tracks vs dz(PV)",
nintDzpvCum, 0,
maxDzpvCum));
1534 "num_pileup_dzpvcut",
"N of associated (recoToSim) pileup tracks vs dz(PV)",
nintDzpvCum, 0,
maxDzpvCum));
1538 histograms.h_assoc2_dzpvcut_pt.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dzpvcut_pt",
1539 "#sump_{T} of associated (recoToSim) tracks vs dz(PV)",
1543 histograms.h_pileup_dzpvcut_pt.push_back(ibook.
book1D(
"num_pileup_dzpvcut_pt",
1544 "#sump_{T} of associated (recoToSim) pileup tracks vs dz(PV)",
1548 histograms.h_reco_dzpvcut_pt.back()->enableSumw2();
1549 histograms.h_assoc2_dzpvcut_pt.back()->enableSumw2();
1550 histograms.h_pileup_dzpvcut_pt.back()->enableSumw2();
1554 histograms.h_assoc2_dzpvsigcut.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dzpvsigcut",
1555 "N of associated (recoToSim) tracks vs dz(PV)/dzError",
1559 histograms.h_pileup_dzpvsigcut.push_back(ibook.
book1D(
"num_pileup_dzpvsigcut",
1560 "N of associated (recoToSim) pileup tracks vs dz(PV)/dzError",
1568 ibook.
book1D(
"num_assoc(recoToSim)_dzpvsigcut_pt",
1569 "#sump_{T} of associated (recoToSim) tracks vs dz(PV)/dzError",
1574 ibook.
book1D(
"num_pileup_dzpvsigcut_pt",
1575 "#sump_{T} of associated (recoToSim) pileup tracks vs dz(PV)/dzError",
1579 histograms.h_reco_dzpvsigcut_pt.back()->enableSumw2();
1580 histograms.h_assoc2_dzpvsigcut_pt.back()->enableSumw2();
1581 histograms.h_pileup_dzpvsigcut_pt.back()->enableSumw2();
1608 histograms.h_seedsFitFailedFraction.push_back(
1609 ibook.
book1D(
"seeds_fitFailedFraction",
"Fraction of seeds for which the fit failed", 100, 0, 1));
1626 histograms.h_assoc2_mvacut_hp.emplace_back();
1627 histograms.h_simul2_mvacut_hp.emplace_back();
1629 histograms.h_assoc2_mva_vs_pt.emplace_back();
1631 histograms.h_assoc2_mva_vs_pt_hp.emplace_back();
1632 histograms.h_fake_mva_vs_pt_hp.emplace_back();
1633 histograms.h_assoc2_mva_vs_eta.emplace_back();
1635 histograms.h_assoc2_mva_vs_eta_hp.emplace_back();
1636 histograms.h_fake_mva_vs_eta_hp.emplace_back();
1638 for (
size_t i = 1;
i <= nMVAs; ++
i) {
1639 auto istr = std::to_string(
i);
1643 histograms.h_reco_mva_hp.back().emplace_back();
1644 histograms.h_assoc2_mva_hp.back().emplace_back();
1646 histograms.h_reco_mvacut_hp.back().emplace_back();
1647 histograms.h_assoc_mvacut_hp.back().emplace_back();
1648 histograms.h_assoc2_mvacut_hp.back().emplace_back();
1649 histograms.h_simul2_mvacut_hp.back().emplace_back();
1651 histograms.h_assoc2_mva_vs_pt_hp.back().emplace_back();
1652 histograms.h_fake_mva_vs_pt_hp.back().emplace_back();
1653 histograms.h_assoc2_mva_vs_eta_hp.back().emplace_back();
1654 histograms.h_fake_mva_vs_eta_hp.back().emplace_back();
1656 pfix =
" (not loose-selected)";
1660 "num_reco_mva" + istr +
"_hp",
"N of reco track after vs MVA" + istr + pfix2,
nintMVA,
minMVA,
maxMVA));
1662 ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr +
"_hp",
1663 "N of associated tracks (recoToSim) vs MVA" + istr + pfix2,
1668 histograms.h_reco_mvacut_hp.back().push_back(ibook.
book1D(
"num_reco_mva" + istr +
"cut" +
"_hp",
1669 "N of reco track vs cut on MVA" + istr + pfix2,
1673 histograms.h_assoc_mvacut_hp.back().push_back(
1674 ibook.
book1D(
"num_assoc(simToReco)_mva" + istr +
"cut_hp",
1675 "N of associated tracks (simToReco) vs cut on MVA" + istr + pfix2,
1679 histograms.h_assoc2_mvacut_hp.back().push_back(
1680 ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr +
"cut_hp",
1681 "N of associated tracks (recoToSim) vs cut on MVA" + istr + pfix2,
1685 histograms.h_simul2_mvacut_hp.back().push_back(
1686 ibook.
book1D(
"num_simul2_mva" + istr +
"cut_hp",
1687 "N of simulated tracks (associated to any track) vs cut on MVA" + istr + pfix2,
1692 histograms.h_assoc2_mva_vs_pt_hp.back().push_back(
1693 makeProfileIfLogX(ibook,
1695 (
"mva_assoc(recoToSim)_mva" + istr +
"_pT_hp").c_str(),
1696 (
"MVA" + istr +
" of associated tracks (recoToSim) vs. track p_{T}" + pfix2).c_str(),
1702 histograms.h_fake_mva_vs_pt_hp.back().push_back(
1703 makeProfileIfLogX(ibook,
1705 (
"mva_fake_mva" + istr +
"pT_hp").c_str(),
1706 (
"MVA" + istr +
" of non-associated tracks (recoToSim) vs. track p_{T}" + pfix2).c_str(),
1712 histograms.h_assoc2_mva_vs_eta_hp.back().push_back(
1713 ibook.
bookProfile(
"mva_assoc(recoToSim)_mva" + istr +
"_eta_hp",
1714 "MVA" + istr +
" of associated tracks (recoToSim) vs. track #eta" + pfix2,
1721 histograms.h_fake_mva_vs_eta_hp.back().push_back(
1722 ibook.
bookProfile(
"mva_fake_mva" + istr +
"eta_hp",
1723 "MVA" + istr +
" of non-associated tracks (recoToSim) vs. track #eta" + pfix2,
1734 histograms.h_assoc2_mva.back().push_back(ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr,
1735 "N of associated tracks (recoToSim) vs MVA" + istr + pfix,
1741 "num_reco_mva" + istr +
"cut",
"N of reco track vs cut on MVA" + istr + pfix,
nintMVA,
minMVA,
maxMVA));
1743 ibook.
book1D(
"num_assoc(simToReco)_mva" + istr +
"cut",
1744 "N of associated tracks (simToReco) vs cut on MVA" + istr + pfix,
1749 ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr +
"cut",
1750 "N of associated tracks (recoToSim) vs cut on MVA" + istr + pfix,
1755 ibook.
book1D(
"num_simul2_mva" + istr +
"cut",
1756 "N of simulated tracks (associated to any track) vs cut on MVA" + istr + pfix,
1761 histograms.h_assoc2_mva_vs_pt.back().push_back(
1762 makeProfileIfLogX(ibook,
1764 (
"mva_assoc(recoToSim)_mva" + istr +
"_pT").c_str(),
1765 (
"MVA" + istr +
" of associated tracks (recoToSim) vs. track p_{T}" + pfix).c_str(),
1771 histograms.h_fake_mva_vs_pt.back().push_back(
1772 makeProfileIfLogX(ibook,
1774 (
"mva_fake_mva" + istr +
"_pT").c_str(),
1775 (
"MVA" + istr +
" of non-associated tracks (recoToSim) vs. track p_{T}" + pfix).c_str(),
1781 histograms.h_assoc2_mva_vs_eta.back().push_back(
1782 ibook.
bookProfile(
"mva_assoc(recoToSim)_mva" + istr +
"_eta",
1783 "MVA" + istr +
" of associated tracks (recoToSim) vs. track #eta" + pfix,
1790 histograms.h_fake_mva_vs_eta.back().push_back(
1792 "MVA" + istr +
" of non-associated tracks (recoToSim) vs. track #eta" + pfix,
1827 int nSimPixelLayers,
1828 int nSimStripMonoAndStereoLayers,
1836 const std::vector<float>& mvas,
1837 unsigned int selectsLoose,
1838 unsigned int selectsHP)
const {
1840 const auto eta =
getEta(momentumTP.eta());
1841 const auto phi = momentumTP.phi();
1843 const auto nSim3DLayers = nSimPixelLayers + nSimStripMonoAndStereoLayers;
1845 const auto vertexTPwrtBS = vertexTP - bsPosition;
1846 const auto vertxy =
std::sqrt(vertexTPwrtBS.perp2());
1847 const auto vertz = vertexTPwrtBS.z();
1855 for (
size_t i = 0;
i < mvas.size(); ++
i) {
1856 if (
i <= selectsLoose) {
1860 if (
i >= 1 &&
i <= selectsHP) {
1956 const double dzpvsigcut = dzpvcut /
track->dzError();
1963 if (simPVPosition) {
1964 const auto simpvz = simPVPosition->z();
1990 for (
unsigned int i = 0;
i < v_dEdx.size();
i++) {
2008 bool isChargeMatched,
2009 int numAssocRecoTracks,
2012 double sharedFraction,
2015 const std::vector<float>& mvas,
2016 unsigned int selectsLoose,
2017 unsigned int selectsHP)
const {
2024 const auto phi =
track.momentum().phi();
2026 const auto dxy =
track.dxy(bsPosition);
2027 const auto dz =
track.dz(bsPosition);
2028 const auto dxypv = pvPosition ?
track.dxy(*pvPosition) : 0.0;
2029 const auto dzpv = pvPosition ?
track.dz(*pvPosition) : 0.0;
2030 const auto dzpvsig = pvPosition ? dzpv /
track.dzError() : 0.0;
2032 const auto nlayers =
track.hitPattern().trackerLayersWithMeasurement();
2033 const auto nPixelLayers =
track.hitPattern().pixelLayersWithMeasurement();
2034 const auto n3DLayers = nPixelLayers +
track.hitPattern().numberOfValidStripLayersWithMonoAndStereo();
2035 const auto refPointWrtBS =
track.referencePoint() - bsPosition;
2036 const auto vertxy =
std::sqrt(refPointWrtBS.perp2());
2037 const auto vertz = refPointWrtBS.z();
2038 const auto chi2 =
track.normalizedChi2();
2039 const auto chi2prob = TMath::Prob(
track.chi2(), (
int)
track.ndof());
2042 const auto simpvz = simPVPosition ? simPVPosition->z() : 0.0;
2061 if (fillSeedingLayerSets)
2074 if (simPVPosition) {
2094 if (!mvas.empty()) {
2124 if (dRJet <= 99999) {
2132 if (fillSeedingLayerSets)
2145 if (simPVPosition) {
2154 if (!mvas.empty()) {
2211 if (numAssocRecoTracks > 1) {
2225 if (fillSeedingLayerSets)
2233 if (simPVPosition) {
2243 if (!isSigMatched) {
2257 if (fillSeedingLayerSets)
2270 if (simPVPosition) {
2281 if (!mvas.empty()) {
2322 const auto pxbHits =
track.hitPattern().numberOfValidPixelBarrelHits();
2323 const auto pxfHits =
track.hitPattern().numberOfValidPixelEndcapHits();
2324 const auto tibHits =
track.hitPattern().numberOfValidStripTIBHits();
2325 const auto tidHits =
track.hitPattern().numberOfValidStripTIDHits();
2326 const auto tobHits =
track.hitPattern().numberOfValidStripTOBHits();
2327 const auto tecHits =
track.hitPattern().numberOfValidStripTECHits();
2335 histograms.nSTRIPhits_vs_eta[
count]->Fill(
eta, tibHits + tidHits + tobHits + tecHits);
2340 const auto btlHits =
track.hitPattern().numberOfValidTimingBTLHits();
2341 const auto etlHits =
track.hitPattern().numberOfValidTimingETLHits();
2346 int LayersAll =
track.hitPattern().stripLayersWithMeasurement();
2347 int Layers2D =
track.hitPattern().numberOfValidStripLayersWithMonoAndStereo();
2348 int Layers1D = LayersAll - Layers2D;
2360 int numRecoTracksSelected,
2361 int numSimTracksSelected)
const {
2365 histograms.nrec_vs_nsim[
count]->Fill(numSimTracksSelected, numRecoTracksSelected);
2379 double qoverpSim = chargeTP /
sqrt(momentumTP.x() * momentumTP.x() + momentumTP.y() * momentumTP.y() +
2380 momentumTP.z() * momentumTP.z());
2381 double lambdaSim =
M_PI / 2 - momentumTP.theta();
2382 double phiSim = momentumTP.phi();
2388 double qoverpRec(0);
2389 double qoverpErrorRec(0);
2391 double ptErrorRec(0);
2392 double lambdaRec(0);
2393 double lambdaErrorRec(0);
2395 double phiErrorRec(0);
2417 getRecoMomentum(
track, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec, lambdaRec, lambdaErrorRec, phiRec, phiErrorRec);
2420 double ptError = ptErrorRec;
2421 double ptres = ptRec -
sqrt(momentumTP.perp2());
2422 double etares =
track.eta() - momentumTP.Eta();
2424 double dxyRec =
track.dxy(bsPosition);
2425 double dzRec =
track.dz(bsPosition);
2427 const auto phiRes = phiRec - phiSim;
2428 const auto dxyRes = dxyRec - dxySim;
2429 const auto dzRes = dzRec - dzSim;
2430 const auto cotThetaRes = 1 /
tan(
M_PI * 0.5 - lambdaRec) - 1 /
tan(
M_PI * 0.5 - lambdaSim);
2433 double qoverpPull = (qoverpRec - qoverpSim) / qoverpErrorRec;
2434 double thetaPull = (lambdaRec - lambdaSim) / lambdaErrorRec;
2435 double phiPull = phiRes / phiErrorRec;
2436 double dxyPull = dxyRes /
track.dxyError();
2437 double dzPull = dzRes /
track.dzError();
2440 double contrib_Qoverp = ((qoverpRec - qoverpSim) / qoverpErrorRec) * ((qoverpRec - qoverpSim) / qoverpErrorRec) / 5;
2441 double contrib_dxy = ((dxyRec - dxySim) /
track.dxyError()) * ((dxyRec - dxySim) /
track.dxyError()) / 5;
2442 double contrib_dz = ((dzRec - dzSim) /
track.dzError()) * ((dzRec - dzSim) /
track.dzError()) / 5;
2443 double contrib_theta = ((lambdaRec - lambdaSim) / lambdaErrorRec) * ((lambdaRec - lambdaSim) / lambdaErrorRec) / 5;
2444 double contrib_phi = ((phiRec - phiSim) / phiErrorRec) * ((phiRec - phiSim) / phiErrorRec) / 5;
2450 <<
"ptREC=" << ptRec <<
"\n"
2451 <<
"etaREC=" <<
track.eta() <<
"\n"
2452 <<
"qoverpREC=" << qoverpRec <<
"\n"
2453 <<
"dxyREC=" << dxyRec <<
"\n"
2454 <<
"dzREC=" << dzRec <<
"\n"
2455 <<
"thetaREC=" <<
track.theta() <<
"\n"
2456 <<
"phiREC=" << phiRec <<
"\n"
2459 <<
"qoverpError()=" << qoverpErrorRec <<
"\n"
2460 <<
"dxyError()=" <<
track.dxyError() <<
"\n"
2461 <<
"dzError()=" <<
track.dzError() <<
"\n"
2462 <<
"thetaError()=" << lambdaErrorRec <<
"\n"
2463 <<
"phiError()=" << phiErrorRec <<
"\n"
2466 <<
"ptSIM=" <<
sqrt(momentumTP.perp2()) <<
"\n"
2467 <<
"etaSIM=" << momentumTP.Eta() <<
"\n"
2468 <<
"qoverpSIM=" << qoverpSim <<
"\n"
2469 <<
"dxySIM=" << dxySim <<
"\n"
2470 <<
"dzSIM=" << dzSim <<
"\n"
2471 <<
"thetaSIM=" <<
M_PI / 2 - lambdaSim <<
"\n"
2472 <<
"phiSIM=" << phiSim <<
"\n"
2475 <<
"contrib_Qoverp=" << contrib_Qoverp <<
"\n"
2476 <<
"contrib_dxy=" << contrib_dxy <<
"\n"
2477 <<
"contrib_dz=" << contrib_dz <<
"\n"
2478 <<
"contrib_theta=" << contrib_theta <<
"\n"
2479 <<
"contrib_phi=" << contrib_phi <<
"\n"
2482 <<
"chi2PULL=" << contrib_Qoverp + contrib_dxy + contrib_dz + contrib_theta + contrib_phi <<
"\n";
2491 const auto etaSim =
getEta(momentumTP.eta());
2492 const auto ptSim =
getPt(
sqrt(momentumTP.perp2()));
2547 double& qoverpError,
2549 double& lambdaError,
2553 ptError =
track.ptError();
2554 qoverp =
track.qoverp();
2555 qoverpError =
track.qoverpError();
2556 lambda =
track.lambda();
2557 lambdaError =
track.lambdaError();
2567 double& qoverpError,
2569 double& lambdaError,
2599 if (
track.seedRef().isNull() || !
track.seedRef().isAvailable())
2606 LogDebug(
"TrackValidator") <<
"Got seed with " <<
nhits <<
" hits, but I have a hard-coded maximum of "
2608 <<
", classifying the seed as 'unknown'. Please increase the maximum in "
2609 "MTVHistoProducerAlgoForTracker.h if needed.";
2617 throw cms::Exception(
"LogicError") <<
"Encountered seed hit detId " << detId.
rawId() <<
" not from Tracker, but "
2622 bool subdetStrip =
false;
2664 return found->second;
2676 int numVertices)
const {
2738 int seedsTotal)
const {
2740 histograms.h_seedsFitFailedFraction[
count]->Fill(static_cast<double>(seedsFitFailed) / seedsTotal);