Skip to content

Commit

Permalink
add a parameter for possible shift of the BC possition
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucia Anna Tarasovicova committed Oct 28, 2024
1 parent 187a842 commit 6eb48fa
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Modules/CTP/include/CTP/RawDataQcTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class CTPRawDataReaderTask final : public TaskInterface
int mRunNumber;
int indexMB1 = -1;
int indexMB2 = -1;
int mShiftInput1 = 0;
int mShiftInput2 = 0;
static const int ninps = o2::ctp::CTP_NINPUTS + 1;
static const int nclasses = o2::ctp::CTP_NCLASSES + 1;
double mScaleInput1 = 1;
Expand Down
36 changes: 31 additions & 5 deletions Modules/CTP/src/RawDataQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
if (input1Tokens.size() > 1) {
mScaleInput1 = std::stod(input1Tokens[1]);
}
if (input1Tokens.size() > 2) {
mShiftInput1 = std::stod(input1Tokens[2]);
}

auto input2Tokens = o2::utils::Str::tokenize(nameInput2, ':', false, true);
if (input2Tokens.size() > 0) {
Expand All @@ -140,6 +143,9 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
if (input2Tokens.size() > 1) {
mScaleInput2 = std::stod(input2Tokens[1]);
}
if (input2Tokens.size() > 2) {
mShiftInput2 = std::stod(input2Tokens[2]);
}

indexMB1 = o2::ctp::CTPInputsConfiguration::getInputIndexFromName(nameInput1);
indexMB2 = o2::ctp::CTPInputsConfiguration::getInputIndexFromName(nameInput2);
Expand All @@ -165,11 +171,31 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
mHistoClassRatios.get()->GetXaxis()->SetLabelSize(0.025);
mHistoClassRatios.get()->GetXaxis()->LabelsOption("v");

mHistoBCMinBias1->SetTitle(Form("BC position %s", nameInput1.c_str()));
mHistoBCMinBias2->SetTitle(Form("BC position %s", nameInput2.c_str()));
TString title1 = Form("BC position %s", nameInput1.c_str());
TString titley1 = Form("Rate");
TString titleX1 = Form("BC");
if (mScaleInput1 > 1) {
title1 += Form(", scaled with 1/%g", mScaleInput1);
titley1 += Form(" #times 1/%g", mScaleInput1);
}
if (mShiftInput1 > 0) {
title1 += Form(", shifted by - %d", mShiftInput1);
titleX1 += Form(" - %d", mShiftInput1);
}
mHistoBCMinBias1->SetTitle(Form("%s; %s; %s", title1.Data(), titleX1.Data(), titley1.Data()));

TString title2 = Form("BC position %s", nameInput2.c_str());
TString titley2 = Form("Rate");
TString titleX2 = Form("BC");
if (mScaleInput2 > 1) {
mHistoBCMinBias2->SetTitle(Form("BC position %s scaled 1/%g", nameInput2.c_str(), mScaleInput2));
title2 += Form(", scaled with 1/%g", mScaleInput2);
titley2 += Form(" #times 1/%g", mScaleInput2);
}
if (mShiftInput2 > 0) {
title2 += Form(", shifted by - %d", mShiftInput2);
titleX2 += Form(" - %d", mShiftInput2);
}
mHistoBCMinBias2->SetTitle(Form("%s; %s; %s", title2.Data(), titleX2.Data(), titley2.Data()));
mHistoClassRatios->SetTitle(Form("Class Ratio to %s", MBclassName.c_str()));
mHistoInputRatios->SetTitle(Form("Input Ratio to %s", nameInput1.c_str()));
}
Expand Down Expand Up @@ -200,11 +226,11 @@ void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx)
mHistoInputs->getNum()->Fill(i);
mHistoInputRatios->getNum()->Fill(i);
if (i == indexMB1 - 1) {
mHistoBCMinBias1->Fill(bcid, 1. / mScaleInput1);
mHistoBCMinBias1->Fill((bcid - mShiftInput1) % 3564, 1. / mScaleInput1);
mHistoInputRatios->getDen()->Fill(0., 1);
}
if (i == indexMB2 - 1) {
mHistoBCMinBias2->Fill(bcid, 1. / mScaleInput2);
mHistoBCMinBias2->Fill((bcid - mShiftInput2) % 3564, 1. / mScaleInput2);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Modules/CTP/src/RawDataReaderCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
std::shared_ptr<TLatex> msg;
if (mo->getName() == "bcMinBias1" || mo->getName() == "bcMinBias2") {
auto* h = dynamic_cast<TH1D*>(mo->getObject());
h->GetXaxis()->SetTitle("BC");
h->SetMarkerStyle(20);
h->SetMarkerSize(0.6);
if (checkResult != Quality::Null) {
msg = std::make_shared<TLatex>(0.2, 0.85, Form("Quality: %s", (checkResult.getName()).c_str()));
if (checkResult == Quality::Bad) {
Expand Down

0 comments on commit 6eb48fa

Please sign in to comment.