Skip to content

Commit 100ed94

Browse files
committed
GLO: Add MTC Trending
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent c1ab963 commit 100ed94

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

Modules/GLO/glo-itstpc-mtch-qcmn-test.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@
4848
"taskParameters": {
4949
"GID": "ITS-TPC,ITS",
5050
"verbose": "false",
51-
"doMTCratios": "true",
51+
"doMTCRatios": "true",
52+
"doTrendingPt": "true",
5253
"doK0QC": "true",
54+
"doTrendingK0s": "true",
5355
"isSync": "true",
5456
"trackSourcesK0": "ITS,TPC,ITS-TPC,ITS-TPC-TOF,TPC-TOF,TPC-TRD,ITS-TPC-TRD,TPC-TRD-TOF,ITS-TPC-TOF,ITS-TPC-TRD-TOF"
5557
},

Modules/GLO/include/GLO/ITSTPCMatchingTask.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,15 @@ class ITSTPCMatchingTask final : public TaskInterface
6666
std::unique_ptr<common::TH1FRatio> mEffEta;
6767
std::unique_ptr<common::TH1FRatio> mEffPhi;
6868

69+
bool mDoPtTrending{ false };
70+
float mTrendingBinPt{ 1.0 };
71+
std::unique_ptr<TGraph> mTrendingPt;
72+
6973
bool mDoK0s{ false };
7074
static constexpr auto mMassK0s{ o2::constants::physics::MassK0Short };
7175
std::unique_ptr<TH3F> mK0sCycle;
7276
std::unique_ptr<TH3F> mK0sIntegral;
77+
bool mDoK0sMassTrending{ false };
7378
std::unique_ptr<TGraphErrors> mK0sMassTrend;
7479
bool fitK0sMass(TH1* h);
7580
double mBackgroundRangeLeft{ 0.45 };

Modules/GLO/src/ITSTPCMatchingTask.cxx

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)