Skip to content

Commit

Permalink
GLOQC: Reduce memory footprint
Browse files Browse the repository at this point in the history
- Change TH?D-->TH?F
- stop creation of MC histos in Data

Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
  • Loading branch information
f3sch committed Mar 15, 2024
1 parent 96e0e44 commit e6a4c90
Show file tree
Hide file tree
Showing 2 changed files with 232 additions and 259 deletions.
229 changes: 118 additions & 111 deletions Detectors/GlobalTracking/include/GlobalTracking/MatchITSTPCQC.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,69 +63,71 @@ class MatchITSTPCQC
void finalize();
void reset();

TH1D* getHistoPtNum(matchType m) const { return mPtNum[m]; }
TH1D* getHistoPtDen(matchType m) const { return mPtDen[m]; }
TEfficiency* getFractionITSTPCmatch(matchType m) const { return mFractionITSTPCmatch[m]; }

TH1D* getHistoPtNumNoEta0(matchType m) const { return mPtNum_noEta0[m]; }
TH1D* getHistoPtDenNoEta0(matchType m) const { return mPtDen_noEta0[m]; }
TEfficiency* getFractionITSTPCmatchNoEta0(matchType m) const { return mFractionITSTPCmatch_noEta0[m]; }

TH1F* getHistoPhiNum(matchType m) const { return mPhiNum[m]; }
TH1F* getHistoPhiDen(matchType m) const { return mPhiDen[m]; }
TEfficiency* getFractionITSTPCmatchPhi(matchType m) const { return mFractionITSTPCmatchPhi[m]; }

TH2F* getHistoPhiVsPtNum(matchType m) const { return mPhiVsPtNum[m]; }
TH2F* getHistoPhiVsPtDen(matchType m) const { return mPhiVsPtDen[m]; }
TEfficiency* getFractionITSTPCmatchPhiVsPt(matchType m) const { return mFractionITSTPCmatchPhiVsPt[m]; }

TH1F* getHistoEtaNum(matchType m) const { return mEtaNum[m]; }
TH1F* getHistoEtaDen(matchType m) const { return mEtaDen[m]; }
TEfficiency* getFractionITSTPCmatchEta(matchType m) const { return mFractionITSTPCmatchEta[m]; }

TH2F* getHistoEtaVsPtNum(matchType m) const { return mEtaVsPtNum[m]; }
TH2F* getHistoEtaVsPtDen(matchType m) const { return mEtaVsPtDen[m]; }
TEfficiency* getFractionITSTPCmatchEtaVsPt(matchType m) const { return mFractionITSTPCmatchEtaVsPt[m]; }

TH2F* getHistoClsVsPtNum(matchType m) const { return mClsVsPtNum[m]; }
TH2F* getHistoClsVsPtDen(matchType m) const { return mClsVsPtDen[m]; }
TEfficiency* getFractionITSTPCmatchClsVsPt(matchType m) const { return mFractionITSTPCmatchClsVsPt[m]; }

TH2F* getHistoChi2VsPtNum(matchType m) const { return mChi2VsPtNum[m]; }
TH2F* getHistoChi2VsPtDen(matchType m) const { return mChi2VsPtDen[m]; }
TEfficiency* getFractionITSTPCmatchChi2VsPt(matchType m) const { return mFractionITSTPCmatchChi2VsPt[m]; }

TH1F* getHistoPtPhysPrimNum(matchType m) const { return mPtPhysPrimNum[m]; }
TH1F* getHistoPtPhysPrimDen(matchType m) const { return mPtPhysPrimDen[m]; }
TEfficiency* getFractionITSTPCmatchPhysPrim(matchType m) const { return mFractionITSTPCmatchPhysPrim[m]; }

TH1F* getHistoPhiPhysPrimNum(matchType m) const { return mPhiPhysPrimNum[m]; }
TH1F* getHistoPhiPhysPrimDen(matchType m) const { return mPhiPhysPrimDen[m]; }
TEfficiency* getFractionITSTPCmatchPhiPhysPrim(matchType m) const { return mFractionITSTPCmatchPhiPhysPrim[m]; }

TH1F* getHistoEtaPhysPrimNum(matchType m) const { return mEtaPhysPrimNum[m]; }
TH1F* getHistoEtaPhysPrimDen(matchType m) const { return mEtaPhysPrimDen[m]; }
TEfficiency* getFractionITSTPCmatchEtaPhysPrim(matchType m) const { return mFractionITSTPCmatchEtaPhysPrim[m]; }

