33 const std::vector<TriggerThreshold *> *caloThresholds)
36 m_type(m_decoder->roiType(m_roiWord)),
63 m_type(m_decoder->roiType(m_roiWord)),
71 m_roiWord{
obj.m_roiWord},
74 m_coordRange{
obj.m_coordRange},
75 m_thresholdMask{
obj.m_thresholdMask},
76 m_triggerThresholdValue{
obj.m_triggerThresholdValue},
77 m_isolationMask{
obj.m_isolationMask},
78 m_emIsolation{
obj.m_emIsolation},
79 m_hadIsolation{
obj.m_hadIsolation},
80 m_hadCoreIsolation{
obj.m_hadCoreIsolation},
81 m_thresholdType{
obj.m_thresholdType}
120 const std::vector<TriggerThreshold *> *caloThresholds)
123 m_thresholdMask = m_roiWord & 0xffff;
125 m_triggerThresholdValue.clear();
126 m_isolationMask.clear();
127 m_emIsolation.clear();
128 m_hadIsolation.clear();
129 m_hadCoreIsolation.clear();
130 m_thresholdType.clear();
132 const vector<unsigned int> passed_thresholds =
133 m_decoder->thresholdsPassed(m_roiWord);
136 std::map<int, TriggerThreshold *> thrMap;
138 for (std::vector<TriggerThreshold *>::const_iterator
it =
139 caloThresholds->begin();
140 it != caloThresholds->end(); ++
it)
145 int num = (*it)->thresholdNumber();
146 thrMap.insert(std::map<int, TriggerThreshold *>::value_type(
num, (*
it)));
154 int ieta =
int((m_coordRange.etaRange().min() + 0.025) / 0.1) +
155 ((m_coordRange.etaRange().min() + 0.025 > 0) ? 0 : -1);
156 int iphi =
int((m_coordRange.phiRange().min() + 0.025) * 32 /
M_PI);
158 for (vector<unsigned int>::const_iterator
itp = passed_thresholds.begin();
159 itp != passed_thresholds.end(); ++
itp)
161 std::map<int, TriggerThreshold *>::const_iterator thr =
162 thrMap.find(*
itp - 1);
163 if (thr != thrMap.end())
166 thr->second->triggerThresholdValue(ieta, iphi);
170 m_triggerThresholdValue.insert(std::map<int, unsigned int>::value_type(
172 m_emIsolation.insert(std::map<int, unsigned int>::value_type(
174 m_hadIsolation.insert(std::map<int, unsigned int>::value_type(
176 m_hadCoreIsolation.insert(
181 m_thresholdType.insert(
182 std::map<int, TrigT1CaloDefs::ClusterAlgorithm>::value_type(*
itp,
199 m_triggerThresholdValue.clear();
200 m_isolationMask.clear();
201 m_emIsolation.clear();
202 m_hadIsolation.clear();
203 m_hadCoreIsolation.clear();
204 m_thresholdType.clear();
210 int ieta =
int((m_coordRange.etaRange().min() + 0.025) / 0.1) +
211 ((m_coordRange.etaRange().min() + 0.025 > 0) ? 0 : -1);
212 int iphi =
int((m_coordRange.phiRange().min() + 0.025) * 32 /
M_PI);
214 unsigned int isolWord = isolation();
217 for (std::vector<TriggerThreshold *>::const_iterator
it =
218 caloThresholds->begin();
219 it != caloThresholds->end(); ++
it) {
227 unsigned int etCut = ctv->
ptcut();
231 bool isolationPassed =
true;
234 if ((isolMask & (1 << bit)) && !(isolWord & (1 << bit)))
235 isolationPassed =
false;
238 int num = (*it)->thresholdNumber();
239 m_triggerThresholdValue.insert(
240 std::map<int, unsigned int>::value_type(
num, etCut));
241 m_isolationMask.insert(
242 std::map<int, unsigned int>::value_type(
num, isolMask));
246 m_thresholdType.insert(
247 std::map<int, TrigT1CaloDefs::ClusterAlgorithm>::value_type(
249 m_thresholdMask |= (1 <<
num);
259 m_triggerThresholdValue.clear();
260 m_isolationMask.clear();
261 m_emIsolation.clear();
262 m_hadIsolation.clear();
263 m_hadCoreIsolation.clear();
264 m_thresholdType.clear();
271 int ieta =
int((m_coordRange.etaRange().min() + 0.025) / 0.1) +
272 ((m_coordRange.etaRange().min() + 0.025 > 0) ? 0 : -1);
277 for (
const shared_ptr<TrigConf::L1Threshold> &thr :
l1menu->thresholds(
triggerType))
287 unsigned int etCut =
std::round(caloThr->thrValue(ieta));
288 unsigned int etCounts = caloThr->thrValueCounts(ieta);
292 unsigned int isolMask = 0;
309 bool isolationPassed =
true;
312 if ((isolMask & (1 << bit)) && !(isolWord & (1 << bit)))
314 isolationPassed =
false;
318 if (eTPassed && isolationPassed)
320 int num = thr->mapping();
321 m_triggerThresholdValue[
num] = etCut;
322 m_isolationMask[
num] = isolMask;
324 m_thresholdMask |= (1 <<
num);
335 double roiPhi = m_coordRange.phi();
350 return m_decoder->module(m_roiWord);
359 return m_decoder->localcoord(m_roiWord);
369 return m_decoder->isolationWord(m_roiWord);
383 if (this->isValidThreshold(threshold_number)) {
384 return ((1 << threshold_number) & m_thresholdMask) != 0;
395 std::vector<unsigned int> *
398 std::vector<unsigned int> *newVec =
new std::vector<unsigned int>;
406 for (
unsigned int iTh = 0; iTh <= nThresh; ++iTh) {
407 std::map<int, unsigned int>::const_iterator
it =
408 m_triggerThresholdValue.find(iTh);
409 if (
it != m_triggerThresholdValue.end())
410 newVec->push_back(iTh);
421 std::map<int, unsigned int>::const_iterator
it =
422 m_triggerThresholdValue.find(
thresh);
423 if (
it != m_triggerThresholdValue.end())
438 std::map<int, unsigned int>::const_iterator
it = m_isolationMask.find(
thresh);
439 if (
it != m_isolationMask.end())
454 std::map<int, unsigned int>::const_iterator
it = m_emIsolation.find(
thresh);
455 if (
it != m_emIsolation.end())
469 map<int, unsigned int>::const_iterator
it = m_hadIsolation.find(
thresh);
470 if (
it != m_hadIsolation.end())
485 map<int, unsigned int>::const_iterator
it = m_hadCoreIsolation.find(
thresh);
486 if (
it != m_hadCoreIsolation.end())
517 map<int, TrigT1CaloDefs::ClusterAlgorithm>::const_iterator
it =
518 m_thresholdType.find(
thresh);
519 if (
it != m_thresholdType.end())