@@ -44,7 +44,6 @@ void MatchITSTPCQC::deleteHistograms()
4444void MatchITSTPCQC::reset ()
4545{
4646 mPtTPC ->Reset ();
47- mFractionITSTPCmatch ->Reset ();
4847 mPt ->Reset ();
4948 mEta ->Reset ();
5049 mChi2Matching ->Reset ();
@@ -58,13 +57,16 @@ bool MatchITSTPCQC::init()
5857{
5958
6059 mPtTPC = new TH1F (" mPtTPC" , " Pt distribution of TPC tracks; Pt; dNdPt" , 100 , 0 .f , 20 .f );
61- mFractionITSTPCmatch = new TH1F (" mFractionITSTPCmatch" , " Fraction of ITSTPC matched tracks vs Pt; Pt; Eff" , 100 , 0 .f , 20 .f );
60+ mFractionITSTPCmatch = new TEfficiency (" mFractionITSTPCmatch" , " Fraction of ITSTPC matched tracks vs Pt; Pt; Eff" , 100 , 0 .f , 20 .f );
6261 mPt = new TH1F (" mPt" , " Pt distribution of matched tracks; Pt; dNdPt" , 100 , 0 .f , 20 .f );
6362 mEta = new TH1F (" mEta" , " Eta distribution of matched tracks; Eta; dNdEta" , 100 , -1 .2f , 1 .2f );
6463 mChi2Matching = new TH1F (" mChi2Matching" , " Chi2 of matching; chi2" , 200 , 0 , 20 );
6564 mChi2Refit = new TH1F (" mChi2Refit" , " Chi2 of refit; chi2" , 200 , 0 , 20 );
6665 mTimeResVsPt = new TH2F (" mTimeResVsPt" , " Time resolution vs Pt; Pt; time res" , 100 , 0 .f , 20 .f , 100 , 0 .f , 2 .f );
6766
67+ mPtTPC ->Sumw2 ();
68+ mPt ->Sumw2 ();
69+
6870 mSrc &= mAllowedSources ;
6971
7072 if ((mSrc [GID::Source::ITSTPC] == 0 || mSrc [GID::Source::TPC] == 0 )) {
@@ -110,7 +112,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx)
110112 mChi2Matching ->Fill (trk.getChi2Match ());
111113 mChi2Refit ->Fill (trk.getChi2Refit ());
112114 mTimeResVsPt ->Fill (trkTpc.getPt (), trk.getTimeMUS ().getTimeStampError ());
113- LOG (INFO ) << " *** chi2Matching = " << trk.getChi2Match () << " , chi2refit = " << trk.getChi2Refit () << " , timeResolution = " << trk.getTimeMUS ().getTimeStampError ();
115+ LOG (DEBUG ) << " *** chi2Matching = " << trk.getChi2Match () << " , chi2refit = " << trk.getChi2Refit () << " , timeResolution = " << trk.getTimeMUS ().getTimeStampError ();
114116 ++mNITSTPCSelectedTracks ;
115117 }
116118 }
@@ -145,9 +147,14 @@ bool MatchITSTPCQC::selectTrack(o2::tpc::TrackTPC const& track)
145147void MatchITSTPCQC::finalize ()
146148{
147149
150+ // first we use mPt and mPtTPC to set the TEfficiency; later they are scaled
151+ if (!mFractionITSTPCmatch ->SetTotalHistogram (*mPtTPC , " " ) ||
152+ !mFractionITSTPCmatch ->SetPassedHistogram (*mPt , " " )) {
153+ LOG (FATAL) << " Something wrong when defining the efficiency histograms!" ;
154+ }
155+
148156 float scaleFactTPC = 1 . / mNTPCSelectedTracks ;
149157 float scaleFactITSTPC = 1 . / mNITSTPCSelectedTracks ;
150- mFractionITSTPCmatch ->Divide (mPt , mPtTPC , 1 , 1 , " b" );
151158 mPtTPC ->Scale (scaleFactTPC);
152159 mPt ->Scale (scaleFactITSTPC);
153160 mEta ->Scale (scaleFactITSTPC);
0 commit comments