20 void BinLogX(TH1*
h) {
21 TAxis* axis =
h->GetXaxis();
22 int bins = axis->GetNbins();
24 float from = axis->GetXmin();
25 float to = axis->GetXmax();
27 std::vector<float> new_bins(
bins + 1, 0);
29 for (
int i = 0;
i <=
bins;
i++) {
30 new_bins[
i] = TMath::Power(10, from +
i *
width);
32 axis->Set(
bins, new_bins.data());
35 void BinLogY(TH1*
h) {
36 TAxis* axis =
h->GetYaxis();
37 int bins = axis->GetNbins();
39 float from = axis->GetXmin();
40 float to = axis->GetXmax();
42 std::vector<float> new_bins(
bins + 1, 0);
44 for (
int i = 0;
i <=
bins;
i++) {
45 new_bins[
i] = TMath::Power(10, from +
i *
width);
47 axis->Set(
bins, new_bins.data());
50 template <
typename...
Args>
52 auto h = std::make_unique<TH1F>(std::forward<Args>(
args)...);
55 const auto&
name =
h->GetName();
56 return ibook.book1D(
name,
h.release());
59 template <
typename...
Args>
61 auto h = std::make_unique<TProfile>(std::forward<Args>(
args)...);
64 const auto&
name =
h->GetName();
65 return ibook.bookProfile(
name,
h.release());
68 template <
typename...
Args>
70 auto h = std::make_unique<TH2F>(std::forward<Args>(
args)...);
73 const auto&
name =
h->GetName();
74 return ibook.book2D(
name,
h.release());
77 template <
typename...
Args>
79 auto h = std::make_unique<TH2F>(std::forward<Args>(
args)...);
82 const auto&
name =
h->GetName();
83 return ibook.book2D(
name,
h.release());
87 for (
size_t i = 0;
i <
labels.size(); ++
i) {
90 h->disableAlphanumeric();
97 h->disableAlphanumeric();
100 void fillMVAHistos(
const std::vector<dqm::reco::MonitorElement*>& h_mva,
101 const std::vector<dqm::reco::MonitorElement*>& h_mvacut,
102 const std::vector<dqm::reco::MonitorElement*>& h_mva_hp,
103 const std::vector<dqm::reco::MonitorElement*>& h_mvacut_hp,
104 const std::vector<float>& mvas,
105 unsigned int selectsLoose,
106 unsigned int selectsHP) {
109 for (
size_t i = 0;
i < mvas.size(); ++
i) {
110 if (
i <= selectsLoose) {
111 h_mva[
i]->Fill(mvas[
i]);
112 h_mvacut[
i]->Fill(mvas[
i]);
114 if (
i >= 1 &&
i <= selectsHP) {
115 h_mva_hp[
i]->Fill(mvas[
i]);
116 h_mvacut_hp[
i]->Fill(mvas[
i]);
121 void fillMVAHistos(
double xval,
122 const std::vector<dqm::reco::MonitorElement*>& h_mva,
123 const std::vector<dqm::reco::MonitorElement*>& h_mva_hp,
124 const std::vector<float>& mvas,
125 unsigned int selectsLoose,
126 unsigned int selectsHP) {
129 for (
size_t i = 0;
i < mvas.size(); ++
i) {
130 if (
i <= selectsLoose) {
131 h_mva[
i]->Fill(xval, mvas[
i]);
133 if (
i >= 1 &&
i <= selectsHP) {
134 h_mva_hp[
i]->Fill(xval, mvas[
i]);
149 minPt =
pset.getParameter<
double>(
"minPt");
150 maxPt =
pset.getParameter<
double>(
"maxPt");
153 useLogPt =
pset.getUntrackedParameter<
bool>(
"useLogPt",
false);
161 minPu =
pset.getParameter<
double>(
"minPu");
162 maxPu =
pset.getParameter<
double>(
"maxPu");
181 minDz =
pset.getParameter<
double>(
"minDz");
182 maxDz =
pset.getParameter<
double>(
"maxDz");
199 mindr =
pset.getParameter<
double>(
"mindr");
200 maxdr =
pset.getParameter<
double>(
"maxdr");
268 auto initTPselector = [&](
auto&
sel,
auto&
name) {
269 sel = std::make_unique<TrackingParticleSelector>(
272 auto initTrackSelector = [&](
auto&
sel,
auto&
name) {
275 auto initGPselector = [&](
auto&
sel,
auto&
name) {
276 sel = std::make_unique<GenParticleCustomSelector>(
301 std::vector<std::pair<SeedingLayerSetId, std::string>> stripPairSets;
304 for (
size_t i = 0;
i < layerSets.size(); ++
i) {
305 const auto& layerSet = layerSets[
i];
310 <<
". Please increase the maximum in MTVHistoProducerAlgoForTracker.h";
313 for (
size_t j = 0;
j < layerSet.size(); ++
j) {
318 bool isStripMono = !layerSet[
j].empty() && layerSet[
j][0] ==
'M';
322 if (layerSet.size() == 3 &&
isTrackerStrip(std::get<GeomDetEnumerators::SubDetector>(std::get<0>(setId[0])))) {
324 pairId[0] = setId[0];
325 pairId[1] = setId[1];
326 stripPairSets.emplace_back(pairId, layerSet[0] +
"+" + layerSet[1]);
330 if (!inserted.second)
332 <<
" is specified twice, while the set list should be unique.";
336 for (
const auto& setIdName : stripPairSets) {
352 <<
"minPt = " <<
minPt <<
" <= 0 out of range while requesting log scale. Using minPt = 0.1.";
362 <<
"minVertpos = " <<
minVertpos <<
" <= 0 out of range while requesting log scale. Using minVertpos = 0.1.";
384 psetTrack.
addParameter(
"quality", std::vector<std::string>{});
385 psetTrack.
addParameter(
"algorithm", std::vector<std::string>{});
386 psetTrack.
addParameter(
"originalAlgorithm", std::vector<std::string>{});
387 psetTrack.
addParameter(
"algorithmMaskContains", std::vector<std::string>{});
391 return std::make_unique<RecoTrackSelectorBase>(psetTrack);
402 histograms.h_bunchxSIM = ibook.
book1D(
"bunchxSIM",
"bunch crossing", 21, -15.5, 5.5);
407 bool doResolutionPlots) {
418 histograms.h_assocpTvseta.push_back(make2DIfLogY(ibook,
420 "num_assoc(simToReco)_pTvseta",
421 "N of associated tracks (simToReco) in (pT-eta) please",
428 histograms.h_simulpTvseta.push_back(make2DIfLogY(ibook,
431 "N of simulated tracks in (pT-eta) plane",
449 histograms.h_assocpixellayer.push_back(ibook.
book1D(
"num_assoc(simToReco)_pixellayer",
450 "N of associated tracks (simToReco) vs pixel layer",
457 histograms.h_assoc3Dlayer.push_back(ibook.
book1D(
"num_assoc(simToReco)_3Dlayer",
458 "N of associated tracks (simToReco) vs 3D layer",
466 ibook.
book1D(
"num_assoc(simToReco)_pu",
"N of associated tracks (simToReco) vs pu",
nintPu,
minPu,
maxPu));
480 ibook.
book1D(
"num_assoc(simToReco)_dz",
"N of associated tracks (simToReco) vs dz",
nintDz,
minDz,
maxDz));
483 histograms.h_assocvertpos.push_back(make1DIfLogX(ibook,
485 "num_assoc(simToReco)_vertpos",
486 "N of associated tracks (simToReco) vs transverse vert position",
490 histograms.h_simulvertpos.push_back(make1DIfLogX(ibook,
493 "N of simulated tracks vs transverse vert position",
499 "num_assoc(simToReco)_zpos",
"N of associated tracks (simToReco) vs z vert position",
nintZpos,
minZpos,
maxZpos));
503 histograms.h_assocdr.push_back(make1DIfLogX(ibook,
505 "num_assoc(simToReco)_dr",
506 "N of associated tracks (simToReco) vs dR",
511 make1DIfLogX(ibook,
true,
"num_simul_dr",
"N of simulated tracks vs dR",
nintdr, log10(
mindr), log10(
maxdr)));
513 histograms.h_assocdrj.push_back(make1DIfLogX(ibook,
515 "num_assoc(simToReco)_drj",
516 "N of associated tracks (simToReco) vs dR(TP,jet)",
521 ibook,
true,
"num_simul_drj",
"N of simulated tracks vs dR(TP,jet)",
nintdrj, log10(
mindrj), log10(
maxdrj)));
526 "num_assoc(simToReco)_simpvz",
"N of associated tracks (simToReco) vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
528 histograms.nrecHit_vs_nsimHit_sim2rec.push_back(doResolutionPlots ? ibook.
book2D(
"nrecHit_vs_nsimHit_sim2rec",
529 "nrecHit vs nsimHit (Sim2RecAssoc)",
540 histograms.h_duplicates_oriAlgo_vs_oriAlgo.push_back(ibook.
book2D(
"duplicates_oriAlgo_vs_oriAlgo",
541 "Duplicate tracks: originalAlgo vs originalAlgo",
548 setBinLabelsAlgo(
histograms.h_duplicates_oriAlgo_vs_oriAlgo.back(), 1);
549 setBinLabelsAlgo(
histograms.h_duplicates_oriAlgo_vs_oriAlgo.back(), 2);
554 "num_assoc(simToReco)_dxypv",
"N of associated tracks (simToReco) vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
559 ibook.
book1D(
"num_assoc(simToReco)_dzpv",
"N of associated tracks (simToReco) vs dz(PV)",
nintDz,
minDz,
maxDz));
563 histograms.h_assocdxypvzoomed.push_back(ibook.
book1D(
"num_assoc(simToReco)_dxypv_zoomed",
564 "N of associated tracks (simToReco) vs dxy(PV)",
571 histograms.h_assocdzpvzoomed.push_back(ibook.
book1D(
"num_assoc(simToReco)_dzpv_zoomed",
572 "N of associated tracks (simToReco) vs dz(PV)",
580 "num_assoc(simToReco)_dzpvcut",
"N of associated tracks (simToReco) vs dz(PV)",
nintDzpvCum, 0,
maxDzpvCum));
584 "num_simul2_dzpvcut",
"N of simulated tracks (associated to any track) from sim PV",
nintDzpvCum, 0,
maxDzpvCum));
586 histograms.h_assoc_dzpvcut_pt.push_back(ibook.
book1D(
"num_assoc(simToReco)_dzpvcut_pt",
587 "#sump_{T} of associated tracks (simToReco) vs dz(PV)",
594 ibook.
book1D(
"num_simul2_dzpvcut_pt",
595 "#sump_{T} of simulated tracks (associated to any track) from sim PV",
599 histograms.h_assoc_dzpvcut_pt.back()->enableSumw2();
600 histograms.h_simul_dzpvcut_pt.back()->enableSumw2();
601 histograms.h_simul2_dzpvcut_pt.back()->enableSumw2();
603 histograms.h_assoc_dzpvsigcut.push_back(ibook.
book1D(
"num_assoc(simToReco)_dzpvsigcut",
604 "N of associated tracks (simToReco) vs dz(PV)/dzError",
611 ibook.
book1D(
"num_simul2_dzpvsigcut",
612 "N of simulated tracks (associated to any track) from sim PV/dzError",
618 ibook.
book1D(
"num_assoc(simToReco)_dzpvsigcut_pt",
619 "#sump_{T} of associated tracks (simToReco) vs dz(PV)/dzError",
626 ibook.
book1D(
"num_simul2_dzpvsigcut_pt",
627 "#sump_{T} of simulated tracks (associated to any track) from sim PV/dzError",
631 histograms.h_assoc_dzpvsigcut_pt.back()->enableSumw2();
632 histograms.h_simul_dzpvsigcut_pt.back()->enableSumw2();
633 histograms.h_simul2_dzpvsigcut_pt.back()->enableSumw2();
638 bool doResolutionPlots) {
642 histograms.h_charge.push_back(ibook.
book1D(
"charge",
"charge", 3, -1.5, 1.5));
646 histograms.h_nchi2.push_back(ibook.
book1D(
"chi2",
"normalized #chi^{2}", 200, 0, 20));
647 histograms.h_nchi2_prob.push_back(ibook.
book1D(
"chi2_prob",
"normalized #chi^{2} probability", 100, 0, 1));
658 histograms.h_algo.back()->disableAlphanumeric();
667 "num_duplicate_eta",
"N of associated (recoToSim) duplicate tracks vs eta",
nintEta,
minEta,
maxEta));
670 "num_chargemisid_eta",
"N of associated (recoToSim) charge misIDed tracks vs eta",
nintEta,
minEta,
maxEta));
683 histograms.h_misidpT.push_back(make1DIfLogX(ibook,
685 "num_chargemisid_pT",
686 "N of associated (recoToSim) charge misIDed tracks vs pT",
693 histograms.h_recopTvseta.push_back(make2DIfLogY(ibook,
696 "N of reco track in (pT-eta) plane",
703 histograms.h_reco2pTvseta.push_back(make2DIfLogY(ibook,
706 "N of selected reco track in (pT-eta) plane",
713 histograms.h_assoc2pTvseta.push_back(make2DIfLogY(ibook,
715 "num_assoc(recoToSim)_pTvseta",
716 "N of associated (recoToSim) tracks in (pT-eta) plane",
723 histograms.h_looperpTvseta.push_back(make2DIfLogY(ibook,
725 "num_duplicate_pTvseta",
726 "N of associated (recoToSim) duplicate tracks in (pT-eta) plane",
737 "num_chargemisid_pTvseta",
738 "N of associated (recoToSim) charge misIDed tracks in (pT-eta) plane",
745 histograms.h_pileuppTvseta.push_back(make2DIfLogY(ibook,
747 "num_pileup_pTvseta",
748 "N of associated (recoToSim) pileup tracks in (pT-eta) plane",
760 "num_duplicate_hit",
"N of associated (recoToSim) duplicate tracks vs hit",
nintHit,
minHit,
maxHit));
763 "num_chargemisid_hit",
"N of associated (recoToSim) charge misIDed tracks vs hit",
nintHit,
minHit,
maxHit));
775 "N of associated (recoToSim) charge misIDed tracks vs layer",
784 histograms.h_assoc2pixellayer.push_back(ibook.
book1D(
"num_assoc(recoToSim)_pixellayer",
785 "N of associated (recoToSim) tracks vs pixellayer",
789 histograms.h_looperpixellayer.push_back(ibook.
book1D(
"num_duplicate_pixellayer",
790 "N of associated (recoToSim) duplicate tracks vs pixellayer",
796 ibook.
book1D(
"num_chargemisid_pixellayer",
797 "N of associated (recoToSim) charge misIDed tracks vs pixellayer",
801 histograms.h_pileuppixellayer.push_back(ibook.
book1D(
"num_pileup_pixellayer",
802 "N of associated (recoToSim) pileup tracks vs pixellayer",
809 histograms.h_assoc23Dlayer.push_back(ibook.
book1D(
"num_assoc(recoToSim)_3Dlayer",
810 "N of associated (recoToSim) tracks vs 3D layer",
815 "N of associated (recoToSim) duplicate tracks vs 3D layer",
821 "N of associated (recoToSim) charge misIDed tracks vs 3D layer",
831 ibook.
book1D(
"num_assoc(recoToSim)_pu",
"N of associated (recoToSim) tracks vs pu",
nintPu,
minPu,
maxPu));
833 ibook.
book1D(
"num_duplicate_pu",
"N of associated (recoToSim) duplicate tracks vs pu",
nintPu,
minPu,
maxPu));
836 "num_chargemisid_pu",
"N of associated (recoToSim) charge misIDed tracks vs pu",
nintPu,
minPu,
maxPu));
844 "num_duplicate_phi",
"N of associated (recoToSim) duplicate tracks vs phi",
nintPhi,
minPhi,
maxPhi));
847 "num_chargemisid_phi",
"N of associated (recoToSim) charge misIDed tracks vs phi",
nintPhi,
minPhi,
maxPhi));
858 "num_chargemisid_dxy",
"N of associated (recoToSim) charge misIDed tracks vs dxy",
nintDxy,
minDxy,
maxDxy));
864 ibook.
book1D(
"num_assoc(recoToSim)_dz",
"N of associated (recoToSim) tracks vs dz",
nintDz,
minDz,
maxDz));
866 ibook.
book1D(
"num_duplicate_dz",
"N of associated (recoToSim) looper tracks vs dz",
nintDz,
minDz,
maxDz));
869 "num_chargemisid_versus_dz",
"N of associated (recoToSim) charge misIDed tracks vs dz",
nintDz,
minDz,
maxDz));
873 histograms.h_recovertpos.push_back(make1DIfLogX(ibook,
876 "N of reconstructed tracks vs transverse ref point position",
883 "num_assoc(recoToSim)_vertpos",
884 "N of associated (recoToSim) tracks vs transverse ref point position",
891 "num_duplicate_vertpos",
892 "N of associated (recoToSim) looper tracks vs transverse ref point position",
899 "num_pileup_vertpos",
900 "N of associated (recoToSim) pileup tracks vs transverse ref point position",
906 "num_reco_zpos",
"N of reconstructed tracks vs transverse ref point position",
nintZpos,
minZpos,
maxZpos));
908 "N of associated (recoToSim) tracks vs transverse ref point position",
913 ibook.
book1D(
"num_duplicate_zpos",
914 "N of associated (recoToSim) looper tracks vs transverse ref point position",
919 ibook.
book1D(
"num_pileup_zpos",
920 "N of associated (recoToSim) pileup tracks vs transverse ref point position",
926 make1DIfLogX(ibook,
true,
"num_reco_dr",
"N of reconstructed tracks vs dR",
nintdr, log10(
mindr), log10(
maxdr)));
927 histograms.h_assoc2dr.push_back(make1DIfLogX(ibook,
929 "num_assoc(recoToSim)_dr",
930 "N of associated tracks (recoToSim) vs dR",
934 histograms.h_looperdr.push_back(make1DIfLogX(ibook,
937 "N of associated (recoToSim) looper tracks vs dR",
941 histograms.h_pileupdr.push_back(make1DIfLogX(ibook,
944 "N of associated (recoToSim) pileup tracks vs dR",
950 ibook,
true,
"num_reco_drj",
"N of reconstructed tracks vs dR(track,jet)",
nintdrj, log10(
mindrj), log10(
maxdrj)));
951 histograms.h_assoc2drj.push_back(make1DIfLogX(ibook,
953 "num_assoc(recoToSim)_drj",
954 "N of associated tracks (recoToSim) vs dR(track,jet)",
958 histograms.h_looperdrj.push_back(make1DIfLogX(ibook,
961 "N of associated (recoToSim) looper tracks vs dR(track,jet)",
965 histograms.h_pileupdrj.push_back(make1DIfLogX(ibook,
968 "N of associated (recoToSim) pileup tracks vs dR(track,jet)",
976 "num_assoc(recoToSim)_simpvz",
"N of associated tracks (recoToSim) vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
978 "num_duplicate_simpvz",
"N of associated (recoToSim) looper tracks vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
980 "num_pileup_simpvz",
"N of associated (recoToSim) pileup tracks vs. sim PV z",
nintPVz,
minPVz,
maxPVz));
985 "N of associated (recoToSim) tracks vs normalized #chi^{2}",
990 "N of associated (recoToSim) looper tracks vs normalized #chi^{2}",
996 ibook.
book1D(
"num_chargemisid_chi2",
997 "N of associated (recoToSim) charge misIDed tracks vs normalized #chi^{2}",
1002 "N of associated (recoToSim) pileup tracks vs normalized #chi^{2}",
1008 ibook.
book1D(
"num_reco_chi2prob",
"N of reco track vs normalized #chi^{2}", 100, 0., 1.));
1010 "num_assoc(recoToSim)_chi2prob",
"N of associated (recoToSim) tracks vs normalized #chi^{2}", 100, 0., 1.));
1012 "num_duplicate_chi2prob",
"N of associated (recoToSim) looper tracks vs normalized #chi^{2}", 100, 0., 1.));
1015 ibook.
book1D(
"num_chargemisid_chi2prob",
1016 "N of associated (recoToSim) charge misIDed tracks vs normalized #chi^{2}",
1021 "num_pileup_chi2prob",
"N of associated (recoToSim) pileup tracks vs normalized #chi^{2}", 100, 0., 1.));
1026 ibook.
book1D(
"num_reco_seedingLayerSet",
"N of reco track vs. seedingLayerSet",
size, 0,
size));
1027 histograms.h_assoc2_seedingLayerSet.push_back(
1028 ibook.
book1D(
"num_assoc(recoToSim)_seedingLayerSet",
1029 "N of associated track (recoToSim) tracks vs. seedingLayerSet",
1034 "num_duplicate_seedingLayerSet",
"N of reco associated (recoToSim) looper vs. seedingLayerSet",
size, 0,
size));
1036 "num_pileup_seedingLayerSet",
"N of reco associated (recoToSim) pileup vs. seedingLayerSet",
size, 0,
size));
1046 auto bookResolutionPlots1D = [&](std::vector<dqm::reco::MonitorElement*>& vec,
auto&&...
params) {
1047 vec.push_back(doResolutionPlots ? ibook.
book1D(std::forward<decltype(
params)>(
params)...) :
nullptr);
1049 auto bookResolutionPlots2D = [&](std::vector<dqm::reco::MonitorElement*>& vec,
bool logx,
auto&&...
params) {
1050 vec.push_back(doResolutionPlots ? make2DIfLogX(ibook, logx, std::forward<decltype(
params)>(
params)...) :
nullptr);
1052 auto bookResolutionPlotsProfile2D = [&](std::vector<dqm::reco::MonitorElement*>& vec,
auto&&...
params) {
1056 bookResolutionPlots1D(
histograms.h_eta,
"eta",
"pseudorapidity residue", 1000, -0.1, 0.1);
1057 bookResolutionPlots1D(
histograms.h_pt,
"pullPt",
"pull of p_{t}", 100, -10, 10);
1058 bookResolutionPlots1D(
histograms.h_pullTheta,
"pullTheta",
"pull of #theta parameter", 250, -25, 25);
1059 bookResolutionPlots1D(
histograms.h_pullPhi,
"pullPhi",
"pull of #phi parameter", 250, -25, 25);
1060 bookResolutionPlots1D(
histograms.h_pullDxy,
"pullDxy",
"pull of dxy parameter", 250, -25, 25);
1061 bookResolutionPlots1D(
histograms.h_pullDz,
"pullDz",
"pull of dz parameter", 250, -25, 25);
1062 bookResolutionPlots1D(
histograms.h_pullQoverp,
"pullQoverp",
"pull of qoverp parameter", 250, -25, 25);
1073 histograms.h_assocFraction.push_back(ibook.
book1D(
"assocFraction",
"fraction of shared hits", 200, 0, 2));
1074 histograms.h_assocSharedHit.push_back(ibook.
book1D(
"assocSharedHit",
"number of shared hits", 41, -0.5, 40.5));
1081 bookResolutionPlots2D(
1083 bookResolutionPlots2D(
1087 "Number of selected reco tracks vs. number of selected sim tracks;TrackingParticles;Reco tracks",
1105 "assoc_chi2prob_vs_eta",
"mean #chi^{2} probability vs #eta",
nintEta,
minEta,
maxEta, 100, 0., 1.,
" "));
1106 histograms.assoc_chi2_vs_pt.push_back(makeProfileIfLogX(
1108 histograms.assoc_chi2prob_vs_pt.push_back(makeProfileIfLogX(
1131 "mean # Layers with measurement vs eta",
1140 "mean # PXL Layers with measurement vs eta",
1149 "mean # STRIP Layers with measurement vs eta",
1157 histograms.nSTRIPlayersWith1dMeas_vs_eta.push_back(ibook.
bookProfile(
"STRIPlayersWith1dMeas_vs_eta",
1158 "mean # STRIP Layers with 1D measurement vs eta",
1166 histograms.nSTRIPlayersWith2dMeas_vs_eta.push_back(ibook.
bookProfile(
"STRIPlayersWith2dMeas_vs_eta",
1167 "mean # STRIP Layers with 2D measurement vs eta",
1199 bookResolutionPlots2D(
histograms.ptres_vs_eta,
1210 bookResolutionPlots2D(
histograms.ptres_vs_phi,
1213 "p_{t} res vs #phi",
1221 bookResolutionPlots2D(
histograms.ptres_vs_pt,
1232 bookResolutionPlots2D(
histograms.cotThetares_vs_eta,
1234 "cotThetares_vs_eta",
1235 "cotThetares_vs_eta",
1243 bookResolutionPlots2D(
histograms.cotThetares_vs_pt,
1245 "cotThetares_vs_pt",
1246 "cotThetares_vs_pt",
1254 bookResolutionPlots2D(
histograms.phires_vs_eta,
1265 bookResolutionPlots2D(
histograms.phires_vs_pt,
1276 bookResolutionPlots2D(
histograms.phires_vs_phi,
1287 bookResolutionPlots2D(
histograms.dxyres_vs_eta,
1298 bookResolutionPlots2D(
histograms.dxyres_vs_pt,
1309 bookResolutionPlots2D(
histograms.dxyres_vs_phi,
1320 bookResolutionPlots2D(
histograms.dzres_vs_eta,
1331 bookResolutionPlots2D(
histograms.dzres_vs_pt,
1342 bookResolutionPlots2D(
histograms.dzres_vs_phi,
1353 bookResolutionPlotsProfile2D(
histograms.ptmean_vs_eta_phi,
1354 "ptmean_vs_eta_phi",
1355 "mean p_{t} vs #eta and #phi",
1365 bookResolutionPlotsProfile2D(
histograms.phimean_vs_eta_phi,
1366 "phimean_vs_eta_phi",
1367 "mean #phi vs #eta and #phi",
1379 bookResolutionPlots2D(
1381 bookResolutionPlots2D(
1383 bookResolutionPlots2D(
1385 bookResolutionPlots2D(
1387 bookResolutionPlots2D(
1393 bookResolutionPlots2D(
1395 bookResolutionPlots2D(
1397 bookResolutionPlots2D(
histograms.thetapull_vs_phi,
1400 "#theta pull vs #phi",
1408 bookResolutionPlots2D(
histograms.nrecHit_vs_nsimHit_rec2sim,
1410 "nrecHit_vs_nsimHit_rec2sim",
1411 "nrecHit vs nsimHit (Rec2simAssoc)",
1424 "num_assoc(recoToSim)_dxypv",
"N of associated (recoToSim) tracks vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
1426 "num_duplicate_dxypv",
"N of associated (recoToSim) looper tracks vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
1429 "N of associated (recoToSim) charge misIDed tracks vs dxy(PV)",
1434 "num_pileup_dxypv",
"N of associated (recoToSim) pileup tracks vs dxy(PV)",
nintDxy,
minDxy,
maxDxy));
1438 ibook.
book1D(
"num_assoc(recoToSim)_dzpv",
"N of associated (recoToSim) tracks vs dz(PV)",
nintDz,
minDz,
maxDz));
1440 ibook.
book1D(
"num_duplicate_dzpv",
"N of associated (recoToSim) looper tracks vs dz(PV)",
nintDz,
minDz,
maxDz));
1442 histograms.h_misiddzpv.push_back(ibook.
book1D(
"num_chargemisid_versus_dzpv",
1443 "N of associated (recoToSim) charge misIDed tracks vs dz(PV)",
1448 ibook.
book1D(
"num_pileup_dzpv",
"N of associated (recoToSim) pileup tracks vs dz(PV)",
nintDz,
minDz,
maxDz));
1452 histograms.h_assoc2dxypvzoomed.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dxypv_zoomed",
1453 "N of associated (recoToSim) tracks vs dxy(PV)",
1457 histograms.h_looperdxypvzoomed.push_back(ibook.
book1D(
"num_duplicate_dxypv_zoomed",
1458 "N of associated (recoToSim) looper tracks vs dxy(PV)",
1463 histograms.h_misiddxypvzoomed.push_back(ibook.
book1D(
"num_chargemisid_dxypv_zoomed",
1464 "N of associated (recoToSim) charge misIDed tracks vs dxy(PV)",
1468 histograms.h_pileupdxypvzoomed.push_back(ibook.
book1D(
"num_pileup_dxypv_zoomed",
1469 "N of associated (recoToSim) pileup tracks vs dxy(PV)",
1476 histograms.h_assoc2dzpvzoomed.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dzpv_zoomed",
1477 "N of associated (recoToSim) tracks vs dz(PV)",
1481 histograms.h_looperdzpvzoomed.push_back(ibook.
book1D(
"num_duplicate_dzpv_zoomed",
1482 "N of associated (recoToSim) looper tracks vs dz(PV)",
1487 histograms.h_misiddzpvzoomed.push_back(ibook.
book1D(
"num_chargemisid_versus_dzpv_zoomed",
1488 "N of associated (recoToSim) charge misIDed tracks vs dz(PV)",
1492 histograms.h_pileupdzpvzoomed.push_back(ibook.
book1D(
"num_pileup_dzpv_zoomed",
1493 "N of associated (recoToSim) pileup tracks vs dz(PV)",
1501 "num_assoc(recoToSim)_dzpvcut",
"N of associated (recoToSim) tracks vs dz(PV)",
nintDzpvCum, 0,
maxDzpvCum));
1503 "num_pileup_dzpvcut",
"N of associated (recoToSim) pileup tracks vs dz(PV)",
nintDzpvCum, 0,
maxDzpvCum));
1507 histograms.h_assoc2_dzpvcut_pt.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dzpvcut_pt",
1508 "#sump_{T} of associated (recoToSim) tracks vs dz(PV)",
1512 histograms.h_pileup_dzpvcut_pt.push_back(ibook.
book1D(
"num_pileup_dzpvcut_pt",
1513 "#sump_{T} of associated (recoToSim) pileup tracks vs dz(PV)",
1517 histograms.h_reco_dzpvcut_pt.back()->enableSumw2();
1518 histograms.h_assoc2_dzpvcut_pt.back()->enableSumw2();
1519 histograms.h_pileup_dzpvcut_pt.back()->enableSumw2();
1523 histograms.h_assoc2_dzpvsigcut.push_back(ibook.
book1D(
"num_assoc(recoToSim)_dzpvsigcut",
1524 "N of associated (recoToSim) tracks vs dz(PV)/dzError",
1528 histograms.h_pileup_dzpvsigcut.push_back(ibook.
book1D(
"num_pileup_dzpvsigcut",
1529 "N of associated (recoToSim) pileup tracks vs dz(PV)/dzError",
1537 ibook.
book1D(
"num_assoc(recoToSim)_dzpvsigcut_pt",
1538 "#sump_{T} of associated (recoToSim) tracks vs dz(PV)/dzError",
1543 ibook.
book1D(
"num_pileup_dzpvsigcut_pt",
1544 "#sump_{T} of associated (recoToSim) pileup tracks vs dz(PV)/dzError",
1548 histograms.h_reco_dzpvsigcut_pt.back()->enableSumw2();
1549 histograms.h_assoc2_dzpvsigcut_pt.back()->enableSumw2();
1550 histograms.h_pileup_dzpvsigcut_pt.back()->enableSumw2();
1577 histograms.h_seedsFitFailedFraction.push_back(
1578 ibook.
book1D(
"seeds_fitFailedFraction",
"Fraction of seeds for which the fit failed", 100, 0, 1));
1595 histograms.h_assoc2_mvacut_hp.emplace_back();
1596 histograms.h_simul2_mvacut_hp.emplace_back();
1598 histograms.h_assoc2_mva_vs_pt.emplace_back();
1600 histograms.h_assoc2_mva_vs_pt_hp.emplace_back();
1601 histograms.h_fake_mva_vs_pt_hp.emplace_back();
1602 histograms.h_assoc2_mva_vs_eta.emplace_back();
1604 histograms.h_assoc2_mva_vs_eta_hp.emplace_back();
1605 histograms.h_fake_mva_vs_eta_hp.emplace_back();
1607 for (
size_t i = 1;
i <= nMVAs; ++
i) {
1608 auto istr = std::to_string(
i);
1612 histograms.h_reco_mva_hp.back().emplace_back();
1613 histograms.h_assoc2_mva_hp.back().emplace_back();
1615 histograms.h_reco_mvacut_hp.back().emplace_back();
1616 histograms.h_assoc_mvacut_hp.back().emplace_back();
1617 histograms.h_assoc2_mvacut_hp.back().emplace_back();
1618 histograms.h_simul2_mvacut_hp.back().emplace_back();
1620 histograms.h_assoc2_mva_vs_pt_hp.back().emplace_back();
1621 histograms.h_fake_mva_vs_pt_hp.back().emplace_back();
1622 histograms.h_assoc2_mva_vs_eta_hp.back().emplace_back();
1623 histograms.h_fake_mva_vs_eta_hp.back().emplace_back();
1625 pfix =
" (not loose-selected)";
1629 "num_reco_mva" + istr +
"_hp",
"N of reco track after vs MVA" + istr + pfix2,
nintMVA,
minMVA,
maxMVA));
1631 ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr +
"_hp",
1632 "N of associated tracks (recoToSim) vs MVA" + istr + pfix2,
1637 histograms.h_reco_mvacut_hp.back().push_back(ibook.
book1D(
"num_reco_mva" + istr +
"cut" +
"_hp",
1638 "N of reco track vs cut on MVA" + istr + pfix2,
1642 histograms.h_assoc_mvacut_hp.back().push_back(
1643 ibook.
book1D(
"num_assoc(simToReco)_mva" + istr +
"cut_hp",
1644 "N of associated tracks (simToReco) vs cut on MVA" + istr + pfix2,
1648 histograms.h_assoc2_mvacut_hp.back().push_back(
1649 ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr +
"cut_hp",
1650 "N of associated tracks (recoToSim) vs cut on MVA" + istr + pfix2,
1654 histograms.h_simul2_mvacut_hp.back().push_back(
1655 ibook.
book1D(
"num_simul2_mva" + istr +
"cut_hp",
1656 "N of simulated tracks (associated to any track) vs cut on MVA" + istr + pfix2,
1661 histograms.h_assoc2_mva_vs_pt_hp.back().push_back(
1662 makeProfileIfLogX(ibook,
1664 (
"mva_assoc(recoToSim)_mva" + istr +
"_pT_hp").c_str(),
1665 (
"MVA" + istr +
" of associated tracks (recoToSim) vs. track p_{T}" + pfix2).c_str(),
1671 histograms.h_fake_mva_vs_pt_hp.back().push_back(
1672 makeProfileIfLogX(ibook,
1674 (
"mva_fake_mva" + istr +
"pT_hp").c_str(),
1675 (
"MVA" + istr +
" of non-associated tracks (recoToSim) vs. track p_{T}" + pfix2).c_str(),
1681 histograms.h_assoc2_mva_vs_eta_hp.back().push_back(
1682 ibook.
bookProfile(
"mva_assoc(recoToSim)_mva" + istr +
"_eta_hp",
1683 "MVA" + istr +
" of associated tracks (recoToSim) vs. track #eta" + pfix2,
1690 histograms.h_fake_mva_vs_eta_hp.back().push_back(
1691 ibook.
bookProfile(
"mva_fake_mva" + istr +
"eta_hp",
1692 "MVA" + istr +
" of non-associated tracks (recoToSim) vs. track #eta" + pfix2,
1703 histograms.h_assoc2_mva.back().push_back(ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr,
1704 "N of associated tracks (recoToSim) vs MVA" + istr + pfix,
1710 "num_reco_mva" + istr +
"cut",
"N of reco track vs cut on MVA" + istr + pfix,
nintMVA,
minMVA,
maxMVA));
1712 ibook.
book1D(
"num_assoc(simToReco)_mva" + istr +
"cut",
1713 "N of associated tracks (simToReco) vs cut on MVA" + istr + pfix,
1718 ibook.
book1D(
"num_assoc(recoToSim)_mva" + istr +
"cut",
1719 "N of associated tracks (recoToSim) vs cut on MVA" + istr + pfix,
1724 ibook.
book1D(
"num_simul2_mva" + istr +
"cut",
1725 "N of simulated tracks (associated to any track) vs cut on MVA" + istr + pfix,
1730 histograms.h_assoc2_mva_vs_pt.back().push_back(
1731 makeProfileIfLogX(ibook,
1733 (
"mva_assoc(recoToSim)_mva" + istr +
"_pT").c_str(),
1734 (
"MVA" + istr +
" of associated tracks (recoToSim) vs. track p_{T}" + pfix).c_str(),
1740 histograms.h_fake_mva_vs_pt.back().push_back(
1741 makeProfileIfLogX(ibook,
1743 (
"mva_fake_mva" + istr +
"_pT").c_str(),
1744 (
"MVA" + istr +
" of non-associated tracks (recoToSim) vs. track p_{T}" + pfix).c_str(),
1750 histograms.h_assoc2_mva_vs_eta.back().push_back(
1751 ibook.
bookProfile(
"mva_assoc(recoToSim)_mva" + istr +
"_eta",
1752 "MVA" + istr +
" of associated tracks (recoToSim) vs. track #eta" + pfix,
1759 histograms.h_fake_mva_vs_eta.back().push_back(
1761 "MVA" + istr +
" of non-associated tracks (recoToSim) vs. track #eta" + pfix,
1796 int nSimPixelLayers,
1797 int nSimStripMonoAndStereoLayers,
1805 const std::vector<float>& mvas,
1806 unsigned int selectsLoose,
1807 unsigned int selectsHP)
const {
1809 const auto eta =
getEta(momentumTP.eta());
1810 const auto phi = momentumTP.phi();
1812 const auto nSim3DLayers = nSimPixelLayers + nSimStripMonoAndStereoLayers;
1814 const auto vertexTPwrtBS = vertexTP - bsPosition;
1815 const auto vertxy =
std::sqrt(vertexTPwrtBS.perp2());
1816 const auto vertz = vertexTPwrtBS.z();
1824 for (
size_t i = 0;
i < mvas.size(); ++
i) {
1825 if (
i <= selectsLoose) {
1829 if (
i >= 1 &&
i <= selectsHP) {
1925 const double dzpvsigcut = dzpvcut /
track->dzError();
1932 if (simPVPosition) {
1933 const auto simpvz = simPVPosition->z();
1959 for (
unsigned int i = 0;
i < v_dEdx.size();
i++) {
1977 bool isChargeMatched,
1978 int numAssocRecoTracks,
1981 double sharedFraction,
1984 const std::vector<float>& mvas,
1985 unsigned int selectsLoose,
1986 unsigned int selectsHP)
const {
1993 const auto phi =
track.momentum().phi();
1995 const auto dxy =
track.dxy(bsPosition);
1996 const auto dz =
track.dz(bsPosition);
1997 const auto dxypv = pvPosition ?
track.dxy(*pvPosition) : 0.0;
1998 const auto dzpv = pvPosition ?
track.dz(*pvPosition) : 0.0;
1999 const auto dzpvsig = pvPosition ? dzpv /
track.dzError() : 0.0;
2001 const auto nlayers =
track.hitPattern().trackerLayersWithMeasurement();
2002 const auto nPixelLayers =
track.hitPattern().pixelLayersWithMeasurement();
2003 const auto n3DLayers = nPixelLayers +
track.hitPattern().numberOfValidStripLayersWithMonoAndStereo();
2004 const auto refPointWrtBS =
track.referencePoint() - bsPosition;
2005 const auto vertxy =
std::sqrt(refPointWrtBS.perp2());
2006 const auto vertz = refPointWrtBS.z();
2007 const auto chi2 =
track.normalizedChi2();
2008 const auto chi2prob = TMath::Prob(
track.chi2(), (
int)
track.ndof());
2011 const auto simpvz = simPVPosition ? simPVPosition->z() : 0.0;
2028 if (fillSeedingLayerSets)
2041 if (simPVPosition) {
2088 if (fillSeedingLayerSets)
2101 if (simPVPosition) {
2157 if (numAssocRecoTracks > 1) {
2171 if (fillSeedingLayerSets)
2179 if (simPVPosition) {
2189 if (!isSigMatched) {
2203 if (fillSeedingLayerSets)
2216 if (simPVPosition) {
2258 const auto pxbHits =
track.hitPattern().numberOfValidPixelBarrelHits();
2259 const auto pxfHits =
track.hitPattern().numberOfValidPixelEndcapHits();
2260 const auto tibHits =
track.hitPattern().numberOfValidStripTIBHits();
2261 const auto tidHits =
track.hitPattern().numberOfValidStripTIDHits();
2262 const auto tobHits =
track.hitPattern().numberOfValidStripTOBHits();
2263 const auto tecHits =
track.hitPattern().numberOfValidStripTECHits();
2271 histograms.nSTRIPhits_vs_eta[
count]->Fill(
eta, tibHits + tidHits + tobHits + tecHits);
2276 const auto btlHits =
track.hitPattern().numberOfValidTimingBTLHits();
2277 const auto etlHits =
track.hitPattern().numberOfValidTimingETLHits();
2282 int LayersAll =
track.hitPattern().stripLayersWithMeasurement();
2283 int Layers2D =
track.hitPattern().numberOfValidStripLayersWithMonoAndStereo();
2284 int Layers1D = LayersAll - Layers2D;
2296 int numRecoTracksSelected,
2297 int numSimTracksSelected)
const {
2301 histograms.nrec_vs_nsim[
count]->Fill(numSimTracksSelected, numRecoTracksSelected);
2315 double qoverpSim = chargeTP /
sqrt(momentumTP.x() * momentumTP.x() + momentumTP.y() * momentumTP.y() +
2316 momentumTP.z() * momentumTP.z());
2317 double lambdaSim =
M_PI / 2 - momentumTP.theta();
2318 double phiSim = momentumTP.phi();
2324 double qoverpRec(0);
2325 double qoverpErrorRec(0);
2327 double ptErrorRec(0);
2328 double lambdaRec(0);
2329 double lambdaErrorRec(0);
2331 double phiErrorRec(0);
2353 getRecoMomentum(
track, ptRec, ptErrorRec, qoverpRec, qoverpErrorRec, lambdaRec, lambdaErrorRec, phiRec, phiErrorRec);
2356 double ptError = ptErrorRec;
2357 double ptres = ptRec -
sqrt(momentumTP.perp2());
2358 double etares =
track.eta() - momentumTP.Eta();
2360 double dxyRec =
track.dxy(bsPosition);
2361 double dzRec =
track.dz(bsPosition);
2363 const auto phiRes = phiRec - phiSim;
2364 const auto dxyRes = dxyRec - dxySim;
2365 const auto dzRes = dzRec - dzSim;
2366 const auto cotThetaRes = 1 /
tan(
M_PI * 0.5 - lambdaRec) - 1 /
tan(
M_PI * 0.5 - lambdaSim);
2369 double qoverpPull = (qoverpRec - qoverpSim) / qoverpErrorRec;
2370 double thetaPull = (lambdaRec - lambdaSim) / lambdaErrorRec;
2371 double phiPull = phiRes / phiErrorRec;
2372 double dxyPull = dxyRes /
track.dxyError();
2373 double dzPull = dzRes /
track.dzError();
2376 double contrib_Qoverp = ((qoverpRec - qoverpSim) / qoverpErrorRec) * ((qoverpRec - qoverpSim) / qoverpErrorRec) / 5;
2377 double contrib_dxy = ((dxyRec - dxySim) /
track.dxyError()) * ((dxyRec - dxySim) /
track.dxyError()) / 5;
2378 double contrib_dz = ((dzRec - dzSim) /
track.dzError()) * ((dzRec - dzSim) /
track.dzError()) / 5;
2379 double contrib_theta = ((lambdaRec - lambdaSim) / lambdaErrorRec) * ((lambdaRec - lambdaSim) / lambdaErrorRec) / 5;
2380 double contrib_phi = ((phiRec - phiSim) / phiErrorRec) * ((phiRec - phiSim) / phiErrorRec) / 5;
2386 <<
"ptREC=" << ptRec <<
"\n"
2387 <<
"etaREC=" <<
track.eta() <<
"\n"
2388 <<
"qoverpREC=" << qoverpRec <<
"\n"
2389 <<
"dxyREC=" << dxyRec <<
"\n"
2390 <<
"dzREC=" << dzRec <<
"\n"
2391 <<
"thetaREC=" <<
track.theta() <<
"\n"
2392 <<
"phiREC=" << phiRec <<
"\n"
2395 <<
"qoverpError()=" << qoverpErrorRec <<
"\n"
2396 <<
"dxyError()=" <<
track.dxyError() <<
"\n"
2397 <<
"dzError()=" <<
track.dzError() <<
"\n"
2398 <<
"thetaError()=" << lambdaErrorRec <<
"\n"
2399 <<
"phiError()=" << phiErrorRec <<
"\n"
2402 <<
"ptSIM=" <<
sqrt(momentumTP.perp2()) <<
"\n"
2403 <<
"etaSIM=" << momentumTP.Eta() <<
"\n"
2404 <<
"qoverpSIM=" << qoverpSim <<
"\n"
2405 <<
"dxySIM=" << dxySim <<
"\n"
2406 <<
"dzSIM=" << dzSim <<
"\n"
2407 <<
"thetaSIM=" <<
M_PI / 2 - lambdaSim <<
"\n"
2408 <<
"phiSIM=" << phiSim <<
"\n"
2411 <<
"contrib_Qoverp=" << contrib_Qoverp <<
"\n"
2412 <<
"contrib_dxy=" << contrib_dxy <<
"\n"
2413 <<
"contrib_dz=" << contrib_dz <<
"\n"
2414 <<
"contrib_theta=" << contrib_theta <<
"\n"
2415 <<
"contrib_phi=" << contrib_phi <<
"\n"
2418 <<
"chi2PULL=" << contrib_Qoverp + contrib_dxy + contrib_dz + contrib_theta + contrib_phi <<
"\n";
2427 const auto etaSim =
getEta(momentumTP.eta());
2428 const auto ptSim =
getPt(
sqrt(momentumTP.perp2()));
2476 double& qoverpError,
2478 double& lambdaError,
2482 ptError =
track.ptError();
2483 qoverp =
track.qoverp();
2484 qoverpError =
track.qoverpError();
2485 lambda =
track.lambda();
2486 lambdaError =
track.lambdaError();
2496 double& qoverpError,
2498 double& lambdaError,
2528 if (
track.seedRef().isNull() || !
track.seedRef().isAvailable())
2532 const auto hitRange =
seed.recHits();
2536 LogDebug(
"TrackValidator") <<
"Got seed with " <<
nhits <<
" hits, but I have a hard-coded maximum of "
2538 <<
", classifying the seed as 'unknown'. Please increase the maximum in "
2539 "MTVHistoProducerAlgoForTracker.h if needed.";
2543 for (
auto iHit = hitRange.first; iHit != hitRange.second; ++iHit, ++
i) {
2544 DetId detId = iHit->geographicalId();
2547 throw cms::Exception(
"LogicError") <<
"Encountered seed hit detId " << detId.
rawId() <<
" not from Tracker, but "
2552 bool subdetStrip =
false;
2593 return found->second;
2605 int numVertices)
const {
2667 int seedsTotal)
const {
2669 histograms.h_seedsFitFailedFraction[
count]->Fill(static_cast<double>(seedsFitFailed) / seedsTotal);