34 const std::vector<TriggerThreshold *> *caloThresholds)
37 m_type(m_decoder->roiType(m_roiWord)),
64 m_type(m_decoder->roiType(m_roiWord)),
72 m_roiWord{
obj.m_roiWord},
75 m_coordRange{
obj.m_coordRange},
76 m_thresholdMask{
obj.m_thresholdMask},
77 m_triggerThresholdValue{
obj.m_triggerThresholdValue},
78 m_isolationMask{
obj.m_isolationMask},
79 m_emIsolation{
obj.m_emIsolation},
80 m_hadIsolation{
obj.m_hadIsolation},
81 m_hadCoreIsolation{
obj.m_hadCoreIsolation},
82 m_thresholdType{
obj.m_thresholdType}
121 const std::vector<TriggerThreshold *> *caloThresholds)
124 m_thresholdMask = m_roiWord & 0xffff;
126 m_triggerThresholdValue.clear();
127 m_isolationMask.clear();
128 m_emIsolation.clear();
129 m_hadIsolation.clear();
130 m_hadCoreIsolation.clear();
131 m_thresholdType.clear();
133 const vector<unsigned int> passed_thresholds =
134 m_decoder->thresholdsPassed(m_roiWord);
137 std::map<int, TriggerThreshold *> thrMap;
139 for (std::vector<TriggerThreshold *>::const_iterator
it =
140 caloThresholds->begin();
141 it != caloThresholds->end(); ++
it)
143 if ((*it)->type() == L1DataDef::emType() ||
144 (*it)->type() == L1DataDef::tauType())
146 int num = (*it)->thresholdNumber();
147 thrMap.insert(std::map<int, TriggerThreshold *>::value_type(
num, (*
it)));
155 int ieta =
int((m_coordRange.etaRange().min() + 0.025) / 0.1) +
156 ((m_coordRange.etaRange().min() + 0.025 > 0) ? 0 : -1);
157 int iphi =
int((m_coordRange.phiRange().min() + 0.025) * 32 /
M_PI);
159 for (vector<unsigned int>::const_iterator
itp = passed_thresholds.begin();
160 itp != passed_thresholds.end(); ++
itp)
162 std::map<int, TriggerThreshold *>::const_iterator thr =
163 thrMap.find(*
itp - 1);
164 if (thr != thrMap.end())
167 thr->second->triggerThresholdValue(ieta, iphi);
171 m_triggerThresholdValue.insert(std::map<int, unsigned int>::value_type(
173 m_emIsolation.insert(std::map<int, unsigned int>::value_type(
175 m_hadIsolation.insert(std::map<int, unsigned int>::value_type(
177 m_hadCoreIsolation.insert(
182 m_thresholdType.insert(
183 std::map<int, TrigT1CaloDefs::ClusterAlgorithm>::value_type(*
itp,
200 m_triggerThresholdValue.clear();
201 m_isolationMask.clear();
202 m_emIsolation.clear();
203 m_hadIsolation.clear();
204 m_hadCoreIsolation.clear();
205 m_thresholdType.clear();
209 : L1DataDef::tauType());
211 int ieta =
int((m_coordRange.etaRange().min() + 0.025) / 0.1) +
212 ((m_coordRange.etaRange().min() + 0.025 > 0) ? 0 : -1);
213 int iphi =
int((m_coordRange.phiRange().min() + 0.025) * 32 /
M_PI);
215 unsigned int isolWord = isolation();
218 for (std::vector<TriggerThreshold *>::const_iterator
it =
219 caloThresholds->begin();
220 it != caloThresholds->end(); ++
it) {
228 unsigned int etCut = ctv->
ptcut();
232 bool isolationPassed =
true;
235 if ((isolMask & (1 << bit)) && !(isolWord & (1 << bit)))
236 isolationPassed =
false;
239 int num = (*it)->thresholdNumber();
240 m_triggerThresholdValue.insert(
241 std::map<int, unsigned int>::value_type(
num, etCut));
242 m_isolationMask.insert(
243 std::map<int, unsigned int>::value_type(
num, isolMask));
247 m_thresholdType.insert(
248 std::map<int, TrigT1CaloDefs::ClusterAlgorithm>::value_type(
250 m_thresholdMask |= (1 <<
num);
260 m_triggerThresholdValue.clear();
261 m_isolationMask.clear();
262 m_emIsolation.clear();
263 m_hadIsolation.clear();
264 m_hadCoreIsolation.clear();
265 m_thresholdType.clear();
272 int ieta =
int((m_coordRange.etaRange().min() + 0.025) / 0.1) +
273 ((m_coordRange.etaRange().min() + 0.025 > 0) ? 0 : -1);
278 for (
const shared_ptr<TrigConf::L1Threshold> &thr :
l1menu->thresholds(
triggerType))
288 unsigned int etCut =
std::round(caloThr->thrValue(ieta));
289 unsigned int etCounts = caloThr->thrValueCounts(ieta);
293 unsigned int isolMask = 0;
310 bool isolationPassed =
true;
313 if ((isolMask & (1 << bit)) && !(isolWord & (1 << bit)))
315 isolationPassed =
false;
319 if (eTPassed && isolationPassed)
321 int num = thr->mapping();
322 m_triggerThresholdValue[
num] = etCut;
323 m_isolationMask[
num] = isolMask;
325 m_thresholdMask |= (1 <<
num);
336 double roiPhi = m_coordRange.phi();
351 return m_decoder->module(m_roiWord);
360 return m_decoder->localcoord(m_roiWord);
370 return m_decoder->isolationWord(m_roiWord);
384 if (this->isValidThreshold(threshold_number)) {
385 return ((1 << threshold_number) & m_thresholdMask) != 0;
396 std::vector<unsigned int> *
399 std::vector<unsigned int> *newVec =
new std::vector<unsigned int>;
407 for (
unsigned int iTh = 0; iTh <= nThresh; ++iTh) {
408 std::map<int, unsigned int>::const_iterator
it =
409 m_triggerThresholdValue.find(iTh);
410 if (
it != m_triggerThresholdValue.end())
411 newVec->push_back(iTh);
422 std::map<int, unsigned int>::const_iterator
it =
423 m_triggerThresholdValue.find(
thresh);
424 if (
it != m_triggerThresholdValue.end())
439 std::map<int, unsigned int>::const_iterator
it = m_isolationMask.find(
thresh);
440 if (
it != m_isolationMask.end())
455 std::map<int, unsigned int>::const_iterator
it = m_emIsolation.find(
thresh);
456 if (
it != m_emIsolation.end())
470 map<int, unsigned int>::const_iterator
it = m_hadIsolation.find(
thresh);
471 if (
it != m_hadIsolation.end())
486 map<int, unsigned int>::const_iterator
it = m_hadCoreIsolation.find(
thresh);
487 if (
it != m_hadCoreIsolation.end())
518 map<int, TrigT1CaloDefs::ClusterAlgorithm>::const_iterator
it =
519 m_thresholdType.find(
thresh);
520 if (
it != m_thresholdType.end())