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
14261462void MatchITSTPCQC::printParams () const
0 commit comments