|
26 | 26 | #include "DataFormatsGlobalTracking/RecoContainer.h" |
27 | 27 | #include "DataFormatsITSMFT/TrkClusRef.h" |
28 | 28 | #include "DataFormatsITSMFT/ClustersPerLayer.h" |
| 29 | +#include "ITSMFTReconstruction/ChipMappingITS.h" |
29 | 30 | #include "DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h" |
30 | 31 | #include "ReconstructionDataFormats/TrackTPCITS.h" |
31 | 32 | #include "ReconstructionDataFormats/GlobalTrackID.h" |
@@ -106,6 +107,7 @@ class CheckResidSpec final : public Task |
106 | 107 | void postProcessHistos(); |
107 | 108 | void drawHistos(); |
108 | 109 |
|
| 110 | + o2::itsmft::ChipMappingITS mChipMap; |
109 | 111 | o2::globaltracking::RecoContainer* mRecoData = nullptr; |
110 | 112 | int mNThreads = 1; |
111 | 113 | bool mMeanVertexUpdated = false; |
@@ -632,6 +634,7 @@ bool CheckResidSpec::refitITStrack(o2::track::TrackParCov& track, GTrackID gid) |
632 | 634 | void CheckResidSpec::fillHistos(const o2::checkresid::Track& trc) |
633 | 635 | { |
634 | 636 | const auto& params = CheckResidConfig::Instance(); |
| 637 | + auto geom = o2::its::GeometryTGeo::Instance(); |
635 | 638 | int np = trc.points.size(); |
636 | 639 | auto pt = trc.track.getPt(); |
637 | 640 | if (pt < params.minPt || pt > params.maxPt) { |
@@ -662,6 +665,21 @@ void CheckResidSpec::fillHistos(const o2::checkresid::Track& trc) |
662 | 665 | mHMan->getHisto2F(il * 10 + 1 * 100 + 5 + 2000)->Fill(pt, pull); |
663 | 666 | mHMan->getHisto2F(il * 10 + 1 * 100 + 5 + 3000)->Fill(trc.track.getTgl(), pull); |
664 | 667 | } |
| 668 | + if (pnt.lr >= 0 && pnt.sens >= 0 && geom->getLayer(pnt.sens) == pnt.lr) { |
| 669 | + const int halfBarrel = geom->getHalfBarrel(pnt.sens); |
| 670 | + const int chip = geom->getFirstChipIndex(pnt.lr) + geom->getChipIdInLayer(pnt.sens); |
| 671 | + const int chipHistoID = (2 * il + halfBarrel) * 100 + 15000; |
| 672 | + if (halfBarrel >= 0 && halfBarrel < 2) { |
| 673 | + mHMan->getHisto2F(chipHistoID)->Fill(chip, pnt.dy); |
| 674 | + mHMan->getHisto2F(chipHistoID + 10)->Fill(chip, pnt.dz); |
| 675 | + if (pnt.sig2y > 0) { |
| 676 | + mHMan->getHisto2F(chipHistoID + 5)->Fill(chip, pnt.dy / std::sqrt(pnt.sig2y)); |
| 677 | + } |
| 678 | + if (pnt.sig2z > 0) { |
| 679 | + mHMan->getHisto2F(chipHistoID + 15)->Fill(chip, pnt.dz / std::sqrt(pnt.sig2z)); |
| 680 | + } |
| 681 | + } |
| 682 | + } |
665 | 683 | } |
666 | 684 | //-------------- |
667 | 685 | if (trc.trIBOut.getX() > 1 && std::abs(trc.trIBOut.getX() - trc.trOBInw.getX()) < 0.1) { |
@@ -726,6 +744,18 @@ void CheckResidSpec::bookHistos() |
726 | 744 | mHMan->addHisto(htgl2, il * 10 + iyz * 100 + 3000); |
727 | 745 | auto htgl2p = new TH2F(fmt::format("{}_{}_{}_pull", dname, lrName, "tgl").c_str(), fmt::format("pull {}_{{{}}} vs {};tg#lambda; pull{}", dtit, lrName, "tg#lambda", dtit).c_str(), params.nBinsTgl, -params.maxTgl, params.maxTgl, params.nBinsRes, -params.maxPull, params.maxPull); |
728 | 746 | mHMan->addHisto(htgl2p, il * 10 + iyz * 100 + 5 + 3000); |
| 747 | + |
| 748 | + if (il > 0) { |
| 749 | + const int ilr = il - 1; |
| 750 | + const int nChips = mChipMap.getNChipsOnLayer(ilr) / 2; |
| 751 | + for (int ib = 0; ib < 2; ++ib) { // chips per halfbarrel |
| 752 | + const int startChip = ib * nChips + mChipMap.getFirstChipsOnLayer(ilr); |
| 753 | + auto h2 = new TH2F(fmt::format("{}_{}_{}", dname, lrName, ib).c_str(), fmt::format("{} Lr{} HB{};chip;{}", dname, lrName, ib, dtit).c_str(), nChips, startChip - 0.5, startChip - 0.5 + nChips, params.nBinsRes, -params.maxDYZ[il], params.maxDYZ[il]); |
| 754 | + mHMan->addHisto(h2, (2 * il + ib) * 100 + iyz * 10 + 15000); |
| 755 | + auto h2p = new TH2F(fmt::format("{}_{}_{}_pull", dname, lrName, ib).c_str(), fmt::format("{} Lr{} HB{} pull;chip;pull{}", dname, lrName, ib, dtit).c_str(), nChips, startChip - 0.5, startChip - 0.5 + nChips, params.nBinsRes, -params.maxPull, params.maxPull); |
| 756 | + mHMan->addHisto(h2p, (2 * il + ib) * 100 + iyz * 10 + 5 + 15000); |
| 757 | + } |
| 758 | + } |
729 | 759 | } |
730 | 760 | } |
731 | 761 |
|
@@ -805,14 +835,24 @@ void CheckResidSpec::postProcessHistos() |
805 | 835 | } |
806 | 836 | } |
807 | 837 | } |
| 838 | + for (int il = 1; il < 8; il++) { |
| 839 | + for (int ib = 0; ib < 2; ib++) { |
| 840 | + for (int iyz = 0; iyz < 2; iyz++) { |
| 841 | + for (int iht = 0; iht < 2; iht++) { |
| 842 | + const int offsV = iht == 0 ? 0 : 5; |
| 843 | + fitSlices((2 * il + ib) * 100 + iyz * 10 + offsV + 15000); |
| 844 | + } |
| 845 | + } |
| 846 | + } |
| 847 | + } |
808 | 848 | histm->write(); |
809 | 849 | } |
810 | 850 | delete gs; |
811 | 851 | } |
812 | 852 |
|
813 | 853 | void CheckResidSpec::drawHistos() |
814 | 854 | { |
815 | | - gROOT->SetBatch(true); |
| 855 | + // gROOT->SetBatch(true); |
816 | 856 | gStyle->SetTitleX(0.2); |
817 | 857 | gStyle->SetTitleY(0.88); |
818 | 858 | gStyle->SetTitleW(0.25); |
@@ -928,6 +968,8 @@ void CheckResidSpec::drawHistos() |
928 | 968 | } |
929 | 969 | TCanvas cly("cly", "", 600, 800), clz("clz", "", 600, 800), clpar("clpar", "", 600, 800); |
930 | 970 | TCanvas czly("czly", "", 600, 800), czlz("czlz", "", 600, 800), czlpar("czlpar", "", 600, 800); |
| 971 | + TCanvas cchip("cchip", "", 600, 800); |
| 972 | + constexpr std::array<const char*, 4> chipTitles{"#DeltaY", "pull #DeltaY", "#DeltaZ", "pull #DeltaZ"}; |
931 | 973 | auto AddLabel = [](const char* txt, float x = 0.1, float y = 0.9, int color = kBlack, float size = 0.04) { |
932 | 974 | TLatex* lt = new TLatex(x, y, txt); |
933 | 975 | lt->SetNDC(); |
@@ -1062,6 +1104,37 @@ void CheckResidSpec::drawHistos() |
1062 | 1104 | AddLabel("IB-OB tracks params differences at R = 12 cm", 0.2, 0.8); |
1063 | 1105 | czlpar.Print(Form("%s_hman.pdf", params.outname.c_str())); |
1064 | 1106 |
|
| 1107 | + for (int il = 1; il < 8; ++il) { |
| 1108 | + for (int ib = 0; ib < 2; ib++) { |
| 1109 | + cchip.Clear(); |
| 1110 | + cchip.Divide(1, 4); |
| 1111 | + for (int iv = 0; iv < 4; ++iv) { |
| 1112 | + cchip.cd(iv + 1); |
| 1113 | + const int iyz = iv / 2; |
| 1114 | + const float yRange = iyz == 0 ? params.resMMLrY[il] : params.resMMLrZ[il]; |
| 1115 | + int nh = this->mHManV.size(); |
| 1116 | + bool drawn = false; |
| 1117 | + for (int j = 0; j < nh; j++) { |
| 1118 | + auto hman = this->mHManV[j].get(); |
| 1119 | + const int id = 15000 + iyz * 10 + (2 * il + ib) * 100 + 1 + (iv % 2); |
| 1120 | + auto histo = hman->getHisto(id); |
| 1121 | + if (histo) { |
| 1122 | + histo->SetMaximum(yRange); |
| 1123 | + histo->SetMinimum((iv % 2) ? 0 : -yRange); |
| 1124 | + if (il > 3) { |
| 1125 | + histo->SetMarkerSize(0.3); |
| 1126 | + histo->SetLineStyle(3); |
| 1127 | + } |
| 1128 | + histo->Draw(drawn ? "same" : ""); |
| 1129 | + drawn = true; |
| 1130 | + } |
| 1131 | + } |
| 1132 | + gPad->SetGrid(); |
| 1133 | + } |
| 1134 | + cchip.Print(Form("%s_hman.pdf", params.outname.c_str())); |
| 1135 | + } |
| 1136 | + } |
| 1137 | + |
1065 | 1138 | cly.Print(Form("%s_hman.pdf]", params.outname.c_str())); |
1066 | 1139 | } |
1067 | 1140 |
|
|
0 commit comments