Skip to content

Commit 2fb6317

Browse files
committed
GLO: Add mtc pt trending
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent fd266c4 commit 2fb6317

File tree

6 files changed

+82
-6
lines changed

6 files changed

+82
-6
lines changed

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"GID": "ITS-TPC,ITS",
5050
"verbose": "false",
5151
"doMTCRatios": "true",
52+
"doMTCTrending": "true",
5253
"doK0QC": "true",
5354
"isSync": "true",
5455
"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"
@@ -131,16 +132,55 @@
131132
"title": "Fitted K0s mass",
132133
"varexp": "gloFitK0sMassSignal.mean:time",
133134
"option": "*L",
135+
"graphYRange": "0.45:0.55",
134136
"graphAxisLabel": "K0s mass (GeV/c^{2}):time"
135137
},
136138
{
137139
"name": "glo_k0s_sigma_trending",
138140
"title": "Fitted K0s sigma",
139141
"varexp": "gloFitK0sMassSignal.sigma:time",
140142
"option": "*L",
143+
"graphYRange": "0:0.01",
141144
"graphAxisLabel": "#sigma_{K0s mass (GeV/c^{2})}:time"
142145
}
143146
]
147+
},
148+
"MTCTrend": {
149+
"active": "true",
150+
"className": "o2::quality_control::postprocessing::TrendingTask",
151+
"moduleName": "QcGLO",
152+
"detectorName": "GLO",
153+
"resumeTrend": "false",
154+
"initTrigger": [
155+
"once"
156+
],
157+
"updateTrigger": [
158+
"newobject:qcdb:GLO/MO/ITSTPCMatchingTask/gloMTCTrendingObject"
159+
],
160+
"stopTrigger": [
161+
"usercontrol"
162+
],
163+
"dataSources": [
164+
{
165+
"type": "repository",
166+
"path": "GLO/MO/ITSTPCMatchingTask",
167+
"names": [
168+
"gloMTCTrendingObject"
169+
],
170+
"reductorName": "o2::quality_control_modules::glo::MTCReductor",
171+
"moduleName": "QcGLO"
172+
}
173+
],
174+
"plots": [
175+
{
176+
"name": "glo_mtc_pt_trending",
177+
"title": "MTC #it{p}_{T} trending",
178+
"varexp": "gloMTCTrendingObject.pt:time",
179+
"option": "*L",
180+
"graphYRange": "0:1.02",
181+
"graphAxisLabel": "MTC:time"
182+
}
183+
]
144184
}
145185
}
146186
}

Modules/GLO/include/GLO/ITSTPCMatchingTask.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "GLOQC/MatchITSTPCQC.h"
2222
#include "Common/TH1Ratio.h"
2323
#include "GLO/Helpers.h"
24+
#include "GLO/Reductors.h"
2425

2526
#include <CommonConstants/PhysicsConstants.h>
2627

@@ -56,6 +57,9 @@ class ITSTPCMatchingTask final : public TaskInterface
5657
std::unique_ptr<common::TH1FRatio> mEffPt;
5758
std::unique_ptr<common::TH1FRatio> mEffEta;
5859
std::unique_ptr<common::TH1FRatio> mEffPhi;
60+
bool mDoMTCTrending{ false };
61+
float mMTCTrendingPt{ 1.5 };
62+
std::unique_ptr<TF1> mMTCTrendingObject;
5963

6064
bool mDoK0s{ false };
6165
bool mPublishK0s3D{ false };

Modules/GLO/include/GLO/LinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
#pragma link C++ class o2::quality_control_modules::glo::ITSTPCMatchingTask + ;
1515
#pragma link C++ class o2::quality_control_modules::glo::ITSTPCmatchingCheck + ;
1616
#pragma link C++ class o2::quality_control_modules::glo::K0sFitReductor + ;
17+
#pragma link C++ class o2::quality_control_modules::glo::MTCReductor + ;
1718
#endif

