CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtCorrelationCondition.cc
Go to the documentation of this file.
1 
17 // this class header
19 
20 // system include files
21 #include <iostream>
22 #include <iomanip>
23 
24 #include <string>
25 #include <vector>
26 #include <algorithm>
27 
28 // user include files
29 // base classes
31 
35 
38 
44 
48 
50 
54 
57 
58 // constructors
59 // default
62  m_isDebugEnabled(edm::isDebugEnabled())
63 {
64 
65  // empty
66 
67 }
68 
69 // from base template condition (from event setup usually)
71  const L1GtCondition* corrTemplate, const L1GtCondition* cond0Condition,
72  const L1GtCondition* cond1Condition, const int cond0NrL1Objects,
73  const int cond1NrL1Objects, const int cond0EtaBits,
74  const int cond1EtaBits, const L1GlobalTriggerGTL* ptrGTL,
75  const L1GlobalTriggerPSB* ptrPSB,
76  const L1GtEtaPhiConversions* etaPhiConversions) :
78  m_gtCorrelationTemplate(static_cast<const L1GtCorrelationTemplate*>(corrTemplate)),
79  m_gtCond0(cond0Condition), m_gtCond1(cond1Condition),
80  m_cond0NrL1Objects(cond0NrL1Objects),
81  m_cond1NrL1Objects(cond1NrL1Objects), m_cond0EtaBits(cond0EtaBits),
82  m_cond1EtaBits(cond1EtaBits), m_gtGTL(ptrGTL), m_gtPSB(ptrPSB),
83  m_gtEtaPhiConversions(etaPhiConversions),
84  m_isDebugEnabled(edm::isDebugEnabled())
85  {
86 
87  m_condMaxNumberObjects = 2; // irrelevant for correlation conditions
88  m_nrBinsPhi = 0;
89 }
90 
91 // copy constructor
93 
95 
96  m_gtCond0 = cp.m_gtCond0;
97  m_gtCond1 = cp.m_gtCond1;
98 
103 
105 
107  m_gtGTL = cp.m_gtGTL;
108  m_gtPSB = cp.m_gtPSB;
109 
111 
115 
118 
119 
120 }
121 
123  const L1GtCorrelationCondition& cp) :
125  copy(cp);
126 }
127 
128 // destructor
130 
131  // empty
132 
133 }
134 
135 // equal operator
138 {
139  copy(cp);
140  return *this;
141 }
142 
143 // methods
144 
145 void L1GtCorrelationCondition::setGtNrBinsPhi(const unsigned int nrBins) {
146 
147  m_nrBinsPhi = nrBins;
148 
149 }
150 
151 //
153  const L1GtCorrelationTemplate* corrTempl) {
154 
155  m_gtCorrelationTemplate = corrTempl;
156 
157 }
158 
159 // set the pointer to GTL
161 
162  m_gtGTL = ptrGTL;
163 
164 }
165 
166 // set the pointer to PSB
168 
169  m_gtPSB = ptrPSB;
170 
171 }
172 
173 // try all object permutations and check spatial correlations, if required
175 
176  // std::cout << "m_isDebugEnabled = " << m_isDebugEnabled << std::endl;
177  // std::cout << "m_verbosity = " << m_verbosity << std::endl;
178 
179  bool condResult = false;
180  bool reqObjResult = false;
181 
182  // number of objects in condition (it is 2, no need to retrieve from
183  // condition template) and their type
184  int nObjInCond = 2;
185  std::vector<L1GtObject> cndObjTypeVec(nObjInCond);
186 
187  // evaluate first the two sub-conditions (Type1s)
188 
191 
192  const L1GtMuonTemplate* corrMuon = 0;
193  const L1GtCaloTemplate* corrCalo = 0;
194  const L1GtEnergySumTemplate* corrEnergySum = 0;
195 
196  // FIXME copying is slow...
197  CombinationsInCond cond0Comb;
198  CombinationsInCond cond1Comb;
199 
200  switch (cond0Categ) {
201  case CondMuon: {
202  corrMuon = static_cast<const L1GtMuonTemplate*>(m_gtCond0);
203  L1GtMuonCondition muCondition(corrMuon, m_gtGTL,
205 
206  muCondition.evaluateConditionStoreResult();
207  reqObjResult = muCondition.condLastResult();
208 
209  cond0Comb = (muCondition.getCombinationsInCond());
210  cndObjTypeVec[0] = (corrMuon->objectType())[0];
211 
212  if (m_verbosity && m_isDebugEnabled ) {
213  std::ostringstream myCout;
214  muCondition.print(myCout);
215 
216  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
217  }
218  }
219  break;
220  case CondCalo: {
221  corrCalo = static_cast<const L1GtCaloTemplate*>(m_gtCond0);
222 
223  L1GtCaloCondition caloCondition(corrCalo, m_gtPSB,
226 
227  caloCondition.evaluateConditionStoreResult();
228  reqObjResult = caloCondition.condLastResult();
229 
230  cond0Comb = (caloCondition.getCombinationsInCond());
231  cndObjTypeVec[0] = (corrCalo->objectType())[0];
232 
233  if (m_verbosity && m_isDebugEnabled) {
234  std::ostringstream myCout;
235  caloCondition.print(myCout);
236 
237  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
238  }
239  }
240  break;
241  case CondEnergySum: {
242  corrEnergySum = static_cast<const L1GtEnergySumTemplate*>(m_gtCond0);
243  L1GtEnergySumCondition eSumCondition(corrEnergySum, m_gtPSB);
244 
245  eSumCondition.evaluateConditionStoreResult();
246  reqObjResult = eSumCondition.condLastResult();
247 
248  cond0Comb = (eSumCondition.getCombinationsInCond());
249  cndObjTypeVec[0] = (corrEnergySum->objectType())[0];
250 
251  if (m_verbosity && m_isDebugEnabled ) {
252  std::ostringstream myCout;
253  eSumCondition.print(myCout);
254 
255  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
256  }
257  }
258  break;
259  default: {
260  // should not arrive here, there are no correlation conditions defined for this object
261  return false;
262  }
263  break;
264  }
265 
266  // return if first subcondition is false
267  if (!reqObjResult) {
268  if (m_verbosity && m_isDebugEnabled) {
269  LogTrace("L1GlobalTrigger")
270  << "\n First sub-condition false, second sub-condition not evaluated and not printed."
271  << std::endl;
272  }
273  return false;
274  }
275 
276  // second object
277  reqObjResult = false;
278 
279  switch (cond1Categ) {
280  case CondMuon: {
281  corrMuon = static_cast<const L1GtMuonTemplate*>(m_gtCond1);
282  L1GtMuonCondition muCondition(corrMuon, m_gtGTL,
284 
285  muCondition.evaluateConditionStoreResult();
286  reqObjResult = muCondition.condLastResult();
287 
288  cond1Comb = (muCondition.getCombinationsInCond());
289  cndObjTypeVec[1] = (corrMuon->objectType())[0];
290 
291  if (m_verbosity && m_isDebugEnabled ) {
292  std::ostringstream myCout;
293  muCondition.print(myCout);
294 
295  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
296  }
297  }
298  break;
299  case CondCalo: {
300  corrCalo = static_cast<const L1GtCaloTemplate*>(m_gtCond1);
301  L1GtCaloCondition caloCondition(corrCalo, m_gtPSB,
304 
305  caloCondition.evaluateConditionStoreResult();
306  reqObjResult = caloCondition.condLastResult();
307 
308  cond1Comb = (caloCondition.getCombinationsInCond());
309  cndObjTypeVec[1] = (corrCalo->objectType())[0];
310 
311  if (m_verbosity && m_isDebugEnabled) {
312  std::ostringstream myCout;
313  caloCondition.print(myCout);
314 
315  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
316  }
317 
318  }
319  break;
320  case CondEnergySum: {
321  corrEnergySum = static_cast<const L1GtEnergySumTemplate*>(m_gtCond1);
322  L1GtEnergySumCondition eSumCondition(corrEnergySum, m_gtPSB);
323  eSumCondition.evaluateConditionStoreResult();
324  reqObjResult = eSumCondition.condLastResult();
325 
326  cond1Comb = (eSumCondition.getCombinationsInCond());
327  cndObjTypeVec[1] = (corrEnergySum->objectType())[0];
328 
329  if (m_verbosity && m_isDebugEnabled ) {
330  std::ostringstream myCout;
331  eSumCondition.print(myCout);
332 
333  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
334  }
335  }
336  break;
337  default: {
338  // should not arrive here, there are no correlation conditions defined for this object
339  return false;
340  }
341  break;
342  }
343 
344  // return if second sub-condition is false
345  if (!reqObjResult) {
346  return false;
347  } else {
348  LogTrace("L1GlobalTrigger") << "\n"
349  << " Both sub-conditions true for object requirements."
350  << " Evaluate correlation requirements.\n" << std::endl;
351 
352  }
353 
354  //
355  // evaluate the delta_eta and delta_phi correlations
356  // if here, the object requirements are satisfied for both sub-conditions
357  //
358 
359  // get the correlation parameters
360 
363 
364  // convert the eta template requirements from string to 64-bit integers
365  // number of 64-bit integers: string length / 16
366  size_t deltaEtaRangeConvSize = (corrPar.deltaEtaRange).size() / 16
367  + 1;
368  std::vector<unsigned long long> deltaEtaRangeConv(
369  deltaEtaRangeConvSize);
370 
371  if (!(hexStringToInt64(corrPar.deltaEtaRange, deltaEtaRangeConv))) {
372  return false;
373  }
374 
375  // convert the phi template requirements from string to 64-bit integers
376  // number of 64-bit integers: string length / 16
377  size_t deltaPhiRangeConvSize = (corrPar.deltaPhiRange).size() / 16
378  + 1;
379  std::vector<unsigned long long> deltaPhiRangeConv(
380  deltaPhiRangeConvSize);
381 
382  if (!(hexStringToInt64(corrPar.deltaPhiRange, deltaPhiRangeConv))) {
383  return false;
384  }
385 
386  // get the index of L1 GT object pair
387  unsigned int objPairIndex = (m_gtEtaPhiConversions->gtObjectPairIndex(
388  cndObjTypeVec[0], cndObjTypeVec[1]));
389 
390  // get the maximum number of bins for the delta phi scales
391  unsigned int corrParDeltaPhiNrBins =
392  (m_gtEtaPhiConversions->gtObjectNrBinsPhi(objPairIndex)) / 2 + 1;
393 
394 
395  // vector to store the indices of the calorimeter objects
396  // from the combination evaluated in the condition
397  SingleCombInCond objectsInComb;
398  objectsInComb.reserve(nObjInCond);
399 
400  // clear the m_combinationsInCond vector
402 
403  // pointers to objects
404  const std::vector<const L1MuGMTCand*>* candMuVec = 0;
405  const std::vector<const L1GctCand*>* candCaloVec = 0;
406  // only ETM and HTM can appear in correlation conditions
407  const L1GctEtMiss* candETM = 0;
408  const L1GctHtMiss* candHTM = 0;
409 
410  // make the conversions of the indices, depending on the combination of objects involved
411  // (via pair index)
412 
413  unsigned int phiIndex0 = 0;
414  unsigned int phiIndex1 = 0;
415 
416  unsigned int phiIndex0Converted = 0;
417  unsigned int phiIndex1Converted = 0;
418 
419  unsigned int etaIndex0 = 0;
420  unsigned int etaIndex1 = 0;
421 
422  unsigned int etaIndex0Converted = 0;
423  unsigned int etaIndex1Converted = 0;
424 
425  LogTrace("L1GlobalTrigger")
426  << " Sub-condition 0: std::vector<SingleCombInCond> size: "
427  << (cond0Comb.size()) << std::endl;
428  LogTrace("L1GlobalTrigger")
429  << " Sub-condition 1: std::vector<SingleCombInCond> size: "
430  << (cond1Comb.size()) << std::endl;
431 
432 
433  // loop over all combinations which produced individually "true" as Type1s
434  for (std::vector<SingleCombInCond>::const_iterator it0Comb =
435  cond0Comb.begin(); it0Comb != cond0Comb.end(); it0Comb++) {
436 
437  // Type1s: there is 1 object only, no need for a loop, index 0 should be OK in (*it0Comb)[0]
438  // ... but add protection to not crash
439  int obj0Index = -1;
440 
441  if ((*it0Comb).size() > 0) {
442  obj0Index = (*it0Comb)[0];
443  } else {
444  LogTrace("L1GlobalTrigger")
445  << "\n SingleCombInCond (*it0Comb).size() "
446  << ((*it0Comb).size()) << std::endl;
447  return false;
448  }
449 
450  bool convStatus = false;
451 
452  switch (cond0Categ) {
453  case CondMuon: {
454  candMuVec = m_gtGTL->getCandL1Mu();
455  phiIndex0 = (*candMuVec)[obj0Index]->phiIndex();
456  etaIndex0 = (*candMuVec)[obj0Index]->etaIndex();
457 
459  objPairIndex, 0, phiIndex0, phiIndex0Converted);
460 
461  if (!convStatus) {
462  // conversion failed, message written in L1GtEtaPhiConversions
463  return false;
464  }
465 
467  Mu, etaIndex0, etaIndex0Converted);
468 
469  if (!convStatus) {
470  // conversion failed, message written in L1GtEtaPhiConversions
471  return false;
472  }
473 
474  }
475  break;
476  case CondCalo: {
477  switch (cndObjTypeVec[0]) {
478  case NoIsoEG: {
479  candCaloVec = m_gtPSB->getCandL1NoIsoEG();
480  }
481  break;
482  case IsoEG: {
483  candCaloVec = m_gtPSB->getCandL1IsoEG();
484  }
485  break;
486  case CenJet: {
487  candCaloVec = m_gtPSB->getCandL1CenJet();
488  }
489  break;
490  case ForJet: {
491  candCaloVec = m_gtPSB->getCandL1ForJet();
492  }
493  break;
494  case TauJet: {
495  candCaloVec = m_gtPSB->getCandL1TauJet();
496  }
497  break;
498  default: {
499  // do nothing
500  }
501  break;
502  }
503 
504  phiIndex0 = (*candCaloVec)[obj0Index]->phiIndex();
505  etaIndex0 = (*candCaloVec)[obj0Index]->etaIndex();
506 
508  objPairIndex, 0, phiIndex0, phiIndex0Converted);
509 
510  if (!convStatus) {
511  // conversion failed, message written in L1GtEtaPhiConversions
512  return false;
513  }
514 
516  cndObjTypeVec[0], etaIndex0, etaIndex0Converted);
517 
518  if (!convStatus) {
519  // conversion failed, message written in L1GtEtaPhiConversions
520  return false;
521  }
522  }
523  break;
524  case CondEnergySum: {
525  switch (cndObjTypeVec[0]) {
526  case ETM: {
527  candETM = m_gtPSB->getCandL1ETM();
528  phiIndex0 = candETM->phi();
529 
531  objPairIndex, 0, phiIndex0, phiIndex0Converted);
532 
533  if (!convStatus) {
534  // conversion failed, message written in L1GtEtaPhiConversions
535  return false;
536  }
537 
538  }
539  break;
540  case HTM: {
541  candHTM = m_gtPSB->getCandL1HTM();
542  phiIndex0 = candHTM->phi();
543 
545  objPairIndex, 0, phiIndex0, phiIndex0Converted);
546 
547  if (!convStatus) {
548  // conversion failed, message written in L1GtEtaPhiConversions
549  return false;
550  }
551 
552  }
553  break;
554  default:
555  // do nothing
556  break;
557  }
558  }
559  break;
560  default: {
561  // should not arrive here, there are no correlation conditions defined for this object
562  return false;
563  }
564  break;
565  }
566 
567  for (std::vector<SingleCombInCond>::const_iterator it1Comb =
568  cond1Comb.begin(); it1Comb != cond1Comb.end(); it1Comb++) {
569 
570  // Type1s: there is 1 object only, no need for a loop (*it1Comb)[0]
571  // ... but add protection to not crash
572  int obj1Index = -1;
573 
574  if ((*it1Comb).size() > 0) {
575  obj1Index = (*it1Comb)[0];
576  } else {
577  LogTrace("L1GlobalTrigger")
578  << "\n SingleCombInCond (*it1Comb).size() "
579  << ((*it1Comb).size()) << std::endl;
580  return false;
581  }
582 
583  switch (cond1Categ) {
584  case CondMuon: {
585  candMuVec = m_gtGTL->getCandL1Mu();
586  phiIndex1 = (*candMuVec)[obj1Index]->phiIndex();
587  etaIndex1 = (*candMuVec)[obj1Index]->etaIndex();
588 
590  objPairIndex, 1, phiIndex1, phiIndex1Converted);
591 
592  if (!convStatus) {
593  // conversion failed, message written in L1GtEtaPhiConversions
594  return false;
595  }
596 
598  cndObjTypeVec[1], etaIndex1, etaIndex1Converted);
599 
600  if (!convStatus) {
601  // conversion failed, message written in L1GtEtaPhiConversions
602  return false;
603  }
604  }
605  break;
606  case CondCalo: {
607  switch (cndObjTypeVec[1]) {
608  case NoIsoEG:
609  candCaloVec = m_gtPSB->getCandL1NoIsoEG();
610  break;
611  case IsoEG:
612  candCaloVec = m_gtPSB->getCandL1IsoEG();
613  break;
614  case CenJet:
615  candCaloVec = m_gtPSB->getCandL1CenJet();
616  break;
617  case ForJet:
618  candCaloVec = m_gtPSB->getCandL1ForJet();
619  break;
620  case TauJet:
621  candCaloVec = m_gtPSB->getCandL1TauJet();
622  break;
623  default:
624  // do nothing
625  break;
626  }
627 
628  phiIndex1 = (*candCaloVec)[obj1Index]->phiIndex();
629  etaIndex1 = (*candCaloVec)[obj1Index]->etaIndex();
630 
632  objPairIndex, 1, phiIndex1, phiIndex1Converted);
633 
634  if (!convStatus) {
635  // conversion failed, message written in L1GtEtaPhiConversions
636  return false;
637  }
638 
640  cndObjTypeVec[1], etaIndex1, etaIndex1Converted);
641 
642  if (!convStatus) {
643  // conversion failed, message written in L1GtEtaPhiConversions
644  return false;
645  }
646 
647  }
648  break;
649  case CondEnergySum: {
650  switch (cndObjTypeVec[1]) {
651  case ETM: {
652  candETM = m_gtPSB->getCandL1ETM();
653  phiIndex1 = candETM->phi();
654 
656  objPairIndex, 1, phiIndex1, phiIndex1Converted);
657 
658  if (!convStatus) {
659  // conversion failed, message written in L1GtEtaPhiConversions
660  return false;
661  }
662  }
663  break;
664  case HTM: {
665  candHTM = m_gtPSB->getCandL1HTM();
666  phiIndex1 = candHTM->phi();
667 
669  objPairIndex, 1, phiIndex1, phiIndex1Converted);
670 
671  if (!convStatus) {
672  // conversion failed, message written in L1GtEtaPhiConversions
673  return false;
674  }
675  }
676  break;
677  default:
678  // do nothing
679  break;
680  }
681  }
682  break;
683  default: {
684  // should not arrive here, there are no correlation conditions defined for this object
685  return false;
686  }
687  break;
688  }
689 
690  if (m_verbosity && m_isDebugEnabled ) {
691  LogTrace("L1GlobalTrigger") << " Correlation pair ["
692  << l1GtObjectEnumToString(cndObjTypeVec[0]) << ", "
693  << l1GtObjectEnumToString(cndObjTypeVec[1])
694  << "] with collection indices [" << obj0Index << ", "
695  << obj1Index << "] " << " has: \n phi indices = ["
696  << phiIndex0 << ", " << phiIndex1 << "] converted to ["
697  << phiIndex0Converted << ", " << phiIndex1Converted
698  << "] \n eta indices [" << etaIndex0 << ", "
699  << etaIndex1 << "] converted to ["
700  << etaIndex0Converted << ", " << etaIndex1Converted
701  << "] \n" << std::endl;
702  }
703 
704  // the conversions were successful, need to evaluate requirements now
705 
706  bool reqEtaPhiResult = false;
707 
708  // evaluate candDeltaPhi requirements
709 
710  unsigned int candDeltaPhi;
711 
712  // calculate absolute value of candDeltaPhi
713  if (phiIndex0Converted > phiIndex1Converted) {
714  candDeltaPhi = phiIndex0Converted - phiIndex1Converted;
715  } else {
716  candDeltaPhi = phiIndex1Converted - phiIndex0Converted;
717  }
718 
719  // check if candDeltaPhi > 180 (via delta_phi_maxbits)
720  // delta_phi contains bits for 0..180 (0 and 180 included)
721  // protect also against infinite loop...
722 
723  int nMaxLoop = 10;
724  int iLoop = 0;
725 
726  while (candDeltaPhi >= corrParDeltaPhiNrBins) {
727 
728  unsigned int candDeltaPhiInitial = candDeltaPhi;
729 
730  // candDeltaPhi > 180 ==> take 360 - candDeltaPhi
731  candDeltaPhi = (corrParDeltaPhiNrBins - 1) * 2 - candDeltaPhi;
732  if (m_verbosity) {
733  LogTrace("L1GlobalTrigger")
734  << " Initial candDeltaPhi = "
735  << candDeltaPhiInitial
736  << " > corrParDeltaPhiNrBins = "
737  << corrParDeltaPhiNrBins
738  << " ==> candDeltaPhi rescaled to: "
739  << candDeltaPhi << " [ loop index " << iLoop
740  << "; breaks after " << nMaxLoop << " loops ]\n"
741  << std::endl;
742  }
743 
744  iLoop++;
745  if (iLoop > nMaxLoop) {
746  return false;
747  }
748  }
749 
750 
751  // template requirements already converted from string to 64-bit integers
752  // ...now check for each 64-bit integer against template requirements
753  bool indResult = true;
754 
755  for (size_t iDeltaPhi = 0; iDeltaPhi < deltaPhiRangeConv.size(); ++iDeltaPhi) {
756  if (!checkBit(deltaPhiRangeConv[iDeltaPhi], candDeltaPhi)) {
757  indResult = false;
758  }
759  }
760 
761  if (!indResult) {
762 
763  if (m_verbosity && m_isDebugEnabled ) {
764  LogTrace("L1GlobalTrigger") << " object delta phi = "
765  << candDeltaPhi << " fails delta phi requirements."
766  << "\n Pair fails correlation condition.\n"
767  << std::endl;
768  }
769 
770  reqEtaPhiResult = false;
771  continue;
772 
773  } else {
774  if (m_verbosity && m_isDebugEnabled ) {
775  LogTrace("L1GlobalTrigger") << " object delta phi = "
776  << candDeltaPhi
777  << " passes delta phi requirements."
778  << std::endl;
779  }
780  }
781 
782 
783  // evaluate candDeltaEta requirements
784 
785  unsigned int candDeltaEta;
786 
787  // calculate absolute value of candDeltaEta
788  if (etaIndex0Converted > etaIndex1Converted) {
789  candDeltaEta = etaIndex0Converted - etaIndex1Converted;
790  } else {
791  candDeltaEta = etaIndex1Converted - etaIndex0Converted;
792  }
793 
794  // template requirements already converted from string to 64-bit integers
795  // ...now check for each 64-bit integer against template requirements
796  indResult = true;
797 
798  for (size_t iDeltaEta = 0; iDeltaEta < deltaEtaRangeConv.size(); ++iDeltaEta) {
799  if (!checkBit(deltaEtaRangeConv[iDeltaEta], candDeltaEta)) {
800  indResult = false;
801  }
802  }
803 
804  if (!indResult) {
805 
806  if (m_verbosity && m_isDebugEnabled ) {
807  LogTrace("L1GlobalTrigger") << " object delta eta = "
808  << candDeltaEta << " fails delta eta requirements."
809  << "\n Pair fails correlation condition.\n"
810  << std::endl;
811  }
812 
813  reqEtaPhiResult = false;
814  continue;
815 
816  } else {
817  if (m_verbosity && m_isDebugEnabled ) {
818  LogTrace("L1GlobalTrigger") << " object delta eta = "
819  << candDeltaEta
820  << " passes delta eta requirements."
821  << "\n Pair passes correlation condition.\n"
822  << std::endl;
823  }
824 
825  reqEtaPhiResult = true;
826 
827  }
828 
829 
830  // clear the indices in the combination
831  objectsInComb.clear();
832 
833  objectsInComb.push_back(obj0Index);
834  objectsInComb.push_back(obj1Index);
835 
836  // if we get here all checks were successful for this combination
837  // set the general result for evaluateCondition to "true"
838 
839  if (reqEtaPhiResult) {
840 
841  condResult = true;
842  (combinationsInCond()).push_back(objectsInComb);
843 
844  }
845 
846  }
847 
848  }
849 
850  if (m_verbosity && m_isDebugEnabled && condResult) {
851  LogTrace("L1GlobalTrigger") << (combinationsInCond()).size()
852  << " correlation pair(s) [" << l1GtObjectEnumToString(
853  cndObjTypeVec[0]) << ", " << l1GtObjectEnumToString(
854  cndObjTypeVec[1]) << "] pass(es) the correlation condition.\n"
855  << std::endl;
856  }
857 
858  return condResult;
859 
860 }
861 
862 
863 void L1GtCorrelationCondition::print(std::ostream& myCout) const {
864 
867 
868 }
869 
L1GtCorrelationCondition & operator=(const L1GtCorrelationCondition &)
bool isDebugEnabled()
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
const std::vector< const L1GctCand * > * getCandL1TauJet() const
pointer to TauJet data list
void print(std::ostream &myCout) const
print condition
Definition: L1GtObject.h:41
const bool checkBit(const Type1 &mask, const unsigned int bitNumber) const
check if a bit with a given number is set in a mask
const std::vector< const L1GctCand * > * getCandL1CenJet() const
pointer to CenJet data list
bool m_condLastResult
the last result of evaluateCondition()
Definition: L1GtObject.h:38
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
const std::vector< const L1GctCand * > * getCandL1NoIsoEG() const
pointer to NoIsoEG data list
unsigned int m_nrBinsPhi
number of bins for delta phi
const std::vector< const L1GctCand * > * getCandL1ForJet() const
pointer to ForJet data list
std::vector< int > SingleCombInCond
typedefs
const L1GtCorrelationTemplate * m_gtCorrelationTemplate
pointer to a L1GtCorrelationTemplate
Persistable copy of missing Et measured at Level-1.
Definition: L1GctEtMiss.h:18
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: L1GtCondition.h:88
void setGtNrBinsPhi(const unsigned int)
void print(std::ostream &myCout) const
print condition
unsigned phi() const
get the Et
Definition: L1GctEtMiss.h:64
std::string l1GtObjectEnumToString(const L1GtObject &)
Definition: L1GtObject.cc:76
const unsigned int gtObjectPairIndex(const L1GtObject &, const L1GtObject &) const
void print(std::ostream &myCout) const
print condition
const L1GtConditionCategory cond1Category() const
void evaluateConditionStoreResult()
call evaluateCondition and save last result
const std::vector< const L1GctCand * > * getCandL1IsoEG() const
pointer to IsoEG data list
const L1GtCondition * m_gtCond0
pointer to first sub-condition
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:168
L1GtConditionCategory
condition categories
const L1GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
const unsigned int gtObjectNrBinsPhi(const L1GtObject &) const
return the number of phi bins for a GT object
#define LogTrace(id)
const L1GctHtMiss * getCandL1HTM() const
pointer to HTM data list
void copy(const L1GtCorrelationCondition &cp)
copy function for copy constructor and operator=
const bool convertEtaIndex(const L1GtObject &, const unsigned int initialIndex, unsigned int &convertedIndex) const
Definition: L1GtObject.h:32
Persistable copy of missing Et measured at Level-1.
Definition: L1GctHtMiss.h:16
const L1GctEtMiss * getCandL1ETM() const
pointer to ETM data list
virtual void print(std::ostream &myCout) const
print the condition
string const
Definition: compareJSON.py:14
void setGtPSB(const L1GlobalTriggerPSB *)
bool hexStringToInt64(const std::string &, std::vector< unsigned long long > &)
void print(std::ostream &myCout) const
print condition
const bool convertPhiIndex(const unsigned int pairIndex, const unsigned int positionPair, const unsigned int initialIndex, unsigned int &convertedIndex) const
void setGtGTL(const L1GlobalTriggerGTL *)
virtual void print(std::ostream &myCout) const
print condition
const bool evaluateCondition() const
the core function to check if the condition matches
const std::vector< const L1MuGMTCand * > * getCandL1Mu() const
return global muon trigger candidate
const CorrelationParameter * correlationParameter() const
get / set correlation parameters
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
void setGtCorrelationTemplate(const L1GtCorrelationTemplate *)
CombinationsInCond const & getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
tuple size
Write out results.
const L1GlobalTriggerGTL * m_gtGTL
pointer to GTL, to be able to get the trigger objects
unsigned phi() const
get the Et
Definition: L1GctHtMiss.h:66
const L1GtCondition * m_gtCond1
pointer to second sub-condition
const L1GtEtaPhiConversions * m_gtEtaPhiConversions
pointer to eta and phi conversion class
bool condLastResult() const
get the latest result for the condition