|
21 | 21 | #include "TH1F.h" |
22 | 22 | #include <TH2F.h> |
23 | 23 | #include "TH2D.h" |
| 24 | +#include "TH3D.h" |
24 | 25 | #include <TProfile.h> |
25 | 26 | #include <TCanvas.h> |
26 | 27 | #include <THStack.h> |
@@ -323,15 +324,16 @@ void CheckDROF(bool plot = false, bool write = false, const std::string& tracfil |
323 | 324 | fOut = TFile::Open("checkDROF.root", "RECREATE"); |
324 | 325 | } |
325 | 326 |
|
| 327 | + const int nb = 100; |
| 328 | + double xbins[nb + 1], ptcutl = 0.01, ptcuth = 10.; |
| 329 | + double a = std::log(ptcuth / ptcutl) / nb; |
| 330 | + for (int i = 0; i <= nb; i++) { |
| 331 | + xbins[i] = ptcutl * std::exp(i * a); |
| 332 | + } |
| 333 | + |
326 | 334 | ////////////////////// |
327 | 335 | // Eff Tracks |
328 | 336 | { |
329 | | - int nb = 100; |
330 | | - double xbins[nb + 1], ptcutl = 0.01, ptcuth = 10.; |
331 | | - double a = std::log(ptcuth / ptcutl) / nb; |
332 | | - for (int i = 0; i <= nb; i++) { |
333 | | - xbins[i] = ptcutl * std::exp(i * a); |
334 | | - } |
335 | 337 | auto num = new TH2D("num", ";#it{p}_{T} (GeV/#it{c});NCls;Efficiency (fake-track rate)", nb, xbins, 4, 4 - 0.5, 8 - 0.5); |
336 | 338 | num->Sumw2(); |
337 | 339 | auto fak = new TH2D("fak", ";#it{p}_{T} (GeV/#it{c});NCls;Fak", nb, xbins, 4, 4 - 0.5, 8 - 0.5); |
@@ -848,6 +850,43 @@ void CheckDROF(bool plot = false, bool write = false, const std::string& tracfil |
848 | 850 | hVtxMCz->Draw("colz"); |
849 | 851 | c->Draw(); |
850 | 852 | } |
| 853 | + ////////////////////// |
| 854 | + // Fake clusters |
| 855 | + if (write) { |
| 856 | + const int nby{4}, nbz{7}; |
| 857 | + double ybins[nby], zbins[nbz]; |
| 858 | + for (int i{0}; i < nby; ++i) { |
| 859 | + ybins[i] = (4 + i) - 0.5; |
| 860 | + } |
| 861 | + for (int i{0}; i < nbz; ++i) { |
| 862 | + zbins[i] = (0 + i) - 0.5; |
| 863 | + } |
| 864 | + auto hFakVal = new TH3D("fakClsVal", "Fake cluster attachment;#it{p}_{T} (GeV/#it{c});NCls;Fake;(fake-cluster rate)", nb, xbins, nby, ybins, nbz, zbins); |
| 865 | + auto hFakMig = new TH3D("fakClsMig", "Fake cluster attachment;#it{p}_{T} (GeV/#it{c});NCls;Fake;(fake-cluster rate)", nb, xbins, nby, ybins, nbz, zbins); |
| 866 | + |
| 867 | + for (auto& event : info) { |
| 868 | + for (auto& part : event) { |
| 869 | + if (!part.isReconstructable()) { |
| 870 | + continue; |
| 871 | + } |
| 872 | + |
| 873 | + const auto& trk = part.track; |
| 874 | + for (int iL{0}; iL < 7; ++iL) { |
| 875 | + if (!trk.hasHitOnLayer(iL) || !trk.isFakeOnLayer(iL) || (part.clusters & (0x1 << iL)) == 0) { |
| 876 | + continue; |
| 877 | + } |
| 878 | + if (trk.hasHitInNextROF()) { |
| 879 | + hFakMig->Fill(trk.getPt(), trk.getNClusters(), iL); |
| 880 | + } else { |
| 881 | + hFakVal->Fill(trk.getPt(), trk.getNClusters(), iL); |
| 882 | + } |
| 883 | + } |
| 884 | + } |
| 885 | + } |
| 886 | + |
| 887 | + hFakMig->Write(); |
| 888 | + hFakVal->Write(); |
| 889 | + } |
851 | 890 | if (fOut) { |
852 | 891 | fOut->Close(); |
853 | 892 | } |
|
0 commit comments