Skip to content

Commit

Permalink
clang
Browse files Browse the repository at this point in the history
  • Loading branch information
lietava committed Nov 13, 2024
1 parent e4efba2 commit 5b3513d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 41 deletions.
56 changes: 28 additions & 28 deletions Detectors/CTP/macro/PlotPbLumi.C
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using namespace std::chrono;
// if fillN = 0: pileup correction not done
// QCDB =1 : use for ongoing run
//
void PlotPbLumi(int runNumber, int fillN = 0, int QCDB = 0, std::string ccdbHost = "http://alice-ccdb.cern.ch" )
void PlotPbLumi(int runNumber, int fillN = 0, int QCDB = 0, std::string ccdbHost = "http://alice-ccdb.cern.ch")
{ // "http://ccdb-test.cern.ch:8080"
std::string mCCDBPathCTPScalers = "CTP/Calib/Scalers";
std::string mQCDBPathCTPScalers = "qc/CTP/Scalers";
Expand All @@ -51,7 +51,7 @@ void PlotPbLumi(int runNumber, int fillN = 0, int QCDB = 0, std::string ccdbHos
// Filling
std::map<string, string> metadata;
int nbc = 0;
if(fillN) {
if (fillN) {
std::string sfill = std::to_string(fillN);
metadata["fillNumber"] = sfill;
auto lhcifdata = ccdbMgr.getSpecific<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", timeStamp, metadata);
Expand All @@ -60,10 +60,10 @@ void PlotPbLumi(int runNumber, int fillN = 0, int QCDB = 0, std::string ccdbHos
nbc = bcs.size();
std::cout << "Number of interacting bc:" << nbc << std::endl;
}
if(QCDB) { // use this option for ongoing run
if (QCDB) { // use this option for ongoing run
mCCDBPathCTPScalers = mQCDBPathCTPScalers;
ccdbMgr.setURL("http://ccdb-test.cern.ch:8080");
timeStamp = duration_cast< milliseconds >(system_clock::now().time_since_epoch()).count();
timeStamp = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
std::cout << "For scalers using Current time:" << timeStamp << std::endl;
}
// Scalers
Expand Down Expand Up @@ -131,20 +131,20 @@ void PlotPbLumi(int runNumber, int fillN = 0, int QCDB = 0, std::string ccdbHos
double_t Trun = timeL - time0;
double_t orbit0 = recs[0].intRecord.orbit;
int n = recs.size() - 1;
if(runNumber == 559143) {
if (runNumber == 559143) {
n = 400;
}
if(runNumber == 559561 ) {
n = n - 3; // rate drops at the end
if (runNumber == 559561) {
n = n - 3; // rate drops at the end
}
if(runNumber == 559575){
if (runNumber == 559575) {
n = n - 6;
}
if(runNumber == 559617) {
if (runNumber == 559617) {
n = n - 5;
}
if(runNumber == 559632) {
n = n - 6;
if (runNumber == 559632) {
n = n - 6;
}
std::cout << " Run duration:" << Trun << " Scalers size:" << n + 1 << std::endl;
Double_t x[n], znc[n], zncpp[n], ex[n], eznc[n];
Expand All @@ -162,34 +162,34 @@ void PlotPbLumi(int runNumber, int fillN = 0, int QCDB = 0, std::string ccdbHos
double_t znci = (double_t)(recs[i + 1].scalersInps[25] - recs[i].scalersInps[25]);
double_t zncipp = znci;
double_t mu = 0;
if(fillN) {
mu = -TMath::Log(1. - znci / tt / nbc / frev);
if (fillN) {
mu = -TMath::Log(1. - znci / tt / nbc / frev);
zncipp = mu * nbc * frev * tt;
}
zncpp[i] = zncipp / 28.;
znc[i] = zncipp / 28. / tt;
eznc[i] = TMath::Sqrt(zncipp) / 28. / tt;
if(1){
if (1) {
//
auto had = recs[i + 1].scalers[tsc].lmBefore - recs[i].scalers[tsc].lmBefore;
had += recs[i + 1].scalers[tce].lmBefore - recs[i].scalers[tce].lmBefore;
tcetsctoznc[i] = (double_t)(had) / zncpp[i];
etcetsctoznc[i] = TMath::Sqrt(tcetsctoznc[i]*(1-tcetsctoznc[i])/ zncpp[i]);
etcetsctoznc[i] = TMath::Sqrt(tcetsctoznc[i] * (1 - tcetsctoznc[i]) / zncpp[i]);
had = recs[i + 1].scalers[tce].lmBefore - recs[i].scalers[tce].lmBefore;
double_t tcec = had;
tcetoznc[i] = (double_t)(had) / zncpp[i];
had = recs[i + 1].scalers[vch].lmBefore - recs[i].scalers[vch].lmBefore;
vchtoznc[i] = (double_t)(had) / zncpp[i] ;
//std::cout << "mu:" << mu << " zncpp corr:" << zncipp << " zncraw:" << znci << " tce:" << tcec << " tce/had" << tcec/zncpp[i] << std::endl;
}
vchtoznc[i] = (double_t)(had) / zncpp[i];
// std::cout << "mu:" << mu << " zncpp corr:" << zncipp << " zncraw:" << znci << " tce:" << tcec << " tce/had" << tcec/zncpp[i] << std::endl;
}
}
//
TFile myfile("file.root","RECREATE");
TFile myfile("file.root", "RECREATE");
gStyle->SetMarkerSize(0.5);
//TGraph* gr1 = new TGraph(n, x, znc);
// TGraph* gr1 = new TGraph(n, x, znc);
TGraphErrors* gr1 = new TGraphErrors(n, x, znc, ex, eznc);
TGraph* gr2 = new TGraph(n, x, tcetsctoznc);
//TGraphErrors* gr2 = new TGraphErrors(n, x, tcetsctoznc, ex, etcetsctoznc); // nom and denom are strongly correlated
// TGraphErrors* gr2 = new TGraphErrors(n, x, tcetsctoznc, ex, etcetsctoznc); // nom and denom are strongly correlated
TGraph* gr3 = new TGraph(n, x, tcetoznc);
TGraph* gr4 = new TGraph(n, x, vchtoznc);
gr1->SetMarkerStyle(20);
Expand All @@ -198,26 +198,26 @@ void PlotPbLumi(int runNumber, int fillN = 0, int QCDB = 0, std::string ccdbHos
gr4->SetMarkerStyle(23);
gr1->SetTitle("R=ZNC/28 rate [Hz]; time[sec]; R");
gr2->SetTitle("R=(TSC+TCE)*TVTX*B*28/ZNC; time[sec]; R");
//gr2->SetTitle("R=TSC*TVTX*B*28/ZNC; time[sec]; R");
// gr2->GetHistogram()->SetMaximum(1.1);
// gr2->GetHistogram()->SetMinimum(0.9);
// gr2->SetTitle("R=TSC*TVTX*B*28/ZNC; time[sec]; R");
// gr2->GetHistogram()->SetMaximum(1.1);
// gr2->GetHistogram()->SetMinimum(0.9);
gr3->SetTitle("R=(TCE)*TVTX*B*28/ZNC; time[sec]; R");
// gr3->GetHistogram()->SetMaximum(0.6);
// gr3->GetHistogram()->SetMinimum(0.4);
gr4->SetTitle("R=(VCH)*TVTX*B*28/ZNC; time[sec]; R");
// gr4->GetHistogram()->SetMaximum(0.6);
// gr4->GetHistogram()->SetMinimum(0.4);
TCanvas* c1 = new TCanvas("c1", srun.c_str(), 200, 10, 800, 500);
TF1 *fun = new TF1("poly0","[0]+x*[1]");
TF1* fun = new TF1("poly0", "[0]+x*[1]");
c1->Divide(2, 2);
c1->cd(1);
gr1->Draw("AP");
c1->cd(2);
fun->SetParameter(0,1);
gr2->Fit("poly0","FM");
fun->SetParameter(0, 1);
gr2->Fit("poly0", "FM");
gr2->Draw("AP");
c1->cd(3);
fun->SetParameter(0,0.5);
fun->SetParameter(0, 0.5);
gr3->Fit("poly0");
gr3->Draw("AP");
c1->cd(4);
Expand Down
12 changes: 6 additions & 6 deletions Detectors/CTP/macro/TestConfig.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void TestConfig(bool test = 1)
if (test == 0) {
return;
}
uint64_t timestamp = 1660276134898+10000;
uint64_t timestamp = 1660276134898 + 10000;
std::string run = "523186";
o2::ctp::ctpCCDBManager::setCCDBHost("https://alice-ccdb.cern.ch");
bool ok;
Expand All @@ -35,12 +35,12 @@ void TestConfig(bool test = 1)
auto& triggerclasses = ctpconfig.getCTPClasses();
std::cout << "Found " << triggerclasses.size() << " trigger classes" << std::endl;
for (const auto& trg : triggerclasses) {
if (trg.cluster->maskCluster[o2::detectors::DetID::EMC]) {
// Class triggering EMCAL cluster
LOG(info) << "Found trigger class for EMCAL cluster: " << trg.name << " with input mask " << std::bitset<64>(trg.descriptor->getInputsMask());
trg.descriptor->getInputsMask();
}
if (trg.cluster->maskCluster[o2::detectors::DetID::EMC]) {
// Class triggering EMCAL cluster
LOG(info) << "Found trigger class for EMCAL cluster: " << trg.name << " with input mask " << std::bitset<64>(trg.descriptor->getInputsMask());
trg.descriptor->getInputsMask();
}
}
return;
int indexInList = 0;
for (const auto& trgclass : triggerclasses) {
Expand Down
2 changes: 1 addition & 1 deletion Detectors/CTP/macro/TestFetcher.C
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void TestFetcher(int runNumber = 559456)
// Opening run
CTPRateFetcher fetcher;
fetcher.setupRun(runNumber, &ccdb, ts, 0);
//ccdb.setURL("http://ali-qcdb-gpn.cern.ch:8083/");
// ccdb.setURL("http://ali-qcdb-gpn.cern.ch:8083/");
ccdb.setURL("http://ccdb-test.cern.ch:8080/");

std::string QCDBPathCTPScalers = "qc/CTP/Scalers";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class RawDataDecoder
void setVerbose(bool v) { mVerbose = v; }
void setMAXErrors(int m) { mErrorMax = m; }
int setLumiInp(int lumiinp, std::string inp);
void setCTPConfig( CTPConfiguration cfg) { mCTPConfig = std::move(cfg); };
void setCTPConfig(CTPConfiguration cfg) { mCTPConfig = std::move(cfg); };
uint32_t getIRRejected() const { return mIRRejected; }
uint32_t getTCRRejected() const { return mTCRRejected; }
std::vector<uint32_t>& getTFOrbits() { return mTFOrbits; }
Expand Down
9 changes: 4 additions & 5 deletions Detectors/CTP/workflow/src/RawDecoderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ void RawDecoderSpec::run(framework::ProcessingContext& ctx)
if (fatal_flag) {
ret = mDecoder.decodeRawFatal(inputs, filter);
} else {
if(mDecodeinputs) {
const auto ctpcfg = inputs.get<o2::ctp::CTPConfiguration*>("ctpconfig");
//ctpcfg->printStream(std::cout);
mDecoder.setCTPConfig(*ctpcfg);
if (mDecodeinputs) {
const auto ctpcfg = inputs.get<o2::ctp::CTPConfiguration*>("ctpconfig");
// ctpcfg->printStream(std::cout);
mDecoder.setCTPConfig(*ctpcfg);
}
ret = mDecoder.decodeRaw(inputs, filter, mOutputDigits, lumiPointsHBF1);
}
Expand Down Expand Up @@ -184,7 +184,6 @@ void RawDecoderSpec::run(framework::ProcessingContext& ctx)
}
mOutputLumiInfo.counts = mCountsT;


mOutputLumiInfo.countsFV0 = mCountsV;
mOutputLumiInfo.nHBFCounted = mNHBIntegratedT;
mOutputLumiInfo.nHBFCountedFV0 = mNHBIntegratedV;
Expand Down

0 comments on commit 5b3513d

Please sign in to comment.