ATLAS Offline Software
gFexGlobalRoI_v1.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4 */
5 
6 
7 // System include(s):
8 #include <stdexcept>
9 
10 // xAOD include(s):
12 
13 // Local include(s):
15 
16 namespace xAOD {
17 
19 
21  : SG::AuxElement() {
22 
23  }
24 
25  void gFexGlobalRoI_v1::initialize( uint32_t word, int tobEtScaleOne, int tobEtScaleTwo) {
26 
27  setWord( word );
36 
37  }
38 
39 
42  setWord )
44  setScaleOne )
46  setScaleTwo )
48  setStatusOne )
50  setStatusTwo )
52  setSaturated )
54  setGlobalType )
56  setQuantityOne )
58  setQuantityTwo )
59 
60 
62 
63 
65  int gFexGlobalRoI_v1::unpackType() const {
66  auto tobID = (word() >> s_tobIDBit) & s_tobIDMask;
67  if (tobID == 0 ) return gNull;
68  else if (tobID == 1 ) return gScalar;
69  else if (tobID == 2 ) return gMET;
70  else if (tobID == 3 ) return gMHT;
71  else if (tobID == 4 ) return gMST;
72  else return -999;
73  }
74 
75  bool gFexGlobalRoI_v1::isgScalar() const {
76  return globalType() == gScalar;
77  }
78 
79  bool gFexGlobalRoI_v1::isgMET() const {
80  return globalType() == gMET;
81  }
82 
83  bool gFexGlobalRoI_v1::isgMHT() const {
84  return globalType() == gMHT;
85  }
86 
87  bool gFexGlobalRoI_v1::isgMST() const {
88  return globalType() == gMST;
89  }
90 
91 
92 
93  unsigned int gFexGlobalRoI_v1::unpackStatusOne() const{
94  return (word() >> s_statusOneBit) & s_statusOneMask;
95  }
96 
97  unsigned int gFexGlobalRoI_v1::unpackStatusTwo() const{
98  return (word() >> s_statusTwoBit) & s_statusTwoMask;
99  }
100 
101  unsigned int gFexGlobalRoI_v1::unpackSaturated() const{
102  return (word() >> s_saturBit) & s_saturMask;
103  }
104 
105 
108  int16_t quantity = (word() >> s_quantityOneBit) & s_quantityOneMask;
109  int SIGNMASK = 0x0800;
110  int EXTENDS = 0xF000;
111  if ((globalType() != gNull) && (globalType() != gScalar)){
112  if( (SIGNMASK & quantity ) ) {
113  quantity = ( EXTENDS | quantity);
114  }
115  }
116  return quantity;
117  }
118 
120  int16_t quantity = (word() >> s_quantityTwoBit) & s_quantityTwoMask;
121  int SIGNMASK = 0x0800;
122  int EXTENDS = 0xF000;
123  if ((globalType() != gNull) && (globalType() != gScalar)){
124  if( (SIGNMASK & quantity ) ) {
125  quantity = ( EXTENDS | quantity);
126  }
127  }
128  return quantity;
129 
130  }
131 
132 
134 
137  float gFexGlobalRoI_v1::METquantityOne() const {
138  if (globalType() != gNull){
139  return quantityOne()*tobEtScaleOne();
140  }
141  return -999;
142  }
145  float gFexGlobalRoI_v1::METquantityTwo() const {
146  if (globalType() != gNull){
147  return quantityTwo()*tobEtScaleOne();
148  }
149 
150  return -999;
151  }
154  float gFexGlobalRoI_v1::SumEt() const {
155  if (globalType() == gScalar ){
156  return quantityTwo()*tobEtScaleTwo();
157  }
158  return -999;
159  }
160 
161 
162 
163 
164 
165 
166 
167 
168 } // namespace xAOD
xAOD::gFexGlobalRoI_v1::globalType
int globalType() const
retrieves the energy saturation status from the 32-bit word
xAOD::AUXSTORE_PRIMITIVE_SETTER_AND_GETTER
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
xAOD::gFexGlobalRoI_v1::isgMET
bool isgMET() const
xAOD::gFexGlobalRoI_v1::s_statusTwoMask
static const int s_statusTwoMask
Definition: gFexGlobalRoI_v1.h:119
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::gFexGlobalRoI_v1::unpackStatusTwo
unsigned int unpackStatusTwo() const
retrieves the Status info for Quantity 1 from the 32-bit word
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
xAOD::gFexGlobalRoI_v1::s_quantityOneBit
static const int s_quantityOneBit
Definition: gFexGlobalRoI_v1.h:112
xAOD::gFexGlobalRoI_v1::gScalar
@ gScalar
indicaes a null value (should be accompanied by a Status=0)
Definition: gFexGlobalRoI_v1.h:38
AuxStoreAccessorMacros.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::gFexGlobalRoI_v1::s_quantityTwoMask
static const int s_quantityTwoMask
Definition: gFexGlobalRoI_v1.h:121
xAOD::statusOne
setScaleOne statusOne
Definition: gFexGlobalRoI_v1.cxx:47
xAOD::gFexGlobalRoI_v1::setScaleOne
void setScaleOne(int value)
Set the "raw" 32-bit words describing the object candidate.
xAOD::gFexGlobalRoI_v1::unpackQuantityOne
int16_t unpackQuantityOne() const
setter for the above
xAOD::gFexGlobalRoI_v1
Class describing properties of a LVL1 gFEX global Trigger Object (TOB) in the xAOD format.
Definition: gFexGlobalRoI_v1.h:25
xAOD::gFexGlobalRoI_v1::METquantityOne
float METquantityOne() const
retrieves the Et index from the 32-bit word
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::gFexGlobalRoI_v1::s_quantityTwoBit
static const int s_quantityTwoBit
Definition: gFexGlobalRoI_v1.h:113
xAOD::gFexGlobalRoI_v1::setScaleTwo
void setScaleTwo(int value)
Set the "raw" 32-bit words describing the object candidate.
xAOD::gFexGlobalRoI_v1::setSaturated
void setSaturated(uint8_t value)
xAOD::gFexGlobalRoI_v1::tobEtScaleOne
int tobEtScaleOne() const
xAOD::gFexGlobalRoI_v1::setQuantityOne
void setQuantityOne(int16_t value)
getter for integer ET on TOB scale (3.2 GeV/count)
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
setWord
void setWord(uint32_t)
xAOD::gFexGlobalRoI_v1::SumEt
float SumEt() const
floating point value (GeV, TOB scale)
xAOD::gFexGlobalRoI_v1::s_saturMask
static const int s_saturMask
Definition: gFexGlobalRoI_v1.h:116
xAOD::gFexGlobalRoI_v1::METquantityTwo
float METquantityTwo() const
floating point value (GeV, TOB scale)
xAOD::gFexGlobalRoI_v1::gMST
@ gMST
MET hard term components (MHTx, MHTy)
Definition: gFexGlobalRoI_v1.h:41
xAOD::gFexGlobalRoI_v1::s_statusTwoBit
static const int s_statusTwoBit
Definition: gFexGlobalRoI_v1.h:111
xAOD::saturated
setScaleOne setStatusOne saturated
Definition: gFexGlobalRoI_v1.cxx:51
xAOD::gFexGlobalRoI_v1::isgMST
bool isgMST() const
xAOD::quantityOne
setScaleOne setStatusOne setSaturated quantityOne
Definition: gFexGlobalRoI_v1.cxx:55
xAOD::gFexGlobalRoI_v1::unpackQuantityTwo
int16_t unpackQuantityTwo() const
setter for the above
xAOD::gFexGlobalRoI_v1::isgMHT
bool isgMHT() const
xAOD::gFexGlobalRoI_v1::quantityOne
int16_t quantityOne() const
TOB ET (decoded from TOB, stored for convenience)
xAOD::gFexGlobalRoI_v1::unpackStatusOne
unsigned int unpackStatusOne() const
xAOD::gFexGlobalRoI_v1::s_statusOneMask
static const int s_statusOneMask
Definition: gFexGlobalRoI_v1.h:118
gFexGlobalRoI_v1.h
xAOD::gFexGlobalRoI_v1::tobEtScaleTwo
int tobEtScaleTwo() const
xAOD::gFexGlobalRoI_v1::s_statusOneBit
static const int s_statusOneBit
Definition: gFexGlobalRoI_v1.h:110
xAOD::gFexGlobalRoI_v1::setQuantityTwo
void setQuantityTwo(int16_t value)
getter for integer ET on TOB scale (3.2 GeV/count)
xAOD::gFexGlobalRoI_v1::gNull
@ gNull
Definition: gFexGlobalRoI_v1.h:37
xAOD::gFexGlobalRoI_v1::setWord
void setWord(uint32_t value)
Set the "raw" 32-bit words describing the object candidate.
xAOD::gFexGlobalRoI_v1::initialize
void initialize(uint32_t word, int tobEtScaleOne, int tobEtScaleTwo=0)
Initialise the object with its properties.
Definition: gFexGlobalRoI_v1.cxx:25
xAOD::gFexGlobalRoI_v1::setStatusOne
void setStatusOne(uint8_t value)
xAOD::gFexGlobalRoI_v1::gMHT
@ gMHT
MET components (METx, METy)
Definition: gFexGlobalRoI_v1.h:40
xAOD::gFexGlobalRoI_v1::word
uint32_t word() const
The "raw" 32-bit word describing the object candidate.
xAOD::gFexGlobalRoI_v1::s_quantityOneMask
static const int s_quantityOneMask
Definition: gFexGlobalRoI_v1.h:120
xAOD::gFexGlobalRoI_v1::unpackSaturated
unsigned int unpackSaturated() const
xAOD::tobEtScaleOne
tobEtScaleOne
Definition: gFexGlobalRoI_v1.cxx:43
xAOD::gFexGlobalRoI_v1::quantityTwo
int16_t quantityTwo() const
retrieves the Et index from the 32-bit word
xAOD::gFexGlobalRoI_v1::s_saturBit
static const int s_saturBit
Constants used in converting to ATLAS units.
Definition: gFexGlobalRoI_v1.h:108
xAOD::gFexGlobalRoI_v1::isgScalar
bool isgScalar() const
Identification of object type with flags.
xAOD::gFexGlobalRoI_v1::setGlobalType
void setGlobalType(int type)
xAOD::gFexGlobalRoI_v1::unpackType
int unpackType() const
xAOD::gFexGlobalRoI_v1::gFexGlobalRoI_v1
gFexGlobalRoI_v1()
Default constructor.
Definition: gFexGlobalRoI_v1.cxx:20
xAOD::gFexGlobalRoI_v1::gMET
@ gMET
scalar values (MET, SumET))
Definition: gFexGlobalRoI_v1.h:39
xAOD::gFexGlobalRoI_v1::setStatusTwo
void setStatusTwo(uint8_t value)