17 #include <RtypesCore.h>
28 #include <TVirtualPad.h>
38 #include <ext/alloc_traits.h>
39 #include <fmt/printf.h>
45 #include <type_traits>
48 #include <boost/range/adaptor/indexed.hpp>
157 isCosmics_(
pset.getParameter<
bool>(
"isCosmics")) {
161 theTrackCollectionToken = consumes<reco::TrackCollection>(TkTag_);
164 hltresultsToken = consumes<edm::TriggerResults>(TriggerResultsTag_);
167 beamspotToken = consumes<reco::BeamSpot>(BeamSpotTag_);
170 vertexToken = consumes<reco::VertexCollection>(VerticesTag_);
174 pmap = std::make_unique<TrackerMap>(
"Pixel");
175 pmap->onlyPixel(
true);
176 pmap->setTitle(
"Pixel Hit entries");
179 tmap = std::make_unique<TrackerMap>(
"Strip");
180 tmap->setTitle(
"Strip Hit entries");
185 pixelmap = std::make_unique<Phase1PixelMaps>(
"COLZ0 L");
186 pixelmap->bookBarrelHistograms(
"DMRsX",
"Median Residuals x-direction",
"Median Residuals");
187 pixelmap->bookBarrelBins(
"DMRsX");
188 pixelmap->bookForwardHistograms(
"DMRsX",
"Median Residuals x-direction",
"Median Residuals");
189 pixelmap->bookForwardBins(
"DMRsX");
191 pixelmap->bookBarrelHistograms(
"DMRsY",
"Median Residuals y-direction",
"Median Residuals");
192 pixelmap->bookBarrelBins(
"DMRsY");
193 pixelmap->bookForwardHistograms(
"DMRsY",
"Median Residuals y-direction",
"Median Residuals");
194 pixelmap->bookForwardBins(
"DMRsY");
197 pixelmap->setNoRescale();
209 template <
class OBJECT_TYPE>
211 for (
const auto &iter : vec | boost::adaptors::indexed(0)) {
212 if (iter.value() && iter.value()->GetName() ==
name) {
217 <<
" could not find " <<
name;
235 std::unique_ptr<TrackerMap>
tmap;
236 std::unique_ptr<TrackerMap>
pmap;
499 time_t start_time =
summary->m_start_time_ll;
501 time_t end_time =
summary->m_stop_time_ll;
511 double seconds = difftime(end_time, start_time) / 1.0e+6;
513 timeMap_[
event.run()] =
seconds;
525 conditionsMap_[
event.run()].first =
mode;
526 conditionsMap_[
event.run()].second = B_;
549 runInfoMap_[
event.run()].first += 1;
550 runInfoMap_[
event.run()].second += tC.size();
555 event.getByToken(hltresultsToken,
hltresults);
560 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
566 triggerMap_[
trigName].second += tC.size();
571 hrun->Fill(
event.run());
572 hlumi->Fill(
event.luminosityBlock());
574 int nHighPurityTracks = 0;
576 for (
const auto &
track : tC) {
577 auto const &residuals =
track.extra()->residuals();
579 unsigned int nHit2D = 0;
582 if (this->isHit2D(**iHit))
585 double resX = residuals.residualX(h_index);
586 double resY = residuals.residualY(h_index);
587 double pullX = residuals.pullX(h_index);
588 double pullY = residuals.pullY(h_index);
590 const DetId &detId = (*iHit)->geographicalId();
592 unsigned int subid = detId.
subdetId();
593 uint32_t detid_db = detId.
rawId();
597 float uOrientation(-999.
F), vOrientation(-999.
F);
598 LocalPoint lPModule(0., 0., 0.), lUDirection(1., 0., 0.), lVDirection(0., 1., 0.), lWDirection(0., 0., 1.);
601 GlobalPoint gUDirection = geomDet->surface().toGlobal(lUDirection);
602 GlobalPoint gVDirection = geomDet->surface().toGlobal(lVDirection);
603 GlobalPoint gWDirection = geomDet->surface().toGlobal(lWDirection);
604 GlobalPoint gPModule = geomDet->surface().toGlobal(lPModule);
606 if (!(*iHit)->detUnit())
610 tmap->fill(detid_db, 1);
621 if (resDetailsTIB_.find(detid_db) == resDetailsTIB_.end()) {
622 resDetailsTIB_[detid_db].rDirection = gWDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
623 resDetailsTIB_[detid_db].zDirection = gVDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
624 resDetailsTIB_[detid_db].rOrZDirection = resDetailsTIB_[detid_db].rDirection;
627 hTIBResXPrime->Fill(uOrientation * resX * 10000);
628 hTIBResXPull->Fill(pullX);
631 this->updateOnlineMomenta(resDetailsTIB_, detid_db, uOrientation * resX *
cmToUm, pullX);
637 hTOBResXPrime->Fill(uOrientation * resX * 10000);
638 hTOBResXPull->Fill(pullX);
641 if (resDetailsTOB_.find(detid_db) == resDetailsTOB_.end()) {
642 resDetailsTOB_[detid_db].rDirection = gWDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
643 resDetailsTOB_[detid_db].zDirection = gVDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
644 resDetailsTOB_[detid_db].rOrZDirection = resDetailsTOB_[detid_db].rDirection;
648 this->updateOnlineMomenta(resDetailsTOB_, detid_db, uOrientation * resX *
cmToUm, pullX);
654 hTIDResXPrime->Fill(uOrientation * resX * 10000);
655 hTIDResXPull->Fill(pullX);
658 this->updateOnlineMomenta(resDetailsTID_, detid_db, uOrientation * resX *
cmToUm, pullX);
664 hTECResXPrime->Fill(uOrientation * resX * 10000);
665 hTECResXPull->Fill(pullX);
668 this->updateOnlineMomenta(resDetailsTEC_, detid_db, uOrientation * resX *
cmToUm, pullX);
672 const SiPixelRecHit *pixhit = dynamic_cast<const SiPixelRecHit *>(*iHit);
677 pmap->fill(detid_db, 1);
687 int layer_num = tTopo->
pxbLayer(detid_db);
690 vOrientation = gVDirection.
z() - gPModule.
z() >= 0 ? +1.F : -1.F;
693 if (resDetailsBPixX_.find(detid_db) == resDetailsBPixX_.end()) {
694 resDetailsBPixX_[detid_db].rDirection = gWDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
695 resDetailsBPixX_[detid_db].zDirection = gVDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
696 resDetailsBPixX_[detid_db].rOrZDirection =
697 resDetailsBPixX_[detid_db].rDirection;
701 if (resDetailsBPixY_.find(detid_db) == resDetailsBPixY_.end()) {
702 resDetailsBPixY_[detid_db].rDirection = gWDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
703 resDetailsBPixY_[detid_db].zDirection = gVDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
704 resDetailsBPixY_[detid_db].rOrZDirection =
705 resDetailsBPixY_[detid_db].rDirection;
708 hHitCountVsThetaBPix->Fill(GP.
theta());
709 hHitCountVsPhiBPix->Fill(GP.
phi());
711 hHitCountVsZBPix->Fill(GP.
z());
712 hHitCountVsXBPix->Fill(GP.
x());
713 hHitCountVsYBPix->Fill(GP.
y());
715 hBPixResXPrime->Fill(uOrientation * resX *
cmToUm);
716 hBPixResYPrime->Fill(vOrientation * resY *
cmToUm);
717 hBPixResXPull->Fill(pullX);
718 hBPixResYPull->Fill(pullY);
723 this->updateOnlineMomenta(resDetailsBPixX_, detid_db, uOrientation * resX *
cmToUm, pullX);
726 this->updateOnlineMomenta(resDetailsBPixY_, detid_db, vOrientation * resY *
cmToUm, pullY);
734 uOrientation = gUDirection.
perp() - gPModule.
perp() >= 0 ? +1.F : -1.F;
737 int side_num = tTopo->
pxfSide(detid_db);
738 int disk_num = tTopo->
pxfDisk(detid_db);
740 int packedTopo = disk_num + 3 * (side_num - 1);
744 hHitCountVsThetaFPix->Fill(GP.
theta());
745 hHitCountVsPhiFPix->Fill(GP.
phi());
747 hHitCountVsZFPix->Fill(GP.
z());
748 hHitCountVsXFPix->Fill(GP.
x());
749 hHitCountVsYFPix->Fill(GP.
y());
751 hFPixResXPrime->Fill(uOrientation * resX *
cmToUm);
752 hFPixResYPrime->Fill(vOrientation * resY *
cmToUm);
753 hFPixResXPull->Fill(pullX);
754 hFPixResYPull->Fill(pullY);
762 if (resDetailsFPixX_.find(detid_db) == resDetailsFPixX_.end()) {
763 resDetailsFPixX_[detid_db].rDirection = gUDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
764 resDetailsFPixX_[detid_db].zDirection = gWDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
765 resDetailsFPixX_[detid_db].rOrZDirection =
766 resDetailsFPixX_[detid_db].zDirection;
770 if (resDetailsFPixY_.find(detid_db) == resDetailsFPixY_.end()) {
771 resDetailsFPixY_[detid_db].rDirection = gUDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
772 resDetailsFPixY_[detid_db].zDirection = gWDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
773 resDetailsFPixY_[detid_db].rOrZDirection =
774 resDetailsFPixY_[detid_db].zDirection;
778 this->updateOnlineMomenta(resDetailsFPixX_, detid_db, uOrientation * resX *
cmToUm, pullX);
781 this->updateOnlineMomenta(resDetailsFPixY_, detid_db, vOrientation * resY *
cmToUm, pullY);
784 hHitCountVsXFPixMinus->Fill(GP.
x());
785 hHitCountVsYFPixMinus->Fill(GP.
y());
786 hHitCountVsZFPixMinus->Fill(GP.
z());
787 hHitCountVsThetaFPixMinus->Fill(GP.
theta());
788 hHitCountVsPhiFPixMinus->Fill(GP.
phi());
790 hFPixZMinusResXPrime->Fill(uOrientation * resX *
cmToUm);
791 hFPixZMinusResYPrime->Fill(vOrientation * resY *
cmToUm);
792 hFPixZMinusResXPull->Fill(pullX);
793 hFPixZMinusResYPull->Fill(pullY);
796 hHitCountVsXFPixPlus->Fill(GP.
x());
797 hHitCountVsYFPixPlus->Fill(GP.
y());
798 hHitCountVsZFPixPlus->Fill(GP.
z());
799 hHitCountVsThetaFPixPlus->Fill(GP.
theta());
800 hHitCountVsPhiFPixPlus->Fill(GP.
phi());
802 hFPixZPlusResXPrime->Fill(uOrientation * resX *
cmToUm);
803 hFPixZPlusResYPrime->Fill(vOrientation * resY *
cmToUm);
804 hFPixZPlusResXPull->Fill(pullX);
805 hFPixZPlusResYPull->Fill(pullY);
813 hHit2D->Fill(nHit2D);
814 hHit->Fill(
track.numberOfValidHits());
815 hnhpxb->Fill(
track.hitPattern().numberOfValidPixelBarrelHits());
816 hnhpxe->Fill(
track.hitPattern().numberOfValidPixelEndcapHits());
817 hnhTIB->Fill(
track.hitPattern().numberOfValidStripTIBHits());
818 hnhTID->Fill(
track.hitPattern().numberOfValidStripTIDHits());
819 hnhTOB->Fill(
track.hitPattern().numberOfValidStripTOBHits());
820 hnhTEC->Fill(
track.hitPattern().numberOfValidStripTECHits());
822 runHitsMap_[
event.run()][0] +=
track.hitPattern().numberOfValidPixelBarrelHits();
823 runHitsMap_[
event.run()][1] +=
track.hitPattern().numberOfValidPixelEndcapHits();
824 runHitsMap_[
event.run()][2] +=
track.hitPattern().numberOfValidStripTIBHits();
825 runHitsMap_[
event.run()][3] +=
track.hitPattern().numberOfValidStripTIDHits();
826 runHitsMap_[
event.run()][4] +=
track.hitPattern().numberOfValidStripTOBHits();
827 runHitsMap_[
event.run()][5] +=
track.hitPattern().numberOfValidStripTECHits();
830 if (
track.hitPattern().numberOfValidPixelBarrelHits() != 0) {
831 hHitComposition->Fill(0.,
track.hitPattern().numberOfValidPixelBarrelHits());
833 pNBpixHitsVsVx->Fill(
track.vx(),
track.hitPattern().numberOfValidPixelBarrelHits());
834 pNBpixHitsVsVy->Fill(
track.vy(),
track.hitPattern().numberOfValidPixelBarrelHits());
835 pNBpixHitsVsVz->Fill(
track.vz(),
track.hitPattern().numberOfValidPixelBarrelHits());
837 if (
track.hitPattern().numberOfValidPixelEndcapHits() != 0) {
838 hHitComposition->Fill(1.,
track.hitPattern().numberOfValidPixelEndcapHits());
840 if (
track.hitPattern().numberOfValidStripTIBHits() != 0) {
841 hHitComposition->Fill(2.,
track.hitPattern().numberOfValidStripTIBHits());
843 if (
track.hitPattern().numberOfValidStripTIDHits() != 0) {
844 hHitComposition->Fill(3.,
track.hitPattern().numberOfValidStripTIDHits());
846 if (
track.hitPattern().numberOfValidStripTOBHits() != 0) {
847 hHitComposition->Fill(4.,
track.hitPattern().numberOfValidStripTOBHits());
849 if (
track.hitPattern().numberOfValidStripTECHits() != 0) {
850 hHitComposition->Fill(5.,
track.hitPattern().numberOfValidStripTECHits());
853 hCharge->Fill(
track.charge());
854 hQoverP->Fill(
track.qoverp());
855 hQoverPZoom->Fill(
track.qoverp());
856 hPt->Fill(
track.pt());
858 hchi2ndof->Fill(
track.normalizedChi2());
859 hEta->Fill(
track.eta());
860 hPhi->Fill(
track.phi());
862 if (fabs(
track.eta()) < 0.8)
863 hPhiBarrel->Fill(
track.phi());
865 hPhiOverlapPlus->Fill(
track.phi());
867 hPhiOverlapMinus->Fill(
track.phi());
868 if (
track.eta() > 1.4)
869 hPhiEndcapPlus->Fill(
track.phi());
870 if (
track.eta() < -1.4)
871 hPhiEndcapMinus->Fill(
track.phi());
873 hd0->Fill(
track.d0());
874 hdz->Fill(
track.dz());
875 hdxy->Fill(
track.dxy());
876 hvx->Fill(
track.vx());
877 hvy->Fill(
track.vy());
878 hvz->Fill(
track.vz());
880 htrkAlgo->Fill(
track.algo());
885 htrkQuality->Fill(myquality);
889 htrkQuality->Fill(myquality);
893 htrkQuality->Fill(myquality);
897 htrkQuality->Fill(myquality);
898 hPhp->Fill(
track.p());
899 hPthp->Fill(
track.pt());
900 hHithp->Fill(
track.numberOfValidHits());
901 hEtahp->Fill(
track.eta());
902 hPhihp->Fill(
track.phi());
903 hchi2ndofhp->Fill(
track.normalizedChi2());
904 hchi2Probhp->Fill(TMath::Prob(
track.chi2(),
track.ndof()));
909 htrkQuality->Fill(myquality);
913 htrkQuality->Fill(myquality);
917 static const int etaindex = this->GetIndex(vTrackHistos_,
"h_tracketa");
918 vTrackHistos_[etaindex]->Fill(
track.eta());
919 static const int phiindex = this->GetIndex(vTrackHistos_,
"h_trackphi");
920 vTrackHistos_[phiindex]->Fill(
track.phi());
921 static const int numOfValidHitsindex = this->GetIndex(vTrackHistos_,
"h_trackNumberOfValidHits");
922 vTrackHistos_[numOfValidHitsindex]->Fill(
track.numberOfValidHits());
923 static const int numOfLostHitsindex = this->GetIndex(vTrackHistos_,
"h_trackNumberOfLostHits");
924 vTrackHistos_[numOfLostHitsindex]->Fill(
track.numberOfLostHits());
927 double theLocalMagFieldInInverseGeV = magneticField_->
inInverseGeV(gPoint).
z();
928 double kappa = -
track.charge() * theLocalMagFieldInInverseGeV /
track.pt();
930 static const int kappaindex = this->GetIndex(vTrackHistos_,
"h_curvature");
931 vTrackHistos_[kappaindex]->Fill(
kappa);
932 static const int kappaposindex = this->GetIndex(vTrackHistos_,
"h_curvature_pos");
933 if (
track.charge() > 0)
934 vTrackHistos_[kappaposindex]->
Fill(fabs(
kappa));
935 static const int kappanegindex = this->GetIndex(vTrackHistos_,
"h_curvature_neg");
936 if (
track.charge() < 0)
937 vTrackHistos_[kappanegindex]->
Fill(fabs(
kappa));
939 double chi2Prob = TMath::Prob(
track.chi2(),
track.ndof());
940 double normchi2 =
track.normalizedChi2();
942 static const int normchi2index = this->GetIndex(vTrackHistos_,
"h_normchi2");
943 vTrackHistos_[normchi2index]->Fill(normchi2);
944 static const int chi2index = this->GetIndex(vTrackHistos_,
"h_chi2");
945 vTrackHistos_[chi2index]->Fill(
track.chi2());
946 static const int chi2Probindex = this->GetIndex(vTrackHistos_,
"h_chi2Prob");
947 vTrackHistos_[chi2Probindex]->Fill(chi2Prob);
948 static const int ptindex = this->GetIndex(vTrackHistos_,
"h_pt");
949 static const int pt2index = this->GetIndex(vTrackHistos_,
"h_ptrebin");
950 vTrackHistos_[ptindex]->Fill(
track.pt());
951 vTrackHistos_[pt2index]->Fill(
track.pt());
952 if (
track.ptError() != 0.) {
953 static const int ptResolutionindex = this->GetIndex(vTrackHistos_,
"h_ptResolution");
954 vTrackHistos_[ptResolutionindex]->Fill(
track.ptError() /
track.pt());
957 static const int d0phiindex = this->GetIndex(vTrackProfiles_,
"p_d0_vs_phi");
958 vTrackProfiles_[d0phiindex]->Fill(
track.phi(),
track.d0());
959 static const int dzphiindex = this->GetIndex(vTrackProfiles_,
"p_dz_vs_phi");
960 vTrackProfiles_[dzphiindex]->Fill(
track.phi(),
track.dz());
961 static const int d0etaindex = this->GetIndex(vTrackProfiles_,
"p_d0_vs_eta");
962 vTrackProfiles_[d0etaindex]->Fill(
track.eta(),
track.d0());
963 static const int dzetaindex = this->GetIndex(vTrackProfiles_,
"p_dz_vs_eta");
964 vTrackProfiles_[dzetaindex]->Fill(
track.eta(),
track.dz());
965 static const int chiProbphiindex = this->GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_phi");
966 vTrackProfiles_[chiProbphiindex]->Fill(
track.phi(), chi2Prob);
967 static const int chiProbabsd0index = this->GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_d0");
968 vTrackProfiles_[chiProbabsd0index]->Fill(fabs(
track.d0()), chi2Prob);
969 static const int chiProbabsdzindex = this->GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_dz");
970 vTrackProfiles_[chiProbabsdzindex]->Fill(
track.dz(), chi2Prob);
971 static const int chiphiindex = this->GetIndex(vTrackProfiles_,
"p_chi2_vs_phi");
972 vTrackProfiles_[chiphiindex]->Fill(
track.phi(),
track.chi2());
973 static const int normchiphiindex = this->GetIndex(vTrackProfiles_,
"p_normchi2_vs_phi");
974 vTrackProfiles_[normchiphiindex]->Fill(
track.phi(), normchi2);
975 static const int chietaindex = this->GetIndex(vTrackProfiles_,
"p_chi2_vs_eta");
976 vTrackProfiles_[chietaindex]->Fill(
track.eta(),
track.chi2());
977 static const int normchiptindex = this->GetIndex(vTrackProfiles_,
"p_normchi2_vs_pt");
978 vTrackProfiles_[normchiptindex]->Fill(
track.pt(), normchi2);
979 static const int normchipindex = this->GetIndex(vTrackProfiles_,
"p_normchi2_vs_p");
980 vTrackProfiles_[normchipindex]->Fill(
track.p(), normchi2);
981 static const int chiProbetaindex = this->GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_eta");
982 vTrackProfiles_[chiProbetaindex]->Fill(
track.eta(), chi2Prob);
983 static const int normchietaindex = this->GetIndex(vTrackProfiles_,
"p_normchi2_vs_eta");
984 vTrackProfiles_[normchietaindex]->Fill(
track.eta(), normchi2);
985 static const int kappaphiindex = this->GetIndex(vTrackProfiles_,
"p_kappa_vs_phi");
986 vTrackProfiles_[kappaphiindex]->Fill(
track.phi(),
kappa);
987 static const int kappaetaindex = this->GetIndex(vTrackProfiles_,
"p_kappa_vs_eta");
988 vTrackProfiles_[kappaetaindex]->Fill(
track.eta(),
kappa);
989 static const int ptResphiindex = this->GetIndex(vTrackProfiles_,
"p_ptResolution_vs_phi");
990 vTrackProfiles_[ptResphiindex]->Fill(
track.phi(),
track.ptError() /
track.pt());
991 static const int ptResetaindex = this->GetIndex(vTrackProfiles_,
"p_ptResolution_vs_eta");
992 vTrackProfiles_[ptResetaindex]->Fill(
track.eta(),
track.ptError() /
track.pt());
995 static const int d0phiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_d0_vs_phi");
996 vTrack2DHistos_[d0phiindex_2d]->Fill(
track.phi(),
track.d0());
997 static const int dzphiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_dz_vs_phi");
998 vTrack2DHistos_[dzphiindex_2d]->Fill(
track.phi(),
track.dz());
999 static const int d0etaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_d0_vs_eta");
1000 vTrack2DHistos_[d0etaindex_2d]->Fill(
track.eta(),
track.d0());
1001 static const int dzetaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_dz_vs_eta");
1002 vTrack2DHistos_[dzetaindex_2d]->Fill(
track.eta(),
track.dz());
1003 static const int chiphiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_chi2_vs_phi");
1004 vTrack2DHistos_[chiphiindex_2d]->Fill(
track.phi(),
track.chi2());
1005 static const int chiProbphiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_chi2Prob_vs_phi");
1006 vTrack2DHistos_[chiProbphiindex_2d]->Fill(
track.phi(), chi2Prob);
1007 static const int chiProbabsd0index_2d = this->GetIndex(vTrack2DHistos_,
"h2_chi2Prob_vs_d0");
1008 vTrack2DHistos_[chiProbabsd0index_2d]->Fill(fabs(
track.d0()), chi2Prob);
1009 static const int normchiphiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_normchi2_vs_phi");
1010 vTrack2DHistos_[normchiphiindex_2d]->Fill(
track.phi(), normchi2);
1011 static const int chietaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_chi2_vs_eta");
1012 vTrack2DHistos_[chietaindex_2d]->Fill(
track.eta(),
track.chi2());
1013 static const int chiProbetaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_chi2Prob_vs_eta");
1014 vTrack2DHistos_[chiProbetaindex_2d]->Fill(
track.eta(), chi2Prob);
1015 static const int normchietaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_normchi2_vs_eta");
1016 vTrack2DHistos_[normchietaindex_2d]->Fill(
track.eta(), normchi2);
1017 static const int kappaphiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_kappa_vs_phi");
1018 vTrack2DHistos_[kappaphiindex_2d]->Fill(
track.phi(),
kappa);
1019 static const int kappaetaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_kappa_vs_eta");
1020 vTrack2DHistos_[kappaetaindex_2d]->Fill(
track.eta(),
kappa);
1021 static const int normchi2kappa_2d = this->GetIndex(vTrack2DHistos_,
"h2_normchi2_vs_kappa");
1022 vTrack2DHistos_[normchi2kappa_2d]->Fill(normchi2,
kappa);
1029 event.getByToken(beamspotToken, beamSpotHandle);
1030 if (beamSpotHandle.
isValid()) {
1044 event.getByLabel(
"offlinePrimaryVertices", vertexHandle);
1045 double mindxy = 100.;
1048 for (reco::VertexCollection::const_iterator pvtx = vertexHandle->begin(); pvtx != vertexHandle->end(); ++pvtx) {
1051 mindxy =
track.dxy(mypoint);
1057 hdxyPV->Fill(mindxy);
1058 hd0PV->Fill(-mindxy);
1061 hd0PVvsphi->Fill(
track.phi(), -mindxy);
1062 hd0PVvseta->Fill(
track.eta(), -mindxy);
1063 hd0PVvspt->Fill(
track.pt(), -mindxy);
1076 hNtrk->Fill(tC.size());
1077 hNtrkZoom->Fill(tC.size());
1078 hNhighPurity->Fill(nHighPurityTracks);
1087 TH1D::SetDefaultSumw2(kTRUE);
1092 hrun = fs->
make<TH1D>(
"h_run",
"run", 100000, 230000, 240000);
1093 hlumi = fs->
make<TH1D>(
"h_lumi",
"lumi", 1000, 0, 1000);
1097 hchi2ndof = fs->
make<TH1D>(
"h_chi2ndof",
"chi2/ndf;#chi^{2}/ndf;tracks", 100, 0, 5.);
1098 hCharge = fs->
make<TH1D>(
"h_charge",
"charge;Charge of the track;tracks", 5, -2.5, 2.5);
1099 hNtrk = fs->
make<TH1D>(
"h_Ntrk",
"ntracks;Number of Tracks;events", 200, 0., 200.);
1100 hNtrkZoom = fs->
make<TH1D>(
"h_NtrkZoom",
"Number of tracks; number of tracks;events", 10, 0., 10.);
1101 hNhighPurity = fs->
make<TH1D>(
"h_NhighPurity",
"n. high purity tracks;Number of high purity tracks;events", 200, 0., 200.);
1104 htrkAlgo = fs->
make<TH1I>(
"h_trkAlgo",
"tracking step;iterative tracking step;tracks", nAlgos, -0.5, nAlgos - 0.5);
1105 for (
int nbin = 1; nbin <= htrkAlgo->GetNbinsX(); nbin++) {
1109 htrkQuality = fs->
make<TH1I>(
"h_trkQuality",
"track quality;track quality;tracks", 6, -1, 5);
1110 std::string qualities[7] = {
"undef",
"loose",
"tight",
"highPurity",
"confirmed",
"goodIterative"};
1111 for (
int nbin = 1; nbin <= htrkQuality->GetNbinsX(); nbin++) {
1112 htrkQuality->GetXaxis()->SetBinLabel(nbin, qualities[nbin - 1].c_str());
1115 hP = fs->
make<TH1D>(
"h_P",
"Momentum;track momentum [GeV];tracks", 100, 0., 100.);
1116 hQoverP = fs->
make<TH1D>(
"h_qoverp",
"Track q/p; track q/p [GeV^{-1}];tracks", 100, -1., 1.);
1117 hQoverPZoom = fs->
make<TH1D>(
"h_qoverpZoom",
"Track q/p; track q/p [GeV^{-1}];tracks", 100, -0.1, 0.1);
1118 hPt = fs->
make<TH1D>(
"h_Pt",
"Transverse Momentum;track p_{T} [GeV];tracks", 100, 0., 100.);
1119 hHit = fs->
make<TH1D>(
"h_nHits",
"Number of hits;track n. hits;tracks", 50, -0.5, 49.5);
1120 hHit2D = fs->
make<TH1D>(
"h_nHit2D",
"Number of 2D hits; number of 2D hits;tracks", 20, 0, 20);
1124 hBPixResXPrime = fs->
make<TH1D>(
"h_BPixResXPrime",
"BPix track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1125 hFPixResXPrime = fs->
make<TH1D>(
"h_FPixResXPrime",
"FPix track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1126 hFPixZPlusResXPrime = fs->
make<TH1D>(
"h_FPixZPlusResXPrime",
"FPix (Z+) track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1127 hFPixZMinusResXPrime = fs->
make<TH1D>(
"h_FPixZMinusResXPrime",
"FPix (Z-) track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1129 hBPixResYPrime = fs->
make<TH1D>(
"h_BPixResYPrime",
"BPix track Y-residuals;res_{Y'} [#mum];hits", 100, -1000., 1000.);
1130 hFPixResYPrime = fs->
make<TH1D>(
"h_FPixResYPrime",
"FPix track Y-residuals;res_{Y'} [#mum];hits", 100, -1000., 1000.);
1131 hFPixZPlusResYPrime = fs->
make<TH1D>(
"h_FPixZPlusResYPrime",
"FPix (Z+) track Y-residuals;res_{Y'} [#mum];hits", 100, -1000., 1000.);
1132 hFPixZMinusResYPrime = fs->
make<TH1D>(
"h_FPixZMinusResYPrime",
"FPix (Z-) track Y-residuals;res_{Y'} [#mum];hits", 100, -1000., 1000.);
1134 hBPixResXPull = fs->
make<TH1D>(
"h_BPixResXPull",
"BPix track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1135 hFPixResXPull = fs->
make<TH1D>(
"h_FPixResXPull",
"FPix track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1136 hFPixZPlusResXPull = fs->
make<TH1D>(
"h_FPixZPlusResXPull",
"FPix (Z+) track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1137 hFPixZMinusResXPull = fs->
make<TH1D>(
"h_FPixZMinusResXPull",
"FPix (Z-) track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1139 hBPixResYPull = fs->
make<TH1D>(
"h_BPixResYPull",
"BPix track Y-pulls;res_{Y'}/#sigma_{res_{Y'}};hits", 100, -5., 5.);
1140 hFPixResYPull = fs->
make<TH1D>(
"h_FPixResYPull",
"FPix track Y-pulls;res_{Y'}/#sigma_{res_{Y'}};hits", 100, -5., 5.);
1141 hFPixZPlusResYPull = fs->
make<TH1D>(
"h_FPixZPlusResYPull",
"FPix (Z+) track Y-pulls;res_{Y'}/#sigma_{res_{Y'}};hits", 100, -5., 5.);
1142 hFPixZMinusResYPull = fs->
make<TH1D>(
"h_FPixZMinusResYPull",
"FPix (Z-) track Y-pulls;res_{Y'}/#sigma_{res_{Y'}};hits", 100, -5., 5.);
1146 hTIBResXPrime = fs->
make<TH1D>(
"h_TIBResXPrime",
"TIB track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1147 hTOBResXPrime = fs->
make<TH1D>(
"h_TOBResXPrime",
"TOB track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1148 hTIDResXPrime = fs->
make<TH1D>(
"h_TIDResXPrime",
"TID track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1149 hTECResXPrime = fs->
make<TH1D>(
"h_TECResXPrime",
"TEC track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1151 hTIBResXPull = fs->
make<TH1D>(
"h_TIBResXPull",
"TIB track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1152 hTOBResXPull = fs->
make<TH1D>(
"h_TOBResXPull",
"TOB track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1153 hTIDResXPull = fs->
make<TH1D>(
"h_TIDResXPull",
"TID track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1154 hTECResXPull = fs->
make<TH1D>(
"h_TECResXPull",
"TEC track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1158 hHitCountVsZBPix = fs->
make<TH1D>(
"h_HitCountVsZBpix",
"Number of BPix hits vs z;hit global z;hits", 60, -30, 30);
1159 hHitCountVsZFPix = fs->
make<TH1D>(
"h_HitCountVsZFpix",
"Number of FPix hits vs z;hit global z;hits", 100, -100, 100);
1161 hHitCountVsXBPix = fs->
make<TH1D>(
"h_HitCountVsXBpix",
"Number of BPix hits vs x;hit global x;hits", 20, -20, 20);
1162 hHitCountVsXFPix = fs->
make<TH1D>(
"h_HitCountVsXFpix",
"Number of FPix hits vs x;hit global x;hits", 20, -20, 20);
1164 hHitCountVsYBPix = fs->
make<TH1D>(
"h_HitCountVsYBpix",
"Number of BPix hits vs y;hit global y;hits", 20, -20, 20);
1165 hHitCountVsYFPix = fs->
make<TH1D>(
"h_HitCountVsYFpix",
"Number of FPix hits vs y;hit global y;hits", 20, -20, 20);
1167 hHitCountVsThetaBPix = fs->
make<TH1D>(
"h_HitCountVsThetaBpix",
"Number of BPix hits vs #theta;hit global #theta;hits", 20, 0.,
M_PI);
1168 hHitCountVsPhiBPix = fs->
make<TH1D>(
"h_HitCountVsPhiBpix",
"Number of BPix hits vs #phi;hit global #phi;hits", 20, -
M_PI,
M_PI);
1170 hHitCountVsThetaFPix = fs->
make<TH1D>(
"h_HitCountVsThetaFpix",
"Number of FPix hits vs #theta;hit global #theta;hits", 40, 0.,
M_PI);
1171 hHitCountVsPhiFPix = fs->
make<TH1D>(
"h_HitCountVsPhiFpix",
"Number of FPix hits vs #phi;hit global #phi;hits", 20, -
M_PI,
M_PI);
1175 hHitCountVsZFPixPlus = fs->
make<TH1D>(
"h_HitCountVsZFPixPlus",
"Number of FPix(Z+) hits vs z;hit global z;hits", 60, 15., 60);
1176 hHitCountVsZFPixMinus = fs->
make<TH1D>(
"h_HitCountVsZFPixMinus",
"Number of FPix(Z-) hits vs z;hit global z;hits", 100, -60., -15.);
1178 hHitCountVsXFPixPlus = fs->
make<TH1D>(
"h_HitCountVsXFPixPlus",
"Number of FPix(Z+) hits vs x;hit global x;hits", 20, -20, 20);
1179 hHitCountVsXFPixMinus = fs->
make<TH1D>(
"h_HitCountVsXFPixMinus",
"Number of FPix(Z-) hits vs x;hit global x;hits", 20, -20, 20);
1181 hHitCountVsYFPixPlus = fs->
make<TH1D>(
"h_HitCountVsYFPixPlus",
"Number of FPix(Z+) hits vs y;hit global y;hits", 20, -20, 20);
1182 hHitCountVsYFPixMinus = fs->
make<TH1D>(
"h_HitCountVsYFPixMinus",
"Number of FPix(Z-) hits vs y;hit global y;hits", 20, -20, 20);
1184 hHitCountVsThetaFPixPlus = fs->
make<TH1D>(
"h_HitCountVsThetaFPixPlus",
"Number of FPix(Z+) hits vs #theta;hit global #theta;hits", 20, 0.,
M_PI);
1185 hHitCountVsPhiFPixPlus = fs->
make<TH1D>(
"h_HitCountVsPhiFPixPlus",
"Number of FPix(Z+) hits vs #phi;hit global #phi;hits",20,-
M_PI,
M_PI);
1187 hHitCountVsThetaFPixMinus = fs->
make<TH1D>(
"h_HitCountVsThetaFPixMinus",
"Number of FPix(Z+) hits vs #theta;hit global #theta;hits", 40, 0.,
M_PI);
1188 hHitCountVsPhiFPixMinus = fs->
make<TH1D>(
"h_HitCountVsPhiFPixMinus",
"Number of FPix(Z+) hits vs #phi;hit global #phi;hits",20,-
M_PI,
M_PI);
1191 barrelLayersResidualsX = bookResidualsHistogram(ByLayerResiduals, 4,
"X",
"Res",
"BPix");
1192 endcapDisksResidualsX = bookResidualsHistogram(ByLayerResiduals, 6,
"X",
"Res",
"FPix");
1193 barrelLayersResidualsY = bookResidualsHistogram(ByLayerResiduals, 4,
"Y",
"Res",
"BPix");
1194 endcapDisksResidualsY = bookResidualsHistogram(ByLayerResiduals, 6,
"Y",
"Res",
"FPix");
1197 barrelLayersPullsX = bookResidualsHistogram(ByLayerPulls, 4,
"X",
"Pull",
"BPix");
1198 endcapDisksPullsX = bookResidualsHistogram(ByLayerPulls, 6,
"X",
"Pull",
"FPix");
1199 barrelLayersPullsY = bookResidualsHistogram(ByLayerPulls, 4,
"Y",
"Pull",
"BPix");
1200 endcapDisksPullsY = bookResidualsHistogram(ByLayerPulls, 6,
"Y",
"Pull",
"FPix");
1202 hEta = fs->
make<TH1D>(
"h_Eta",
"Track pseudorapidity; track #eta;tracks", 100, -
M_PI,
M_PI);
1203 hPhi = fs->
make<TH1D>(
"h_Phi",
"Track azimuth; track #phi;tracks", 100, -
M_PI,
M_PI);
1205 hPhiBarrel = fs->
make<TH1D>(
"h_PhiBarrel",
"hPhiBarrel (0<|#eta|<0.8);track #Phi;tracks", 100, -
M_PI,
M_PI);
1206 hPhiOverlapPlus = fs->
make<TH1D>(
"h_PhiOverlapPlus",
"hPhiOverlapPlus (0.8<#eta<1.4);track #phi;tracks", 100, -
M_PI,
M_PI);
1207 hPhiOverlapMinus = fs->
make<TH1D>(
"h_PhiOverlapMinus",
"hPhiOverlapMinus (-1.4<#eta<-0.8);track #phi;tracks", 100, -
M_PI,
M_PI);
1208 hPhiEndcapPlus = fs->
make<TH1D>(
"h_PhiEndcapPlus",
"hPhiEndcapPlus (#eta>1.4);track #phi;track", 100, -
M_PI,
M_PI);
1209 hPhiEndcapMinus = fs->
make<TH1D>(
"h_PhiEndcapMinus",
"hPhiEndcapMinus (#eta<1.4);track #phi;tracks", 100, -
M_PI,
M_PI);
1212 hPhp = fs->
make<TH1D>(
"h_P_hp",
"Momentum (high purity);track momentum [GeV];tracks", 100, 0., 100.);
1213 hPthp = fs->
make<TH1D>(
"h_Pt_hp",
"Transverse Momentum (high purity);track p_{T} [GeV];tracks", 100, 0., 100.);
1214 hHithp = fs->
make<TH1D>(
"h_nHit_hp",
"Number of hits (high purity);track n. hits;tracks", 30, 0, 30);
1215 hEtahp = fs->
make<TH1D>(
"h_Eta_hp",
"Track pseudorapidity (high purity); track #eta;tracks", 100, -
M_PI,
M_PI);
1216 hPhihp = fs->
make<TH1D>(
"h_Phi_hp",
"Track azimuth (high purity); track #phi;tracks", 100, -
M_PI,
M_PI);
1217 hchi2ndofhp = fs->
make<TH1D>(
"h_chi2ndof_hp",
"chi2/ndf (high purity);#chi^{2}/ndf;tracks", 100, 0, 5.);
1218 hchi2Probhp = fs->
make<TH1D>(
"hchi2_Prob_hp",
"#chi^{2} probability (high purity);#chi^{2}prob_{Track};Number of Tracks", 100, 0.0, 1.);
1220 hvx = fs->
make<TH1D>(
"h_vx",
"Track v_{x} ; track v_{x} [cm];tracks", 100, -1.5, 1.5);
1221 hvy = fs->
make<TH1D>(
"h_vy",
"Track v_{y} ; track v_{y} [cm];tracks", 100, -1.5, 1.5);
1222 hvz = fs->
make<TH1D>(
"h_vz",
"Track v_{z} ; track v_{z} [cm];tracks", 100, -20., 20.);
1223 hd0 = fs->
make<TH1D>(
"h_d0",
"Track d_{0} ; track d_{0} [cm];tracks", 100, -1., 1.);
1224 hdxy = fs->
make<TH1D>(
"h_dxy",
"Track d_{xy}; track d_{xy} [cm]; tracks", 100, -0.5, 0.5);
1225 hdz = fs->
make<TH1D>(
"h_dz",
"Track d_{z} ; track d_{z} [cm]; tracks", 100, -20, 20);
1227 hd0PVvsphi = fs->
make<TH2D>(
"h2_d0PVvsphi",
"hd0PVvsphi;track #phi;track d_{0}(PV) [cm]", 160, -
M_PI,
M_PI, 100, -1., 1.);
1228 hd0PVvseta = fs->
make<TH2D>(
"h2_d0PVvseta",
"hdPV0vseta;track #eta;track d_{0}(PV) [cm]", 160, -2.5, 2.5, 100, -1., 1.);
1229 hd0PVvspt = fs->
make<TH2D>(
"h2_d0PVvspt",
"hdPV0vspt;track p_{T};d_{0}(PV) [cm]", 50, 0., 100., 100, -1, 1.);
1231 hdxyBS = fs->
make<TH1D>(
"h_dxyBS",
"hdxyBS; track d_{xy}(BS) [cm];tracks", 100, -0.1, 0.1);
1232 hd0BS = fs->
make<TH1D>(
"h_d0BS",
"hd0BS ; track d_{0}(BS) [cm];tracks", 100, -0.1, 0.1);
1233 hdzBS = fs->
make<TH1D>(
"h_dzBS",
"hdzBS ; track d_{z}(BS) [cm];tracks", 100, -12, 12);
1234 hdxyPV = fs->
make<TH1D>(
"h_dxyPV",
"hdxyPV; track d_{xy}(PV) [cm];tracks", 100, -0.1, 0.1);
1235 hd0PV = fs->
make<TH1D>(
"h_d0PV",
"hd0PV ; track d_{0}(PV) [cm];tracks", 100, -0.15, 0.15);
1236 hdzPV = fs->
make<TH1D>(
"h_dzPV",
"hdzPV ; track d_{z}(PV) [cm];tracks", 100, -0.1, 0.1);
1238 hnhTIB = fs->
make<TH1D>(
"h_nHitTIB",
"nhTIB;# hits in TIB; tracks", 20, 0., 20.);
1239 hnhTID = fs->
make<TH1D>(
"h_nHitTID",
"nhTID;# hits in TID; tracks", 20, 0., 20.);
1240 hnhTOB = fs->
make<TH1D>(
"h_nHitTOB",
"nhTOB;# hits in TOB; tracks", 20, 0., 20.);
1241 hnhTEC = fs->
make<TH1D>(
"h_nHitTEC",
"nhTEC;# hits in TEC; tracks", 20, 0., 20.);
1244 hvx = fs->
make<TH1D>(
"h_vx",
"Track v_{x};track v_{x} [cm];tracks", 100, -100., 100.);
1245 hvy = fs->
make<TH1D>(
"h_vy",
"Track v_{y};track v_{y} [cm];tracks", 100, -100., 100.);
1246 hvz = fs->
make<TH1D>(
"h_vz",
"Track v_{z};track v_{z} [cm];track", 100, -100., 100.);
1247 hd0 = fs->
make<TH1D>(
"h_d0",
"Track d_{0};track d_{0} [cm];track", 100, -100., 100.);
1248 hdxy = fs->
make<TH1D>(
"h_dxy",
"Track d_{xy};track d_{xy} [cm];tracks", 100, -100, 100);
1249 hdz = fs->
make<TH1D>(
"h_dz",
"Track d_{z};track d_{z} [cm];tracks", 100, -200, 200);
1251 hd0vsphi = fs->
make<TH2D>(
"h2_d0vsphi",
"Track d_{0} vs #phi; track #phi;track d_{0} [cm]", 160, -3.20, 3.20, 100, -100., 100.);
1252 hd0vseta = fs->
make<TH2D>(
"h2_d0vseta",
"Track d_{0} vs #eta; track #eta;track d_{0} [cm]", 160, -3.20, 3.20, 100, -100., 100.);
1253 hd0vspt = fs->
make<TH2D>(
"h2_d0vspt",
"Track d_{0} vs p_{T};track p_{T};track d_{0} [cm]", 50, 0., 100., 100, -100, 100);
1255 hdxyBS = fs->
make<TH1D>(
"h_dxyBS",
"Track d_{xy}(BS);d_{xy}(BS) [cm];tracks", 100, -100., 100.);
1256 hd0BS = fs->
make<TH1D>(
"h_d0BS",
"Track d_{0}(BS);d_{0}(BS) [cm];tracks", 100, -100., 100.);
1257 hdzBS = fs->
make<TH1D>(
"h_dzBS",
"Track d_{z}(BS);d_{z}(BS) [cm];tracks", 100, -100., 100.);
1258 hdxyPV = fs->
make<TH1D>(
"h_dxyPV",
"Track d_{xy}(PV); d_{xy}(PV) [cm];tracks", 100, -100., 100.);
1259 hd0PV = fs->
make<TH1D>(
"h_d0PV",
"Track d_{0}(PV); d_{0}(PV) [cm];tracks", 100, -100., 100.);
1260 hdzPV = fs->
make<TH1D>(
"h_dzPV",
"Track d_{z}(PV); d_{z}(PV) [cm];tracks", 100, -100., 100.);
1262 hnhTIB = fs->
make<TH1D>(
"h_nHitTIB",
"nhTIB;# hits in TIB; tracks", 30, 0., 30.);
1263 hnhTID = fs->
make<TH1D>(
"h_nHitTID",
"nhTID;# hits in TID; tracks", 30, 0., 30.);
1264 hnhTOB = fs->
make<TH1D>(
"h_nHitTOB",
"nhTOB;# hits in TOB; tracks", 30, 0., 30.);
1265 hnhTEC = fs->
make<TH1D>(
"h_nHitTEC",
"nhTEC;# hits in TEC; tracks", 30, 0., 30.);
1268 hnhpxb = fs->
make<TH1D>(
"h_nHitPXB",
"nhpxb;# hits in Pixel Barrel; tracks", 10, 0., 10.);
1269 hnhpxe = fs->
make<TH1D>(
"h_nHitPXE",
"nhpxe;# hits in Pixel Endcap; tracks", 10, 0., 10.);
1271 hHitComposition = fs->
make<TH1D>(
"h_hitcomposition",
"track hit composition;;# hits", 6, -0.5, 5.5);
1272 pNBpixHitsVsVx = fs->
make<TProfile>(
"p_NpixHits_vs_Vx",
"n. Barrel Pixel hits vs. v_{x};v_{x} (cm);n. BPix hits", 20, -20, 20);
1273 pNBpixHitsVsVy = fs->
make<TProfile>(
"p_NpixHits_vs_Vy",
"n. Barrel Pixel hits vs. v_{y};v_{y} (cm);n. BPix hits", 20, -20, 20);
1274 pNBpixHitsVsVz = fs->
make<TProfile>(
"p_NpixHits_vs_Vz",
"n. Barrel Pixel hits vs. v_{z};v_{z} (cm);n. BPix hits", 20, -100, 100);
1276 std::string dets[6] = {
"PXB",
"PXF",
"TIB",
"TID",
"TOB",
"TEC"};
1277 for (
int i = 1;
i <= hHitComposition->GetNbinsX();
i++) {
1278 hHitComposition->GetXaxis()->SetBinLabel(
i, dets[
i - 1].c_str());
1281 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_tracketa",
"Track #eta;#eta_{Track};Number of Tracks", 90, -3., 3.));
1282 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_trackphi",
"Track #phi;#phi_{Track};Number of Tracks", 90, -
M_PI,
M_PI));
1283 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_trackNumberOfValidHits",
"Track # of valid hits;# of valid hits _{Track};Number of Tracks", 40, 0., 40.));
1284 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_trackNumberOfLostHits",
"Track # of lost hits;# of lost hits _{Track};Number of Tracks", 10, 0., 10.));
1285 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_curvature",
"Curvature #kappa;#kappa_{Track};Number of Tracks", 100, -.05, .05));
1286 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_curvature_pos",
"Curvature |#kappa| Positive Tracks;|#kappa_{pos Track}|;Number of Tracks", 100, .0, .05));
1287 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_curvature_neg",
"Curvature |#kappa| Negative Tracks;|#kappa_{neg Track}|;Number of Tracks", 100, .0, .05));
1288 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_diff_curvature",
"Curvature |#kappa| Tracks Difference;|#kappa_{Track}|;# Pos Tracks - # Neg Tracks", 100,.0,.05));
1290 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_chi2",
"Track #chi^{2};#chi^{2}_{Track};Number of Tracks", 500, -0.01, 500.));
1291 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_chi2Prob",
"#chi^{2} probability;Track Prob(#chi^{2},ndof);Number of Tracks", 100, 0.0, 1.));
1292 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_normchi2",
"#chi^{2}/ndof;#chi^{2}/ndof;Number of Tracks", 100, -0.01, 10.));
1295 double xBins[19] = {0., 0.15, 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 7., 10., 15., 25., 40., 100., 200.};
1296 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_pt",
"Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 250, 0., 250));
1297 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_ptrebin",
"Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 18,
xBins));
1299 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_ptResolution",
"#delta_{p_{T}}/p_{T}^{track};#delta_{p_{T}}/p_{T}^{track};Number of Tracks", 100, 0., 0.5));
1300 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_d0_vs_phi",
"Transverse Impact Parameter vs. #phi;#phi_{Track};#LT d_{0} #GT [cm]", 100, -
M_PI,
M_PI));
1301 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_dz_vs_phi",
"Longitudinal Impact Parameter vs. #phi;#phi_{Track};#LT d_{z} #GT [cm]", 100, -
M_PI,
M_PI));
1302 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_d0_vs_eta",
"Transverse Impact Parameter vs. #eta;#eta_{Track};#LT d_{0} #GT [cm]", 100, -
M_PI,
M_PI));
1303 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_dz_vs_eta",
"Longitudinal Impact Parameter vs. #eta;#eta_{Track};#LT d_{z} #GT [cm]", 100, -
M_PI,
M_PI));
1304 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_chi2_vs_phi",
"#chi^{2} vs. #phi;#phi_{Track};#LT #chi^{2} #GT", 100, -
M_PI,
M_PI));
1305 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_chi2Prob_vs_phi",
"#chi^{2} probablility vs. #phi;#phi_{Track};#LT #chi^{2} probability#GT",100,-
M_PI,
M_PI));
1306 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_chi2Prob_vs_d0",
"#chi^{2} probablility vs. |d_{0}|;|d_{0}|[cm];#LT #chi^{2} probability#GT", 100, 0, 80));
1307 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_chi2Prob_vs_dz",
"#chi^{2} probablility vs. dz;d_{z} [cm];#LT #chi^{2} probability#GT", 100, -30, 30));
1308 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_normchi2_vs_phi",
"#chi^{2}/ndof vs. #phi;#phi_{Track};#LT #chi^{2}/ndof #GT", 100, -
M_PI,
M_PI));
1309 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_chi2_vs_eta",
"#chi^{2} vs. #eta;#eta_{Track};#LT #chi^{2} #GT", 100, -
M_PI,
M_PI));
1310 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_normchi2_vs_pt",
"norm #chi^{2} vs. p_{T}_{Track}; p_{T}_{Track};#LT #chi^{2}/ndof #GT", 18,
xBins));
1311 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_normchi2_vs_p",
"#chi^{2}/ndof vs. p_{Track};p_{Track};#LT #chi^{2}/ndof #GT", 18,
xBins));
1312 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_chi2Prob_vs_eta",
"#chi^{2} probability vs. #eta;#eta_{Track};#LT #chi^{2} probability #GT",100,-
M_PI,
M_PI));
1313 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_normchi2_vs_eta",
"#chi^{2}/ndof vs. #eta;#eta_{Track};#LT #chi^{2}/ndof #GT", 100, -
M_PI,
M_PI));
1314 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_kappa_vs_phi",
"#kappa vs. #phi;#phi_{Track};#kappa", 100, -
M_PI,
M_PI));
1315 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_kappa_vs_eta",
"#kappa vs. #eta;#eta_{Track};#kappa", 100, -
M_PI,
M_PI));
1316 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_ptResolution_vs_phi",
"#delta_{p_{T}}/p_{T}^{track};#phi^{track};#delta_{p_{T}}/p_{T}^{track}",100,-
M_PI,
M_PI));
1317 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_ptResolution_vs_eta",
"#delta_{p_{T}}/p_{T}^{track};#eta^{track};#delta_{p_{T}}/p_{T}^{track}",100,-
M_PI,
M_PI));
1318 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_d0_vs_phi",
"Transverse Impact Parameter vs. #phi;#phi_{Track};d_{0} [cm]", 100, -
M_PI,
M_PI, 100, -1., 1.));
1319 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_dz_vs_phi",
"Longitudinal Impact Parameter vs. #phi;#phi_{Track};d_{z} [cm]",100,-
M_PI,
M_PI,100,-100.,100.));
1320 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_d0_vs_eta",
"Transverse Impact Parameter vs. #eta;#eta_{Track};d_{0} [cm]", 100, -
M_PI,
M_PI, 100, -1., 1.));
1321 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_dz_vs_eta",
"Longitudinal Impact Parameter vs. #eta;#eta_{Track};d_{z} [cm]",100,-
M_PI,
M_PI, 100,-100.,100.));
1322 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_chi2_vs_phi",
"#chi^{2} vs. #phi;#phi_{Track};#chi^{2}", 100, -
M_PI,
M_PI, 500, 0., 500.));
1323 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_chi2Prob_vs_phi",
"#chi^{2} probability vs. #phi;#phi_{Track};#chi^{2} probability",100,-
M_PI,
M_PI,100,0.,1.));
1324 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_chi2Prob_vs_d0",
"#chi^{2} probability vs. |d_{0}|;|d_{0}| [cm];#chi^{2} probability",100,0,80,100,0.,1.));
1325 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_normchi2_vs_phi",
"#chi^{2}/ndof vs. #phi;#phi_{Track};#chi^{2}/ndof", 100, -
M_PI,
M_PI, 100, 0., 10.));
1326 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_chi2_vs_eta",
"#chi^{2} vs. #eta;#eta_{Track};#chi^{2}", 100, -
M_PI,
M_PI, 500, 0., 500.));
1327 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_chi2Prob_vs_eta",
"#chi^{2} probaility vs. #eta;#eta_{Track};#chi^{2} probability",100,-
M_PI,
M_PI,100,0.,1.));
1328 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_normchi2_vs_eta",
"#chi^{2}/ndof vs. #eta;#eta_{Track};#chi^{2}/ndof", 100, -
M_PI,
M_PI, 100, 0., 10.));
1329 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_kappa_vs_phi",
"#kappa vs. #phi;#phi_{Track};#kappa", 100, -
M_PI,
M_PI, 100, .0, .05));
1330 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_kappa_vs_eta",
"#kappa vs. #eta;#eta_{Track};#kappa", 100, -
M_PI,
M_PI, 100, .0, .05));
1331 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_normchi2_vs_kappa",
"#kappa vs. #chi^{2}/ndof;#chi^{2}/ndof;#kappa", 100, 0., 10, 100, -.03, .03));
1340 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1341 edm::LogPrint(
"DMRChecker") <<
"Events run in total: " << ievt << std::endl;
1342 edm::LogPrint(
"DMRChecker") <<
"n. tracks: " << itrks << std::endl;
1343 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1345 int nFiringTriggers = triggerMap_.size();
1346 edm::LogPrint(
"DMRChecker") <<
"firing triggers: " << nFiringTriggers << std::endl;
1347 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1349 tksByTrigger_ = fs->
make<TH1D>(
1350 "tksByTrigger",
"tracks by HLT path;;% of # traks", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1351 evtsByTrigger_ = fs->
make<TH1D>(
1352 "evtsByTrigger",
"events by HLT path;;% of # events", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1356 for (
std::map<
std::string, std::pair<int, int> >::iterator it = triggerMap_.begin(); it != triggerMap_.end();
1360 double trkpercent = ((it->second).
second) * 100. / double(itrks);
1361 double evtpercent = ((it->second).
first) * 100. / double(ievt);
1365 edm::LogPrint(
"DMRChecker") <<
"HLT path: " << std::setw(60) << left << it->first <<
" | events firing: " << right
1366 << std::setw(8) << (it->second).
first <<
" (" << setw(8) <<
fixed << evtpercent
1368 <<
" | tracks collected: " << std::setw(10) << (it->second).
second <<
" (" << setw(8)
1369 <<
fixed << trkpercent <<
"%)";
1371 tksByTrigger_->SetBinContent(
i, trkpercent);
1372 tksByTrigger_->GetXaxis()->SetBinLabel(
i, (it->first).c_str());
1374 evtsByTrigger_->SetBinContent(
i, evtpercent);
1375 evtsByTrigger_->GetXaxis()->SetBinLabel(
i, (it->first).c_str());
1378 int nRuns = conditionsMap_.size();
1380 vector<int> theRuns_;
1381 for (
map<
int, std::pair<int, float> >::iterator it = conditionsMap_.begin(); it != conditionsMap_.end(); ++it) {
1382 theRuns_.push_back(it->first);
1385 sort(theRuns_.begin(), theRuns_.end());
1386 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1387 edm::LogPrint(
"DMRChecker") <<
"first run: " << theRuns_[0] << std::endl;
1388 edm::LogPrint(
"DMRChecker") <<
"last run: " << theRuns_[theRuns_.size() - 1] << std::endl;
1389 edm::LogPrint(
"DMRChecker") <<
"considered runs: " << nRuns << std::endl;
1390 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1392 modeByRun_ = fs->
make<TH1D>(
1393 "modeByRun",
"Strip APV mode by run number;;APV mode (-1=deco,+1=peak)", nRuns, -0.5, nRuns - 0.5);
1394 fieldByRun_ = fs->
make<TH1D>(
1395 "fieldByRun",
"CMS B-field intensity by run number;;B-field intensity [T]", nRuns, -0.5, nRuns - 0.5);
1398 fs->
make<TH1D>(
"tracksByRun",
"n. AlCaReco Tracks by run number;;n. of tracks", nRuns, -0.5, nRuns - 0.5);
1399 hitsByRun_ = fs->
make<TH1D>(
"histByRun",
"n. of hits by run number;;n. of hits", nRuns, -0.5, nRuns - 0.5);
1401 trackRatesByRun_ = fs->
make<TH1D>(
1402 "trackRatesByRun",
"rate of AlCaReco Tracks by run number;;n. of tracks/s", nRuns, -0.5, nRuns - 0.5);
1403 eventRatesByRun_ = fs->
make<TH1D>(
1404 "eventRatesByRun",
"rate of AlCaReco Events by run number;;n. of events/s", nRuns, -0.5, nRuns - 0.5);
1406 hitsinBPixByRun_ = fs->
make<TH1D>(
1407 "histinBPixByRun",
"n. of hits in BPix by run number;;n. of BPix hits", nRuns, -0.5, nRuns - 0.5);
1408 hitsinFPixByRun_ = fs->
make<TH1D>(
1409 "histinFPixByRun",
"n. of hits in FPix by run number;;n. of FPix hits", nRuns, -0.5, nRuns - 0.5);
1412 for (
int the_r = theRuns_[0]; the_r <= theRuns_[theRuns_.size() - 1]; the_r++) {
1413 if (conditionsMap_.find(the_r)->second.first != 0) {
1415 double runTime = timeMap_.find(the_r)->second;
1417 edm::LogPrint(
"DMRChecker") <<
"run:" << the_r <<
" | isPeak: " << std::setw(4)
1418 << conditionsMap_.find(the_r)->second.first
1419 <<
"| B-field: " << conditionsMap_.find(the_r)->second.second <<
" [T]"
1420 <<
"| events: " << setw(10) << runInfoMap_.find(the_r)->second.first
1421 <<
"(rate: " << setw(10) << (runInfoMap_.find(the_r)->second.first) / runTime
1423 <<
", tracks " << setw(10) << runInfoMap_.find(the_r)->second.second
1424 <<
"(rate: " << setw(10) << (runInfoMap_.find(the_r)->second.second) / runTime
1425 <<
" trk/s)" << std::endl;
1428 modeByRun_->SetBinContent(indexing, conditionsMap_.find(the_r)->second.first);
1429 modeByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1430 fieldByRun_->SetBinContent(indexing, conditionsMap_.find(the_r)->second.second);
1431 fieldByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1433 tracksByRun_->SetBinContent(indexing, runInfoMap_.find(the_r)->second.first);
1434 tracksByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1435 hitsByRun_->SetBinContent(indexing, runInfoMap_.find(the_r)->second.second);
1436 hitsByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1438 hitsinBPixByRun_->SetBinContent(indexing, (runHitsMap_.find(the_r)->second)[0]);
1439 hitsinBPixByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1440 hitsinFPixByRun_->SetBinContent(indexing, (runHitsMap_.find(the_r)->second)[1]);
1441 hitsinFPixByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1443 trackRatesByRun_->SetBinContent(indexing, (runInfoMap_.find(the_r)->second.second) / runTime);
1444 trackRatesByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1445 eventRatesByRun_->SetBinContent(indexing, (runInfoMap_.find(the_r)->second.first) / runTime);
1446 eventRatesByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1448 constexpr
const char *
subdets[]{
"BPix",
"FPix",
"TIB",
"TID",
"TOB",
"TEC"};
1450 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1451 edm::LogPrint(
"DMRChecker") <<
"Hits by Sub-det" << std::endl;
1453 for (
const auto &
entry : runHitsMap_.find(the_r)->second) {
1457 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1467 DMRBPixX_ = DMeanR.
make<TH1D>(
"DMRBPix-X",
"DMR of BPix-X;mean of X-residuals;modules", 100., -200, 200);
1468 DMRBPixY_ = DMeanR.
make<TH1D>(
"DMRBPix-Y",
"DMR of BPix-Y;mean of Y-residuals;modules", 100., -200, 200);
1470 DMRFPixX_ = DMeanR.
make<TH1D>(
"DMRFPix-X",
"DMR of FPix-X;mean of X-residuals;modules", 100., -200, 200);
1471 DMRFPixY_ = DMeanR.
make<TH1D>(
"DMRFPix-Y",
"DMR of FPix-Y;mean of Y-residuals;modules", 100., -200, 200);
1473 DMRTIB_ = DMeanR.
make<TH1D>(
"DMRTIB",
"DMR of TIB;mean of X-residuals;modules", 100., -200, 200);
1474 DMRTOB_ = DMeanR.
make<TH1D>(
"DMRTOB",
"DMR of TOB;mean of X-residuals;modules", 100., -200, 200);
1476 DMRTID_ = DMeanR.
make<TH1D>(
"DMRTID",
"DMR of TID;mean of X-residuals;modules", 100., -200, 200);
1477 DMRTEC_ = DMeanR.
make<TH1D>(
"DMRTEC",
"DMR of TEC;mean of X-residuals;modules", 100., -200, 200);
1481 DMRBPixXSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"BPix",
"X",
true);
1482 DMRBPixYSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"BPix",
"Y",
true);
1484 DMRFPixXSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"FPix",
"X",
false);
1485 DMRFPixYSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"FPix",
"Y",
false);
1487 DMRTIBSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"TIB",
"X",
true);
1488 DMRTOBSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"TOB",
"X",
true);
1493 DRnRBPixX_ = DRnRs.
make<TH1D>(
"DRnRBPix-X",
"DRnR of BPix-X;rms of normalized X-residuals;modules", 100., 0., 3.);
1494 DRnRBPixY_ = DRnRs.
make<TH1D>(
"DRnRBPix-Y",
"DRnR of BPix-Y;rms of normalized Y-residuals;modules", 100., 0., 3.);
1496 DRnRFPixX_ = DRnRs.
make<TH1D>(
"DRnRFPix-X",
"DRnR of FPix-X;rms of normalized X-residuals;modules", 100., 0., 3.);
1497 DRnRFPixY_ = DRnRs.
make<TH1D>(
"DRnRFPix-Y",
"DRnR of FPix-Y;rms of normalized Y-residuals;modules", 100., 0., 3.);
1499 DRnRTIB_ = DRnRs.
make<TH1D>(
"DRnRTIB",
"DRnR of TIB;rms of normalized X-residuals;modules", 100., 0., 3.);
1500 DRnRTOB_ = DRnRs.
make<TH1D>(
"DRnRTOB",
"DRnR of TOB;rms of normalized Y-residuals;modules", 100., 0., 3.);
1502 DRnRTID_ = DRnRs.
make<TH1D>(
"DRnRTID",
"DRnR of TID;rms of normalized X-residuals;modules", 100., 0., 3.);
1503 DRnRTEC_ = DRnRs.
make<TH1D>(
"DRnRTEC",
"DRnR of TEC;rms of normalized Y-residuals;modules", 100., 0., 3.);
1513 PixelDMRS_x_ByLayer = std::make_unique<PixelRegions::PixelRegionContainers>(&standaloneTopo, ph_info.
phase());
1514 PixelDMRS_y_ByLayer = std::make_unique<PixelRegions::PixelRegionContainers>(&standaloneTopo, ph_info.
phase());
1517 PixelDMRS_x_ByLayer->bookAll(
"Barrel Pixel DMRs",
"median(x'_{pred}-x'_{hit}) [#mum]",
"# modules", 100, -50, 50);
1518 PixelDMRS_y_ByLayer->bookAll(
"Barrel Pixel DMRs",
"median(y'_{pred}-y'_{hit}) [#mum]",
"# modules", 100, -50, 50);
1530 for (
auto &bpixid : resDetailsBPixX_) {
1531 DMRBPixX_->Fill(bpixid.second.runningMeanOfRes_);
1533 pixelmap->fillBarrelBin(
"DMRsX", bpixid.first, bpixid.second.runningMeanOfRes_);
1538 PixelDMRS_x_ByLayer->fill(bpixid.first, bpixid.second.runningMeanOfRes_);
1541 if (bpixid.second.rDirection > 0) {
1542 DMRBPixXSplit_[0]->Fill(bpixid.second.runningMeanOfRes_);
1544 DMRBPixXSplit_[1]->Fill(bpixid.second.runningMeanOfRes_);
1547 if (bpixid.second.hitCount < 2)
1548 DRnRBPixX_->Fill(-1);
1550 DRnRBPixX_->Fill(
sqrt(bpixid.second.runningNormVarOfRes_ / (bpixid.second.hitCount - 1)));
1553 for (
auto &bpixid : resDetailsBPixY_) {
1554 DMRBPixY_->Fill(bpixid.second.runningMeanOfRes_);
1556 pixelmap->fillBarrelBin(
"DMRsY", bpixid.first, bpixid.second.runningMeanOfRes_);
1557 PixelDMRS_y_ByLayer->fill(bpixid.first, bpixid.second.runningMeanOfRes_);
1560 if (bpixid.second.rDirection > 0) {
1561 DMRBPixYSplit_[0]->Fill(bpixid.second.runningMeanOfRes_);
1563 DMRBPixYSplit_[1]->Fill(bpixid.second.runningMeanOfRes_);
1566 if (bpixid.second.hitCount < 2)
1567 DRnRBPixY_->Fill(-1);
1569 DRnRBPixY_->Fill(
sqrt(bpixid.second.runningNormVarOfRes_ / (bpixid.second.hitCount - 1)));
1572 for (
auto &fpixid : resDetailsFPixX_) {
1573 DMRFPixX_->Fill(fpixid.second.runningMeanOfRes_);
1575 pixelmap->fillForwardBin(
"DMRsX", fpixid.first, fpixid.second.runningMeanOfRes_);
1576 PixelDMRS_x_ByLayer->fill(fpixid.first, fpixid.second.runningMeanOfRes_);
1579 if (fpixid.second.zDirection > 0) {
1580 DMRFPixXSplit_[0]->Fill(fpixid.second.runningMeanOfRes_);
1582 DMRFPixXSplit_[1]->Fill(fpixid.second.runningMeanOfRes_);
1585 if (fpixid.second.hitCount < 2)
1586 DRnRFPixX_->Fill(-1);
1588 DRnRFPixX_->Fill(
sqrt(fpixid.second.runningNormVarOfRes_ / (fpixid.second.hitCount - 1)));
1591 for (
auto &fpixid : resDetailsFPixY_) {
1592 DMRFPixY_->Fill(fpixid.second.runningMeanOfRes_);
1594 pixelmap->fillForwardBin(
"DMRsY", fpixid.first, fpixid.second.runningMeanOfRes_);
1595 PixelDMRS_y_ByLayer->fill(fpixid.first, fpixid.second.runningMeanOfRes_);
1598 if (fpixid.second.zDirection > 0) {
1599 DMRFPixYSplit_[0]->Fill(fpixid.second.runningMeanOfRes_);
1601 DMRFPixYSplit_[1]->Fill(fpixid.second.runningMeanOfRes_);
1604 if (fpixid.second.hitCount < 2)
1605 DRnRFPixY_->Fill(-1);
1607 DRnRFPixY_->Fill(
sqrt(fpixid.second.runningNormVarOfRes_ / (fpixid.second.hitCount - 1)));
1612 for (
auto &tibid : resDetailsTIB_) {
1613 DMRTIB_->Fill(tibid.second.runningMeanOfRes_);
1616 if (tibid.second.rDirection > 0) {
1617 DMRTIBSplit_[0]->Fill(tibid.second.runningMeanOfRes_);
1619 DMRTIBSplit_[1]->Fill(tibid.second.runningMeanOfRes_);
1622 if (tibid.second.hitCount < 2)
1625 DRnRTIB_->Fill(
sqrt(tibid.second.runningNormVarOfRes_ / (tibid.second.hitCount - 1)));
1628 for (
auto &tobid : resDetailsTOB_) {
1629 DMRTOB_->Fill(tobid.second.runningMeanOfRes_);
1632 if (tobid.second.rDirection > 0) {
1633 DMRTOBSplit_[0]->Fill(tobid.second.runningMeanOfRes_);
1635 DMRTOBSplit_[1]->Fill(tobid.second.runningMeanOfRes_);
1638 if (tobid.second.hitCount < 2)
1641 DRnRTOB_->Fill(
sqrt(tobid.second.runningNormVarOfRes_ / (tobid.second.hitCount - 1)));
1644 for (
auto &tidid : resDetailsTID_) {
1645 DMRTID_->Fill(tidid.second.runningMeanOfRes_);
1647 if (tidid.second.hitCount < 2)
1650 DRnRTID_->Fill(
sqrt(tidid.second.runningNormVarOfRes_ / (tidid.second.hitCount - 1)));
1653 for (
auto &tecid : resDetailsTEC_) {
1654 DMRTEC_->Fill(tecid.second.runningMeanOfRes_);
1656 if (tecid.second.hitCount < 2)
1659 DRnRTEC_->Fill(
sqrt(tecid.second.runningNormVarOfRes_ / (tecid.second.hitCount - 1)));
1662 edm::LogPrint(
"DMRChecker") <<
"n. of bpix modules " << resDetailsBPixX_.size() << std::endl;
1663 edm::LogPrint(
"DMRChecker") <<
"n. of fpix modules " << resDetailsFPixX_.size() << std::endl;
1666 pmap->save(
true, 0, 0,
"PixelHitMap.pdf", 600, 800);
1667 pmap->save(
true, 0, 0,
"PixelHitMap.png", 500, 750);
1670 tmap->save(
true, 0, 0,
"StripHitMap.pdf");
1671 tmap->save(
true, 0, 0,
"StripHitMap.png");
1674 gStyle->SetPalette(kRainBow);
1675 pixelmap->beautifyAllHistograms();
1677 TCanvas cBX(
"CanvXBarrel",
"CanvXBarrel", 1200, 1000);
1678 pixelmap->drawBarrelMaps(
"DMRsX", cBX);
1679 cBX.SaveAs(
"pixelBarrelDMR_x.png");
1681 TCanvas cFX(
"CanvXForward",
"CanvXForward", 1600, 1000);
1682 pixelmap->drawForwardMaps(
"DMRsX", cFX);
1683 cFX.SaveAs(
"pixelForwardDMR_x.png");
1685 TCanvas cBY(
"CanvYBarrel",
"CanvYBarrel", 1200, 1000);
1686 pixelmap->drawBarrelMaps(
"DMRsY", cBY);
1687 cBY.SaveAs(
"pixelBarrelDMR_y.png");
1689 TCanvas cFY(
"CanvXForward",
"CanvXForward", 1600, 1000);
1690 pixelmap->drawForwardMaps(
"DMRsY", cFY);
1691 cFY.SaveAs(
"pixelForwardDMR_y.png");
1695 gStyle->SetOptStat(
"emr");
1696 PixelDMRS_x_ByLayer->beautify(2, 0);
1697 PixelDMRS_y_ByLayer->beautify(2, 0);
1699 TCanvas DMRxBarrel(
"DMRxBarrelCanv",
"x-coordinate", 1400, 1200);
1700 DMRxBarrel.Divide(2, 2);
1701 PixelDMRS_x_ByLayer->draw(DMRxBarrel,
true,
"HISTS");
1702 adjustCanvases(DMRxBarrel,
true);
1703 for (
unsigned int c = 1;
c <= 4;
c++) {
1704 DMRxBarrel.cd(
c)->Update();
1706 PixelDMRS_x_ByLayer->stats();
1708 TCanvas DMRxForward(
"DMRxForwardCanv",
"x-coordinate", 1400, 1200);
1709 DMRxForward.Divide(4, 3);
1710 PixelDMRS_x_ByLayer->draw(DMRxForward,
false,
"HISTS");
1711 adjustCanvases(DMRxForward,
false);
1712 for (
unsigned int c = 1;
c <= 12;
c++) {
1713 DMRxForward.cd(
c)->Update();
1715 PixelDMRS_x_ByLayer->stats();
1717 DMRxBarrel.SaveAs(
"DMR_x_Barrel_ByLayer.png");
1718 DMRxForward.SaveAs(
"DMR_x_Forward_ByRing.png");
1720 TCanvas DMRyBarrel(
"DMRyBarrelCanv",
"y-coordinate", 1400, 1200);
1721 DMRyBarrel.Divide(2, 2);
1722 PixelDMRS_y_ByLayer->draw(DMRyBarrel,
true,
"HISTS");
1723 adjustCanvases(DMRyBarrel,
true);
1724 for (
unsigned int c = 1;
c <= 4;
c++) {
1725 DMRyBarrel.cd(
c)->Update();
1727 PixelDMRS_y_ByLayer->stats();
1729 TCanvas DMRyForward(
"DMRyForwardCanv",
"y-coordinate", 1400, 1200);
1730 DMRyForward.Divide(4, 3);
1731 PixelDMRS_y_ByLayer->draw(DMRyForward,
false,
"HISTS");
1732 adjustCanvases(DMRyForward,
false);
1733 for (
unsigned int c = 1;
c <= 12;
c++) {
1734 DMRyForward.cd(
c)->Update();
1736 PixelDMRS_y_ByLayer->stats();
1738 DMRyBarrel.SaveAs(
"DMR_y_Barrel_ByLayer.png");
1739 DMRyForward.SaveAs(
"DMR_y_Forward_ByRing.png");
1746 unsigned int maxPads =
isBarrel ? 4 : 12;
1747 for (
unsigned int c = 1;
c <= maxPads;
c++) {
1752 auto ltx = TLatex();
1753 ltx.SetTextFont(62);
1754 ltx.SetTextSize(0.05);
1755 ltx.SetTextAlign(11);
1759 for (
unsigned int c = 1;
c <= maxPads;
c++) {
1762 ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1763 1 - gPad->GetTopMargin() + 0.01,
1772 bool countStereoHitAs2D_ =
true;
1775 if (!
hit.isValid() ||
1776 (
hit.dimension() < 2 && !countStereoHitAs2D_ && !dynamic_cast<const SiStripRecHit1D *>(&
hit))) {
1779 const DetId detId(
hit.geographicalId());
1781 if (detId.subdetId() ==
kBPIX || detId.subdetId() ==
kFPIX) {
1786 return countStereoHitAs2D_;
1787 else if (dynamic_cast<const SiStripRecHit1D *>(&
hit) || dynamic_cast<const SiStripRecHit2D *>(&
hit))
1790 else if (dynamic_cast<const SiStripMatchedRecHit2D *>(&
hit))
1792 else if (dynamic_cast<const ProjectedSiStripRecHit2D *>(&
hit)) {
1794 return (countStereoHitAs2D_ && this->isHit2D(pH->
originalHit()));
1797 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor "
1798 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
1804 <<
"Hit not in tracker with 'official' dimension >=2.";
1818 TH1F::SetDefaultSumw2(kTRUE);
1820 std::array<TH1D *, 2>
out;
1821 std::array<std::string, 2> sign_name = {{
"plus",
"minus"}};
1822 std::array<std::string, 2>
sign = {{
">0",
"<0"}};
1823 for (
unsigned int i = 0;
i < 2;
i++) {
1826 const char *axisTitle_;
1829 name_ = Form(
"DMR%s_%s_rDir%s", subdet.c_str(), vartype.c_str(), sign_name[
i].c_str());
1830 title_ = Form(
"Split DMR of %s-%s (rDir%s)", subdet.c_str(), vartype.c_str(),
sign[
i].c_str());
1831 axisTitle_ = Form(
"mean of %s-residuals (rDir%s);modules", vartype.c_str(),
sign[
i].c_str());
1833 name_ = Form(
"DMR%s_%s_zDir%s", subdet.c_str(), vartype.c_str(), sign_name[
i].c_str());
1834 title_ = Form(
"Split DMR of %s-%s (zDir%s)", subdet.c_str(), vartype.c_str(),
sign[
i].c_str());
1835 axisTitle_ = Form(
"mean of %s-residuals (zDir%s);modules", vartype.c_str(),
sign[
i].c_str());
1838 out[
i] =
dir.make<TH1D>(name_, fmt::sprintf(
"%s;%s", title_, axisTitle_).c_str(), 100., -200, 200);
1848 TH1F::SetDefaultSumw2(kTRUE);
1850 std::pair<double, double>
limits;
1852 if (
varType.find(
"Res") != std::string::npos) {
1853 limits = std::make_pair(-1000., 1000);
1855 limits = std::make_pair(-3., 3.);
1858 std::map<unsigned int, TH1D *>
h;
1860 for (
unsigned int i = 1;
i <= theNLayers;
i++) {
1863 const char *xAxisTitle_;
1865 if (
varType.find(
"Res") != std::string::npos) {
1866 xAxisTitle_ = (
"res_{" + resType +
"'} [#mum]").c_str();
1868 xAxisTitle_ = (
"res_{" + resType +
"'}/#sigma_{res_{" + resType +
"`}}").c_str();
1871 unsigned int side = -1;
1872 if (detType.find(
"FPix") != std::string::npos) {
1873 side = (
i - 1) / 3 + 1;
1874 unsigned int plane = (
i - 1) % 3 + 1;
1883 name_ = Form(
"h_%s%s%s_side%i_disk%i", detType.c_str(),
varType.c_str(), resType.c_str(), side, plane);
1884 title_ = Form(
"%s (%s, disk %i) track %s-%s;%s;hits",
1893 name_ = Form(
"h_%s%s%s_layer%i", detType.c_str(),
varType.c_str(), resType.c_str(),
i);
1895 "%s (layer %i) track %s-%s;%s;hits", detType.c_str(),
i, resType.c_str(),
varType.c_str(), xAxisTitle_);
1910 if (
h.count(
index) != 0) {
1914 double min =
h[
index]->GetXaxis()->GetXmin();
1915 double max =
h[
index]->GetXaxis()->GetXmax();
1930 myDetails[theID].hitCount += 1;
1935 if (myDetails[theID].hitCount != 1) {
1936 delta = the_data - myDetails[theID].runningMeanOfRes_;
1937 n_delta = the_pull - myDetails[theID].runningNormMeanOfRes_;
1938 myDetails[theID].runningMeanOfRes_ += (
delta / myDetails[theID].hitCount);
1939 myDetails[theID].runningNormMeanOfRes_ += (n_delta / myDetails[theID].hitCount);
1941 myDetails[theID].runningMeanOfRes_ = the_data;
1942 myDetails[theID].runningNormMeanOfRes_ = the_pull;
1945 float delta2 = the_data - myDetails[theID].runningMeanOfRes_;
1946 float n_delta2 = the_pull - myDetails[theID].runningNormMeanOfRes_;
1948 myDetails[theID].runningVarOfRes_ +=
delta * delta2;
1949 myDetails[theID].runningNormVarOfRes_ += n_delta * n_delta2;
1958 std::array<TH1D *, 2> DMRSplit,
1959 std::unique_ptr<PixelRegions::PixelRegionContainers> regionalDMR) {
1960 for (
const auto &element : myDetails) {
1962 DMR->Fill(element.second.runningMeanOfRes_);
1965 if (regionalDMR.get()) {
1966 regionalDMR->fill(element.first, element.second.runningMeanOfRes_);
1970 if (element.second.rOrZDirection > 0) {
1971 DMRSplit[0]->Fill(element.second.runningMeanOfRes_);
1973 DMRSplit[1]->Fill(element.second.runningMeanOfRes_);
1977 if (element.second.hitCount < 2) {
1980 DRnR->Fill(
sqrt(element.second.runningNormVarOfRes_ / (element.second.hitCount - 1)));
1991 desc.setComment(
"Generic track analyzer to check ALCARECO sample quantities / compute fast DMRs");
1996 desc.add<
bool>(
"isCosmics",
false);
1997 descriptions.
add(
"DMRChecker",
desc);