Skip to content

Commit fcad428

Browse files
committed
dev: cut for minimal count added
1 parent aafbebf commit fcad428

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

Detectors/CTP/macro/PlotPbLumi.C

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ using namespace o2::ctp;
3535
// qc = 0: takes scalers from CCDB (available only for finished runs) otherwise from QCCDB (available for active runs)
3636
// t0-tlast: window in seconds counted from beginning of run
3737
//
38-
void PlotPbLumi(int runNumber = 567905, bool sum = 0, bool qc = 0, Double_t t0 = 0., Double_t tlast = 0.)
38+
void PlotPbLumi(int runNumber = 572073, bool sum = 1, double cut = 0, bool qc = 0, Double_t t0 = 0., Double_t tlast = 0.)
3939
{ //
4040
// PLots in one canvas
4141
// znc rate/28
@@ -173,12 +173,15 @@ void PlotPbLumi(int runNumber = 567905, bool sum = 0, bool qc = 0, Double_t t0 =
173173
Double_t* tcetoznc = tcetozncvec.data();
174174
Double_t* vchtoznc = vchtozncvec.data();
175175
for (int i = i0; i < ilast; i++) {
176+
//for (int i = 30; i < 40; i++) {
177+
176178
int iv = i - i0;
177179
x[iv] = (double_t)(recs[i + 1].intRecord.orbit + recs[i].intRecord.orbit) / 2. - orbit0;
178180
x[iv] *= 88e-6;
179181
// x[i] = (double_t)(recs[i+1].epochTime + recs[i].epochTime)/2.;
180182
double_t tt = (double_t)(recs[i + 1].intRecord.orbit - recs[i].intRecord.orbit);
181183
tt = tt * 88e-6;
184+
//std::cout << i << " " << iv << " " << tt << std::endl;
182185
//
183186
// std::cout << recs[i+1].scalersInps[25] << std::endl;
184187
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 =
199202
// std::cout << recs[i+1].scalers[tce].lmBefore << std::endl;
200203
had += recs[i + 1].scalers[tsc].lmBefore - recs[i].scalers[tsc].lmBefore;
201204
// rat = (double_t)(had)/double_t(recs[i+1].scalersInps[25] - recs[i].scalersInps[25])*28;
202-
tcetsctoznc[iv] = (double_t)(had) / zncpp[iv] / tt;
205+
if(zncpp[iv] > cut) {
206+
tcetsctoznc[iv] = (double_t)(had) / zncpp[iv] / tt;
207+
} else {
208+
tcetsctoznc[iv] = 0.;
209+
}
203210
had = recs[i + 1].scalers[tce].lmBefore - recs[i].scalers[tce].lmBefore;
204211
// rat = (double_t)(had)/double_t(recs[i+1].scalersInps[25] - recs[i].scalersInps[25])*28;
205-
tcetoznc[iv] = (double_t)(had) / zncpp[iv] / tt;
212+
if(zncpp[iv] > cut) {
213+
tcetoznc[iv] = (double_t)(had) / zncpp[iv] / tt;
214+
} else {
215+
tcetoznc[iv] = 0.;
216+
}
206217
had = recs[i + 1].scalers[vch].lmBefore - recs[i].scalers[vch].lmBefore;
207218
double_t muvch = -TMath::Log(1. - had / tt / nbc / frev);
208219

209220
// rat = (double_t)(had)/double_t(recs[i+1].scalersInps[25] - recs[i].scalersInps[25])*28;
210-
vchtoznc[iv] = (double_t)(had) / zncpp[iv] / tt;
221+
if(zncpp[iv] > cut) {
222+
vchtoznc[iv] = (double_t)(had) / zncpp[iv] / tt;
223+
} else {
224+
vchtoznc[iv] = 0.;
225+
}
211226
// std::cout << "muzdc:" << mu << " mu tce:" << mutce << " muvch:" << muvch << std::endl;
212227
}
213228
//

0 commit comments

Comments
 (0)