1818#include < TCanvas.h>
1919#include < TH1.h>
2020#include < TH2.h>
21- #include < TF1.h>
22- #include < TPaveText.h>
2321
2422// O2 includes
2523#include " Framework/ProcessingContext.h"
2624#include " DataFormatsTPC/TrackTPC.h"
2725#include " TPCQC/Helpers.h"
2826#include < Framework/InputRecord.h>
29- #include " TPC/Utility.h"
3027
3128// QC includes
3229#include " QualityControl/QcInfoLogger.h"
@@ -74,10 +71,7 @@ void PID::initialize(o2::framework::InitContext& /*ctx*/)
7471 getObjectsManager ()->startPublishing (canv.get ());
7572 }
7673 }
77- mSeparationPower = mQCPID .getSeparationPowerCanvas ();
78- getObjectsManager ()->startPublishing (mSeparationPower );
79-
80- } // namespace o2::quality_control_modules::tpc
74+ }
8175
8276void PID::startOfActivity (const Activity& /* activity*/ )
8377{
@@ -103,47 +97,7 @@ void PID::monitorData(o2::framework::ProcessingContext& ctx)
10397
10498void PID::endOfCycle ()
10599{
106- // ===| Fitting Histogram for separation Power |============================================================
107- std::unique_ptr<TF1 > fitFunc = std::make_unique<TF1 >(" fitFunc" , " [0]*exp(-0.5*((x-[1])/[2])^2) + [3]*exp(-0.5*((x-[4])/[5])^2)" , 0 , 100 );
108-
109- for (auto const & pair : mQCPID .getMapOfHisto ()) {
110- for (auto & hist : pair.second ) {
111- // if (std::static_cast<string>(pair.first).compare("hdEdxMaxMIP") == 0) {
112- if (pair.first .compare (" hdEdxMaxMIP" ) == 0 ) {
113- mTrendingParameters .clear ();
114- // Define fitting function: sum of two Gaussians with an offset
115- // Set initial parameters for the fit
116- fitFunc->SetParameter (0 , 3000 ); // Amplitude of the first Gaussian
117- fitFunc->SetParameter (1 , 50 ); // Mean of the first Gaussian
118- fitFunc->SetParLimits (1 , 45 , 55 );
119- fitFunc->SetParameter (2 , 2 ); // Sigma of the first Gaussian
120- fitFunc->SetParameter (3 , 100 ); // Amplitude of the second Gaussian
121- fitFunc->SetParameter (4 , 75 ); // Mean of the second Gaussian
122- fitFunc->SetParLimits (4 , 60 , 90 );
123- fitFunc->SetParameter (5 , 10 ); // Sigma of the second Gaussian
124-
125- // Fit the histogram with the fitting function
126- hist->Fit (fitFunc.get (), " QR" );
127-
128- // Retrieve parameters of the fitted function
129- mTrendingParameters .emplace_back (fitFunc->GetParameter (1 )); // Mean pion
130- mTrendingParameters .emplace_back (fitFunc->GetParameter (2 )); // sigma pion
131- mTrendingParameters .emplace_back (fitFunc->GetParameter (4 )); // Mean electron
132- mTrendingParameters .emplace_back (fitFunc->GetParameter (5 )); // sigma electro
133- }
134- }
135- }
136-
137100 ILOG (Debug, Devel) << " endOfCycle" << ENDM ;
138-
139- TPaveText* pSeparationPower = new TPaveText (.05 , .05 , .95 , .95 );
140- pSeparationPower->AddText (fmt::format (" Mean Pi: {:.3}" , mTrendingParameters [0 ]).c_str ());
141- pSeparationPower->AddText (fmt::format (" Sigma Pi: {:.3}" , mTrendingParameters [1 ]).c_str ());
142- pSeparationPower->AddText (fmt::format (" Mean El: {:.3}" , mTrendingParameters [2 ]).c_str ());
143- pSeparationPower->AddText (fmt::format (" Sigma El: {:.3}" , mTrendingParameters [3 ]).c_str ());
144- pSeparationPower->AddText (fmt::format (" separationPower: {:.3}" , (mTrendingParameters [2 ] - mTrendingParameters [0 ]) / (mTrendingParameters [1 ] / 2 . + mTrendingParameters [3 ] / 2 .)).c_str ());
145- mSeparationPower ->cd ();
146- pSeparationPower->Draw ();
147101}
148102
149103void PID::endOfActivity (const Activity& /* activity*/ )
0 commit comments