@@ -60,6 +60,20 @@ void ITSTPCMatchingTask::initialize(o2::framework::InitContext& /*ctx*/)
6060 mIsSync = common::getFromConfig (mCustomParameters , " isSync" , false );
6161 // MTC ratios
6262 mDoMTCRatios = common::getFromConfig (mCustomParameters , " doMTCRatios" , false );
63+ mDoPtTrending = common::getFromConfig (mCustomParameters , " doTrendingPt" , false );
64+ mTrendingBinPt = common::getFromConfig (mCustomParameters , " trendingBinPt" , 1 .0f );
65+ if (mDoPtTrending && !mDoMTCRatios ) {
66+ ILOG (Fatal) << " Cannot do pt trending while ratios are disabled!" << ENDM;
67+ } else if (mDoPtTrending ) {
68+ mTrendingPt .reset (new TGraph);
69+ mTrendingPt ->SetNameTitle (" mPtTrending" , Form (" ITS-TPC matching efficiency trending at %.1f GeV/c;Cycle;Efficiency" , mTrendingBinPt ));
70+ mTrendingPt ->GetHistogram ()->SetMinimum (0.0 );
71+ mTrendingPt ->GetHistogram ()->SetMaximum (1.05 );
72+ mTrendingPt ->SetMarkerSize (2 );
73+ mTrendingPt ->SetMarkerStyle (20 );
74+ mTrendingPt ->SetMarkerColor (kGreen );
75+ getObjectsManager ()->startPublishing (mTrendingPt .get (), PublicationPolicy::ThroughStop);
76+ }
6377 // K0s
6478 mMatchITSTPCQC .setDoK0QC ((mDoK0s = getFromConfig (mCustomParameters , " doK0QC" , false )));
6579 if (mIsSync && mDoK0s ) {
@@ -76,9 +90,17 @@ void ITSTPCMatchingTask::initialize(o2::framework::InitContext& /*ctx*/)
7690 mBackgroundRangeRight = common::getFromConfig (mCustomParameters , " k0sBackgroundRangeRight" , 0.54 );
7791 mBackground .reset (new TF1 (" gloFitK0sMassBackground" , mFitBackground , mBackgroundRangeLeft , mBackgroundRangeRight , mFitBackground .mNPar ));
7892 mSignalAndBackground .reset (new TF1 (" gloFitK0sMassSignal" , " [0] + [1] * x + [2] * x * x + gaus(3)" , mBackgroundRangeLeft , mBackgroundRangeRight ));
79- mK0sMassTrend .reset (new TGraphErrors);
80- mK0sMassTrend ->SetNameTitle (" mK0MassTrend" , " K0s Mass + Sigma;Cycle;K0s mass (GeV/c^{2})" );
81- getObjectsManager ()->startPublishing (mK0sMassTrend .get (), PublicationPolicy::ThroughStop);
93+
94+ if ((mDoK0sMassTrending = common::getFromConfig (mCustomParameters , " doTrendingK0s" , false ))) {
95+ mK0sMassTrend .reset (new TGraphErrors);
96+ mK0sMassTrend ->SetNameTitle (" mK0MassTrend" , " K0s Mass + Sigma;Cycle;K0s mass (GeV/c^{2})" );
97+ mK0sMassTrend ->SetMarkerSize (2 );
98+ mK0sMassTrend ->SetMarkerStyle (20 );
99+ mK0sMassTrend ->SetMarkerColor (kGreen );
100+ mK0sMassTrend ->GetHistogram ()->SetMinimum (mBackgroundRangeLeft );
101+ mK0sMassTrend ->GetHistogram ()->SetMaximum (mBackgroundRangeRight );
102+ getObjectsManager ()->startPublishing (mK0sMassTrend .get (), PublicationPolicy::ThroughStop);
103+ }
82104 }
83105
84106 mMatchITSTPCQC .initDataRequest ();
@@ -143,6 +165,9 @@ void ITSTPCMatchingTask::endOfCycle()
143165 makeRatio (mEffPt , mMatchITSTPCQC .getFractionITSTPCmatch (gloqc::MatchITSTPCQC::ITS));
144166 getObjectsManager ()->startPublishing (mEffPt .get (), PublicationPolicy::Once);
145167 getObjectsManager ()->setDefaultDrawOptions (mEffPt ->GetName (), " logx" );
168+ if (mDoPtTrending ) {
169+ mTrendingPt ->AddPoint (mNCycle , mEffPt ->GetBinContent (mEffPt ->FindBin (mTrendingBinPt )));
170+ }
146171
147172 // Eta
148173 makeRatio (mEffEta , mMatchITSTPCQC .getFractionITSTPCmatchEta (gloqc::MatchITSTPCQC::ITS));
@@ -180,7 +205,7 @@ void ITSTPCMatchingTask::endOfCycle()
180205
181206 TH1D* h{ nullptr };
182207 getObjectsManager ()->startPublishing ((h = mK0sCycle ->ProjectionY (" mK0sMassVsPtVsOcc_Cycle_pmass" )), PublicationPolicy::Once);
183- if (fitK0sMass (h)) {
208+ if (fitK0sMass (h) && mDoK0sMassTrending ) {
184209 mK0sMassTrend ->AddPoint (mNCycle , mSignalAndBackground ->GetParameter (4 ));
185210 mK0sMassTrend ->SetPointError (mK0sMassTrend ->GetN () - 1 , 0 ., mSignalAndBackground ->GetParameter (5 ));
186211 }
0 commit comments