ATLAS Offline Software
JetEnergyRoI.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
10 
11 using namespace std;
12 using namespace LVL1;
13 
14 namespace ROIB {
15 
16  JetEnergyRoI::JetEnergyRoI( uint32_t RoIWord )
17  : m_roIWord( RoIWord )
18  {
19  }
20 
22  : m_roIWord( 0 )
23  {
24  }
25 
28  m_roIWord = RoIFormatUpdater::UpdateJetEnergyRoI( m_roIWord );
29  return;
30  }
31 
33  return m_roIWord;
34  }
35 
36  unsigned int JetEnergyRoI::jetRoIVersion() const {
37  int type = BitOp::getValue( &m_roIWord, 0xe0000000 );
38 
39  if (type == TrigT1CaloDefs::Run1JetType) return 1;
40  else if (type == TrigT1CaloDefs::Run2JetType) return 2;
41 
42  return 999;
43  }
44 
45  unsigned int JetEnergyRoI::roIType() const {
46 
47  if ( m_roIWord != 0 ) {
48 
49  int type = BitOp::getValue( &m_roIWord, 0xe0000000 );
50 
51  if (type == TrigT1CaloDefs::Run1JetType || type == TrigT1CaloDefs::Run2JetType) return TrigT1CaloDefs::JetRoIWordType;
52  else if (type == TrigT1CaloDefs::JetEtType) return TrigT1CaloDefs::JetEtRoIWordType;
53  else {
54  int type2 = BitOp::getValue( &m_roIWord, 0xf0000000 );
55  if (type2 == TrigT1CaloDefs::energyRoIWord0) return TrigT1CaloDefs::EnergyRoIWordType0;
56  else if (type2 == TrigT1CaloDefs::energyRoIWord1) return TrigT1CaloDefs::EnergyRoIWordType1;
57  else if (type2 == TrigT1CaloDefs::energyRoIWord2) return TrigT1CaloDefs::EnergyRoIWordType2;
58  }
59 
60  }
61 
62  return TrigT1CaloDefs::RoIWordTypeError;
63  }
64 
65  unsigned int JetEnergyRoI::electronicsID() const {
66  if ( m_roIWord == 0 || roIType() != TrigT1CaloDefs::JetRoIWordType )
67  return 9999;
68  else {
69  return BitOp::getValue( &m_roIWord, 0x1ff10000 );
70  }
71  }
72 
73  vector< unsigned int > JetEnergyRoI::thresholds() const {
74  vector< unsigned int > returnVec;
75  if ( m_roIWord == 0 || roIType() != TrigT1CaloDefs::JetRoIWordType )
76  returnVec.push_back( 9999 );
77  else if ( jetRoIVersion() > 1 ) returnVec.push_back( 0 );
78  else {
79  for ( unsigned int i = 0;i < TrigT1CaloDefs::numOfJetThresholds+TrigT1CaloDefs::numOfFwdJetThresholds;i++ )
80  returnVec.push_back( static_cast< unsigned int >( BitOp::isSet( &m_roIWord, i ) ) );
81  }
82  return returnVec;
83  }
84 
85  unsigned int JetEnergyRoI::etLarge() const {
86  if (jetRoIVersion() < 2) return 0;
87  else return BitOp::getValue( &m_roIWord, 0x3ff );
88  }
89 
90  unsigned int JetEnergyRoI::etSmall() const {
91  if (jetRoIVersion() < 2) return 0;
92  else return BitOp::getValue( &m_roIWord, 0x7fc00 );
93  }
94 
95  unsigned int JetEnergyRoI::jetEt() const {
96  if ( m_roIWord == 0 || roIType() != TrigT1CaloDefs::JetEtRoIWordType )
97  return 9999;
98  else {
99  return BitOp::getValue( &m_roIWord, 0x0000000f );
100  }
101  }
102 
103  unsigned int JetEnergyRoI::energyX() const {
104  if ( m_roIWord == 0 || roIType() != TrigT1CaloDefs::EnergyRoIWordType0 )
105  return 9999;
106  else {
107  return BitOp::getValue( &m_roIWord, 0x0000ffff );
108  }
109  }
110 
111  unsigned int JetEnergyRoI::energyY() const {
112  if ( m_roIWord == 0 || roIType() != TrigT1CaloDefs::EnergyRoIWordType1 )
113  return 9999;
114  else {
115  return BitOp::getValue( &m_roIWord, 0x0000ffff );
116  }
117  }
118 
119  unsigned int JetEnergyRoI::energySum() const {
120  if ( m_roIWord == 0 || roIType() != TrigT1CaloDefs::EnergyRoIWordType2 )
121  return 9999;
122  else {
123  return BitOp::getValue( &m_roIWord, 0x0000ffff );
124  }
125  }
126 
127  unsigned int JetEnergyRoI::etSumType() const {
128  if ( roIType() != TrigT1CaloDefs::EnergyRoIWordType0 &&
129  roIType() != TrigT1CaloDefs::EnergyRoIWordType1 &&
130  roIType() != TrigT1CaloDefs::EnergyRoIWordType2 )
131  return 0;
132  else {
133  return BitOp::getValue( &m_roIWord, 0x04000000 );
134  }
135  }
136 
137  vector< unsigned int > JetEnergyRoI::etSumThresholds() const {
138  vector< unsigned int > returnVec;
139  if ( m_roIWord == 0 || roIType() != TrigT1CaloDefs::EnergyRoIWordType1 )
140  returnVec.push_back( 9999 );
141  else {
142  const unsigned int result = BitOp::getValue( &m_roIWord, 0x00ff0000 );
143  for ( unsigned int i = 0;i < TrigT1CaloDefs::numOfSumEtThresholds;i++ )
144  returnVec.push_back( static_cast< unsigned int >( BitOp::isSet( &result, i ) ) );
145  }
146  return returnVec;
147  }
148 
149  vector< unsigned int > JetEnergyRoI::etMissThresholds() const {
150  vector< unsigned int > returnVec;
151 
152  if ( m_roIWord == 0 || roIType() != TrigT1CaloDefs::EnergyRoIWordType2 )
153  returnVec.push_back( 9999 );
154  else {
155  const unsigned int result = BitOp::getValue( &m_roIWord, 0x00ff0000 );
156  for ( unsigned int i = 0;i < TrigT1CaloDefs::numOfMissingEtThresholds;i++ )
157  returnVec.push_back( static_cast< unsigned int >( BitOp::isSet( &result, i ) ) );
158  }
159  return returnVec;
160  }
161 
162  vector< unsigned int > JetEnergyRoI::metSigThresholds() const {
163  vector< unsigned int > returnVec;
164  if ( m_roIWord == 0 || roIType() != TrigT1CaloDefs::EnergyRoIWordType0 )
165  returnVec.push_back( 9999 );
166  else {
167  const unsigned int result = BitOp::getValue( &m_roIWord, 0x00ff0000 );
168  for ( unsigned int i = 0;i < TrigT1CaloDefs::numOfMEtSigThresholds;i++ )
169  returnVec.push_back( static_cast< unsigned int >( BitOp::isSet( &result, i ) ) );
170  }
171  return returnVec;
172  }
173 
174 
175 } // namespace ROIB
RoIFormatUpdater.h
ROIB::JetEnergyRoI::etMissThresholds
std::vector< unsigned int > etMissThresholds() const
Definition: JetEnergyRoI.cxx:149
ROIB::JetEnergyRoI::etSumType
unsigned int etSumType() const
Eta range for MET/SumET RoIs (0 = full, 1 = restricted)
Definition: JetEnergyRoI.cxx:127
get_generator_info.result
result
Definition: get_generator_info.py:21
ROIB::JetEnergyRoI::metSigThresholds
std::vector< unsigned int > metSigThresholds() const
Definition: JetEnergyRoI.cxx:162
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
JetEnergyRoI.h
ROIB::JetEnergyRoI::etLarge
unsigned int etLarge() const
Methods returning the jet ET cluster values for Run 2 RoIs.
Definition: JetEnergyRoI.cxx:85
ROIB::JetEnergyRoI::update
void update()
Definition: JetEnergyRoI.cxx:26
ROIB::JetEnergyRoI::energyX
unsigned int energyX() const
Method returning Ex, Ey, and Esum.
Definition: JetEnergyRoI.cxx:103
ROIB::JetEnergyRoI::jetRoIVersion
unsigned int jetRoIVersion() const
Jet RoI version (Run 1 or Run 2)
Definition: JetEnergyRoI.cxx:36
ROIB::JetEnergyRoI::m_roIWord
uint32_t m_roIWord
Definition: JetEnergyRoI.h:59
ROIB::JetEnergyRoI::energyY
unsigned int energyY() const
Definition: JetEnergyRoI.cxx:111
ROIB
Namespace of the LVL1 RoIB simulation.
Definition: ILvl1ResultAccessTool.h:19
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
ROIB::JetEnergyRoI::energySum
unsigned int energySum() const
Definition: JetEnergyRoI.cxx:119
lumiFormat.i
int i
Definition: lumiFormat.py:85
BitOp.h
ROIB::JetEnergyRoI::thresholds
std::vector< unsigned int > thresholds() const
Method returning the list of passed thresholds.
Definition: JetEnergyRoI.cxx:73
ROIB::JetEnergyRoI::roIType
unsigned int roIType() const
Method returning the RoI type (jet, energy, jet-Et)
Definition: JetEnergyRoI.cxx:45
ROIB::JetEnergyRoI::roIWord
uint32_t roIWord() const
Method returning the RoI word.
Definition: JetEnergyRoI.cxx:32
BitOp::isSet
static bool isSet(const unsigned int *uintValue, int bit)
Check if a the given bit in the given unsigned int or int value is set.
Definition: BitOp.h:47
ROIB::JetEnergyRoI::etSmall
unsigned int etSmall() const
Definition: JetEnergyRoI.cxx:90
TrigT1CaloDefs.h
ROIB::JetEnergyRoI::jetEt
unsigned int jetEt() const
Definition: JetEnergyRoI.cxx:95
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ROIB::JetEnergyRoI::etSumThresholds
std::vector< unsigned int > etSumThresholds() const
Method returning patterns for passed etsum and etmiss threhsolds.
Definition: JetEnergyRoI.cxx:137
ROIB::JetEnergyRoI::electronicsID
unsigned int electronicsID() const
Method returning electronics address.
Definition: JetEnergyRoI.cxx:65
BitOp::getValue
static unsigned int getValue(const unsigned int *uintValue, const unsigned int mask)
get the value in the input word represented by a bit pattern given as a bitmask
Definition: BitOp.cxx:47
ROIB::JetEnergyRoI::JetEnergyRoI
JetEnergyRoI()
Definition: JetEnergyRoI.cxx:21