Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions Detectors/CTP/macro/PlotPbLumi.C
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void PlotPbLumi(int runNumber = 567905, bool qc = 0)
std::cout << "Timestamp:" << timeStamp << std::endl;
// Filling
auto lhcifdata = ccdbMgr.getForRun<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", runNumber);
//auto lhcifdata = ccdbMgr.getSpecific<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", timeStamp, metadata);
// auto lhcifdata = ccdbMgr.getSpecific<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", timeStamp, metadata);
if (!lhcifdata) {
throw std::runtime_error("No GRPLHCIFData for run " + std::to_string(runNumber));
}
Expand All @@ -61,7 +61,7 @@ void PlotPbLumi(int runNumber = 567905, bool qc = 0)
std::map<string, string> metadata;
metadata["runNumber"] = srun;
CTPRunScalers* scl = nullptr;
if(qc) {
if (qc) {
ccdbMgr.setURL("http://ali-qcdb-gpn.cern.ch:8083");
scl = ccdbMgr.getSpecific<CTPRunScalers>(mCCDBPathCTPScalersQC, timeStamp, metadata);
} else {
Expand Down Expand Up @@ -138,17 +138,17 @@ void PlotPbLumi(int runNumber = 567905, bool qc = 0)
double_t orbit0 = recs[0].intRecord.orbit;
int n = recs.size() - 1;
std::cout << " Run duration:" << Trun << " Scalers size:" << n + 1 << std::endl;
//Double_t x[n], znc[n], zncpp[n];
// Double_t x[n], znc[n], zncpp[n];
std::vector<Double_t> xvec(n), zncvec(n), zncppvec(n), zncclassvec(n);
Double_t *x = xvec.data();
Double_t *znc = zncvec.data();
Double_t *zncpp = zncppvec.data();
Double_t *zncclass = zncclassvec.data();
//Double_t tcetsctoznc[n], tcetoznc[n], vchtoznc[n];
Double_t* x = xvec.data();
Double_t* znc = zncvec.data();
Double_t* zncpp = zncppvec.data();
Double_t* zncclass = zncclassvec.data();
// Double_t tcetsctoznc[n], tcetoznc[n], vchtoznc[n];
std::vector<Double_t> tcetsctozncvec(n), tcetozncvec(n), vchtozncvec(n);
Double_t *tcetsctoznc = tcetsctozncvec.data();
Double_t *tcetoznc = tcetozncvec.data();
Double_t *vchtoznc = vchtozncvec.data();
Double_t* tcetsctoznc = tcetsctozncvec.data();
Double_t* tcetoznc = tcetozncvec.data();
Double_t* vchtoznc = vchtozncvec.data();
bool sum = 0;
for (int i = 0; i < n; i++) {
x[i] = (double_t)(recs[i + 1].intRecord.orbit + recs[i].intRecord.orbit) / 2. - orbit0;
Expand All @@ -165,11 +165,11 @@ void PlotPbLumi(int runNumber = 567905, bool qc = 0)
znc[i] = znci / 28. / tt;
// znc class
znci = recs[i + 1].scalers[zncclsi].l1Before - recs[i].scalers[zncclsi].l1Before;
zncclass[i] = znci / 28. /tt;
//std::cout << znc[i]/zncclass[i] << std::endl;
zncclass[i] = znci / 28. / tt;
// std::cout << znc[i]/zncclass[i] << std::endl;
//
double_t had = 0;
if(sum) {
if (sum) {
had += recs[i + 1].scalers[tce].lmBefore - recs[i].scalers[tce].lmBefore;
}
double_t mutce = -TMath::Log(1. - had / tt / nbc / frev);
Expand All @@ -185,13 +185,13 @@ void PlotPbLumi(int runNumber = 567905, bool qc = 0)

// rat = (double_t)(had)/double_t(recs[i+1].scalersInps[25] - recs[i].scalersInps[25])*28;
vchtoznc[i] = (double_t)(had) / zncpp[i] / tt;
//std::cout << "muzdc:" << mu << " mu tce:" << mutce << " muvch:" << muvch << std::endl;
// std::cout << "muzdc:" << mu << " mu tce:" << mutce << " muvch:" << muvch << std::endl;
}
//
gStyle->SetMarkerSize(0.5);
TGraph* gr1 = new TGraph(n, x, znc);
TGraph* gr11 = new TGraph(n, x, zncpp); // PileuP corrected
TGraph* gr12 = new TGraph(n, x, zncclass); // NOT PileuP corrected
TGraph* gr11 = new TGraph(n, x, zncpp); // PileuP corrected
TGraph* gr12 = new TGraph(n, x, zncclass); // NOT PileuP corrected
TGraph* gr2 = new TGraph(n, x, tcetsctoznc);
TGraph* gr3 = new TGraph(n, x, tcetoznc);
TGraph* gr4 = new TGraph(n, x, vchtoznc);
Expand All @@ -204,7 +204,7 @@ void PlotPbLumi(int runNumber = 567905, bool qc = 0)
gr3->SetMarkerStyle(23);
gr4->SetMarkerStyle(23);
gr11->SetTitle("R=ZNC/28 rate [Hz] (red=PilUp Corrected); time[sec]; R");
if(sum) {
if (sum) {
gr2->SetTitle("R=(TSC+TCE)*TVTX*B*28/ZNC; time[sec]; R");
} else {
gr2->SetTitle("R=(TSC)*TVTX*B*28/ZNC; time[sec]; R");
Expand Down