File indexing completed on 2024-10-08 05:11:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "L1Trigger/GlobalTrigger/interface/L1GtCorrelationCondition.h"
0017
0018
0019 #include <iomanip>
0020 #include <iostream>
0021
0022 #include <algorithm>
0023 #include <string>
0024 #include <vector>
0025
0026
0027
0028 #include "CondFormats/L1TObjects/interface/L1GtCorrelationTemplate.h"
0029
0030 #include "CondFormats/L1TObjects/interface/L1GtCaloTemplate.h"
0031 #include "CondFormats/L1TObjects/interface/L1GtEnergySumTemplate.h"
0032 #include "CondFormats/L1TObjects/interface/L1GtMuonTemplate.h"
0033
0034 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTCand.h"
0035 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0036
0037 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctCand.h"
0038 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEmCand.h"
0039 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtSums.h"
0040 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctJetCand.h"
0041 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTCand.h"
0042
0043 #include "L1Trigger/GlobalTrigger/interface/L1GtCaloCondition.h"
0044 #include "L1Trigger/GlobalTrigger/interface/L1GtEnergySumCondition.h"
0045 #include "L1Trigger/GlobalTrigger/interface/L1GtMuonCondition.h"
0046
0047 #include "L1Trigger/GlobalTrigger/interface/L1GtEtaPhiConversions.h"
0048
0049 #include "L1Trigger/GlobalTrigger/interface/L1GlobalTriggerFunctions.h"
0050 #include "L1Trigger/GlobalTrigger/interface/L1GlobalTriggerGTL.h"
0051 #include "L1Trigger/GlobalTrigger/interface/L1GlobalTriggerPSB.h"
0052
0053 #include "FWCore/MessageLogger/interface/MessageDrop.h"
0054 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0055
0056
0057
0058 L1GtCorrelationCondition::L1GtCorrelationCondition()
0059 : L1GtConditionEvaluation(), m_isDebugEnabled(edm::isDebugEnabled()) {
0060
0061 }
0062
0063
0064 L1GtCorrelationCondition::L1GtCorrelationCondition(const L1GtCondition *corrTemplate,
0065 const L1GtCondition *cond0Condition,
0066 const L1GtCondition *cond1Condition,
0067 const int cond0NrL1Objects,
0068 const int cond1NrL1Objects,
0069 const int cond0EtaBits,
0070 const int cond1EtaBits,
0071 const L1GlobalTriggerGTL *ptrGTL,
0072 const L1GlobalTriggerPSB *ptrPSB,
0073 const L1GtEtaPhiConversions *etaPhiConversions)
0074 : L1GtConditionEvaluation(),
0075 m_gtCorrelationTemplate(static_cast<const L1GtCorrelationTemplate *>(corrTemplate)),
0076 m_gtCond0(cond0Condition),
0077 m_gtCond1(cond1Condition),
0078 m_cond0NrL1Objects(cond0NrL1Objects),
0079 m_cond1NrL1Objects(cond1NrL1Objects),
0080 m_cond0EtaBits(cond0EtaBits),
0081 m_cond1EtaBits(cond1EtaBits),
0082 m_gtGTL(ptrGTL),
0083 m_gtPSB(ptrPSB),
0084 m_gtEtaPhiConversions(etaPhiConversions),
0085 m_isDebugEnabled(edm::isDebugEnabled()) {
0086 m_condMaxNumberObjects = 2;
0087 m_nrBinsPhi = 0;
0088 }
0089
0090
0091 void L1GtCorrelationCondition::copy(const L1GtCorrelationCondition &cp) {
0092 m_gtCorrelationTemplate = cp.m_gtCorrelationTemplate;
0093
0094 m_gtCond0 = cp.m_gtCond0;
0095 m_gtCond1 = cp.m_gtCond1;
0096
0097 m_cond0NrL1Objects = cp.m_cond0NrL1Objects;
0098 m_cond1NrL1Objects = cp.m_cond1NrL1Objects;
0099 m_cond0EtaBits = cp.m_cond0EtaBits;
0100 m_cond1EtaBits = cp.m_cond1EtaBits;
0101
0102 m_nrBinsPhi = cp.m_nrBinsPhi;
0103
0104 m_gtCorrelationTemplate = cp.m_gtCorrelationTemplate;
0105 m_gtGTL = cp.m_gtGTL;
0106 m_gtPSB = cp.m_gtPSB;
0107
0108 m_gtEtaPhiConversions = cp.m_gtEtaPhiConversions;
0109
0110 m_condMaxNumberObjects = cp.m_condMaxNumberObjects;
0111 m_condLastResult = cp.m_condLastResult;
0112 m_combinationsInCond = cp.m_combinationsInCond;
0113
0114 m_verbosity = cp.m_verbosity;
0115 m_isDebugEnabled = cp.m_isDebugEnabled;
0116 }
0117
0118 L1GtCorrelationCondition::L1GtCorrelationCondition(const L1GtCorrelationCondition &cp) : L1GtConditionEvaluation() {
0119 copy(cp);
0120 }
0121
0122
0123 L1GtCorrelationCondition::~L1GtCorrelationCondition() {
0124
0125 }
0126
0127
0128 L1GtCorrelationCondition &L1GtCorrelationCondition::operator=(const L1GtCorrelationCondition &cp) {
0129 copy(cp);
0130 return *this;
0131 }
0132
0133
0134
0135 void L1GtCorrelationCondition::setGtNrBinsPhi(const unsigned int nrBins) { m_nrBinsPhi = nrBins; }
0136
0137
0138 void L1GtCorrelationCondition::setGtCorrelationTemplate(const L1GtCorrelationTemplate *corrTempl) {
0139 m_gtCorrelationTemplate = corrTempl;
0140 }
0141
0142
0143 void L1GtCorrelationCondition::setGtGTL(const L1GlobalTriggerGTL *ptrGTL) { m_gtGTL = ptrGTL; }
0144
0145
0146 void L1GtCorrelationCondition::setGtPSB(const L1GlobalTriggerPSB *ptrPSB) { m_gtPSB = ptrPSB; }
0147
0148
0149 const bool L1GtCorrelationCondition::evaluateCondition() const {
0150
0151
0152
0153 bool condResult = false;
0154 bool reqObjResult = false;
0155
0156
0157
0158 int nObjInCond = 2;
0159 std::vector<L1GtObject> cndObjTypeVec(nObjInCond);
0160
0161
0162
0163 const L1GtConditionCategory cond0Categ = m_gtCorrelationTemplate->cond0Category();
0164 const L1GtConditionCategory cond1Categ = m_gtCorrelationTemplate->cond1Category();
0165
0166 const L1GtMuonTemplate *corrMuon = nullptr;
0167 const L1GtCaloTemplate *corrCalo = nullptr;
0168 const L1GtEnergySumTemplate *corrEnergySum = nullptr;
0169
0170
0171 CombinationsInCond cond0Comb;
0172 CombinationsInCond cond1Comb;
0173
0174 switch (cond0Categ) {
0175 case CondMuon: {
0176 corrMuon = static_cast<const L1GtMuonTemplate *>(m_gtCond0);
0177 L1GtMuonCondition muCondition(corrMuon, m_gtGTL, m_cond0NrL1Objects, m_cond0EtaBits);
0178
0179 muCondition.evaluateConditionStoreResult();
0180 reqObjResult = muCondition.condLastResult();
0181
0182 cond0Comb = (muCondition.getCombinationsInCond());
0183 cndObjTypeVec[0] = (corrMuon->objectType())[0];
0184
0185 if (m_verbosity && m_isDebugEnabled) {
0186 std::ostringstream myCout;
0187 muCondition.print(myCout);
0188
0189 LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
0190 }
0191 } break;
0192 case CondCalo: {
0193 corrCalo = static_cast<const L1GtCaloTemplate *>(m_gtCond0);
0194
0195 L1GtCaloCondition caloCondition(corrCalo,
0196 m_gtPSB,
0197 m_cond0NrL1Objects,
0198 m_cond0NrL1Objects,
0199 m_cond0NrL1Objects,
0200 m_cond0NrL1Objects,
0201 m_cond0NrL1Objects,
0202 m_cond0EtaBits);
0203
0204 caloCondition.evaluateConditionStoreResult();
0205 reqObjResult = caloCondition.condLastResult();
0206
0207 cond0Comb = (caloCondition.getCombinationsInCond());
0208 cndObjTypeVec[0] = (corrCalo->objectType())[0];
0209
0210 if (m_verbosity && m_isDebugEnabled) {
0211 std::ostringstream myCout;
0212 caloCondition.print(myCout);
0213
0214 LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
0215 }
0216 } break;
0217 case CondEnergySum: {
0218 corrEnergySum = static_cast<const L1GtEnergySumTemplate *>(m_gtCond0);
0219 L1GtEnergySumCondition eSumCondition(corrEnergySum, m_gtPSB);
0220
0221 eSumCondition.evaluateConditionStoreResult();
0222 reqObjResult = eSumCondition.condLastResult();
0223
0224 cond0Comb = (eSumCondition.getCombinationsInCond());
0225 cndObjTypeVec[0] = (corrEnergySum->objectType())[0];
0226
0227 if (m_verbosity && m_isDebugEnabled) {
0228 std::ostringstream myCout;
0229 eSumCondition.print(myCout);
0230
0231 LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
0232 }
0233 } break;
0234 default: {
0235
0236
0237 return false;
0238 } break;
0239 }
0240
0241
0242 if (!reqObjResult) {
0243 if (m_verbosity && m_isDebugEnabled) {
0244 LogTrace("L1GlobalTrigger") << "\n First sub-condition false, second sub-condition not "
0245 "evaluated and not printed."
0246 << std::endl;
0247 }
0248 return false;
0249 }
0250
0251
0252 switch (cond1Categ) {
0253 case CondMuon: {
0254 corrMuon = static_cast<const L1GtMuonTemplate *>(m_gtCond1);
0255 L1GtMuonCondition muCondition(corrMuon, m_gtGTL, m_cond1NrL1Objects, m_cond1EtaBits);
0256
0257 muCondition.evaluateConditionStoreResult();
0258 reqObjResult = muCondition.condLastResult();
0259
0260 cond1Comb = (muCondition.getCombinationsInCond());
0261 cndObjTypeVec[1] = (corrMuon->objectType())[0];
0262
0263 if (m_verbosity && m_isDebugEnabled) {
0264 std::ostringstream myCout;
0265 muCondition.print(myCout);
0266
0267 LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
0268 }
0269 } break;
0270 case CondCalo: {
0271 corrCalo = static_cast<const L1GtCaloTemplate *>(m_gtCond1);
0272 L1GtCaloCondition caloCondition(corrCalo,
0273 m_gtPSB,
0274 m_cond1NrL1Objects,
0275 m_cond1NrL1Objects,
0276 m_cond1NrL1Objects,
0277 m_cond1NrL1Objects,
0278 m_cond1NrL1Objects,
0279 m_cond1EtaBits);
0280
0281 caloCondition.evaluateConditionStoreResult();
0282 reqObjResult = caloCondition.condLastResult();
0283
0284 cond1Comb = (caloCondition.getCombinationsInCond());
0285 cndObjTypeVec[1] = (corrCalo->objectType())[0];
0286
0287 if (m_verbosity && m_isDebugEnabled) {
0288 std::ostringstream myCout;
0289 caloCondition.print(myCout);
0290
0291 LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
0292 }
0293
0294 } break;
0295 case CondEnergySum: {
0296 corrEnergySum = static_cast<const L1GtEnergySumTemplate *>(m_gtCond1);
0297 L1GtEnergySumCondition eSumCondition(corrEnergySum, m_gtPSB);
0298 eSumCondition.evaluateConditionStoreResult();
0299 reqObjResult = eSumCondition.condLastResult();
0300
0301 cond1Comb = (eSumCondition.getCombinationsInCond());
0302 cndObjTypeVec[1] = (corrEnergySum->objectType())[0];
0303
0304 if (m_verbosity && m_isDebugEnabled) {
0305 std::ostringstream myCout;
0306 eSumCondition.print(myCout);
0307
0308 LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
0309 }
0310 } break;
0311 default: {
0312
0313
0314 return false;
0315 } break;
0316 }
0317
0318
0319 if (!reqObjResult) {
0320 return false;
0321 } else {
0322 LogTrace("L1GlobalTrigger") << "\n"
0323 << " Both sub-conditions true for object requirements."
0324 << " Evaluate correlation requirements.\n"
0325 << std::endl;
0326 }
0327
0328
0329
0330
0331
0332
0333
0334
0335 L1GtCorrelationTemplate::CorrelationParameter corrPar = *(m_gtCorrelationTemplate->correlationParameter());
0336
0337
0338
0339 size_t deltaEtaRangeConvSize = (corrPar.deltaEtaRange).size() / 16 + 1;
0340 std::vector<unsigned long long> deltaEtaRangeConv(deltaEtaRangeConvSize);
0341
0342 if (!(hexStringToInt64(corrPar.deltaEtaRange, deltaEtaRangeConv))) {
0343 return false;
0344 }
0345
0346
0347
0348 size_t deltaPhiRangeConvSize = (corrPar.deltaPhiRange).size() / 16 + 1;
0349 std::vector<unsigned long long> deltaPhiRangeConv(deltaPhiRangeConvSize);
0350
0351 if (!(hexStringToInt64(corrPar.deltaPhiRange, deltaPhiRangeConv))) {
0352 return false;
0353 }
0354
0355
0356 unsigned int objPairIndex = (m_gtEtaPhiConversions->gtObjectPairIndex(cndObjTypeVec[0], cndObjTypeVec[1]));
0357
0358
0359 unsigned int corrParDeltaPhiNrBins = (m_gtEtaPhiConversions->gtObjectNrBinsPhi(objPairIndex)) / 2 + 1;
0360
0361
0362
0363 SingleCombInCond objectsInComb;
0364 objectsInComb.reserve(nObjInCond);
0365
0366
0367 (combinationsInCond()).clear();
0368
0369
0370 const std::vector<const L1MuGMTCand *> *candMuVec = nullptr;
0371 const std::vector<const L1GctCand *> *candCaloVec = nullptr;
0372
0373 const L1GctEtMiss *candETM = nullptr;
0374 const L1GctHtMiss *candHTM = nullptr;
0375
0376
0377
0378
0379 unsigned int phiIndex0 = 0;
0380 unsigned int phiIndex1 = 0;
0381
0382 unsigned int phiIndex0Converted = 0;
0383 unsigned int phiIndex1Converted = 0;
0384
0385 unsigned int etaIndex0 = 0;
0386 unsigned int etaIndex1 = 0;
0387
0388 unsigned int etaIndex0Converted = 0;
0389 unsigned int etaIndex1Converted = 0;
0390
0391 LogTrace("L1GlobalTrigger") << " Sub-condition 0: std::vector<SingleCombInCond> size: " << (cond0Comb.size())
0392 << std::endl;
0393 LogTrace("L1GlobalTrigger") << " Sub-condition 1: std::vector<SingleCombInCond> size: " << (cond1Comb.size())
0394 << std::endl;
0395
0396
0397 for (std::vector<SingleCombInCond>::const_iterator it0Comb = cond0Comb.begin(); it0Comb != cond0Comb.end();
0398 it0Comb++) {
0399
0400
0401
0402 int obj0Index = -1;
0403
0404 if (!(*it0Comb).empty()) {
0405 obj0Index = (*it0Comb)[0];
0406 } else {
0407 LogTrace("L1GlobalTrigger") << "\n SingleCombInCond (*it0Comb).size() " << ((*it0Comb).size()) << std::endl;
0408 return false;
0409 }
0410
0411 bool convStatus = false;
0412
0413 switch (cond0Categ) {
0414 case CondMuon: {
0415 candMuVec = m_gtGTL->getCandL1Mu();
0416 phiIndex0 = (*candMuVec)[obj0Index]->phiIndex();
0417 etaIndex0 = (*candMuVec)[obj0Index]->etaIndex();
0418
0419 convStatus = m_gtEtaPhiConversions->convertPhiIndex(objPairIndex, 0, phiIndex0, phiIndex0Converted);
0420
0421 if (!convStatus) {
0422
0423 return false;
0424 }
0425
0426 convStatus = m_gtEtaPhiConversions->convertEtaIndex(Mu, etaIndex0, etaIndex0Converted);
0427
0428 if (!convStatus) {
0429
0430 return false;
0431 }
0432
0433 } break;
0434 case CondCalo: {
0435 switch (cndObjTypeVec[0]) {
0436 case NoIsoEG: {
0437 candCaloVec = m_gtPSB->getCandL1NoIsoEG();
0438 } break;
0439 case IsoEG: {
0440 candCaloVec = m_gtPSB->getCandL1IsoEG();
0441 } break;
0442 case CenJet: {
0443 candCaloVec = m_gtPSB->getCandL1CenJet();
0444 } break;
0445 case ForJet: {
0446 candCaloVec = m_gtPSB->getCandL1ForJet();
0447 } break;
0448 case TauJet: {
0449 candCaloVec = m_gtPSB->getCandL1TauJet();
0450 } break;
0451 default: {
0452
0453 } break;
0454 }
0455
0456 phiIndex0 = (*candCaloVec)[obj0Index]->phiIndex();
0457 etaIndex0 = (*candCaloVec)[obj0Index]->etaIndex();
0458
0459 convStatus = m_gtEtaPhiConversions->convertPhiIndex(objPairIndex, 0, phiIndex0, phiIndex0Converted);
0460
0461 if (!convStatus) {
0462
0463 return false;
0464 }
0465
0466 convStatus = m_gtEtaPhiConversions->convertEtaIndex(cndObjTypeVec[0], etaIndex0, etaIndex0Converted);
0467
0468 if (!convStatus) {
0469
0470 return false;
0471 }
0472 } break;
0473 case CondEnergySum: {
0474 switch (cndObjTypeVec[0]) {
0475 case ETM: {
0476 candETM = m_gtPSB->getCandL1ETM();
0477 phiIndex0 = candETM->phi();
0478
0479 convStatus = m_gtEtaPhiConversions->convertPhiIndex(objPairIndex, 0, phiIndex0, phiIndex0Converted);
0480
0481 if (!convStatus) {
0482
0483 return false;
0484 }
0485
0486 } break;
0487 case HTM: {
0488 candHTM = m_gtPSB->getCandL1HTM();
0489 phiIndex0 = candHTM->phi();
0490
0491 convStatus = m_gtEtaPhiConversions->convertPhiIndex(objPairIndex, 0, phiIndex0, phiIndex0Converted);
0492
0493 if (!convStatus) {
0494
0495 return false;
0496 }
0497
0498 } break;
0499 default:
0500
0501 break;
0502 }
0503 } break;
0504 default: {
0505
0506
0507 return false;
0508 } break;
0509 }
0510
0511 for (std::vector<SingleCombInCond>::const_iterator it1Comb = cond1Comb.begin(); it1Comb != cond1Comb.end();
0512 it1Comb++) {
0513
0514
0515 int obj1Index = -1;
0516
0517 if (!(*it1Comb).empty()) {
0518 obj1Index = (*it1Comb)[0];
0519 } else {
0520 LogTrace("L1GlobalTrigger") << "\n SingleCombInCond (*it1Comb).size() " << ((*it1Comb).size()) << std::endl;
0521 return false;
0522 }
0523
0524 switch (cond1Categ) {
0525 case CondMuon: {
0526 candMuVec = m_gtGTL->getCandL1Mu();
0527 phiIndex1 = (*candMuVec)[obj1Index]->phiIndex();
0528 etaIndex1 = (*candMuVec)[obj1Index]->etaIndex();
0529
0530 convStatus = m_gtEtaPhiConversions->convertPhiIndex(objPairIndex, 1, phiIndex1, phiIndex1Converted);
0531
0532 if (!convStatus) {
0533
0534 return false;
0535 }
0536
0537 convStatus = m_gtEtaPhiConversions->convertEtaIndex(cndObjTypeVec[1], etaIndex1, etaIndex1Converted);
0538
0539 if (!convStatus) {
0540
0541 return false;
0542 }
0543 } break;
0544 case CondCalo: {
0545 switch (cndObjTypeVec[1]) {
0546 case NoIsoEG:
0547 candCaloVec = m_gtPSB->getCandL1NoIsoEG();
0548 break;
0549 case IsoEG:
0550 candCaloVec = m_gtPSB->getCandL1IsoEG();
0551 break;
0552 case CenJet:
0553 candCaloVec = m_gtPSB->getCandL1CenJet();
0554 break;
0555 case ForJet:
0556 candCaloVec = m_gtPSB->getCandL1ForJet();
0557 break;
0558 case TauJet:
0559 candCaloVec = m_gtPSB->getCandL1TauJet();
0560 break;
0561 default:
0562
0563 break;
0564 }
0565
0566 phiIndex1 = (*candCaloVec)[obj1Index]->phiIndex();
0567 etaIndex1 = (*candCaloVec)[obj1Index]->etaIndex();
0568
0569 convStatus = m_gtEtaPhiConversions->convertPhiIndex(objPairIndex, 1, phiIndex1, phiIndex1Converted);
0570
0571 if (!convStatus) {
0572
0573 return false;
0574 }
0575
0576 convStatus = m_gtEtaPhiConversions->convertEtaIndex(cndObjTypeVec[1], etaIndex1, etaIndex1Converted);
0577
0578 if (!convStatus) {
0579
0580 return false;
0581 }
0582
0583 } break;
0584 case CondEnergySum: {
0585 switch (cndObjTypeVec[1]) {
0586 case ETM: {
0587 candETM = m_gtPSB->getCandL1ETM();
0588 phiIndex1 = candETM->phi();
0589
0590 convStatus = m_gtEtaPhiConversions->convertPhiIndex(objPairIndex, 1, phiIndex1, phiIndex1Converted);
0591
0592 if (!convStatus) {
0593
0594 return false;
0595 }
0596 } break;
0597 case HTM: {
0598 candHTM = m_gtPSB->getCandL1HTM();
0599 phiIndex1 = candHTM->phi();
0600
0601 convStatus = m_gtEtaPhiConversions->convertPhiIndex(objPairIndex, 1, phiIndex1, phiIndex1Converted);
0602
0603 if (!convStatus) {
0604
0605 return false;
0606 }
0607 } break;
0608 default:
0609
0610 break;
0611 }
0612 } break;
0613 default: {
0614
0615
0616 return false;
0617 } break;
0618 }
0619
0620 if (m_verbosity && m_isDebugEnabled) {
0621 LogTrace("L1GlobalTrigger") << " Correlation pair [" << l1GtObjectEnumToString(cndObjTypeVec[0]) << ", "
0622 << l1GtObjectEnumToString(cndObjTypeVec[1]) << "] with collection indices ["
0623 << obj0Index << ", " << obj1Index << "] "
0624 << " has: \n phi indices = [" << phiIndex0 << ", " << phiIndex1
0625 << "] converted to [" << phiIndex0Converted << ", " << phiIndex1Converted
0626 << "] \n eta indices [" << etaIndex0 << ", " << etaIndex1 << "] converted to ["
0627 << etaIndex0Converted << ", " << etaIndex1Converted << "] \n"
0628 << std::endl;
0629 }
0630
0631
0632
0633 bool reqEtaPhiResult = false;
0634
0635
0636
0637 unsigned int candDeltaPhi;
0638
0639
0640 if (phiIndex0Converted > phiIndex1Converted) {
0641 candDeltaPhi = phiIndex0Converted - phiIndex1Converted;
0642 } else {
0643 candDeltaPhi = phiIndex1Converted - phiIndex0Converted;
0644 }
0645
0646
0647
0648
0649
0650 int nMaxLoop = 10;
0651 int iLoop = 0;
0652
0653 while (candDeltaPhi >= corrParDeltaPhiNrBins) {
0654 unsigned int candDeltaPhiInitial = candDeltaPhi;
0655
0656
0657 candDeltaPhi = (corrParDeltaPhiNrBins - 1) * 2 - candDeltaPhi;
0658 if (m_verbosity) {
0659 LogTrace("L1GlobalTrigger") << " Initial candDeltaPhi = " << candDeltaPhiInitial
0660 << " > corrParDeltaPhiNrBins = " << corrParDeltaPhiNrBins
0661 << " ==> candDeltaPhi rescaled to: " << candDeltaPhi << " [ loop index " << iLoop
0662 << "; breaks after " << nMaxLoop << " loops ]\n"
0663 << std::endl;
0664 }
0665
0666 iLoop++;
0667 if (iLoop > nMaxLoop) {
0668 return false;
0669 }
0670 }
0671
0672
0673
0674 bool indResult = true;
0675
0676 for (size_t iDeltaPhi = 0; iDeltaPhi < deltaPhiRangeConv.size(); ++iDeltaPhi) {
0677 if (!checkBit(deltaPhiRangeConv[iDeltaPhi], candDeltaPhi)) {
0678 indResult = false;
0679 }
0680 }
0681
0682 if (!indResult) {
0683 if (m_verbosity && m_isDebugEnabled) {
0684 LogTrace("L1GlobalTrigger") << " object delta phi = " << candDeltaPhi << " fails delta phi requirements."
0685 << "\n Pair fails correlation condition.\n"
0686 << std::endl;
0687 }
0688
0689 continue;
0690
0691 } else {
0692 if (m_verbosity && m_isDebugEnabled) {
0693 LogTrace("L1GlobalTrigger") << " object delta phi = " << candDeltaPhi
0694 << " passes delta phi requirements." << std::endl;
0695 }
0696 }
0697
0698
0699
0700 unsigned int candDeltaEta;
0701
0702
0703 if (etaIndex0Converted > etaIndex1Converted) {
0704 candDeltaEta = etaIndex0Converted - etaIndex1Converted;
0705 } else {
0706 candDeltaEta = etaIndex1Converted - etaIndex0Converted;
0707 }
0708
0709
0710
0711 indResult = true;
0712
0713 for (size_t iDeltaEta = 0; iDeltaEta < deltaEtaRangeConv.size(); ++iDeltaEta) {
0714 if (!checkBit(deltaEtaRangeConv[iDeltaEta], candDeltaEta)) {
0715 indResult = false;
0716 }
0717 }
0718
0719 if (!indResult) {
0720 if (m_verbosity && m_isDebugEnabled) {
0721 LogTrace("L1GlobalTrigger") << " object delta eta = " << candDeltaEta << " fails delta eta requirements."
0722 << "\n Pair fails correlation condition.\n"
0723 << std::endl;
0724 }
0725
0726 reqEtaPhiResult = false;
0727 continue;
0728
0729 } else {
0730 if (m_verbosity && m_isDebugEnabled) {
0731 LogTrace("L1GlobalTrigger") << " object delta eta = " << candDeltaEta
0732 << " passes delta eta requirements."
0733 << "\n Pair passes correlation condition.\n"
0734 << std::endl;
0735 }
0736
0737 reqEtaPhiResult = true;
0738 }
0739
0740
0741 objectsInComb.clear();
0742
0743 objectsInComb.push_back(obj0Index);
0744 objectsInComb.push_back(obj1Index);
0745
0746
0747
0748
0749 if (reqEtaPhiResult) {
0750 condResult = true;
0751 (combinationsInCond()).push_back(objectsInComb);
0752 }
0753 }
0754 }
0755
0756 if (m_verbosity && m_isDebugEnabled && condResult) {
0757 LogTrace("L1GlobalTrigger") << (combinationsInCond()).size() << " correlation pair(s) ["
0758 << l1GtObjectEnumToString(cndObjTypeVec[0]) << ", "
0759 << l1GtObjectEnumToString(cndObjTypeVec[1]) << "] pass(es) the correlation condition.\n"
0760 << std::endl;
0761 }
0762
0763 return condResult;
0764 }
0765
0766 void L1GtCorrelationCondition::print(std::ostream &myCout) const {
0767 m_gtCorrelationTemplate->print(myCout);
0768 L1GtConditionEvaluation::print(myCout);
0769 }