51 const int ifCaloEtaNumberBits) :
55 m_ifCaloEtaNumberBits(ifCaloEtaNumberBits)
124 m_gtCaloTemplate = caloTempl;
138 m_ifCaloEtaNumberBits = ifCaloEtaNumberBitsValue;
144 const int& corrParDeltaPhiNrBins) {
146 m_corrParDeltaPhiNrBins = corrParDeltaPhiNrBins;
154 int nObjInCond = m_gtCaloTemplate->nrObjects();
166 switch ((m_gtCaloTemplate->objectType())[0]) {
168 candVec = m_uGtB->getCandL1EG();
172 candVec = m_uGtB->getCandL1Jet();
176 candVec = m_uGtB->getCandL1Tau();
185 int useBx = bxEval + m_gtCaloTemplate->condRelativeBx();
188 if( ( useBx < candVec->getFirstBX() ) ||
194 int numberObjects = candVec->
size(useBx);
197 if (numberObjects < nObjInCond) {
201 std::vector<int>
index(numberObjects);
203 for (
int i = 0;
i < numberObjects; ++
i) {
213 bool condResult =
false;
218 objectsInComb.reserve(nObjInCond);
221 combinationsInCond().clear();
229 for(
int i=0;
i<numberObjects;
i++ ){
232 objectsInComb.clear();
235 bool passCondition = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
237 objectsInComb.push_back(
i);
240 combinationsInCond().push_back(objectsInComb);
244 else if( nObjInCond==2 ){
246 for(
int i=0;
i<numberObjects;
i++ ){
248 bool passCondition0i = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
249 bool passCondition1i = checkObjectParameter(1, *(candVec->
at(useBx,
i)));
251 if( !( passCondition0i || passCondition1i ) )
continue;
253 for(
int j=0;
j<numberObjects;
j++ ){
257 bool passCondition0j = checkObjectParameter(0, *(candVec->
at(useBx,
j)));
258 bool passCondition1j = checkObjectParameter(1, *(candVec->
at(useBx,
j)));
261 (passCondition0i && passCondition1j) ||
262 (passCondition0j && passCondition1i)
267 if (m_gtCaloTemplate->wsc()) {
272 const int ObjInWscComb = 2;
273 if (nObjInCond != ObjInWscComb) {
278 <<
"number of particles in condition with spatial correlation = "
279 << nObjInCond <<
"\n it must be = " << ObjInWscComb
287 *(m_gtCaloTemplate->correlationParameter());
291 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRangeDeltaEta" << std::endl;
296 if( !checkRangeDeltaPhi( (candVec->
at(useBx,
i))->hwPhi(), (candVec->
at(useBx,
j))->hwPhi(),
298 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRangeDeltaPhi" << std::endl;
305 objectsInComb.clear();
306 objectsInComb.push_back(
i);
307 objectsInComb.push_back(
j);
310 combinationsInCond().push_back(objectsInComb);
315 else if( nObjInCond==3 ){
317 for(
int i=0;
i<numberObjects;
i++ ){
320 bool passCondition0i = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
321 bool passCondition1i = checkObjectParameter(1, *(candVec->
at(useBx,
i)));
322 bool passCondition2i = checkObjectParameter(2, *(candVec->
at(useBx,
i)));
324 if( !( passCondition0i || passCondition1i || passCondition2i ) )
continue;
326 for(
int j=0;
j<numberObjects;
j++ ){
329 bool passCondition0j = checkObjectParameter(0, *(candVec->
at(useBx,
j)));
330 bool passCondition1j = checkObjectParameter(1, *(candVec->
at(useBx,
j)));
331 bool passCondition2j = checkObjectParameter(2, *(candVec->
at(useBx,
j)));
333 if( !( passCondition0j || passCondition1j || passCondition2j ) )
continue;
335 for(
int k=0;
k<numberObjects;
k++ ){
336 if(
k==
i ||
k==
j )
continue;
339 bool passCondition0k = checkObjectParameter(0, *(candVec->
at(useBx,
k)));
340 bool passCondition1k = checkObjectParameter(1, *(candVec->
at(useBx,
k)));
341 bool passCondition2k = checkObjectParameter(2, *(candVec->
at(useBx,
k)));
344 (passCondition0i && passCondition1j && passCondition2k) ||
345 (passCondition0i && passCondition1k && passCondition2j) ||
346 (passCondition0j && passCondition1k && passCondition2i) ||
347 (passCondition0j && passCondition1i && passCondition2k) ||
348 (passCondition0k && passCondition1i && passCondition2j) ||
349 (passCondition0k && passCondition1j && passCondition2i)
354 objectsInComb.clear();
355 objectsInComb.push_back(
i);
356 objectsInComb.push_back(
j);
357 objectsInComb.push_back(
k);
358 combinationsInCond().push_back(objectsInComb);
364 else if( nObjInCond==4 ){
367 for(
int i=0;
i<numberObjects;
i++ ){
369 bool passCondition0i = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
370 bool passCondition1i = checkObjectParameter(1, *(candVec->
at(useBx,
i)));
371 bool passCondition2i = checkObjectParameter(2, *(candVec->
at(useBx,
i)));
372 bool passCondition3i = checkObjectParameter(3, *(candVec->
at(useBx,
i)));
374 if( !( passCondition0i || passCondition1i || passCondition2i || passCondition3i ) )
continue;
376 for(
int j=0;
j<numberObjects;
j++ ){
379 bool passCondition0j = checkObjectParameter(0, *(candVec->
at(useBx,
j)));
380 bool passCondition1j = checkObjectParameter(1, *(candVec->
at(useBx,
j)));
381 bool passCondition2j = checkObjectParameter(2, *(candVec->
at(useBx,
j)));
382 bool passCondition3j = checkObjectParameter(3, *(candVec->
at(useBx,
j)));
384 if( !( passCondition0j || passCondition1j || passCondition2j || passCondition3j ) )
continue;
386 for(
int k=0;
k<numberObjects;
k++ ){
387 if(
k==
i ||
k==
j )
continue;
389 bool passCondition0k = checkObjectParameter(0, *(candVec->
at(useBx,
k)));
390 bool passCondition1k = checkObjectParameter(1, *(candVec->
at(useBx,
k)));
391 bool passCondition2k = checkObjectParameter(2, *(candVec->
at(useBx,
k)));
392 bool passCondition3k = checkObjectParameter(3, *(candVec->
at(useBx,
k)));
394 if( !( passCondition0k || passCondition1k || passCondition2k || passCondition3k ) )
continue;
396 for(
int m=0;
m<numberObjects;
m++ ){
397 if(
m==
i ||
m==
j ||
m==
k )
continue;
400 bool passCondition0m = checkObjectParameter(0, *(candVec->
at(useBx,
m)));
401 bool passCondition1m = checkObjectParameter(1, *(candVec->
at(useBx,
m)));
402 bool passCondition2m = checkObjectParameter(2, *(candVec->
at(useBx,
m)));
403 bool passCondition3m = checkObjectParameter(3, *(candVec->
at(useBx,
m)));
406 (passCondition0i && passCondition1j && passCondition2k && passCondition3m) ||
407 (passCondition0i && passCondition1j && passCondition2m && passCondition3k) ||
408 (passCondition0i && passCondition1k && passCondition2j && passCondition3m) ||
409 (passCondition0i && passCondition1k && passCondition2m && passCondition3j) ||
410 (passCondition0i && passCondition1m && passCondition2j && passCondition3k) ||
411 (passCondition0i && passCondition1m && passCondition2k && passCondition3j) ||
412 (passCondition0j && passCondition1i && passCondition2k && passCondition3m) ||
413 (passCondition0j && passCondition1i && passCondition2m && passCondition3k) ||
414 (passCondition0j && passCondition1k && passCondition2i && passCondition3m) ||
415 (passCondition0j && passCondition1k && passCondition2m && passCondition3i) ||
416 (passCondition0j && passCondition1m && passCondition2i && passCondition3k) ||
417 (passCondition0j && passCondition1m && passCondition2k && passCondition3i) ||
418 (passCondition0k && passCondition1i && passCondition2j && passCondition3m) ||
419 (passCondition0k && passCondition1i && passCondition2m && passCondition3j) ||
420 (passCondition0k && passCondition1j && passCondition2i && passCondition3m) ||
421 (passCondition0k && passCondition1j && passCondition2m && passCondition3i) ||
422 (passCondition0k && passCondition1m && passCondition2i && passCondition3j) ||
423 (passCondition0k && passCondition1m && passCondition2j && passCondition3i) ||
424 (passCondition0m && passCondition1i && passCondition2j && passCondition3k) ||
425 (passCondition0m && passCondition1i && passCondition2k && passCondition3j) ||
426 (passCondition0m && passCondition1j && passCondition2i && passCondition3k) ||
427 (passCondition0m && passCondition1j && passCondition2k && passCondition3i) ||
428 (passCondition0m && passCondition1k && passCondition2i && passCondition3j) ||
429 (passCondition0m && passCondition1k && passCondition2j && passCondition3i)
432 objectsInComb.clear();
433 objectsInComb.push_back(
i);
434 objectsInComb.push_back(
j);
435 objectsInComb.push_back(
k);
436 objectsInComb.push_back(
m);
439 combinationsInCond().push_back(objectsInComb);
449 <<
"\n CaloCondition: total number of permutations found: " << totalLoops
450 <<
"\n CaloCondition: number of permutations passing requirements: " << passLoops
451 <<
"\n" << std::endl;
463 switch ((m_gtCaloTemplate->objectType())[0]) {
465 return (m_uGtB->getCandL1EG())->at(bx,indexCand);
469 return (m_uGtB->getCandL1Jet())->at(bx,indexCand);
473 return (m_uGtB->getCandL1Tau())->at(bx,indexCand);
495 int nObjInCond = m_gtCaloTemplate->nrObjects();
497 if (iCondition >= nObjInCond || iCondition < 0) {
509 <<
"\n CaloTemplate: "
510 <<
"\n\t condRelativeBx = " << m_gtCaloTemplate->condRelativeBx()
511 <<
"\n ObjectParameter : "
513 <<
"\n\t etaRange = " << objPar.
etaRange
514 <<
"\n\t phiRange = " << objPar.
phiRange
519 <<
"\n l1t::Candidate : "
520 <<
"\n\t hwPt = " << cand.
hwPt()
521 <<
"\n\t hwEta = " << cand.
hwEta()
522 <<
"\n\t hwPhi = " << cand.
hwPhi()
528 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkThreshold" << std::endl;
534 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRange(eta)" << std::endl;
544 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed checkRange(phi)" << std::endl;
550 if( cand.
hwIso()>4 ){
551 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate has out of range hwIso = " << cand.
hwIso() << std::endl;
556 LogDebug(
"L1TGlobal") <<
"\t\t l1t::Candidate failed isolation requirement" << std::endl;
573 m_gtCaloTemplate->print(myCout);
575 myCout <<
" Number of bits for eta of calorimeter objects = "
576 << m_ifCaloEtaNumberBits << std::endl;
577 myCout <<
" Maximum number of bins for the delta phi scales = "
578 << 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
void setGtCorrParDeltaPhiNrBins(const int &)
unsigned int phiWindow2Upper
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
unsigned int phiWindow2Lower
unsigned int phiWindow1Upper
unsigned int etLowThreshold
typedef for a single object template
void setGtCaloTemplate(const CaloTemplate *)
bool condLastResult() const
get the latest result for the condition
unsigned int deltaEtaRangeUpper
const std::vector< GlobalObject > & objectType() const
get / set the trigger object type(s) in the condition
const int gtIfCaloEtaNumberBits() const
get / set the number of bits for eta of calorimeter objects
unsigned int etaWindow1Lower
void setuGtB(const GlobalBoard *)
set the pointer to uGT GlobalBoard
unsigned int phiWindow1Lower
unsigned int deltaPhiRangeUpper
unsigned int etaWindow2Upper
const l1t::L1Candidate * getCandidate(const int bx, const int indexCand) const
load calo candidates
int m_verbosity
verbosity level
int condMaxNumberObjects() const
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=
const GlobalBoard * getuGtB() const
get / set the pointer to uGt GlobalBoard
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
unsigned int etaWindow2Lower
unsigned int etHighThreshold
int m_condMaxNumberObjects
unsigned int isolationLUT
unsigned int etaWindow1Upper
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 deltaEtaRangeLower
const T & at(int bx, unsigned i) const