TH2F* getHistoResidualPt() const { return mResidualPt; }
TH2F* getHistoResidualPhi() const { return mResidualPhi; }
TH2F* getHistoResidualEta() const { return mResidualEta; }

TH1F* getHistoChi2Matching() const { return mChi2Matching; }
TH1F* getHistoChi2Refit() const { return mChi2Refit; }
TH2F* getHistoTimeResVsPt() const { return mTimeResVsPt; }
TH1F* getHistoDCAr() const { return mDCAr; }
TH2F* getHistoDCArVsPtNum() const { return mDCArVsPtNum; }
TH2F* getHistoDCArVsPtDen() const { return mDCArVsPtDen; }
TEfficiency* getFractionITSTPCmatchDCArVsPt() const { return mFractionITSTPCmatchDCArVsPt; }

TH1D* getHisto1OverPtNum(matchType m) const { return m1OverPtNum[m]; }
TH1D* getHisto1OverPtDen(matchType m) const { return m1OverPtDen[m]; }
TEfficiency* getFractionITSTPCmatch1OverPt(matchType m) const { return mFractionITSTPCmatch1OverPt[m]; }

TH1D* getHisto1OverPtPhysPrimNum(matchType m) const { return m1OverPtPhysPrimNum[m]; }
TH1D* getHisto1OverPtPhysPrimDen(matchType m) const { return m1OverPtPhysPrimDen[m]; }
TEfficiency* getFractionITSTPCmatchPhysPrim1OverPt(matchType m) const { return mFractionITSTPCmatchPhysPrim1OverPt[m]; }
/* do we need these?
TH1D* getHistoPtNum(matchType m) const { return mPtNum[m]; }
TH1D* getHistoPtDen(matchType m) const { return mPtDen[m]; }
TEfficiency* getFractionITSTPCmatch(matchType m) const { return mFractionITSTPCmatch[m]; }
TH1D* getHistoPtNumNoEta0(matchType m) const { return mPtNum_noEta0[m]; }
TH1D* getHistoPtDenNoEta0(matchType m) const { return mPtDen_noEta0[m]; }
TEfficiency* getFractionITSTPCmatchNoEta0(matchType m) const { return mFractionITSTPCmatch_noEta0[m]; }
TH1F* getHistoPhiNum(matchType m) const { return mPhiNum[m]; }
TH1F* getHistoPhiDen(matchType m) const { return mPhiDen[m]; }
TEfficiency* getFractionITSTPCmatchPhi(matchType m) const { return mFractionITSTPCmatchPhi[m]; }
TH2F* getHistoPhiVsPtNum(matchType m) const { return mPhiVsPtNum[m]; }
TH2F* getHistoPhiVsPtDen(matchType m) const { return mPhiVsPtDen[m]; }
TEfficiency* getFractionITSTPCmatchPhiVsPt(matchType m) const { return mFractionITSTPCmatchPhiVsPt[m]; }
TH1F* getHistoEtaNum(matchType m) const { return mEtaNum[m]; }
TH1F* getHistoEtaDen(matchType m) const { return mEtaDen[m]; }
TEfficiency* getFractionITSTPCmatchEta(matchType m) const { return mFractionITSTPCmatchEta[m]; }
TH2F* getHistoEtaVsPtNum(matchType m) const { return mEtaVsPtNum[m]; }
TH2F* getHistoEtaVsPtDen(matchType m) const { return mEtaVsPtDen[m]; }
TEfficiency* getFractionITSTPCmatchEtaVsPt(matchType m) const { return mFractionITSTPCmatchEtaVsPt[m]; }
TH2F* getHistoClsVsPtNum(matchType m) const { return mClsVsPtNum[m]; }
TH2F* getHistoClsVsPtDen(matchType m) const { return mClsVsPtDen[m]; }
TEfficiency* getFractionITSTPCmatchClsVsPt(matchType m) const { return mFractionITSTPCmatchClsVsPt[m]; }
TH2F* getHistoChi2VsPtNum(matchType m) const { return mChi2VsPtNum[m]; }
TH2F* getHistoChi2VsPtDen(matchType m) const { return mChi2VsPtDen[m]; }
TEfficiency* getFractionITSTPCmatchChi2VsPt(matchType m) const { return mFractionITSTPCmatchChi2VsPt[m]; }
TH1F* getHistoPtPhysPrimNum(matchType m) const { return mPtPhysPrimNum[m]; }
TH1F* getHistoPtPhysPrimDen(matchType m) const { return mPtPhysPrimDen[m]; }
TEfficiency* getFractionITSTPCmatchPhysPrim(matchType m) const { return mFractionITSTPCmatchPhysPrim[m]; }
TH1F* getHistoPhiPhysPrimNum(matchType m) const { return mPhiPhysPrimNum[m]; }
TH1F* getHistoPhiPhysPrimDen(matchType m) const { return mPhiPhysPrimDen[m]; }
TEfficiency* getFractionITSTPCmatchPhiPhysPrim(matchType m) const { return mFractionITSTPCmatchPhiPhysPrim[m]; }
TH1F* getHistoEtaPhysPrimNum(matchType m) const { return mEtaPhysPrimNum[m]; }
TH1F* getHistoEtaPhysPrimDen(matchType m) const { return mEtaPhysPrimDen[m]; }
TEfficiency* getFractionITSTPCmatchEtaPhysPrim(matchType m) const { return mFractionITSTPCmatchEtaPhysPrim[m]; }
TH2F* getHistoResidualPt() const { return mResidualPt; }
TH2F* getHistoResidualPhi() const { return mResidualPhi; }
TH2F* getHistoResidualEta() const { return mResidualEta; }
TH1F* getHistoChi2Matching() const { return mChi2Matching; }
TH1F* getHistoChi2Refit() const { return mChi2Refit; }
TH2F* getHistoTimeResVsPt() const { return mTimeResVsPt; }
TH1F* getHistoDCAr() const { return mDCAr; }
TH2F* getHistoDCArVsPtNum() const { return mDCArVsPtNum; }
TH2F* getHistoDCArVsPtDen() const { return mDCArVsPtDen; }
TEfficiency* getFractionITSTPCmatchDCArVsPt() const { return mFractionITSTPCmatchDCArVsPt; }
TH1D* getHisto1OverPtNum(matchType m) const { return m1OverPtNum[m]; }
TH1D* getHisto1OverPtDen(matchType m) const { return m1OverPtDen[m]; }
TEfficiency* getFractionITSTPCmatch1OverPt(matchType m) const { return mFractionITSTPCmatch1OverPt[m]; }
TH1D* getHisto1OverPtPhysPrimNum(matchType m) const { return m1OverPtPhysPrimNum[m]; }
TH1D* getHisto1OverPtPhysPrimDen(matchType m) const { return m1OverPtPhysPrimDen[m]; }
TEfficiency* getFractionITSTPCmatchPhysPrim1OverPt(matchType m) const { return mFractionITSTPCmatchPhysPrim1OverPt[m]; }
*/

