Skip to content

Commit 3594f9f

Browse files
committed
GLOQC: Add PV contrib vs ITS tracks
Signed-off-by: Felix Schlepper <[email protected]>
1 parent 6d9bad5 commit 3594f9f

File tree

3 files changed

+60
-4
lines changed

3 files changed

+60
-4
lines changed

Detectors/GLOQC/include/GLOQC/MatchITSTPCQC.h

+14-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class MatchITSTPCQC
7474
bool processV0(int iv, o2::globaltracking::RecoContainer& recoData, std::vector<float>& mTBinClOcc, float pvTime);
7575
bool refitV0(const o2::dataformats::V0Index& id, o2::dataformats::V0& v0, o2::globaltracking::RecoContainer& recoData);
7676

77+
// returning raw pointer but this task keeps ownership!
7778
TH1D* getHistoPtNum(matchType m) const { return mPtNum[m]; }
7879
TH1D* getHistoPtDen(matchType m) const { return mPtDen[m]; }
7980
TEfficiency* getFractionITSTPCmatch(matchType m) const { return mFractionITSTPCmatch[m]; }
@@ -144,6 +145,9 @@ class MatchITSTPCQC
144145
TH3F* getHistoK0MassVsPtVsOccpp() const { return mK0MassVsPtVsOccpp; }
145146
TH3F* getHistoK0MassVsPtVsOccPbPb() const { return mK0MassVsPtVsOccPbPb; }
146147

148+
auto getHistoPVNContVsITSTracks() const { return mPVNContVsITSTracks; }
149+
auto getHistoPVNContVsITSTracksPbPb() const { return mPVNContVsITSTracksPbPb; }
150+
147151
void getHistos(TObjArray& objar);
148152

149153
/// \brief Publishes the histograms to the publisher e.g. the one provided by the QC task
@@ -247,6 +251,9 @@ class MatchITSTPCQC
247251
publisher->startPublishing(mK0MassVsPtVsOccpp);
248252
publisher->startPublishing(mK0MassVsPtVsOccPbPb);
249253
}
254+
255+
publisher->startPublishing(mPVNContVsITSTracks);
256+
publisher->startPublishing(mPVNContVsITSTracksPbPb);
250257
}
251258

252259
void setTrkSources(GID::mask_t src) { mSrc = src; }
@@ -315,6 +322,8 @@ class MatchITSTPCQC
315322
gsl::span<const o2::its::TrackITS> mITSTracks;
316323
// ITS-TPC
317324
gsl::span<const o2::dataformats::TrackTPCITS> mITSTPCTracks;
325+
// PVs
326+
gsl::span<const o2::dataformats::PrimaryVertex> mPVs;
318327
bool mUseMC = false; // Usage of the MC information
319328
bool mUseTrkPID = false; // Usage of the PID hypothesis in tracking
320329
float mBz = 0; ///< nominal Bz
@@ -457,7 +466,11 @@ class MatchITSTPCQC
457466
float mK0MaxDCA = 0.01; // max DCA to select the K0
458467
float mK0MinCosPA = 0.995; // min cosPA to select the K0
459468

460-
ClassDefNV(MatchITSTPCQC, 4);
469+
// for Mutliplicty PV
470+
TH2F* mPVNContVsITSTracks{nullptr};
471+
TH2F* mPVNContVsITSTracksPbPb{nullptr};
472+
473+
ClassDefNV(MatchITSTPCQC, 5);
461474
};
462475
} // namespace gloqc
463476
} // namespace o2

Detectors/GLOQC/src/MatchITSTPCQC.cxx

+45-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include "GLOQC/MatchITSTPCQC.h"
1515
#include "ReconstructionDataFormats/TrackTPCITS.h"
16+
#include "ReconstructionDataFormats/VtxTrackRef.h"
1617
#include "DataFormatsTPC/TrackTPC.h"
1718
#include "DetectorsBase/Propagator.h"
1819
#include "SimulationDataFormat/MCUtils.h"
@@ -133,6 +134,10 @@ void MatchITSTPCQC::deleteHistograms()
133134
// K0
134135
delete mK0MassVsPtVsOccpp;
135136
delete mK0MassVsPtVsOccPbPb;
137+
138+
// PV
139+
delete mPVNContVsITSTracks;
140+
delete mPVNContVsITSTracksPbPb;
136141
}
137142

138143
//__________________________________________________________
@@ -220,6 +225,9 @@ void MatchITSTPCQC::reset()
220225
mK0MassVsPtVsOccpp->Reset();
221226
mK0MassVsPtVsOccPbPb->Reset();
222227
}
228+
229+
mPVNContVsITSTracks->Reset();
230+
mPVNContVsITSTracksPbPb->Reset();
223231
}
224232

225233
//__________________________________________________________
@@ -440,6 +448,29 @@ bool MatchITSTPCQC::init()
440448
mK0MassVsPtVsOccPbPb = new TH3F("mK0MassVsPtVsOccPbPb", "K0 invariant mass vs Pt vs TPC occupancy; Pt [GeV/c]; K0s mass [GeV/c^2]; TPC occ", nbinsPtK0, xbinsPtK0, nbinsMassK0, ybinsMassK0, nbinsMultK0PbPb, zbinsMultK0PbPb);
441449
}
442450

