16 #include "GaudiKernel/MsgStream.h"
17 #include "GaudiKernel/StatusCode.h"
49 const std::string &
name,
const IInterface*
parent )
51 m_errorTool(
"LVL1::TrigT1CaloMonErrorToolV1/TrigT1CaloMonErrorToolV1"),
52 m_histTool(
"LVL1::TrigT1CaloLWHistogramToolV1/TrigT1CaloLWHistogramToolV1"),
54 m_h_l2_1d_L1NeL2Summary(0),
55 m_h_l2_1d_L1EqL2Summary(0),
56 m_h_l2_2d_JEMRoIErrors(0),
57 m_h_l2_2d_CPMRoIErrorsEM(0),
58 m_h_l2_2d_CPMRoIErrorsEMTau(0),
59 m_h_l2_2d_MismatchEvents(0)
92 if (
sc.isFailure())
return sc;
95 if(
sc.isFailure() ) {
96 msg(MSG::ERROR) <<
"Unable to locate Tool TrigT1CaloMonErrorTool"
102 if(
sc.isFailure() ) {
103 msg(MSG::ERROR) <<
"Unable to locate Tool TrigT1CaloLWHistogramTool"
108 return StatusCode::SUCCESS;
139 "Transmission Errors between L1Calo and Level2",
143 "Transmission Matches between L1Calo and Level2",
148 "l2_2d_JEMRoIErrors",
"Transmission Errors between JEMs and Level2");
150 "l2_2d_CPMRoIErrorsEM",
"Transmission Errors between CPMs and Level2 EM");
152 "l2_2d_CPMRoIErrorsEMTau",
153 "Transmission Errors between CPMs and Level2 EMTau");
158 "l2_2d_MismatchEvents",
159 "Transmission Errors between L1Calo and Level2 Event Numbers",
168 return StatusCode::SUCCESS;
181 return StatusCode::SUCCESS;
188 return StatusCode::SUCCESS;
194 if (
sc.isFailure() || !roib_rdo ) {
195 msg(MSG::WARNING) <<
"ERROR retrieving RoIB RDO from store!" <<
endmsg;
206 if (
sc == StatusCode::FAILURE || !L1Calo_JEMRoI) {
209 return StatusCode::SUCCESS;
214 int L2_JetEtHits = 0;
215 int L2_SumEtHits = 0;
216 int L2_MissingEtHits = 0;
217 int L2_MissingEtSigHits = 0;
223 JetEnergyResultCollection::const_iterator
it1 = jerColl.begin();
224 JetEnergyResultCollection::const_iterator it1End = jerColl.end();
225 for (;
it1 != it1End; ++
it1) {
227 JetEnergyRoICollection::const_iterator it2 = roiColl.begin();
228 JetEnergyRoICollection::const_iterator it2End = roiColl.end();
229 for (; it2 != it2End; ++it2) {
230 const unsigned int roIType = it2->roIType();
236 const int nthresh = (roi->
forward()) ? 4 : 8;
238 <<
" module " << roi->
jem()
239 <<
" frame " << roi->
frame()
246 L2_JetEtHits = it2->jetEt();
249 L2_Ex = it2->energyX();
250 L2_MissingEtSigHits = (it2->roIWord() >> 16) & 0xff;
252 L2_Ey = it2->energyY();
253 L2_SumEtHits = (it2->roIWord() >> 16) & 0xff;
255 L2_Et = it2->energySum();
256 std::vector<unsigned int>
hits(it2->etMissThresholds());
258 L2_MissingEtHits = 0;
259 for (
int bit = 0; bit <
size; ++bit) {
260 L2_MissingEtHits |= (
hits[bit] << bit);
273 it_L1Calo_JEMRoI = L1Calo_JEMRoI->
begin();
274 for (; it_L1Calo_JEMRoI != it_L1Calo_JEMRoIEnd; ++it_L1Calo_JEMRoI) {
275 const int nthresh = ((*it_L1Calo_JEMRoI)->forward()) ? 4 : 8;
276 msg(
MSG::DEBUG) <<
"L1Calo: JEP crate " << (*it_L1Calo_JEMRoI)->crate()
277 <<
" module " << (*it_L1Calo_JEMRoI)->jem()
278 <<
" frame " << (*it_L1Calo_JEMRoI)->frame()
279 <<
" location " << (*it_L1Calo_JEMRoI)->location()
282 (*it_L1Calo_JEMRoI)->hits(), nthresh)
289 std::vector<int> foundL2(L2_JEMRoI->
size());
291 it_L1Calo_JEMRoI = L1Calo_JEMRoI->
begin();
292 for (; it_L1Calo_JEMRoI != it_L1Calo_JEMRoIEnd; ++it_L1Calo_JEMRoI) {
293 const int crate = (*it_L1Calo_JEMRoI)->crate();
294 const int jem = (*it_L1Calo_JEMRoI)->jem();
295 const int frame = (*it_L1Calo_JEMRoI)->frame();
296 const int location = (*it_L1Calo_JEMRoI)->location();
297 const int hits = (*it_L1Calo_JEMRoI)->hits();
298 const int nthresh = ((*it_L1Calo_JEMRoI)->forward()) ? 4 : 8;
301 it_L2_JEMRoI = L2_JEMRoI->
begin();
302 it_L2_found = foundL2.begin();
303 for (; it_L2_JEMRoI != it_L2_JEMRoIEnd; ++it_L2_JEMRoI, ++it_L2_found) {
304 if ((*it_L2_found) == 0) {
305 if ((crate == (*it_L2_JEMRoI)->crate()) &&
306 (jem == (*it_L2_JEMRoI)->jem()) &&
307 (frame == (*it_L2_JEMRoI)->frame()) &&
308 (
location == (*it_L2_JEMRoI)->location())) {
309 hitsL2 = (*it_L2_JEMRoI)->hits();
316 if (
hits != hitsL2) {
318 msg(
MSG::DEBUG) <<
"JEP crate " << crate <<
" module " << jem
319 <<
" frame " << frame <<
" location " <<
location
323 <<
m_histTool->thresholdString(hitsL2, nthresh)
334 it_L2_JEMRoI = L2_JEMRoI->
begin();
335 it_L2_found = foundL2.begin();
336 for (; it_L2_JEMRoI != it_L2_JEMRoIEnd; ++it_L2_JEMRoI, ++it_L2_found) {
337 if (((*it_L2_found) == 0) && (*it_L2_JEMRoI)->hits()) {
339 const int hitsL1 = 0;
340 const int nthresh = ((*it_L2_JEMRoI)->forward()) ? 4 : 8;
342 <<
" module " << (*it_L2_JEMRoI)->jem()
343 <<
" frame " << (*it_L2_JEMRoI)->frame()
344 <<
" location " << (*it_L2_JEMRoI)->location()
346 <<
m_histTool->thresholdString(hitsL1, nthresh)
349 (*it_L2_JEMRoI)->hits(), nthresh)
354 (*it_L2_JEMRoI)->crate());
363 if (
sc == StatusCode::FAILURE || !L1Calo_CR) {
364 msg(MSG::INFO) <<
"No L1Calo CMM RoI found in TES at "
366 return StatusCode::SUCCESS;
369 int L1Calo_JetEtHits = L1Calo_CR->
jetEtHits();
370 int L1Calo_SumEtHits = L1Calo_CR->
sumEtHits();
374 int L1Calo_Ex = (L1Calo_CR->
ex() | ((L1Calo_CR->
exError() & 0x1) << 15));
375 int L1Calo_Ey = (L1Calo_CR->
ey() | ((L1Calo_CR->
eyError() & 0x1) << 15));
376 int L1Calo_Et = (L1Calo_CR->
et() | ((L1Calo_CR->
etError() & 0x1) << 15));
378 if (L1Calo_JetEtHits != L2_JetEtHits) {
383 if (L1Calo_SumEtHits != L2_SumEtHits) {
388 if (L1Calo_MissingEtHits != L2_MissingEtHits) {
391 }
else if (L1Calo_MissingEtHits) {
395 if (L1Calo_MissingEtSigHits != L2_MissingEtSigHits) {
398 }
else if (L1Calo_MissingEtSigHits) {
402 if ((L1Calo_Ex != L2_Ex) || (L1Calo_Ey != L2_Ey) || (L1Calo_Et != L2_Et)) {
405 }
else if (L1Calo_Ex || L1Calo_Ey || L1Calo_Et) {
416 if (
sc == StatusCode::FAILURE || !L1Calo_CPMRoI) {
419 return StatusCode::SUCCESS;
424 const int nthresh = 16;
427 EMTauResultCollection::const_iterator et1 = etrColl.begin();
428 EMTauResultCollection::const_iterator et1End = etrColl.end();
429 for (; et1 != et1End; ++et1) {
431 EMTauRoICollection::const_iterator et2 = roiColl.begin();
432 EMTauRoICollection::const_iterator et2End = roiColl.end();
433 for (; et2 != et2End; ++et2) {
440 <<
" module " << roi->
cpm()
441 <<
" chip " << roi->
chip()
458 it_L1Calo_CPMRoI = L1Calo_CPMRoI->
begin();
459 for (; it_L1Calo_CPMRoI != it_L1Calo_CPMRoIEnd; ++it_L1Calo_CPMRoI) {
460 msg(
MSG::DEBUG) <<
"L1Calo: CP crate " << (*it_L1Calo_CPMRoI)->crate()
461 <<
" module " << (*it_L1Calo_CPMRoI)->cpm()
462 <<
" chip " << (*it_L1Calo_CPMRoI)->chip()
463 <<
" location " << (*it_L1Calo_CPMRoI)->location()
466 (*it_L1Calo_CPMRoI)->hits(), nthresh)
474 foundL2.resize(L2_CPMRoI->
size());
475 it_L1Calo_CPMRoI = L1Calo_CPMRoI->
begin();
476 for (; it_L1Calo_CPMRoI != it_L1Calo_CPMRoIEnd; ++it_L1Calo_CPMRoI) {
477 const int crate = (*it_L1Calo_CPMRoI)->crate();
478 const int cpm = (*it_L1Calo_CPMRoI)->cpm();
479 const int chip = (*it_L1Calo_CPMRoI)->chip();
480 const int location = (*it_L1Calo_CPMRoI)->location();
481 const int hits = (*it_L1Calo_CPMRoI)->hits();
482 const int hitsEm =
hits & 0xff;
483 const int hitsTau = (
hits >> 8) & 0xff;
486 it_L2_CPMRoI = L2_CPMRoI->
begin();
487 it_L2_found = foundL2.begin();
488 for (; it_L2_CPMRoI != it_L2_CPMRoIEnd; ++it_L2_CPMRoI, ++it_L2_found) {
489 if ((*it_L2_found) == 0) {
490 if ((crate == (*it_L2_CPMRoI)->crate()) &&
491 (cpm == (*it_L2_CPMRoI)->cpm()) &&
492 (chip == (*it_L2_CPMRoI)->chip()) &&
493 (
location == (*it_L2_CPMRoI)->location())) {
494 hitsL2 = (*it_L2_CPMRoI)->hits();
501 if (
hits != hitsL2) {
504 <<
" chip " << chip <<
" location " <<
location
508 <<
m_histTool->thresholdString(hitsL2, nthresh)
511 const int hitsEmL2 = hitsL2 & 0xff;
512 const int hitsTauL2 = (hitsL2 >> 8) & 0xff;
513 if (hitsEm != hitsEmL2) {
518 if (hitsTau != hitsTauL2) {
531 it_L2_CPMRoI = L2_CPMRoI->
begin();
532 it_L2_found = foundL2.begin();
533 for (; it_L2_CPMRoI != it_L2_CPMRoIEnd; ++it_L2_CPMRoI, ++it_L2_found) {
534 if (((*it_L2_found) == 0) && (*it_L2_CPMRoI)->hits()) {
535 const int crate = (*it_L2_CPMRoI)->crate();
536 const int cpm = (*it_L2_CPMRoI)->cpm();
537 const int hits = (*it_L2_CPMRoI)->hits();
538 const int hitsEm =
hits & 0xff;
539 const int hitsTau = (
hits >> 8) & 0xff;
541 const int hitsL1 = 0;
544 <<
" chip " << (*it_L1Calo_CPMRoI)->chip()
545 <<
" location " << (*it_L1Calo_CPMRoI)->location()
547 <<
m_histTool->thresholdString(hitsL1, nthresh)
566 return StatusCode::SUCCESS;
577 return StatusCode::SUCCESS;