diff --git a/Detectors/GLOQC/CMakeLists.txt b/Detectors/GLOQC/CMakeLists.txt index 1aca89fee1579..cdb307a6515c8 100644 --- a/Detectors/GLOQC/CMakeLists.txt +++ b/Detectors/GLOQC/CMakeLists.txt @@ -15,18 +15,7 @@ o2_add_library(GLOQC SOURCES src/MatchITSTPCQC.cxx src/ITSTPCMatchingQCParams.cxx - PUBLIC_LINK_LIBRARIES O2::Framework - O2::DataFormatsTPC - O2::DataFormatsITS - O2::SimConfig - O2::DataFormatsGlobalTracking - O2::MathUtils - O2::SimulationDataFormat - O2::ReconstructionDataFormats - O2::Steer - O2::GlobalTracking - O2::DCAFitter - O2::DetectorsVertexing) + PUBLIC_LINK_LIBRARIES O2::DetectorsVertexing) o2_target_root_dictionary(GLOQC HEADERS include/GLOQC/MatchITSTPCQC.h diff --git a/Detectors/GLOQC/include/GLOQC/MatchITSTPCQC.h b/Detectors/GLOQC/include/GLOQC/MatchITSTPCQC.h index 47261886da279..bfc9977c2af5c 100644 --- a/Detectors/GLOQC/include/GLOQC/MatchITSTPCQC.h +++ b/Detectors/GLOQC/include/GLOQC/MatchITSTPCQC.h @@ -130,7 +130,7 @@ class MatchITSTPCQC TH1D* getHisto1OverPtPhysPrimDen(matchType m) const { return m1OverPtPhysPrimDen[m]; } TEfficiency* getFractionITSTPCmatchPhysPrim1OverPt(matchType m) const { return mFractionITSTPCmatchPhysPrim1OverPt[m]; } - TH1F* getHistoK0Mass() const { return mK0Mass; } + TH2F* getHistoK0MassVsPt() const { return mK0MassVsPt; } void getHistos(TObjArray& objar); @@ -227,7 +227,9 @@ class MatchITSTPCQC publisher->startPublishing(mDCArVsPtNum); publisher->startPublishing(mDCArVsPtDen); publisher->startPublishing(mFractionITSTPCmatchDCArVsPt); - publisher->startPublishing(mK0Mass); + if (mDoK0QC) { + publisher->startPublishing(mK0MassVsPt); + } } void setSources(GID::mask_t src) { mSrc = src; } @@ -387,7 +389,7 @@ class MatchITSTPCQC // for V0s o2::vertexing::DCAFitterN<2> mFitterV0; - TH1F* mK0Mass = nullptr; + TH2F* mK0MassVsPt = nullptr; bool mDoK0QC = false; // whether to fill the K0 QC plot(s) float mCutK0Mass = 0.05; // cut on the difference between the K0 mass and the PDG mass bool mRefit = false; // whether to refit or not diff --git a/Detectors/GLOQC/src/MatchITSTPCQC.cxx b/Detectors/GLOQC/src/MatchITSTPCQC.cxx index 61ad6d181eee1..3d7d63c23c59f 100644 --- a/Detectors/GLOQC/src/MatchITSTPCQC.cxx +++ b/Detectors/GLOQC/src/MatchITSTPCQC.cxx @@ -86,21 +86,19 @@ void MatchITSTPCQC::deleteHistograms() delete mChi2VsPtDen[i]; delete mFractionITSTPCmatchChi2VsPt[i]; - if (mUseTrkPID) { // Vs Tracking PID hypothesis - for (int j = 0; j < o2::track::PID::NIDs; ++j) { - // Pt - delete mPtNumVsTrkPID[i][j]; - delete mPtDenVsTrkPID[i][j]; - delete mFractionITSTPCmatchPtVsTrkPID[i][j]; - // Phi - delete mPhiNumVsTrkPID[i][j]; - delete mPhiDenVsTrkPID[i][j]; - delete mFractionITSTPCmatchPhiVsTrkPID[i][j]; - // Eta - delete mEtaNumVsTrkPID[i][j]; - delete mEtaDenVsTrkPID[i][j]; - delete mFractionITSTPCmatchEtaVsTrkPID[i][j]; - } + for (int j = 0; j < o2::track::PID::NIDs; ++j) { + // Pt + delete mPtNumVsTrkPID[i][j]; + delete mPtDenVsTrkPID[i][j]; + delete mFractionITSTPCmatchPtVsTrkPID[i][j]; + // Phi + delete mPhiNumVsTrkPID[i][j]; + delete mPhiDenVsTrkPID[i][j]; + delete mFractionITSTPCmatchPhiVsTrkPID[i][j]; + // Eta + delete mEtaNumVsTrkPID[i][j]; + delete mEtaDenVsTrkPID[i][j]; + delete mFractionITSTPCmatchEtaVsTrkPID[i][j]; } // 1/Pt @@ -126,9 +124,7 @@ void MatchITSTPCQC::deleteHistograms() delete mFractionITSTPCmatchDCArVsPt; // K0 - if (mDoK0QC) { - delete mK0Mass; - } + delete mK0MassVsPt; } //__________________________________________________________ @@ -209,7 +205,7 @@ void MatchITSTPCQC::reset() // K0 if (mDoK0QC) { - mK0Mass->Reset(); + mK0MassVsPt->Reset(); } } @@ -381,7 +377,7 @@ bool MatchITSTPCQC::init() if (mDoK0QC) { // V0s - mK0Mass = new TH1F("mK0Mass", "K0 invariant mass", 100, 0.3, 0.7); + mK0MassVsPt = new TH2F("mK0MassVsPt", "K0 invariant mass vs Pt", 100, 0.3, 0.7, 100, 0.f, 20.f); } return true; @@ -404,9 +400,7 @@ void MatchITSTPCQC::initDataRequest() } mDataRequest = std::make_shared(); - LOG(info) << "Requesting tracks..."; mDataRequest->requestTracks(mSrc, mUseMC); - LOG(info) << "... done requesting tracks"; if (mDoK0QC) { mDataRequest->requestPrimaryVertices(mUseMC); mDataRequest->requestSecondaryVertices(mUseMC); @@ -418,8 +412,6 @@ void MatchITSTPCQC::initDataRequest() void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) { - LOG(info) << "Starting"; - // Getting the B field mBz = o2::base::Propagator::Instance()->getNominalBz(); @@ -905,7 +897,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) if (mDoK0QC) { // now doing K0S - const auto pvertices = ctx.inputs().get>("pvtx"); + const auto pvertices = mRecoCont.getPrimaryVertices(); LOG(info) << "Found " << pvertices.size() << " primary vertices"; auto v0IDs = mRecoCont.getV0sIdx(); @@ -959,7 +951,7 @@ bool MatchITSTPCQC::processV0(int iv, o2::globaltracking::RecoContainer& recoDat if (mCutK0Mass > 0 && std::abs(std::sqrt(v0sel.calcMass2AsK0()) - 0.497) > mCutK0Mass) { return false; } - mK0Mass->Fill(std::sqrt(v0sel.calcMass2AsK0())); + mK0MassVsPt->Fill(std::sqrt(v0sel.calcMass2AsK0()), v0sel.getPt()); return true; } @@ -1232,5 +1224,5 @@ void MatchITSTPCQC::getHistos(TObjArray& objar) objar.Add(mFractionITSTPCmatchDCArVsPt); // V0 - objar.Add(mK0Mass); + objar.Add(mK0MassVsPt); }