void getHistos(TObjArray& objar);

Expand All @@ -136,6 +138,7 @@ class MatchITSTPCQC
void publishHistograms(const std::shared_ptr<T>& publisher)
{
for (int i = 0; i < matchType::SIZE; ++i) {
// Pt
publisher->startPublishing(mPtNum[i]);
publisher->startPublishing(mPtDen[i]);
publisher->startPublishing(mFractionITSTPCmatch[i]);
Expand All @@ -144,66 +147,72 @@ class MatchITSTPCQC
publisher->startPublishing(mPtDen_noEta0[i]);
publisher->startPublishing(mFractionITSTPCmatch_noEta0[i]);

publisher->startPublishing(mPtPhysPrimNum[i]);
publisher->startPublishing(mPtPhysPrimDen[i]);
publisher->startPublishing(mFractionITSTPCmatchPhysPrim[i]);

// Phi
publisher->startPublishing(mPhiNum[i]);
publisher->startPublishing(mPhiDen[i]);
publisher->startPublishing(mFractionITSTPCmatchPhi[i]);

if (mUseTrkPID) { // Vs Tracking PID hypothesis
for (int j = 0; j < o2::track::PID::NIDs; ++j) {
// Pt
publisher->startPublishing(mPtNumVsTrkPID[i][j]);
publisher->startPublishing(mPtDenVsTrkPID[i][j]);
publisher->startPublishing(mFractionITSTPCmatchPtVsTrkPID[i][j]);
// Phi
publisher->startPublishing(mPhiNumVsTrkPID[i][j]);
publisher->startPublishing(mPhiDenVsTrkPID[i][j]);
publisher->startPublishing(mFractionITSTPCmatchPhiVsTrkPID[i][j]);
// Eta
publisher->startPublishing(mEtaNumVsTrkPID[i][j]);
publisher->startPublishing(mEtaDenVsTrkPID[i][j]);
publisher->startPublishing(mFractionITSTPCmatchEtaVsTrkPID[i][j]);
}
}

publisher->startPublishing(mPhiPhysPrimNum[i]);
publisher->startPublishing(mPhiPhysPrimDen[i]);
publisher->startPublishing(mFractionITSTPCmatchPhiPhysPrim[i]);

publisher->startPublishing(mPhiVsPtNum[i]);
publisher->startPublishing(mPhiVsPtDen[i]);
publisher->startPublishing(mFractionITSTPCmatchPhiVsPt[i]);

// Eta
publisher->startPublishing(mEtaNum[i]);
publisher->startPublishing(mEtaDen[i]);
publisher->startPublishing(mFractionITSTPCmatchEta[i]);

publisher->startPublishing(mEtaPhysPrimNum[i]);
publisher->startPublishing(mEtaPhysPrimDen[i]);
publisher->startPublishing(mFractionITSTPCmatchEtaPhysPrim[i]);

publisher->startPublishing(mEtaVsPtNum[i]);
publisher->startPublishing(mEtaVsPtDen[i]);
publisher->startPublishing(mFractionITSTPCmatchEtaVsPt[i]);

// Clusters
publisher->startPublishing(mClsVsPtNum[i]);
publisher->startPublishing(mClsVsPtDen[i]);
publisher->startPublishing(mFractionITSTPCmatchClsVsPt[i]);

// Chi2
publisher->startPublishing(mChi2VsPtNum[i]);
publisher->startPublishing(mChi2VsPtDen[i]);
publisher->startPublishing(mFractionITSTPCmatchChi2VsPt[i]);

// 1/pt
publisher->startPublishing(m1OverPtNum[i]);
publisher->startPublishing(m1OverPtDen[i]);
publisher->startPublishing(mFractionITSTPCmatch1OverPt[i]);

publisher->startPublishing(m1OverPtPhysPrimNum[i]);
publisher->startPublishing(m1OverPtPhysPrimDen[i]);
publisher->startPublishing(mFractionITSTPCmatchPhysPrim1OverPt[i]);
if (mUseTrkPID) { // Vs Tracking PID hypothesis
for (int j = 0; j < o2::track::PID::NIDs; ++j) {
// Pt
publisher->startPublishing(mPtNumVsTrkPID[i][j]);
publisher->startPublishing(mPtDenVsTrkPID[i][j]);
publisher->startPublishing(mFractionITSTPCmatchPtVsTrkPID[i][j]);

// Phi
publisher->startPublishing(mPhiNumVsTrkPID[i][j]);
publisher->startPublishing(mPhiDenVsTrkPID[i][j]);
publisher->startPublishing(mFractionITSTPCmatchPhiVsTrkPID[i][j]);

// Eta
publisher->startPublishing(mEtaNumVsTrkPID[i][j]);
publisher->startPublishing(mEtaDenVsTrkPID[i][j]);
publisher->startPublishing(mFractionITSTPCmatchEtaVsTrkPID[i][j]);
}
}

if (mUseMC) {
publisher->startPublishing(mPhiPhysPrimNum[i]);
publisher->startPublishing(mPhiPhysPrimDen[i]);
publisher->startPublishing(mFractionITSTPCmatchPhiPhysPrim[i]);
publisher->startPublishing(mPtPhysPrimNum[i]);
publisher->startPublishing(mPtPhysPrimDen[i]);
publisher->startPublishing(mFractionITSTPCmatchPhysPrim[i]);
publisher->startPublishing(mEtaPhysPrimNum[i]);
publisher->startPublishing(mEtaPhysPrimDen[i]);
publisher->startPublishing(mFractionITSTPCmatchEtaPhysPrim[i]);
publisher->startPublishing(m1OverPtPhysPrimNum[i]);
publisher->startPublishing(m1OverPtPhysPrimDen[i]);
publisher->startPublishing(mFractionITSTPCmatchPhysPrim1OverPt[i]);
}
}
publisher->startPublishing(mChi2Matching);
publisher->startPublishing(mChi2Refit);
Expand All @@ -225,8 +234,6 @@ class MatchITSTPCQC
void deleteHistograms();
void setBz(float bz) { mBz = bz; }

// track selection
bool selectTrack(o2::tpc::TrackTPC const& track); // still present but not used
// ITS track
void setMinPtITSCut(float v) { mPtITSCut = v; };
void setEtaITSCut(float v) { mEtaITSCut = v; }; // TODO: define 2 different values for min and max (**)
Expand Down Expand Up @@ -273,18 +280,18 @@ class MatchITSTPCQC
o2::steer::MCKinematicsReader mcReader; // reader of MC information

// Pt
TH1D* mPtNum[matchType::SIZE] = {};
TH1D* mPtDen[matchType::SIZE] = {};
TH1F* mPtNum[matchType::SIZE] = {};
TH1F* mPtDen[matchType::SIZE] = {};
TEfficiency* mFractionITSTPCmatch[matchType::SIZE] = {};
TH1D* mPtNum_noEta0[matchType::SIZE] = {};
TH1D* mPtDen_noEta0[matchType::SIZE] = {};
TH1F* mPtNum_noEta0[matchType::SIZE] = {};
TH1F* mPtDen_noEta0[matchType::SIZE] = {};
TEfficiency* mFractionITSTPCmatch_noEta0[matchType::SIZE] = {};
TH1F* mPtPhysPrimNum[matchType::SIZE] = {};
TH1F* mPtPhysPrimDen[matchType::SIZE] = {};
TEfficiency* mFractionITSTPCmatchPhysPrim[matchType::SIZE] = {};
// Pt split per PID hypothesis in tracking
TH1D* mPtNumVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TH1D* mPtDenVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TH1F* mPtNumVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TH1F* mPtDenVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TEfficiency* mFractionITSTPCmatchPtVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
// Phi
TH1F* mPhiNum[matchType::SIZE] = {};
Expand All @@ -297,8 +304,8 @@ class MatchITSTPCQC
TH2F* mPhiVsPtDen[matchType::SIZE] = {};
TEfficiency* mFractionITSTPCmatchPhiVsPt[matchType::SIZE] = {};
// Phi split per PID hypothesis in tracking
TH1D* mPhiNumVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TH1D* mPhiDenVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TH1F* mPhiNumVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TH1F* mPhiDenVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TEfficiency* mFractionITSTPCmatchPhiVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
// Eta
TH1F* mEtaNum[matchType::SIZE] = {};
Expand All @@ -319,8 +326,8 @@ class MatchITSTPCQC
TH2F* mChi2VsPtDen[matchType::SIZE] = {};
TEfficiency* mFractionITSTPCmatchChi2VsPt[matchType::SIZE] = {};
// Eta split per PID hypothesis in tracking
TH1D* mEtaNumVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TH1D* mEtaDenVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TH1F* mEtaNumVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TH1F* mEtaDenVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
TEfficiency* mFractionITSTPCmatchEtaVsTrkPID[matchType::SIZE][track::PID::NIDs] = {};
// Residuals
TH2F* mResidualPt = nullptr;
Expand All @@ -335,11 +342,11 @@ class MatchITSTPCQC
TH2F* mDCArVsPtDen = nullptr;
TEfficiency* mFractionITSTPCmatchDCArVsPt = nullptr;
// 1/Pt
TH1D* m1OverPtNum[matchType::SIZE] = {};
TH1D* m1OverPtDen[matchType::SIZE] = {};
TH1F* m1OverPtNum[matchType::SIZE] = {};
TH1F* m1OverPtDen[matchType::SIZE] = {};
TEfficiency* mFractionITSTPCmatch1OverPt[matchType::SIZE] = {};
TH1D* m1OverPtPhysPrimNum[matchType::SIZE] = {};
TH1D* m1OverPtPhysPrimDen[matchType::SIZE] = {};
TH1F* m1OverPtPhysPrimNum[matchType::SIZE] = {};
TH1F* m1OverPtPhysPrimDen[matchType::SIZE] = {};
TEfficiency* mFractionITSTPCmatchPhysPrim1OverPt[matchType::SIZE] = {};

void setEfficiency(TEfficiency* eff, TH1* hnum, TH1* hden, bool is2D = false);
Expand Down
Loading

0 comments on commit e6a4c90

Please sign in to comment.