Skip to content

Commit aef6b38

Browse files
committed
drof macro
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent b130d65 commit aef6b38

1 file changed

Lines changed: 45 additions & 6 deletions

File tree

Detectors/ITSMFT/ITS/macros/test/CheckDROF.C

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "TH1F.h"
2222
#include <TH2F.h>
2323
#include "TH2D.h"
24+
#include "TH3D.h"
2425
#include <TProfile.h>
2526
#include <TCanvas.h>
2627
#include <THStack.h>
@@ -323,15 +324,16 @@ void CheckDROF(bool plot = false, bool write = false, const std::string& tracfil
323324
fOut = TFile::Open("checkDROF.root", "RECREATE");
324325
}
325326

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+
326334
//////////////////////
327335
// Eff Tracks
328336
{
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-
}
335337
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);
336338
num->Sumw2();
337339
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
848850
hVtxMCz->Draw("colz");
849851
c->Draw();
850852
}
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+
}
851890
if (fOut) {
852891
fOut->Close();
853892
}

0 commit comments

Comments
 (0)