diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchITSTPCQC.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchITSTPCQC.h index 1c21ee528f371..93ffc155a07e0 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchITSTPCQC.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchITSTPCQC.h @@ -47,11 +47,10 @@ struct LblInfo { class MatchITSTPCQC { public: - enum matchType : int { TPC = 0, - ITS, - SIZE }; - + ITS, + SIZE }; + MatchITSTPCQC() = default; ~MatchITSTPCQC(); @@ -150,11 +149,11 @@ class MatchITSTPCQC bool mUseMC = false; float mBz = 0; ///< nominal Bz std::array, matchType::SIZE> mMapLabels; // map with labels that have been found for the matched ITSTPC tracks; key is the label, - // value is the LbLinfo with the id of the track with the highest pT found with that label so far, - // and the flag to say if it is a physical primary or not + // value is the LbLinfo with the id of the track with the highest pT found with that label so far, + // and the flag to say if it is a physical primary or not std::array, matchType::SIZE> mMapRefLabels; // map with labels that have been found for the unmatched TPC tracks; key is the label, - // value is the LblInfo with the id of the track with the highest number of TPC clusters found - // with that label so far, and the flag to say if it is a physical primary or not + // value is the LblInfo with the id of the track with the highest number of TPC clusters found + // with that label so far, and the flag to say if it is a physical primary or not o2::steer::MCKinematicsReader mcReader; // reader of MC information // Pt @@ -203,7 +202,7 @@ class MatchITSTPCQC TH1D* m1OverPtPhysPrimNum[matchType::SIZE] = {}; TH1D* m1OverPtPhysPrimDen[matchType::SIZE] = {}; TEfficiency* mFractionITSTPCmatchPhysPrim1OverPt[matchType::SIZE] = {}; - + void setEfficiency(TEfficiency* eff, TH1* hnum, TH1* hden, bool is2D = false); int mNTPCSelectedTracks = 0; diff --git a/Detectors/GlobalTracking/src/MatchITSTPCQC.cxx b/Detectors/GlobalTracking/src/MatchITSTPCQC.cxx index 717b56d6c799f..7f21d6b6793a8 100644 --- a/Detectors/GlobalTracking/src/MatchITSTPCQC.cxx +++ b/Detectors/GlobalTracking/src/MatchITSTPCQC.cxx @@ -134,7 +134,7 @@ void MatchITSTPCQC::reset() bool MatchITSTPCQC::init() { - std::array title{ "TPC", "ITS" }; + std::array title{"TPC", "ITS"}; for (int i = 0; i < matchType::SIZE; ++i) { // Pt mPtNum[i] = new TH1D(Form("mPtNum_%s", title[i].c_str()), Form("Pt distribution of ITSTPC matched tracks, wrt %s tracks; Pt [GeV/c]; dNdPt", title[i].c_str()), 100, 0.f, 20.f); @@ -161,7 +161,7 @@ bool MatchITSTPCQC::init() m1OverPtNum[i] = new TH1D(Form("m1OverPtNum_%s", title[i].c_str()), Form("1/Pt distribution of matched tracks, wrt %s tracks; 1/Pt [c/GeV]; dNdPt", title[i].c_str()), 100, 0.f, 20.f); m1OverPtDen[i] = new TH1D(Form("m1OverPtDen_%s", title[i].c_str()), Form("1/Pt distribution of %s tracks; 1/Pt [c/GeV]; dNdPt", title[i].c_str()), 100, 0.f, 20.f); mFractionITSTPCmatch1OverPt[i] = new TEfficiency(Form("mFractionITSTPCmatch1OverPt_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs 1/Pt, wrt %s tracks; 1/Pt [c/GeV]; Eff", title[i].c_str()), 100, 0.f, 20.f); - + // These will be empty in case of no MC info... mPhiPhysPrimNum[i] = new TH1F(Form("mPhiPhysPrimNum", title[i].c_str()), Form("Phi distribution of matched tracks (physical primary), wrt %s tracks; Phi [rad]; dNdPhi", title[i].c_str()), 100, 0.f, 2 * TMath::Pi()); mPhiPhysPrimDen[i] = new TH1F(Form("mPhiPhysPrimDen", title[i].c_str()), Form("Phi distribution of %s tracks (physical primary); Phi [rad]; dNdPhi", title[i].c_str()), 100, 0.f, 2 * TMath::Pi()); @@ -170,7 +170,7 @@ bool MatchITSTPCQC::init() mEtaPhysPrimDen[i] = new TH1F(Form("mEtaPhysPrimDen", title[i].c_str()), Form("Eta distribution of %s tracks (physical primary); Eta; dNdEta", title[i].c_str()), 100, -2.f, 2.f); mFractionITSTPCmatchEtaPhysPrim[i] = new TEfficiency(Form("mFractionITSTPCmatchEtaPhysPrim", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs Eta (physical primary), wrt %s tracks; Eta; Eff", title[i].c_str()), 100, -2.f, 2.f); } - + mResidualPt = new TH2F("mResidualPt", "Residuals of ITS-TPC matching in #it{p}_{T}; #it{p}_{T}^{ITS-TPC} [GeV/c]; #it{p}_{T}^{ITS-TPC} - #it{p}_{T}^{TPC} [GeV/c]", 100, 0.f, 20.f, 100, -1.f, 1.f); mResidualPhi = new TH2F("mResidualPhi", "Residuals of ITS-TPC matching in #it{#phi}; #it{#phi}^{ITS-TPC} [rad]; #it{#phi}^{ITS-TPC} - #it{#phi}^{TPC} [rad]", 100, 0.f, 2 * TMath::Pi(), 100, -1.f, 1.f); mResidualEta = new TH2F("mResidualEta", "Residuals of ITS-TPC matching in #it{#eta}; #it{#eta}^{ITS-TPC}; #it{#eta}^{ITS-TPC} - #it{#eta}^{TPC}", 100, -2.f, 2.f, 100, -1.f, 1.f); @@ -219,17 +219,17 @@ bool MatchITSTPCQC::init() mEtaPhysPrimDen[i]->Sumw2(); mEtaVsPtNum[i]->Sumw2(); mEtaVsPtDen[i]->Sumw2(); - + m1OverPtNum[i]->Sumw2(); m1OverPtDen[i]->Sumw2(); m1OverPtPhysPrimNum[i]->Sumw2(); m1OverPtPhysPrimDen[i]->Sumw2(); - + mPtNum_noEta0[i]->SetOption("logy"); mPtDen_noEta0[i]->SetOption("logy"); mPtNum[i]->SetOption("logy"); mPtDen[i]->SetOption("logy"); - + mPtNum[i]->GetYaxis()->SetTitleOffset(1.4); mPtDen[i]->GetYaxis()->SetTitleOffset(1.4); mPtNum_noEta0[i]->GetYaxis()->SetTitleOffset(1.4); @@ -241,7 +241,7 @@ bool MatchITSTPCQC::init() mChi2Matching->SetOption("logy"); mChi2Refit->SetOption("logy"); mTimeResVsPt->SetOption("colz logz logy logx"); - + mChi2Matching->GetYaxis()->SetTitleOffset(1.4); mChi2Refit->GetYaxis()->SetTitleOffset(1.4); mTimeResVsPt->GetYaxis()->SetTitleOffset(1.4); @@ -322,46 +322,46 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) auto idxTrkTpc = trk.getRefTPC().getIndex(); if (isTPCTrackSelectedEntry[idxTrkTpc] == true) { auto lbl = mRecoCont.getTrackMCLabel({(unsigned int)(itrk), GID::Source::ITSTPC}); - if (mMapLabels[matchType::TPC].find(lbl) == mMapLabels[matchType::TPC].end()) { + if (mMapLabels[matchType::TPC].find(lbl) == mMapLabels[matchType::TPC].end()) { int source = lbl.getSourceID(); int event = lbl.getEventID(); const std::vector& pcontainer = mcReader.getTracks(source, event); const o2::MCTrack& p = pcontainer[lbl.getTrackID()]; if (MCTrackNavigator::isPhysicalPrimary(p, pcontainer)) { - mMapLabels[matchType::TPC].insert({lbl, {itrk, true}}); + mMapLabels[matchType::TPC].insert({lbl, {itrk, true}}); } else { - mMapLabels[matchType::TPC].insert({lbl, {itrk, false}}); + mMapLabels[matchType::TPC].insert({lbl, {itrk, false}}); } } else { // winner (if more tracks have the same label) has the highest pt if (mITSTPCTracks[mMapLabels[matchType::TPC].at(lbl).mIdx].getPt() < trk.getPt()) { - mMapLabels[matchType::TPC].at(lbl).mIdx = itrk; + mMapLabels[matchType::TPC].at(lbl).mIdx = itrk; } } } auto idxTrkIts = trk.getRefITS().getIndex(); /* - if (trk.getRefITS().getSource() == GID::Source::ITSAB) { - // track from AfterBurner, skipping - continue; + if (trk.getRefITS().getSource() == GID::Source::ITSAB) { + // track from AfterBurner, skipping + continue; } */ if (isITSTrackSelectedEntry[idxTrkIts] == true) { auto lbl = mRecoCont.getTrackMCLabel({(unsigned int)(itrk), GID::Source::ITSTPC}); - if (mMapLabels[matchType::ITS].find(lbl) == mMapLabels[matchType::ITS].end()) { + if (mMapLabels[matchType::ITS].find(lbl) == mMapLabels[matchType::ITS].end()) { int source = lbl.getSourceID(); int event = lbl.getEventID(); const std::vector& pcontainer = mcReader.getTracks(source, event); const o2::MCTrack& p = pcontainer[lbl.getTrackID()]; if (MCTrackNavigator::isPhysicalPrimary(p, pcontainer)) { - mMapLabels[matchType::ITS].insert({lbl, {itrk, true}}); + mMapLabels[matchType::ITS].insert({lbl, {itrk, true}}); } else { - mMapLabels[matchType::ITS].insert({lbl, {itrk, false}}); + mMapLabels[matchType::ITS].insert({lbl, {itrk, false}}); } } else { // winner (if more tracks have the same label) has the highest pt if (mITSTPCTracks[mMapLabels[matchType::ITS].at(lbl).mIdx].getPt() < trk.getPt()) { - mMapLabels[matchType::ITS].at(lbl).mIdx = itrk; + mMapLabels[matchType::ITS].at(lbl).mIdx = itrk; } } } @@ -371,44 +371,44 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) // track selection and there are no duplicated tracks wrt the same MC label) for (int i = 0; i < matchType::SIZE; ++i) { for (auto const& el : mMapLabels[i]) { - auto const& trk = mITSTPCTracks[el.second.mIdx]; - o2::track::TrackParCov trkDen; - if (i == matchType::TPC) { - trkDen = mTPCTracks[trk.getRefTPC()]; - } else { - trkDen = mITSTracks[trk.getRefITS()]; - } - mPtNum[i]->Fill(trkDen.getPt()); - if (std::abs(trkDen.getEta()) > 0.05) { - mPtNum_noEta0[i]->Fill(trkDen.getPt()); - } - mPhiNum[i]->Fill(trkDen.getPhi()); - mPhiVsPtNum[i]->Fill(trkDen.getPt(), trkDen.getPhi()); - mEtaNum[i]->Fill(trkDen.getEta()); - mEtaVsPtNum[i]->Fill(trkDen.getPt(), trkDen.getEta()); - m1OverPtNum[i]->Fill(trkDen.getPtInv()); - // we fill also the denominator - mPtDen[i]->Fill(trkDen.getPt()); - if (std::abs(trkDen.getEta()) > 0.05) { - mPtDen_noEta0[i]->Fill(trkDen.getPt()); - } - mPhiDen[i]->Fill(trkDen.getPhi()); - mPhiVsPtDen[i]->Fill(trkDen.getPt(), trkDen.getPhi()); - mEtaDen[i]->Fill(trkDen.getEta()); - mEtaVsPtDen[i]->Fill(trkDen.getPt(), trkDen.getEta()); - m1OverPtDen[i]->Fill(trkDen.getPtInv()); - if (el.second.mIsPhysicalPrimary) { - mPtPhysPrimNum[i]->Fill(trkDen.getPt()); - mPhiPhysPrimNum[i]->Fill(trkDen.getPhi()); - mEtaPhysPrimNum[i]->Fill(trkDen.getEta()); - m1OverPtPhysPrimNum[i]->Fill(trkDen.getPtInv()); - // we fill also the denominator - mPtPhysPrimDen[i]->Fill(trkDen.getPt()); - mPhiPhysPrimDen[i]->Fill(trkDen.getPhi()); - mEtaPhysPrimDen[i]->Fill(trkDen.getEta()); - m1OverPtPhysPrimDen[i]->Fill(trkDen.getPtInv()); - } - ++mNITSTPCSelectedTracks[i]; + auto const& trk = mITSTPCTracks[el.second.mIdx]; + o2::track::TrackParCov trkDen; + if (i == matchType::TPC) { + trkDen = mTPCTracks[trk.getRefTPC()]; + } else { + trkDen = mITSTracks[trk.getRefITS()]; + } + mPtNum[i]->Fill(trkDen.getPt()); + if (std::abs(trkDen.getEta()) > 0.05) { + mPtNum_noEta0[i]->Fill(trkDen.getPt()); + } + mPhiNum[i]->Fill(trkDen.getPhi()); + mPhiVsPtNum[i]->Fill(trkDen.getPt(), trkDen.getPhi()); + mEtaNum[i]->Fill(trkDen.getEta()); + mEtaVsPtNum[i]->Fill(trkDen.getPt(), trkDen.getEta()); + m1OverPtNum[i]->Fill(trkDen.getPtInv()); + // we fill also the denominator + mPtDen[i]->Fill(trkDen.getPt()); + if (std::abs(trkDen.getEta()) > 0.05) { + mPtDen_noEta0[i]->Fill(trkDen.getPt()); + } + mPhiDen[i]->Fill(trkDen.getPhi()); + mPhiVsPtDen[i]->Fill(trkDen.getPt(), trkDen.getPhi()); + mEtaDen[i]->Fill(trkDen.getEta()); + mEtaVsPtDen[i]->Fill(trkDen.getPt(), trkDen.getEta()); + m1OverPtDen[i]->Fill(trkDen.getPtInv()); + if (el.second.mIsPhysicalPrimary) { + mPtPhysPrimNum[i]->Fill(trkDen.getPt()); + mPhiPhysPrimNum[i]->Fill(trkDen.getPhi()); + mEtaPhysPrimNum[i]->Fill(trkDen.getEta()); + m1OverPtPhysPrimNum[i]->Fill(trkDen.getPtInv()); + // we fill also the denominator + mPtPhysPrimDen[i]->Fill(trkDen.getPt()); + mPhiPhysPrimDen[i]->Fill(trkDen.getPhi()); + mEtaPhysPrimDen[i]->Fill(trkDen.getEta()); + m1OverPtPhysPrimDen[i]->Fill(trkDen.getPtInv()); + } + ++mNITSTPCSelectedTracks[i]; } } } @@ -420,66 +420,64 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) if (trk.getRefITS().getIndex() >= mITSTracks.size()) { LOG(fatal) << "******************** ATTENTION! for ITS track associated to matched track: idx = " << trk.getRefITS().getIndex() << ", size of container = " << mITSTracks.size() << " in TF " << evCount; } - std::array title{ "TPC", "ITS" }; - for (int i = 0; i < matchType::SIZE; ++i) { + std::array title{"TPC", "ITS"}; + for (int i = 0; i < matchType::SIZE; ++i) { o2::track::TrackParCov trkRef; int idxTrkRef; bool fillHisto = false; if (i == matchType::TPC) { - trkRef = mTPCTracks[trk.getRefTPC()]; - idxTrkRef = trk.getRefTPC().getIndex(); - if (isTPCTrackSelectedEntry[idxTrkRef] == true) { - fillHisto = true; - ++mNITSTPCSelectedTracks[i]; - } + trkRef = mTPCTracks[trk.getRefTPC()]; + idxTrkRef = trk.getRefTPC().getIndex(); + if (isTPCTrackSelectedEntry[idxTrkRef] == true) { + fillHisto = true; + ++mNITSTPCSelectedTracks[i]; + } } else { - trkRef = mITSTracks[trk.getRefITS()]; - idxTrkRef = trk.getRefITS().getIndex(); - LOG(debug) << "Checking track (ITS) with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " and pt = " << trkRef.getPt(); - if (trk.getRefITS().getSource() == GID::ITSAB) { - // do not use afterburner tracks - LOG(debug) << "Track (ITS) with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " is from afterburner"; - continue; - } - if (isITSTrackSelectedEntry[idxTrkRef] == true) { - LOG(debug) << "Track was selected (ITS), with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " , we keep it in the numerator, pt = " << trkRef.getPt(); - fillHisto = true; - ++mNITSTPCSelectedTracks[i]; - } - else { - LOG(debug) << "Track was not selected (ITS), with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " , we don't keep it in the numerator, pt = " << trkRef.getPt(); - } + trkRef = mITSTracks[trk.getRefITS()]; + idxTrkRef = trk.getRefITS().getIndex(); + LOG(debug) << "Checking track (ITS) with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " and pt = " << trkRef.getPt(); + if (trk.getRefITS().getSource() == GID::ITSAB) { + // do not use afterburner tracks + LOG(debug) << "Track (ITS) with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " is from afterburner"; + continue; + } + if (isITSTrackSelectedEntry[idxTrkRef] == true) { + LOG(debug) << "Track was selected (ITS), with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " , we keep it in the numerator, pt = " << trkRef.getPt(); + fillHisto = true; + ++mNITSTPCSelectedTracks[i]; + } else { + LOG(debug) << "Track was not selected (ITS), with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " , we don't keep it in the numerator, pt = " << trkRef.getPt(); + } } if (fillHisto == true) { - if (!mUseMC) { - LOG(debug) << "Filling num (" << title[i] << ") with track with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " with pt = " << trkRef.getPt(); - mPtNum[i]->Fill(trkRef.getPt()); - if (std::abs(trkRef.getEta()) > 0.05) { - mPtNum_noEta0[i]->Fill(trkRef.getPt()); - } - mPhiNum[i]->Fill(trkRef.getPhi()); - mPhiVsPtNum[i]->Fill(trkRef.getPt(), trkRef.getPhi()); - mEtaNum[i]->Fill(trkRef.getEta()); - mEtaVsPtNum[i]->Fill(trkRef.getPt(), trkRef.getEta()); - m1OverPtNum[i]->Fill(trkRef.getPtInv()); - } - if (i == matchType::TPC) { - mResidualPt->Fill(trk.getPt(), trk.getPt() - trkRef.getPt()); - mResidualPhi->Fill(trk.getPhi(), trk.getPhi() - trkRef.getPhi()); - mResidualEta->Fill(trk.getEta(), trk.getEta() - trkRef.getEta()); - mChi2Matching->Fill(trk.getChi2Match()); - mChi2Refit->Fill(trk.getChi2Refit()); - mTimeResVsPt->Fill(trkRef.getPt(), trk.getTimeMUS().getTimeStampError()); - math_utils::Point3D v{}; - std::array dca; - if (trkRef.propagateParamToDCA(v, mBz, &dca)) { - mDCAr->Fill(dca[0]); - } - LOG(debug) << "*** chi2Matching = " << trk.getChi2Match() << ", chi2refit = " << trk.getChi2Refit() << ", timeResolution = " << trk.getTimeMUS().getTimeStampError(); - } - } - else { - LOG(debug) << "Not filling num (" << title[i] << ") for ITSTPC track " << iITSTPC << " for track with pt " << trkRef.getPt(); + if (!mUseMC) { + LOG(debug) << "Filling num (" << title[i] << ") with track with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " with pt = " << trkRef.getPt(); + mPtNum[i]->Fill(trkRef.getPt()); + if (std::abs(trkRef.getEta()) > 0.05) { + mPtNum_noEta0[i]->Fill(trkRef.getPt()); + } + mPhiNum[i]->Fill(trkRef.getPhi()); + mPhiVsPtNum[i]->Fill(trkRef.getPt(), trkRef.getPhi()); + mEtaNum[i]->Fill(trkRef.getEta()); + mEtaVsPtNum[i]->Fill(trkRef.getPt(), trkRef.getEta()); + m1OverPtNum[i]->Fill(trkRef.getPtInv()); + } + if (i == matchType::TPC) { + mResidualPt->Fill(trk.getPt(), trk.getPt() - trkRef.getPt()); + mResidualPhi->Fill(trk.getPhi(), trk.getPhi() - trkRef.getPhi()); + mResidualEta->Fill(trk.getEta(), trk.getEta() - trkRef.getEta()); + mChi2Matching->Fill(trk.getChi2Match()); + mChi2Refit->Fill(trk.getChi2Refit()); + mTimeResVsPt->Fill(trkRef.getPt(), trk.getTimeMUS().getTimeStampError()); + math_utils::Point3D v{}; + std::array dca; + if (trkRef.propagateParamToDCA(v, mBz, &dca)) { + mDCAr->Fill(dca[0]); + } + LOG(debug) << "*** chi2Matching = " << trk.getChi2Match() << ", chi2refit = " << trk.getChi2Refit() << ", timeResolution = " << trk.getTimeMUS().getTimeStampError(); + } + } else { + LOG(debug) << "Not filling num (" << title[i] << ") for ITSTPC track " << iITSTPC << " for track with pt " << trkRef.getPt(); } } ++iITSTPC; @@ -555,7 +553,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) auto const& trk = mTPCTracks[el.second.mIdx]; mPtDen[matchType::TPC]->Fill(trk.getPt()); if (std::abs(trk.getEta()) > 0.05) { - mPtDen_noEta0[matchType::TPC]->Fill(trk.getPt()); + mPtDen_noEta0[matchType::TPC]->Fill(trk.getPt()); } mPhiDen[matchType::TPC]->Fill(trk.getPhi()); mPhiVsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getPhi()); @@ -574,7 +572,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) auto const& trk = mITSTracks[el.second.mIdx]; mPtDen[matchType::ITS]->Fill(trk.getPt()); if (std::abs(trk.getEta()) > 0.05) { - mPtDen_noEta0[matchType::ITS]->Fill(trk.getPt()); + mPtDen_noEta0[matchType::ITS]->Fill(trk.getPt()); } mPhiDen[matchType::ITS]->Fill(trk.getPhi()); mPhiVsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getPhi()); @@ -594,12 +592,12 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) for (size_t itrk = 0; itrk < mTPCTracks.size(); ++itrk) { auto const& trk = mTPCTracks[itrk]; if (isTPCTrackSelectedEntry[itrk] == true) { - LOG(debug) << "Filling den (TPC) with track with pt = " << trk.getPt(); + LOG(debug) << "Filling den (TPC) with track with pt = " << trk.getPt(); mPtDen[matchType::TPC]->Fill(trk.getPt()); - if (std::abs(trk.getEta()) > 0.05) { - mPtDen_noEta0[matchType::TPC]->Fill(trk.getPt()); - } - mPhiDen[matchType::TPC]->Fill(trk.getPhi()); + if (std::abs(trk.getEta()) > 0.05) { + mPtDen_noEta0[matchType::TPC]->Fill(trk.getPt()); + } + mPhiDen[matchType::TPC]->Fill(trk.getPhi()); mPhiVsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getPhi()); mEtaDen[matchType::TPC]->Fill(trk.getEta()); mEtaVsPtDen[matchType::TPC]->Fill(trk.getPt(), trk.getEta()); @@ -611,20 +609,19 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) auto const& trk = mITSTracks[itrk]; LOG(debug) << "Checking den for track (ITS) " << itrk << " with pt " << trk.getPt(); if (isITSTrackSelectedEntry[itrk] == true) { - LOG(debug) << "Filling den for track (ITS) " << itrk << " with pt = " << trk.getPt(); + LOG(debug) << "Filling den for track (ITS) " << itrk << " with pt = " << trk.getPt(); mPtDen[matchType::ITS]->Fill(trk.getPt()); - if (std::abs(trk.getEta()) > 0.05) { - mPtDen_noEta0[matchType::ITS]->Fill(trk.getPt()); - } - mPhiDen[matchType::ITS]->Fill(trk.getPhi()); + if (std::abs(trk.getEta()) > 0.05) { + mPtDen_noEta0[matchType::ITS]->Fill(trk.getPt()); + } + mPhiDen[matchType::ITS]->Fill(trk.getPhi()); mPhiVsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getPhi()); mEtaDen[matchType::ITS]->Fill(trk.getEta()); mEtaVsPtDen[matchType::ITS]->Fill(trk.getPt(), trk.getEta()); m1OverPtDen[matchType::ITS]->Fill(trk.getPtInv()); ++mNITSSelectedTracks; - } - else { - LOG(debug) << "Not filling for this track (ITS) " << itrk << " with pt = " << trk.getPt(); + } else { + LOG(debug) << "Not filling for this track (ITS) " << itrk << " with pt = " << trk.getPt(); } } } @@ -660,7 +657,7 @@ bool MatchITSTPCQC::selectTrack(o2::tpc::TrackTPC const& track) void MatchITSTPCQC::finalize() { - std::array title{ "TPC", "ITS" }; + std::array title{"TPC", "ITS"}; // first we use denominators and nominators to set the TEfficiency; later they are scaled @@ -668,22 +665,22 @@ void MatchITSTPCQC::finalize() for (int i = 0; i < matchType::SIZE; ++i) { for (int i = 0; i < mPtDen[i]->GetNbinsX(); ++i) { if (mPtDen[i]->GetBinContent(i + 1) < mPtNum[i]->GetBinContent(i + 1)) { - LOG(error) << title[i] << ": bin " << i + 1 << " in [" << mPtNum[i]->GetBinLowEdge(i + 1) << " , " << mPtNum[i]->GetBinLowEdge(i + 1) + mPtNum[i]->GetBinWidth(i + 1) << "]: mPtDen[i] = " << mPtDen[i]->GetBinContent(i + 1) << ", mPtNum[i] = " << mPtNum[i]->GetBinContent(i + 1); + LOG(error) << title[i] << ": bin " << i + 1 << " in [" << mPtNum[i]->GetBinLowEdge(i + 1) << " , " << mPtNum[i]->GetBinLowEdge(i + 1) + mPtNum[i]->GetBinWidth(i + 1) << "]: mPtDen[i] = " << mPtDen[i]->GetBinContent(i + 1) << ", mPtNum[i] = " << mPtNum[i]->GetBinContent(i + 1); } } for (int i = 0; i < mPtDen_noEta0[i]->GetNbinsX(); ++i) { if (mPtDen_noEta0[i]->GetBinContent(i + 1) < mPtNum_noEta0[i]->GetBinContent(i + 1)) { - LOG(error) << title[i] << ": bin " << i + 1 << " in [" << mPtNum_noEta0[i]->GetBinLowEdge(i + 1) << " , " << mPtNum_noEta0[i]->GetBinLowEdge(i + 1) + mPtNum_noEta0[i]->GetBinWidth(i + 1) << "]: mPtDen_noEta0[i] = " << mPtDen_noEta0[i]->GetBinContent(i + 1) << ", mPtNum_noEta0[i] = " << mPtNum_noEta0[i]->GetBinContent(i + 1); + LOG(error) << title[i] << ": bin " << i + 1 << " in [" << mPtNum_noEta0[i]->GetBinLowEdge(i + 1) << " , " << mPtNum_noEta0[i]->GetBinLowEdge(i + 1) + mPtNum_noEta0[i]->GetBinWidth(i + 1) << "]: mPtDen_noEta0[i] = " << mPtDen_noEta0[i]->GetBinContent(i + 1) << ", mPtNum_noEta0[i] = " << mPtNum_noEta0[i]->GetBinContent(i + 1); } } for (int i = 0; i < mPhiDen[i]->GetNbinsX(); ++i) { if (mPhiDen[i]->GetBinContent(i + 1) < mPhiNum[i]->GetBinContent(i + 1)) { - LOG(error) << title[i] << ": bin " << i + 1 << " in [" << mPhiNum[i]->GetBinLowEdge(i + 1) << " , " << mPhiNum[i]->GetBinLowEdge(i + 1) + mPhiNum[i]->GetBinWidth(i + 1) <<"]: mPhiDen[i] = " << mPhiDen[i]->GetBinContent(i + 1) << ", mPhiNum[i] = " << mPhiNum[i]->GetBinContent(i + 1); + LOG(error) << title[i] << ": bin " << i + 1 << " in [" << mPhiNum[i]->GetBinLowEdge(i + 1) << " , " << mPhiNum[i]->GetBinLowEdge(i + 1) + mPhiNum[i]->GetBinWidth(i + 1) << "]: mPhiDen[i] = " << mPhiDen[i]->GetBinContent(i + 1) << ", mPhiNum[i] = " << mPhiNum[i]->GetBinContent(i + 1); } } for (int i = 0; i < mEtaDen[i]->GetNbinsX(); ++i) { if (mEtaDen[i]->GetBinContent(i + 1) < mEtaNum[i]->GetBinContent(i + 1)) { - LOG(error) << title[i] << ": bin " << i + 1 << " in [" << mEtaNum[i]->GetBinLowEdge(i + 1) << " , " << mEtaNum[i]->GetBinLowEdge(i + 1) + mEtaNum[i]->GetBinWidth(i + 1) <<"]: mEtaDen[i] = " << mEtaDen[i]->GetBinContent(i + 1) << ", mEtaNum[i] = " << mEtaNum[i]->GetBinContent(i + 1); + LOG(error) << title[i] << ": bin " << i + 1 << " in [" << mEtaNum[i]->GetBinLowEdge(i + 1) << " , " << mEtaNum[i]->GetBinLowEdge(i + 1) + mEtaNum[i]->GetBinWidth(i + 1) << "]: mEtaDen[i] = " << mEtaDen[i]->GetBinContent(i + 1) << ", mEtaNum[i] = " << mEtaNum[i]->GetBinContent(i + 1); } } @@ -768,7 +765,7 @@ void MatchITSTPCQC::getHistos(TObjArray& objar) objar.Add(mPtNum[i]); objar.Add(mPtDen[i]); objar.Add(mFractionITSTPCmatch[i]); - + objar.Add(mPtNum_noEta0[i]); objar.Add(mPtDen_noEta0[i]); objar.Add(mFractionITSTPCmatch_noEta0[i]); @@ -776,7 +773,7 @@ void MatchITSTPCQC::getHistos(TObjArray& objar) objar.Add(mPtPhysPrimNum[i]); objar.Add(mPtPhysPrimDen[i]); objar.Add(mFractionITSTPCmatchPhysPrim[i]); - + objar.Add(mPhiNum[i]); objar.Add(mPhiDen[i]); objar.Add(mFractionITSTPCmatchPhi[i]); @@ -796,7 +793,7 @@ void MatchITSTPCQC::getHistos(TObjArray& objar) objar.Add(mEtaPhysPrimNum[i]); objar.Add(mEtaPhysPrimDen[i]); objar.Add(mFractionITSTPCmatchEtaPhysPrim[i]); - + objar.Add(mEtaVsPtNum[i]); objar.Add(mEtaVsPtDen[i]); objar.Add(mFractionITSTPCmatchEtaVsPt[i]); @@ -808,7 +805,6 @@ void MatchITSTPCQC::getHistos(TObjArray& objar) objar.Add(m1OverPtPhysPrimNum[i]); objar.Add(m1OverPtPhysPrimDen[i]); objar.Add(mFractionITSTPCmatchPhysPrim1OverPt[i]); - } objar.Add(mChi2Matching); objar.Add(mChi2Refit);