99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111
12+ #include < algorithm>
13+
1214#include " GLOQC/MatchITSTPCQC.h"
1315#include " ReconstructionDataFormats/TrackTPCITS.h"
1416#include " DataFormatsTPC/TrackTPC.h"
15- #include " Framework/InputSpec.h"
16- #include " ReconstructionDataFormats/TrackParametrization.h"
1717#include " DetectorsBase/Propagator.h"
1818#include " SimulationDataFormat/MCUtils.h"
19- #include < algorithm>
20- #include " TGraphAsymmErrors.h"
2119#include " GlobalTracking/TrackCuts.h"
2220#include < DetectorsBase/GRPGeomHelper.h>
2321#include < TEfficiency.h>
2422#include " ReconstructionDataFormats/PrimaryVertex.h"
2523#include " ReconstructionDataFormats/V0.h"
26- // #include "GlobalTrackingStudy/V0Ext.h"
2724#include " DetectorsVertexing/SVertexerParams.h"
2825#include " Framework/InputRecord.h"
2926#include " Framework/TimingInfo.h"
3027#include " GPUO2InterfaceUtils.h"
3128#include " CommonConstants/LHCConstants.h"
32- #include " DataFormatsTPC/Constants.h"
3329#include " DetectorsCommonDataFormats/DetID.h"
34-
3530#include " GPUO2InterfaceRefit.h"
3631
3732using namespace o2 ::gloqc;
@@ -41,7 +36,6 @@ using DetID = o2::detectors::DetID;
4136
4237MatchITSTPCQC::~MatchITSTPCQC ()
4338{
44-
4539 deleteHistograms ();
4640}
4741
@@ -467,7 +461,7 @@ void MatchITSTPCQC::initDataRequest()
467461
468462 mSrc &= mAllowedSources ;
469463
470- if (mSrc [GID::Source::ITSTPC] == 0 || mSrc [GID::Source::TPC] == 0 || mSrc [GID::Source::ITS] == 0 ) {
464+ if (! mSrc [GID::Source::ITSTPC] || ! mSrc [GID::Source::TPC] || ! mSrc [GID::Source::ITS]) {
471465 LOG (fatal) << " We cannot do ITSTPC QC, some sources are missing, check sources in " << mSrc ;
472466 }
473467
@@ -518,7 +512,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
518512 }
519513
520514 static int evCount = 0 ;
521- mRecoCont .collectData (ctx, *mDataRequest . get () );
515+ mRecoCont .collectData (ctx, *mDataRequest );
522516 mTPCTracks = mRecoCont .getTPCTracks ();
523517 mITSTracks = mRecoCont .getITSTracks ();
524518 mITSTPCTracks = mRecoCont .getTPCITSTracks ();
@@ -581,7 +575,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
581575 if (trk.getRefITS ().getSource () != GID::ITS) {
582576 continue ;
583577 }
584- if (isTPCTrackSelectedEntry[idxTrkTpc] == true ) {
578+ if (isTPCTrackSelectedEntry[idxTrkTpc]) {
585579 auto lbl = mRecoCont .getTrackMCLabel ({(unsigned int )(itrk), GID::Source::ITSTPC});
586580 if (!lbl.isValid ()) {
587581 continue ;
@@ -592,9 +586,9 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
592586 const std::vector<o2::MCTrack>& pcontainer = mcReader.getTracks (source, event);
593587 const o2::MCTrack& p = pcontainer[lbl.getTrackID ()];
594588 if (MCTrackNavigator::isPhysicalPrimary (p, pcontainer)) {
595- mMapLabels [matchType::TPC].insert ({lbl, {itrk, true }});
589+ mMapLabels [matchType::TPC].insert ({lbl, {. mIdx = itrk, . mIsPhysicalPrimary = true }});
596590 } else {
597- mMapLabels [matchType::TPC].insert ({lbl, {itrk, false }});
591+ mMapLabels [matchType::TPC].insert ({lbl, {. mIdx = itrk, . mIsPhysicalPrimary = false }});
598592 }
599593 } else {
600594 // winner (if more tracks have the same label) has the highest pt
@@ -604,7 +598,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
604598 }
605599 }
606600 auto idxTrkIts = trk.getRefITS ().getIndex ();
607- if (isITSTrackSelectedEntry[idxTrkIts] == true ) {
601+ if (isITSTrackSelectedEntry[idxTrkIts]) {
608602 auto lbl = mRecoCont .getTrackMCLabel ({(unsigned int )(itrk), GID::Source::ITSTPC});
609603 if (!lbl.isValid ()) {
610604 continue ;
@@ -615,9 +609,9 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
615609 const std::vector<o2::MCTrack>& pcontainer = mcReader.getTracks (source, event);
616610 const o2::MCTrack& p = pcontainer[lbl.getTrackID ()];
617611 if (MCTrackNavigator::isPhysicalPrimary (p, pcontainer)) {
618- mMapLabels [matchType::ITS].insert ({lbl, {itrk, true }});
612+ mMapLabels [matchType::ITS].insert ({lbl, {. mIdx = itrk, . mIsPhysicalPrimary = true }});
619613 } else {
620- mMapLabels [matchType::ITS].insert ({lbl, {itrk, false }});
614+ mMapLabels [matchType::ITS].insert ({lbl, {. mIdx = itrk, . mIsPhysicalPrimary = false }});
621615 }
622616 } else {
623617 // winner (if more tracks have the same label) has the highest pt
@@ -725,13 +719,13 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
725719 std::array<std::string, 2 > title{" TPC" , " ITS" };
726720 for (int i = 0 ; i < matchType::SIZE; ++i) {
727721 o2::track::TrackParCov trkRef;
728- int idxTrkRef;
722+ unsigned int idxTrkRef{ 0 } ;
729723 bool fillHisto = false ;
730724 bool isEtaITSOk = true ;
731725 if (i == matchType::TPC) {
732726 trkRef = mTPCTracks [trk.getRefTPC ()];
733727 idxTrkRef = trk.getRefTPC ().getIndex ();
734- if (isTPCTrackSelectedEntry[idxTrkRef] == true ) {
728+ if (isTPCTrackSelectedEntry[idxTrkRef]) {
735729 fillHisto = true ;
736730 ++mNITSTPCSelectedTracks [i];
737731 }
@@ -747,7 +741,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
747741 }
748742 trkRef = mITSTracks [trk.getRefITS ()];
749743 LOG (debug) << " Checking track (ITS) with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " and pt = " << trkRef.getPt ();
750- if (isITSTrackSelectedEntry[idxTrkRef] == true ) {
744+ if (isITSTrackSelectedEntry[idxTrkRef]) {
751745 LOG (debug) << " Track was selected (ITS), with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " , we keep it in the numerator, pt = " << trkRef.getPt ();
752746 fillHisto = true ;
753747 ++mNITSTPCSelectedTracks [i];
@@ -760,7 +754,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
760754 LOG (debug) << " Track (ITS), with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " will be discarded when filling pt of phi related histograms, since eta = " << trkRef.getEta () << " , we don't keep it in the numerator, pt = " << trkRef.getPt ();
761755 }
762756 }
763- if (fillHisto == true ) {
757+ if (fillHisto) {
764758 if (!mUseMC ) {
765759 LOG (debug) << " Filling num (" << title[i] << " ) with track with id " << idxTrkRef << " for ITSTPC track " << iITSTPC << " with pt = " << trkRef.getPt ();
766760 if (isEtaITSOk) {
@@ -800,7 +794,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
800794 mChi2Refit ->Fill (trk.getChi2Refit ());
801795 mTimeResVsPt ->Fill (trkRef.getPt (), trk.getTimeMUS ().getTimeStampError ());
802796 math_utils::Point3D<float > v{};
803- std::array<float , 2 > dca;
797+ std::array<float , 2 > dca{- 999 , - 999 } ;
804798 if (trkRef.propagateParamToDCA (v, mBz , &dca)) {
805799 mDCAr ->Fill (dca[0 ]);
806800 if (!mUseMC ) {
@@ -825,7 +819,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
825819 // track with the highest number of TPC clusters
826820 for (int itrk = 0 ; itrk < static_cast <int >(mTPCTracks .size ()); ++itrk) {
827821 auto const & trk = mTPCTracks [itrk];
828- if (isTPCTrackSelectedEntry[itrk] == true ) {
822+ if (isTPCTrackSelectedEntry[itrk]) {
829823 auto lbl = mRecoCont .getTrackMCLabel ({(unsigned int )(itrk), GID::Source::TPC});
830824 if (!lbl.isValid ()) {
831825 continue ;
@@ -857,7 +851,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
857851 // track with the highest number of ITS clusters
858852 for (int itrk = 0 ; itrk < static_cast <int >(mITSTracks .size ()); ++itrk) {
859853 auto const & trk = mITSTracks [itrk];
860- if (isITSTrackSelectedEntry[itrk] == true ) {
854+ if (isITSTrackSelectedEntry[itrk]) {
861855 auto lbl = mRecoCont .getTrackMCLabel ({(unsigned int )(itrk), GID::Source::ITS});
862856 if (!lbl.isValid ()) {
863857 continue ;
@@ -945,7 +939,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
945939 // if we are in data, we loop over all tracks (no check on the label)
946940 for (size_t itrk = 0 ; itrk < mTPCTracks .size (); ++itrk) {
947941 auto const & trk = mTPCTracks [itrk];
948- if (isTPCTrackSelectedEntry[itrk] == true ) {
942+ if (isTPCTrackSelectedEntry[itrk]) {
949943 LOG (debug) << " Filling den (TPC) with track with pt = " << trk.getPt ();
950944 mPtDen [matchType::TPC]->Fill (trk.getPt ());
951945 if (std::abs (trk.getEta ()) > mEtaNo0Cut ) {
@@ -972,7 +966,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
972966 for (size_t itrk = 0 ; itrk < mITSTracks .size (); ++itrk) {
973967 auto const & trk = mITSTracks [itrk];
974968 LOG (debug) << " Checking den for track (ITS) " << itrk << " with pt " << trk.getPt () << " and eta = " << trk.getEta ();
975- if (isITSTrackSelectedEntry[itrk] == true ) {
969+ if (isITSTrackSelectedEntry[itrk]) {
976970 if (std::abs (trk.getEta ()) < mEtaITSCut ) {
977971 LOG (debug) << " Filling den for track (ITS) " << itrk << " with pt = " << trk.getPt () << " and eta = " << trk.getEta ();
978972 mPtDen [matchType::ITS]->Fill (trk.getPt ());
@@ -1428,3 +1422,30 @@ void MatchITSTPCQC::getHistos(TObjArray& objar)
14281422 objar.Add (mK0MassVsPtVsOccpp );
14291423 objar.Add (mK0MassVsPtVsOccPbPb );
14301424}
1425+
1426+ void MatchITSTPCQC::printParams () const
1427+ {
1428+ LOG (info) << " MatchITSTPCQC parameters:" ;
1429+ LOG (info) << " - minPtBins = " << mPtBins ;
1430+ LOG (info) << " - minPtITSCut = " << mPtITSCut ;
1431+ LOG (info) << " - etaITSCut = " << mEtaITSCut ;
1432+ LOG (info) << " - minNITSClustersCut = " << mMinNClustersITS ;
1433+ LOG (info) << " - maxChi2PerClusterITS = " << mMaxChi2PerClusterITS ;
1434+ LOG (info) << " - minPtTPCCut = " << mPtTPCCut ;
1435+ LOG (info) << " - etaTPCCut = " << mEtaTPCCut ;
1436+ LOG (info) << " - minNTPCClustersCut = " << mNTPCClustersCut ;
1437+ LOG (info) << " - mEtaNo0Cut = " << mEtaNo0Cut ;
1438+ LOG (info) << " - minDCACut = " << mDCATPCCut ;
1439+ LOG (info) << " - minDCACutY = " << mDCATPCCutY ;
1440+ LOG (info) << " - minPtCut = " << mPtCut ;
1441+ LOG (info) << " - maxPtCut = " << mPtMaxCut ;
1442+ LOG (info) << " - etaCut = " << mEtaCut ;
1443+ LOG (info) << " - cutK0Mass = " << mCutK0Mass ;
1444+ LOG (info) << " - maxEtaK0 = " << mMaxEtaK0 ;
1445+ LOG (info) << " - minTPCOccpp = " << mMinTPCOccpp ;
1446+ LOG (info) << " - maxTPCOccpp = " << mMaxTPCOccpp ;
1447+ LOG (info) << " - nBinsTPCOccpp = " << mNBinsTPCOccpp ;
1448+ LOG (info) << " - minTPCOccPbPb = " << mMinTPCOccPbPb ;
1449+ LOG (info) << " - maxTPCOccPbPb = " << mMaxTPCOccPbPb ;
1450+ LOG (info) << " - nBinsTPCOccPbPb = " << mNBinsTPCOccPbPb ;
1451+ }
0 commit comments