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>
159 isCosmics_(
pset.getParameter<
bool>(
"isCosmics")) {
163 theTrackCollectionToken = consumes<reco::TrackCollection>(TkTag_);
166 hltresultsToken = consumes<edm::TriggerResults>(TriggerResultsTag_);
169 beamspotToken = consumes<reco::BeamSpot>(BeamSpotTag_);
172 vertexToken = consumes<reco::VertexCollection>(VerticesTag_);
176 pmap = std::make_unique<TrackerMap>(
"Pixel");
177 pmap->onlyPixel(
true);
178 pmap->setTitle(
"Pixel Hit entries");
181 tmap = std::make_unique<TrackerMap>(
"Strip");
182 tmap->setTitle(
"Strip Hit entries");
187 pixelmap = std::make_unique<Phase1PixelMaps>(
"COLZ0 L");
188 pixelmap->bookBarrelHistograms(
"DMRsX",
"Median Residuals x-direction",
"Median Residuals");
189 pixelmap->bookBarrelBins(
"DMRsX");
190 pixelmap->bookForwardHistograms(
"DMRsX",
"Median Residuals x-direction",
"Median Residuals");
191 pixelmap->bookForwardBins(
"DMRsX");
193 pixelmap->bookBarrelHistograms(
"DMRsY",
"Median Residuals y-direction",
"Median Residuals");
194 pixelmap->bookBarrelBins(
"DMRsY");
195 pixelmap->bookForwardHistograms(
"DMRsY",
"Median Residuals y-direction",
"Median Residuals");
196 pixelmap->bookForwardBins(
"DMRsY");
199 pixelmap->setNoRescale();
211 template <
class OBJECT_TYPE>
213 for (
const auto &iter : vec | boost::adaptors::indexed(0)) {
214 if (iter.value() && iter.value()->GetName() ==
name) {
219 <<
" could not find " <<
name;
237 std::unique_ptr<TrackerMap>
tmap;
238 std::unique_ptr<TrackerMap>
pmap;
501 time_t start_time =
summary->m_start_time_ll;
503 time_t end_time =
summary->m_stop_time_ll;
513 double seconds = difftime(end_time, start_time) / 1.0e+6;
515 timeMap_[
event.run()] =
seconds;
527 conditionsMap_[
event.run()].first =
mode;
528 conditionsMap_[
event.run()].second = B_;
551 runInfoMap_[
event.run()].first += 1;
552 runInfoMap_[
event.run()].second += tC.size();
557 event.getByToken(hltresultsToken,
hltresults);
562 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
568 triggerMap_[
trigName].second += tC.size();
573 hrun->Fill(
event.run());
574 hlumi->Fill(
event.luminosityBlock());
576 int nHighPurityTracks = 0;
578 for (
const auto &
track : tC) {
579 auto const &residuals =
track.extra()->residuals();
581 unsigned int nHit2D = 0;
584 if (this->isHit2D(**iHit))
587 double resX = residuals.residualX(h_index);
588 double resY = residuals.residualY(h_index);
589 double pullX = residuals.pullX(h_index);
590 double pullY = residuals.pullY(h_index);
592 const DetId &detId = (*iHit)->geographicalId();
594 unsigned int subid = detId.
subdetId();
595 uint32_t detid_db = detId.
rawId();
599 float uOrientation(-999.
F), vOrientation(-999.
F);
600 LocalPoint lPModule(0., 0., 0.), lUDirection(1., 0., 0.), lVDirection(0., 1., 0.), lWDirection(0., 0., 1.);
603 GlobalPoint gUDirection = geomDet->surface().toGlobal(lUDirection);
604 GlobalPoint gVDirection = geomDet->surface().toGlobal(lVDirection);
605 GlobalPoint gWDirection = geomDet->surface().toGlobal(lWDirection);
606 GlobalPoint gPModule = geomDet->surface().toGlobal(lPModule);
608 if (!(*iHit)->detUnit())
612 tmap->fill(detid_db, 1);
623 if (resDetailsTIB_.find(detid_db) == resDetailsTIB_.end()) {
624 resDetailsTIB_[detid_db].rDirection = gWDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
625 resDetailsTIB_[detid_db].zDirection = gVDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
626 resDetailsTIB_[detid_db].rOrZDirection = resDetailsTIB_[detid_db].rDirection;
629 hTIBResXPrime->Fill(uOrientation * resX * 10000);
630 hTIBResXPull->Fill(pullX);
633 this->updateOnlineMomenta(resDetailsTIB_, detid_db, uOrientation * resX *
cmToUm, pullX);
639 hTOBResXPrime->Fill(uOrientation * resX * 10000);
640 hTOBResXPull->Fill(pullX);
643 if (resDetailsTOB_.find(detid_db) == resDetailsTOB_.end()) {
644 resDetailsTOB_[detid_db].rDirection = gWDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
645 resDetailsTOB_[detid_db].zDirection = gVDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
646 resDetailsTOB_[detid_db].rOrZDirection = resDetailsTOB_[detid_db].rDirection;
650 this->updateOnlineMomenta(resDetailsTOB_, detid_db, uOrientation * resX *
cmToUm, pullX);
656 hTIDResXPrime->Fill(uOrientation * resX * 10000);
657 hTIDResXPull->Fill(pullX);
660 this->updateOnlineMomenta(resDetailsTID_, detid_db, uOrientation * resX *
cmToUm, pullX);
666 hTECResXPrime->Fill(uOrientation * resX * 10000);
667 hTECResXPull->Fill(pullX);
670 this->updateOnlineMomenta(resDetailsTEC_, detid_db, uOrientation * resX *
cmToUm, pullX);
674 const SiPixelRecHit *pixhit = dynamic_cast<const SiPixelRecHit *>(*iHit);
679 pmap->fill(detid_db, 1);
689 int layer_num = tTopo->
pxbLayer(detid_db);
692 vOrientation = gVDirection.
z() - gPModule.
z() >= 0 ? +1.F : -1.F;
695 if (resDetailsBPixX_.find(detid_db) == resDetailsBPixX_.end()) {
696 resDetailsBPixX_[detid_db].rDirection = gWDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
697 resDetailsBPixX_[detid_db].zDirection = gVDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
698 resDetailsBPixX_[detid_db].rOrZDirection =
699 resDetailsBPixX_[detid_db].rDirection;
703 if (resDetailsBPixY_.find(detid_db) == resDetailsBPixY_.end()) {
704 resDetailsBPixY_[detid_db].rDirection = gWDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
705 resDetailsBPixY_[detid_db].zDirection = gVDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
706 resDetailsBPixY_[detid_db].rOrZDirection =
707 resDetailsBPixY_[detid_db].rDirection;
710 hHitCountVsThetaBPix->Fill(GP.
theta());
711 hHitCountVsPhiBPix->Fill(GP.
phi());
713 hHitCountVsZBPix->Fill(GP.
z());
714 hHitCountVsXBPix->Fill(GP.
x());
715 hHitCountVsYBPix->Fill(GP.
y());
717 hBPixResXPrime->Fill(uOrientation * resX *
cmToUm);
718 hBPixResYPrime->Fill(vOrientation * resY *
cmToUm);
719 hBPixResXPull->Fill(pullX);
720 hBPixResYPull->Fill(pullY);
725 this->updateOnlineMomenta(resDetailsBPixX_, detid_db, uOrientation * resX *
cmToUm, pullX);
728 this->updateOnlineMomenta(resDetailsBPixY_, detid_db, vOrientation * resY *
cmToUm, pullY);
736 uOrientation = gUDirection.
perp() - gPModule.
perp() >= 0 ? +1.F : -1.F;
739 int side_num = tTopo->
pxfSide(detid_db);
740 int disk_num = tTopo->
pxfDisk(detid_db);
742 int packedTopo = disk_num + 3 * (side_num - 1);
746 hHitCountVsThetaFPix->Fill(GP.
theta());
747 hHitCountVsPhiFPix->Fill(GP.
phi());
749 hHitCountVsZFPix->Fill(GP.
z());
750 hHitCountVsXFPix->Fill(GP.
x());
751 hHitCountVsYFPix->Fill(GP.
y());
753 hFPixResXPrime->Fill(uOrientation * resX *
cmToUm);
754 hFPixResYPrime->Fill(vOrientation * resY *
cmToUm);
755 hFPixResXPull->Fill(pullX);
756 hFPixResYPull->Fill(pullY);
764 if (resDetailsFPixX_.find(detid_db) == resDetailsFPixX_.end()) {
765 resDetailsFPixX_[detid_db].rDirection = gUDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
766 resDetailsFPixX_[detid_db].zDirection = gWDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
767 resDetailsFPixX_[detid_db].rOrZDirection =
768 resDetailsFPixX_[detid_db].zDirection;
772 if (resDetailsFPixY_.find(detid_db) == resDetailsFPixY_.end()) {
773 resDetailsFPixY_[detid_db].rDirection = gUDirection.
perp() - gPModule.
perp() >= 0 ? +1 : -1;
774 resDetailsFPixY_[detid_db].zDirection = gWDirection.
z() - gPModule.
z() >= 0 ? +1 : -1;
775 resDetailsFPixY_[detid_db].rOrZDirection =
776 resDetailsFPixY_[detid_db].zDirection;
780 this->updateOnlineMomenta(resDetailsFPixX_, detid_db, uOrientation * resX *
cmToUm, pullX);
783 this->updateOnlineMomenta(resDetailsFPixY_, detid_db, vOrientation * resY *
cmToUm, pullY);
786 hHitCountVsXFPixMinus->Fill(GP.
x());
787 hHitCountVsYFPixMinus->Fill(GP.
y());
788 hHitCountVsZFPixMinus->Fill(GP.
z());
789 hHitCountVsThetaFPixMinus->Fill(GP.
theta());
790 hHitCountVsPhiFPixMinus->Fill(GP.
phi());
792 hFPixZMinusResXPrime->Fill(uOrientation * resX *
cmToUm);
793 hFPixZMinusResYPrime->Fill(vOrientation * resY *
cmToUm);
794 hFPixZMinusResXPull->Fill(pullX);
795 hFPixZMinusResYPull->Fill(pullY);
798 hHitCountVsXFPixPlus->Fill(GP.
x());
799 hHitCountVsYFPixPlus->Fill(GP.
y());
800 hHitCountVsZFPixPlus->Fill(GP.
z());
801 hHitCountVsThetaFPixPlus->Fill(GP.
theta());
802 hHitCountVsPhiFPixPlus->Fill(GP.
phi());
804 hFPixZPlusResXPrime->Fill(uOrientation * resX *
cmToUm);
805 hFPixZPlusResYPrime->Fill(vOrientation * resY *
cmToUm);
806 hFPixZPlusResXPull->Fill(pullX);
807 hFPixZPlusResYPull->Fill(pullY);
815 hHit2D->Fill(nHit2D);
816 hHit->Fill(
track.numberOfValidHits());
817 hnhpxb->Fill(
track.hitPattern().numberOfValidPixelBarrelHits());
818 hnhpxe->Fill(
track.hitPattern().numberOfValidPixelEndcapHits());
819 hnhTIB->Fill(
track.hitPattern().numberOfValidStripTIBHits());
820 hnhTID->Fill(
track.hitPattern().numberOfValidStripTIDHits());
821 hnhTOB->Fill(
track.hitPattern().numberOfValidStripTOBHits());
822 hnhTEC->Fill(
track.hitPattern().numberOfValidStripTECHits());
824 runHitsMap_[
event.run()][0] +=
track.hitPattern().numberOfValidPixelBarrelHits();
825 runHitsMap_[
event.run()][1] +=
track.hitPattern().numberOfValidPixelEndcapHits();
826 runHitsMap_[
event.run()][2] +=
track.hitPattern().numberOfValidStripTIBHits();
827 runHitsMap_[
event.run()][3] +=
track.hitPattern().numberOfValidStripTIDHits();
828 runHitsMap_[
event.run()][4] +=
track.hitPattern().numberOfValidStripTOBHits();
829 runHitsMap_[
event.run()][5] +=
track.hitPattern().numberOfValidStripTECHits();
832 if (
track.hitPattern().numberOfValidPixelBarrelHits() != 0) {
833 hHitComposition->Fill(0.,
track.hitPattern().numberOfValidPixelBarrelHits());
835 pNBpixHitsVsVx->Fill(
track.vx(),
track.hitPattern().numberOfValidPixelBarrelHits());
836 pNBpixHitsVsVy->Fill(
track.vy(),
track.hitPattern().numberOfValidPixelBarrelHits());
837 pNBpixHitsVsVz->Fill(
track.vz(),
track.hitPattern().numberOfValidPixelBarrelHits());
839 if (
track.hitPattern().numberOfValidPixelEndcapHits() != 0) {
840 hHitComposition->Fill(1.,
track.hitPattern().numberOfValidPixelEndcapHits());
842 if (
track.hitPattern().numberOfValidStripTIBHits() != 0) {
843 hHitComposition->Fill(2.,
track.hitPattern().numberOfValidStripTIBHits());
845 if (
track.hitPattern().numberOfValidStripTIDHits() != 0) {
846 hHitComposition->Fill(3.,
track.hitPattern().numberOfValidStripTIDHits());
848 if (
track.hitPattern().numberOfValidStripTOBHits() != 0) {
849 hHitComposition->Fill(4.,
track.hitPattern().numberOfValidStripTOBHits());
851 if (
track.hitPattern().numberOfValidStripTECHits() != 0) {
852 hHitComposition->Fill(5.,
track.hitPattern().numberOfValidStripTECHits());
855 hCharge->Fill(
track.charge());
856 hQoverP->Fill(
track.qoverp());
857 hQoverPZoom->Fill(
track.qoverp());
858 hPt->Fill(
track.pt());
860 hchi2ndof->Fill(
track.normalizedChi2());
861 hEta->Fill(
track.eta());
862 hPhi->Fill(
track.phi());
864 if (fabs(
track.eta()) < 0.8)
865 hPhiBarrel->Fill(
track.phi());
867 hPhiOverlapPlus->Fill(
track.phi());
869 hPhiOverlapMinus->Fill(
track.phi());
870 if (
track.eta() > 1.4)
871 hPhiEndcapPlus->Fill(
track.phi());
872 if (
track.eta() < -1.4)
873 hPhiEndcapMinus->Fill(
track.phi());
875 hd0->Fill(
track.d0());
876 hdz->Fill(
track.dz());
877 hdxy->Fill(
track.dxy());
878 hvx->Fill(
track.vx());
879 hvy->Fill(
track.vy());
880 hvz->Fill(
track.vz());
882 htrkAlgo->Fill(
track.algo());
887 htrkQuality->Fill(myquality);
891 htrkQuality->Fill(myquality);
895 htrkQuality->Fill(myquality);
899 htrkQuality->Fill(myquality);
900 hPhp->Fill(
track.p());
901 hPthp->Fill(
track.pt());
902 hHithp->Fill(
track.numberOfValidHits());
903 hEtahp->Fill(
track.eta());
904 hPhihp->Fill(
track.phi());
905 hchi2ndofhp->Fill(
track.normalizedChi2());
906 hchi2Probhp->Fill(TMath::Prob(
track.chi2(),
track.ndof()));
911 htrkQuality->Fill(myquality);
915 htrkQuality->Fill(myquality);
919 static const int etaindex = this->GetIndex(vTrackHistos_,
"h_tracketa");
920 vTrackHistos_[etaindex]->Fill(
track.eta());
921 static const int phiindex = this->GetIndex(vTrackHistos_,
"h_trackphi");
922 vTrackHistos_[phiindex]->Fill(
track.phi());
923 static const int numOfValidHitsindex = this->GetIndex(vTrackHistos_,
"h_trackNumberOfValidHits");
924 vTrackHistos_[numOfValidHitsindex]->Fill(
track.numberOfValidHits());
925 static const int numOfLostHitsindex = this->GetIndex(vTrackHistos_,
"h_trackNumberOfLostHits");
926 vTrackHistos_[numOfLostHitsindex]->Fill(
track.numberOfLostHits());
929 double theLocalMagFieldInInverseGeV = magneticField_->
inInverseGeV(gPoint).
z();
930 double kappa = -
track.charge() * theLocalMagFieldInInverseGeV /
track.pt();
932 static const int kappaindex = this->GetIndex(vTrackHistos_,
"h_curvature");
933 vTrackHistos_[kappaindex]->Fill(
kappa);
934 static const int kappaposindex = this->GetIndex(vTrackHistos_,
"h_curvature_pos");
935 if (
track.charge() > 0)
936 vTrackHistos_[kappaposindex]->
Fill(fabs(
kappa));
937 static const int kappanegindex = this->GetIndex(vTrackHistos_,
"h_curvature_neg");
938 if (
track.charge() < 0)
939 vTrackHistos_[kappanegindex]->
Fill(fabs(
kappa));
941 double chi2Prob = TMath::Prob(
track.chi2(),
track.ndof());
942 double normchi2 =
track.normalizedChi2();
944 static const int normchi2index = this->GetIndex(vTrackHistos_,
"h_normchi2");
945 vTrackHistos_[normchi2index]->Fill(normchi2);
946 static const int chi2index = this->GetIndex(vTrackHistos_,
"h_chi2");
947 vTrackHistos_[chi2index]->Fill(
track.chi2());
948 static const int chi2Probindex = this->GetIndex(vTrackHistos_,
"h_chi2Prob");
949 vTrackHistos_[chi2Probindex]->Fill(chi2Prob);
950 static const int ptindex = this->GetIndex(vTrackHistos_,
"h_pt");
951 static const int pt2index = this->GetIndex(vTrackHistos_,
"h_ptrebin");
952 vTrackHistos_[ptindex]->Fill(
track.pt());
953 vTrackHistos_[pt2index]->Fill(
track.pt());
954 if (
track.ptError() != 0.) {
955 static const int ptResolutionindex = this->GetIndex(vTrackHistos_,
"h_ptResolution");
956 vTrackHistos_[ptResolutionindex]->Fill(
track.ptError() /
track.pt());
959 static const int d0phiindex = this->GetIndex(vTrackProfiles_,
"p_d0_vs_phi");
960 vTrackProfiles_[d0phiindex]->Fill(
track.phi(),
track.d0());
961 static const int dzphiindex = this->GetIndex(vTrackProfiles_,
"p_dz_vs_phi");
962 vTrackProfiles_[dzphiindex]->Fill(
track.phi(),
track.dz());
963 static const int d0etaindex = this->GetIndex(vTrackProfiles_,
"p_d0_vs_eta");
964 vTrackProfiles_[d0etaindex]->Fill(
track.eta(),
track.d0());
965 static const int dzetaindex = this->GetIndex(vTrackProfiles_,
"p_dz_vs_eta");
966 vTrackProfiles_[dzetaindex]->Fill(
track.eta(),
track.dz());
967 static const int chiProbphiindex = this->GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_phi");
968 vTrackProfiles_[chiProbphiindex]->Fill(
track.phi(), chi2Prob);
969 static const int chiProbabsd0index = this->GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_d0");
970 vTrackProfiles_[chiProbabsd0index]->Fill(fabs(
track.d0()), chi2Prob);
971 static const int chiProbabsdzindex = this->GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_dz");
972 vTrackProfiles_[chiProbabsdzindex]->Fill(
track.dz(), chi2Prob);
973 static const int chiphiindex = this->GetIndex(vTrackProfiles_,
"p_chi2_vs_phi");
974 vTrackProfiles_[chiphiindex]->Fill(
track.phi(),
track.chi2());
975 static const int normchiphiindex = this->GetIndex(vTrackProfiles_,
"p_normchi2_vs_phi");
976 vTrackProfiles_[normchiphiindex]->Fill(
track.phi(), normchi2);
977 static const int chietaindex = this->GetIndex(vTrackProfiles_,
"p_chi2_vs_eta");
978 vTrackProfiles_[chietaindex]->Fill(
track.eta(),
track.chi2());
979 static const int normchiptindex = this->GetIndex(vTrackProfiles_,
"p_normchi2_vs_pt");
980 vTrackProfiles_[normchiptindex]->Fill(
track.pt(), normchi2);
981 static const int normchipindex = this->GetIndex(vTrackProfiles_,
"p_normchi2_vs_p");
982 vTrackProfiles_[normchipindex]->Fill(
track.p(), normchi2);
983 static const int chiProbetaindex = this->GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_eta");
984 vTrackProfiles_[chiProbetaindex]->Fill(
track.eta(), chi2Prob);
985 static const int normchietaindex = this->GetIndex(vTrackProfiles_,
"p_normchi2_vs_eta");
986 vTrackProfiles_[normchietaindex]->Fill(
track.eta(), normchi2);
987 static const int kappaphiindex = this->GetIndex(vTrackProfiles_,
"p_kappa_vs_phi");
988 vTrackProfiles_[kappaphiindex]->Fill(
track.phi(),
kappa);
989 static const int kappaetaindex = this->GetIndex(vTrackProfiles_,
"p_kappa_vs_eta");
990 vTrackProfiles_[kappaetaindex]->Fill(
track.eta(),
kappa);
991 static const int ptResphiindex = this->GetIndex(vTrackProfiles_,
"p_ptResolution_vs_phi");
992 vTrackProfiles_[ptResphiindex]->Fill(
track.phi(),
track.ptError() /
track.pt());
993 static const int ptResetaindex = this->GetIndex(vTrackProfiles_,
"p_ptResolution_vs_eta");
994 vTrackProfiles_[ptResetaindex]->Fill(
track.eta(),
track.ptError() /
track.pt());
997 static const int d0phiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_d0_vs_phi");
998 vTrack2DHistos_[d0phiindex_2d]->Fill(
track.phi(),
track.d0());
999 static const int dzphiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_dz_vs_phi");
1000 vTrack2DHistos_[dzphiindex_2d]->Fill(
track.phi(),
track.dz());
1001 static const int d0etaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_d0_vs_eta");
1002 vTrack2DHistos_[d0etaindex_2d]->Fill(
track.eta(),
track.d0());
1003 static const int dzetaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_dz_vs_eta");
1004 vTrack2DHistos_[dzetaindex_2d]->Fill(
track.eta(),
track.dz());
1005 static const int chiphiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_chi2_vs_phi");
1006 vTrack2DHistos_[chiphiindex_2d]->Fill(
track.phi(),
track.chi2());
1007 static const int chiProbphiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_chi2Prob_vs_phi");
1008 vTrack2DHistos_[chiProbphiindex_2d]->Fill(
track.phi(), chi2Prob);
1009 static const int chiProbabsd0index_2d = this->GetIndex(vTrack2DHistos_,
"h2_chi2Prob_vs_d0");
1010 vTrack2DHistos_[chiProbabsd0index_2d]->Fill(fabs(
track.d0()), chi2Prob);
1011 static const int normchiphiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_normchi2_vs_phi");
1012 vTrack2DHistos_[normchiphiindex_2d]->Fill(
track.phi(), normchi2);
1013 static const int chietaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_chi2_vs_eta");
1014 vTrack2DHistos_[chietaindex_2d]->Fill(
track.eta(),
track.chi2());
1015 static const int chiProbetaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_chi2Prob_vs_eta");
1016 vTrack2DHistos_[chiProbetaindex_2d]->Fill(
track.eta(), chi2Prob);
1017 static const int normchietaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_normchi2_vs_eta");
1018 vTrack2DHistos_[normchietaindex_2d]->Fill(
track.eta(), normchi2);
1019 static const int kappaphiindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_kappa_vs_phi");
1020 vTrack2DHistos_[kappaphiindex_2d]->Fill(
track.phi(),
kappa);
1021 static const int kappaetaindex_2d = this->GetIndex(vTrack2DHistos_,
"h2_kappa_vs_eta");
1022 vTrack2DHistos_[kappaetaindex_2d]->Fill(
track.eta(),
kappa);
1023 static const int normchi2kappa_2d = this->GetIndex(vTrack2DHistos_,
"h2_normchi2_vs_kappa");
1024 vTrack2DHistos_[normchi2kappa_2d]->Fill(normchi2,
kappa);
1031 event.getByToken(beamspotToken, beamSpotHandle);
1032 if (beamSpotHandle.
isValid()) {
1046 event.getByLabel(
"offlinePrimaryVertices", vertexHandle);
1047 double mindxy = 100.;
1050 for (reco::VertexCollection::const_iterator pvtx = vertexHandle->begin(); pvtx != vertexHandle->end(); ++pvtx) {
1053 mindxy =
track.dxy(mypoint);
1059 hdxyPV->Fill(mindxy);
1060 hd0PV->Fill(-mindxy);
1063 hd0PVvsphi->Fill(
track.phi(), -mindxy);
1064 hd0PVvseta->Fill(
track.eta(), -mindxy);
1065 hd0PVvspt->Fill(
track.pt(), -mindxy);
1078 hNtrk->Fill(tC.size());
1079 hNtrkZoom->Fill(tC.size());
1080 hNhighPurity->Fill(nHighPurityTracks);
1089 TH1D::SetDefaultSumw2(kTRUE);
1094 hrun = fs->
make<TH1D>(
"h_run",
"run", 100000, 230000, 240000);
1095 hlumi = fs->
make<TH1D>(
"h_lumi",
"lumi", 1000, 0, 1000);
1099 hchi2ndof = fs->
make<TH1D>(
"h_chi2ndof",
"chi2/ndf;#chi^{2}/ndf;tracks", 100, 0, 5.);
1100 hCharge = fs->
make<TH1D>(
"h_charge",
"charge;Charge of the track;tracks", 5, -2.5, 2.5);
1101 hNtrk = fs->
make<TH1D>(
"h_Ntrk",
"ntracks;Number of Tracks;events", 200, 0., 200.);
1102 hNtrkZoom = fs->
make<TH1D>(
"h_NtrkZoom",
"Number of tracks; number of tracks;events", 10, 0., 10.);
1103 hNhighPurity = fs->
make<TH1D>(
"h_NhighPurity",
"n. high purity tracks;Number of high purity tracks;events", 200, 0., 200.);
1106 htrkAlgo = fs->
make<TH1I>(
"h_trkAlgo",
"tracking step;iterative tracking step;tracks", nAlgos, -0.5, nAlgos - 0.5);
1107 for (
int nbin = 1;
nbin <= htrkAlgo->GetNbinsX();
nbin++) {
1111 htrkQuality = fs->
make<TH1I>(
"h_trkQuality",
"track quality;track quality;tracks", 6, -1, 5);
1112 std::string qualities[7] = {
"undef",
"loose",
"tight",
"highPurity",
"confirmed",
"goodIterative"};
1113 for (
int nbin = 1;
nbin <= htrkQuality->GetNbinsX();
nbin++) {
1114 htrkQuality->GetXaxis()->SetBinLabel(
nbin, qualities[
nbin - 1].c_str());
1117 hP = fs->
make<TH1D>(
"h_P",
"Momentum;track momentum [GeV];tracks", 100, 0., 100.);
1118 hQoverP = fs->
make<TH1D>(
"h_qoverp",
"Track q/p; track q/p [GeV^{-1}];tracks", 100, -1., 1.);
1119 hQoverPZoom = fs->
make<TH1D>(
"h_qoverpZoom",
"Track q/p; track q/p [GeV^{-1}];tracks", 100, -0.1, 0.1);
1120 hPt = fs->
make<TH1D>(
"h_Pt",
"Transverse Momentum;track p_{T} [GeV];tracks", 100, 0., 100.);
1121 hHit = fs->
make<TH1D>(
"h_nHits",
"Number of hits;track n. hits;tracks", 50, -0.5, 49.5);
1122 hHit2D = fs->
make<TH1D>(
"h_nHit2D",
"Number of 2D hits; number of 2D hits;tracks", 20, 0, 20);
1126 hBPixResXPrime = fs->
make<TH1D>(
"h_BPixResXPrime",
"BPix track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1127 hFPixResXPrime = fs->
make<TH1D>(
"h_FPixResXPrime",
"FPix track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1128 hFPixZPlusResXPrime = fs->
make<TH1D>(
"h_FPixZPlusResXPrime",
"FPix (Z+) track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1129 hFPixZMinusResXPrime = fs->
make<TH1D>(
"h_FPixZMinusResXPrime",
"FPix (Z-) track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1131 hBPixResYPrime = fs->
make<TH1D>(
"h_BPixResYPrime",
"BPix track Y-residuals;res_{Y'} [#mum];hits", 100, -1000., 1000.);
1132 hFPixResYPrime = fs->
make<TH1D>(
"h_FPixResYPrime",
"FPix track Y-residuals;res_{Y'} [#mum];hits", 100, -1000., 1000.);
1133 hFPixZPlusResYPrime = fs->
make<TH1D>(
"h_FPixZPlusResYPrime",
"FPix (Z+) track Y-residuals;res_{Y'} [#mum];hits", 100, -1000., 1000.);
1134 hFPixZMinusResYPrime = fs->
make<TH1D>(
"h_FPixZMinusResYPrime",
"FPix (Z-) track Y-residuals;res_{Y'} [#mum];hits", 100, -1000., 1000.);
1136 hBPixResXPull = fs->
make<TH1D>(
"h_BPixResXPull",
"BPix track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1137 hFPixResXPull = fs->
make<TH1D>(
"h_FPixResXPull",
"FPix track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1138 hFPixZPlusResXPull = fs->
make<TH1D>(
"h_FPixZPlusResXPull",
"FPix (Z+) track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1139 hFPixZMinusResXPull = fs->
make<TH1D>(
"h_FPixZMinusResXPull",
"FPix (Z-) track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1141 hBPixResYPull = fs->
make<TH1D>(
"h_BPixResYPull",
"BPix track Y-pulls;res_{Y'}/#sigma_{res_{Y'}};hits", 100, -5., 5.);
1142 hFPixResYPull = fs->
make<TH1D>(
"h_FPixResYPull",
"FPix track Y-pulls;res_{Y'}/#sigma_{res_{Y'}};hits", 100, -5., 5.);
1143 hFPixZPlusResYPull = fs->
make<TH1D>(
"h_FPixZPlusResYPull",
"FPix (Z+) track Y-pulls;res_{Y'}/#sigma_{res_{Y'}};hits", 100, -5., 5.);
1144 hFPixZMinusResYPull = fs->
make<TH1D>(
"h_FPixZMinusResYPull",
"FPix (Z-) track Y-pulls;res_{Y'}/#sigma_{res_{Y'}};hits", 100, -5., 5.);
1148 hTIBResXPrime = fs->
make<TH1D>(
"h_TIBResXPrime",
"TIB track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1149 hTOBResXPrime = fs->
make<TH1D>(
"h_TOBResXPrime",
"TOB track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1150 hTIDResXPrime = fs->
make<TH1D>(
"h_TIDResXPrime",
"TID track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1151 hTECResXPrime = fs->
make<TH1D>(
"h_TECResXPrime",
"TEC track X-residuals;res_{X'} [#mum];hits", 100, -1000., 1000.);
1153 hTIBResXPull = fs->
make<TH1D>(
"h_TIBResXPull",
"TIB track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1154 hTOBResXPull = fs->
make<TH1D>(
"h_TOBResXPull",
"TOB track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1155 hTIDResXPull = fs->
make<TH1D>(
"h_TIDResXPull",
"TID track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1156 hTECResXPull = fs->
make<TH1D>(
"h_TECResXPull",
"TEC track X-pulls;res_{X'}/#sigma_{res_{X'}};hits", 100, -5., 5.);
1160 hHitCountVsZBPix = fs->
make<TH1D>(
"h_HitCountVsZBpix",
"Number of BPix hits vs z;hit global z;hits", 60, -30, 30);
1161 hHitCountVsZFPix = fs->
make<TH1D>(
"h_HitCountVsZFpix",
"Number of FPix hits vs z;hit global z;hits", 100, -100, 100);
1163 hHitCountVsXBPix = fs->
make<TH1D>(
"h_HitCountVsXBpix",
"Number of BPix hits vs x;hit global x;hits", 20, -20, 20);
1164 hHitCountVsXFPix = fs->
make<TH1D>(
"h_HitCountVsXFpix",
"Number of FPix hits vs x;hit global x;hits", 20, -20, 20);
1166 hHitCountVsYBPix = fs->
make<TH1D>(
"h_HitCountVsYBpix",
"Number of BPix hits vs y;hit global y;hits", 20, -20, 20);
1167 hHitCountVsYFPix = fs->
make<TH1D>(
"h_HitCountVsYFpix",
"Number of FPix hits vs y;hit global y;hits", 20, -20, 20);
1169 hHitCountVsThetaBPix = fs->
make<TH1D>(
"h_HitCountVsThetaBpix",
"Number of BPix hits vs #theta;hit global #theta;hits", 20, 0.,
M_PI);
1170 hHitCountVsPhiBPix = fs->
make<TH1D>(
"h_HitCountVsPhiBpix",
"Number of BPix hits vs #phi;hit global #phi;hits", 20, -
M_PI,
M_PI);
1172 hHitCountVsThetaFPix = fs->
make<TH1D>(
"h_HitCountVsThetaFpix",
"Number of FPix hits vs #theta;hit global #theta;hits", 40, 0.,
M_PI);
1173 hHitCountVsPhiFPix = fs->
make<TH1D>(
"h_HitCountVsPhiFpix",
"Number of FPix hits vs #phi;hit global #phi;hits", 20, -
M_PI,
M_PI);
1177 hHitCountVsZFPixPlus = fs->
make<TH1D>(
"h_HitCountVsZFPixPlus",
"Number of FPix(Z+) hits vs z;hit global z;hits", 60, 15., 60);
1178 hHitCountVsZFPixMinus = fs->
make<TH1D>(
"h_HitCountVsZFPixMinus",
"Number of FPix(Z-) hits vs z;hit global z;hits", 100, -60., -15.);
1180 hHitCountVsXFPixPlus = fs->
make<TH1D>(
"h_HitCountVsXFPixPlus",
"Number of FPix(Z+) hits vs x;hit global x;hits", 20, -20, 20);
1181 hHitCountVsXFPixMinus = fs->
make<TH1D>(
"h_HitCountVsXFPixMinus",
"Number of FPix(Z-) hits vs x;hit global x;hits", 20, -20, 20);
1183 hHitCountVsYFPixPlus = fs->
make<TH1D>(
"h_HitCountVsYFPixPlus",
"Number of FPix(Z+) hits vs y;hit global y;hits", 20, -20, 20);
1184 hHitCountVsYFPixMinus = fs->
make<TH1D>(
"h_HitCountVsYFPixMinus",
"Number of FPix(Z-) hits vs y;hit global y;hits", 20, -20, 20);
1186 hHitCountVsThetaFPixPlus = fs->
make<TH1D>(
"h_HitCountVsThetaFPixPlus",
"Number of FPix(Z+) hits vs #theta;hit global #theta;hits", 20, 0.,
M_PI);
1187 hHitCountVsPhiFPixPlus = fs->
make<TH1D>(
"h_HitCountVsPhiFPixPlus",
"Number of FPix(Z+) hits vs #phi;hit global #phi;hits",20,-
M_PI,
M_PI);
1189 hHitCountVsThetaFPixMinus = fs->
make<TH1D>(
"h_HitCountVsThetaFPixMinus",
"Number of FPix(Z+) hits vs #theta;hit global #theta;hits", 40, 0.,
M_PI);
1190 hHitCountVsPhiFPixMinus = fs->
make<TH1D>(
"h_HitCountVsPhiFPixMinus",
"Number of FPix(Z+) hits vs #phi;hit global #phi;hits",20,-
M_PI,
M_PI);
1193 barrelLayersResidualsX = bookResidualsHistogram(ByLayerResiduals, 4,
"X",
"Res",
"BPix");
1194 endcapDisksResidualsX = bookResidualsHistogram(ByLayerResiduals, 6,
"X",
"Res",
"FPix");
1195 barrelLayersResidualsY = bookResidualsHistogram(ByLayerResiduals, 4,
"Y",
"Res",
"BPix");
1196 endcapDisksResidualsY = bookResidualsHistogram(ByLayerResiduals, 6,
"Y",
"Res",
"FPix");
1199 barrelLayersPullsX = bookResidualsHistogram(ByLayerPulls, 4,
"X",
"Pull",
"BPix");
1200 endcapDisksPullsX = bookResidualsHistogram(ByLayerPulls, 6,
"X",
"Pull",
"FPix");
1201 barrelLayersPullsY = bookResidualsHistogram(ByLayerPulls, 4,
"Y",
"Pull",
"BPix");
1202 endcapDisksPullsY = bookResidualsHistogram(ByLayerPulls, 6,
"Y",
"Pull",
"FPix");
1204 hEta = fs->
make<TH1D>(
"h_Eta",
"Track pseudorapidity; track #eta;tracks", 100, -
M_PI,
M_PI);
1205 hPhi = fs->
make<TH1D>(
"h_Phi",
"Track azimuth; track #phi;tracks", 100, -
M_PI,
M_PI);
1207 hPhiBarrel = fs->
make<TH1D>(
"h_PhiBarrel",
"hPhiBarrel (0<|#eta|<0.8);track #Phi;tracks", 100, -
M_PI,
M_PI);
1208 hPhiOverlapPlus = fs->
make<TH1D>(
"h_PhiOverlapPlus",
"hPhiOverlapPlus (0.8<#eta<1.4);track #phi;tracks", 100, -
M_PI,
M_PI);
1209 hPhiOverlapMinus = fs->
make<TH1D>(
"h_PhiOverlapMinus",
"hPhiOverlapMinus (-1.4<#eta<-0.8);track #phi;tracks", 100, -
M_PI,
M_PI);
1210 hPhiEndcapPlus = fs->
make<TH1D>(
"h_PhiEndcapPlus",
"hPhiEndcapPlus (#eta>1.4);track #phi;track", 100, -
M_PI,
M_PI);
1211 hPhiEndcapMinus = fs->
make<TH1D>(
"h_PhiEndcapMinus",
"hPhiEndcapMinus (#eta<1.4);track #phi;tracks", 100, -
M_PI,
M_PI);
1214 hPhp = fs->
make<TH1D>(
"h_P_hp",
"Momentum (high purity);track momentum [GeV];tracks", 100, 0., 100.);
1215 hPthp = fs->
make<TH1D>(
"h_Pt_hp",
"Transverse Momentum (high purity);track p_{T} [GeV];tracks", 100, 0., 100.);
1216 hHithp = fs->
make<TH1D>(
"h_nHit_hp",
"Number of hits (high purity);track n. hits;tracks", 30, 0, 30);
1217 hEtahp = fs->
make<TH1D>(
"h_Eta_hp",
"Track pseudorapidity (high purity); track #eta;tracks", 100, -
M_PI,
M_PI);
1218 hPhihp = fs->
make<TH1D>(
"h_Phi_hp",
"Track azimuth (high purity); track #phi;tracks", 100, -
M_PI,
M_PI);
1219 hchi2ndofhp = fs->
make<TH1D>(
"h_chi2ndof_hp",
"chi2/ndf (high purity);#chi^{2}/ndf;tracks", 100, 0, 5.);
1220 hchi2Probhp = fs->
make<TH1D>(
"hchi2_Prob_hp",
"#chi^{2} probability (high purity);#chi^{2}prob_{Track};Number of Tracks", 100, 0.0, 1.);
1222 hvx = fs->
make<TH1D>(
"h_vx",
"Track v_{x} ; track v_{x} [cm];tracks", 100, -1.5, 1.5);
1223 hvy = fs->
make<TH1D>(
"h_vy",
"Track v_{y} ; track v_{y} [cm];tracks", 100, -1.5, 1.5);
1224 hvz = fs->
make<TH1D>(
"h_vz",
"Track v_{z} ; track v_{z} [cm];tracks", 100, -20., 20.);
1225 hd0 = fs->
make<TH1D>(
"h_d0",
"Track d_{0} ; track d_{0} [cm];tracks", 100, -1., 1.);
1226 hdxy = fs->
make<TH1D>(
"h_dxy",
"Track d_{xy}; track d_{xy} [cm]; tracks", 100, -0.5, 0.5);
1227 hdz = fs->
make<TH1D>(
"h_dz",
"Track d_{z} ; track d_{z} [cm]; tracks", 100, -20, 20);
1229 hd0PVvsphi = fs->
make<TH2D>(
"h2_d0PVvsphi",
"hd0PVvsphi;track #phi;track d_{0}(PV) [cm]", 160, -
M_PI,
M_PI, 100, -1., 1.);
1230 hd0PVvseta = fs->
make<TH2D>(
"h2_d0PVvseta",
"hdPV0vseta;track #eta;track d_{0}(PV) [cm]", 160, -2.5, 2.5, 100, -1., 1.);
1231 hd0PVvspt = fs->
make<TH2D>(
"h2_d0PVvspt",
"hdPV0vspt;track p_{T};d_{0}(PV) [cm]", 50, 0., 100., 100, -1, 1.);
1233 hdxyBS = fs->
make<TH1D>(
"h_dxyBS",
"hdxyBS; track d_{xy}(BS) [cm];tracks", 100, -0.1, 0.1);
1234 hd0BS = fs->
make<TH1D>(
"h_d0BS",
"hd0BS ; track d_{0}(BS) [cm];tracks", 100, -0.1, 0.1);
1235 hdzBS = fs->
make<TH1D>(
"h_dzBS",
"hdzBS ; track d_{z}(BS) [cm];tracks", 100, -12, 12);
1236 hdxyPV = fs->
make<TH1D>(
"h_dxyPV",
"hdxyPV; track d_{xy}(PV) [cm];tracks", 100, -0.1, 0.1);
1237 hd0PV = fs->
make<TH1D>(
"h_d0PV",
"hd0PV ; track d_{0}(PV) [cm];tracks", 100, -0.15, 0.15);
1238 hdzPV = fs->
make<TH1D>(
"h_dzPV",
"hdzPV ; track d_{z}(PV) [cm];tracks", 100, -0.1, 0.1);
1240 hnhTIB = fs->
make<TH1D>(
"h_nHitTIB",
"nhTIB;# hits in TIB; tracks", 20, 0., 20.);
1241 hnhTID = fs->
make<TH1D>(
"h_nHitTID",
"nhTID;# hits in TID; tracks", 20, 0., 20.);
1242 hnhTOB = fs->
make<TH1D>(
"h_nHitTOB",
"nhTOB;# hits in TOB; tracks", 20, 0., 20.);
1243 hnhTEC = fs->
make<TH1D>(
"h_nHitTEC",
"nhTEC;# hits in TEC; tracks", 20, 0., 20.);
1246 hvx = fs->
make<TH1D>(
"h_vx",
"Track v_{x};track v_{x} [cm];tracks", 100, -100., 100.);
1247 hvy = fs->
make<TH1D>(
"h_vy",
"Track v_{y};track v_{y} [cm];tracks", 100, -100., 100.);
1248 hvz = fs->
make<TH1D>(
"h_vz",
"Track v_{z};track v_{z} [cm];track", 100, -100., 100.);
1249 hd0 = fs->
make<TH1D>(
"h_d0",
"Track d_{0};track d_{0} [cm];track", 100, -100., 100.);
1250 hdxy = fs->
make<TH1D>(
"h_dxy",
"Track d_{xy};track d_{xy} [cm];tracks", 100, -100, 100);
1251 hdz = fs->
make<TH1D>(
"h_dz",
"Track d_{z};track d_{z} [cm];tracks", 100, -200, 200);
1253 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.);
1254 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.);
1255 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);
1257 hdxyBS = fs->
make<TH1D>(
"h_dxyBS",
"Track d_{xy}(BS);d_{xy}(BS) [cm];tracks", 100, -100., 100.);
1258 hd0BS = fs->
make<TH1D>(
"h_d0BS",
"Track d_{0}(BS);d_{0}(BS) [cm];tracks", 100, -100., 100.);
1259 hdzBS = fs->
make<TH1D>(
"h_dzBS",
"Track d_{z}(BS);d_{z}(BS) [cm];tracks", 100, -100., 100.);
1260 hdxyPV = fs->
make<TH1D>(
"h_dxyPV",
"Track d_{xy}(PV); d_{xy}(PV) [cm];tracks", 100, -100., 100.);
1261 hd0PV = fs->
make<TH1D>(
"h_d0PV",
"Track d_{0}(PV); d_{0}(PV) [cm];tracks", 100, -100., 100.);
1262 hdzPV = fs->
make<TH1D>(
"h_dzPV",
"Track d_{z}(PV); d_{z}(PV) [cm];tracks", 100, -100., 100.);
1264 hnhTIB = fs->
make<TH1D>(
"h_nHitTIB",
"nhTIB;# hits in TIB; tracks", 30, 0., 30.);
1265 hnhTID = fs->
make<TH1D>(
"h_nHitTID",
"nhTID;# hits in TID; tracks", 30, 0., 30.);
1266 hnhTOB = fs->
make<TH1D>(
"h_nHitTOB",
"nhTOB;# hits in TOB; tracks", 30, 0., 30.);
1267 hnhTEC = fs->
make<TH1D>(
"h_nHitTEC",
"nhTEC;# hits in TEC; tracks", 30, 0., 30.);
1270 hnhpxb = fs->
make<TH1D>(
"h_nHitPXB",
"nhpxb;# hits in Pixel Barrel; tracks", 10, 0., 10.);
1271 hnhpxe = fs->
make<TH1D>(
"h_nHitPXE",
"nhpxe;# hits in Pixel Endcap; tracks", 10, 0., 10.);
1273 hHitComposition = fs->
make<TH1D>(
"h_hitcomposition",
"track hit composition;;# hits", 6, -0.5, 5.5);
1274 pNBpixHitsVsVx = fs->
make<TProfile>(
"p_NpixHits_vs_Vx",
"n. Barrel Pixel hits vs. v_{x};v_{x} (cm);n. BPix hits", 20, -20, 20);
1275 pNBpixHitsVsVy = fs->
make<TProfile>(
"p_NpixHits_vs_Vy",
"n. Barrel Pixel hits vs. v_{y};v_{y} (cm);n. BPix hits", 20, -20, 20);
1276 pNBpixHitsVsVz = fs->
make<TProfile>(
"p_NpixHits_vs_Vz",
"n. Barrel Pixel hits vs. v_{z};v_{z} (cm);n. BPix hits", 20, -100, 100);
1278 std::string dets[6] = {
"PXB",
"PXF",
"TIB",
"TID",
"TOB",
"TEC"};
1279 for (
int i = 1;
i <= hHitComposition->GetNbinsX();
i++) {
1280 hHitComposition->GetXaxis()->SetBinLabel(
i, dets[
i - 1].c_str());
1283 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_tracketa",
"Track #eta;#eta_{Track};Number of Tracks", 90, -3., 3.));
1284 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_trackphi",
"Track #phi;#phi_{Track};Number of Tracks", 90, -
M_PI,
M_PI));
1285 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_trackNumberOfValidHits",
"Track # of valid hits;# of valid hits _{Track};Number of Tracks", 40, 0., 40.));
1286 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_trackNumberOfLostHits",
"Track # of lost hits;# of lost hits _{Track};Number of Tracks", 10, 0., 10.));
1287 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_curvature",
"Curvature #kappa;#kappa_{Track};Number of Tracks", 100, -.05, .05));
1288 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_curvature_pos",
"Curvature |#kappa| Positive Tracks;|#kappa_{pos Track}|;Number of Tracks", 100, .0, .05));
1289 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_curvature_neg",
"Curvature |#kappa| Negative Tracks;|#kappa_{neg Track}|;Number of Tracks", 100, .0, .05));
1290 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_diff_curvature",
"Curvature |#kappa| Tracks Difference;|#kappa_{Track}|;# Pos Tracks - # Neg Tracks", 100,.0,.05));
1292 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_chi2",
"Track #chi^{2};#chi^{2}_{Track};Number of Tracks", 500, -0.01, 500.));
1293 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_chi2Prob",
"#chi^{2} probability;Track Prob(#chi^{2},ndof);Number of Tracks", 100, 0.0, 1.));
1294 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_normchi2",
"#chi^{2}/ndof;#chi^{2}/ndof;Number of Tracks", 100, -0.01, 10.));
1297 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.};
1298 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_pt",
"Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 250, 0., 250));
1299 vTrackHistos_.push_back(fs->
make<TH1F>(
"h_ptrebin",
"Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 18,
xBins));
1301 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));
1302 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));
1303 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));
1304 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));
1305 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));
1306 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));
1307 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));
1308 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));
1309 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));
1310 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));
1311 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));
1312 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));
1313 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));
1314 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));
1315 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));
1316 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_kappa_vs_phi",
"#kappa vs. #phi;#phi_{Track};#kappa", 100, -
M_PI,
M_PI));
1317 vTrackProfiles_.push_back(fs->
make<TProfile>(
"p_kappa_vs_eta",
"#kappa vs. #eta;#eta_{Track};#kappa", 100, -
M_PI,
M_PI));
1318 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));
1319 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));
1320 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.));
1321 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.));
1322 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.));
1323 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.));
1324 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.));
1325 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.));
1326 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.));
1327 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.));
1328 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.));
1329 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.));
1330 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.));
1331 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_kappa_vs_phi",
"#kappa vs. #phi;#phi_{Track};#kappa", 100, -
M_PI,
M_PI, 100, .0, .05));
1332 vTrack2DHistos_.push_back(fs->
make<TH2F>(
"h2_kappa_vs_eta",
"#kappa vs. #eta;#eta_{Track};#kappa", 100, -
M_PI,
M_PI, 100, .0, .05));
1333 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));
1342 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1343 edm::LogPrint(
"DMRChecker") <<
"Events run in total: " << ievt << std::endl;
1344 edm::LogPrint(
"DMRChecker") <<
"n. tracks: " << itrks << std::endl;
1345 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1347 int nFiringTriggers = triggerMap_.size();
1348 edm::LogPrint(
"DMRChecker") <<
"firing triggers: " << nFiringTriggers << std::endl;
1349 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1351 tksByTrigger_ = fs->
make<TH1D>(
1352 "tksByTrigger",
"tracks by HLT path;;% of # traks", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1353 evtsByTrigger_ = fs->
make<TH1D>(
1354 "evtsByTrigger",
"events by HLT path;;% of # events", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1358 for (
std::map<
std::string, std::pair<int, int> >::iterator it = triggerMap_.begin(); it != triggerMap_.end();
1362 double trkpercent = ((it->second).
second) * 100. / double(itrks);
1363 double evtpercent = ((it->second).
first) * 100. / double(ievt);
1367 edm::LogPrint(
"DMRChecker") <<
"HLT path: " << std::setw(60) << left << it->first <<
" | events firing: " << right
1368 << std::setw(8) << (it->second).
first <<
" (" << setw(8) <<
fixed << evtpercent
1370 <<
" | tracks collected: " << std::setw(10) << (it->second).
second <<
" (" << setw(8)
1371 <<
fixed << trkpercent <<
"%)";
1373 tksByTrigger_->SetBinContent(
i, trkpercent);
1374 tksByTrigger_->GetXaxis()->SetBinLabel(
i, (it->first).c_str());
1376 evtsByTrigger_->SetBinContent(
i, evtpercent);
1377 evtsByTrigger_->GetXaxis()->SetBinLabel(
i, (it->first).c_str());
1380 int nRuns = conditionsMap_.size();
1382 vector<int> theRuns_;
1383 for (
map<
int, std::pair<int, float> >::iterator it = conditionsMap_.begin(); it != conditionsMap_.end(); ++it) {
1384 theRuns_.push_back(it->first);
1387 sort(theRuns_.begin(), theRuns_.end());
1388 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1389 edm::LogPrint(
"DMRChecker") <<
"first run: " << theRuns_[0] << std::endl;
1390 edm::LogPrint(
"DMRChecker") <<
"last run: " << theRuns_[theRuns_.size() - 1] << std::endl;
1391 edm::LogPrint(
"DMRChecker") <<
"considered runs: " << nRuns << std::endl;
1392 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1394 modeByRun_ = fs->
make<TH1D>(
1395 "modeByRun",
"Strip APV mode by run number;;APV mode (-1=deco,+1=peak)", nRuns, -0.5, nRuns - 0.5);
1396 fieldByRun_ = fs->
make<TH1D>(
1397 "fieldByRun",
"CMS B-field intensity by run number;;B-field intensity [T]", nRuns, -0.5, nRuns - 0.5);
1400 fs->
make<TH1D>(
"tracksByRun",
"n. AlCaReco Tracks by run number;;n. of tracks", nRuns, -0.5, nRuns - 0.5);
1401 hitsByRun_ = fs->
make<TH1D>(
"histByRun",
"n. of hits by run number;;n. of hits", nRuns, -0.5, nRuns - 0.5);
1403 trackRatesByRun_ = fs->
make<TH1D>(
1404 "trackRatesByRun",
"rate of AlCaReco Tracks by run number;;n. of tracks/s", nRuns, -0.5, nRuns - 0.5);
1405 eventRatesByRun_ = fs->
make<TH1D>(
1406 "eventRatesByRun",
"rate of AlCaReco Events by run number;;n. of events/s", nRuns, -0.5, nRuns - 0.5);
1408 hitsinBPixByRun_ = fs->
make<TH1D>(
1409 "histinBPixByRun",
"n. of hits in BPix by run number;;n. of BPix hits", nRuns, -0.5, nRuns - 0.5);
1410 hitsinFPixByRun_ = fs->
make<TH1D>(
1411 "histinFPixByRun",
"n. of hits in FPix by run number;;n. of FPix hits", nRuns, -0.5, nRuns - 0.5);
1414 for (
int the_r = theRuns_[0]; the_r <= theRuns_[theRuns_.size() - 1]; the_r++) {
1415 if (conditionsMap_.find(the_r)->second.first != 0) {
1417 double runTime = timeMap_.find(the_r)->second;
1419 edm::LogPrint(
"DMRChecker") <<
"run:" << the_r <<
" | isPeak: " << std::setw(4)
1420 << conditionsMap_.find(the_r)->second.first
1421 <<
"| B-field: " << conditionsMap_.find(the_r)->second.second <<
" [T]"
1422 <<
"| events: " << setw(10) << runInfoMap_.find(the_r)->second.first
1423 <<
"(rate: " << setw(10) << (runInfoMap_.find(the_r)->second.first) / runTime
1425 <<
", tracks " << setw(10) << runInfoMap_.find(the_r)->second.second
1426 <<
"(rate: " << setw(10) << (runInfoMap_.find(the_r)->second.second) / runTime
1427 <<
" trk/s)" << std::endl;
1430 modeByRun_->SetBinContent(indexing, conditionsMap_.find(the_r)->second.first);
1431 modeByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1432 fieldByRun_->SetBinContent(indexing, conditionsMap_.find(the_r)->second.second);
1433 fieldByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1435 tracksByRun_->SetBinContent(indexing, runInfoMap_.find(the_r)->second.first);
1436 tracksByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1437 hitsByRun_->SetBinContent(indexing, runInfoMap_.find(the_r)->second.second);
1438 hitsByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1440 hitsinBPixByRun_->SetBinContent(indexing, (runHitsMap_.find(the_r)->second)[0]);
1441 hitsinBPixByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1442 hitsinFPixByRun_->SetBinContent(indexing, (runHitsMap_.find(the_r)->second)[1]);
1443 hitsinFPixByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1445 trackRatesByRun_->SetBinContent(indexing, (runInfoMap_.find(the_r)->second.second) / runTime);
1446 trackRatesByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1447 eventRatesByRun_->SetBinContent(indexing, (runInfoMap_.find(the_r)->second.first) / runTime);
1448 eventRatesByRun_->GetXaxis()->SetBinLabel(indexing, Form(
"%d", the_r));
1450 constexpr
const char *
subdets[]{
"BPix",
"FPix",
"TIB",
"TID",
"TOB",
"TEC"};
1452 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1453 edm::LogPrint(
"DMRChecker") <<
"Hits by Sub-det" << std::endl;
1455 for (
const auto &
entry : runHitsMap_.find(the_r)->second) {
1459 edm::LogPrint(
"DMRChecker") <<
"*******************************" << std::endl;
1469 DMRBPixX_ = DMeanR.
make<TH1D>(
"DMRBPix-X",
"DMR of BPix-X;mean of X-residuals;modules", 100., -200, 200);
1470 DMRBPixY_ = DMeanR.
make<TH1D>(
"DMRBPix-Y",
"DMR of BPix-Y;mean of Y-residuals;modules", 100., -200, 200);
1472 DMRFPixX_ = DMeanR.
make<TH1D>(
"DMRFPix-X",
"DMR of FPix-X;mean of X-residuals;modules", 100., -200, 200);
1473 DMRFPixY_ = DMeanR.
make<TH1D>(
"DMRFPix-Y",
"DMR of FPix-Y;mean of Y-residuals;modules", 100., -200, 200);
1475 DMRTIB_ = DMeanR.
make<TH1D>(
"DMRTIB",
"DMR of TIB;mean of X-residuals;modules", 100., -200, 200);
1476 DMRTOB_ = DMeanR.
make<TH1D>(
"DMRTOB",
"DMR of TOB;mean of X-residuals;modules", 100., -200, 200);
1478 DMRTID_ = DMeanR.
make<TH1D>(
"DMRTID",
"DMR of TID;mean of X-residuals;modules", 100., -200, 200);
1479 DMRTEC_ = DMeanR.
make<TH1D>(
"DMRTEC",
"DMR of TEC;mean of X-residuals;modules", 100., -200, 200);
1483 DMRBPixXSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"BPix",
"X",
true);
1484 DMRBPixYSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"BPix",
"Y",
true);
1486 DMRFPixXSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"FPix",
"X",
false);
1487 DMRFPixYSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"FPix",
"Y",
false);
1489 DMRTIBSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"TIB",
"X",
true);
1490 DMRTOBSplit_ = bookSplitDMRHistograms(DMeanRSplit,
"TOB",
"X",
true);
1495 DRnRBPixX_ = DRnRs.
make<TH1D>(
"DRnRBPix-X",
"DRnR of BPix-X;rms of normalized X-residuals;modules", 100., 0., 3.);
1496 DRnRBPixY_ = DRnRs.
make<TH1D>(
"DRnRBPix-Y",
"DRnR of BPix-Y;rms of normalized Y-residuals;modules", 100., 0., 3.);
1498 DRnRFPixX_ = DRnRs.
make<TH1D>(
"DRnRFPix-X",
"DRnR of FPix-X;rms of normalized X-residuals;modules", 100., 0., 3.);
1499 DRnRFPixY_ = DRnRs.
make<TH1D>(
"DRnRFPix-Y",
"DRnR of FPix-Y;rms of normalized Y-residuals;modules", 100., 0., 3.);
1501 DRnRTIB_ = DRnRs.
make<TH1D>(
"DRnRTIB",
"DRnR of TIB;rms of normalized X-residuals;modules", 100., 0., 3.);
1502 DRnRTOB_ = DRnRs.
make<TH1D>(
"DRnRTOB",
"DRnR of TOB;rms of normalized Y-residuals;modules", 100., 0., 3.);
1504 DRnRTID_ = DRnRs.
make<TH1D>(
"DRnRTID",
"DRnR of TID;rms of normalized X-residuals;modules", 100., 0., 3.);
1505 DRnRTEC_ = DRnRs.
make<TH1D>(
"DRnRTEC",
"DRnR of TEC;rms of normalized Y-residuals;modules", 100., 0., 3.);
1515 PixelDMRS_x_ByLayer = std::make_unique<PixelRegions::PixelRegionContainers>(&standaloneTopo, ph_info.
phase());
1516 PixelDMRS_y_ByLayer = std::make_unique<PixelRegions::PixelRegionContainers>(&standaloneTopo, ph_info.
phase());
1519 PixelDMRS_x_ByLayer->bookAll(
"Barrel Pixel DMRs",
"median(x'_{pred}-x'_{hit}) [#mum]",
"# modules", 100, -50, 50);
1520 PixelDMRS_y_ByLayer->bookAll(
"Barrel Pixel DMRs",
"median(y'_{pred}-y'_{hit}) [#mum]",
"# modules", 100, -50, 50);
1532 for (
auto &bpixid : resDetailsBPixX_) {
1533 DMRBPixX_->Fill(bpixid.second.runningMeanOfRes_);
1535 pixelmap->fillBarrelBin(
"DMRsX", bpixid.first, bpixid.second.runningMeanOfRes_);
1540 PixelDMRS_x_ByLayer->fill(bpixid.first, bpixid.second.runningMeanOfRes_);
1543 if (bpixid.second.rDirection > 0) {
1544 DMRBPixXSplit_[0]->Fill(bpixid.second.runningMeanOfRes_);
1546 DMRBPixXSplit_[1]->Fill(bpixid.second.runningMeanOfRes_);
1549 if (bpixid.second.hitCount < 2)
1550 DRnRBPixX_->Fill(-1);
1552 DRnRBPixX_->Fill(
sqrt(bpixid.second.runningNormVarOfRes_ / (bpixid.second.hitCount - 1)));
1555 for (
auto &bpixid : resDetailsBPixY_) {
1556 DMRBPixY_->Fill(bpixid.second.runningMeanOfRes_);
1558 pixelmap->fillBarrelBin(
"DMRsY", bpixid.first, bpixid.second.runningMeanOfRes_);
1559 PixelDMRS_y_ByLayer->fill(bpixid.first, bpixid.second.runningMeanOfRes_);
1562 if (bpixid.second.rDirection > 0) {
1563 DMRBPixYSplit_[0]->Fill(bpixid.second.runningMeanOfRes_);
1565 DMRBPixYSplit_[1]->Fill(bpixid.second.runningMeanOfRes_);
1568 if (bpixid.second.hitCount < 2)
1569 DRnRBPixY_->Fill(-1);
1571 DRnRBPixY_->Fill(
sqrt(bpixid.second.runningNormVarOfRes_ / (bpixid.second.hitCount - 1)));
1574 for (
auto &fpixid : resDetailsFPixX_) {
1575 DMRFPixX_->Fill(fpixid.second.runningMeanOfRes_);
1577 pixelmap->fillForwardBin(
"DMRsX", fpixid.first, fpixid.second.runningMeanOfRes_);
1578 PixelDMRS_x_ByLayer->fill(fpixid.first, fpixid.second.runningMeanOfRes_);
1581 if (fpixid.second.zDirection > 0) {
1582 DMRFPixXSplit_[0]->Fill(fpixid.second.runningMeanOfRes_);
1584 DMRFPixXSplit_[1]->Fill(fpixid.second.runningMeanOfRes_);
1587 if (fpixid.second.hitCount < 2)
1588 DRnRFPixX_->Fill(-1);
1590 DRnRFPixX_->Fill(
sqrt(fpixid.second.runningNormVarOfRes_ / (fpixid.second.hitCount - 1)));
1593 for (
auto &fpixid : resDetailsFPixY_) {
1594 DMRFPixY_->Fill(fpixid.second.runningMeanOfRes_);
1596 pixelmap->fillForwardBin(
"DMRsY", fpixid.first, fpixid.second.runningMeanOfRes_);
1597 PixelDMRS_y_ByLayer->fill(fpixid.first, fpixid.second.runningMeanOfRes_);
1600 if (fpixid.second.zDirection > 0) {
1601 DMRFPixYSplit_[0]->Fill(fpixid.second.runningMeanOfRes_);
1603 DMRFPixYSplit_[1]->Fill(fpixid.second.runningMeanOfRes_);
1606 if (fpixid.second.hitCount < 2)
1607 DRnRFPixY_->Fill(-1);
1609 DRnRFPixY_->Fill(
sqrt(fpixid.second.runningNormVarOfRes_ / (fpixid.second.hitCount - 1)));
1614 for (
auto &tibid : resDetailsTIB_) {
1615 DMRTIB_->Fill(tibid.second.runningMeanOfRes_);
1618 if (tibid.second.rDirection > 0) {
1619 DMRTIBSplit_[0]->Fill(tibid.second.runningMeanOfRes_);
1621 DMRTIBSplit_[1]->Fill(tibid.second.runningMeanOfRes_);
1624 if (tibid.second.hitCount < 2)
1627 DRnRTIB_->Fill(
sqrt(tibid.second.runningNormVarOfRes_ / (tibid.second.hitCount - 1)));
1630 for (
auto &tobid : resDetailsTOB_) {
1631 DMRTOB_->Fill(tobid.second.runningMeanOfRes_);
1634 if (tobid.second.rDirection > 0) {
1635 DMRTOBSplit_[0]->Fill(tobid.second.runningMeanOfRes_);
1637 DMRTOBSplit_[1]->Fill(tobid.second.runningMeanOfRes_);
1640 if (tobid.second.hitCount < 2)
1643 DRnRTOB_->Fill(
sqrt(tobid.second.runningNormVarOfRes_ / (tobid.second.hitCount - 1)));
1646 for (
auto &tidid : resDetailsTID_) {
1647 DMRTID_->Fill(tidid.second.runningMeanOfRes_);
1649 if (tidid.second.hitCount < 2)
1652 DRnRTID_->Fill(
sqrt(tidid.second.runningNormVarOfRes_ / (tidid.second.hitCount - 1)));
1655 for (
auto &tecid : resDetailsTEC_) {
1656 DMRTEC_->Fill(tecid.second.runningMeanOfRes_);
1658 if (tecid.second.hitCount < 2)
1661 DRnRTEC_->Fill(
sqrt(tecid.second.runningNormVarOfRes_ / (tecid.second.hitCount - 1)));
1664 edm::LogPrint(
"DMRChecker") <<
"n. of bpix modules " << resDetailsBPixX_.size() << std::endl;
1665 edm::LogPrint(
"DMRChecker") <<
"n. of fpix modules " << resDetailsFPixX_.size() << std::endl;
1668 pmap->save(
true, 0, 0,
"PixelHitMap.pdf", 600, 800);
1669 pmap->save(
true, 0, 0,
"PixelHitMap.png", 500, 750);
1672 tmap->save(
true, 0, 0,
"StripHitMap.pdf");
1673 tmap->save(
true, 0, 0,
"StripHitMap.png");
1676 gStyle->SetPalette(kRainBow);
1677 pixelmap->beautifyAllHistograms();
1679 TCanvas cBX(
"CanvXBarrel",
"CanvXBarrel", 1200, 1000);
1680 pixelmap->DrawBarrelMaps(
"DMRsX", cBX);
1681 cBX.SaveAs(
"pixelBarrelDMR_x.png");
1683 TCanvas cFX(
"CanvXForward",
"CanvXForward", 1600, 1000);
1684 pixelmap->DrawForwardMaps(
"DMRsX", cFX);
1685 cFX.SaveAs(
"pixelForwardDMR_x.png");
1687 TCanvas cBY(
"CanvYBarrel",
"CanvYBarrel", 1200, 1000);
1688 pixelmap->DrawBarrelMaps(
"DMRsY", cBY);
1689 cBY.SaveAs(
"pixelBarrelDMR_y.png");
1691 TCanvas cFY(
"CanvXForward",
"CanvXForward", 1600, 1000);
1692 pixelmap->DrawForwardMaps(
"DMRsY", cFY);
1693 cFY.SaveAs(
"pixelForwardDMR_y.png");
1697 gStyle->SetOptStat(
"emr");
1698 PixelDMRS_x_ByLayer->beautify(2, 0);
1699 PixelDMRS_y_ByLayer->beautify(2, 0);
1701 TCanvas DMRxBarrel(
"DMRxBarrelCanv",
"x-coordinate", 1400, 1200);
1702 DMRxBarrel.Divide(2, 2);
1703 PixelDMRS_x_ByLayer->draw(DMRxBarrel,
true,
"HISTS");
1704 adjustCanvases(DMRxBarrel,
true);
1705 for (
unsigned int c = 1;
c <= 4;
c++) {
1706 DMRxBarrel.cd(
c)->Update();
1708 PixelDMRS_x_ByLayer->stats();
1710 TCanvas DMRxForward(
"DMRxForwardCanv",
"x-coordinate", 1400, 1200);
1711 DMRxForward.Divide(4, 3);
1712 PixelDMRS_x_ByLayer->draw(DMRxForward,
false,
"HISTS");
1713 adjustCanvases(DMRxForward,
false);
1714 for (
unsigned int c = 1;
c <= 12;
c++) {
1715 DMRxForward.cd(
c)->Update();
1717 PixelDMRS_x_ByLayer->stats();
1719 DMRxBarrel.SaveAs(
"DMR_x_Barrel_ByLayer.png");
1720 DMRxForward.SaveAs(
"DMR_x_Forward_ByRing.png");
1722 TCanvas DMRyBarrel(
"DMRyBarrelCanv",
"y-coordinate", 1400, 1200);
1723 DMRyBarrel.Divide(2, 2);
1724 PixelDMRS_y_ByLayer->draw(DMRyBarrel,
true,
"HISTS");
1725 adjustCanvases(DMRyBarrel,
true);
1726 for (
unsigned int c = 1;
c <= 4;
c++) {
1727 DMRyBarrel.cd(
c)->Update();
1729 PixelDMRS_y_ByLayer->stats();
1731 TCanvas DMRyForward(
"DMRyForwardCanv",
"y-coordinate", 1400, 1200);
1732 DMRyForward.Divide(4, 3);
1733 PixelDMRS_y_ByLayer->draw(DMRyForward,
false,
"HISTS");
1734 adjustCanvases(DMRyForward,
false);
1735 for (
unsigned int c = 1;
c <= 12;
c++) {
1736 DMRyForward.cd(
c)->Update();
1738 PixelDMRS_y_ByLayer->stats();
1740 DMRyBarrel.SaveAs(
"DMR_y_Barrel_ByLayer.png");
1741 DMRyForward.SaveAs(
"DMR_y_Forward_ByRing.png");
1748 unsigned int maxPads =
isBarrel ? 4 : 12;
1749 for (
unsigned int c = 1;
c <= maxPads;
c++) {
1754 auto ltx = TLatex();
1755 ltx.SetTextFont(62);
1756 ltx.SetTextSize(0.05);
1757 ltx.SetTextAlign(11);
1761 for (
unsigned int c = 1;
c <= maxPads;
c++) {
1764 ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1765 1 - gPad->GetTopMargin() + 0.01,
1774 bool countStereoHitAs2D_ =
true;
1777 if (!
hit.isValid() ||
1778 (
hit.dimension() < 2 && !countStereoHitAs2D_ && !dynamic_cast<const SiStripRecHit1D *>(&
hit))) {
1781 const DetId detId(
hit.geographicalId());
1783 if (detId.subdetId() ==
kBPIX || detId.subdetId() ==
kFPIX) {
1788 return countStereoHitAs2D_;
1789 else if (dynamic_cast<const SiStripRecHit1D *>(&
hit) || dynamic_cast<const SiStripRecHit2D *>(&
hit))
1792 else if (dynamic_cast<const SiStripMatchedRecHit2D *>(&
hit))
1794 else if (dynamic_cast<const ProjectedSiStripRecHit2D *>(&
hit)) {
1796 return (countStereoHitAs2D_ && this->isHit2D(pH->
originalHit()));
1799 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor "
1800 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
1806 <<
"Hit not in tracker with 'official' dimension >=2.";
1820 TH1F::SetDefaultSumw2(kTRUE);
1822 std::array<TH1D *, 2>
out;
1823 std::array<std::string, 2> sign_name = {{
"plus",
"minus"}};
1824 std::array<std::string, 2>
sign = {{
">0",
"<0"}};
1825 for (
unsigned int i = 0;
i < 2;
i++) {
1828 const char *axisTitle_;
1831 name_ = Form(
"DMR%s_%s_rDir%s", subdet.c_str(), vartype.c_str(), sign_name[
i].c_str());
1832 title_ = Form(
"Split DMR of %s-%s (rDir%s)", subdet.c_str(), vartype.c_str(),
sign[
i].c_str());
1833 axisTitle_ = Form(
"mean of %s-residuals (rDir%s);modules", vartype.c_str(),
sign[
i].c_str());
1835 name_ = Form(
"DMR%s_%s_zDir%s", subdet.c_str(), vartype.c_str(), sign_name[
i].c_str());
1836 title_ = Form(
"Split DMR of %s-%s (zDir%s)", subdet.c_str(), vartype.c_str(),
sign[
i].c_str());
1837 axisTitle_ = Form(
"mean of %s-residuals (zDir%s);modules", vartype.c_str(),
sign[
i].c_str());
1840 out[
i] =
dir.make<TH1D>(name_, fmt::sprintf(
"%s;%s", title_, axisTitle_).c_str(), 100., -200, 200);
1850 TH1F::SetDefaultSumw2(kTRUE);
1852 std::pair<double, double>
limits;
1854 if (
varType.find(
"Res") != std::string::npos) {
1855 limits = std::make_pair(-1000., 1000);
1857 limits = std::make_pair(-3., 3.);
1860 std::map<unsigned int, TH1D *>
h;
1862 for (
unsigned int i = 1;
i <= theNLayers;
i++) {
1865 const char *xAxisTitle_;
1867 if (
varType.find(
"Res") != std::string::npos) {
1868 xAxisTitle_ = (
"res_{" + resType +
"'} [#mum]").c_str();
1870 xAxisTitle_ = (
"res_{" + resType +
"'}/#sigma_{res_{" + resType +
"`}}").c_str();
1873 unsigned int side = -1;
1874 if (detType.find(
"FPix") != std::string::npos) {
1875 side = (
i - 1) / 3 + 1;
1876 unsigned int plane = (
i - 1) % 3 + 1;
1885 name_ = Form(
"h_%s%s%s_side%i_disk%i", detType.c_str(),
varType.c_str(), resType.c_str(), side, plane);
1886 title_ = Form(
"%s (%s, disk %i) track %s-%s;%s;hits",
1895 name_ = Form(
"h_%s%s%s_layer%i", detType.c_str(),
varType.c_str(), resType.c_str(),
i);
1897 "%s (layer %i) track %s-%s;%s;hits", detType.c_str(),
i, resType.c_str(),
varType.c_str(), xAxisTitle_);
1912 if (
h.count(
index) != 0) {
1916 double min =
h[
index]->GetXaxis()->GetXmin();
1917 double max =
h[
index]->GetXaxis()->GetXmax();
1932 myDetails[theID].hitCount += 1;
1937 if (myDetails[theID].hitCount != 1) {
1938 delta = the_data - myDetails[theID].runningMeanOfRes_;
1939 n_delta = the_pull - myDetails[theID].runningNormMeanOfRes_;
1940 myDetails[theID].runningMeanOfRes_ += (
delta / myDetails[theID].hitCount);
1941 myDetails[theID].runningNormMeanOfRes_ += (n_delta / myDetails[theID].hitCount);
1943 myDetails[theID].runningMeanOfRes_ = the_data;
1944 myDetails[theID].runningNormMeanOfRes_ = the_pull;
1947 float delta2 = the_data - myDetails[theID].runningMeanOfRes_;
1948 float n_delta2 = the_pull - myDetails[theID].runningNormMeanOfRes_;
1950 myDetails[theID].runningVarOfRes_ +=
delta * delta2;
1951 myDetails[theID].runningNormVarOfRes_ += n_delta * n_delta2;
1960 std::array<TH1D *, 2> DMRSplit,
1961 std::unique_ptr<PixelRegions::PixelRegionContainers> regionalDMR) {
1962 for (
const auto &element : myDetails) {
1964 DMR->Fill(element.second.runningMeanOfRes_);
1967 if (regionalDMR.get()) {
1968 regionalDMR->fill(element.first, element.second.runningMeanOfRes_);
1972 if (element.second.rOrZDirection > 0) {
1973 DMRSplit[0]->Fill(element.second.runningMeanOfRes_);
1975 DMRSplit[1]->Fill(element.second.runningMeanOfRes_);
1979 if (element.second.hitCount < 2) {
1982 DRnR->Fill(
sqrt(element.second.runningNormVarOfRes_ / (element.second.hitCount - 1)));
1993 desc.setComment(
"Generic track analyzer to check ALCARECO sample quantities / compute fast DMRs");
1998 desc.add<
bool>(
"isCosmics",
false);
1999 descriptions.
add(
"DMRChecker",
desc);