@@ -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
148176void PostProcessingLuminometer::finalize (Trigger, framework::ServiceRegistryRef)
0 commit comments