32 #include <boost/range/adaptor/indexed.hpp>
113 pmap = std::make_unique<TrackerMap>(
"Pixel");
114 pmap->onlyPixel(
true);
115 pmap->setTitle(
"Pixel Hit entries");
118 tmap = std::make_unique<TrackerMap>(
"Strip");
119 tmap->setTitle(
"Strip Hit entries");
122 pixelmap = std::make_unique<Phase1PixelMaps>(
"COLZ0 L");
123 pixelmap->bookBarrelHistograms(
"entriesBarrel",
"# hits",
"# pixel hits");
124 pixelmap->bookForwardHistograms(
"entriesForward",
"# hits",
"# pixel hits");
133 template <
class OBJECT_TYPE>
134 int GetIndex(
const std::vector<OBJECT_TYPE *> &vec,
const TString &
name) {
135 for (
const auto &iter : vec | boost::adaptors::indexed(0)) {
136 if (iter.value() && iter.value()->GetName() ==
name) {
140 edm::LogError(
"GeneralPurposeTrackAnalyzer") <<
"@SUB=GeneralPurposeTrackAnalyzer::GetIndex"
141 <<
" could not find " <<
name;
161 std::unique_ptr<TrackerMap>
tmap;
162 std::unique_ptr<TrackerMap>
pmap;
326 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") <<
"Reconstructed " << tC.size() <<
" tracks" << std::endl;
333 int ntrigs = hltresults->size();
336 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
338 bool accept = hltresults->accept(itrig);
342 << trigName <<
" " << accept <<
" ,track size: " << tC.size() << std::endl;
354 int nHighPurityTracks = 0;
357 unsigned int nHit2D = 0;
358 std::bitset<16> rocsToMask;
359 for (
auto iHit =
track->recHitsBegin(); iHit !=
track->recHitsEnd(); ++iHit) {
365 const DetId &detId = (*iHit)->geographicalId();
371 if (pixhit->isValid()) {
372 unsigned int subid = detId.
subdetId();
373 int detid_db = detId.
rawId();
376 auto clustp = pixhit->cluster();
380 auto const &cluster = *clustp;
381 int row = cluster.x() - 0.5,
col = cluster.y() - 0.5;
382 int rocId =
coord_.
roc(detId, std::make_pair(row,
col));
384 rocsToMask.set(rocId);
388 pmap->fill(detid_db, 1);
391 pixelmap->fillBarrelBin(
"entriesBarrel", detid_db, 1);
393 pixelmap->fillForwardBin(
"entriesForward", detid_db, 1);
423 if ((*iHit)->isValid()) {
431 hnhpxb->Fill(
track->hitPattern().numberOfValidPixelBarrelHits());
432 hnhpxe->Fill(
track->hitPattern().numberOfValidPixelEndcapHits());
433 hnhTIB->Fill(
track->hitPattern().numberOfValidStripTIBHits());
434 hnhTID->Fill(
track->hitPattern().numberOfValidStripTIDHits());
435 hnhTOB->Fill(
track->hitPattern().numberOfValidStripTOBHits());
436 hnhTEC->Fill(
track->hitPattern().numberOfValidStripTECHits());
439 if (
track->hitPattern().numberOfValidPixelBarrelHits() != 0) {
446 if (
track->hitPattern().numberOfValidPixelEndcapHits() != 0) {
449 if (
track->hitPattern().numberOfValidStripTIBHits() != 0) {
452 if (
track->hitPattern().numberOfValidStripTIDHits() != 0) {
455 if (
track->hitPattern().numberOfValidStripTOBHits() != 0) {
458 if (
track->hitPattern().numberOfValidStripTECHits() != 0) {
471 if (fabs(
track->eta()) < 0.8) {
474 if (
track->eta() > 0.8 &&
track->eta() < 1.4) {
477 if (
track->eta() < -0.8 &&
track->eta() > -1.4) {
480 if (
track->eta() > 1.4) {
483 if (
track->eta() < -1.4) {
542 double theLocalMagFieldInInverseGeV =
magneticField_->inInverseGeV(gPoint).z();
543 double kappa = -
track->charge() * theLocalMagFieldInInverseGeV /
track->pt();
548 if (
track->charge() > 0)
551 if (
track->charge() < 0)
554 double chi2Prob = TMath::Prob(
track->chi2(),
track->ndof());
555 double normchi2 =
track->normalizedChi2();
567 if (
track->ptError() != 0.) {
642 if (beamSpotHandle.
isValid()) {
643 beamSpot = *beamSpotHandle;
655 double mindxy = 100.;
658 for (
auto pvtx = vertexHandle->cbegin(); pvtx != vertexHandle->cend(); ++pvtx) {
661 mindxy =
track->dxy(mypoint);
662 dz =
track->dz(mypoint);
667 hd0PV->Fill(-mindxy);
685 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") <<
"end of track loop" << std::endl;
689 hNtrk->Fill(tC.size());
694 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") <<
"end of analysis" << std::endl;
708 <<
"run number:" <<
run.run() <<
" magnetic field: " << B_ <<
" [T]" << std::endl;
713 if (apvlat->singleReadOutMode() == 1) {
715 }
else if (apvlat->singleReadOutMode() == 0) {
728 coord_.
init(trackerTopology, trackerGeometry, siPixelFedCablingMap);
740 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") << __LINE__ << std::endl;
743 TH1D::SetDefaultSumw2(kTRUE);
751 hrun =
fs->
make<TH1D>(
"h_run",
"run", 100000, 230000, 240000);
752 hlumi =
fs->
make<TH1D>(
"h_lumi",
"lumi", 1000, 0, 1000);
754 hchi2ndof =
fs->
make<TH1D>(
"h_chi2ndof",
"chi2/ndf;#chi^{2}/ndf;tracks", 100, 0, 5.);
755 hCharge =
fs->
make<TH1D>(
"h_charge",
"charge;Charge of the track;tracks", 5, -2.5, 2.5);
756 hNtrk =
fs->
make<TH1D>(
"h_Ntrk",
"ntracks;Number of Tracks;events", 200, 0., 200.);
757 hNtrkZoom =
fs->
make<TH1D>(
"h_NtrkZoom",
"Number of tracks; number of tracks;events", 10, 0., 10.);
759 fs->
make<TH1D>(
"h_NhighPurity",
"n. high purity tracks;Number of high purity tracks;events", 200, 0., 200.);
762 "tracking step;iterative tracking step;tracks",
765 double(reco::TrackBase::algoSize));
768 "original tracking step;original iterative tracking step;tracks",
771 double(reco::TrackBase::algoSize));
773 for (
size_t ibin = 0; ibin < reco::TrackBase::algoSize - 1; ibin++) {
778 htrkQuality =
fs->
make<TH1I>(
"h_trkQuality",
"track quality;track quality;tracks", 6, -1, 5);
779 std::string qualities[7] = {
"undef",
"loose",
"tight",
"highPurity",
"confirmed",
"goodIterative"};
780 for (
int nbin = 1; nbin <=
htrkQuality->GetNbinsX(); nbin++) {
781 htrkQuality->GetXaxis()->SetBinLabel(nbin, (qualities[nbin - 1]).c_str());
784 hP =
fs->
make<TH1D>(
"h_P",
"Momentum;track momentum [GeV];tracks", 100, 0., 100.);
785 hQoverP =
fs->
make<TH1D>(
"h_qoverp",
"Track q/p; track q/p [GeV^{-1}];tracks", 100, -1., 1.);
786 hQoverPZoom =
fs->
make<TH1D>(
"h_qoverpZoom",
"Track q/p; track q/p [GeV^{-1}];tracks", 100, -0.1, 0.1);
787 hPt =
fs->
make<TH1D>(
"h_Pt",
"Transverse Momentum;track p_{T} [GeV];tracks", 100, 0., 100.);
788 hHit =
fs->
make<TH1D>(
"h_nHits",
"Number of hits;track n. hits;tracks", 50, -0.5, 49.5);
789 hHit2D =
fs->
make<TH1D>(
"h_nHit2D",
"Number of 2D hits; number of 2D hits;tracks", 20, 0, 20);
791 hHitCountVsZBPix =
fs->
make<TH1D>(
"h_HitCountVsZBpix",
"Number of BPix hits vs z;hit global z;hits", 60, -30, 30);
793 fs->
make<TH1D>(
"h_HitCountVsZFpix",
"Number of FPix hits vs z;hit global z;hits", 100, -100, 100);
795 hHitCountVsXBPix =
fs->
make<TH1D>(
"h_HitCountVsXBpix",
"Number of BPix hits vs x;hit global x;hits", 20, -20, 20);
796 hHitCountVsXFPix =
fs->
make<TH1D>(
"h_HitCountVsXFpix",
"Number of FPix hits vs x;hit global x;hits", 20, -20, 20);
798 hHitCountVsYBPix =
fs->
make<TH1D>(
"h_HitCountVsYBpix",
"Number of BPix hits vs y;hit global y;hits", 20, -20, 20);
799 hHitCountVsYFPix =
fs->
make<TH1D>(
"h_HitCountVsYFpix",
"Number of FPix hits vs y;hit global y;hits", 20, -20, 20);
802 fs->
make<TH1D>(
"h_HitCountVsThetaBpix",
"Number of BPix hits vs #theta;hit global #theta;hits", 20, 0.,
M_PI);
804 fs->
make<TH1D>(
"h_HitCountVsPhiBpix",
"Number of BPix hits vs #phi;hit global #phi;hits", 20, -
M_PI,
M_PI);
807 fs->
make<TH1D>(
"h_HitCountVsThetaFpix",
"Number of FPix hits vs #theta;hit global #theta;hits", 40, 0.,
M_PI);
809 fs->
make<TH1D>(
"h_HitCountVsPhiFpix",
"Number of FPix hits vs #phi;hit global #phi;hits", 20, -
M_PI,
M_PI);
816 fs->
make<TH1D>(
"h_PhiOverlapPlus",
"hPhiOverlapPlus (0.8<#eta<1.4);track #phi;tracks", 100, -
M_PI,
M_PI);
818 fs->
make<TH1D>(
"h_PhiOverlapMinus",
"hPhiOverlapMinus (-1.4<#eta<-0.8);track #phi;tracks", 100, -
M_PI,
M_PI);
821 fs->
make<TH1D>(
"h_PhiEndcapMinus",
"hPhiEndcapMinus (#eta<1.4);track #phi;tracks", 100, -
M_PI,
M_PI);
824 hPhp =
fs->
make<TH1D>(
"h_P_hp",
"Momentum (high purity);track momentum [GeV];tracks", 100, 0., 100.);
825 hPthp =
fs->
make<TH1D>(
"h_Pt_hp",
"Transverse Momentum (high purity);track p_{T} [GeV];tracks", 100, 0., 100.);
826 hHithp =
fs->
make<TH1D>(
"h_nHit_hp",
"Number of hits (high purity);track n. hits;tracks", 30, 0, 30);
828 fs->
make<TH1D>(
"h_Eta_hp",
"Track pseudorapidity (high purity); track #eta;tracks", 100, -
etaMax_,
etaMax_);
829 hPhihp =
fs->
make<TH1D>(
"h_Phi_hp",
"Track azimuth (high purity); track #phi;tracks", 100, -
M_PI,
M_PI);
830 hchi2ndofhp =
fs->
make<TH1D>(
"h_chi2ndof_hp",
"chi2/ndf (high purity);#chi^{2}/ndf;tracks", 100, 0, 5.);
832 "h_chi2_Prob_hp",
"#chi^{2} probability (high purity);#chi^{2}prob_{Track};Number of Tracks", 100, 0.0, 1.);
834 hvx =
fs->
make<TH1D>(
"h_vx",
"Track v_{x} ; track v_{x} [cm];tracks", 100, -1.5, 1.5);
835 hvy =
fs->
make<TH1D>(
"h_vy",
"Track v_{y} ; track v_{y} [cm];tracks", 100, -1.5, 1.5);
836 hvz =
fs->
make<TH1D>(
"h_vz",
"Track v_{z} ; track v_{z} [cm];tracks", 100, -20., 20.);
837 hd0 =
fs->
make<TH1D>(
"h_d0",
"Track d_{0} ; track d_{0} [cm];tracks", 100, -1., 1.);
838 hdxy =
fs->
make<TH1D>(
"h_dxy",
"Track d_{xy}; track d_{xy} [cm]; tracks", 100, -0.5, 0.5);
839 hdz =
fs->
make<TH1D>(
"h_dz",
"Track d_{z} ; track d_{z} [cm]; tracks", 100, -20, 20);
842 fs->
make<TH2D>(
"h2_d0PVvsphi",
"hd0PVvsphi;track #phi;track d_{0}(PV) [cm]", 160, -
M_PI,
M_PI, 100, -1., 1.);
844 fs->
make<TH2D>(
"h2_d0PVvseta",
"hdPV0vseta;track #eta;track d_{0}(PV) [cm]", 160, -2.5, 2.5, 100, -1., 1.);
845 hd0PVvspt =
fs->
make<TH2D>(
"h2_d0PVvspt",
"hdPV0vspt;track p_{T};d_{0}(PV) [cm]", 50, 0., 100., 100, -1, 1.);
847 hdxyBS =
fs->
make<TH1D>(
"h_dxyBS",
"hdxyBS; track d_{xy}(BS) [cm];tracks", 100, -0.1, 0.1);
848 hd0BS =
fs->
make<TH1D>(
"h_d0BS",
"hd0BS ; track d_{0}(BS) [cm];tracks", 100, -0.1, 0.1);
849 hdzBS =
fs->
make<TH1D>(
"h_dzBS",
"hdzBS ; track d_{z}(BS) [cm];tracks", 100, -12, 12);
850 hdxyPV =
fs->
make<TH1D>(
"h_dxyPV",
"hdxyPV; track d_{xy}(PV) [cm];tracks", 100, -0.1, 0.1);
851 hd0PV =
fs->
make<TH1D>(
"h_d0PV",
"hd0PV ; track d_{0}(PV) [cm];tracks", 100, -0.15, 0.15);
852 hdzPV =
fs->
make<TH1D>(
"h_dzPV",
"hdzPV ; track d_{z}(PV) [cm];tracks", 100, -0.1, 0.1);
854 hnhTIB =
fs->
make<TH1D>(
"h_nHitTIB",
"nhTIB;# hits in TIB; tracks", 20, 0., 20.);
855 hnhTID =
fs->
make<TH1D>(
"h_nHitTID",
"nhTID;# hits in TID; tracks", 20, 0., 20.);
856 hnhTOB =
fs->
make<TH1D>(
"h_nHitTOB",
"nhTOB;# hits in TOB; tracks", 20, 0., 20.);
857 hnhTEC =
fs->
make<TH1D>(
"h_nHitTEC",
"nhTEC;# hits in TEC; tracks", 20, 0., 20.);
860 hvx =
fs->
make<TH1D>(
"h_vx",
"Track v_{x};track v_{x} [cm];tracks", 100, -100., 100.);
861 hvy =
fs->
make<TH1D>(
"h_vy",
"Track v_{y};track v_{y} [cm];tracks", 100, -100., 100.);
862 hvz =
fs->
make<TH1D>(
"h_vz",
"Track v_{z};track v_{z} [cm];track", 100, -100., 100.);
863 hd0 =
fs->
make<TH1D>(
"h_d0",
"Track d_{0};track d_{0} [cm];track", 100, -100., 100.);
864 hdxy =
fs->
make<TH1D>(
"h_dxy",
"Track d_{xy};track d_{xy} [cm];tracks", 100, -100, 100);
865 hdz =
fs->
make<TH1D>(
"h_dz",
"Track d_{z};track d_{z} [cm];tracks", 100, -200, 200);
868 "h2_d0vsphi",
"Track d_{0} vs #phi; track #phi;track d_{0} [cm]", 160, -3.20, 3.20, 100, -100., 100.);
870 "h2_d0vseta",
"Track d_{0} vs #eta; track #eta;track d_{0} [cm]", 160, -3.20, 3.20, 100, -100., 100.);
872 "h2_d0vspt",
"Track d_{0} vs p_{T};track p_{T};track d_{0} [cm]", 50, 0., 100., 100, -100, 100);
874 hdxyBS =
fs->
make<TH1D>(
"h_dxyBS",
"Track d_{xy}(BS);d_{xy}(BS) [cm];tracks", 100, -100., 100.);
875 hd0BS =
fs->
make<TH1D>(
"h_d0BS",
"Track d_{0}(BS);d_{0}(BS) [cm];tracks", 100, -100., 100.);
876 hdzBS =
fs->
make<TH1D>(
"h_dzBS",
"Track d_{z}(BS);d_{z}(BS) [cm];tracks", 100, -100., 100.);
877 hdxyPV =
fs->
make<TH1D>(
"h_dxyPV",
"Track d_{xy}(PV); d_{xy}(PV) [cm];tracks", 100, -100., 100.);
878 hd0PV =
fs->
make<TH1D>(
"h_d0PV",
"Track d_{0}(PV); d_{0}(PV) [cm];tracks", 100, -100., 100.);
879 hdzPV =
fs->
make<TH1D>(
"h_dzPV",
"Track d_{z}(PV); d_{z}(PV) [cm];tracks", 100, -100., 100.);
881 hnhTIB =
fs->
make<TH1D>(
"h_nHitTIB",
"nhTIB;# hits in TIB; tracks", 30, 0., 30.);
882 hnhTID =
fs->
make<TH1D>(
"h_nHitTID",
"nhTID;# hits in TID; tracks", 30, 0., 30.);
883 hnhTOB =
fs->
make<TH1D>(
"h_nHitTOB",
"nhTOB;# hits in TOB; tracks", 30, 0., 30.);
884 hnhTEC =
fs->
make<TH1D>(
"h_nHitTEC",
"nhTEC;# hits in TEC; tracks", 30, 0., 30.);
887 hnhpxb =
fs->
make<TH1D>(
"h_nHitPXB",
"nhpxb;# hits in Pixel Barrel; tracks", 10, 0., 10.);
888 hnhpxe =
fs->
make<TH1D>(
"h_nHitPXE",
"nhpxe;# hits in Pixel Endcap; tracks", 10, 0., 10.);
893 fs->
make<TProfile>(
"p_NpixHits_vs_Vx",
"n. Barrel Pixel hits vs. v_{x};v_{x} (cm);n. BPix hits", 20, -20, 20);
896 fs->
make<TProfile>(
"p_NpixHits_vs_Vy",
"n. Barrel Pixel hits vs. v_{y};v_{y} (cm);n. BPix hits", 20, -20, 20);
899 fs->
make<TProfile>(
"p_NpixHits_vs_Vz",
"n. Barrel Pixel hits vs. v_{z};v_{z} (cm);n. BPix hits", 20, -100, 100);
901 std::string dets[6] = {
"PXB",
"PXF",
"TIB",
"TID",
"TOB",
"TEC"};
908 fs->
make<TH1F>(
"h_tracketa",
"Track #eta;#eta_{Track};Number of Tracks", 90, -etaMax_, etaMax_));
909 vTrackHistos_.push_back(
fs->
make<TH1F>(
"h_trackphi",
"Track #phi;#phi_{Track};Number of Tracks", 90, -M_PI, M_PI));
911 "h_trackNumberOfValidHits",
"Track # of valid hits;# of valid hits _{Track};Number of Tracks", 40, 0., 40.));
913 "h_trackNumberOfLostHits",
"Track # of lost hits;# of lost hits _{Track};Number of Tracks", 10, 0., 10.));
915 fs->
make<TH1F>(
"h_curvature",
"Curvature #kappa;#kappa_{Track};Number of Tracks", 100, -.05, .05));
917 "h_curvature_pos",
"Curvature |#kappa| Positive Tracks;|#kappa_{pos Track}|;Number of Tracks", 100, .0, .05));
919 "h_curvature_neg",
"Curvature |#kappa| Negative Tracks;|#kappa_{neg Track}|;Number of Tracks", 100, .0, .05));
921 fs->
make<TH1F>(
"h_diff_curvature",
922 "Curvature |#kappa| Tracks Difference;|#kappa_{Track}|;# Pos Tracks - # Neg Tracks",
928 fs->
make<TH1F>(
"h_chi2",
"Track #chi^{2};#chi^{2}_{Track};Number of Tracks", 500, -0.01, 500.));
930 fs->
make<TH1F>(
"h_chi2Prob",
"#chi^{2} probability;Track Prob(#chi^{2},ndof);Number of Tracks", 100, 0.0, 1.));
932 fs->
make<TH1F>(
"h_normchi2",
"#chi^{2}/ndof;#chi^{2}/ndof;Number of Tracks", 100, -0.01, 10.));
934 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.};
935 vTrackHistos_.push_back(
fs->
make<TH1F>(
"h_pt",
"Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 250, 0., 250));
936 vTrackHistos_.push_back(
fs->
make<TH1F>(
"h_ptrebin",
"Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 18, xBins));
938 "h_ptResolution",
"#delta_{p_{T}}/p_{T}^{track};#delta_{p_{T}}/p_{T}^{track};Number of Tracks", 100, 0., 0.5));
940 "p_d0_vs_phi",
"Transverse Impact Parameter vs. #phi;#phi_{Track};#LT d_{0} #GT [cm]", 100, -M_PI, M_PI));
942 "p_dz_vs_phi",
"Longitudinal Impact Parameter vs. #phi;#phi_{Track};#LT d_{z} #GT [cm]", 100, -M_PI, M_PI));
944 "p_d0_vs_eta",
"Transverse Impact Parameter vs. #eta;#eta_{Track};#LT d_{0} #GT [cm]", 100, -etaMax_, etaMax_));
946 fs->
make<TProfile>(
"p_dz_vs_eta",
947 "Longitudinal Impact Parameter vs. #eta;#eta_{Track};#LT d_{z} #GT [cm]",
952 fs->
make<TProfile>(
"p_chi2_vs_phi",
"#chi^{2} vs. #phi;#phi_{Track};#LT #chi^{2} #GT", 100, -M_PI, M_PI));
954 fs->
make<TProfile>(
"p_chi2Prob_vs_phi",
955 "#chi^{2} probablility vs. #phi;#phi_{Track};#LT #chi^{2} probability#GT",
961 "p_chi2Prob_vs_d0",
"#chi^{2} probablility vs. |d_{0}|;|d_{0}|[cm];#LT #chi^{2} probability#GT", 100, 0, 80));
963 "p_chi2Prob_vs_dz",
"#chi^{2} probablility vs. dz;d_{z} [cm];#LT #chi^{2} probability#GT", 100, -30, 30));
965 "p_normchi2_vs_phi",
"#chi^{2}/ndof vs. #phi;#phi_{Track};#LT #chi^{2}/ndof #GT", 100, -M_PI, M_PI));
967 fs->
make<TProfile>(
"p_chi2_vs_eta",
"#chi^{2} vs. #eta;#eta_{Track};#LT #chi^{2} #GT", 100, -etaMax_, etaMax_));
969 "p_normchi2_vs_pt",
"norm #chi^{2} vs. p_{T}_{Track}; p_{T}_{Track};#LT #chi^{2}/ndof #GT", 18, xBins));
971 "p_normchi2_vs_p",
"#chi^{2}/ndof vs. p_{Track};p_{Track};#LT #chi^{2}/ndof #GT", 18, xBins));
973 fs->
make<TProfile>(
"p_chi2Prob_vs_eta",
974 "#chi^{2} probability vs. #eta;#eta_{Track};#LT #chi^{2} probability #GT",
980 "p_normchi2_vs_eta",
"#chi^{2}/ndof vs. #eta;#eta_{Track};#LT #chi^{2}/ndof #GT", 100, -etaMax_, etaMax_));
982 fs->
make<TProfile>(
"p_kappa_vs_phi",
"#kappa vs. #phi;#phi_{Track};#kappa", 100, -M_PI, M_PI));
984 fs->
make<TProfile>(
"p_kappa_vs_eta",
"#kappa vs. #eta;#eta_{Track};#kappa", 100, -etaMax_, etaMax_));
986 fs->
make<TProfile>(
"p_ptResolution_vs_phi",
987 "#delta_{p_{T}}/p_{T}^{track};#phi^{track};#delta_{p_{T}}/p_{T}^{track}",
993 fs->
make<TProfile>(
"p_ptResolution_vs_eta",
994 "#delta_{p_{T}}/p_{T}^{track};#eta^{track};#delta_{p_{T}}/p_{T}^{track}",
1000 "h2_d0_vs_phi",
"Transverse Impact Parameter vs. #phi;#phi_{Track};d_{0} [cm]", 100, -M_PI, M_PI, 100, -1., 1.));
1002 "Longitudinal Impact Parameter vs. #phi;#phi_{Track};d_{z} [cm]",
1011 "Transverse Impact Parameter vs. #eta;#eta_{Track};d_{0} [cm]",
1019 "Longitudinal Impact Parameter vs. #eta;#eta_{Track};d_{z} [cm]",
1028 fs->
make<TH2F>(
"h2_chi2_vs_phi",
"#chi^{2} vs. #phi;#phi_{Track};#chi^{2}", 100, -M_PI, M_PI, 500, 0., 500.));
1030 "#chi^{2} probability vs. #phi;#phi_{Track};#chi^{2} probability",
1039 "#chi^{2} probability vs. |d_{0}|;|d_{0}| [cm];#chi^{2} probability",
1048 "h2_normchi2_vs_phi",
"#chi^{2}/ndof vs. #phi;#phi_{Track};#chi^{2}/ndof", 100, -M_PI, M_PI, 100, 0., 10.));
1050 "h2_chi2_vs_eta",
"#chi^{2} vs. #eta;#eta_{Track};#chi^{2}", 100, -etaMax_, etaMax_, 500, 0., 500.));
1052 "#chi^{2} probaility vs. #eta;#eta_{Track};#chi^{2} probability",
1061 "h2_normchi2_vs_eta",
"#chi^{2}/ndof vs. #eta;#eta_{Track};#chi^{2}/ndof", 100, -etaMax_, etaMax_, 100, 0., 10.));
1063 fs->
make<TH2F>(
"h2_kappa_vs_phi",
"#kappa vs. #phi;#phi_{Track};#kappa", 100, -M_PI, M_PI, 100, .0, .05));
1065 fs->
make<TH2F>(
"h2_kappa_vs_eta",
"#kappa vs. #eta;#eta_{Track};#kappa", 100, -etaMax_, etaMax_, 100, .0, .05));
1067 "h2_normchi2_vs_kappa",
"#kappa vs. #chi^{2}/ndof;#chi^{2}/ndof;#kappa", 100, 0., 10, 100, -.03, .03));
1077 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1078 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"Events run in total: " <<
ievt << std::endl;
1080 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1083 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"firing triggers: " << nFiringTriggers << std::endl;
1084 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1087 "tksByTrigger",
"tracks by HLT path;;% of # traks", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1089 "evtsByTrigger",
"events by HLT path;;% of # events", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1095 double trkpercent = ((it.second).
second) * 100. / double(
itrks);
1096 double evtpercent = ((it.second).
first) * 100. / double(
ievt);
1101 <<
"HLT path: " << std::setw(60) << std::left << it.first <<
" | events firing: " << std::right
1102 << std::setw(8) << (it.second).
first <<
" (" << std::setw(8) << std::fixed << std::setprecision(4)
1103 << evtpercent <<
"%)"
1104 <<
" | tracks collected: " << std::setw(10) << (it.second).
second <<
" (" << std::setw(8) << std::fixed
1105 << std::setprecision(4) << trkpercent <<
"%)";
1108 tksByTrigger_->GetXaxis()->SetBinLabel(i, (it.first).c_str());
1116 std::vector<int> theRuns_;
1118 theRuns_.push_back(it.first);
1121 sort(theRuns_.begin(), theRuns_.end());
1122 int runRange = theRuns_.back() - theRuns_.front() + 1;
1124 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1125 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"first run: " << theRuns_.front() << std::endl;
1126 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"last run: " << theRuns_.back() << std::endl;
1127 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"considered runs: " << nRuns << std::endl;
1128 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1131 "Strip APV mode by run number;;APV mode (-1=deco,+1=peak)",
1133 theRuns_.front() - 0.5,
1134 theRuns_.back() + 0.5);
1137 "CMS B-field intensity by run number;;B-field intensity [T]",
1139 theRuns_.front() - 0.5,
1140 theRuns_.back() + 0.5);
1142 for (
const auto &the_r : theRuns_) {
1143 if (conditionsMap_.find(the_r)->second.first != 0) {
1145 <<
"run:" << the_r <<
" | isPeak: " << std::setw(4) << conditionsMap_.find(the_r)->second.first
1146 <<
"| B-field: " << conditionsMap_.find(the_r)->second.second <<
" [T]"
1147 <<
"| events: " << std::setw(10) <<
runInfoMap_.find(the_r)->second.first <<
", tracks " << std::setw(10)
1148 <<
runInfoMap_.find(the_r)->second.second << std::endl;
1151 modeByRun_->SetBinContent((the_r - theRuns_.front()) + 1, conditionsMap_.find(the_r)->second.first);
1152 fieldByRun_->SetBinContent((the_r - theRuns_.front()) + 1, conditionsMap_.find(the_r)->second.second);
1153 modeByRun_->GetXaxis()->SetBinLabel((the_r - theRuns_.front()) + 1, std::to_string(the_r).c_str());
1154 fieldByRun_->GetXaxis()->SetBinLabel((the_r - theRuns_.front()) + 1, std::to_string(the_r).c_str());
1158 pmap->save(
true, 0, 0,
"PixelHitMap.pdf", 600, 800);
1159 pmap->save(
true, 0, 0,
"PixelHitMap.png", 500, 750);
1162 tmap->save(
true, 0, 0,
"StripHitMap.pdf");
1163 tmap->save(
true, 0, 0,
"StripHitMap.png");
1165 gStyle->SetPalette(kRainBow);
1168 TCanvas cB(
"CanvBarrel",
"CanvBarrel", 1200, 1000);
1169 pixelmap->drawBarrelMaps(
"entriesBarrel", cB);
1170 cB.SaveAs(
"pixelBarrelEntries.png");
1172 TCanvas cF(
"CanvForward",
"CanvForward", 1600, 1000);
1173 pixelmap->drawForwardMaps(
"entriesForward", cF);
1174 cF.SaveAs(
"pixelForwardEntries.png");
1176 TCanvas cRocs = TCanvas(
"cRocs",
"cRocs", 1200, 1600);
1177 pixelrocsmap_->drawMaps(cRocs,
"Pixel on-track clusters occupancy");
1178 cRocs.SaveAs(
"Phase1PixelROCMaps_fullROCs.png");
1185 bool countStereoHitAs2D_ =
true;
1194 if (detId.subdetId() ==
kBPIX || detId.subdetId() ==
kFPIX) {
1199 return countStereoHitAs2D_;
1200 else if (dynamic_cast<const SiStripRecHit1D *>(&hit) ||
dynamic_cast<const SiStripRecHit2D *
>(&hit))
1203 else if (dynamic_cast<const SiStripMatchedRecHit2D *>(&hit))
1205 else if (dynamic_cast<const ProjectedSiStripRecHit2D *>(&hit)) {
1209 edm::LogError(
"UnknownType") <<
"@SUB=GeneralPurposeTrackAnalyzer::isHit2D"
1210 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor "
1211 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
1216 edm::LogWarning(
"DetectorMismatch") <<
"@SUB=GeneralPurposeTrackAnalyzer::isHit2D"
1217 <<
"Hit not in tracker with 'official' dimension >=2.";
1230 desc.
setComment(
"Generic track analyzer to check ALCARECO sample quantities");
1235 desc.
add<
bool>(
"isCosmics",
false);
1236 descriptions.
add(
"GeneralPurposeTrackAnalyzer", desc);
static const std::string kSharedResource
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
double z0() const
z coordinate
const edm::ESGetToken< SiStripLatency, SiStripLatencyRcd > latencyToken_
virtual int dimension() const =0
TProfile * pNBpixHitsVsVy
std::map< int, std::pair< int, float > > conditionsMap_
SiPixelCoordinates coord_
TH1D * hHitCountVsPhiFPix
edm::EDGetTokenT< edm::TriggerResults > hltresultsToken_
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken_
#define DEFINE_FWK_MODULE(type)
double y() const
y coordinate
std::unique_ptr< TrackerMap > tmap
edm::InputTag VerticesTag_
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
constexpr uint32_t rawId() const
get the raw id
std::vector< Track > TrackCollection
collection of Tracks
static void fillDescriptions(edm::ConfigurationDescriptions &)
std::unique_ptr< TrackerMap > pmap
T * make(const Args &...args) const
make new ROOT object
Log< level::Error, false > LogError
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Strings const & triggerNames() const
void beginRun(edm::Run const &run, edm::EventSetup const &setup) override
const TrackerGeometry * trackerGeometry_
std::vector< TH1 * > vTrackHistos_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomTokenBR_
Geom::Theta< T > theta() const
bool isThere(GeomDetEnumerators::SubDetector subdet) const
U second(std::pair< T, U > const &p)
void setComment(std::string const &value)
TH1D * hHitCountVsPhiBPix
std::vector< TH1 * > vTrackProfiles_
edm::ESHandle< MagneticField > magneticField_
std::map< std::string, std::pair< int, int > > triggerMap_
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
GeneralPurposeTrackAnalyzer(const edm::ParameterSet &pset)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Abs< T >::type abs(const T &t)
TH1D * hHitCountVsThetaFPix
double z() const
z coordinate
void init(const TrackerTopology *, const TrackerGeometry *, const SiPixelFedCablingMap *)
int roc(const DetId &, const std::pair< int, int > &)
std::map< int, std::pair< int, int > > runInfoMap_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< TH1 * > vTrack2DHistos_
Log< level::Warning, true > LogPrint
const TrackerGeomDet * idToDet(DetId) const override
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
SiStripRecHit2D originalHit() const
Log< level::Info, false > LogInfo
Detector identifier class for the strip tracker.
edm::InputTag BeamSpotTag_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
double x() const
x coordinate
T const * product() const
std::string const & triggerName(unsigned int index) const
XYZPointD XYZPoint
point in space with cartesian internal representation
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyTokenBR_
T const * product() const
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
TProfile * pNBpixHitsVsVx
static const std::string algoNames[]
void endRun(edm::Run const &, edm::EventSetup const &) override
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
std::unique_ptr< Phase1PixelROCMaps > pixelrocsmap_
TH1D * hHitCountVsThetaBPix
double y0() const
y coordinate
edm::Service< TFileService > fs
DetId geographicalId() const
Log< level::Warning, false > LogWarning
std::unique_ptr< Phase1PixelMaps > pixelmap
bool isHit2D(const TrackingRecHit &hit)
edm::InputTag TriggerResultsTag_
~GeneralPurposeTrackAnalyzer() override=default
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > siPixelFedCablingMapTokenBR_
TProfile * pNBpixHitsVsVz
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
double x0() const
x coordinate