Modules/GLO/include/GLO/Reductors.h

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,25 @@ namespace o2::quality_control_modules::glo
2020
class K0sFitReductor final : public quality_control::postprocessing::ReductorTObject
2121
{
2222
void* getBranchAddress() final { return &mStats; };
23-
const char* getBranchLeafList() final { return "mean/D:sigma"; };
24-
void update(TObject* obj) override;
23+
const char* getBranchLeafList() final { return "mean/F:sigma/F"; };
24+
void update(TObject* obj) final;
2525

2626
private:
2727
struct {
28-
Double_t mean;
29-
Double_t stddev;
28+
Float_t mean;
29+
Float_t sigma;
30+
} mStats;
31+
};
32+
33+
class MTCReductor final : public quality_control::postprocessing::ReductorTObject
34+
{
35+
void* getBranchAddress() final { return &mStats; };
36+
const char* getBranchLeafList() final { return "pt/F"; };
37+
void update(TObject* obj) final;
38+
39+
private:
40+
struct {
41+
Float_t pt;
3042
} mStats;
3143
};
3244

Modules/GLO/src/ITSTPCMatchingTask.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ void ITSTPCMatchingTask::initialize(o2::framework::InitContext& /*ctx*/)
5555
// Sync
5656
mIsSync = common::getFromConfig(mCustomParameters, "isSync", false);
5757
// MTC ratios
58-
mDoMTCRatios = common::getFromConfig(mCustomParameters, "doMTCRatios", false);
58+
if ((mDoMTCRatios = common::getFromConfig(mCustomParameters, "doMTCRatios", false))) {
59+
if ((mDoMTCTrending = getFromConfig(mCustomParameters, "doMTCTrending", false))) {
60+
mMTCTrendingPt = getFromConfig(mCustomParameters, "trendingPt", 1.5f);
61+
mMTCTrendingObject.reset(new TF1("gloMTCTrendingObject", "pol0"));
62+
}
63+
}
5964
// K0s
6065
mMatchITSTPCQC.setDoK0QC((mDoK0s = getFromConfig(mCustomParameters, "doK0QC", false)));
6166
if (mIsSync && mDoK0s) {
@@ -131,6 +136,10 @@ void ITSTPCMatchingTask::endOfCycle()
131136
makeRatio(mEffPt, mMatchITSTPCQC.getFractionITSTPCmatch(gloqc::MatchITSTPCQC::ITS));
132137
getObjectsManager()->startPublishing(mEffPt.get(), PublicationPolicy::Once);
133138
getObjectsManager()->setDefaultDrawOptions(mEffPt->GetName(), "logx");
139+
if (mDoMTCTrending) {
140+
mMTCTrendingObject->SetParameter(0, mEffPt->GetBinContent(mEffPt->FindBin(mMTCTrendingPt)));
141+
getObjectsManager()->startPublishing<true>(mMTCTrendingObject.get(), PublicationPolicy::Once);
142+
}
134143

135144
// Eta
136145
makeRatio(mEffEta, mMatchITSTPCQC.getFractionITSTPCmatchEta(gloqc::MatchITSTPCQC::ITS));

Modules/GLO/src/Reductors.cxx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ void K0sFitReductor::update(TObject* obj)
2525
}
2626

2727
mStats.mean = f->GetParameter(helpers::K0sFitter::Parameters::Mass);
28-
mStats.stddev = f->GetParameter(helpers::K0sFitter::Parameters::Sigma);
28+
mStats.sigma = f->GetParameter(helpers::K0sFitter::Parameters::Sigma);
29+
}
30+
31+
void MTCReductor::update(TObject* obj)
32+
{
33+
auto f = dynamic_cast<TF1*>(obj);
34+
if (!f) {
35+
return;
36+
}
37+
38+
mStats.pt = f->GetParameter(0);
2939
}
3040

3141
} // namespace o2::quality_control_modules::glo

0 commit comments

Comments
 (0)