Skip to content

Commit ff41d6d

Browse files
committed
Revert "Added Separation Power Plot for Pions and electrons" (#2336)
This reverts commit 31419b8.
1 parent eed9c05 commit ff41d6d

3 files changed

Lines changed: 2 additions & 50 deletions

File tree

Modules/TPC/include/TPC/PID.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class PID final : public TaskInterface
5252

5353
private:
5454
o2::tpc::qc::PID mQCPID{};
55-
TCanvas* mSeparationPower;
56-
std::vector<double> mTrendingParameters;
5755
};
5856

5957
} // namespace o2::quality_control_modules::tpc

Modules/TPC/run/tpcQCPID_sampled.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"className": "o2::quality_control_modules::tpc::PID",
2929
"moduleName": "QcTPC",
3030
"detectorName": "TPC",
31-
"cycleDurationSeconds": "60",
31+
"cycleDurationSeconds": "10",
3232
"dataSource_comment": "The other type of dataSource is \"direct\", see basic-no-sampling.json.",
3333
"dataSource": {
3434
"type": "dataSamplingPolicy",

Modules/TPC/src/PID.cxx

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@
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

8276
void PID::startOfActivity(const Activity& /*activity*/)
8377
{
@@ -103,47 +97,7 @@ void PID::monitorData(o2::framework::ProcessingContext& ctx)
10397

10498
void 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

149103
void PID::endOfActivity(const Activity& /*activity*/)

0 commit comments

Comments
 (0)