ATLAS Offline Software
Loading...
Searching...
No Matches
RecEnergyRoI.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4/***************************************************************************
5 RecEnergyRoI.cxx - description
6 -------------------
7 begin : Mon Jan 22 2001
8 email : moyse@heppch.ph.qmw.ac.uk
9***************************************************************************/
10
11
12// Trigger config includes:
16#include "TrigConfData/L1Menu.h"
18
19// Local include(s):
22
23using namespace std;
24using namespace TrigConf;
25
26LVL1::RecEnergyRoI::RecEnergyRoI(unsigned int RoIWord0, unsigned int RoIWord1, unsigned int RoIWord2,
27 const std::vector<TrigConf::TriggerThreshold *> *caloThresholds)
28{
29
30 this->construct(RoIWord0, RoIWord1, RoIWord2, caloThresholds);
31}
32
33LVL1::RecEnergyRoI::RecEnergyRoI(unsigned int RoIWord0, unsigned int RoIWord1, unsigned int RoIWord2,
34 const TrigConf::L1Menu *const l1menu)
35 : m_roiWord0(RoIWord0),
36 m_roiWord1(RoIWord1),
37 m_roiWord2(RoIWord2)
38{
39 construct(l1menu);
40}
41
42//copy constructor
52
53//assignment operator
67
69
76void LVL1::RecEnergyRoI::construct(unsigned int RoIWord0, unsigned int RoIWord1, unsigned int RoIWord2,
77 const std::vector<TriggerThreshold *> *caloThresholds)
78{
79 m_roiWord0 = RoIWord0;
80 m_roiWord1 = RoIWord1;
81 m_roiWord2 = RoIWord2;
82
83 // Copy threshold values into maps for matching to list of thresholds passed
84 std::map< int, TriggerThreshold* > etMissMap;
85 std::map< int, TriggerThreshold* > sumEtMap;
86 std::map< int, TriggerThreshold* > mEtSigMap;
87 for( std::vector< TriggerThreshold* >::const_iterator it = caloThresholds->begin();
88 it != caloThresholds->end(); ++it ) {
89 if( ( *it )->type() == L1DataDef::typeAsString(L1DataDef::XE) ) {
90 int num = ( *it )->thresholdNumber();
91 etMissMap.insert( std::map< int, TriggerThreshold* >::value_type( num, *it ) );
92 }
93 else if( ( *it )->type() == L1DataDef::typeAsString(L1DataDef::TE) ) {
94 int num = ( *it )->thresholdNumber();
95 sumEtMap.insert( std::map< int, TriggerThreshold* >::value_type( num, *it ) );
96 }
97 else if( ( *it )->type() == L1DataDef::typeAsString(L1DataDef::XS) ) {
98 int num = ( *it )->thresholdNumber();
99 mEtSigMap.insert( std::map< int, TriggerThreshold* >::value_type( num, *it ) );
100 }
101 }
102
103 // Find which thresholds this RoI passed and copy the values into the maps
104 for (unsigned int xeMapping : etMissThresholdsPassed())
105 {
106 std::map<int, TriggerThreshold *>::const_iterator thr = etMissMap.find(xeMapping - 1);
107 if (thr != etMissMap.end()) {
108 TriggerThresholdValue* ttv = thr->second->triggerThresholdValue(0,0);
109 m_etMissThresholdValue.insert(std::map<int, unsigned int>::value_type(xeMapping, ttv->thresholdValueCount()));
110 }
111 }
112
113 for (unsigned int teMapping : sumEtThresholdsPassed())
114 {
115 std::map<int, TriggerThreshold *>::const_iterator thr = sumEtMap.find(teMapping - 1);
116 if (thr != sumEtMap.end()) {
117 TriggerThresholdValue* ttv = thr->second->triggerThresholdValue(0,0);
118 m_sumEtThresholdValue.insert(std::map<int, unsigned int>::value_type(teMapping, ttv->thresholdValueCount()));
119 }
120 }
121
122 for (unsigned int xsMapping : mEtSigThresholdsPassed())
123 {
124 std::map<int, TriggerThreshold *>::const_iterator thr = mEtSigMap.find(xsMapping - 1);
125 if (thr != mEtSigMap.end()) {
126 TriggerThresholdValue* ttv = thr->second->triggerThresholdValue(0,0);
127 m_mEtSigThresholdValue.insert(std::map<int, unsigned int>::value_type(xsMapping, ttv->thresholdValueCount()));
128 }
129 }
130}
131
133{
134 // Find which thresholds this RoI passed and copy the values into the maps
135 if ( ! l1menu->thresholds("XE").empty() ) {
136 for (unsigned int xeMapping : etMissThresholdsPassed())
137 {
138 const TrigConf::L1Threshold &thr = l1menu->threshold("XE", xeMapping - 1);
139 auto &caloThr = dynamic_cast<const TrigConf::L1Threshold_Calo &>(thr);
140 m_etMissThresholdValue[xeMapping] = caloThr.thrValueCounts();
141 }
142 }
143 if ( ! l1menu->thresholds("TE").empty() ) {
144 for (unsigned int teMapping : sumEtThresholdsPassed())
145 {
146 const TrigConf::L1Threshold &thr = l1menu->threshold("TE", teMapping - 1);
147 auto &caloThr = dynamic_cast<const TrigConf::L1Threshold_Calo &>(thr);
148 m_sumEtThresholdValue[teMapping] = caloThr.thrValueCounts();
149 }
150 }
151 if ( ! l1menu->thresholds("XS").empty() ) {
152 for (unsigned int xsMapping : mEtSigThresholdsPassed())
153 {
154 const TrigConf::L1Threshold &thr = l1menu->threshold("XS", xsMapping - 1);
155 auto &caloThr = dynamic_cast<const TrigConf::L1Threshold_Calo &>(thr);
156 m_mEtSigThresholdValue[xsMapping] = caloThr.thrValueCounts();
157 }
158 }
159}
160
162{
163 return m_roiWord0;
164}
165
167{
168 return m_roiWord1;
169}
170
172{
173 return m_roiWord2;
174}
175
178bool LVL1::RecEnergyRoI::passedEtMissThreshold(unsigned int thresholdNumber) const
179{
180
181 if ( this->isValidEtMissThreshold( thresholdNumber ) ) {
183 return ( get.etMissThresholdPassed( m_roiWord2, thresholdNumber ) );
184 }
185 return false;
186}
187
190bool LVL1::RecEnergyRoI::passedSumEtThreshold(unsigned int thresholdNumber) const
191{
192
193 if ( this->isValidSumEtThreshold( thresholdNumber ) ) {
195 return ( get.sumEtThresholdPassed( m_roiWord1, thresholdNumber ) );
196 }
197 return false;
198}
199
202bool LVL1::RecEnergyRoI::passedMEtSigThreshold(unsigned int thresholdNumber) const
203{
204
205 if ( this->isValidSumEtThreshold( thresholdNumber ) ) {
207 return ( get.mEtSigThresholdPassed( m_roiWord0, thresholdNumber ) );
208 }
209 return false;
210}
211
214{
216 return get.etMissThresholdsPassed(m_roiWord2);
217}
218
221{
223 return get.etSumThresholdsPassed(m_roiWord1);
224}
225
228{
230 return get.mEtSigThresholdsPassed(m_roiWord0);
231}
232
235unsigned int LVL1::RecEnergyRoI::etMissTriggerThreshold(const unsigned int thresh) const
236{
237 std::map< int, unsigned int >::const_iterator it = m_etMissThresholdValue.find( thresh );
238 if( it != m_etMissThresholdValue.end() ) {
239 return it->second;
240 }
242}
243
246unsigned int LVL1::RecEnergyRoI::sumEtTriggerThreshold(const unsigned int thresh) const
247{
248
249 std::map< int, unsigned int >::const_iterator it = m_sumEtThresholdValue.find( thresh );
250 if( it != m_sumEtThresholdValue.end() ) {
251 return it->second;
252 }
254}
255
258unsigned int LVL1::RecEnergyRoI::mEtSigTriggerThreshold(const unsigned int thresh) const
259{
260
261 std::map< int, unsigned int >::const_iterator it = m_mEtSigThresholdValue.find( thresh );
262 if( it != m_mEtSigThresholdValue.end() ) {
263 return it->second;
264 }
266}
267
269bool LVL1::RecEnergyRoI::isValidEtMissThreshold(const unsigned int thresh) const
270{
271
273}
274
276bool LVL1::RecEnergyRoI::isValidSumEtThreshold(const unsigned int thresh) const
277{
278
279 return (thresh <= TrigT1CaloDefs::numOfSumEtThresholds);
280}
281
283bool LVL1::RecEnergyRoI::isValidMEtSigThreshold(const unsigned int thresh) const
284{
285
286 return (thresh <= TrigT1CaloDefs::numOfMEtSigThresholds);
287}
288
292{
293
295 return get.energyX(m_roiWord0);
296}
297
301{
302
304 return get.energyY(m_roiWord1);
305}
306
310{
312 return get.energyT(m_roiWord2);
313}
314
317{
319 return get.energyOverflow(m_roiWord0);
320}
321
324{
326 return get.energyOverflow(m_roiWord1);
327}
328
331{
333 return get.energyOverflow(m_roiWord2);
334}
A level 1 calorimeter trigger conversion service: returns the Coordinate represented by a RoI word.
This class defines the reconstructed EnergySum ROI.
std::vector< unsigned int > etMissThresholdsPassed() const
returns a vector of thresholds passed.
unsigned int roiWord2() const
returns roi word 2.
std::map< int, unsigned int > m_etMissThresholdValue
bool passedMEtSigThreshold(unsigned int thresholdNumber) const
returns TRUE if threshold number threshold_number has been passed by this ROI.
unsigned long int m_roiWord2
this is the actual format of the data sent from the LVL1 hardware.
unsigned int sumEtTriggerThreshold(const unsigned int thresh) const
returns the value of the trigger threshold for the threshold passed.
bool isValidMEtSigThreshold(const unsigned int thresh) const
returns true if thresh is a valid Sum Et threshold number
bool overflowX() const
returns the Ex overflow bit
unsigned int roiWord1() const
returns roi word 1.
int energyY() const
returns the (signed) Ey energy projection.
RecEnergyRoI & operator=(const RecEnergyRoI &obj)
int energyT() const
returns the total ET.
unsigned int mEtSigTriggerThreshold(const unsigned int thresh) const
returns the value of the trigger threshold for the threshold passed.
std::vector< unsigned int > sumEtThresholdsPassed() const
returns a vector of thresholds passed.
unsigned long int m_roiWord0
this is the actual format of the data sent from the LVL1 hardware.
std::map< int, unsigned int > m_mEtSigThresholdValue
void construct(unsigned int RoIWord0, unsigned int RoIWord1, unsigned int RoIWord2, const std::vector< TrigConf::TriggerThreshold * > *caloThresholds)
The "construct" call unpacks the RoIWord and copies information about the passed thresholds from the ...
unsigned int etMissTriggerThreshold(const unsigned int thresh) const
returns the value of the trigger threshold for the threshold passed.
unsigned int roiWord0() const
returns roi word 0.
bool passedSumEtThreshold(unsigned int thresholdNumber) const
returns TRUE if threshold number threshold_number has been passed by this ROI.
bool overflowY() const
returns the Ey overflow bit
bool overflowT() const
returns the ETsum overflow bit
unsigned long int m_roiWord1
this is the actual format of the data sent from the LVL1 hardware.
bool passedEtMissThreshold(unsigned int thresholdNumber) const
returns TRUE if threshold number threshold_number has been passed by this ROI.
bool isValidEtMissThreshold(const unsigned int thresh) const
returns true if thresh is a valid EtMiss threshold number
bool isValidSumEtThreshold(const unsigned int thresh) const
returns true if thresh is a valid Sum Et threshold number
int energyX() const
returns the (signed) Ex energy projection.
std::map< int, unsigned int > m_sumEtThresholdValue
std::vector< unsigned int > mEtSigThresholdsPassed() const
returns a vector of thresholds passed.
static const unsigned int numOfSumEtThresholds
static const unsigned int Error
static const unsigned int numOfMEtSigThresholds
static const unsigned int numOfMissingEtThresholds
static std::string & typeAsString(TriggerType tt)
Definition L1DataDef.h:53
L1 menu configuration.
Definition L1Menu.h:28
Standard L1 threshold configuration.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22
STL namespace.