60 const int nrL1NoIsoEG,
65 const int ifCaloEtaNumberBits) :
69 m_ifCaloEtaNumberBits(ifCaloEtaNumberBits)
162 const int& corrParDeltaPhiNrBins) {
182 const std::vector<const L1GctCand*>* candVec;
205 int numberObjects = candVec->size();
208 if (numberObjects < nObjInCond) {
212 std::vector<int>
index(numberObjects);
214 for (
int i = 0;
i < numberObjects; ++
i) {
219 int jump =
factorial(numberObjects - nObjInCond);
227 bool condResult =
false;
232 objectsInComb.reserve(nObjInCond);
246 objectsInComb.clear();
248 bool tmpResult =
true;
251 for (
int i = 0;
i < nObjInCond;
i++) {
254 objectsInComb.push_back(index[i]);
271 const int ObjInWscComb = 2;
272 if (nObjInCond != ObjInWscComb) {
277 <<
"number of particles in condition with spatial correlation = "
278 << nObjInCond <<
"\n it must be = " << ObjInWscComb
288 unsigned int candDeltaEta;
289 unsigned int candDeltaPhi;
295 int signedEta[ObjInWscComb];
296 int signBit[ObjInWscComb] = { 0, 0 };
300 for (
int i = 0;
i < ObjInWscComb; ++
i) {
301 signBit[
i] = ((*candVec)[index[
i]]->etaIndex() & scaleEta)
303 signedEta[
i] = ((*candVec)[index[
i]]->etaIndex() )%scaleEta;
305 if (signBit[
i] == 1) {
306 signedEta[
i] = (-1)*signedEta[
i];
312 candDeltaEta =
static_cast<int> (
std::abs(signedEta[1] - signedEta[0]))
313 + static_cast<int> (signBit[1]^signBit[0]);
322 if ((*candVec)[index[0]]->phiIndex()> (*candVec)[index[1]]->phiIndex()) {
323 candDeltaPhi = (*candVec)[index[0]]->phiIndex() - (*candVec)[index[1]]->phiIndex();
326 candDeltaPhi = (*candVec)[index[1]]->phiIndex() - (*candVec)[index[0]]->phiIndex();
338 unsigned int candDeltaPhiInitial = candDeltaPhi;
344 <<
" Initial candDeltaPhi = "
345 << candDeltaPhiInitial
346 <<
" > m_corrParDeltaPhiNrBins = "
348 <<
" ==> candDeltaPhi rescaled to: "
349 << candDeltaPhi <<
" [ loop index " << iLoop
350 <<
"; breaks after " << nMaxLoop <<
" loops ]\n"
355 if (iLoop > nMaxLoop) {
375 }
while (std::next_permutation(index.begin(), index.end()) );
430 if (iCondition >= nObjInCond || iCondition < 0) {
469 myCout <<
" Number of bits for eta of calorimeter objects = "
471 myCout <<
" Maximum number of bins for the delta phi scales = "
virtual bool empty() const =0
empty candidate - true if object not initialized
int m_ifCaloEtaNumberBits
number of bits for eta of calorimeter objects
const std::vector< const L1GctCand * > * getCandL1TauJet() const
pointer to TauJet data list
void print(std::ostream &myCout) const
print condition
const int nrObjects() const
get number of trigger objects
const bool checkBit(const Type1 &mask, const unsigned int bitNumber) const
check if a bit with a given number is set in a mask
int m_verbosity
verbosity level
const std::vector< const L1GctCand * > * getCandL1CenJet() const
pointer to CenJet data list
bool m_condLastResult
the last result of evaluateCondition()
const int gtIfCaloEtaNumberBits() const
get / set the number of bits for eta of calorimeter objects
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
unsigned long long deltaPhiRange
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
const std::vector< const L1GctCand * > * getCandL1NoIsoEG() const
pointer to NoIsoEG data list
const std::vector< const L1GctCand * > * getCandL1ForJet() const
pointer to ForJet data list
std::vector< int > SingleCombInCond
typedefs
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
unsigned long long deltaEtaRange
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
const L1GctCand * getCandidate(const int indexCand) const
load calo candidates
int condMaxNumberObjects() const
void setGtCaloTemplate(const L1GtCaloTemplate *)
const bool checkObjectParameter(const int iCondition, const L1GctCand &cand) const
function to check a single object if it matches a condition
const L1GlobalTriggerPSB * gtPSB() const
get / set the pointer to PSB
const std::vector< const L1GctCand * > * getCandL1IsoEG() const
pointer to IsoEG data list
const L1GtCaloTemplate * m_gtCaloTemplate
pointer to a L1GtCaloTemplate
L1GtCaloCondition & operator=(const L1GtCaloCondition &)
virtual unsigned etaIndex() const =0
get eta index (bit 3 is sign, 1 for -ve Z, 0 for +ve Z)
const bool checkThreshold(const Type1 &threshold, const Type2 &value, const bool condGEqValue) const
const L1GtCaloTemplate * gtCaloTemplate() const
get / set the pointer to a L1GtCondition
void setGtIfCaloEtaNumberBits(const int &)
void copy(const L1GtCaloCondition &cp)
copy function for copy constructor and operator=
typedef for a single object template
unsigned int m_corrParDeltaPhiNrBins
typedef for correlation parameters
virtual void print(std::ostream &myCout) const
print the condition
int m_condMaxNumberObjects
const bool evaluateCondition() const
the core function to check if the condition matches
virtual unsigned phiIndex() const =0
get phi index (0-17)
void setGtPSB(const L1GlobalTriggerPSB *)
set the pointer to PSB
const CorrelationParameter * correlationParameter() const
ABC for GCT EM and jet candidates.
int factorial(int n)
factorial function
virtual void print(std::ostream &myCout) const
print condition
const bool condGEq() const
get / set condition GEq flag
const std::vector< ObjectParameter > * objectParameter() const
virtual unsigned rank() const =0
get the rank code (6 bits)
CombinationsInCond const & getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
virtual ~L1GtCaloCondition()
bool condLastResult() const
get the latest result for the condition
void setGtCorrParDeltaPhiNrBins(const int &)