From fcad4285b3d2d7eb0759f29a1db331c68693c4d6 Mon Sep 17 00:00:00 2001 From: Roman Lietava Date: Mon, 25 May 2026 10:01:13 +0200 Subject: [PATCH 1/2] dev: cut for minimal count added --- Detectors/CTP/macro/PlotPbLumi.C | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Detectors/CTP/macro/PlotPbLumi.C b/Detectors/CTP/macro/PlotPbLumi.C index 4bda8d25e006e..1e06bb958cf2a 100644 --- a/Detectors/CTP/macro/PlotPbLumi.C +++ b/Detectors/CTP/macro/PlotPbLumi.C @@ -35,7 +35,7 @@ using namespace o2::ctp; // qc = 0: takes scalers from CCDB (available only for finished runs) otherwise from QCCDB (available for active runs) // t0-tlast: window in seconds counted from beginning of run // -void PlotPbLumi(int runNumber = 567905, bool sum = 0, bool qc = 0, Double_t t0 = 0., Double_t tlast = 0.) +void PlotPbLumi(int runNumber = 572073, bool sum = 1, double cut = 0, bool qc = 0, Double_t t0 = 0., Double_t tlast = 0.) { // // PLots in one canvas // znc rate/28 @@ -173,12 +173,15 @@ void PlotPbLumi(int runNumber = 567905, bool sum = 0, bool qc = 0, Double_t t0 = Double_t* tcetoznc = tcetozncvec.data(); Double_t* vchtoznc = vchtozncvec.data(); for (int i = i0; i < ilast; i++) { + //for (int i = 30; i < 40; i++) { + int iv = i - i0; x[iv] = (double_t)(recs[i + 1].intRecord.orbit + recs[i].intRecord.orbit) / 2. - orbit0; x[iv] *= 88e-6; // x[i] = (double_t)(recs[i+1].epochTime + recs[i].epochTime)/2.; double_t tt = (double_t)(recs[i + 1].intRecord.orbit - recs[i].intRecord.orbit); tt = tt * 88e-6; + //std::cout << i << " " << iv << " " << tt << std::endl; // // std::cout << recs[i+1].scalersInps[25] << std::endl; double_t znci = (double_t)(recs[i + 1].scalersInps[25] - recs[i].scalersInps[25]); @@ -199,15 +202,27 @@ void PlotPbLumi(int runNumber = 567905, bool sum = 0, bool qc = 0, Double_t t0 = // std::cout << recs[i+1].scalers[tce].lmBefore << std::endl; had += recs[i + 1].scalers[tsc].lmBefore - recs[i].scalers[tsc].lmBefore; // rat = (double_t)(had)/double_t(recs[i+1].scalersInps[25] - recs[i].scalersInps[25])*28; - tcetsctoznc[iv] = (double_t)(had) / zncpp[iv] / tt; + if(zncpp[iv] > cut) { + tcetsctoznc[iv] = (double_t)(had) / zncpp[iv] / tt; + } else { + tcetsctoznc[iv] = 0.; + } had = recs[i + 1].scalers[tce].lmBefore - recs[i].scalers[tce].lmBefore; // rat = (double_t)(had)/double_t(recs[i+1].scalersInps[25] - recs[i].scalersInps[25])*28; - tcetoznc[iv] = (double_t)(had) / zncpp[iv] / tt; + if(zncpp[iv] > cut) { + tcetoznc[iv] = (double_t)(had) / zncpp[iv] / tt; + } else { + tcetoznc[iv] = 0.; + } had = recs[i + 1].scalers[vch].lmBefore - recs[i].scalers[vch].lmBefore; double_t muvch = -TMath::Log(1. - had / tt / nbc / frev); // rat = (double_t)(had)/double_t(recs[i+1].scalersInps[25] - recs[i].scalersInps[25])*28; - vchtoznc[iv] = (double_t)(had) / zncpp[iv] / tt; + if(zncpp[iv] > cut) { + vchtoznc[iv] = (double_t)(had) / zncpp[iv] / tt; + } else { + vchtoznc[iv] = 0.; + } // std::cout << "muzdc:" << mu << " mu tce:" << mutce << " muvch:" << muvch << std::endl; } // From 384ee2ff0beb415a6e15f401033f7dd854b57731 Mon Sep 17 00:00:00 2001 From: Roman Lietava Date: Mon, 25 May 2026 10:03:57 +0200 Subject: [PATCH 2/2] clang --- Detectors/CTP/macro/PlotPbLumi.C | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Detectors/CTP/macro/PlotPbLumi.C b/Detectors/CTP/macro/PlotPbLumi.C index 1e06bb958cf2a..1022b6e30d0be 100644 --- a/Detectors/CTP/macro/PlotPbLumi.C +++ b/Detectors/CTP/macro/PlotPbLumi.C @@ -173,7 +173,7 @@ void PlotPbLumi(int runNumber = 572073, bool sum = 1, double cut = 0, bool qc = Double_t* tcetoznc = tcetozncvec.data(); Double_t* vchtoznc = vchtozncvec.data(); for (int i = i0; i < ilast; i++) { - //for (int i = 30; i < 40; i++) { + // for (int i = 30; i < 40; i++) { int iv = i - i0; x[iv] = (double_t)(recs[i + 1].intRecord.orbit + recs[i].intRecord.orbit) / 2. - orbit0; @@ -181,9 +181,9 @@ void PlotPbLumi(int runNumber = 572073, bool sum = 1, double cut = 0, bool qc = // x[i] = (double_t)(recs[i+1].epochTime + recs[i].epochTime)/2.; double_t tt = (double_t)(recs[i + 1].intRecord.orbit - recs[i].intRecord.orbit); tt = tt * 88e-6; - //std::cout << i << " " << iv << " " << tt << std::endl; + // std::cout << i << " " << iv << " " << tt << std::endl; // - // std::cout << recs[i+1].scalersInps[25] << std::endl; + // std::cout << recs[i+1].scalersInps[25] << std::endl; double_t znci = (double_t)(recs[i + 1].scalersInps[25] - recs[i].scalersInps[25]); double_t mu = -TMath::Log(1. - znci / tt / nbc / frev); double_t zncipp = mu * nbc * frev; @@ -202,14 +202,14 @@ void PlotPbLumi(int runNumber = 572073, bool sum = 1, double cut = 0, bool qc = // std::cout << recs[i+1].scalers[tce].lmBefore << std::endl; had += recs[i + 1].scalers[tsc].lmBefore - recs[i].scalers[tsc].lmBefore; // rat = (double_t)(had)/double_t(recs[i+1].scalersInps[25] - recs[i].scalersInps[25])*28; - if(zncpp[iv] > cut) { + if (zncpp[iv] > cut) { tcetsctoznc[iv] = (double_t)(had) / zncpp[iv] / tt; } else { tcetsctoznc[iv] = 0.; } had = recs[i + 1].scalers[tce].lmBefore - recs[i].scalers[tce].lmBefore; // rat = (double_t)(had)/double_t(recs[i+1].scalersInps[25] - recs[i].scalersInps[25])*28; - if(zncpp[iv] > cut) { + if (zncpp[iv] > cut) { tcetoznc[iv] = (double_t)(had) / zncpp[iv] / tt; } else { tcetoznc[iv] = 0.; @@ -218,7 +218,7 @@ void PlotPbLumi(int runNumber = 572073, bool sum = 1, double cut = 0, bool qc = double_t muvch = -TMath::Log(1. - had / tt / nbc / frev); // rat = (double_t)(had)/double_t(recs[i+1].scalersInps[25] - recs[i].scalersInps[25])*28; - if(zncpp[iv] > cut) { + if (zncpp[iv] > cut) { vchtoznc[iv] = (double_t)(had) / zncpp[iv] / tt; } else { vchtoznc[iv] = 0.;