![]() |
![]() |
#include <L1Trigger/GlobalTrigger/interface/L1GtJetCountsCondition.h>
Public Member Functions | |
const bool | evaluateCondition () const |
the core function to check if the condition matches | |
const L1GtJetCountsTemplate * | gtJetCountsTemplate () const |
get / set the pointer to a L1GtCondition | |
const L1GlobalTriggerPSB * | gtPSB () const |
get / set the pointer to PSB | |
L1GtJetCountsCondition (const L1GtJetCountsCondition &) | |
L1GtJetCountsCondition (const L1GtCondition *, const L1GlobalTriggerPSB *, const int nrL1JetCounts) | |
from base template condition (from event setup usually) | |
L1GtJetCountsCondition () | |
constructors default | |
L1GtJetCountsCondition & | operator= (const L1GtJetCountsCondition &) |
void | print (std::ostream &myCout) const |
print condition | |
void | setGtJetCountsTemplate (const L1GtJetCountsTemplate *) |
void | setGtPSB (const L1GlobalTriggerPSB *) |
set the pointer to PSB | |
virtual | ~L1GtJetCountsCondition () |
Private Member Functions | |
void | copy (const L1GtJetCountsCondition &cp) |
copy function for copy constructor and operator= | |
Private Attributes | |
const L1GtJetCountsTemplate * | m_gtJetCountsTemplate |
pointer to a L1GtJetCountsTemplate | |
const L1GlobalTriggerPSB * | m_gtPSB |
pointer to PSB, to be able to get the trigger objects | |
unsigned int | m_numberL1JetCounts |
maximum number of jet counts |
Implementation: <TODO: enter implementation details>
$Date$ $Revision$
Implementation: <TODO: enter implementation details>
$Date$ $Revision$
Definition at line 35 of file L1GtJetCountsCondition.h.
L1GtJetCountsCondition::L1GtJetCountsCondition | ( | ) |
constructors default
Definition at line 39 of file L1GtJetCountsCondition.cc.
00039 : 00040 L1GtConditionEvaluation() { 00041 00042 //empty 00043 00044 }
L1GtJetCountsCondition::L1GtJetCountsCondition | ( | const L1GtCondition * | jcTemplate, | |
const L1GlobalTriggerPSB * | ptrPSB, | |||
const int | nrL1JetCounts | |||
) |
from base template condition (from event setup usually)
Definition at line 47 of file L1GtJetCountsCondition.cc.
References L1GtConditionEvaluation::m_condMaxNumberObjects.
00048 : 00049 L1GtConditionEvaluation(), 00050 m_gtJetCountsTemplate(static_cast<const L1GtJetCountsTemplate*>(jcTemplate)), 00051 m_gtPSB(ptrPSB), 00052 m_numberL1JetCounts(nrL1JetCounts) 00053 { 00054 00055 // maximum number of objects received for the evaluation of the condition 00056 // no objects, in fact, just a number 00057 m_condMaxNumberObjects = 1; 00058 00059 }
L1GtJetCountsCondition::L1GtJetCountsCondition | ( | const L1GtJetCountsCondition & | cp | ) |
Definition at line 73 of file L1GtJetCountsCondition.cc.
References copy().
00073 : 00074 L1GtConditionEvaluation() { 00075 00076 copy(cp); 00077 00078 }
L1GtJetCountsCondition::~L1GtJetCountsCondition | ( | ) | [virtual] |
void L1GtJetCountsCondition::copy | ( | const L1GtJetCountsCondition & | cp | ) | [private] |
copy function for copy constructor and operator=
Definition at line 62 of file L1GtJetCountsCondition.cc.
References L1GtConditionEvaluation::condLastResult(), L1GtConditionEvaluation::condMaxNumberObjects(), L1GtConditionEvaluation::getCombinationsInCond(), gtJetCountsTemplate(), gtPSB(), L1GtConditionEvaluation::m_combinationsInCond, L1GtConditionEvaluation::m_condLastResult, L1GtConditionEvaluation::m_condMaxNumberObjects, m_gtJetCountsTemplate, and m_gtPSB.
Referenced by L1GtJetCountsCondition(), and operator=().
00062 { 00063 00064 m_gtJetCountsTemplate = cp.gtJetCountsTemplate(); 00065 m_gtPSB = cp.gtPSB(); 00066 00067 m_condMaxNumberObjects = cp.condMaxNumberObjects(); 00068 m_condLastResult = cp.condLastResult(); 00069 m_combinationsInCond = cp.getCombinationsInCond(); 00070 00071 }
const bool L1GtJetCountsCondition::evaluateCondition | ( | ) | const [virtual] |
the core function to check if the condition matches
Implements L1GtConditionEvaluation.
Definition at line 109 of file L1GtJetCountsCondition.cc.
References L1GtConditionEvaluation::checkThreshold(), L1GtCondition::condGEq(), L1GctJetCounts::count(), L1GtJetCountsTemplate::ObjectParameter::countIndex, L1GtJetCountsTemplate::ObjectParameter::countThreshold, lat::endl(), L1GlobalTriggerPSB::getCandL1JetCounts(), jetCounts, m_gtJetCountsTemplate, m_gtPSB, m_numberL1JetCounts, and L1GtJetCountsTemplate::objectParameter().
00109 { 00110 00111 // number of trigger objects in the condition 00112 // in fact, there is only one object 00113 int iCondition = 0; 00114 00115 // condition result condResult will be set to true if the jet counts 00116 // passes the requirement 00117 bool condResult = false; 00118 00119 // store the index of the JetCount object 00120 // from the combination evaluated in the condition 00121 SingleCombInCond objectsInComb; 00122 00123 // clear the m_combinationsInCond vector 00124 (*m_combinationsInCond).clear(); 00125 00126 // get the jet counts (event / condition) 00127 const L1GctJetCounts* jetCounts = m_gtPSB->getCandL1JetCounts(); 00128 00129 // protection against missing jet counts collection 00130 if (jetCounts == 0) { 00131 return false; 00132 } 00133 00134 const L1GtJetCountsTemplate::ObjectParameter objPar = 00135 ( *(m_gtJetCountsTemplate->objectParameter()) )[iCondition]; 00136 00137 unsigned int cIndex = objPar.countIndex; 00138 00139 if (cIndex >= m_numberL1JetCounts) { 00140 00141 edm::LogError("L1GtJetCountsCondition") << "\nL1GtJetCountsCondition error: countIndex " 00142 << cIndex << "greater than maximum allowed count = " << m_numberL1JetCounts 00143 << "\n ==> condResult = false " << std::endl; 00144 return false; 00145 00146 } 00147 00148 unsigned int countValue = jetCounts->count(cIndex); 00149 00150 // check countThreshold 00151 if ( !checkThreshold(objPar.countThreshold, countValue, m_gtJetCountsTemplate->condGEq()) ) { 00152 00153 return false; 00154 } 00155 00156 // index is always zero, as they are global quantities (there is only one object) 00157 int indexObj = 0; 00158 00159 objectsInComb.push_back(indexObj); 00160 (*m_combinationsInCond).push_back(objectsInComb); 00161 00162 // if we get here all checks were successful for this combination 00163 // set the general result for evaluateCondition to "true" 00164 00165 condResult = true; 00166 return condResult; 00167 00168 }
const L1GtJetCountsTemplate* L1GtJetCountsCondition::gtJetCountsTemplate | ( | ) | const [inline] |
get / set the pointer to a L1GtCondition
Definition at line 67 of file L1GtJetCountsCondition.h.
References m_gtJetCountsTemplate.
Referenced by copy().
00067 { 00068 return m_gtJetCountsTemplate; 00069 }
const L1GlobalTriggerPSB* L1GtJetCountsCondition::gtPSB | ( | ) | const [inline] |
get / set the pointer to PSB
Definition at line 74 of file L1GtJetCountsCondition.h.
References m_gtPSB.
Referenced by copy().
00074 { 00075 return m_gtPSB; 00076 }
L1GtJetCountsCondition & L1GtJetCountsCondition::operator= | ( | const L1GtJetCountsCondition & | cp | ) |
Definition at line 88 of file L1GtJetCountsCondition.cc.
References copy().
00089 { 00090 copy(cp); 00091 return *this; 00092 }
void L1GtJetCountsCondition::print | ( | std::ostream & | myCout | ) | const [virtual] |
print condition
Reimplemented from L1GtConditionEvaluation.
Definition at line 170 of file L1GtJetCountsCondition.cc.
References m_gtJetCountsTemplate, L1GtJetCountsTemplate::print(), and L1GtConditionEvaluation::print().
Referenced by L1GlobalTriggerGTL::run().
00170 { 00171 00172 m_gtJetCountsTemplate->print(myCout); 00173 L1GtConditionEvaluation::print(myCout); 00174 00175 }
void L1GtJetCountsCondition::setGtJetCountsTemplate | ( | const L1GtJetCountsTemplate * | jcTemplate | ) |
Definition at line 95 of file L1GtJetCountsCondition.cc.
References m_gtJetCountsTemplate.
00095 { 00096 00097 m_gtJetCountsTemplate = jcTemplate; 00098 00099 }
void L1GtJetCountsCondition::setGtPSB | ( | const L1GlobalTriggerPSB * | ptrPSB | ) |
set the pointer to PSB
Definition at line 102 of file L1GtJetCountsCondition.cc.
References m_gtPSB.
00102 { 00103 00104 m_gtPSB = ptrPSB; 00105 00106 }
const L1GtJetCountsTemplate* L1GtJetCountsCondition::m_gtJetCountsTemplate [private] |
pointer to a L1GtJetCountsTemplate
Definition at line 88 of file L1GtJetCountsCondition.h.
Referenced by copy(), evaluateCondition(), gtJetCountsTemplate(), print(), and setGtJetCountsTemplate().
const L1GlobalTriggerPSB* L1GtJetCountsCondition::m_gtPSB [private] |
pointer to PSB, to be able to get the trigger objects
Definition at line 91 of file L1GtJetCountsCondition.h.
Referenced by copy(), evaluateCondition(), gtPSB(), and setGtPSB().
unsigned int L1GtJetCountsCondition::m_numberL1JetCounts [private] |
maximum number of jet counts
Definition at line 94 of file L1GtJetCountsCondition.h.
Referenced by evaluateCondition().