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
2322namespace o2 ::quality_control_modules::tpc
2423{
@@ -30,36 +29,28 @@ void* SeparationPowerReductor::getBranchAddress()
3029
3130const char * SeparationPowerReductor::getBranchLeafList ()
3231{
33- return " meanPi /F:meanEl:separationPower" ;
32+ return " amplitudePi /F:meanPi:sigmaPi:amplitudeEl: meanEl:sigmaEl: separationPower:chiSquareOverNdf " ;
3433}
3534
3635void 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