CMS 3D CMS Logo

L1GtHfRingEtSumsCondition.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <iomanip>
20 #include <iostream>
21 
22 #include <vector>
23 
24 // user include files
25 // base class
27 
30 
32 
34 
35 // constructors
36 // default
38  // empty
39 }
40 
41 // from base template condition (from event setup usually)
44  m_gtHfRingEtSumsTemplate(static_cast<const L1GtHfRingEtSumsTemplate *>(etTemplate)),
45  m_gtPSB(ptrPSB) {
46  // maximum number of objects received for the evaluation of the condition
47  // no objects, in fact, just a number
49 }
50 
51 // copy constructor
53  m_gtHfRingEtSumsTemplate = cp.gtHfRingEtSumsTemplate();
54  m_gtPSB = cp.gtPSB();
55 
56  m_condMaxNumberObjects = cp.condMaxNumberObjects();
57  m_condLastResult = cp.condLastResult();
58  m_combinationsInCond = cp.getCombinationsInCond();
59 
60  m_verbosity = cp.m_verbosity;
61 }
62 
64  copy(cp);
65 }
66 
67 // destructor
69  // empty
70 }
71 
72 // equal operator
74  copy(cp);
75  return *this;
76 }
77 
78 // methods
80  m_gtHfRingEtSumsTemplate = etTemplate;
81 }
82 
85 
86 // try all object permutations and check spatial correlations, if required
88  // number of trigger objects in the condition
89  // no objects, in fact, just a number
90  int iCondition = 0;
91 
92  // condition result condResult will be set to true if the HF Ring Et sums
93  // passes the requirement
94  bool condResult = false;
95 
96  // store the index of the HfRingEtSums object
97  // from the combination evaluated in the condition
98  SingleCombInCond objectsInComb;
99 
100  // clear the m_combinationsInCond vector
102 
103  // get the HF Ring Et sums (event / condition)
104  const L1GctHFRingEtSums *etSumCand = m_gtPSB->getCandL1HfRingEtSums();
105 
106  // protection against missing HF Ring Et sums collection
107  if (etSumCand == nullptr) {
108  return false;
109  }
110 
112 
113  // FIXME ask GCT to provide a method to retrieve it
114  const unsigned int numberL1HfRingEtSums = 4;
115 
116  const unsigned int cIndex = objPar.etSumIndex;
117  if (cIndex >= numberL1HfRingEtSums) {
118  edm::LogError("L1GlobalTrigger") << "\nL1GtHfRingEtSumsCondition error: etSumIndex " << cIndex
119  << "greater than GCT maximum index = " << numberL1HfRingEtSums
120  << "\n ==> condResult = false " << std::endl;
121  return false;
122  }
123 
124  const unsigned int etSumValue = etSumCand->etSum(cIndex);
125 
126  // check countThreshold
127  if (!checkThreshold(objPar.etSumThreshold, etSumValue, m_gtHfRingEtSumsTemplate->condGEq())) {
128  return false;
129  }
130 
131  // index is always zero - the object is in fact a count
132  int indexObj = 0;
133 
134  objectsInComb.push_back(indexObj);
135  (combinationsInCond()).push_back(objectsInComb);
136 
137  // if we get here all checks were successful for this combination
138  // set the general result for evaluateCondition to "true"
139 
140  condResult = true;
141  return condResult;
142 }
143 
144 void L1GtHfRingEtSumsCondition::print(std::ostream &myCout) const {
147 }
L1GtConditionEvaluation
Definition: L1GtConditionEvaluation.h:37
L1GtCondition
Definition: L1GtCondition.h:35
L1GtHfRingEtSumsTemplate::ObjectParameter::etSumIndex
unsigned int etSumIndex
Definition: L1GtHfRingEtSumsTemplate.h:57
L1GctHFRingEtSums.h
L1GtHfRingEtSumsCondition
Definition: L1GtHfRingEtSumsCondition.h:32
L1GtConditionEvaluation::m_verbosity
int m_verbosity
verbosity level
Definition: L1GtConditionEvaluation.h:105
L1GtHfRingEtSumsTemplate::ObjectParameter
typedef for a single object template
Definition: L1GtHfRingEtSumsTemplate.h:56
L1GtConditionEvaluation::combinationsInCond
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
Definition: L1GtConditionEvaluation.h:82
L1GtHfRingEtSumsTemplate
Definition: L1GtHfRingEtSumsTemplate.h:34
L1GtCondition::condGEq
const bool condGEq() const
get / set condition GEq flag
Definition: L1GtCondition.h:72
L1GtHfRingEtSumsCondition::copy
void copy(const L1GtHfRingEtSumsCondition &cp)
copy function for copy constructor and operator=
Definition: L1GtHfRingEtSumsCondition.cc:52
L1GlobalTriggerReadoutSetupFwd.h
L1GctHFRingEtSums
L1 GCT HF ring Et sums.
Definition: L1GctHFRingEtSums.h:16
L1GtConditionEvaluation::print
virtual void print(std::ostream &myCout) const
print condition
Definition: L1GtConditionEvaluation.cc:34
L1GtConditionEvaluation::m_combinationsInCond
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
Definition: L1GtConditionEvaluation.h:102
hgcal_conditions::parameters
Definition: HGCConditions.h:86
watchdog.const
const
Definition: watchdog.py:83
L1GlobalTriggerPSB::getCandL1HfRingEtSums
const L1GctHFRingEtSums * getCandL1HfRingEtSums() const
pointer to HfRingEtSums data list
Definition: L1GlobalTriggerPSB.h:177
L1GtConditionEvaluation::checkThreshold
const bool checkThreshold(const Type1 &threshold, const Type2 &value, const bool condGEqValue) const
Definition: L1GtConditionEvaluation.h:113
L1GtConditionEvaluation::m_condLastResult
bool m_condLastResult
the last result of evaluateCondition()
Definition: L1GtConditionEvaluation.h:99
L1GtHfRingEtSumsCondition::setGtPSB
void setGtPSB(const L1GlobalTriggerPSB *)
set the pointer to PSB
Definition: L1GtHfRingEtSumsCondition.cc:84
L1GtHfRingEtSumsCondition.h
SingleCombInCond
std::vector< int > SingleCombInCond
typedefs
Definition: L1GlobalTriggerObjectMapFwd.h:29
L1GtHfRingEtSumsCondition::setGtHfRingEtSumsTemplate
void setGtHfRingEtSumsTemplate(const L1GtHfRingEtSumsTemplate *)
Definition: L1GtHfRingEtSumsCondition.cc:79
L1GctHFRingEtSums::etSum
uint16_t etSum(unsigned const i) const
Definition: L1GctHFRingEtSums.cc:50
L1GtConditionEvaluation.h
L1GtHfRingEtSumsCondition::~L1GtHfRingEtSumsCondition
~L1GtHfRingEtSumsCondition() override
Definition: L1GtHfRingEtSumsCondition.cc:68
L1GtHfRingEtSumsCondition::m_gtPSB
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
Definition: L1GtHfRingEtSumsCondition.h:77
clear
void clear(HadCaloObj &c)
Definition: data.h:124
L1GtHfRingEtSumsTemplate::ObjectParameter::etSumThreshold
unsigned int etSumThreshold
Definition: L1GtHfRingEtSumsTemplate.h:58
L1GtHfRingEtSumsCondition::L1GtHfRingEtSumsCondition
L1GtHfRingEtSumsCondition()
Definition: L1GtHfRingEtSumsCondition.cc:37
L1GtHfRingEtSumsCondition::print
void print(std::ostream &myCout) const override
print condition
Definition: L1GtHfRingEtSumsCondition.cc:144
L1GtConditionEvaluation::m_condMaxNumberObjects
int m_condMaxNumberObjects
Definition: L1GtConditionEvaluation.h:96
L1GlobalTriggerPSB.h
L1GtHfRingEtSumsTemplate::objectParameter
const std::vector< ObjectParameter > * objectParameter() const
Definition: L1GtHfRingEtSumsTemplate.h:64
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
L1GtHfRingEtSumsTemplate.h
L1GtHfRingEtSumsCondition::operator=
L1GtHfRingEtSumsCondition & operator=(const L1GtHfRingEtSumsCondition &)
Definition: L1GtHfRingEtSumsCondition.cc:73
L1GtHfRingEtSumsCondition::evaluateCondition
const bool evaluateCondition() const override
the core function to check if the condition matches
Definition: L1GtHfRingEtSumsCondition.cc:87
L1GlobalTriggerPSB
Definition: L1GlobalTriggerPSB.h:58
L1GtHfRingEtSumsCondition::m_gtHfRingEtSumsTemplate
const L1GtHfRingEtSumsTemplate * m_gtHfRingEtSumsTemplate
pointer to a L1GtHfRingEtSumsTemplate
Definition: L1GtHfRingEtSumsCondition.h:74
L1GtHfRingEtSumsTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: L1GtHfRingEtSumsTemplate.cc:77