Skip to content

Commit

Permalink
First round of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chiarazampolli committed Jun 11, 2024
1 parent a9e5335 commit 5c9a864
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 42 deletions.
13 changes: 1 addition & 12 deletions Detectors/GLOQC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions Detectors/GLOQC/include/GLOQC/MatchITSTPCQC.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -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
Expand Down
46 changes: 19 additions & 27 deletions Detectors/GLOQC/src/MatchITSTPCQC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -126,9 +124,7 @@ void MatchITSTPCQC::deleteHistograms()
delete mFractionITSTPCmatchDCArVsPt;

// K0
if (mDoK0QC) {
delete mK0Mass;
}
delete mK0MassVsPt;
}

//__________________________________________________________
Expand Down Expand Up @@ -209,7 +205,7 @@ void MatchITSTPCQC::reset()

// K0
if (mDoK0QC) {
mK0Mass->Reset();
mK0MassVsPt->Reset();
}
}

Expand Down Expand Up @@ -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;
Expand All @@ -404,9 +400,7 @@ void MatchITSTPCQC::initDataRequest()
}

mDataRequest = std::make_shared<o2::globaltracking::DataRequest>();
LOG(info) << "Requesting tracks...";
mDataRequest->requestTracks(mSrc, mUseMC);
LOG(info) << "... done requesting tracks";
if (mDoK0QC) {
mDataRequest->requestPrimaryVertices(mUseMC);
mDataRequest->requestSecondaryVertices(mUseMC);
Expand All @@ -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();

Expand Down Expand Up @@ -905,7 +897,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)

if (mDoK0QC) {
// now doing K0S
const auto pvertices = ctx.inputs().get<gsl::span<o2::dataformats::PrimaryVertex>>("pvtx");
const auto pvertices = mRecoCont.getPrimaryVertices();
LOG(info) << "Found " << pvertices.size() << " primary vertices";

auto v0IDs = mRecoCont.getV0sIdx();
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -1232,5 +1224,5 @@ void MatchITSTPCQC::getHistos(TObjArray& objar)
objar.Add(mFractionITSTPCmatchDCArVsPt);

// V0
objar.Add(mK0Mass);
objar.Add(mK0MassVsPt);
}

0 comments on commit 5c9a864

Please sign in to comment.