Skip to content

Commit 632af8d

Browse files
committed
GLO: QC: minor cleanup (removal of some headers and other stuff)
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 73c976a commit 632af8d

File tree

2 files changed

+63
-62
lines changed

2 files changed

+63
-62
lines changed

Detectors/GLOQC/include/GLOQC/MatchITSTPCQC.h

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@
2525
#include "DataFormatsGlobalTracking/RecoContainer.h"
2626
#include "Framework/ProcessingContext.h"
2727
#include "SimulationDataFormat/MCCompLabel.h"
28-
#include "SimulationDataFormat/MCTrack.h"
2928
#include "Steer/MCKinematicsReader.h"
3029
#include "ReconstructionDataFormats/PID.h"
3130
#include "DCAFitter/DCAFitterN.h"
3231
#include "GPUO2InterfaceConfiguration.h"
33-
// #include "GPUSettingsO2.h"
3432
#include "GPUParam.h"
3533
#include "GPUParam.inc"
3634

@@ -56,11 +54,15 @@ struct LblInfo {
5654
class MatchITSTPCQC
5755
{
5856
public:
59-
enum matchType : int { TPC = 0,
60-
ITS,
61-
SIZE };
57+
enum matchType : uint8_t { TPC = 0,
58+
ITS,
59+
SIZE };
6260

6361
MatchITSTPCQC() = default;
62+
MatchITSTPCQC(const MatchITSTPCQC&) = delete;
63+
MatchITSTPCQC(MatchITSTPCQC&&) = delete;
64+
MatchITSTPCQC& operator=(const MatchITSTPCQC&) = delete;
65+
MatchITSTPCQC& operator=(MatchITSTPCQC&&) = delete;
6466
~MatchITSTPCQC();
6567

6668
bool init();
@@ -260,14 +262,14 @@ class MatchITSTPCQC
260262
// ITS track
261263
void setMinPtITSCut(float v) { mPtITSCut = v; };
262264
void setEtaITSCut(float v) { mEtaITSCut = v; }; // TODO: define 2 different values for min and max (**)
263-
void setMinNClustersITS(float v) { mMinNClustersITS = v; }
265+
void setMinNClustersITS(int v) { mMinNClustersITS = v; }
264266
void setMaxChi2PerClusterITS(float v) { mMaxChi2PerClusterITS = v; }
265267
// TO DO: define an agreed way to implement the setter for ITS matching (min. # layers, which layers)
266268
// [...] --> exploit the method TrackCuts::setRequireHitsInITSLayers(...)
267269
// TPC track
268270
void setMinPtTPCCut(float v) { mPtTPCCut = v; };
269271
void setEtaTPCCut(float v) { mEtaTPCCut = v; }; // TODO: define 2 different values for min and max (***)
270-
void setMinNTPCClustersCut(float v) { mNTPCClustersCut = v; }
272+
void setMinNTPCClustersCut(int v) { mNTPCClustersCut = v; }
271273
void setMinDCAtoBeamPipeCut(std::array<float, 2> v)
272274
{
273275
setMinDCAtoBeamPipeDistanceCut(v[0]);
@@ -295,33 +297,11 @@ class MatchITSTPCQC
295297
void setK0Scaling(float v) { mK0Scaling = v; }
296298
float getK0Scaling() const { return mK0Scaling; }
297299
void setK0MaxDCA(float v) { mK0MaxDCA = v; }
298-
float getK0MaxDCA() { return mK0MaxDCA; }
300+
float getK0MaxDCA() const { return mK0MaxDCA; }
299301
void setK0MinCosPA(float v) { mK0MinCosPA = v; }
300302
float getK0MinCosPA() const { return mK0MinCosPA; }
301303

302-
void printParams()
303-
{
304-
LOG(info) << "minPtITSCut = " << mPtITSCut;
305-
LOG(info) << "etaITSCut = " << mEtaITSCut;
306-
LOG(info) << "minNITSClustersCut = " << mMinNClustersITS;
307-
LOG(info) << "maxChi2PerClusterITS = " << mMaxChi2PerClusterITS;
308-
LOG(info) << "minPtTPCCut = " << mPtTPCCut;
309-
LOG(info) << "etaTPCCut = " << mEtaTPCCut;
310-
LOG(info) << "minNTPCClustersCut = " << mNTPCClustersCut;
311-
LOG(info) << "minDCACut = " << mDCATPCCut;
312-
LOG(info) << "minDCACutY = " << mDCATPCCutY;
313-
LOG(info) << "minPtCut = " << mPtCut;
314-
LOG(info) << "maxPtCut = " << mPtMaxCut;
315-
LOG(info) << "etaCut = " << mEtaCut;
316-
LOG(info) << "cutK0Mass = " << mCutK0Mass;
317-
LOG(info) << "maxEtaK0 = " << mMaxEtaK0;
318-
LOG(info) << "minTPCOccpp = " << mMinTPCOccpp;
319-
LOG(info) << "maxTPCOccpp = " << mMaxTPCOccpp;
320-
LOG(info) << "nBinsTPCOccpp = " << mNBinsTPCOccpp;
321-
LOG(info) << "minTPCOccPbPb = " << mMinTPCOccPbPb;
322-
LOG(info) << "maxTPCOccPbPb = " << mMaxTPCOccPbPb;
323-
LOG(info) << "nBinsTPCOccPbPb = " << mNBinsTPCOccPbPb;
324-
}
304+
void printParams() const;
325305

326306
private:
327307
std::shared_ptr<o2::globaltracking::DataRequest> mDataRequest;
@@ -428,11 +408,11 @@ class MatchITSTPCQC
428408

429409
// cut values
430410
// ITS track
431-
float mPtITSCut = 0.1f; // min pT for ITS track
432-
float mEtaITSCut = 1.4f; // eta window for ITS track --> TODO: define 2 different values for min and max (**)
433-
int mMinNClustersITS = 0; // min number of ITS clusters
434-
float mMaxChi2PerClusterITS{1e10f}; // max its fit chi2 per ITS cluster
435-
std::vector<std::pair<int8_t, std::set<uint8_t>>> mRequiredITSHits{}; // vector of ITS requirements (minNRequiredHits in specific requiredLayers)
411+
float mPtITSCut = 0.1f; // min pT for ITS track
412+
float mEtaITSCut = 1.4f; // eta window for ITS track --> TODO: define 2 different values for min and max (**)
413+
int mMinNClustersITS = 0; // min number of ITS clusters
414+
float mMaxChi2PerClusterITS{1e10f}; // max its fit chi2 per ITS cluster
415+
std::vector<std::pair<int8_t, std::set<uint8_t>>> mRequiredITSHits; // vector of ITS requirements (minNRequiredHits in specific requiredLayers)
436416
// TPC track
437417
float mPtTPCCut = 0.1f; // min pT for TPC track
438418
float mEtaTPCCut = 1.4f; // eta window for TPC track --> TODO: define 2 different values for min and max (***)
@@ -462,7 +442,7 @@ class MatchITSTPCQC
462442
std::shared_ptr<o2::gpu::GPUParam> mParam = nullptr;
463443
int mNHBPerTF = 0;
464444
int mNTPCOccBinLength = 0; ///< TPC occ. histo bin length in TBs
465-
float mNTPCOccBinLengthInv;
445+
float mNTPCOccBinLengthInv{};
466446
std::vector<float> mTBinClOcc; ///< TPC occupancy histo: i-th entry is the integrated occupancy for ~1 orbit starting from the TB = i*mNTPCOccBinLength
467447
gsl::span<const unsigned int> mTPCRefitterOccMap; ///< externally set TPC clusters occupancy map
468448
bool mIsHI = false;

Detectors/GLOQC/src/MatchITSTPCQC.cxx

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,24 @@
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

3732
using namespace o2::gloqc;
@@ -41,7 +36,6 @@ using DetID = o2::detectors::DetID;
4136

4237
MatchITSTPCQC::~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

Comments
 (0)