451+
auto makeBins = [](int out) {
452+
std::array<Double_t, 101> xbins{0};
453+
Double_t xlogmin = TMath::Log10(1);
454+
Double_t xlogmax = TMath::Log10(out);
455+
Double_t dlogx = (xlogmax - xlogmin) / 100;
456+
for (int i = 0; i <= 100; i++) {
457+
Double_t xlog = xlogmin + (i * dlogx);
458+
xbins[i] = TMath::Exp(TMath::Log(10) * xlog);
459+
}
460+
return xbins;
461+
};
462+
463+
{
464+
auto xbinsPV = makeBins(250);
465+
auto xbinsITS = makeBins(500);
466+
mPVNContVsITSTracks = new TH2F("mPVNContVsITSTracks", "PV NCont. vs ITS Tracks;PV NCont.;ITS Tracks", 100, xbinsPV.data(), 100, xbinsITS.data());
467+
}
468+
{
469+
auto xbinsPV = makeBins(10'000);
470+
auto xbinsITS = makeBins(20'000);
471+
mPVNContVsITSTracksPbPb = new TH2F("mPVNContVsITSTracksPbPb", "PV NCont. vs ITS Tracks;PV NCont.;ITS Tracks", 100, xbinsPV.data(), 100, xbinsITS.data());
472+
}
473+
443474
LOG(info) << "Printing configuration cuts";
444475
printParams();
445476

@@ -516,10 +547,19 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
516547
mTPCTracks = mRecoCont.getTPCTracks();
517548
mITSTracks = mRecoCont.getITSTracks();
518549
mITSTPCTracks = mRecoCont.getTPCITSTracks();
550+
mPVs = mRecoCont.getPrimaryVertices();
519551

520552
LOG(info) << "****** Number of found ITSTPC tracks = " << mITSTPCTracks.size();
521553
LOG(info) << "****** Number of found TPC tracks = " << mTPCTracks.size();
522554
LOG(info) << "****** Number of found ITS tracks = " << mITSTracks.size();
555+
LOG(info) << "****** Number of PVs = " << mPVs.size();
556+
557+
const auto& pvm = mRecoCont.getPrimaryVertexMatchedTrackRefs();
558+
for (int i{0}; i < mPVs.size(); ++i) {
559+
const auto& pv = mPVs[i];
560+
const auto& m = pvm[i];
561+
((mIsHI) ? mPVNContVsITSTracksPbPb : mPVNContVsITSTracks)->Fill(pv.getNContributors(), mITSTracks.size());
562+
}
523563

524564
// cache selection for TPC and ITS tracks
525565
std::vector<bool> isTPCTrackSelectedEntry(mTPCTracks.size(), false);
@@ -991,11 +1031,9 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
9911031
}
9921032
}
9931033

994-
if (mDoK0QC && mRecoCont.getPrimaryVertices().size() > 0) {
1034+
if (mDoK0QC && mPVs.size() > 0) {
9951035
// now doing K0S
9961036
mFitterV0.setBz(mBz);
997-
const auto pvertices = mRecoCont.getPrimaryVertices();
998-
LOG(info) << "****** Number of PVs = " << pvertices.size();
9991037

10001038
// getting occupancy estimator
10011039
mNHBPerTF = o2::base::GRPGeomHelper::instance().getGRPECS()->getNHBFPerTF();
@@ -1421,6 +1459,10 @@ void MatchITSTPCQC::getHistos(TObjArray& objar)
14211459
// V0
14221460
objar.Add(mK0MassVsPtVsOccpp);
14231461
objar.Add(mK0MassVsPtVsOccPbPb);
1462+
1463+
// PV Multiplicity
1464+
objar.Add(mPVNContVsITSTracks);
1465+
objar.Add(mPVNContVsITSTracksPbPb);
14241466
}
14251467

14261468
void MatchITSTPCQC::printParams() const

Detectors/GlobalTrackingWorkflow/qc/src/ITSTPCMatchingQCSpec.cxx

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ void ITSTPCMatchingQCDevice::init(InitContext& /*ic*/)
3737
mMatchITSTPCQC = std::make_unique<o2::gloqc::MatchITSTPCQC>();
3838
mMatchITSTPCQC->setDataRequest(mDataRequest);
3939
mMatchITSTPCQC->setTrkSources(o2::dataformats::GlobalTrackID::getSourcesMask(mTrkSources));
40+
mMatchITSTPCQC->setNBinsPt(params.nBinsPt);
4041
mMatchITSTPCQC->setMinPtITSCut(params.minPtITSCut);
4142
mMatchITSTPCQC->setEtaITSCut(params.etaITSCut);
4243
mMatchITSTPCQC->setMinNClustersITS(params.minNITSClustersCut);

0 commit comments

Comments
 (0)