54 const int ifCaloEtaNumberBits) :
58 m_ifCaloEtaNumberBits(ifCaloEtaNumberBits)
133 m_gtCaloTemplate = caloTempl;
147 m_ifCaloEtaNumberBits = ifCaloEtaNumberBitsValue;
153 const int& corrParDeltaPhiNrBins) {
155 m_corrParDeltaPhiNrBins = corrParDeltaPhiNrBins;
163 int nObjInCond = m_gtCaloTemplate->nrObjects();
175 switch ((m_gtCaloTemplate->objectType())[0]) {
177 candVec = m_uGtB->getCandL1EG();
181 candVec = m_uGtB->getCandL1Jet();
185 candVec = m_uGtB->getCandL1Tau();
194 int useBx = bxEval + m_gtCaloTemplate->condRelativeBx();
197 if( ( useBx < candVec->getFirstBX() ) ||
203 int numberObjects = candVec->
size(useBx);
206 if (numberObjects < nObjInCond) {
210 std::vector<int>
index(numberObjects);
212 for (
int i = 0;
i < numberObjects; ++
i) {
222 bool condResult =
false;
227 objectsInComb.reserve(nObjInCond);
230 combinationsInCond().clear();
238 for(
int i=0;
i<numberObjects;
i++ ){
241 objectsInComb.clear();
244 bool passCondition = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
246 objectsInComb.push_back(
i);
249 combinationsInCond().push_back(objectsInComb);
253 else if( nObjInCond==2 ){
255 for(
int i=0;
i<numberObjects;
i++ ){
258 objectsInComb.clear();
260 bool passCondition0i = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
261 bool passCondition1i = checkObjectParameter(1, *(candVec->
at(useBx,
i)));
263 if( !( passCondition0i || passCondition1i ) )
continue;
265 for(
int j=0;
j<numberObjects;
j++ ){
269 bool passCondition0j = checkObjectParameter(0, *(candVec->
at(useBx,
j)));
270 bool passCondition1j = checkObjectParameter(1, *(candVec->
at(useBx,
j)));
273 (passCondition0i && passCondition1j) ||
274 (passCondition0j && passCondition1i)
279 if (m_gtCaloTemplate->wsc()) {
284 const int ObjInWscComb = 2;
285 if (nObjInCond != ObjInWscComb) {
290 <<
"number of particles in condition with spatial correlation = "
291 << nObjInCond <<
"\n it must be = " << ObjInWscComb
299 *(m_gtCaloTemplate->correlationParameter());
303 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed checkRangeDeltaEta" << std::endl;
308 if( !checkRangeDeltaPhi( (candVec->
at(useBx,
i))->hwPhi(), (candVec->
at(useBx,
j))->hwPhi(),
310 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed checkRangeDeltaPhi" << std::endl;
318 objectsInComb.push_back(
i);
319 objectsInComb.push_back(
j);
322 combinationsInCond().push_back(objectsInComb);
327 else if( nObjInCond==3 ){
329 for(
int i=0;
i<numberObjects;
i++ ){
332 objectsInComb.clear();
334 bool passCondition0i = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
335 bool passCondition1i = checkObjectParameter(1, *(candVec->
at(useBx,
i)));
336 bool passCondition2i = checkObjectParameter(2, *(candVec->
at(useBx,
i)));
338 if( !( passCondition0i || passCondition1i || passCondition2i ) )
continue;
340 for(
int j=0;
j<numberObjects;
j++ ){
343 bool passCondition0j = checkObjectParameter(0, *(candVec->
at(useBx,
j)));
344 bool passCondition1j = checkObjectParameter(1, *(candVec->
at(useBx,
j)));
345 bool passCondition2j = checkObjectParameter(2, *(candVec->
at(useBx,
j)));
347 if( !( passCondition0j || passCondition1j || passCondition2j ) )
continue;
349 for(
int k=0;
k<numberObjects;
k++ ){
350 if(
k==
i ||
k==
j )
continue;
353 bool passCondition0k = checkObjectParameter(0, *(candVec->
at(useBx,
k)));
354 bool passCondition1k = checkObjectParameter(1, *(candVec->
at(useBx,
k)));
355 bool passCondition2k = checkObjectParameter(2, *(candVec->
at(useBx,
k)));
358 (passCondition0i && passCondition1j && passCondition2k) ||
359 (passCondition0i && passCondition1k && passCondition2j) ||
360 (passCondition0j && passCondition1k && passCondition2i) ||
361 (passCondition0j && passCondition1i && passCondition2k) ||
362 (passCondition0k && passCondition1i && passCondition2j) ||
363 (passCondition0k && passCondition1j && passCondition2i)
368 objectsInComb.push_back(
i);
369 objectsInComb.push_back(
j);
370 objectsInComb.push_back(
k);
371 combinationsInCond().push_back(objectsInComb);
377 else if( nObjInCond==4 ){
380 for(
int i=0;
i<numberObjects;
i++ ){
383 objectsInComb.clear();
385 bool passCondition0i = checkObjectParameter(0, *(candVec->
at(useBx,
i)));
386 bool passCondition1i = checkObjectParameter(1, *(candVec->
at(useBx,
i)));
387 bool passCondition2i = checkObjectParameter(2, *(candVec->
at(useBx,
i)));
388 bool passCondition3i = checkObjectParameter(3, *(candVec->
at(useBx,
i)));
390 if( !( passCondition0i || passCondition1i || passCondition2i || passCondition3i ) )
continue;
392 for(
int j=0;
j<numberObjects;
j++ ){
395 bool passCondition0j = checkObjectParameter(0, *(candVec->
at(useBx,
j)));
396 bool passCondition1j = checkObjectParameter(1, *(candVec->
at(useBx,
j)));
397 bool passCondition2j = checkObjectParameter(2, *(candVec->
at(useBx,
j)));
398 bool passCondition3j = checkObjectParameter(3, *(candVec->
at(useBx,
j)));
400 if( !( passCondition0j || passCondition1j || passCondition2j || passCondition3j ) )
continue;
402 for(
int k=0;
k<numberObjects;
k++ ){
403 if(
k==
i ||
k==
j )
continue;
405 bool passCondition0k = checkObjectParameter(0, *(candVec->
at(useBx,
k)));
406 bool passCondition1k = checkObjectParameter(1, *(candVec->
at(useBx,
k)));
407 bool passCondition2k = checkObjectParameter(2, *(candVec->
at(useBx,
k)));
408 bool passCondition3k = checkObjectParameter(3, *(candVec->
at(useBx,
k)));
410 if( !( passCondition0k || passCondition1k || passCondition2k || passCondition3k ) )
continue;
412 for(
int m=0;
m<numberObjects;
m++ ){
413 if(
m==
i ||
m==
j ||
m==
k )
continue;
416 bool passCondition0m = checkObjectParameter(0, *(candVec->
at(useBx,
m)));
417 bool passCondition1m = checkObjectParameter(1, *(candVec->
at(useBx,
m)));
418 bool passCondition2m = checkObjectParameter(2, *(candVec->
at(useBx,
m)));
419 bool passCondition3m = checkObjectParameter(3, *(candVec->
at(useBx,
m)));
422 (passCondition0i && passCondition1j && passCondition2k && passCondition3m) ||
423 (passCondition0i && passCondition1j && passCondition2m && passCondition3k) ||
424 (passCondition0i && passCondition1k && passCondition2j && passCondition3m) ||
425 (passCondition0i && passCondition1k && passCondition2m && passCondition3j) ||
426 (passCondition0i && passCondition1m && passCondition2j && passCondition3k) ||
427 (passCondition0i && passCondition1m && passCondition2k && passCondition3j) ||
428 (passCondition0j && passCondition1i && passCondition2k && passCondition3m) ||
429 (passCondition0j && passCondition1i && passCondition2m && passCondition3k) ||
430 (passCondition0j && passCondition1k && passCondition2i && passCondition3m) ||
431 (passCondition0j && passCondition1k && passCondition2m && passCondition3i) ||
432 (passCondition0j && passCondition1m && passCondition2i && passCondition3k) ||
433 (passCondition0j && passCondition1m && passCondition2k && passCondition3i) ||
434 (passCondition0k && passCondition1i && passCondition2j && passCondition3m) ||
435 (passCondition0k && passCondition1i && passCondition2m && passCondition3j) ||
436 (passCondition0k && passCondition1j && passCondition2i && passCondition3m) ||
437 (passCondition0k && passCondition1j && passCondition2m && passCondition3i) ||
438 (passCondition0k && passCondition1m && passCondition2i && passCondition3j) ||
439 (passCondition0k && passCondition1m && passCondition2j && passCondition3i) ||
440 (passCondition0m && passCondition1i && passCondition2j && passCondition3k) ||
441 (passCondition0m && passCondition1i && passCondition2k && passCondition3j) ||
442 (passCondition0m && passCondition1j && passCondition2i && passCondition3k) ||
443 (passCondition0m && passCondition1j && passCondition2k && passCondition3i) ||
444 (passCondition0m && passCondition1k && passCondition2i && passCondition3j) ||
445 (passCondition0m && passCondition1k && passCondition2j && passCondition3i)
448 objectsInComb.push_back(
i);
449 objectsInComb.push_back(
j);
450 objectsInComb.push_back(
k);
451 objectsInComb.push_back(
m);
454 combinationsInCond().push_back(objectsInComb);
464 <<
"\n CaloCondition: total number of permutations found: " << totalLoops
465 <<
"\n CaloCondition: number of permutations passing requirements: " << passLoops
466 <<
"\n" << std::endl;
478 switch ((m_gtCaloTemplate->objectType())[0]) {
480 return (m_uGtB->getCandL1EG())->at(bx,indexCand);
484 return (m_uGtB->getCandL1Jet())->at(bx,indexCand);
488 return (m_uGtB->getCandL1Tau())->at(bx,indexCand);
510 int nObjInCond = m_gtCaloTemplate->nrObjects();
512 if (iCondition >= nObjInCond || iCondition < 0) {
524 <<
"\n CaloTemplate: "
525 <<
"\n\t condRelativeBx = " << m_gtCaloTemplate->condRelativeBx()
526 <<
"\n ObjectParameter : "
528 <<
"\n\t etaRange = " << objPar.
etaRange
529 <<
"\n\t phiRange = " << objPar.
phiRange
534 <<
"\n l1t::Candidate : "
535 <<
"\n\t hwPt = " << cand.
hwPt()
536 <<
"\n\t hwEta = " << cand.
hwEta()
537 <<
"\n\t hwPhi = " << cand.
hwPhi()
543 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed checkThreshold" << std::endl;
549 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed checkRange(eta)" << std::endl;
559 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed checkRange(phi)" << std::endl;
565 if( cand.
hwIso()>4 ){
566 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate has out of range hwIso = " << cand.
hwIso() << std::endl;
571 LogDebug(
"l1t|Global") <<
"\t\t l1t::Candidate failed isolation requirement" << std::endl;
588 m_gtCaloTemplate->print(myCout);
590 myCout <<
" Number of bits for eta of calorimeter objects = "
591 << m_ifCaloEtaNumberBits << std::endl;
592 myCout <<
" Maximum number of bins for the delta phi scales = "
593 << 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 int gtIfCaloEtaNumberBits() const
get / set the number of bits for eta of calorimeter objects
unsigned int etaWindow1Lower
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
unsigned int phiWindow1Lower
void setuGtB(const GtBoard *)
set the pointer to uGT GtBoard
unsigned int deltaPhiRangeUpper
unsigned int etaWindow2Upper
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
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=
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