Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
23 using namespace std;
24 using namespace TrigConf;
25 
26 LVL1::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 
33 LVL1::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 {
40 }
41 
42 //copy constructor
44  : m_roiWord0(obj.m_roiWord0),
45  m_roiWord1(obj.m_roiWord1),
46  m_roiWord2(obj.m_roiWord2),
47  m_etMissThresholdValue(obj.m_etMissThresholdValue),
48  m_sumEtThresholdValue(obj.m_sumEtThresholdValue),
49  m_mEtSigThresholdValue(obj.m_mEtSigThresholdValue)
50 {
51 }
52 
53 //assignment operator
56 {
57  if(this != &rhs) {
58  m_roiWord0 = rhs.m_roiWord0;
59  m_roiWord1 = rhs.m_roiWord1;
60  m_roiWord2 = rhs.m_roiWord2;
61  m_etMissThresholdValue = rhs.m_etMissThresholdValue;
62  m_sumEtThresholdValue = rhs.m_sumEtThresholdValue;
63  m_mEtSigThresholdValue = rhs.m_mEtSigThresholdValue;
64  }
65  return *this;
66 }
67 
69 
76 void 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 
161 unsigned int LVL1::RecEnergyRoI::roiWord0() const
162 {
163  return m_roiWord0;
164 }
165 
166 unsigned int LVL1::RecEnergyRoI::roiWord1() const
167 {
168  return m_roiWord1;
169 }
170 
171 unsigned int LVL1::RecEnergyRoI::roiWord2() const
172 {
173  return m_roiWord2;
174 }
175 
178 bool 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 
190 bool 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 
202 bool 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 
213 vector<unsigned int> LVL1::RecEnergyRoI::etMissThresholdsPassed() const
214 {
216  return get.etMissThresholdsPassed(m_roiWord2);
217 }
218 
220 vector<unsigned int> LVL1::RecEnergyRoI::sumEtThresholdsPassed() const
221 {
223  return get.etSumThresholdsPassed(m_roiWord1);
224 }
225 
227 vector<unsigned int> LVL1::RecEnergyRoI::mEtSigThresholdsPassed() const
228 {
230  return get.mEtSigThresholdsPassed(m_roiWord0);
231 }
232 
235 unsigned 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  }
241  return TrigT1CaloDefs::Error;
242 }
243 
246 unsigned 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  }
253  return TrigT1CaloDefs::Error;
254 }
255 
258 unsigned 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  }
265  return TrigT1CaloDefs::Error;
266 }
267 
270 {
271 
273 }
274 
276 bool LVL1::RecEnergyRoI::isValidSumEtThreshold(const unsigned int thresh) const
277 {
278 
280 }
281 
284 {
285 
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 }
TrigConf::TriggerThresholdValue
Definition: TriggerThresholdValue.h:22
RecEnergyRoI.h
LVL1::RecEnergyRoI::roiWord1
unsigned int roiWord1() const
returns roi word 1.
Definition: RecEnergyRoI.cxx:166
LVL1::RecEnergyRoI::sumEtTriggerThreshold
unsigned int sumEtTriggerThreshold(const unsigned int thresh) const
returns the value of the trigger threshold for the threshold passed.
Definition: RecEnergyRoI.cxx:246
physval_make_web_display.thresh
thresh
Definition: physval_make_web_display.py:36
LVL1::RecEnergyRoI::energyX
int energyX() const
returns the (signed) Ex energy projection.
Definition: RecEnergyRoI.cxx:291
LVL1::JEPRoIDecoder
A level 1 calorimeter trigger conversion service: returns the Coordinate represented by a RoI word.
Definition: JEPRoIDecoder.h:33
LVL1::RecEnergyRoI::energyT
int energyT() const
returns the total ET.
Definition: RecEnergyRoI.cxx:309
LVL1::RecEnergyRoI::m_roiWord1
unsigned long int m_roiWord1
this is the actual format of the data sent from the LVL1 hardware.
Definition: RecEnergyRoI.h:141
skel.it
it
Definition: skel.GENtoEVGEN.py:407
LVL1::RecEnergyRoI::roiWord2
unsigned int roiWord2() const
returns roi word 2.
Definition: RecEnergyRoI.cxx:171
LVL1::RecEnergyRoI::etMissTriggerThreshold
unsigned int etMissTriggerThreshold(const unsigned int thresh) const
returns the value of the trigger threshold for the threshold passed.
Definition: RecEnergyRoI.cxx:235
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
LVL1::RecEnergyRoI::overflowT
bool overflowT() const
returns the ETsum overflow bit
Definition: RecEnergyRoI.cxx:330
LVL1::RecEnergyRoI::isValidEtMissThreshold
bool isValidEtMissThreshold(const unsigned int thresh) const
returns true if thresh is a valid EtMiss threshold number
Definition: RecEnergyRoI.cxx:269
L1Threshold.h
LVL1::RecEnergyRoI
This class defines the reconstructed EnergySum ROI.
Definition: RecEnergyRoI.h:37
TrigConf::L1DataDef::XE
@ XE
Definition: L1DataDef.h:22
TrigConf::L1Threshold_Calo
Definition: L1ThresholdBase.h:188
LVL1::RecEnergyRoI::mEtSigThresholdsPassed
std::vector< unsigned int > mEtSigThresholdsPassed() const
returns a vector of thresholds passed.
Definition: RecEnergyRoI.cxx:227
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
LVL1::RecEnergyRoI::passedMEtSigThreshold
bool passedMEtSigThreshold(unsigned int thresholdNumber) const
returns TRUE if threshold number threshold_number has been passed by this ROI.
Definition: RecEnergyRoI.cxx:202
LVL1::RecEnergyRoI::RecEnergyRoI
RecEnergyRoI()
Definition: RecEnergyRoI.h:41
TrigConf::L1Threshold_Calo::thrValueCounts
virtual unsigned int thrValueCounts(int eta=0) const
Definition: L1ThresholdBase.cxx:278
LVL1::RecEnergyRoI::m_sumEtThresholdValue
std::map< int, unsigned int > m_sumEtThresholdValue
Definition: RecEnergyRoI.h:148
LVL1::RecEnergyRoI::overflowY
bool overflowY() const
returns the Ey overflow bit
Definition: RecEnergyRoI.cxx:323
LVL1::RecEnergyRoI::etMissThresholdsPassed
std::vector< unsigned int > etMissThresholdsPassed() const
returns a vector of thresholds passed.
Definition: RecEnergyRoI.cxx:213
LVL1::RecEnergyRoI::mEtSigTriggerThreshold
unsigned int mEtSigTriggerThreshold(const unsigned int thresh) const
returns the value of the trigger threshold for the threshold passed.
Definition: RecEnergyRoI.cxx:258
LVL1::RecEnergyRoI::sumEtThresholdsPassed
std::vector< unsigned int > sumEtThresholdsPassed() const
returns a vector of thresholds passed.
Definition: RecEnergyRoI.cxx:220
LVL1::RecEnergyRoI::~RecEnergyRoI
~RecEnergyRoI()
Definition: RecEnergyRoI.cxx:68
LVL1::TrigT1CaloDefs::numOfSumEtThresholds
static const unsigned int numOfSumEtThresholds
Definition: TrigT1CaloDefs.h:129
TriggerThreshold.h
LVL1::RecEnergyRoI::passedSumEtThreshold
bool passedSumEtThreshold(unsigned int thresholdNumber) const
returns TRUE if threshold number threshold_number has been passed by this ROI.
Definition: RecEnergyRoI.cxx:190
TriggerThresholdValue.h
JEPRoIDecoder.h
LVL1::RecEnergyRoI::isValidSumEtThreshold
bool isValidSumEtThreshold(const unsigned int thresh) const
returns true if thresh is a valid Sum Et threshold number
Definition: RecEnergyRoI.cxx:276
LVL1::RecEnergyRoI::passedEtMissThreshold
bool passedEtMissThreshold(unsigned int thresholdNumber) const
returns TRUE if threshold number threshold_number has been passed by this ROI.
Definition: RecEnergyRoI.cxx:178
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
TrigConf::L1DataDef::TE
@ TE
Definition: L1DataDef.h:22
TrigConf::L1DataDef::typeAsString
static std::string & typeAsString(TriggerType tt)
Definition: L1DataDef.h:53
LVL1::RecEnergyRoI::m_mEtSigThresholdValue
std::map< int, unsigned int > m_mEtSigThresholdValue
Definition: RecEnergyRoI.h:149
LVL1::RecEnergyRoI::m_roiWord0
unsigned long int m_roiWord0
this is the actual format of the data sent from the LVL1 hardware.
Definition: RecEnergyRoI.h:137
LVL1::RecEnergyRoI::operator=
RecEnergyRoI & operator=(const RecEnergyRoI &obj)
Definition: RecEnergyRoI.cxx:55
LVL1::RecEnergyRoI::m_etMissThresholdValue
std::map< int, unsigned int > m_etMissThresholdValue
Definition: RecEnergyRoI.h:147
LVL1::RecEnergyRoI::isValidMEtSigThreshold
bool isValidMEtSigThreshold(const unsigned int thresh) const
returns true if thresh is a valid Sum Et threshold number
Definition: RecEnergyRoI.cxx:283
L1DataDef.h
LVL1::RecEnergyRoI::construct
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 ...
Definition: RecEnergyRoI.cxx:76
LVL1::RecEnergyRoI::energyY
int energyY() const
returns the (signed) Ey energy projection.
Definition: RecEnergyRoI.cxx:300
LVL1::RecEnergyRoI::roiWord0
unsigned int roiWord0() const
returns roi word 0.
Definition: RecEnergyRoI.cxx:161
TrigConf::L1DataDef::XS
@ XS
Definition: L1DataDef.h:22
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
LVL1::TrigT1CaloDefs::numOfMEtSigThresholds
static const unsigned int numOfMEtSigThresholds
Definition: TrigT1CaloDefs.h:130
TrigConf::TriggerThresholdValue::thresholdValueCount
virtual int thresholdValueCount() const
Definition: TriggerThresholdValue.cxx:76
L1Menu.h
python.PyAthena.obj
obj
Definition: PyAthena.py:132
LVL1::TrigT1CaloDefs::numOfMissingEtThresholds
static const unsigned int numOfMissingEtThresholds
Definition: TrigT1CaloDefs.h:128
LVL1::RecEnergyRoI::m_roiWord2
unsigned long int m_roiWord2
this is the actual format of the data sent from the LVL1 hardware.
Definition: RecEnergyRoI.h:145
LVL1::RecEnergyRoI::overflowX
bool overflowX() const
returns the Ex overflow bit
Definition: RecEnergyRoI.cxx:316
TrigConf::L1Threshold
Standard L1 threshold configuration.
Definition: L1ThresholdBase.h:125
LVL1::TrigT1CaloDefs::Error
static const unsigned int Error
Definition: TrigT1CaloDefs.h:122