Skip to content

Commit 9b5a6ca

Browse files
committed
GLO: Make MTC reductor configurable
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 2ee92ba commit 9b5a6ca

3 files changed

Lines changed: 69 additions & 10 deletions

File tree

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

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
}
146146
]
147147
},
148-
"MTCTrend": {
148+
"MTCTrend1": {
149149
"active": "true",
150150
"className": "o2::quality_control::postprocessing::TrendingTask",
151151
"moduleName": "QcGLO",
@@ -168,14 +168,65 @@
168168
"mFractionITSTPCmatch_ITS_Hist"
169169
],
170170
"reductorName": "o2::quality_control_modules::glo::MTCReductor",
171+
"reductorParameters": {
172+
"default": {
173+
"default": {
174+
"pt": "1.5"
175+
}
176+
}
177+
},
171178
"moduleName": "QcGLO"
172179
}
173180
],
174181
"plots": [
175182
{
176-
"name": "glo_mtc_pt_trending",
183+
"name": "glo_mtc_pt15_trending",
177184
"title": "MTC at #it{p}_{T}=1.5 trending",
178-
"varexp": "mFractionITSTPCmatch_ITS_Hist.pt:time",
185+
"varexp": "mFractionITSTPCmatch_ITS_Hist.mtc:time",
186+
"option": "*L",
187+
"graphYRange": "0:1.02",
188+
"graphAxisLabel": "MTC:time"
189+
}
190+
]
191+
},
192+
"MTCTrend2": {
193+
"active": "true",
194+
"className": "o2::quality_control::postprocessing::TrendingTask",
195+
"moduleName": "QcGLO",
196+
"detectorName": "GLO",
197+
"resumeTrend": "false",
198+
"initTrigger": [
199+
"once"
200+
],
201+
"updateTrigger": [
202+
"newobject:qcdb:GLO/MO/ITSTPCMatchingTask/mFractionITSTPCmatch_ITS_Hist"
203+
],
204+
"stopTrigger": [
205+
"usercontrol"
206+
],
207+
"dataSources": [
208+
{
209+
"type": "repository",
210+
"path": "GLO/MO/ITSTPCMatchingTask",
211+
"names": [
212+
"mFractionITSTPCmatch_ITS_Hist"
213+
],
214+
"reductorName": "o2::quality_control_modules::glo::MTCReductor",
215+
"reductorParameters": {
216+
"default": {
217+
"default": {
218+
"pt": "0.5"
219+
}
220+
}
221+
},
222+
"moduleName": "QcGLO"
223+
}
224+
],
225+
"plots": [
226+
{
227+
"name": "glo_mtc_pt05_trending",
228+
"title": "MTC at #it{p}_{T}=0.5 trending",
229+
"varexp": "mFractionITSTPCmatch_ITS_Hist.mtc:time",
179230
"option": "*L",
180231
"graphYRange": "0:1.02",
181232
"graphAxisLabel": "MTC:time"

Modules/GLO/include/GLO/Reductors.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ class K0sFitReductor final : public quality_control::postprocessing::ReductorTOb
3535
class MTCReductor final : public quality_control::postprocessing::ReductorTObject
3636
{
3737
void* getBranchAddress() final { return &mStats; };
38-
const char* getBranchLeafList() final { return "pt/F"; };
38+
const char* getBranchLeafList() final;
3939
void update(TObject* obj) final;
4040

4141
private:
4242
struct {
43-
Float_t pt{ 0. };
43+
Float_t mtc{ 0. };
4444
} mStats;
45+
46+
Float_t mPt{ 0 };
4547
};
4648

4749
class PVITSReductor final : public quality_control::postprocessing::ReductorTObject
@@ -56,7 +58,7 @@ class PVITSReductor final : public quality_control::postprocessing::ReductorTObj
5658
Float_t pol1{ 0. };
5759
} mStats;
5860

59-
Double_t mR0{ 0 }, mR1{ 0 };
61+
Float_t mR0{ 0 }, mR1{ 0 };
6062
};
6163

6264
} // namespace o2::quality_control_modules::glo

Modules/GLO/src/Reductors.cxx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,27 @@ void K0sFitReductor::update(TObject* obj)
3434
mStats.sigma = f->GetParameter(helpers::K0sFitter::Parameters::Sigma);
3535
}
3636

37+
const char* MTCReductor::getBranchLeafList()
38+
{
39+
mPt = common::internal::stringToType<Float_t>(mCustomParameters.atOrDefaultValue("pt", "0"));
40+
41+
return "mtc/F";
42+
};
43+
3744
void MTCReductor::update(TObject* obj)
3845
{
3946
auto h = dynamic_cast<TH1*>(obj);
4047
if (!h) {
4148
return;
4249
}
4350

44-
mStats.pt = (float)h->GetBinContent(h->FindBin(1.5));
51+
mStats.mtc = (float)h->GetBinContent(h->FindBin(mPt));
4552
}
4653

4754
const char* PVITSReductor::getBranchLeafList()
4855
{
49-
mR0 = common::internal::stringToType<Double_t>(mCustomParameters.atOrDefaultValue("r0", "0"));
50-
mR1 = common::internal::stringToType<Double_t>(mCustomParameters.atOrDefaultValue("r1", "0"));
56+
mR0 = common::internal::stringToType<Float_t>(mCustomParameters.atOrDefaultValue("r0", "0"));
57+
mR1 = common::internal::stringToType<Float_t>(mCustomParameters.atOrDefaultValue("r1", "0"));
5158

5259
return "pol0/F:pol1/F";
5360
};
@@ -60,7 +67,6 @@ void PVITSReductor::update(TObject* obj)
6067
}
6168

6269
auto res = p->Fit("pol1", "QSNC", "", mR0, mR1);
63-
printf("Fitting from %f to %f -> %d\n", mR0, mR1, (int)res);
6470
if ((Int_t)res != 0) {
6571
return;
6672
}

0 commit comments

Comments
 (0)