Skip to content

Commit 7c61fb8

Browse files
committed
GLOQC: Add PV contrib vs ITS tracks
1 parent 6d9bad5 commit 7c61fb8

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

Detectors/GLOQC/include/GLOQC/MatchITSTPCQC.h

Lines changed: 11 additions & 1 deletion
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,8 @@ class MatchITSTPCQC
144145
TH3F* getHistoK0MassVsPtVsOccpp() const { return mK0MassVsPtVsOccpp; }
145146
TH3F* getHistoK0MassVsPtVsOccPbPb() const { return mK0MassVsPtVsOccPbPb; }
146147

148+
auto getHistoPVNContVsITSTracks() const { return mPVNContVsITSTracks; }
149+
147150
void getHistos(TObjArray& objar);
148151

149152
/// \brief Publishes the histograms to the publisher e.g. the one provided by the QC task
@@ -247,6 +250,8 @@ class MatchITSTPCQC
247250
publisher->startPublishing(mK0MassVsPtVsOccpp);
248251
publisher->startPublishing(mK0MassVsPtVsOccPbPb);
249252
}
253+
254+
publisher->startPublishing(mPVNContVsITSTracks);
250255
}
251256

252257
void setTrkSources(GID::mask_t src) { mSrc = src; }
@@ -315,6 +320,8 @@ class MatchITSTPCQC
315320
gsl::span<const o2::its::TrackITS> mITSTracks;
316321
// ITS-TPC
317322
gsl::span<const o2::dataformats::TrackTPCITS> mITSTPCTracks;
323+
// PVs
324+
gsl::span<const o2::dataformats::PrimaryVertex> mPVs;
318325
bool mUseMC = false; // Usage of the MC information
319326
bool mUseTrkPID = false; // Usage of the PID hypothesis in tracking
320327
float mBz = 0; ///< nominal Bz
@@ -457,7 +464,10 @@ class MatchITSTPCQC
457464
float mK0MaxDCA = 0.01; // max DCA to select the K0
458465
float mK0MinCosPA = 0.995; // min cosPA to select the K0
459466

460-
ClassDefNV(MatchITSTPCQC, 4);
467+
// for Mutliplicty PV
468+
TH2F* mPVNContVsITSTracks{nullptr};
469+
470+
ClassDefNV(MatchITSTPCQC, 5);
461471
};
462472
} // namespace gloqc
463473
} // namespace o2

Detectors/GLOQC/src/MatchITSTPCQC.cxx

Lines changed: 39 additions & 3 deletions
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,9 @@ void MatchITSTPCQC::deleteHistograms()
133134
// K0
134135
delete mK0MassVsPtVsOccpp;
135136
delete mK0MassVsPtVsOccPbPb;
137+
138+
// PV
139+
delete mPVNContVsITSTracks;
136140
}
137141

138142
//__________________________________________________________
@@ -220,6 +224,8 @@ void MatchITSTPCQC::reset()
220224
mK0MassVsPtVsOccpp->Reset();
221225
mK0MassVsPtVsOccPbPb->Reset();
222226
}
227+
228+
mPVNContVsITSTracks->Reset();
223229
}
224230

225231
//__________________________________________________________
@@ -440,6 +446,24 @@ bool MatchITSTPCQC::init()
440446
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);
441447
}
442448

449+
Double_t* xbinsPV = new Double_t[100 + 1];
450+
Double_t xlogminPV = TMath::Log10(1);
451+
Double_t xlogmaxPV = TMath::Log10(10000);
452+
Double_t dlogxPV = (xlogmaxPV - xlogminPV) / 100;
453+
for (int i = 0; i <= 100; i++) {
454+
Double_t xlogPV = xlogminPV + i * dlogxPV;
455+
xbinsPV[i] = TMath::Exp(TMath::Log(10) * xlogPV);
456+
}
457+
Double_t* xbinsITS = new Double_t[100 + 1];
458+
Double_t xlogminITS = TMath::Log10(1);
459+
Double_t xlogmaxITS = TMath::Log10(15000);
460+
Double_t dlogxITS = (xlogmaxITS - xlogminITS) / 100;
461+
for (int i = 0; i <= 100; i++) {
462+
Double_t xlogITS = xlogminITS + i * dlogxITS;
463+
xbinsITS[i] = TMath::Exp(TMath::Log(10) * xlogITS);
464+
}
465+
mPVNContVsITSTracks = new TH2F("mPVNContVsITSTracks", "PV NCont. vs ITS Tracks;PV NCont.;ITS Tracks", 100, xbinsPV, 100, xbinsITS);
466+
443467
LOG(info) << "Printing configuration cuts";
444468
printParams();
445469

@@ -448,6 +472,8 @@ bool MatchITSTPCQC::init()
448472
delete[] ybinsMassK0;
449473
delete[] zbinsMultK0pp;
450474
delete[] zbinsMultK0PbPb;
475+
delete[] xbinsPV;
476+
delete[] xbinsITS;
451477

452478
return true;
453479
}
@@ -516,10 +542,19 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
516542
mTPCTracks = mRecoCont.getTPCTracks();
517543
mITSTracks = mRecoCont.getITSTracks();
518544
mITSTPCTracks = mRecoCont.getTPCITSTracks();
545+
mPVs = mRecoCont.getPrimaryVertices();
519546

520547
LOG(info) << "****** Number of found ITSTPC tracks = " << mITSTPCTracks.size();
521548
LOG(info) << "****** Number of found TPC tracks = " << mTPCTracks.size();
522549
LOG(info) << "****** Number of found ITS tracks = " << mITSTracks.size();
550+
LOG(info) << "****** Number of PVs = " << mPVs.size();
551+
552+
const auto& pvm = mRecoCont.getPrimaryVertexMatchedTrackRefs();
553+
for (int i{0}; i < mPVs.size(); ++i) {
554+
const auto& pv = mPVs[i];
555+
const auto& m = pvm[i];
556+
mPVNContVsITSTracks->Fill(pv.getNContributors(), m.getEntriesOfSource(dataformats::GlobalTrackID::ITS));
557+
}
523558

524559
// cache selection for TPC and ITS tracks
525560
std::vector<bool> isTPCTrackSelectedEntry(mTPCTracks.size(), false);
@@ -991,11 +1026,9 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
9911026
}
9921027
}
9931028

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

10001033
// getting occupancy estimator
10011034
mNHBPerTF = o2::base::GRPGeomHelper::instance().getGRPECS()->getNHBFPerTF();
@@ -1421,6 +1454,9 @@ void MatchITSTPCQC::getHistos(TObjArray& objar)
14211454
// V0
14221455
objar.Add(mK0MassVsPtVsOccpp);
14231456
objar.Add(mK0MassVsPtVsOccPbPb);
1457+
1458+
// PV Multiplicity
1459+
objar.Add(mPVNContVsITSTracks);
14241460
}
14251461

14261462
void MatchITSTPCQC::printParams() const

Detectors/GlobalTrackingWorkflow/qc/src/ITSTPCMatchingQCSpec.cxx

Lines changed: 1 addition & 0 deletions
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)