1818// root includes
1919#include " TStyle.h"
2020#include " TFile.h"
21- #include " TCanvas.h"
2221#include " TMathBase.h"
2322#include " TObjArray.h"
2423
@@ -93,16 +92,11 @@ void PID::initializeHistograms()
9392 mMapHist [" hdEdxMaxMIPVsSec" ].emplace_back (std::make_unique<TH2F>(fmt::format (" hdEdxMaxMIPVsSec_{}" , name).data (), (fmt::format (" MIP Q_{{Max}} {}" , name) + " ;sector;d#it{E}/d#it{x}_{Max} (arb. unit)" ).data (), binsSec.bins , binsSec.min , binsSec.max , binsdEdxMIPMax.bins , binsdEdxMIPMax.min , binsdEdxMIPMax.max ));
9493 mMapHist [" hMIPNclVsTgl" ].emplace_back (std::make_unique<TH2F>(fmt::format (" hMIPNclVsTgl_{}" , name).data (), (fmt::format (" rec. clusters {}" , name) + " ;#tan(#lambda); rec clusters" ).data (), 50 , -2 , 2 , nclMax[idEdxType] - nclCuts[idEdxType], nclCuts[idEdxType], nclMax[idEdxType]));
9594 mMapHist [" hMIPNclVsTglSub" ].emplace_back (std::make_unique<TH2F>(fmt::format (" hMIPNclVsTglSub_{}" , name).data (), (fmt::format (" sub-thrs. clusters {}" , name) + " ;#tan(#lambda);sub-thrs. clusters" ).data (), 50 , -2 , 2 , 20 , 0 , 20 ));
96- if (mCreateCanvas ) {
97- mMapHistCanvas [" hdEdxVspHypoPos" ].emplace_back (std::make_unique<TH2F>(fmt::format (" hdEdxVspHypoPos_{}" , name).data (), (fmt::format (" Q_{{Tot}} Pos {}" , name) + " ;#it{p} (GeV/#it{c});d#it{E}/d#it{x}_{Tot} (arb. unit)" ).data (), 200 , bins.data (), binNumber, binsdEdxTot_Log.data ()));
98- mMapHistCanvas [" hdEdxVspHypoNeg" ].emplace_back (std::make_unique<TH2F>(fmt::format (" hdEdxVspHypoNeg_{}" , name).data (), (fmt::format (" Q_{{Tot}} Neg {}" , name) + " ;#it{p} (GeV/#it{c});d#it{E}/d#it{x}_{Tot} (arb. unit)" ).data (), 200 , bins.data (), binNumber, binsdEdxTot_Log.data ()));
95+ if (mGetdEdxVspHypoHist ) {
96+ mMapHist [" hdEdxVspHypoPos" ].emplace_back (std::make_unique<TH2F>(fmt::format (" hdEdxVspHypoPos_{}" , name).data (), (fmt::format (" Q_{{Tot}} Pos {}" , name) + " ;#it{p} (GeV/#it{c});d#it{E}/d#it{x}_{Tot} (arb. unit)" ).data (), 200 , bins.data (), binNumber, binsdEdxTot_Log.data ()));
97+ mMapHist [" hdEdxVspHypoNeg" ].emplace_back (std::make_unique<TH2F>(fmt::format (" hdEdxVspHypoNeg_{}" , name).data (), (fmt::format (" Q_{{Tot}} Neg {}" , name) + " ;#it{p} (GeV/#it{c});d#it{E}/d#it{x}_{Tot} (arb. unit)" ).data (), 200 , bins.data (), binNumber, binsdEdxTot_Log.data ()));
9998 }
10099 }
101- if (mCreateCanvas ) {
102- mMapCanvas [" CdEdxPIDHypothesisVsp" ].emplace_back (std::make_unique<TCanvas>(" CdEdxPIDHypothesisVsp" , " PID Hypothesis Ratio" ));
103- mMapCanvas [" CdEdxPIDHypothesisVsp" ].at (0 )->Divide (5 , 2 );
104- }
105- mSeparationPowerCanvas .reset (new TCanvas (" CSeparationPower" , " Separation Power" ));
106100}
107101
108102// ______________________________________________________________________________
@@ -113,11 +107,6 @@ void PID::resetHistograms()
113107 hist->Reset ();
114108 }
115109 }
116- for (const auto & pair : mMapHistCanvas ) {
117- for (auto & hist : pair.second ) {
118- hist->Reset ();
119- }
120- }
121110}
122111
123112// ______________________________________________________________________________
@@ -185,10 +174,10 @@ bool PID::processTrack(const o2::tpc::TrackTPC& track, size_t nTracks)
185174 if (std::abs (tgl) < mCutAbsTgl ) {
186175 mMapHist [" hdEdxTotVsp" ][idEdxType]->Fill (pTPC, dEdxTot[idEdxType]);
187176 mMapHist [" hdEdxMaxVsp" ][idEdxType]->Fill (pTPC, dEdxMax[idEdxType]);
188- if (mCreateCanvas ) {
177+ if (mGetdEdxVspHypoHist ) {
189178 const auto pidHypothesis = track.getPID ().getID ();
190179 if (pidHypothesis <= o2::track::PID::NIDs) {
191- auto pidHist = mMapHistCanvas [(track.getCharge () > 0 ) ? " hdEdxVspHypoPos" : " hdEdxVspHypoNeg" ][idEdxType].get ();
180+ auto pidHist = mMapHist [(track.getCharge () > 0 ) ? " hdEdxVspHypoPos" : " hdEdxVspHypoNeg" ][idEdxType].get ();
192181 pidHist->SetBinContent (pidHist->GetXaxis ()->FindBin (pTPC), pidHist->GetYaxis ()->FindBin (dEdxTot[idEdxType]), pidHypothesis + 1 );
193182 }
194183 }
@@ -227,21 +216,6 @@ bool PID::processTrack(const o2::tpc::TrackTPC& track, size_t nTracks)
227216 }
228217 }
229218 }
230-
231- if (mCreateCanvas ) {
232- for (auto const & pairC : mMapCanvas ) {
233- for (auto & canv : pairC.second ) {
234- int h = 1 ;
235- for (auto const & pairH : mMapHistCanvas ) {
236- for (auto & hist : pairH.second ) {
237- canv->cd (h);
238- hist->Draw ();
239- h++;
240- }
241- }
242- }
243- }
244- }
245219 return true ;
246220}
247221
0 commit comments