ATLAS Offline Software
RecEnergyRoI.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 // $Id: RecEnergyRoI.cxx 342657 2011-01-28 23:42:18Z watsona $
5 /***************************************************************************
6  RecEnergyRoI.cxx - description
7  -------------------
8  begin : Mon Jan 22 2001
9  email : moyse@heppch.ph.qmw.ac.uk
10 ***************************************************************************/
11 
12 
13 // Trigger config includes:
17 #include "TrigConfData/L1Menu.h"
19 
20 // Local include(s):
23 
24 using namespace std;
25 using namespace TrigConf;
26 
27 LVL1::RecEnergyRoI::RecEnergyRoI(unsigned int RoIWord0, unsigned int RoIWord1, unsigned int RoIWord2,
28  const std::vector<TrigConf::TriggerThreshold *> *caloThresholds)
29 {
30 
31  this->construct(RoIWord0, RoIWord1, RoIWord2, caloThresholds);
32 }
33 
34 LVL1::RecEnergyRoI::RecEnergyRoI(unsigned int RoIWord0, unsigned int RoIWord1, unsigned int RoIWord2,
35  const TrigConf::L1Menu *const l1menu)
36  : m_roiWord0(RoIWord0),
37  m_roiWord1(RoIWord1),
38  m_roiWord2(RoIWord2)
39 {
41 }
42 
43 //copy constructor
45  : m_roiWord0(obj.m_roiWord0),
46  m_roiWord1(obj.m_roiWord1),
47  m_roiWord2(obj.m_roiWord2),
48  m_etMissThresholdValue(obj.m_etMissThresholdValue),
49  m_sumEtThresholdValue(obj.m_sumEtThresholdValue),
50  m_mEtSigThresholdValue(obj.m_mEtSigThresholdValue)
51 {
52 }
53 
54 //assignment operator
57 {
58  if(this != &rhs) {
59  m_roiWord0 = rhs.m_roiWord0;
60  m_roiWord1 = rhs.m_roiWord1;
61  m_roiWord2 = rhs.m_roiWord2;
62  m_etMissThresholdValue = rhs.m_etMissThresholdValue;
63  m_sumEtThresholdValue = rhs.m_sumEtThresholdValue;
64  m_mEtSigThresholdValue = rhs.m_mEtSigThresholdValue;
65  }
66  return *this;
67 }
68 
70 
77 void LVL1::RecEnergyRoI::construct(unsigned int RoIWord0, unsigned int RoIWord1, unsigned int RoIWord2,
78  const std::vector<TriggerThreshold *> *caloThresholds)
79 {
80  m_roiWord0 = RoIWord0;
81  m_roiWord1 = RoIWord1;
82  m_roiWord2 = RoIWord2;
83 
84  // Copy threshold values into maps for matching to list of thresholds passed
85  std::map< int, TriggerThreshold* > etMissMap;
86  std::map< int, TriggerThreshold* > sumEtMap;
87  std::map< int, TriggerThreshold* > mEtSigMap;
88  for( std::vector< TriggerThreshold* >::const_iterator it = caloThresholds->begin();
89  it != caloThresholds->end(); ++it ) {
90  if( ( *it )->type() == L1DataDef::xeType() ) {
91  int num = ( *it )->thresholdNumber();
92  etMissMap.insert( std::map< int, TriggerThreshold* >::value_type( num, *it ) );
93  }
94  else if( ( *it )->type() == L1DataDef::teType() ) {
95  int num = ( *it )->thresholdNumber();
96  sumEtMap.insert( std::map< int, TriggerThreshold* >::value_type( num, *it ) );
97  }
98  else if( ( *it )->type() == L1DataDef::xsType() ) {
99  int num = ( *it )->thresholdNumber();
100  mEtSigMap.insert( std::map< int, TriggerThreshold* >::value_type( num, *it ) );
101  }
102  }
103 
104  // Find which thresholds this RoI passed and copy the values into the maps
105  for (unsigned int xeMapping : etMissThresholdsPassed())
106  {
107  std::map<int, TriggerThreshold *>::const_iterator thr = etMissMap.find(xeMapping - 1);
108  if (thr != etMissMap.end()) {
109  TriggerThresholdValue* ttv = thr->second->triggerThresholdValue(0,0);
110  m_etMissThresholdValue.insert(std::map<int, unsigned int>::value_type(xeMapping, ttv->thresholdValueCount()));
111  }
112  }
113 
114  for (unsigned int teMapping : sumEtThresholdsPassed())
115  {
116  std::map<int, TriggerThreshold *>::const_iterator thr = sumEtMap.find(teMapping - 1);
117  if (thr != sumEtMap.end()) {
118  TriggerThresholdValue* ttv = thr->second->triggerThresholdValue(0,0);
119  m_sumEtThresholdValue.insert(std::map<int, unsigned int>::value_type(teMapping, ttv->thresholdValueCount()));
120  }
121  }
122 
123  for (unsigned int xsMapping : mEtSigThresholdsPassed())
124  {
125  std::map<int, TriggerThreshold *>::const_iterator thr = mEtSigMap.find(xsMapping - 1);
126  if (thr != mEtSigMap.end()) {
127  TriggerThresholdValue* ttv = thr->second->triggerThresholdValue(0,0);
128  m_mEtSigThresholdValue.insert(std::map<int, unsigned int>::value_type(xsMapping, ttv->thresholdValueCount()));
129  }
130  }
131 }
132 
134 {
135  // Find which thresholds this RoI passed and copy the values into the maps
136  if ( ! l1menu->thresholds("XE").empty() ) {
137  for (unsigned int xeMapping : etMissThresholdsPassed())
138  {
139  const TrigConf::L1Threshold &thr = l1menu->threshold("XE", xeMapping - 1);
140  auto &caloThr = dynamic_cast<const TrigConf::L1Threshold_Calo &>(thr);
141  m_etMissThresholdValue[xeMapping] = caloThr.thrValueCounts();
142  }
143  }
144  if ( ! l1menu->thresholds("TE").empty() ) {
145  for (unsigned int teMapping : sumEtThresholdsPassed())
146  {
147  const TrigConf::L1Threshold &thr = l1menu->threshold("TE", teMapping - 1);
148  auto &caloThr = dynamic_cast<const TrigConf::L1Threshold_Calo &>(thr);
149  m_sumEtThresholdValue[teMapping] = caloThr.thrValueCounts();
150  }
151  }
152  if ( ! l1menu->thresholds("XS").empty() ) {
153  for (unsigned int xsMapping : mEtSigThresholdsPassed())
154  {
155  const TrigConf::L1Threshold &thr = l1menu->threshold("XS", xsMapping - 1);
156  auto &caloThr = dynamic_cast<const TrigConf::L1Threshold_Calo &>(thr);
157  m_mEtSigThresholdValue[xsMapping] = caloThr.thrValueCounts();
158  }
159  }
160 }
161 
162 unsigned int LVL1::RecEnergyRoI::roiWord0() const
163 {
164  return m_roiWord0;
165 }
166 
167 unsigned int LVL1::RecEnergyRoI::roiWord1() const
168 {
169  return m_roiWord1;
170 }
171 
172 unsigned int LVL1::RecEnergyRoI::roiWord2() const
173 {
174  return m_roiWord2;
175 }
176 
179 bool LVL1::RecEnergyRoI::passedEtMissThreshold(unsigned int thresholdNumber) const
180 {
181 
182  if ( this->isValidEtMissThreshold( thresholdNumber ) ) {
184  return ( get.etMissThresholdPassed( m_roiWord2, thresholdNumber ) );
185  }
186  return false;
187 }
188 
191 bool LVL1::RecEnergyRoI::passedSumEtThreshold(unsigned int thresholdNumber) const
192 {
193 
194  if ( this->isValidSumEtThreshold( thresholdNumber ) ) {
196  return ( get.sumEtThresholdPassed( m_roiWord1, thresholdNumber ) );
197  }
198  return false;
199 }
200 
203 bool LVL1::RecEnergyRoI::passedMEtSigThreshold(unsigned int thresholdNumber) const
204 {
205 
206  if ( this->isValidSumEtThreshold( thresholdNumber ) ) {
208  return ( get.mEtSigThresholdPassed( m_roiWord0, thresholdNumber ) );
209  }
210  return false;
211 }
212 
214 vector<unsigned int> LVL1::RecEnergyRoI::etMissThresholdsPassed() const
215 {
217  return get.etMissThresholdsPassed(m_roiWord2);
218 }
219 
221 vector<unsigned int> LVL1::RecEnergyRoI::sumEtThresholdsPassed() const
222 {
224  return get.etSumThresholdsPassed(m_roiWord1);
225 }
226 
228 vector<unsigned int> LVL1::RecEnergyRoI::mEtSigThresholdsPassed() const
229 {
231  return get.mEtSigThresholdsPassed(m_roiWord0);
232 }
233 
236 unsigned int LVL1::RecEnergyRoI::etMissTriggerThreshold(const unsigned int thresh) const
237 {
238  std::map< int, unsigned int >::const_iterator it = m_etMissThresholdValue.find( thresh );
239  if( it != m_etMissThresholdValue.end() ) {
240  return it->second;
241  }
242  return TrigT1CaloDefs::Error;
243 }
244 
247 unsigned int LVL1::RecEnergyRoI::sumEtTriggerThreshold(const unsigned int thresh) const
248 {
249 
250  std::map< int, unsigned int >::const_iterator it = m_sumEtThresholdValue.find( thresh );
251  if( it != m_sumEtThresholdValue.end() ) {
252  return it->second;
253  }
254  return TrigT1CaloDefs::Error;
255 }
256 
259 unsigned int LVL1::RecEnergyRoI::mEtSigTriggerThreshold(const unsigned int thresh) const
260 {
261 
262  std::map< int, unsigned int >::const_iterator it = m_mEtSigThresholdValue.find( thresh );
263  if( it != m_mEtSigThresholdValue.end() ) {
264  return it->second;
265  }
266  return TrigT1CaloDefs::Error;
267 }
268 
271 {
272 
274 }
275 
277 bool LVL1::RecEnergyRoI::isValidSumEtThreshold(const unsigned int thresh) const
278 {
279 
281 }
282 
285 {
286 
288 }
289 
293 {
294 
296  return get.energyX(m_roiWord0);
297 }
298 
302 {
303 
305  return get.energyY(m_roiWord1);
306 }
307 
311 {
313  return get.energyT(m_roiWord2);
314 }
315 
318 {
320  return get.energyOverflow(m_roiWord0);
321 }
322 
325 {
327  return get.energyOverflow(m_roiWord1);
328 }
329 
332 {
334  return get.energyOverflow(m_roiWord2);
335 }
TrigConf::TriggerThresholdValue
Definition: TriggerThresholdValue.h:22
RecEnergyRoI.h
LVL1::RecEnergyRoI::roiWord1
unsigned int roiWord1() const
returns roi word 1.
Definition: RecEnergyRoI.cxx:167
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:247
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:292
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:310
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:396
LVL1::RecEnergyRoI::roiWord2
unsigned int roiWord2() const
returns roi word 2.
Definition: RecEnergyRoI.cxx:172
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:236
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
LVL1::RecEnergyRoI::overflowT
bool overflowT() const
returns the ETsum overflow bit
Definition: RecEnergyRoI.cxx:331
LVL1::RecEnergyRoI::isValidEtMissThreshold
bool isValidEtMissThreshold(const unsigned int thresh) const
returns true if thresh is a valid EtMiss threshold number
Definition: RecEnergyRoI.cxx:270
L1Threshold.h
LVL1::RecEnergyRoI
This class defines the reconstructed EnergySum ROI.
Definition: RecEnergyRoI.h:37
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:228
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:203
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:324
LVL1::RecEnergyRoI::etMissThresholdsPassed
std::vector< unsigned int > etMissThresholdsPassed() const
returns a vector of thresholds passed.
Definition: RecEnergyRoI.cxx:214
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:259
LVL1::RecEnergyRoI::sumEtThresholdsPassed
std::vector< unsigned int > sumEtThresholdsPassed() const
returns a vector of thresholds passed.
Definition: RecEnergyRoI.cxx:221
LVL1::RecEnergyRoI::~RecEnergyRoI
~RecEnergyRoI()
Definition: RecEnergyRoI.cxx:69
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:191
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:277
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:179
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
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:56
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:284
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:77
LVL1::RecEnergyRoI::energyY
int energyY() const
returns the (signed) Ey energy projection.
Definition: RecEnergyRoI.cxx:301
LVL1::RecEnergyRoI::roiWord0
unsigned int roiWord0() const
returns roi word 0.
Definition: RecEnergyRoI.cxx:162
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:317
TrigConf::L1Threshold
Standard L1 threshold configuration.
Definition: L1ThresholdBase.h:125
LVL1::TrigT1CaloDefs::Error
static const unsigned int Error
Definition: TrigT1CaloDefs.h:122