diff --git a/Detectors/CMakeLists.txt b/Detectors/CMakeLists.txt index a7cbccc7f0be8..eef692ff18ca7 100644 --- a/Detectors/CMakeLists.txt +++ b/Detectors/CMakeLists.txt @@ -36,6 +36,7 @@ add_subdirectory(FOCAL) add_subdirectory(GlobalTracking) add_subdirectory(GlobalTrackingWorkflow) add_subdirectory(Vertexing) +add_subdirectory(GLOQC) if(BUILD_ANALYSIS) add_subdirectory(AOD) diff --git a/Detectors/GLOQC/CMakeLists.txt b/Detectors/GLOQC/CMakeLists.txt new file mode 100644 index 0000000000000..1aca89fee1579 --- /dev/null +++ b/Detectors/GLOQC/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright 2019-2020 CERN and copyright holders of ALICE O2. +# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +# All rights not expressly granted are reserved. +# +# This software is distributed under the terms of the GNU General Public +# License v3 (GPL Version 3), copied verbatim in the file "COPYING". +# +# In applying this license CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization +# or submit itself to any jurisdiction. +# add_compile_options(-O0 -g -fPIC) + +o2_add_library(GLOQC + TARGETVARNAME targetName + 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) + +o2_target_root_dictionary(GLOQC + HEADERS include/GLOQC/MatchITSTPCQC.h + include/GLOQC/ITSTPCMatchingQCParams.h + +) + + diff --git a/Detectors/GlobalTracking/include/GlobalTracking/ITSTPCMatchingQCParams.h b/Detectors/GLOQC/include/GLOQC/ITSTPCMatchingQCParams.h similarity index 92% rename from Detectors/GlobalTracking/include/GlobalTracking/ITSTPCMatchingQCParams.h rename to Detectors/GLOQC/include/GLOQC/ITSTPCMatchingQCParams.h index 652525fce12ab..001996feb4c69 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/ITSTPCMatchingQCParams.h +++ b/Detectors/GLOQC/include/GLOQC/ITSTPCMatchingQCParams.h @@ -19,7 +19,7 @@ namespace o2 { -namespace globaltracking +namespace gloqc { // There are configurable params for TPC-ITS matching @@ -30,11 +30,13 @@ struct ITSTPCMatchingQCParams : public o2::conf::ConfigurableParamHelper #include @@ -27,6 +27,7 @@ #include "SimulationDataFormat/MCTrack.h" #include "Steer/MCKinematicsReader.h" #include "ReconstructionDataFormats/PID.h" +#include "DCAFitter/DCAFitterN.h" #include #include #include @@ -35,7 +36,7 @@ namespace o2 { -namespace globaltracking +namespace gloqc { using GID = o2::dataformats::GlobalTrackID; @@ -62,6 +63,8 @@ class MatchITSTPCQC void setDataRequest(const std::shared_ptr& dr) { mDataRequest = dr; } void finalize(); void reset(); + bool processV0(int iv, o2::globaltracking::RecoContainer& recoData); + bool refitV0(const o2::dataformats::V0Index& id, o2::dataformats::V0& v0, o2::globaltracking::RecoContainer& recoData); TH1D* getHistoPtNum(matchType m) const { return mPtNum[m]; } TH1D* getHistoPtDen(matchType m) const { return mPtDen[m]; } @@ -127,6 +130,8 @@ class MatchITSTPCQC TH1D* getHisto1OverPtPhysPrimDen(matchType m) const { return m1OverPtPhysPrimDen[m]; } TEfficiency* getFractionITSTPCmatchPhysPrim1OverPt(matchType m) const { return mFractionITSTPCmatchPhysPrim1OverPt[m]; } + TH1F* getHistoK0Mass() const { return mK0Mass; } + void getHistos(TObjArray& objar); /// \brief Publishes the histograms to the publisher e.g. the one provided by the QC task @@ -222,6 +227,7 @@ class MatchITSTPCQC publisher->startPublishing(mDCArVsPtNum); publisher->startPublishing(mDCArVsPtDen); publisher->startPublishing(mFractionITSTPCmatchDCArVsPt); + publisher->startPublishing(mK0Mass); } void setSources(GID::mask_t src) { mSrc = src; } @@ -231,6 +237,8 @@ class MatchITSTPCQC bool getUseMC() const { return mUseMC; } void deleteHistograms(); void setBz(float bz) { mBz = bz; } + void setDoK0QC(bool v) { mDoK0QC = v; } + bool getDoK0QC() const { return mDoK0QC; } // ITS track void setMinPtITSCut(float v) { mPtITSCut = v; }; @@ -255,11 +263,16 @@ class MatchITSTPCQC void setMaxPtCut(float v) { mPtMaxCut = v; } void setEtaCut(float v) { mEtaCut = v; } // TODO: define 2 different values for min and max (*) + // K0 + void setMaxK0Eta(float v) { mMaxEtaK0 = v; } + void setRefitK0(bool v) { mRefit = v; } + void setCutK0Mass(bool v) { mCutK0Mass = v; } + private: std::shared_ptr mDataRequest; o2::globaltracking::RecoContainer mRecoCont; GID::mask_t mSrc = GID::getSourcesMask("ITS,TPC,ITS-TPC"); - GID::mask_t mAllowedSources = GID::getSourcesMask("ITS,TPC,ITS-TPC"); + GID::mask_t mAllowedSources = GID::getSourcesMask("ITS,TPC,ITS-TPC,ITS-TPC-TOF,TPC-TOF,TPC-TRD,ITS-TPC-TRD,TPC-TRD-TOF,ITS-TPC-TOF,ITS-TPC-TRD-TOF"); // TPC gsl::span mTPCTracks; // ITS @@ -372,9 +385,18 @@ class MatchITSTPCQC float mEtaCut = 1e10f; // 1e10f as defaults of Detectors/GlobalTracking/include/GlobalTracking/TrackCuts.h // TODO: define 2 different values for min and max (*) - ClassDefNV(MatchITSTPCQC, 2); + // for V0s + o2::vertexing::DCAFitterN<2> mFitterV0; + TH1F* mK0Mass = 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 + float mMaxEtaK0 = 0.8; // cut on the K0 eta + long int mTimestamp = -1; // timestamp used to load the SVertexParam object: if differnt from -1, we don't load (it means we already did it) + + ClassDefNV(MatchITSTPCQC, 3); }; -} // namespace globaltracking +} // namespace gloqc } // namespace o2 #endif diff --git a/Detectors/GLOQC/src/GLOQCLinkDef.h b/Detectors/GLOQC/src/GLOQCLinkDef.h new file mode 100644 index 0000000000000..bc9ae2534de27 --- /dev/null +++ b/Detectors/GLOQC/src/GLOQCLinkDef.h @@ -0,0 +1,20 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#ifdef __CLING__ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::gloqc::ITSTPCMatchingQCParams> + ; + +#endif diff --git a/Detectors/GlobalTracking/src/ITSTPCMatchingQCParams.cxx b/Detectors/GLOQC/src/ITSTPCMatchingQCParams.cxx similarity index 85% rename from Detectors/GlobalTracking/src/ITSTPCMatchingQCParams.cxx rename to Detectors/GLOQC/src/ITSTPCMatchingQCParams.cxx index 103aa874abb90..b5c9f6842dfc3 100644 --- a/Detectors/GlobalTracking/src/ITSTPCMatchingQCParams.cxx +++ b/Detectors/GLOQC/src/ITSTPCMatchingQCParams.cxx @@ -12,5 +12,5 @@ /// \file ITSTPCMatchingQCParams.h /// \brief Configurable params for ITSTPC matching QC -#include "GlobalTracking/ITSTPCMatchingQCParams.h" -O2ParamImpl(o2::globaltracking::ITSTPCMatchingQCParams); +#include "GLOQC/ITSTPCMatchingQCParams.h" +O2ParamImpl(o2::gloqc::ITSTPCMatchingQCParams); diff --git a/Detectors/GlobalTracking/src/MatchITSTPCQC.cxx b/Detectors/GLOQC/src/MatchITSTPCQC.cxx similarity index 91% rename from Detectors/GlobalTracking/src/MatchITSTPCQC.cxx rename to Detectors/GLOQC/src/MatchITSTPCQC.cxx index 440bda85813a3..61ad6d181eee1 100644 --- a/Detectors/GlobalTracking/src/MatchITSTPCQC.cxx +++ b/Detectors/GLOQC/src/MatchITSTPCQC.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "GlobalTracking/MatchITSTPCQC.h" +#include "GLOQC/MatchITSTPCQC.h" #include "ReconstructionDataFormats/TrackTPCITS.h" #include "DataFormatsTPC/TrackTPC.h" #include "Framework/InputSpec.h" @@ -20,8 +20,14 @@ #include "TGraphAsymmErrors.h" #include "GlobalTracking/TrackCuts.h" #include - -using namespace o2::globaltracking; +#include "ReconstructionDataFormats/PrimaryVertex.h" +#include "ReconstructionDataFormats/V0.h" +// #include "GlobalTrackingStudy/V0Ext.h" +#include "DetectorsVertexing/SVertexerParams.h" +#include "Framework/InputRecord.h" +#include "Framework/TimingInfo.h" + +using namespace o2::gloqc; using namespace o2::mcutils; using MCTrack = o2::MCTrackT; @@ -118,6 +124,11 @@ void MatchITSTPCQC::deleteHistograms() delete mDCArVsPtNum; delete mDCArVsPtDen; delete mFractionITSTPCmatchDCArVsPt; + + // K0 + if (mDoK0QC) { + delete mK0Mass; + } } //__________________________________________________________ @@ -195,6 +206,11 @@ void MatchITSTPCQC::reset() mDCAr->Reset(); mDCArVsPtNum->Reset(); mDCArVsPtDen->Reset(); + + // K0 + if (mDoK0QC) { + mK0Mass->Reset(); + } } //__________________________________________________________ @@ -363,6 +379,11 @@ bool MatchITSTPCQC::init() } } + if (mDoK0QC) { + // V0s + mK0Mass = new TH1F("mK0Mass", "K0 invariant mass", 100, 0.3, 0.7); + } + return true; } @@ -373,6 +394,9 @@ void MatchITSTPCQC::initDataRequest() // initialize data request, if it was not already done + if (mDoK0QC) { + mSrc = GID::getSourcesMask("ITS,TPC,ITS-TPC,ITS-TPC-TOF,TPC-TOF,TPC-TRD,ITS-TPC-TRD,TPC-TRD-TOF,ITS-TPC-TOF,ITS-TPC-TRD-TOF"); + } mSrc &= mAllowedSources; if (mSrc[GID::Source::ITSTPC] == 0 || mSrc[GID::Source::TPC] == 0 || mSrc[GID::Source::ITS] == 0) { @@ -380,7 +404,13 @@ 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); + } } //__________________________________________________________ @@ -388,9 +418,18 @@ void MatchITSTPCQC::initDataRequest() void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) { + LOG(info) << "Starting"; + // Getting the B field mBz = o2::base::Propagator::Instance()->getNominalBz(); + // Getting the SVertexer config params + if (mTimestamp == -1 && mDoK0QC) { + // we have not yet initialized the SVertexer params; let's do it + ctx.inputs().get("SVParam"); + mTimestamp = ctx.services().get().creation; + } + static int evCount = 0; mRecoCont.collectData(ctx, *mDataRequest.get()); mTPCTracks = mRecoCont.getTPCTracks(); @@ -863,9 +902,112 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) } } } + + if (mDoK0QC) { + // now doing K0S + const auto pvertices = ctx.inputs().get>("pvtx"); + LOG(info) << "Found " << pvertices.size() << " primary vertices"; + + auto v0IDs = mRecoCont.getV0sIdx(); + auto nv0 = v0IDs.size(); + if (nv0 > mRecoCont.getV0s().size()) { + mRefit = true; + } + LOG(info) << "Found " << mRecoCont.getV0s().size() << " V0s in reco container"; + LOG(info) << "Found " << nv0 << " V0s ids"; + // associating sec vtxs to prim vtx + std::map> pv2sv; + static int tfID = 0; + for (int iv = 0; iv < nv0; iv++) { + const auto v0id = v0IDs[iv]; + pv2sv[v0id.getVertexID()].push_back(iv); + } + int nV0sOk = 0; + // processing every sec vtx for each prim vtx + for (auto it : pv2sv) { + int pvID = it.first; + auto& vv = it.second; + if (pvID < 0 || vv.size() == 0) { + continue; + } + for (int iv0 : vv) { + nV0sOk += processV0(iv0, mRecoCont) ? 1 : 0; + } + } + + LOG(info) << "Processed " << nV0sOk << " V0s"; + } evCount++; } +//__________________________________________________________ +bool MatchITSTPCQC::processV0(int iv, o2::globaltracking::RecoContainer& recoData) +{ + o2::dataformats::V0 v0; + auto v0s = recoData.getV0s(); + auto v0IDs = recoData.getV0sIdx(); + static int tfID = 0; + + const auto& v0id = v0IDs[iv]; + if (mRefit && !refitV0(v0id, v0, recoData)) { + return false; + } + const auto& v0sel = mRefit ? v0 : v0s[iv]; + if (mMaxEtaK0 < std::abs(v0sel.getEta())) { + return false; + } + if (mCutK0Mass > 0 && std::abs(std::sqrt(v0sel.calcMass2AsK0()) - 0.497) > mCutK0Mass) { + return false; + } + mK0Mass->Fill(std::sqrt(v0sel.calcMass2AsK0())); + return true; +} + +//__________________________________________________________ +bool MatchITSTPCQC::refitV0(const o2::dataformats::V0Index& id, o2::dataformats::V0& v0, o2::globaltracking::RecoContainer& recoData) +{ + auto seedP = recoData.getTrackParam(id.getProngID(0)); + auto seedN = recoData.getTrackParam(id.getProngID(1)); + bool isTPConly = (id.getProngID(0).getSource() == o2::dataformats::GlobalTrackID::TPC) || (id.getProngID(1).getSource() == o2::dataformats::GlobalTrackID::TPC); + const auto& svparam = o2::vertexing::SVertexerParams::Instance(); + if (svparam.mTPCTrackPhotonTune && isTPConly) { + mFitterV0.setMaxDZIni(svparam.mTPCTrackMaxDZIni); + mFitterV0.setMaxDXYIni(svparam.mTPCTrackMaxDXYIni); + mFitterV0.setMaxChi2(svparam.mTPCTrackMaxChi2); + mFitterV0.setCollinear(true); + } + int nCand = mFitterV0.process(seedP, seedN); + if (svparam.mTPCTrackPhotonTune && isTPConly) { // restore + // Reset immediately to the defaults + mFitterV0.setMaxDZIni(svparam.maxDZIni); + mFitterV0.setMaxDXYIni(svparam.maxDXYIni); + mFitterV0.setMaxChi2(svparam.maxChi2); + mFitterV0.setCollinear(false); + } + if (nCand == 0) { // discard this pair + return false; + } + const int cand = 0; + if (!mFitterV0.isPropagateTracksToVertexDone(cand) && !mFitterV0.propagateTracksToVertex(cand)) { + return false; + } + const auto& trPProp = mFitterV0.getTrack(0, cand); + const auto& trNProp = mFitterV0.getTrack(1, cand); + std::array pP{}, pN{}; + trPProp.getPxPyPzGlo(pP); + trNProp.getPxPyPzGlo(pN); + std::array pV0 = {pP[0] + pN[0], pP[1] + pN[1], pP[2] + pN[2]}; + auto p2V0 = pV0[0] * pV0[0] + pV0[1] * pV0[1] + pV0[2] * pV0[2]; + const auto& pv = recoData.getPrimaryVertex(id.getVertexID()); + const auto v0XYZ = mFitterV0.getPCACandidatePos(cand); + float dx = v0XYZ[0] - pv.getX(), dy = v0XYZ[1] - pv.getY(), dz = v0XYZ[2] - pv.getZ(), prodXYZv0 = dx * pV0[0] + dy * pV0[1] + dz * pV0[2]; + float cosPA = prodXYZv0 / std::sqrt((dx * dx + dy * dy + dz * dz) * p2V0); + new (&v0) o2::dataformats::V0(v0XYZ, pV0, mFitterV0.calcPCACovMatrixFlat(cand), trPProp, trNProp); + v0.setDCA(mFitterV0.getChi2AtPCACandidate(cand)); + v0.setCosPA(cosPA); + return true; +} + //__________________________________________________________ void MatchITSTPCQC::finalize() { @@ -1088,4 +1230,7 @@ void MatchITSTPCQC::getHistos(TObjArray& objar) objar.Add(mDCArVsPtNum); objar.Add(mDCArVsPtDen); objar.Add(mFractionITSTPCmatchDCArVsPt); + + // V0 + objar.Add(mK0Mass); } diff --git a/Detectors/GlobalTracking/CMakeLists.txt b/Detectors/GlobalTracking/CMakeLists.txt index cc62bac02a1cb..92862c874b8ac 100644 --- a/Detectors/GlobalTracking/CMakeLists.txt +++ b/Detectors/GlobalTracking/CMakeLists.txt @@ -20,8 +20,6 @@ o2_add_library(GlobalTracking src/MatchCosmicsParams.cxx src/MatchGlobalFwd.cxx src/MatchGlobalFwdAssessment.cxx - src/MatchITSTPCQC.cxx - src/ITSTPCMatchingQCParams.cxx src/MatchGlobalFwdParam.cxx src/MatchTOFParams.cxx PUBLIC_LINK_LIBRARIES O2::Framework @@ -63,8 +61,6 @@ o2_target_root_dictionary(GlobalTracking include/GlobalTracking/MatchHMP.h include/GlobalTracking/MatchCosmics.h include/GlobalTracking/MatchCosmicsParams.h - include/GlobalTracking/MatchITSTPCQC.h - include/GlobalTracking/ITSTPCMatchingQCParams.h include/GlobalTracking/TrackMethods.h include/GlobalTracking/TrackCuts.h) diff --git a/Detectors/GlobalTracking/src/GlobalTrackingLinkDef.h b/Detectors/GlobalTracking/src/GlobalTrackingLinkDef.h index cd463aedf963e..fddc0096c7ccf 100644 --- a/Detectors/GlobalTracking/src/GlobalTrackingLinkDef.h +++ b/Detectors/GlobalTracking/src/GlobalTrackingLinkDef.h @@ -29,8 +29,6 @@ #pragma link C++ class o2::globaltracking::MatchTOFParams + ; #pragma link C++ class o2::conf::ConfigurableParamHelper < o2::globaltracking::MatchTOFParams> + ; -#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::globaltracking::ITSTPCMatchingQCParams> + ; - #pragma link C++ class o2::globaltracking::GloFwdAssessment + ; #pragma link C++ class o2::globaltracking::GlobalFwdMatchingParam + ; diff --git a/Detectors/GlobalTrackingWorkflow/CMakeLists.txt b/Detectors/GlobalTrackingWorkflow/CMakeLists.txt index 6b0c5a7285c15..1f530f30d238a 100644 --- a/Detectors/GlobalTrackingWorkflow/CMakeLists.txt +++ b/Detectors/GlobalTrackingWorkflow/CMakeLists.txt @@ -49,6 +49,7 @@ o2_add_library(GlobalTrackingWorkflow O2::SimulationDataFormat O2::DetectorsVertexing O2::StrangenessTracking) + o2_add_executable(driver-workflow COMPONENT_NAME reader SOURCES src/reader-driver-workflow.cxx diff --git a/Detectors/GlobalTrackingWorkflow/qc/CMakeLists.txt b/Detectors/GlobalTrackingWorkflow/qc/CMakeLists.txt index 4a72fb8cede77..45a66f8ce5b82 100644 --- a/Detectors/GlobalTrackingWorkflow/qc/CMakeLists.txt +++ b/Detectors/GlobalTrackingWorkflow/qc/CMakeLists.txt @@ -14,6 +14,7 @@ o2_add_library(GlobalTrackingWorkflowQC PUBLIC_LINK_LIBRARIES O2::DataFormatsGlobalTracking O2::GlobalTracking ROOT::Core + O2::GLOQC ) o2_add_executable(match-qc diff --git a/Detectors/GlobalTrackingWorkflow/qc/include/GlobalTrackingWorkflowQC/ITSTPCMatchingQCSpec.h b/Detectors/GlobalTrackingWorkflow/qc/include/GlobalTrackingWorkflowQC/ITSTPCMatchingQCSpec.h index 48d96921287c6..1d76add46839a 100644 --- a/Detectors/GlobalTrackingWorkflow/qc/include/GlobalTrackingWorkflowQC/ITSTPCMatchingQCSpec.h +++ b/Detectors/GlobalTrackingWorkflow/qc/include/GlobalTrackingWorkflowQC/ITSTPCMatchingQCSpec.h @@ -17,7 +17,7 @@ #include "Framework/DataProcessorSpec.h" #include "Framework/Task.h" -#include "GlobalTracking/MatchITSTPCQC.h" +#include "GLOQC/MatchITSTPCQC.h" #include "DetectorsBase/GRPGeomHelper.h" using namespace o2::framework; @@ -29,7 +29,7 @@ namespace globaltracking class ITSTPCMatchingQCDevice : public Task { public: - ITSTPCMatchingQCDevice(std::shared_ptr dr, std::shared_ptr req, bool useMC) : mDataRequest(dr), mCCDBRequest(req), mUseMC(useMC){}; + ITSTPCMatchingQCDevice(std::shared_ptr dr, std::shared_ptr req, bool useMC, bool doK0QC) : mDataRequest(dr), mCCDBRequest(req), mUseMC(useMC), mDoK0QC(doK0QC){}; void init(o2::framework::InitContext& ic) final; void run(o2::framework::ProcessingContext& pc) final; void endOfStream(o2::framework::EndOfStreamContext& ec) final; @@ -37,17 +37,18 @@ class ITSTPCMatchingQCDevice : public Task private: void sendOutput(DataAllocator& output); - std::unique_ptr mMatchITSTPCQC; + std::unique_ptr mMatchITSTPCQC; std::shared_ptr mDataRequest; std::shared_ptr mCCDBRequest; bool mUseMC = true; + bool mDoK0QC = true; }; } // namespace globaltracking namespace framework { -DataProcessorSpec getITSTPCMatchingQCDevice(bool useMC); +DataProcessorSpec getITSTPCMatchingQCDevice(bool useMC, bool doK0QC); } // namespace framework } // namespace o2 diff --git a/Detectors/GlobalTrackingWorkflow/qc/src/ITSTPCMatchingQCSpec.cxx b/Detectors/GlobalTrackingWorkflow/qc/src/ITSTPCMatchingQCSpec.cxx index 7b48a6c30ffbc..9452c945435d9 100644 --- a/Detectors/GlobalTrackingWorkflow/qc/src/ITSTPCMatchingQCSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/qc/src/ITSTPCMatchingQCSpec.cxx @@ -15,7 +15,7 @@ #include "Framework/ConfigParamRegistry.h" #include "Framework/Logger.h" #include "GlobalTrackingWorkflowQC/ITSTPCMatchingQCSpec.h" -#include "GlobalTracking/ITSTPCMatchingQCParams.h" +#include "GLOQC/ITSTPCMatchingQCParams.h" #include "DataFormatsGlobalTracking/RecoContainer.h" #include "DetectorsBase/Propagator.h" @@ -31,9 +31,9 @@ namespace globaltracking void ITSTPCMatchingQCDevice::init(InitContext& /*ic*/) { - const o2::globaltracking::ITSTPCMatchingQCParams& params = o2::globaltracking::ITSTPCMatchingQCParams::Instance(); + const o2::gloqc::ITSTPCMatchingQCParams& params = o2::gloqc::ITSTPCMatchingQCParams::Instance(); - mMatchITSTPCQC = std::make_unique(); + mMatchITSTPCQC = std::make_unique(); mMatchITSTPCQC->init(); mMatchITSTPCQC->setDataRequest(mDataRequest); mMatchITSTPCQC->setPtCut(params.minPtCut); @@ -41,10 +41,15 @@ void ITSTPCMatchingQCDevice::init(InitContext& /*ic*/) mMatchITSTPCQC->setMinNTPCClustersCut(params.minNTPCClustersCut); mMatchITSTPCQC->setMinDCAtoBeamPipeDistanceCut(params.minDCACut); mMatchITSTPCQC->setMinDCAtoBeamPipeYCut(params.minDCACutY); + mMatchITSTPCQC->setCutK0Mass(params.cutK0Mass); + mMatchITSTPCQC->setMaxK0Eta(params.maxEtaK0); o2::base::GRPGeomHelper::instance().setRequest(mCCDBRequest); if (mUseMC) { mMatchITSTPCQC->setUseMC(mUseMC); } + if (mDoK0QC) { + mMatchITSTPCQC->setDoK0QC(mDoK0QC); + } } //_____________________________________________________________ @@ -94,7 +99,7 @@ namespace framework { using GID = o2::dataformats::GlobalTrackID; -DataProcessorSpec getITSTPCMatchingQCDevice(bool useMC) +DataProcessorSpec getITSTPCMatchingQCDevice(bool useMC, bool doK0QC) { std::vector outputs; outputs.emplace_back("GLO", "ITSTPCMATCHQC", 0, Lifetime::Sporadic); @@ -113,7 +118,7 @@ DataProcessorSpec getITSTPCMatchingQCDevice(bool useMC) "itstpc-matching-qc", dataRequest->inputs, outputs, - AlgorithmSpec{adaptFromTask(dataRequest, ccdbRequest, useMC)}, + AlgorithmSpec{adaptFromTask(dataRequest, ccdbRequest, useMC, doK0QC)}, Options{{}}}; } diff --git a/Detectors/GlobalTrackingWorkflow/qc/src/itstpc-matching-qc-workflow.cxx b/Detectors/GlobalTrackingWorkflow/qc/src/itstpc-matching-qc-workflow.cxx index 16bd2d78d77e2..8ed9774a38b1a 100644 --- a/Detectors/GlobalTrackingWorkflow/qc/src/itstpc-matching-qc-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/qc/src/itstpc-matching-qc-workflow.cxx @@ -21,6 +21,7 @@ void customize(std::vector& workflowOptions) // option allowing to set parameters std::vector options{ {"disable-mc", o2::framework::VariantType::Bool, false, {"disable use of MC information even if available"}}, + {"disable-k0-qc", o2::framework::VariantType::Bool, false, {"disable K0 QC"}}, {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}}; std::swap(workflowOptions, options); } @@ -37,8 +38,10 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) o2::conf::ConfigurableParam::writeINI("o2-itstpc-matching-qc.ini"); LOG(info) << "ITSTPC matching QC: disable-mc = " << configcontext.options().get("disable-mc"); auto useMC = !configcontext.options().get("disable-mc"); + LOG(info) << "ITSTPC matching QC: disable-k0-qc = " << configcontext.options().get("disable-k0-qc"); + auto doK0QC = !configcontext.options().get("disable-k0-qc"); WorkflowSpec specs; - specs.emplace_back(getITSTPCMatchingQCDevice(useMC)); + specs.emplace_back(getITSTPCMatchingQCDevice(useMC, doK0QC)); return specs; }