32 #include <boost/range/adaptor/indexed.hpp> 119 pmap = std::make_unique<TrackerMap>(
"Pixel");
120 pmap->onlyPixel(
true);
121 pmap->setTitle(
"Pixel Hit entries");
124 tmap = std::make_unique<TrackerMap>(
"Strip");
125 tmap->setTitle(
"Strip Hit entries");
128 pixelmap = std::make_unique<Phase1PixelMaps>(
"COLZ0 L");
129 pixelmap->bookBarrelHistograms(
"entriesBarrel",
"# hits",
"# pixel hits");
130 pixelmap->bookForwardHistograms(
"entriesForward",
"# hits",
"# pixel hits");
139 template <
class OBJECT_TYPE>
140 int index(
const std::vector<OBJECT_TYPE *> &vec,
const TString &
name) {
141 for (
const auto &iter : vec | boost::adaptors::indexed(0)) {
142 if (iter.value() && iter.value()->GetName() ==
name) {
146 edm::LogError(
"GeneralPurposeTrackAnalyzer") <<
"@SUB=GeneralPurposeTrackAnalyzer::index" 147 <<
" could not find " <<
name;
151 template <
typename T,
typename... Args>
169 std::optional<SiPixelCoordinates>
coord_;
173 std::unique_ptr<TrackerMap>
tmap;
174 std::unique_ptr<TrackerMap>
pmap;
339 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") <<
"Reconstructed " << tC.size() <<
" tracks" << std::endl;
349 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
355 <<
trigName <<
" " <<
accept <<
" ,track size: " << tC.size() << std::endl;
367 int nHighPurityTracks = 0;
370 unsigned int nHit2D = 0;
371 std::bitset<16> rocsToMask;
372 for (
auto iHit =
track->recHitsBegin(); iHit !=
track->recHitsEnd(); ++iHit) {
378 const DetId &
detId = (*iHit)->geographicalId();
384 if (pixhit->isValid()) {
385 unsigned int subid =
detId.subdetId();
386 int detid_db =
detId.rawId();
389 auto clustp = pixhit->cluster();
393 auto const &cluster = *clustp;
394 int row = cluster.x() - 0.5,
col = cluster.y() - 0.5;
397 pmap->fill(detid_db, 1);
400 rocsToMask.set(rocId);
404 pixelmap->fillBarrelBin(
"entriesBarrel", detid_db, 1);
406 pixelmap->fillForwardBin(
"entriesForward", detid_db, 1);
444 hnhpxb->Fill(
track->hitPattern().numberOfValidPixelBarrelHits());
445 hnhpxe->Fill(
track->hitPattern().numberOfValidPixelEndcapHits());
446 hnhTIB->Fill(
track->hitPattern().numberOfValidStripTIBHits());
447 hnhTID->Fill(
track->hitPattern().numberOfValidStripTIDHits());
448 hnhTOB->Fill(
track->hitPattern().numberOfValidStripTOBHits());
449 hnhTEC->Fill(
track->hitPattern().numberOfValidStripTECHits());
452 if (
track->hitPattern().numberOfValidPixelBarrelHits() != 0) {
459 if (
track->hitPattern().numberOfValidPixelEndcapHits() != 0) {
462 if (
track->hitPattern().numberOfValidStripTIBHits() != 0) {
465 if (
track->hitPattern().numberOfValidStripTIDHits() != 0) {
468 if (
track->hitPattern().numberOfValidStripTOBHits() != 0) {
471 if (
track->hitPattern().numberOfValidStripTECHits() != 0) {
484 if (fabs(
track->eta()) < 0.8) {
487 if (
track->eta() > 0.8 &&
track->eta() < 1.4) {
490 if (
track->eta() < -0.8 &&
track->eta() > -1.4) {
493 if (
track->eta() > 1.4) {
496 if (
track->eta() < -1.4) {
545 static const int etaindex = this->
index(vTrackHistos_,
"h_tracketa");
547 static const int phiindex = this->
index(vTrackHistos_,
"h_trackphi");
549 static const int numOfValidHitsindex = this->
index(vTrackHistos_,
"h_trackNumberOfValidHits");
551 static const int numOfLostHitsindex = this->
index(vTrackHistos_,
"h_trackNumberOfLostHits");
556 double kappa = -
track->charge() * theLocalMagFieldInInverseGeV /
track->pt();
558 static const int kappaindex = this->
index(vTrackHistos_,
"h_curvature");
560 static const int kappaposindex = this->
index(vTrackHistos_,
"h_curvature_pos");
561 if (
track->charge() > 0)
563 static const int kappanegindex = this->
index(vTrackHistos_,
"h_curvature_neg");
564 if (
track->charge() < 0)
567 double chi2Prob = TMath::Prob(
track->chi2(),
track->ndof());
570 static const int normchi2index = this->
index(vTrackHistos_,
"h_normchi2");
572 static const int chi2index = this->
index(vTrackHistos_,
"h_chi2");
574 static const int chi2Probindex = this->
index(vTrackHistos_,
"h_chi2Prob");
576 static const int ptindex = this->
index(vTrackHistos_,
"h_pt");
577 static const int pt2index = this->
index(vTrackHistos_,
"h_ptrebin");
580 if (
track->ptError() != 0.) {
581 static const int ptResolutionindex = this->
index(vTrackHistos_,
"h_ptResolution");
585 static const int d0phiindex = this->
index(vTrackProfiles_,
"p_d0_vs_phi");
587 static const int dzphiindex = this->
index(vTrackProfiles_,
"p_dz_vs_phi");
589 static const int d0etaindex = this->
index(vTrackProfiles_,
"p_d0_vs_eta");
591 static const int dzetaindex = this->
index(vTrackProfiles_,
"p_dz_vs_eta");
593 static const int chiProbphiindex = this->
index(vTrackProfiles_,
"p_chi2Prob_vs_phi");
595 static const int chiProbabsd0index = this->
index(vTrackProfiles_,
"p_chi2Prob_vs_d0");
597 static const int chiProbabsdzindex = this->
index(vTrackProfiles_,
"p_chi2Prob_vs_dz");
599 static const int chiphiindex = this->
index(vTrackProfiles_,
"p_chi2_vs_phi");
601 static const int normchiphiindex = this->
index(vTrackProfiles_,
"p_normchi2_vs_phi");
603 static const int chietaindex = this->
index(vTrackProfiles_,
"p_chi2_vs_eta");
605 static const int normchiptindex = this->
index(vTrackProfiles_,
"p_normchi2_vs_pt");
607 static const int normchipindex = this->
index(vTrackProfiles_,
"p_normchi2_vs_p");
609 static const int chiProbetaindex = this->
index(vTrackProfiles_,
"p_chi2Prob_vs_eta");
611 static const int normchietaindex = this->
index(vTrackProfiles_,
"p_normchi2_vs_eta");
613 static const int kappaphiindex = this->
index(vTrackProfiles_,
"p_kappa_vs_phi");
615 static const int kappaetaindex = this->
index(vTrackProfiles_,
"p_kappa_vs_eta");
617 static const int ptResphiindex = this->
index(vTrackProfiles_,
"p_ptResolution_vs_phi");
619 static const int ptResetaindex = this->
index(vTrackProfiles_,
"p_ptResolution_vs_eta");
623 static const int etaphiindex_2d = this->
index(vTrack2DHistos_,
"h2_phi_vs_eta");
625 static const int d0phiindex_2d = this->
index(vTrack2DHistos_,
"h2_d0_vs_phi");
627 static const int dzphiindex_2d = this->
index(vTrack2DHistos_,
"h2_dz_vs_phi");
629 static const int d0etaindex_2d = this->
index(vTrack2DHistos_,
"h2_d0_vs_eta");
631 static const int dzetaindex_2d = this->
index(vTrack2DHistos_,
"h2_dz_vs_eta");
633 static const int chiphiindex_2d = this->
index(vTrack2DHistos_,
"h2_chi2_vs_phi");
635 static const int chiProbphiindex_2d = this->
index(vTrack2DHistos_,
"h2_chi2Prob_vs_phi");
637 static const int chiProbabsd0index_2d = this->
index(vTrack2DHistos_,
"h2_chi2Prob_vs_d0");
639 static const int normchiphiindex_2d = this->
index(vTrack2DHistos_,
"h2_normchi2_vs_phi");
641 static const int chietaindex_2d = this->
index(vTrack2DHistos_,
"h2_chi2_vs_eta");
643 static const int chiProbetaindex_2d = this->
index(vTrack2DHistos_,
"h2_chi2Prob_vs_eta");
645 static const int normchietaindex_2d = this->
index(vTrack2DHistos_,
"h2_normchi2_vs_eta");
647 static const int kappaphiindex_2d = this->
index(vTrack2DHistos_,
"h2_kappa_vs_phi");
649 static const int kappaetaindex_2d = this->
index(vTrack2DHistos_,
"h2_kappa_vs_eta");
651 static const int normchi2kappa_2d = this->
index(vTrack2DHistos_,
"h2_normchi2_vs_kappa");
657 if (beamSpotHandle.
isValid()) {
663 double Beamsigmaz =
beamSpot.sigmaZ();
666 double BeamWidthX =
beamSpot.BeamWidthX();
667 double BeamWidthY =
beamSpot.BeamWidthY();
689 double mindxy = 100.;
692 for (
auto pvtx = vertexHandle->cbegin(); pvtx != vertexHandle->cend(); ++pvtx) {
695 mindxy =
track->dxy(mypoint);
701 hd0PV->Fill(-mindxy);
719 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") <<
"end of track loop" << std::endl;
723 hNtrk->Fill(tC.size());
728 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") <<
"end of analysis" << std::endl;
746 <<
"run number:" <<
run.run() <<
" magnetic field: " << B_ <<
" [T]" << std::endl;
789 coord_->init(trackerTopology, trackerGeometry, siPixelFedCablingMap);
801 edm::LogInfo(
"GeneralPurposeTrackAnalyzer") << __LINE__ << std::endl;
804 TH1D::SetDefaultSumw2(kTRUE);
810 hrun = book<TH1D>(
"h_run",
"run", 100000, 230000, 240000);
811 hlumi = book<TH1D>(
"h_lumi",
"lumi", 1000, 0, 1000);
813 hchi2ndof = book<TH1D>(
"h_chi2ndof",
"chi2/ndf;#chi^{2}/ndf;tracks", 100, 0, 5.);
814 hCharge = book<TH1D>(
"h_charge",
"charge;Charge of the track;tracks", 5, -2.5, 2.5);
815 hNtrk = book<TH1D>(
"h_Ntrk",
"ntracks;Number of Tracks;events", 200, 0., 200.);
816 hNtrkZoom = book<TH1D>(
"h_NtrkZoom",
"Number of tracks; number of tracks;events", 10, 0., 10.);
818 book<TH1D>(
"h_NhighPurity",
"n. high purity tracks;Number of high purity tracks;events", 200, 0., 200.);
821 "tracking step;iterative tracking step;tracks",
827 "original tracking step;original iterative tracking step;tracks",
837 htrkQuality = book<TH1I>(
"h_trkQuality",
"track quality;track quality;tracks", 6, -1, 5);
838 std::string qualities[7] = {
"undef",
"loose",
"tight",
"highPurity",
"confirmed",
"goodIterative"};
839 for (
int nbin = 1; nbin <=
htrkQuality->GetNbinsX(); nbin++) {
843 hP = book<TH1D>(
"h_P",
"Momentum;track momentum [GeV];tracks", 100, 0., 100.);
844 hQoverP = book<TH1D>(
"h_qoverp",
"Track q/p; track q/p [GeV^{-1}];tracks", 100, -1., 1.);
845 hQoverPZoom = book<TH1D>(
"h_qoverpZoom",
"Track q/p; track q/p [GeV^{-1}];tracks", 100, -0.1, 0.1);
846 hPt = book<TH1D>(
"h_Pt",
"Transverse Momentum;track p_{T} [GeV];tracks", 100, 0., 100.);
847 hHit = book<TH1D>(
"h_nHits",
"Number of hits;track n. hits;tracks", 50, -0.5, 49.5);
848 hHit2D = book<TH1D>(
"h_nHit2D",
"Number of 2D hits; number of 2D hits;tracks", 20, 0, 20);
850 hHitCountVsZBPix = book<TH1D>(
"h_HitCountVsZBpix",
"Number of BPix hits vs z;hit global z;hits", 60, -30, 30);
851 hHitCountVsZFPix = book<TH1D>(
"h_HitCountVsZFpix",
"Number of FPix hits vs z;hit global z;hits", 100, -100, 100);
853 hHitCountVsXBPix = book<TH1D>(
"h_HitCountVsXBpix",
"Number of BPix hits vs x;hit global x;hits", 20, -20, 20);
854 hHitCountVsXFPix = book<TH1D>(
"h_HitCountVsXFpix",
"Number of FPix hits vs x;hit global x;hits", 20, -20, 20);
856 hHitCountVsYBPix = book<TH1D>(
"h_HitCountVsYBpix",
"Number of BPix hits vs y;hit global y;hits", 20, -20, 20);
857 hHitCountVsYFPix = book<TH1D>(
"h_HitCountVsYFpix",
"Number of FPix hits vs y;hit global y;hits", 20, -20, 20);
860 book<TH1D>(
"h_HitCountVsThetaBpix",
"Number of BPix hits vs #theta;hit global #theta;hits", 20, 0.,
M_PI);
862 book<TH1D>(
"h_HitCountVsPhiBpix",
"Number of BPix hits vs #phi;hit global #phi;hits", 20, -
M_PI,
M_PI);
865 book<TH1D>(
"h_HitCountVsThetaFpix",
"Number of FPix hits vs #theta;hit global #theta;hits", 40, 0.,
M_PI);
867 book<TH1D>(
"h_HitCountVsPhiFpix",
"Number of FPix hits vs #phi;hit global #phi;hits", 20, -
M_PI,
M_PI);
869 hEta = book<TH1D>(
"h_Eta",
"Track pseudorapidity; track #eta;tracks", 100, -
etaMax_,
etaMax_);
870 hPhi = book<TH1D>(
"h_Phi",
"Track azimuth; track #phi;tracks", 100, -
M_PI,
M_PI);
872 hPhiBarrel = book<TH1D>(
"h_PhiBarrel",
"hPhiBarrel (0<|#eta|<0.8);track #phi;tracks", 100, -
M_PI,
M_PI);
874 book<TH1D>(
"h_PhiOverlapPlus",
"hPhiOverlapPlus (0.8<#eta<1.4);track #phi;tracks", 100, -
M_PI,
M_PI);
876 book<TH1D>(
"h_PhiOverlapMinus",
"hPhiOverlapMinus (-1.4<#eta<-0.8);track #phi;tracks", 100, -
M_PI,
M_PI);
877 hPhiEndcapPlus = book<TH1D>(
"h_PhiEndcapPlus",
"hPhiEndcapPlus (#eta>1.4);track #phi;track", 100, -
M_PI,
M_PI);
878 hPhiEndcapMinus = book<TH1D>(
"h_PhiEndcapMinus",
"hPhiEndcapMinus (#eta<1.4);track #phi;tracks", 100, -
M_PI,
M_PI);
880 h_BSx0 = book<TH1F>(
"h_BSx0",
"x-coordinate of reco beamspot;x^{BS}_{0};n_{events}", 100, -0.1, 0.1);
881 h_BSy0 = book<TH1F>(
"h_BSy0",
"y-coordinate of reco beamspot;y^{BS}_{0};n_{events}", 100, -0.1, 0.1);
882 h_BSz0 = book<TH1F>(
"h_BSz0",
"z-coordinate of reco beamspot;z^{BS}_{0};n_{events}", 100, -1., 1.);
883 h_Beamsigmaz = book<TH1F>(
"h_Beamsigmaz",
"z-coordinate beam width;#sigma_{Z}^{beam};n_{events}", 100, 0., 7.);
884 h_BeamWidthX = book<TH1F>(
"h_BeamWidthX",
"x-coordinate beam width;#sigma_{X}^{beam};n_{events}", 100, 0., 0.01);
885 h_BeamWidthY = book<TH1F>(
"h_BeamWidthY",
"y-coordinate beam width;#sigma_{Y}^{beam};n_{events}", 100, 0., 0.01);
886 h_BSdxdz = book<TH1F>(
"h_BSdxdz",
"BeamSpot dxdz;beamspot dx/dz;n_{events}", 100, -0.0003, 0.0003);
887 h_BSdydz = book<TH1F>(
"h_BSdydz",
"BeamSpot dydz;beamspot dy/dz;n_{events}", 100, -0.0003, 0.0003);
890 hPhp = book<TH1D>(
"h_P_hp",
"Momentum (high purity);track momentum [GeV];tracks", 100, 0., 100.);
891 hPthp = book<TH1D>(
"h_Pt_hp",
"Transverse Momentum (high purity);track p_{T} [GeV];tracks", 100, 0., 100.);
892 hHithp = book<TH1D>(
"h_nHit_hp",
"Number of hits (high purity);track n. hits;tracks", 30, 0, 30);
893 hEtahp = book<TH1D>(
"h_Eta_hp",
"Track pseudorapidity (high purity); track #eta;tracks", 100, -
etaMax_,
etaMax_);
894 hPhihp = book<TH1D>(
"h_Phi_hp",
"Track azimuth (high purity); track #phi;tracks", 100, -
M_PI,
M_PI);
895 hchi2ndofhp = book<TH1D>(
"h_chi2ndof_hp",
"chi2/ndf (high purity);#chi^{2}/ndf;tracks", 100, 0, 5.);
897 "h_chi2_Prob_hp",
"#chi^{2} probability (high purity);#chi^{2}prob_{Track};Number of Tracks", 100, 0.0, 1.);
899 hvx = book<TH1D>(
"h_vx",
"Track v_{x} ; track v_{x} [cm];tracks", 100, -1.5, 1.5);
900 hvy = book<TH1D>(
"h_vy",
"Track v_{y} ; track v_{y} [cm];tracks", 100, -1.5, 1.5);
901 hvz = book<TH1D>(
"h_vz",
"Track v_{z} ; track v_{z} [cm];tracks", 100, -20., 20.);
902 hd0 = book<TH1D>(
"h_d0",
"Track d_{0} ; track d_{0} [cm];tracks", 100, -1., 1.);
903 hdxy = book<TH1D>(
"h_dxy",
"Track d_{xy}; track d_{xy} [cm]; tracks", 100, -0.5, 0.5);
904 hdz = book<TH1D>(
"h_dz",
"Track d_{z} ; track d_{z} [cm]; tracks", 100, -20, 20);
907 book<TH2D>(
"h2_d0PVvsphi",
"hd0PVvsphi;track #phi;track d_{0}(PV) [cm]", 160, -
M_PI,
M_PI, 100, -1., 1.);
909 book<TH2D>(
"h2_d0PVvseta",
"hdPV0vseta;track #eta;track d_{0}(PV) [cm]", 160, -2.5, 2.5, 100, -1., 1.);
910 hd0PVvspt = book<TH2D>(
"h2_d0PVvspt",
"hdPV0vspt;track p_{T};d_{0}(PV) [cm]", 50, 0., 100., 100, -1, 1.);
912 hdxyBS = book<TH1D>(
"h_dxyBS",
"hdxyBS; track d_{xy}(BS) [cm];tracks", 100, -0.1, 0.1);
913 hd0BS = book<TH1D>(
"h_d0BS",
"hd0BS ; track d_{0}(BS) [cm];tracks", 100, -0.1, 0.1);
914 hdzBS = book<TH1D>(
"h_dzBS",
"hdzBS ; track d_{z}(BS) [cm];tracks", 100, -12, 12);
915 hdxyPV = book<TH1D>(
"h_dxyPV",
"hdxyPV; track d_{xy}(PV) [cm];tracks", 100, -0.1, 0.1);
916 hd0PV = book<TH1D>(
"h_d0PV",
"hd0PV ; track d_{0}(PV) [cm];tracks", 100, -0.15, 0.15);
917 hdzPV = book<TH1D>(
"h_dzPV",
"hdzPV ; track d_{z}(PV) [cm];tracks", 100, -0.1, 0.1);
919 hnhTIB = book<TH1D>(
"h_nHitTIB",
"nhTIB;# hits in TIB; tracks", 20, 0., 20.);
920 hnhTID = book<TH1D>(
"h_nHitTID",
"nhTID;# hits in TID; tracks", 20, 0., 20.);
921 hnhTOB = book<TH1D>(
"h_nHitTOB",
"nhTOB;# hits in TOB; tracks", 20, 0., 20.);
922 hnhTEC = book<TH1D>(
"h_nHitTEC",
"nhTEC;# hits in TEC; tracks", 20, 0., 20.);
925 hvx = book<TH1D>(
"h_vx",
"Track v_{x};track v_{x} [cm];tracks", 100, -100., 100.);
926 hvy = book<TH1D>(
"h_vy",
"Track v_{y};track v_{y} [cm];tracks", 100, -100., 100.);
927 hvz = book<TH1D>(
"h_vz",
"Track v_{z};track v_{z} [cm];track", 100, -100., 100.);
928 hd0 = book<TH1D>(
"h_d0",
"Track d_{0};track d_{0} [cm];track", 100, -100., 100.);
929 hdxy = book<TH1D>(
"h_dxy",
"Track d_{xy};track d_{xy} [cm];tracks", 100, -100, 100);
930 hdz = book<TH1D>(
"h_dz",
"Track d_{z};track d_{z} [cm];tracks", 100, -200, 200);
933 "h2_d0vsphi",
"Track d_{0} vs #phi; track #phi;track d_{0} [cm]", 160, -3.20, 3.20, 100, -100., 100.);
935 "h2_d0vseta",
"Track d_{0} vs #eta; track #eta;track d_{0} [cm]", 160, -3.20, 3.20, 100, -100., 100.);
937 book<TH2D>(
"h2_d0vspt",
"Track d_{0} vs p_{T};track p_{T};track d_{0} [cm]", 50, 0., 100., 100, -100, 100);
939 hdxyBS = book<TH1D>(
"h_dxyBS",
"Track d_{xy}(BS);d_{xy}(BS) [cm];tracks", 100, -100., 100.);
940 hd0BS = book<TH1D>(
"h_d0BS",
"Track d_{0}(BS);d_{0}(BS) [cm];tracks", 100, -100., 100.);
941 hdzBS = book<TH1D>(
"h_dzBS",
"Track d_{z}(BS);d_{z}(BS) [cm];tracks", 100, -100., 100.);
942 hdxyPV = book<TH1D>(
"h_dxyPV",
"Track d_{xy}(PV); d_{xy}(PV) [cm];tracks", 100, -100., 100.);
943 hd0PV = book<TH1D>(
"h_d0PV",
"Track d_{0}(PV); d_{0}(PV) [cm];tracks", 100, -100., 100.);
944 hdzPV = book<TH1D>(
"h_dzPV",
"Track d_{z}(PV); d_{z}(PV) [cm];tracks", 100, -100., 100.);
946 hnhTIB = book<TH1D>(
"h_nHitTIB",
"nhTIB;# hits in TIB; tracks", 30, 0., 30.);
947 hnhTID = book<TH1D>(
"h_nHitTID",
"nhTID;# hits in TID; tracks", 30, 0., 30.);
948 hnhTOB = book<TH1D>(
"h_nHitTOB",
"nhTOB;# hits in TOB; tracks", 30, 0., 30.);
949 hnhTEC = book<TH1D>(
"h_nHitTEC",
"nhTEC;# hits in TEC; tracks", 30, 0., 30.);
952 hnhpxb = book<TH1D>(
"h_nHitPXB",
"nhpxb;# hits in Pixel Barrel; tracks", 10, 0., 10.);
953 hnhpxe = book<TH1D>(
"h_nHitPXE",
"nhpxe;# hits in Pixel Endcap; tracks", 10, 0., 10.);
955 hHitComposition = book<TH1D>(
"h_hitcomposition",
"track hit composition;;# hits", 6, -0.5, 5.5);
958 book<TProfile>(
"p_NpixHits_vs_Vx",
"n. Barrel Pixel hits vs. v_{x};v_{x} (cm);n. BPix hits", 20, -20, 20);
961 book<TProfile>(
"p_NpixHits_vs_Vy",
"n. Barrel Pixel hits vs. v_{y};v_{y} (cm);n. BPix hits", 20, -20, 20);
964 book<TProfile>(
"p_NpixHits_vs_Vz",
"n. Barrel Pixel hits vs. v_{z};v_{z} (cm);n. BPix hits", 20, -100, 100);
966 std::string dets[6] = {
"PXB",
"PXF",
"TIB",
"TID",
"TOB",
"TEC"};
977 vTrackHistos_.push_back(book<TH1F>(
"h_trackphi",
"Track #phi;#phi_{Track};Number of Tracks", 90, -
M_PI,
M_PI));
978 vTrackHistos_.push_back(book<TH1F>(
"h_trackNumberOfValidHits",
"Track # of valid hits;# of valid hits _{Track};Number of Tracks", 40, 0., 40.));
979 vTrackHistos_.push_back(book<TH1F>(
"h_trackNumberOfLostHits",
"Track # of lost hits;# of lost hits _{Track};Number of Tracks", 10, 0., 10.));
980 vTrackHistos_.push_back(book<TH1F>(
"h_curvature",
"Curvature #kappa;#kappa_{Track};Number of Tracks", 100, -.05, .05));
981 vTrackHistos_.push_back(book<TH1F>(
"h_curvature_pos",
"Curvature |#kappa| Positive Tracks;|#kappa_{pos Track}|;Number of Tracks", 100, .0, .05));
982 vTrackHistos_.push_back(book<TH1F>(
"h_curvature_neg",
"Curvature |#kappa| Negative Tracks;|#kappa_{neg Track}|;Number of Tracks", 100, .0, .05));
983 vTrackHistos_.push_back(book<TH1F>(
"h_diff_curvature",
"Curvature |#kappa| Tracks Difference;|#kappa_{Track}|;# Pos Tracks - # Neg Tracks",100, .0, .05));
984 vTrackHistos_.push_back(book<TH1F>(
"h_chi2",
"Track #chi^{2};#chi^{2}_{Track};Number of Tracks", 500, -0.01, 500.));
985 vTrackHistos_.push_back(book<TH1F>(
"h_chi2Prob",
"#chi^{2} probability;Track Prob(#chi^{2},ndof);Number of Tracks", 100, 0.0, 1.));
986 vTrackHistos_.push_back(book<TH1F>(
"h_normchi2",
"#chi^{2}/ndof;#chi^{2}/ndof;Number of Tracks", 100, -0.01, 10.));
988 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.};
989 vTrackHistos_.push_back(book<TH1F>(
"h_pt",
"Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 250, 0., 250));
990 vTrackHistos_.push_back(book<TH1F>(
"h_ptrebin",
"Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 18,
xBins));
991 vTrackHistos_.push_back(book<TH1F>(
"h_ptResolution",
"#delta_{p_{T}}/p_{T}^{track};#delta_{p_{T}}/p_{T}^{track};Number of Tracks", 100, 0., 0.5));
993 vTrackProfiles_.push_back(book<TProfile>(
"p_d0_vs_phi",
"Transverse Impact Parameter vs. #phi;#phi_{Track};#LT d_{0} #GT [cm]", 100, -
M_PI,
M_PI));
994 vTrackProfiles_.push_back(book<TProfile>(
"p_dz_vs_phi",
"Longitudinal Impact Parameter vs. #phi;#phi_{Track};#LT d_{z} #GT [cm]", 100, -
M_PI,
M_PI));
995 vTrackProfiles_.push_back(book<TProfile>(
"p_d0_vs_eta",
"Transverse Impact Parameter vs. #eta;#eta_{Track};#LT d_{0} #GT [cm]", 100, -
etaMax_,
etaMax_));
996 vTrackProfiles_.push_back(book<TProfile>(
"p_dz_vs_eta",
"Longitudinal Impact Parameter vs. #eta;#eta_{Track};#LT d_{z} #GT [cm]", 100, -
etaMax_,
etaMax_));
997 vTrackProfiles_.push_back(book<TProfile>(
"p_chi2_vs_phi",
"#chi^{2} vs. #phi;#phi_{Track};#LT #chi^{2} #GT", 100, -
M_PI,
M_PI));
998 vTrackProfiles_.push_back(book<TProfile>(
"p_chi2Prob_vs_phi",
"#chi^{2} probablility vs. #phi;#phi_{Track};#LT #chi^{2} probability#GT", 100, -
M_PI,
M_PI));
999 vTrackProfiles_.push_back(book<TProfile>(
"p_chi2Prob_vs_d0",
"#chi^{2} probablility vs. |d_{0}|;|d_{0}|[cm];#LT #chi^{2} probability#GT", 100, 0, 80));
1000 vTrackProfiles_.push_back(book<TProfile>(
"p_chi2Prob_vs_dz",
"#chi^{2} probablility vs. dz;d_{z} [cm];#LT #chi^{2} probability#GT", 100, -30, 30));
1001 vTrackProfiles_.push_back(book<TProfile>(
"p_normchi2_vs_phi",
"#chi^{2}/ndof vs. #phi;#phi_{Track};#LT #chi^{2}/ndof #GT", 100, -
M_PI,
M_PI));
1003 vTrackProfiles_.push_back(book<TProfile>(
"p_normchi2_vs_pt",
"norm #chi^{2} vs. p_{T}_{Track}; p_{T}_{Track};#LT #chi^{2}/ndof #GT", 18,
xBins));
1004 vTrackProfiles_.push_back(book<TProfile>(
"p_normchi2_vs_p",
"#chi^{2}/ndof vs. p_{Track};p_{Track};#LT #chi^{2}/ndof #GT", 18,
xBins));
1005 vTrackProfiles_.push_back(book<TProfile>(
"p_chi2Prob_vs_eta",
"#chi^{2} probability vs. #eta;#eta_{Track};#LT #chi^{2} probability #GT",100,-
etaMax_,
etaMax_));
1006 vTrackProfiles_.push_back(book<TProfile>(
"p_normchi2_vs_eta",
"#chi^{2}/ndof vs. #eta;#eta_{Track};#LT #chi^{2}/ndof #GT", 100, -
etaMax_,
etaMax_));
1007 vTrackProfiles_.push_back(book<TProfile>(
"p_kappa_vs_phi",
"#kappa vs. #phi;#phi_{Track};#kappa", 100, -
M_PI,
M_PI));
1009 vTrackProfiles_.push_back(book<TProfile>(
"p_ptResolution_vs_phi",
"#delta_{p_{T}}/p_{T}^{track};#phi^{track};#delta_{p_{T}}/p_{T}^{track}",100,-
M_PI,
M_PI));
1010 vTrackProfiles_.push_back(book<TProfile>(
"p_ptResolution_vs_eta",
"#delta_{p_{T}}/p_{T}^{track};#eta^{track};#delta_{p_{T}}/p_{T}^{track}",100,-
etaMax_,
etaMax_));
1013 vTrack2DHistos_.push_back(book<TH2F>(
"h2_d0_vs_phi",
"Transverse Impact Parameter vs. #phi;#phi_{Track};d_{0} [cm]", 100, -
M_PI,
M_PI, 100, -1., 1.));
1014 vTrack2DHistos_.push_back(book<TH2F>(
"h2_dz_vs_phi",
"Longitudinal Impact Parameter vs. #phi;#phi_{Track};d_{z} [cm]",100, -
M_PI,
M_PI, 100, -100., 100.));
1015 vTrack2DHistos_.push_back(book<TH2F>(
"h2_d0_vs_eta",
"Transverse Impact Parameter vs. #eta;#eta_{Track};d_{0} [cm]", 100, -
etaMax_,
etaMax_, 100, -1., 1.));
1016 vTrack2DHistos_.push_back(book<TH2F>(
"h2_dz_vs_eta",
"Longitudinal Impact Parameter vs. #eta;#eta_{Track};d_{z} [cm]", 100, -
etaMax_,
etaMax_, 100, -100., 100.));
1017 vTrack2DHistos_.push_back(book<TH2F>(
"h2_chi2_vs_phi",
"#chi^{2} vs. #phi;#phi_{Track};#chi^{2}", 100, -
M_PI,
M_PI, 500, 0., 500.));
1018 vTrack2DHistos_.push_back(book<TH2F>(
"h2_chi2Prob_vs_phi",
"#chi^{2} probability vs. #phi;#phi_{Track};#chi^{2} probability", 100, -
M_PI,
M_PI, 100, 0., 1.));
1019 vTrack2DHistos_.push_back(book<TH2F>(
"h2_chi2Prob_vs_d0",
"#chi^{2} probability vs. |d_{0}|;|d_{0}| [cm];#chi^{2} probability", 100, 0, 80, 100, 0., 1.));
1020 vTrack2DHistos_.push_back(book<TH2F>(
"h2_normchi2_vs_phi",
"#chi^{2}/ndof vs. #phi;#phi_{Track};#chi^{2}/ndof", 100, -
M_PI,
M_PI, 100, 0., 10.));
1022 vTrack2DHistos_.push_back(book<TH2F>(
"h2_chi2Prob_vs_eta",
"#chi^{2} probaility vs. #eta;#eta_{Track};#chi^{2} probability", 100, -
etaMax_,
etaMax_, 100, 0., 1.));
1023 vTrack2DHistos_.push_back(book<TH2F>(
"h2_normchi2_vs_eta",
"#chi^{2}/ndof vs. #eta;#eta_{Track};#chi^{2}/ndof", 100, -
etaMax_,
etaMax_, 100, 0., 10.));
1024 vTrack2DHistos_.push_back(book<TH2F>(
"h2_kappa_vs_phi",
"#kappa vs. #phi;#phi_{Track};#kappa", 100, -
M_PI,
M_PI, 100, .0, .05));
1026 vTrack2DHistos_.push_back(book<TH2F>(
"h2_normchi2_vs_kappa",
"#kappa vs. #chi^{2}/ndof;#chi^{2}/ndof;#kappa", 100, 0., 10, 100, -.03, .03));
1036 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1037 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"Events run in total: " <<
ievt << std::endl;
1039 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1043 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" << std::endl;
1046 book<TH1D>(
"tksByTrigger",
"tracks by HLT path;;% of # traks", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1048 book<TH1D>(
"evtsByTrigger",
"events by HLT path;;% of # events", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1054 double trkpercent = ((
it.second).
second) * 100. / double(
itrks);
1055 double evtpercent = ((
it.second).
first) * 100. / double(
ievt);
1060 <<
"HLT path: " << std::setw(60) << std::left <<
it.first <<
" | events firing: " << std::right
1061 << std::setw(8) << (
it.second).
first <<
" (" << std::setw(8) <<
std::fixed << std::setprecision(4)
1062 << evtpercent <<
"%)" 1063 <<
" | tracks collected: " << std::setw(10) << (
it.second).
second <<
" (" << std::setw(8) <<
std::fixed 1064 << std::setprecision(4) << trkpercent <<
"%)";
1075 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" 1077 <<
" no run was processed! " 1079 <<
"*******************************";
1084 std::vector<int> theRuns_;
1087 theRuns_.push_back(
it.first);
1090 sort(theRuns_.begin(), theRuns_.end());
1091 int runRange = theRuns_.back() - theRuns_.front() + 1;
1093 edm::LogPrint(
"GeneralPurposeTrackAnalyzer") <<
"*******************************" 1095 <<
"first run: " << theRuns_.front() <<
"\n" 1096 <<
"last run: " << theRuns_.back() <<
"\n" 1097 <<
"considered runs: " << nRuns <<
"\n" 1098 <<
"*******************************";
1101 "Strip APV mode by run number;;APV mode (-1=deco,+1=peak)",
1103 theRuns_.front() - 0.5,
1104 theRuns_.back() + 0.5);
1107 "CMS B-field intensity by run number;;B-field intensity [T]",
1109 theRuns_.front() - 0.5,
1110 theRuns_.back() + 0.5);
1112 edm::LogPrint(
"") << __PRETTY_FUNCTION__ <<
" line: " << __LINE__ << std::endl;
1114 for (
const auto &the_r : theRuns_) {
1117 <<
"run:" << the_r <<
" | isPeak: " << std::setw(4) <<
conditionsMap_.find(the_r)->second.first
1118 <<
"| B-field: " <<
conditionsMap_.find(the_r)->second.second <<
" [T]" 1119 <<
"| events: " << std::setw(10) <<
runInfoMap_.find(the_r)->second.first <<
", tracks " << std::setw(10)
1120 <<
runInfoMap_.find(the_r)->second.second << std::endl;
1129 static const int kappadiffindex = this->
index(vTrackHistos_,
"h_diff_curvature");
1137 pmap->save(
true, 0, 0,
"PixelHitMap.pdf", 600, 800);
1138 pmap->save(
true, 0, 0,
"PixelHitMap.png", 500, 750);
1141 tmap->save(
true, 0, 0,
"StripHitMap.pdf");
1142 tmap->save(
true, 0, 0,
"StripHitMap.png");
1144 gStyle->SetPalette(kRainBow);
1147 TCanvas cB(
"CanvBarrel",
"CanvBarrel", 1200, 1000);
1148 pixelmap->drawBarrelMaps(
"entriesBarrel", cB);
1149 cB.SaveAs(
"pixelBarrelEntries.png");
1151 TCanvas cF(
"CanvForward",
"CanvForward", 1600, 1000);
1152 pixelmap->drawForwardMaps(
"entriesForward", cF);
1153 cF.SaveAs(
"pixelForwardEntries.png");
1155 TCanvas cRocs = TCanvas(
"cRocs",
"cRocs", 1200, 1600);
1156 pixelrocsmap_->drawMaps(cRocs,
"Pixel on-track clusters occupancy");
1157 cRocs.SaveAs(
"Phase1PixelROCMaps_fullROCs.png");
1165 bool countStereoHitAs2D_ =
true;
1168 if (!
hit.isValid() ||
1179 return countStereoHitAs2D_;
1180 else if (dynamic_cast<const SiStripRecHit1D *>(&
hit) ||
dynamic_cast<const SiStripRecHit2D *
>(&
hit))
1183 else if (dynamic_cast<const SiStripMatchedRecHit2D *>(&
hit))
1185 else if (dynamic_cast<const ProjectedSiStripRecHit2D *>(&
hit)) {
1189 edm::LogError(
"UnknownType") <<
"@SUB=GeneralPurposeTrackAnalyzer::isHit2D" 1190 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor " 1191 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
1196 edm::LogWarning(
"DetectorMismatch") <<
"@SUB=GeneralPurposeTrackAnalyzer::isHit2D" 1197 <<
"Hit not in tracker with 'official' dimension >=2.";
1210 desc.setComment(
"Generic track analyzer to check ALCARECO sample quantities");
1215 desc.add<
bool>(
"isCosmics",
false);
1216 desc.add<
bool>(
"doLatencyAnalysis",
true);
static const std::string kSharedResource
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
TProfile * pNBpixHitsVsVy
std::map< int, std::pair< int, float > > conditionsMap_
TH1D * hHitCountVsPhiFPix
double z() const
z coordinate
edm::EDGetTokenT< edm::TriggerResults > hltresultsToken_
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken_
Strings const & triggerNames() const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
Geom::Phi< T > phi() const
std::unique_ptr< TrackerMap > tmap
edm::InputTag VerticesTag_
Global3DPoint GlobalPoint
std::vector< Track > TrackCollection
collection of Tracks
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
static void fillDescriptions(edm::ConfigurationDescriptions &)
std::unique_ptr< TrackerMap > pmap
Log< level::Error, false > LogError
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
void beginRun(edm::Run const &run, edm::EventSetup const &setup) override
const TrackerGeometry * trackerGeometry_
std::vector< TH1 * > vTrackHistos_
static std::string to_string(const XMLCh *ch)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomTokenBR_
U second(std::pair< T, U > const &p)
TH1D * hHitCountVsPhiBPix
std::vector< TH1 * > vTrackProfiles_
T const * product() const
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)
bool isThere(GeomDetEnumerators::SubDetector subdet) const
GeneralPurposeTrackAnalyzer(const edm::ParameterSet &pset)
Abs< T >::type abs(const T &t)
TH1D * hHitCountVsThetaFPix
#define DEFINE_FWK_MODULE(type)
std::map< int, std::pair< int, int > > runInfoMap_
double x() const
x coordinate
std::vector< TH1 * > vTrack2DHistos_
Log< level::Warning, true > LogPrint
const TrackerGeomDet * idToDet(DetId) const override
double y() const
y coordinate
const char * qualities[3]
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
Log< level::Info, false > LogInfo
Detector identifier class for the strip tracker.
edm::InputTag BeamSpotTag_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
int16_t singleReadOutMode() const
XYZPointD XYZPoint
point in space with cartesian internal representation
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyTokenBR_
std::string const & triggerName(unsigned int index) const
edm::ESGetToken< SiStripLatency, SiStripLatencyRcd > latencyToken_
TProfile * pNBpixHitsVsVx
static const std::string algoNames[]
void endRun(edm::Run const &, edm::EventSetup const &) override
std::unique_ptr< Phase1PixelROCMaps > pixelrocsmap_
TH1D * hHitCountVsThetaBPix
SiStripRecHit2D originalHit() const
edm::Service< TFileService > fs
T * book(const Args &...args) const
T * make(const Args &...args) const
make new ROOT object
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_
std::optional< SiPixelCoordinates > coord_
TProfile * pNBpixHitsVsVz
Geom::Theta< T > theta() const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
int index(const std::vector< OBJECT_TYPE *> &vec, const TString &name)