Skip to content

Commit f979c0a

Browse files
authored
add DecError corrections in TOF lumi post proc. (#2611)
1 parent 3ad1286 commit f979c0a

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

Modules/TOF/include/TOF/PostProcessingLuminometer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class PostProcessingLuminometer final : public quality_control::postprocessing::
6363
std::string mCCDBPath = "TOF/MO/TaskDigits/";
6464
std::string mMOEfficiency = "OrbitVsCrate";
6565
std::string mMOActiveChannels = "HitMap";
66+
std::string mMOdecodingErrors = "DecodingErrors";
6667
std::string mMOMultiplicity = "Multiplicity/Integrated";
6768
std::shared_ptr<TH1F> mHistoOrbitsInTFEfficiency = nullptr;
6869
std::shared_ptr<TH1F> mHistoLuminometer = nullptr;
@@ -73,4 +74,4 @@ class PostProcessingLuminometer final : public quality_control::postprocessing::
7374

7475
} // namespace o2::quality_control_modules::tof
7576

76-
#endif // QUALITYCONTROL_POSTPROCESSINGLuminometer_H
77+
#endif // QUALITYCONTROL_POSTPROCESSINGLuminometer_H

Modules/TOF/src/PostProcessingLuminometer.cxx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,31 @@ void PostProcessingLuminometer::update(Trigger t, framework::ServiceRegistryRef)
8989
auto moEfficiency = mDatabase->retrieveMO(mCCDBPath, mMOEfficiency, t.timestamp, t.activity);
9090
auto moActiveChannels = mDatabase->retrieveMO(mCCDBPath, mMOActiveChannels, t.timestamp, t.activity);
9191
auto moMultiplicity = mDatabase->retrieveMO(mCCDBPath, mMOMultiplicity, t.timestamp, t.activity);
92+
auto moDecodingErrors = mDatabase->retrieveMO(mCCDBPath, mMOdecodingErrors, t.timestamp, t.activity);
9293

9394
float ROeff = 1.;
9495
float hitMult = 0.;
9596
float activeCh = 1.;
97+
float decodingEff = 1.;
98+
99+
// Decoding Errors
100+
if (moDecodingErrors) {
101+
TH2D* htemp = static_cast<TH2D*>(moDecodingErrors->getObject());
102+
TH1D* hproj = (TH1D*)htemp->ProjectionY();
103+
hproj->SetName("decodErr_pro");
104+
if (hproj->GetBinContent(1) > 0) {
105+
hproj->Scale(0.1 / hproj->GetBinContent(1)); // normalize to the first bin content and divide by 10 (TRMs)
106+
for (int ibin = 3; ibin < hproj->GetNbinsX() - 1; ibin++) { // count on TRM errors (skip last bin = DRM errors)
107+
decodingEff -= hproj->GetBinContent(ibin);
108+
}
109+
if (decodingEff < 1E-2) {
110+
ILOG(Warning) << "decodingEff = " << decodingEff << " -> it is too low? Why? ... skipping such a correction " << ENDM;
111+
decodingEff = 1.;
112+
}
113+
}
114+
} else {
115+
ILOG(Warning) << "Did not find MO " << moDecodingErrors << " in path " << mCCDBPath << ENDM;
116+
}
96117

97118
// Readout efficiency
98119
TH2F* moHEfficiency = static_cast<TH2F*>(moEfficiency ? moEfficiency->getObject() : nullptr);
@@ -142,7 +163,14 @@ void PostProcessingLuminometer::update(Trigger t, framework::ServiceRegistryRef)
142163
ILOG(Warning) << "Did not find MO " << mMOMultiplicity << " in path " << mCCDBPath << ENDM;
143164
}
144165

145-
mHistoLuminometer->Fill(hitMult / (activeCh * ROeff));
166+
mHistoLuminometer->Fill(hitMult / (activeCh * ROeff * decodingEff));
167+
ILOG(Info) << "____________________" << ENDM;
168+
ILOG(Info) << "Luminometer summary " << ENDM;
169+
ILOG(Info) << "decodingEff = " << decodingEff << ENDM;
170+
ILOG(Info) << "activeCh = " << activeCh << ENDM;
171+
ILOG(Info) << "ROeff = " << ROeff << ENDM;
172+
ILOG(Info) << "hitMult = " << hitMult << ENDM;
173+
ILOG(Info) << "____________________" << ENDM;
146174
}
147175

148176
void PostProcessingLuminometer::finalize(Trigger, framework::ServiceRegistryRef)

0 commit comments

Comments
 (0)