32 #include <boost/range/adaptor/indexed.hpp>
107 pmap = std::make_unique<TrackerMap>(
"Pixel");
108 pmap->onlyPixel(
true);
109 pmap->setTitle(
"Pixel Hit entries");
112 tmap = std::make_unique<TrackerMap>(
"Strip");
113 tmap->setTitle(
"Strip Hit entries");
116 pixelmap = std::make_unique<Phase1PixelMaps>(
"COLZ0 L");
117 pixelmap->bookBarrelHistograms(
"entriesBarrel",
"# hits",
"# pixel hits");
118 pixelmap->bookBarrelBins(
"entriesBarrel");
119 pixelmap->bookForwardHistograms(
"entriesForward",
"# hits",
"# pixel hits");
120 pixelmap->bookForwardBins(
"entriesForward");
127 template <
class OBJECT_TYPE>
128 int GetIndex(
const std::vector<OBJECT_TYPE *> &vec,
const TString &
name) {
129 for (
const auto &iter : vec | boost::adaptors::indexed(0)) {
130 if (iter.value() && iter.value()->GetName() ==
name) {
134 edm::LogError(
"GeneralPurposeTrackAnalyzer") <<
"@SUB=GeneralPurposeTrackAnalyzer::GetIndex"
135 <<
" could not find " <<
name;
149 std::unique_ptr<TrackerMap>
tmap;
150 std::unique_ptr<TrackerMap>
pmap;
315 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") <<
"Reconstructed " << tC.size() <<
" tracks" << std::endl;
326 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
332 <<
trigName <<
" " <<
accept <<
" ,track size: " << tC.size() << std::endl;
344 int nHighPurityTracks = 0;
347 unsigned int nHit2D = 0;
348 for (
auto iHit =
track->recHitsBegin(); iHit !=
track->recHitsEnd(); ++iHit) {
353 const DetId &detId = (*iHit)->geographicalId();
356 const SiPixelRecHit *pixhit = dynamic_cast<const SiPixelRecHit *>(*iHit);
359 if (pixhit->isValid()) {
360 unsigned int subid = detId.
subdetId();
361 int detid_db = detId.
rawId();
364 pmap->fill(detid_db, 1);
367 pixelmap->fillBarrelBin(
"entriesBarrel", detid_db, 1);
369 pixelmap->fillForwardBin(
"entriesForward", detid_db, 1);
399 if ((*iHit)->isValid()) {
407 hnhpxb->Fill(
track->hitPattern().numberOfValidPixelBarrelHits());
408 hnhpxe->Fill(
track->hitPattern().numberOfValidPixelEndcapHits());
409 hnhTIB->Fill(
track->hitPattern().numberOfValidStripTIBHits());
410 hnhTID->Fill(
track->hitPattern().numberOfValidStripTIDHits());
411 hnhTOB->Fill(
track->hitPattern().numberOfValidStripTOBHits());
412 hnhTEC->Fill(
track->hitPattern().numberOfValidStripTECHits());
415 if (
track->hitPattern().numberOfValidPixelBarrelHits() != 0) {
422 if (
track->hitPattern().numberOfValidPixelEndcapHits() != 0) {
425 if (
track->hitPattern().numberOfValidStripTIBHits() != 0) {
428 if (
track->hitPattern().numberOfValidStripTIDHits() != 0) {
431 if (
track->hitPattern().numberOfValidStripTOBHits() != 0) {
434 if (
track->hitPattern().numberOfValidStripTECHits() != 0) {
447 if (fabs(
track->eta()) < 0.8) {
450 if (
track->eta() > 0.8 &&
track->eta() < 1.4) {
453 if (
track->eta() < -0.8 &&
track->eta() > -1.4) {
456 if (
track->eta() > 1.4) {
459 if (
track->eta() < -1.4) {
508 static const int etaindex = this->
GetIndex(vTrackHistos_,
"h_tracketa");
510 static const int phiindex = this->
GetIndex(vTrackHistos_,
"h_trackphi");
512 static const int numOfValidHitsindex = this->
GetIndex(vTrackHistos_,
"h_trackNumberOfValidHits");
514 static const int numOfLostHitsindex = this->
GetIndex(vTrackHistos_,
"h_trackNumberOfLostHits");
519 double kappa = -
track->charge() * theLocalMagFieldInInverseGeV /
track->pt();
521 static const int kappaindex = this->
GetIndex(vTrackHistos_,
"h_curvature");
523 static const int kappaposindex = this->
GetIndex(vTrackHistos_,
"h_curvature_pos");
524 if (
track->charge() > 0)
526 static const int kappanegindex = this->
GetIndex(vTrackHistos_,
"h_curvature_neg");
527 if (
track->charge() < 0)
530 double chi2Prob = TMath::Prob(
track->chi2(),
track->ndof());
531 double normchi2 =
track->normalizedChi2();
533 static const int normchi2index = this->
GetIndex(vTrackHistos_,
"h_normchi2");
535 static const int chi2index = this->
GetIndex(vTrackHistos_,
"h_chi2");
537 static const int chi2Probindex = this->
GetIndex(vTrackHistos_,
"h_chi2Prob");
539 static const int ptindex = this->
GetIndex(vTrackHistos_,
"h_pt");
540 static const int pt2index = this->
GetIndex(vTrackHistos_,
"h_ptrebin");
543 if (
track->ptError() != 0.) {
544 static const int ptResolutionindex = this->
GetIndex(vTrackHistos_,
"h_ptResolution");
548 static const int d0phiindex = this->
GetIndex(vTrackProfiles_,
"p_d0_vs_phi");
550 static const int dzphiindex = this->
GetIndex(vTrackProfiles_,
"p_dz_vs_phi");
552 static const int d0etaindex = this->
GetIndex(vTrackProfiles_,
"p_d0_vs_eta");
554 static const int dzetaindex = this->
GetIndex(vTrackProfiles_,
"p_dz_vs_eta");
556 static const int chiProbphiindex = this->
GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_phi");
558 static const int chiProbabsd0index = this->
GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_d0");
560 static const int chiProbabsdzindex = this->
GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_dz");
562 static const int chiphiindex = this->
GetIndex(vTrackProfiles_,
"p_chi2_vs_phi");
564 static const int normchiphiindex = this->
GetIndex(vTrackProfiles_,
"p_normchi2_vs_phi");
566 static const int chietaindex = this->
GetIndex(vTrackProfiles_,
"p_chi2_vs_eta");
568 static const int normchiptindex = this->
GetIndex(vTrackProfiles_,
"p_normchi2_vs_pt");
570 static const int normchipindex = this->
GetIndex(vTrackProfiles_,
"p_normchi2_vs_p");
572 static const int chiProbetaindex = this->
GetIndex(vTrackProfiles_,
"p_chi2Prob_vs_eta");
574 static const int normchietaindex = this->
GetIndex(vTrackProfiles_,
"p_normchi2_vs_eta");
576 static const int kappaphiindex = this->
GetIndex(vTrackProfiles_,
"p_kappa_vs_phi");
578 static const int kappaetaindex = this->
GetIndex(vTrackProfiles_,
"p_kappa_vs_eta");
580 static const int ptResphiindex = this->
GetIndex(vTrackProfiles_,
"p_ptResolution_vs_phi");
582 static const int ptResetaindex = this->
GetIndex(vTrackProfiles_,
"p_ptResolution_vs_eta");
586 static const int d0phiindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_d0_vs_phi");
588 static const int dzphiindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_dz_vs_phi");
590 static const int d0etaindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_d0_vs_eta");
592 static const int dzetaindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_dz_vs_eta");
594 static const int chiphiindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_chi2_vs_phi");
596 static const int chiProbphiindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_chi2Prob_vs_phi");
598 static const int chiProbabsd0index_2d = this->
GetIndex(vTrack2DHistos_,
"h2_chi2Prob_vs_d0");
600 static const int normchiphiindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_normchi2_vs_phi");
602 static const int chietaindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_chi2_vs_eta");
604 static const int chiProbetaindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_chi2Prob_vs_eta");
606 static const int normchietaindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_normchi2_vs_eta");
608 static const int kappaphiindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_kappa_vs_phi");
610 static const int kappaetaindex_2d = this->
GetIndex(vTrack2DHistos_,
"h2_kappa_vs_eta");
612 static const int normchi2kappa_2d = this->
GetIndex(vTrack2DHistos_,
"h2_normchi2_vs_kappa");
619 if (beamSpotHandle.
isValid()) {
633 event.getByLabel(
"offlinePrimaryVertices", vertexHandle);
634 double mindxy = 100.;
637 for (
auto pvtx = vertexHandle->cbegin(); pvtx != vertexHandle->cend(); ++pvtx) {
640 mindxy =
track->dxy(mypoint);
646 hd0PV->Fill(-mindxy);
664 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") <<
"end of track loop" << std::endl;
668 hNtrk->Fill(tC.size());
673 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") <<
"end of analysis" << std::endl;
687 <<
"run number:" <<
run.run() <<
" magnetic field: " << B_ <<
" [T]" << std::endl;
711 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") << __LINE__ << std::endl;
714 TH1D::SetDefaultSumw2(kTRUE);
722 hrun =
fs->
make<TH1D>(
"h_run",
"run", 100000, 230000, 240000);
723 hlumi =
fs->
make<TH1D>(
"h_lumi",
"lumi", 1000, 0, 1000);
725 hchi2ndof =
fs->
make<TH1D>(
"h_chi2ndof",
"chi2/ndf;#chi^{2}/ndf;tracks", 100, 0, 5.);
726 hCharge =
fs->
make<TH1D>(
"h_charge",
"charge;Charge of the track;tracks", 5, -2.5, 2.5);
727 hNtrk =
fs->
make<TH1D>(
"h_Ntrk",
"ntracks;Number of Tracks;events", 200, 0., 200.);
728 hNtrkZoom =
fs->
make<TH1D>(
"h_NtrkZoom",
"Number of tracks; number of tracks;events", 10, 0., 10.);
730 fs->
make<TH1D>(
"h_NhighPurity",
"n. high purity tracks;Number of high purity tracks;events", 200, 0., 200.);
733 "tracking step;iterative tracking step;tracks",
739 "original tracking step;original iterative tracking step;tracks",
749 htrkQuality =
fs->
make<TH1I>(
"h_trkQuality",
"track quality;track quality;tracks", 6, -1, 5);
750 std::string qualities[7] = {
"undef",
"loose",
"tight",
"highPurity",
"confirmed",
"goodIterative"};
751 for (
int nbin = 1; nbin <=
htrkQuality->GetNbinsX(); nbin++) {
752 htrkQuality->GetXaxis()->SetBinLabel(nbin, (qualities[nbin - 1]).c_str());
755 hP =
fs->
make<TH1D>(
"h_P",
"Momentum;track momentum [GeV];tracks", 100, 0., 100.);
756 hQoverP =
fs->
make<TH1D>(
"h_qoverp",
"Track q/p; track q/p [GeV^{-1}];tracks", 100, -1., 1.);
757 hQoverPZoom =
fs->
make<TH1D>(
"h_qoverpZoom",
"Track q/p; track q/p [GeV^{-1}];tracks", 100, -0.1, 0.1);
758 hPt =
fs->
make<TH1D>(
"h_Pt",
"Transverse Momentum;track p_{T} [GeV];tracks", 100, 0., 100.);
759 hHit =
fs->
make<TH1D>(
"h_nHits",
"Number of hits;track n. hits;tracks", 50, -0.5, 49.5);
760 hHit2D =
fs->
make<TH1D>(
"h_nHit2D",
"Number of 2D hits; number of 2D hits;tracks", 20, 0, 20);
762 hHitCountVsZBPix =
fs->
make<TH1D>(
"h_HitCountVsZBpix",
"Number of BPix hits vs z;hit global z;hits", 60, -30, 30);
764 fs->
make<TH1D>(
"h_HitCountVsZFpix",
"Number of FPix hits vs z;hit global z;hits", 100, -100, 100);
766 hHitCountVsXBPix =
fs->
make<TH1D>(
"h_HitCountVsXBpix",
"Number of BPix hits vs x;hit global x;hits", 20, -20, 20);
767 hHitCountVsXFPix =
fs->
make<TH1D>(
"h_HitCountVsXFpix",
"Number of FPix hits vs x;hit global x;hits", 20, -20, 20);
769 hHitCountVsYBPix =
fs->
make<TH1D>(
"h_HitCountVsYBpix",
"Number of BPix hits vs y;hit global y;hits", 20, -20, 20);
770 hHitCountVsYFPix =
fs->
make<TH1D>(
"h_HitCountVsYFpix",
"Number of FPix hits vs y;hit global y;hits", 20, -20, 20);
773 fs->
make<TH1D>(
"h_HitCountVsThetaBpix",
"Number of BPix hits vs #theta;hit global #theta;hits", 20, 0.,
M_PI);
775 fs->
make<TH1D>(
"h_HitCountVsPhiBpix",
"Number of BPix hits vs #phi;hit global #phi;hits", 20, -
M_PI,
M_PI);
778 fs->
make<TH1D>(
"h_HitCountVsThetaFpix",
"Number of FPix hits vs #theta;hit global #theta;hits", 40, 0.,
M_PI);
780 fs->
make<TH1D>(
"h_HitCountVsPhiFpix",
"Number of FPix hits vs #phi;hit global #phi;hits", 20, -
M_PI,
M_PI);
787 fs->
make<TH1D>(
"h_PhiOverlapPlus",
"hPhiOverlapPlus (0.8<#eta<1.4);track #phi;tracks", 100, -
M_PI,
M_PI);
789 fs->
make<TH1D>(
"h_PhiOverlapMinus",
"hPhiOverlapMinus (-1.4<#eta<-0.8);track #phi;tracks", 100, -
M_PI,
M_PI);
792 fs->
make<TH1D>(
"h_PhiEndcapMinus",
"hPhiEndcapMinus (#eta<1.4);track #phi;tracks", 100, -
M_PI,
M_PI);
795 hPhp =
fs->
make<TH1D>(
"h_P_hp",
"Momentum (high purity);track momentum [GeV];tracks", 100, 0., 100.);
796 hPthp =
fs->
make<TH1D>(
"h_Pt_hp",
"Transverse Momentum (high purity);track p_{T} [GeV];tracks", 100, 0., 100.);
797 hHithp =
fs->
make<TH1D>(
"h_nHit_hp",
"Number of hits (high purity);track n. hits;tracks", 30, 0, 30);
799 fs->
make<TH1D>(
"h_Eta_hp",
"Track pseudorapidity (high purity); track #eta;tracks", 100, -
etaMax_,
etaMax_);
800 hPhihp =
fs->
make<TH1D>(
"h_Phi_hp",
"Track azimuth (high purity); track #phi;tracks", 100, -
M_PI,
M_PI);
801 hchi2ndofhp =
fs->
make<TH1D>(
"h_chi2ndof_hp",
"chi2/ndf (high purity);#chi^{2}/ndf;tracks", 100, 0, 5.);
803 "h_chi2_Prob_hp",
"#chi^{2} probability (high purity);#chi^{2}prob_{Track};Number of Tracks", 100, 0.0, 1.);
805 hvx =
fs->
make<TH1D>(
"h_vx",
"Track v_{x} ; track v_{x} [cm];tracks", 100, -1.5, 1.5);
806 hvy =
fs->
make<TH1D>(
"h_vy",
"Track v_{y} ; track v_{y} [cm];tracks", 100, -1.5, 1.5);
807 hvz =
fs->
make<TH1D>(
"h_vz",
"Track v_{z} ; track v_{z} [cm];tracks", 100, -20., 20.);
808 hd0 =
fs->
make<TH1D>(
"h_d0",
"Track d_{0} ; track d_{0} [cm];tracks", 100, -1., 1.);
809 hdxy =
fs->
make<TH1D>(
"h_dxy",
"Track d_{xy}; track d_{xy} [cm]; tracks", 100, -0.5, 0.5);
810 hdz =
fs->
make<TH1D>(
"h_dz",
"Track d_{z} ; track d_{z} [cm]; tracks", 100, -20, 20);
813 fs->
make<TH2D>(
"h2_d0PVvsphi",
"hd0PVvsphi;track #phi;track d_{0}(PV) [cm]", 160, -
M_PI,
M_PI, 100, -1., 1.);
815 fs->
make<TH2D>(
"h2_d0PVvseta",
"hdPV0vseta;track #eta;track d_{0}(PV) [cm]", 160, -2.5, 2.5, 100, -1., 1.);
816 hd0PVvspt =
fs->
make<TH2D>(
"h2_d0PVvspt",
"hdPV0vspt;track p_{T};d_{0}(PV) [cm]", 50, 0., 100., 100, -1, 1.);
818 hdxyBS =
fs->
make<TH1D>(
"h_dxyBS",
"hdxyBS; track d_{xy}(BS) [cm];tracks", 100, -0.1, 0.1);
819 hd0BS =
fs->
make<TH1D>(
"h_d0BS",
"hd0BS ; track d_{0}(BS) [cm];tracks", 100, -0.1, 0.1);
820 hdzBS =
fs->
make<TH1D>(
"h_dzBS",
"hdzBS ; track d_{z}(BS) [cm];tracks", 100, -12, 12);
821 hdxyPV =
fs->
make<TH1D>(
"h_dxyPV",
"hdxyPV; track d_{xy}(PV) [cm];tracks", 100, -0.1, 0.1);
822 hd0PV =
fs->
make<TH1D>(
"h_d0PV",
"hd0PV ; track d_{0}(PV) [cm];tracks", 100, -0.15, 0.15);
823 hdzPV =
fs->
make<TH1D>(
"h_dzPV",
"hdzPV ; track d_{z}(PV) [cm];tracks", 100, -0.1, 0.1);
825 hnhTIB =
fs->
make<TH1D>(
"h_nHitTIB",
"nhTIB;# hits in TIB; tracks", 20, 0., 20.);
826 hnhTID =
fs->
make<TH1D>(
"h_nHitTID",
"nhTID;# hits in TID; tracks", 20, 0., 20.);
827 hnhTOB =
fs->
make<TH1D>(
"h_nHitTOB",
"nhTOB;# hits in TOB; tracks", 20, 0., 20.);
828 hnhTEC =
fs->
make<TH1D>(
"h_nHitTEC",
"nhTEC;# hits in TEC; tracks", 20, 0., 20.);
831 hvx =
fs->
make<TH1D>(
"h_vx",
"Track v_{x};track v_{x} [cm];tracks", 100, -100., 100.);
832 hvy =
fs->
make<TH1D>(
"h_vy",
"Track v_{y};track v_{y} [cm];tracks", 100, -100., 100.);
833 hvz =
fs->
make<TH1D>(
"h_vz",
"Track v_{z};track v_{z} [cm];track", 100, -100., 100.);
834 hd0 =
fs->
make<TH1D>(
"h_d0",
"Track d_{0};track d_{0} [cm];track", 100, -100., 100.);
835 hdxy =
fs->
make<TH1D>(
"h_dxy",
"Track d_{xy};track d_{xy} [cm];tracks", 100, -100, 100);
836 hdz =
fs->
make<TH1D>(
"h_dz",
"Track d_{z};track d_{z} [cm];tracks", 100, -200, 200);
839 "h2_d0vsphi",
"Track d_{0} vs #phi; track #phi;track d_{0} [cm]", 160, -3.20, 3.20, 100, -100., 100.);
841 "h2_d0vseta",
"Track d_{0} vs #eta; track #eta;track d_{0} [cm]", 160, -3.20, 3.20, 100, -100., 100.);
843 "h2_d0vspt",
"Track d_{0} vs p_{T};track p_{T};track d_{0} [cm]", 50, 0., 100., 100, -100, 100);
845 hdxyBS =
fs->
make<TH1D>(
"h_dxyBS",
"Track d_{xy}(BS);d_{xy}(BS) [cm];tracks", 100, -100., 100.);
846 hd0BS =
fs->
make<TH1D>(
"h_d0BS",
"Track d_{0}(BS);d_{0}(BS) [cm];tracks", 100, -100., 100.);
847 hdzBS =
fs->
make<TH1D>(
"h_dzBS",
"Track d_{z}(BS);d_{z}(BS) [cm];tracks", 100, -100., 100.);
848 hdxyPV =
fs->
make<TH1D>(
"h_dxyPV",
"Track d_{xy}(PV); d_{xy}(PV) [cm];tracks", 100, -100., 100.);
849 hd0PV =
fs->
make<TH1D>(
"h_d0PV",
"Track d_{0}(PV); d_{0}(PV) [cm];tracks", 100, -100., 100.);
850 hdzPV =
fs->
make<TH1D>(
"h_dzPV",
"Track d_{z}(PV); d_{z}(PV) [cm];tracks", 100, -100., 100.);
852 hnhTIB =
fs->
make<TH1D>(
"h_nHitTIB",
"nhTIB;# hits in TIB; tracks", 30, 0., 30.);
853 hnhTID =
fs->
make<TH1D>(
"h_nHitTID",
"nhTID;# hits in TID; tracks", 30, 0., 30.);
854 hnhTOB =
fs->
make<TH1D>(
"h_nHitTOB",
"nhTOB;# hits in TOB; tracks", 30, 0., 30.);
855 hnhTEC =
fs->
make<TH1D>(
"h_nHitTEC",
"nhTEC;# hits in TEC; tracks", 30, 0., 30.);
858 hnhpxb =
fs->
make<TH1D>(
"h_nHitPXB",
"nhpxb;# hits in Pixel Barrel; tracks", 10, 0., 10.);
859 hnhpxe =
fs->
make<TH1D>(
"h_nHitPXE",
"nhpxe;# hits in Pixel Endcap; tracks", 10, 0., 10.);
864 fs->
make<TProfile>(
"p_NpixHits_vs_Vx",
"n. Barrel Pixel hits vs. v_{x};v_{x} (cm);n. BPix hits", 20, -20, 20);
867 fs->
make<TProfile>(
"p_NpixHits_vs_Vy",
"n. Barrel Pixel hits vs. v_{y};v_{y} (cm);n. BPix hits", 20, -20, 20);
870 fs->
make<TProfile>(
"p_NpixHits_vs_Vz",
"n. Barrel Pixel hits vs. v_{z};v_{z} (cm);n. BPix hits", 20, -100, 100);
872 std::string dets[6] = {
"PXB",
"PXF",
"TIB",
"TID",
"TOB",
"TEC"};
879 fs->
make<TH1F>(
"h_tracketa",
"Track #eta;#eta_{Track};Number of Tracks", 90, -
etaMax_,
etaMax_));
882 "h_trackNumberOfValidHits",
"Track # of valid hits;# of valid hits _{Track};Number of Tracks", 40, 0., 40.));
884 "h_trackNumberOfLostHits",
"Track # of lost hits;# of lost hits _{Track};Number of Tracks", 10, 0., 10.));
886 fs->
make<TH1F>(
"h_curvature",
"Curvature #kappa;#kappa_{Track};Number of Tracks", 100, -.05, .05));
888 "h_curvature_pos",
"Curvature |#kappa| Positive Tracks;|#kappa_{pos Track}|;Number of Tracks", 100, .0, .05));
890 "h_curvature_neg",
"Curvature |#kappa| Negative Tracks;|#kappa_{neg Track}|;Number of Tracks", 100, .0, .05));
892 fs->
make<TH1F>(
"h_diff_curvature",
893 "Curvature |#kappa| Tracks Difference;|#kappa_{Track}|;# Pos Tracks - # Neg Tracks",
899 fs->
make<TH1F>(
"h_chi2",
"Track #chi^{2};#chi^{2}_{Track};Number of Tracks", 500, -0.01, 500.));
901 fs->
make<TH1F>(
"h_chi2Prob",
"#chi^{2} probability;Track Prob(#chi^{2},ndof);Number of Tracks", 100, 0.0, 1.));
903 fs->
make<TH1F>(
"h_normchi2",
"#chi^{2}/ndof;#chi^{2}/ndof;Number of Tracks", 100, -0.01, 10.));
905 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.};
906 vTrackHistos_.push_back(
fs->
make<TH1F>(
"h_pt",
"Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 250, 0., 250));
907 vTrackHistos_.push_back(
fs->
make<TH1F>(
"h_ptrebin",
"Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 18,
xBins));
909 "h_ptResolution",
"#delta_{p_{T}}/p_{T}^{track};#delta_{p_{T}}/p_{T}^{track};Number of Tracks", 100, 0., 0.5));
911 "p_d0_vs_phi",
"Transverse Impact Parameter vs. #phi;#phi_{Track};#LT d_{0} #GT [cm]", 100, -
M_PI,
M_PI));
913 "p_dz_vs_phi",
"Longitudinal Impact Parameter vs. #phi;#phi_{Track};#LT d_{z} #GT [cm]", 100, -
M_PI,
M_PI));
915 "p_d0_vs_eta",
"Transverse Impact Parameter vs. #eta;#eta_{Track};#LT d_{0} #GT [cm]", 100, -
etaMax_,
etaMax_));
917 fs->
make<TProfile>(
"p_dz_vs_eta",
918 "Longitudinal Impact Parameter vs. #eta;#eta_{Track};#LT d_{z} #GT [cm]",
923 fs->
make<TProfile>(
"p_chi2_vs_phi",
"#chi^{2} vs. #phi;#phi_{Track};#LT #chi^{2} #GT", 100, -
M_PI,
M_PI));
925 fs->
make<TProfile>(
"p_chi2Prob_vs_phi",
926 "#chi^{2} probablility vs. #phi;#phi_{Track};#LT #chi^{2} probability#GT",
932 "p_chi2Prob_vs_d0",
"#chi^{2} probablility vs. |d_{0}|;|d_{0}|[cm];#LT #chi^{2} probability#GT", 100, 0, 80));
934 "p_chi2Prob_vs_dz",
"#chi^{2} probablility vs. dz;d_{z} [cm];#LT #chi^{2} probability#GT", 100, -30, 30));
936 "p_normchi2_vs_phi",
"#chi^{2}/ndof vs. #phi;#phi_{Track};#LT #chi^{2}/ndof #GT", 100, -
M_PI,
M_PI));
938 fs->
make<TProfile>(
"p_chi2_vs_eta",
"#chi^{2} vs. #eta;#eta_{Track};#LT #chi^{2} #GT", 100, -
etaMax_,
etaMax_));
940 "p_normchi2_vs_pt",
"norm #chi^{2} vs. p_{T}_{Track}; p_{T}_{Track};#LT #chi^{2}/ndof #GT", 18,
xBins));
942 "p_normchi2_vs_p",
"#chi^{2}/ndof vs. p_{Track};p_{Track};#LT #chi^{2}/ndof #GT", 18,
xBins));
944 fs->
make<TProfile>(
"p_chi2Prob_vs_eta",
945 "#chi^{2} probability vs. #eta;#eta_{Track};#LT #chi^{2} probability #GT",
951 "p_normchi2_vs_eta",
"#chi^{2}/ndof vs. #eta;#eta_{Track};#LT #chi^{2}/ndof #GT", 100, -
etaMax_,
etaMax_));
953 fs->
make<TProfile>(
"p_kappa_vs_phi",
"#kappa vs. #phi;#phi_{Track};#kappa", 100, -
M_PI,
M_PI));
955 fs->
make<TProfile>(
"p_kappa_vs_eta",
"#kappa vs. #eta;#eta_{Track};#kappa", 100, -
etaMax_,
etaMax_));
957 fs->
make<TProfile>(
"p_ptResolution_vs_phi",
958 "#delta_{p_{T}}/p_{T}^{track};#phi^{track};#delta_{p_{T}}/p_{T}^{track}",
964 fs->
make<TProfile>(
"p_ptResolution_vs_eta",
965 "#delta_{p_{T}}/p_{T}^{track};#eta^{track};#delta_{p_{T}}/p_{T}^{track}",
971 "h2_d0_vs_phi",
"Transverse Impact Parameter vs. #phi;#phi_{Track};d_{0} [cm]", 100, -
M_PI,
M_PI, 100, -1., 1.));
973 "Longitudinal Impact Parameter vs. #phi;#phi_{Track};d_{z} [cm]",
982 "Transverse Impact Parameter vs. #eta;#eta_{Track};d_{0} [cm]",
990 "Longitudinal Impact Parameter vs. #eta;#eta_{Track};d_{z} [cm]",
999 fs->
make<TH2F>(
"h2_chi2_vs_phi",
"#chi^{2} vs. #phi;#phi_{Track};#chi^{2}", 100, -
M_PI,
M_PI, 500, 0., 500.));
1001 "#chi^{2} probability vs. #phi;#phi_{Track};#chi^{2} probability",
1010 "#chi^{2} probability vs. |d_{0}|;|d_{0}| [cm];#chi^{2} probability",
1019 "h2_normchi2_vs_phi",
"#chi^{2}/ndof vs. #phi;#phi_{Track};#chi^{2}/ndof", 100, -
M_PI,
M_PI, 100, 0., 10.));
1021 "h2_chi2_vs_eta",
"#chi^{2} vs. #eta;#eta_{Track};#chi^{2}", 100, -
etaMax_,
etaMax_, 500, 0., 500.));
1023 "#chi^{2} probaility vs. #eta;#eta_{Track};#chi^{2} probability",
1032 "h2_normchi2_vs_eta",
"#chi^{2}/ndof vs. #eta;#eta_{Track};#chi^{2}/ndof", 100, -
etaMax_,
etaMax_, 100, 0., 10.));
1034 fs->
make<TH2F>(
"h2_kappa_vs_phi",
"#kappa vs. #phi;#phi_{Track};#kappa", 100, -
M_PI,
M_PI, 100, .0, .05));
1036 fs->
make<TH2F>(
"h2_kappa_vs_eta",
"#kappa vs. #eta;#eta_{Track};#kappa", 100, -
etaMax_,
etaMax_, 100, .0, .05));
1038 "h2_normchi2_vs_kappa",
"#kappa vs. #chi^{2}/ndof;#chi^{2}/ndof;#kappa", 100, 0., 10, 100, -.03, .03));
1048 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1049 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"Events run in total: " <<
ievt << std::endl;
1051 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1054 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"firing triggers: " << nFiringTriggers << std::endl;
1055 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1058 "tksByTrigger",
"tracks by HLT path;;% of # traks", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1060 "evtsByTrigger",
"events by HLT path;;% of # events", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1066 double trkpercent = ((it.second).
second) * 100. / double(
itrks);
1067 double evtpercent = ((it.second).
first) * 100. / double(
ievt);
1072 <<
"HLT path: " << std::setw(60) << std::left << it.first <<
" | events firing: " << std::right
1073 << std::setw(8) << (it.second).
first <<
" (" << std::setw(8) <<
std::fixed << std::setprecision(4)
1074 << evtpercent <<
"%)"
1075 <<
" | tracks collected: " << std::setw(10) << (it.second).
second <<
" (" << std::setw(8) <<
std::fixed
1076 << std::setprecision(4) << trkpercent <<
"%)";
1087 std::vector<int> theRuns_;
1089 theRuns_.push_back(it.first);
1092 sort(theRuns_.begin(), theRuns_.end());
1093 int runRange = theRuns_.back() - theRuns_.front() + 1;
1095 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1096 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"first run: " << theRuns_.front() << std::endl;
1097 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"last run: " << theRuns_.back() << std::endl;
1098 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"considered runs: " << nRuns << std::endl;
1099 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1102 "Strip APV mode by run number;;APV mode (-1=deco,+1=peak)",
1104 theRuns_.front() - 0.5,
1105 theRuns_.back() + 0.5);
1108 "CMS B-field intensity by run number;;B-field intensity [T]",
1110 theRuns_.front() - 0.5,
1111 theRuns_.back() + 0.5);
1113 for (
const auto &the_r : theRuns_) {
1116 <<
"run:" << the_r <<
" | isPeak: " << std::setw(4) <<
conditionsMap_.find(the_r)->second.first
1117 <<
"| B-field: " <<
conditionsMap_.find(the_r)->second.second <<
" [T]"
1118 <<
"| events: " << std::setw(10) <<
runInfoMap_.find(the_r)->second.first <<
", tracks " << std::setw(10)
1119 <<
runInfoMap_.find(the_r)->second.second << std::endl;
1124 modeByRun_->GetXaxis()->SetBinLabel((the_r - theRuns_.front()) + 1, std::to_string(the_r).c_str());
1125 fieldByRun_->GetXaxis()->SetBinLabel((the_r - theRuns_.front()) + 1, std::to_string(the_r).c_str());
1128 pmap->save(
true, 0, 0,
"PixelHitMap.pdf", 600, 800);
1129 pmap->save(
true, 0, 0,
"PixelHitMap.png", 500, 750);
1131 tmap->save(
true, 0, 0,
"StripHitMap.pdf");
1132 tmap->save(
true, 0, 0,
"StripHitMap.png");
1134 gStyle->SetPalette(kRainBow);
1137 TCanvas cB(
"CanvBarrel",
"CanvBarrel", 1200, 1000);
1138 pixelmap->drawBarrelMaps(
"entriesBarrel", cB);
1139 cB.SaveAs(
"pixelBarrelEntries.png");
1141 TCanvas cF(
"CanvForward",
"CanvForward", 1600, 1000);
1142 pixelmap->drawForwardMaps(
"entriesForward", cF);
1143 cF.SaveAs(
"pixelForwardEntries.png");
1150 bool countStereoHitAs2D_ =
true;
1153 if (!
hit.isValid() ||
1154 (
hit.dimension() < 2 && !countStereoHitAs2D_ && !dynamic_cast<const SiStripRecHit1D *>(&
hit))) {
1157 const DetId detId(
hit.geographicalId());
1159 if (detId.subdetId() ==
kBPIX || detId.subdetId() ==
kFPIX) {
1164 return countStereoHitAs2D_;
1165 else if (dynamic_cast<const SiStripRecHit1D *>(&
hit) || dynamic_cast<const SiStripRecHit2D *>(&
hit))
1168 else if (dynamic_cast<const SiStripMatchedRecHit2D *>(&
hit))
1170 else if (dynamic_cast<const ProjectedSiStripRecHit2D *>(&
hit)) {
1174 edm::LogError(
"UnknownType") <<
"@SUB=GeneralPurposeTrackAnalyzer::isHit2D"
1175 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor "
1176 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
1181 edm::LogWarning(
"DetectorMismatch") <<
"@SUB=GeneralPurposeTrackAnalyzer::isHit2D"
1182 <<
"Hit not in tracker with 'official' dimension >=2.";
1195 desc.setComment(
"Generic track analyzer to check ALCARECO sample quantities");
1200 desc.add<
bool>(
"isCosmics",
false);
1201 descriptions.
add(
"GeneralPurposeTrackAnalyzer",
desc);