Skip to content

Commit 120f6ed

Browse files
lhusovaLucia Anna Tarasovicova
authored andcommitted
CTP: change in RawDataReaderCheck.cxx (#2463)
* fix for overlapping messages * add a parameter for possible shift of the BC possition --------- Co-authored-by: Lucia Anna Tarasovicova <lucia.anna.husova@cern.ch>
1 parent d064c26 commit 120f6ed

3 files changed

Lines changed: 44 additions & 11 deletions

File tree

Modules/CTP/include/CTP/RawDataQcTask.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class CTPRawDataReaderTask final : public TaskInterface
5959
int mRunNumber;
6060
int indexMB1 = -1;
6161
int indexMB2 = -1;
62+
int mShiftInput1 = 0;
63+
int mShiftInput2 = 0;
6264
static const int ninps = o2::ctp::CTP_NINPUTS + 1;
6365
static const int nclasses = o2::ctp::CTP_NCLASSES + 1;
6466
double mScaleInput1 = 1;

Modules/CTP/src/RawDataQcTask.cxx

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
132132
if (input1Tokens.size() > 1) {
133133
mScaleInput1 = std::stod(input1Tokens[1]);
134134
}
135+
if (input1Tokens.size() > 2) {
136+
mShiftInput1 = std::stod(input1Tokens[2]);
137+
}
135138

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

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

168-
mHistoBCMinBias1->SetTitle(Form("BC position %s", nameInput1.c_str()));
169-
mHistoBCMinBias2->SetTitle(Form("BC position %s", nameInput2.c_str()));
174+
TString title1 = Form("BC position %s", nameInput1.c_str());
175+
TString titley1 = Form("Rate");
176+
TString titleX1 = Form("BC");
177+
if (mScaleInput1 > 1) {
178+
title1 += Form(", scaled with 1/%g", mScaleInput1);
179+
titley1 += Form(" #times 1/%g", mScaleInput1);
180+
}
181+
if (mShiftInput1 > 0) {
182+
title1 += Form(", shifted by - %d", mShiftInput1);
183+
titleX1 += Form(" - %d", mShiftInput1);
184+
}
185+
mHistoBCMinBias1->SetTitle(Form("%s; %s; %s", title1.Data(), titleX1.Data(), titley1.Data()));
186+
187+
TString title2 = Form("BC position %s", nameInput2.c_str());
188+
TString titley2 = Form("Rate");
189+
TString titleX2 = Form("BC");
170190
if (mScaleInput2 > 1) {
171-
mHistoBCMinBias2->SetTitle(Form("BC position %s scaled 1/%g", nameInput2.c_str(), mScaleInput2));
191+
title2 += Form(", scaled with 1/%g", mScaleInput2);
192+
titley2 += Form(" #times 1/%g", mScaleInput2);
193+
}
194+
if (mShiftInput2 > 0) {
195+
title2 += Form(", shifted by - %d", mShiftInput2);
196+
titleX2 += Form(" - %d", mShiftInput2);
172197
}
198+
mHistoBCMinBias2->SetTitle(Form("%s; %s; %s", title2.Data(), titleX2.Data(), titley2.Data()));
173199
mHistoClassRatios->SetTitle(Form("Class Ratio to %s", MBclassName.c_str()));
174200
mHistoInputRatios->SetTitle(Form("Input Ratio to %s", nameInput1.c_str()));
175201
}
@@ -200,11 +226,11 @@ void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx)
200226
mHistoInputs->getNum()->Fill(i);
201227
mHistoInputRatios->getNum()->Fill(i);
202228
if (i == indexMB1 - 1) {
203-
mHistoBCMinBias1->Fill(bcid, 1. / mScaleInput1);
229+
mHistoBCMinBias1->Fill((bcid - mShiftInput1) % 3564, 1. / mScaleInput1);
204230
mHistoInputRatios->getDen()->Fill(0., 1);
205231
}
206232
if (i == indexMB2 - 1) {
207-
mHistoBCMinBias2->Fill(bcid, 1. / mScaleInput2);
233+
mHistoBCMinBias2->Fill((bcid - mShiftInput2) % 3564, 1. / mScaleInput2);
208234
}
209235
}
210236
}

Modules/CTP/src/RawDataReaderCheck.cxx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
194194
std::shared_ptr<TLatex> msg;
195195
if (mo->getName() == "bcMinBias1" || mo->getName() == "bcMinBias2") {
196196
auto* h = dynamic_cast<TH1D*>(mo->getObject());
197-
h->GetXaxis()->SetTitle("BC");
197+
h->SetMarkerStyle(20);
198+
h->SetMarkerSize(0.6);
198199
if (checkResult != Quality::Null) {
199200
msg = std::make_shared<TLatex>(0.2, 0.85, Form("Quality: %s", (checkResult.getName()).c_str()));
200201
if (checkResult == Quality::Bad) {
@@ -222,26 +223,30 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
222223
msg->SetNDC();
223224
h->GetListOfFunctions()->Add(msg->Clone());
224225

226+
float messagePos = 0.75;
227+
float initialMessagePos = 0.75;
225228
if (mVecMediumBC.size() > 0) {
226-
msg = std::make_shared<TLatex>(0.2, 0.75, Form("BC is expected on following possitions, but inputs are below threshold (%f):", mThreshold));
229+
msg = std::make_shared<TLatex>(0.2, initialMessagePos, Form("BC is expected on following possitions, but inputs are below threshold (%g):", round(mThreshold)));
227230
msg->SetTextSize(0.03);
228231
msg->SetNDC();
229232
h->GetListOfFunctions()->Add(msg->Clone());
230233
for (size_t i = 0; i < mVecMediumBC.size(); i++) {
231-
msg = std::make_shared<TLatex>(0.2, 0.75 - (i + 1) * 0.02, Form("%d", mVecMediumBC[i]));
234+
messagePos = initialMessagePos - (i + 1) * 0.02;
235+
msg = std::make_shared<TLatex>(0.2, messagePos, Form("%d", mVecMediumBC[i]));
232236
msg->SetTextSize(0.02);
233237
msg->SetNDC();
234238
h->GetListOfFunctions()->Add(msg->Clone());
235239
}
236240
}
237-
241+
initialMessagePos = messagePos - 0.04;
238242
if (mVecBadBC.size() > 0) {
239-
msg = std::make_shared<TLatex>(0.2, 0.75, Form("BC is not expected on following possitions, but inputs are above threshold (%f):", mThreshold));
243+
msg = std::make_shared<TLatex>(0.2, initialMessagePos, Form("BC is not expected on following possitions, but inputs are above threshold (%g):", round(mThreshold)));
240244
msg->SetTextSize(0.03);
241245
msg->SetNDC();
242246
h->GetListOfFunctions()->Add(msg->Clone());
243247
for (size_t i = 0; i < mVecBadBC.size(); i++) {
244-
msg = std::make_shared<TLatex>(0.2, 0.75 - (i + 1) * 0.02, Form("%d", mVecBadBC[i]));
248+
messagePos = initialMessagePos - (i + 1) * 0.02;
249+
msg = std::make_shared<TLatex>(0.2, messagePos, Form("%d", mVecBadBC[i]));
245250
msg->SetTextSize(0.02);
246251
msg->SetNDC();
247252
h->GetListOfFunctions()->Add(msg->Clone());

0 commit comments

Comments
 (0)