CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtHfRingEtSumsCondition.cc
Go to the documentation of this file.
1 
17 // this class header
19 
20 // system include files
21 #include <iostream>
22 #include <iomanip>
23 
24 #include <vector>
25 
26 // user include files
27 // base class
29 
32 
34 
36 
37 // constructors
38 // default
41 
42  //empty
43 
44 }
45 
46 // from base template condition (from event setup usually)
48  const L1GtCondition* etTemplate, const L1GlobalTriggerPSB* ptrPSB) :
49  L1GtConditionEvaluation(), m_gtHfRingEtSumsTemplate(
50  static_cast<const L1GtHfRingEtSumsTemplate*> (etTemplate)), m_gtPSB(
51  ptrPSB)
52 {
53 
54  // maximum number of objects received for the evaluation of the condition
55  // no objects, in fact, just a number
57 
58 }
59 
60 // copy constructor
62 
64  m_gtPSB = cp.gtPSB();
65 
69 
71 
72 }
73 
76 
77  copy(cp);
78 
79 }
80 
81 // destructor
83 
84  // empty
85 
86 }
87 
88 // equal operator
90 {
91  copy(cp);
92  return *this;
93 }
94 
95 // methods
97 
98  m_gtHfRingEtSumsTemplate = etTemplate;
99 
100 }
101 
104 
105  m_gtPSB = ptrPSB;
106 
107 }
108 
109 // try all object permutations and check spatial correlations, if required
111 
112  // number of trigger objects in the condition
113  // no objects, in fact, just a number
114  int iCondition = 0;
115 
116  // condition result condResult will be set to true if the HF Ring Et sums
117  // passes the requirement
118  bool condResult = false;
119 
120  // store the index of the HfRingEtSums object
121  // from the combination evaluated in the condition
122  SingleCombInCond objectsInComb;
123 
124  // clear the m_combinationsInCond vector
126 
127  // get the HF Ring Et sums (event / condition)
128  const L1GctHFRingEtSums* etSumCand = m_gtPSB->getCandL1HfRingEtSums();
129 
130  // protection against missing HF Ring Et sums collection
131  if (etSumCand == 0) {
132  return false;
133  }
134 
136  ( *(m_gtHfRingEtSumsTemplate->objectParameter()) )[iCondition];
137 
138  // FIXME ask GCT to provide a method to retrieve it
139  const unsigned int numberL1HfRingEtSums = 4;
140 
141  const unsigned int cIndex = objPar.etSumIndex;
142  if (cIndex >= numberL1HfRingEtSums) {
143 
144  edm::LogError("L1GlobalTrigger") << "\nL1GtHfRingEtSumsCondition error: etSumIndex "
145  << cIndex << "greater than GCT maximum index = " << numberL1HfRingEtSums
146  << "\n ==> condResult = false " << std::endl;
147  return false;
148 
149  }
150 
151  const unsigned int etSumValue = etSumCand->etSum(cIndex);
152 
153  // check countThreshold
154  if ( !checkThreshold(objPar.etSumThreshold, etSumValue, m_gtHfRingEtSumsTemplate->condGEq()) ) {
155 
156  return false;
157  }
158 
159  // index is always zero - the object is in fact a count
160  int indexObj = 0;
161 
162  objectsInComb.push_back(indexObj);
163  (combinationsInCond()).push_back(objectsInComb);
164 
165  // if we get here all checks were successful for this combination
166  // set the general result for evaluateCondition to "true"
167 
168  condResult = true;
169  return condResult;
170 
171 }
172 
173 void L1GtHfRingEtSumsCondition::print(std::ostream& myCout) const {
174 
177 
178 }
179 
const bool evaluateCondition() const
the core function to check if the condition matches
typedef for a single object template
bool m_condLastResult
the last result of evaluateCondition()
void setGtHfRingEtSumsTemplate(const L1GtHfRingEtSumsTemplate *)
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
const L1GctHFRingEtSums * getCandL1HfRingEtSums() const
pointer to HfRingEtSums data list
std::vector< int > SingleCombInCond
typedefs
virtual void print(std::ostream &myCout) const
print the condition
void setGtPSB(const L1GlobalTriggerPSB *)
set the pointer to PSB
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:168
const bool checkThreshold(const Type1 &threshold, const Type2 &value, const bool condGEqValue) const
const L1GtHfRingEtSumsTemplate * m_gtHfRingEtSumsTemplate
pointer to a L1GtHfRingEtSumsTemplate
L1 GCT HF ring Et sums.
L1GtHfRingEtSumsCondition & operator=(const L1GtHfRingEtSumsCondition &)
void print(std::ostream &myCout) const
print condition
const L1GlobalTriggerPSB * m_gtPSB
pointer to PSB, to be able to get the trigger objects
string const
Definition: compareJSON.py:14
uint16_t etSum(unsigned const i) const
virtual void print(std::ostream &myCout) const
print condition
const bool condGEq() const
get / set condition GEq flag
Definition: L1GtCondition.h:99
const L1GlobalTriggerPSB * gtPSB() const
get / set the pointer to PSB
CombinationsInCond const & getCombinationsInCond() const
get all the object combinations evaluated to true in the condition
const L1GtHfRingEtSumsTemplate * gtHfRingEtSumsTemplate() const
get / set the pointer to a L1GtCondition
void copy(const L1GtHfRingEtSumsCondition &cp)
copy function for copy constructor and operator=
const std::vector< ObjectParameter > * objectParameter() const
bool condLastResult() const
get the latest result for the condition