diff --git a/Detectors/CTP/macro/PlotPbLumi.C b/Detectors/CTP/macro/PlotPbLumi.C index 4bda8d25e006e..1022b6e30d0be 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,14 +173,17 @@ 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; + // 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; @@ -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; } //