Skip to content

Commit c155de9

Browse files
authored
TPC: Update Reductor for PID SepPower to new data format (#2345)
* TPC Reductor PID Separation Power
1 parent 7eb4e7b commit c155de9

3 files changed

Lines changed: 34 additions & 33 deletions

File tree

Modules/TPC/include/TPC/SeparationPowerReductor.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#define QC_MODULE_TPC_SEPARATIONPOWERREDUCTOR_H
1818

1919
#include "QualityControl/ReductorTObject.h"
20-
#include <TText.h>
2120

2221
namespace o2::quality_control_modules::tpc
2322
{
@@ -37,12 +36,15 @@ class SeparationPowerReductor : public quality_control::postprocessing::Reductor
3736

3837
private:
3938
struct {
39+
float amplitudePi;
4040
float meanPi;
41+
float sigmaPi;
42+
float amplitudeEl;
4143
float meanEl;
44+
float sigmaEl;
4245
float separationPower;
46+
float chiSquareOverNdf;
4347
} mSeparationPower;
44-
45-
float getValue(TText* line);
4648
};
4749

4850
} // namespace o2::quality_control_modules::tpc

Modules/TPC/run/tpcQCTrending_separationpower.json

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{
3434
"type": "repository",
3535
"path": "TPC/MO/PID",
36-
"name": "CSeparationPower",
36+
"name": "pSeparationPower",
3737
"reductorName": "o2::quality_control_modules::tpc::SeparationPowerReductor",
3838
"moduleName": "QcTPC"
3939
}
@@ -42,23 +42,31 @@
4242
{
4343
"name": "sepPower_MeanPi",
4444
"title": "Trend of Separation Power Mean Pion",
45-
"varexp": "CSeparationPower.meanPi:time",
45+
"varexp": "pSeparationPower.meanPi:time",
4646
"selection": "",
4747
"option": "*L",
48-
"graphErrors": ""
48+
"graphErrors": "0:sigmaPi"
4949
},
5050
{
5151
"name": "sepPower_El",
5252
"title": "Trend of Separation Power Mean Electron",
53-
"varexp": "CSeparationPower.meanEl:time",
53+
"varexp": "pSeparationPower.meanEl:time",
5454
"selection": "",
5555
"option": "*L",
56-
"graphErrors": ""
56+
"graphErrors": "0:sigmaEl"
5757
},
5858
{
5959
"name": "sepPower_SeparationPower",
6060
"title": "Trend of SeparationPower",
61-
"varexp": "CSeparationPower.separationPower:time",
61+
"varexp": "pSeparationPower.separationPower:time",
62+
"selection": "",
63+
"option": "*L",
64+
"graphErrors": ""
65+
},
66+
{
67+
"name": "sepPower_ChiSquareOverNDF",
68+
"title": "Trend of SeparationPower ChiSquare/NDF fit",
69+
"varexp": "pSeparationPower.chiSquareOverNdf:time",
6270
"selection": "",
6371
"option": "*L",
6472
"graphErrors": ""
@@ -68,7 +76,7 @@
6876
"userorcontrol"
6977
],
7078
"updateTrigger": [
71-
"foreachlatest:ccdb:qc/TPC/MO/PID/CSeparationPower"
79+
"foreachlatest:ccdb:qc/TPC/MO/PID/pSeparationPower"
7280
],
7381
"stopTrigger": [
7482
"userorcontrol"

Modules/TPC/src/SeparationPowerReductor.cxx

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
#include "QualityControl/QcInfoLogger.h"
1818
#include <boost/algorithm/string.hpp>
1919
#include <string>
20-
#include <TCanvas.h>
21-
#include <TPaveText.h>
20+
#include <TProfile.h>
2221

2322
namespace o2::quality_control_modules::tpc
2423
{
@@ -30,36 +29,28 @@ void* SeparationPowerReductor::getBranchAddress()
3029

3130
const char* SeparationPowerReductor::getBranchLeafList()
3231
{
33-
return "meanPi/F:meanEl:separationPower";
32+
return "amplitudePi/F:meanPi:sigmaPi:amplitudeEl:meanEl:sigmaEl:separationPower:chiSquareOverNdf";
3433
}
3534

3635
void SeparationPowerReductor::update(TObject* obj)
3736
{
38-
// The values for the separation power are saved in a TPaveText inside a TCanvas 'obj'.
37+
// The values for the separation power are saved in a TProfile
3938
if (obj) {
40-
if (auto canvas = static_cast<TCanvas*>(obj)) {
41-
if (auto blocText = static_cast<TPaveText*>(canvas->GetPrimitive("TPave"))) {
42-
mSeparationPower.meanPi = getValue((TText*)blocText->GetLineWith("Mean Pi:"));
43-
mSeparationPower.meanEl = getValue((TText*)blocText->GetLineWith("Mean El:"));
44-
mSeparationPower.separationPower = getValue((TText*)blocText->GetLineWith("separationPower:"));
45-
}
39+
if (auto profile = static_cast<TProfile*>(obj)) {
40+
mSeparationPower.amplitudePi = profile->GetBinContent(1);
41+
mSeparationPower.meanPi = profile->GetBinContent(2);
42+
mSeparationPower.sigmaPi = profile->GetBinContent(3);
43+
44+
mSeparationPower.amplitudeEl = profile->GetBinContent(4);
45+
mSeparationPower.meanEl = profile->GetBinContent(5);
46+
mSeparationPower.sigmaEl = profile->GetBinContent(6);
47+
48+
mSeparationPower.separationPower = profile->GetBinContent(7);
49+
mSeparationPower.chiSquareOverNdf = profile->GetBinContent(8);
4650
}
4751
} else {
4852
ILOG(Error, Support) << "No 'obj' found." << ENDM;
4953
}
5054
}
5155

52-
float SeparationPowerReductor::getValue(TText* line)
53-
{
54-
if (!line) {
55-
return 0.;
56-
}
57-
58-
std::string text = static_cast<std::string>(line->GetTitle());
59-
const std::size_t posEndType = text.find(":");
60-
std::string quantity = text.substr(posEndType + 2, -1); // take string (excluding : and empty space) till end of line
61-
62-
return stof(quantity);
63-
}
64-
6556
} // namespace o2::quality_control_modules::tpc

0 commit comments

Comments
 (0)