61 const int ifCaloEtaNumberBits) :
65 m_ifCaloEtaNumberBits(ifCaloEtaNumberBits)
140 m_gtCaloTemplate = caloTempl;
154 m_ifCaloEtaNumberBits = ifCaloEtaNumberBitsValue;
160 const int& corrParDeltaPhiNrBins) {
162 m_corrParDeltaPhiNrBins = corrParDeltaPhiNrBins;
170 int nObjInCond = m_gtCaloTemplate->nrObjects();
182 switch ((m_gtCaloTemplate->objectType())[0]) {
184 candVec = m_uGtB->getCandL1EG();
188 candVec = m_uGtB->getCandL1Jet();
192 candVec = m_uGtB->getCandL1Tau();
201 int useBx = bxEval + m_gtCaloTemplate->condRelativeBx();
204 if( ( useBx < candVec->getFirstBX() ) ||
210 int numberObjects = candVec->
size(useBx);
213 if (numberObjects < nObjInCond) {
217 std::vector<int>
index(numberObjects);
219 for (
int i = 0;
i < numberObjects; ++
i) {
229 bool condResult =
false;
234 objectsInComb.reserve(nObjInCond);
237 combinationsInCond().clear();
245 objectsInComb.clear();
247 for(
int i=0;
i<numberObjects;
i++ ){
250 bool passCondition = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
252 objectsInComb.push_back(
i);
255 combinationsInCond().push_back(objectsInComb);
259 else if( nObjInCond==2 ){
262 objectsInComb.clear();
264 for(
int i=0;
i<numberObjects;
i++ ){
265 bool passCondition0i = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
266 bool passCondition1i = checkObjectParameter(1, *(candVec->
at(useBx,
i)));
268 if( !( passCondition0i || passCondition1i ) )
continue;
270 for(
int j=0;
j<numberObjects;
j++ ){
274 bool passCondition0j = checkObjectParameter(0, *(candVec->
at(useBx,
j)));
275 bool passCondition1j = checkObjectParameter(1, *(candVec->
at(useBx,
j)));
278 (passCondition0i && passCondition1j) ||
279 (passCondition0j && passCondition1i)
284 if (m_gtCaloTemplate->wsc()) {
289 const int ObjInWscComb = 2;
290 if (nObjInCond != ObjInWscComb) {
295 <<
"number of particles in condition with spatial correlation = "
296 << nObjInCond <<
"\n it must be = " << ObjInWscComb
304 *(m_gtCaloTemplate->correlationParameter());
308 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed checkRangeDeltaEta" << std::endl;
313 if( !checkRangeDeltaPhi( (candVec->
at(useBx,
i))->hwPhi(), (candVec->
at(useBx,
j))->hwPhi(),
315 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed checkRangeDeltaPhi" << std::endl;
323 objectsInComb.push_back(
i);
324 objectsInComb.push_back(
j);
327 combinationsInCond().push_back(objectsInComb);
332 else if( nObjInCond==3 ){
335 objectsInComb.clear();
337 for(
int i=0;
i<numberObjects;
i++ ){
338 bool passCondition0i = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
339 bool passCondition1i = checkObjectParameter(1, *(candVec->
at(useBx,
i)));
340 bool passCondition2i = checkObjectParameter(2, *(candVec->
at(useBx,
i)));
342 if( !( passCondition0i || passCondition1i || passCondition2i ) )
continue;
344 for(
int j=0;
j<numberObjects;
j++ ){
347 bool passCondition0j = checkObjectParameter(0, *(candVec->
at(useBx,
j)));
348 bool passCondition1j = checkObjectParameter(1, *(candVec->
at(useBx,
j)));
349 bool passCondition2j = checkObjectParameter(2, *(candVec->
at(useBx,
j)));
351 if( !( passCondition0j || passCondition1j || passCondition2j ) )
continue;
353 for(
int k=0;
k<numberObjects;
k++ ){
354 if(
k==
i ||
k==
j )
continue;
357 bool passCondition0k = checkObjectParameter(0, *(candVec->
at(useBx,
k)));
358 bool passCondition1k = checkObjectParameter(1, *(candVec->
at(useBx,
k)));
359 bool passCondition2k = checkObjectParameter(2, *(candVec->
at(useBx,
k)));
362 (passCondition0i && passCondition1j && passCondition2k) ||
363 (passCondition0i && passCondition1k && passCondition2j) ||
364 (passCondition0j && passCondition1k && passCondition2i) ||
365 (passCondition0j && passCondition1i && passCondition2k) ||
366 (passCondition0k && passCondition1i && passCondition2j) ||
367 (passCondition0k && passCondition1j && passCondition2i)
372 objectsInComb.push_back(
i);
373 objectsInComb.push_back(
j);
374 objectsInComb.push_back(
k);
375 combinationsInCond().push_back(objectsInComb);
381 else if( nObjInCond==4 ){
384 objectsInComb.clear();
386 for(
int i=0;
i<numberObjects;
i++ ){
387 bool passCondition0i = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
388 bool passCondition1i = checkObjectParameter(1, *(candVec->
at(useBx,
i)));
389 bool passCondition2i = checkObjectParameter(2, *(candVec->
at(useBx,
i)));
390 bool passCondition3i = checkObjectParameter(3, *(candVec->
at(useBx,
i)));
392 if( !( passCondition0i || passCondition1i || passCondition2i || passCondition3i ) )
continue;
394 for(
int j=0;
j<numberObjects;
j++ ){
397 bool passCondition0j = checkObjectParameter(0, *(candVec->
at(useBx,
j)));
398 bool passCondition1j = checkObjectParameter(1, *(candVec->
at(useBx,
j)));
399 bool passCondition2j = checkObjectParameter(2, *(candVec->
at(useBx,
j)));
400 bool passCondition3j = checkObjectParameter(3, *(candVec->
at(useBx,
j)));
402 if( !( passCondition0j || passCondition1j || passCondition2j || passCondition3j ) )
continue;
404 for(
int k=0;
k<numberObjects;
k++ ){
405 if(
k==
i ||
k==
j )
continue;
407 bool passCondition0k = checkObjectParameter(0, *(candVec->
at(useBx,
k)));
408 bool passCondition1k = checkObjectParameter(1, *(candVec->
at(useBx,
k)));
409 bool passCondition2k = checkObjectParameter(2, *(candVec->
at(useBx,
k)));
410 bool passCondition3k = checkObjectParameter(3, *(candVec->
at(useBx,
k)));
412 if( !( passCondition0k || passCondition1k || passCondition2k || passCondition3k ) )
continue;
414 for(
int m=0;
m<numberObjects;
m++ ){
415 if(
m==
i ||
m==
j ||
m==
k )
continue;
418 bool passCondition0m = checkObjectParameter(0, *(candVec->
at(useBx,
m)));
419 bool passCondition1m = checkObjectParameter(1, *(candVec->
at(useBx,
m)));
420 bool passCondition2m = checkObjectParameter(2, *(candVec->
at(useBx,
m)));
421 bool passCondition3m = checkObjectParameter(3, *(candVec->
at(useBx,
m)));
424 (passCondition0i && passCondition1j && passCondition2k && passCondition3m) ||
425 (passCondition0i && passCondition1j && passCondition2m && passCondition3k) ||
426 (passCondition0i && passCondition1k && passCondition2j && passCondition3m) ||
427 (passCondition0i && passCondition1k && passCondition2m && passCondition3j) ||
428 (passCondition0i && passCondition1m && passCondition2j && passCondition3k) ||
429 (passCondition0i && passCondition1m && passCondition2k && passCondition3j) ||
430 (passCondition0j && passCondition1i && passCondition2k && passCondition3m) ||
431 (passCondition0j && passCondition1i && passCondition2m && passCondition3k) ||
432 (passCondition0j && passCondition1k && passCondition2i && passCondition3m) ||
433 (passCondition0j && passCondition1k && passCondition2m && passCondition3i) ||
434 (passCondition0j && passCondition1m && passCondition2i && passCondition3k) ||
435 (passCondition0j && passCondition1m && passCondition2k && passCondition3i) ||
436 (passCondition0k && passCondition1i && passCondition2j && passCondition3m) ||
437 (passCondition0k && passCondition1i && passCondition2m && passCondition3j) ||
438 (passCondition0k && passCondition1j && passCondition2i && passCondition3m) ||
439 (passCondition0k && passCondition1j && passCondition2m && passCondition3i) ||
440 (passCondition0k && passCondition1m && passCondition2i && passCondition3j) ||
441 (passCondition0k && passCondition1m && passCondition2j && passCondition3i) ||
442 (passCondition0m && passCondition1i && passCondition2j && passCondition3k) ||
443 (passCondition0m && passCondition1i && passCondition2k && passCondition3j) ||
444 (passCondition0m && passCondition1j && passCondition2i && passCondition3k) ||
445 (passCondition0m && passCondition1j && passCondition2k && passCondition3i) ||
446 (passCondition0m && passCondition1k && passCondition2i && passCondition3j) ||
447 (passCondition0m && passCondition1k && passCondition2j && passCondition3i)
450 objectsInComb.push_back(
i);
451 objectsInComb.push_back(
j);
452 objectsInComb.push_back(
k);
453 objectsInComb.push_back(
m);
456 combinationsInCond().push_back(objectsInComb);
466 <<
"\n CaloCondition: total number of permutations found: " << totalLoops
467 <<
"\n CaloCondition: number of permutations passing requirements: " << passLoops
468 <<
"\n" << std::endl;
480 switch ((m_gtCaloTemplate->objectType())[0]) {
482 return (m_uGtB->getCandL1EG())->at(bx,indexCand);
486 return (m_uGtB->getCandL1Jet())->at(bx,indexCand);
490 return (m_uGtB->getCandL1Tau())->at(bx,indexCand);
512 int nObjInCond = m_gtCaloTemplate->nrObjects();
514 if (iCondition >= nObjInCond || iCondition < 0) {
526 <<
"\n CaloTemplate: "
527 <<
"\n\t condRelativeBx = " << m_gtCaloTemplate->condRelativeBx()
528 <<
"\n ObjectParameter : "
530 <<
"\n\t etaRange = " << objPar.
etaRange
531 <<
"\n\t phiRange = " << objPar.
phiRange
536 <<
"\n l1t::Candidate : "
537 <<
"\n\t hwPt = " << cand.
hwPt()
538 <<
"\n\t hwEta = " << cand.
hwEta()
539 <<
"\n\t hwPhi = " << cand.
hwPhi()
544 if ( !checkThreshold(objPar.
etThreshold, cand.
hwPt(), m_gtCaloTemplate->condGEq()) ) {
545 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed checkThreshold" << std::endl;
551 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed checkRange(eta)" << std::endl;
561 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed checkRange(phi)" << std::endl;
567 if( cand.
hwIso()>4 ){
568 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate has out of range hwIso = " << cand.
hwIso() << std::endl;
573 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed isolation requirement" << std::endl;
590 m_gtCaloTemplate->print(myCout);
592 myCout <<
" Number of bits for eta of calorimeter objects = "
593 << m_ifCaloEtaNumberBits << std::endl;
594 myCout <<
" Maximum number of bins for the delta phi scales = "
595 << m_corrParDeltaPhiNrBins <<
"\n " << std::endl;
const CaloTemplate * gtCaloTemplate() const
get / set the pointer to a Condition
unsigned int m_corrParDeltaPhiNrBins
unsigned size(int bx) const
CombinationsInCond const & getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
unsigned int phiWindowLower
void setGtCorrParDeltaPhiNrBins(const int &)
void print(std::ostream &myCout) const
print condition
virtual void print(std::ostream &myCout) const
print condition
void setGtIfCaloEtaNumberBits(const int &)
std::vector< int > SingleCombInCond
typedefs
unsigned int deltaPhiRangeLower
typedef for a single object template
void setGtCaloTemplate(const CaloTemplate *)
bool condLastResult() const
get the latest result for the condition
unsigned int deltaEtaRangeUpper
const int gtIfCaloEtaNumberBits() const
get / set the number of bits for eta of calorimeter objects
unsigned int phiWindowUpper
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
void setuGtB(const GtBoard *)
set the pointer to uGT GtBoard
unsigned int deltaPhiRangeUpper
const l1t::L1Candidate * getCandidate(const int bx, const int indexCand) const
load calo candidates
const GtBoard * getuGtB() const
get / set the pointer to uGt GtBoard
int m_verbosity
verbosity level
unsigned int etaWindowUpper
int condMaxNumberObjects() const
unsigned int etaWindowLower
CaloCondition & operator=(const CaloCondition &)
const bool checkObjectParameter(const int iCondition, const l1t::L1Candidate &cand) const
function to check a single object if it matches a condition
typedef for correlation parameters
void copy(const CaloCondition &cp)
copy function for copy constructor and operator=
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
int m_condMaxNumberObjects
unsigned int isolationLUT
const bool evaluateCondition(const int bxEval) const
the core function to check if the condition matches
const CaloTemplate * m_gtCaloTemplate
pointer to a CaloTemplate
unsigned int etaWindowVetoLower
unsigned int deltaEtaRangeLower
unsigned int phiWindowVetoLower
const T & at(int bx, unsigned i) const