ATLAS Offline Software
Loading...
Searching...
No Matches
jFexMETRoI_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// System include(s):
7#include <stdexcept>
8
9// xAOD include(s):
11
12// Local include(s):
14
15namespace xAOD {
16
21
25 setTobEx ( unpackEx() );
26 setTobEy ( unpackEy() );
27 setTobRes ( unpackRes() );
28 setTobSat ( unpackSat() );
29 setResolution( resolution );
30
31 //include in future when xTOB in jFEX has been implemented.
32
33 // If the object is a TOB then the isTOB should be true.
34 // For xTOB default is false, but should be set if a matching TOB is found
35 // if (type() == TOB) setIsTOB(1);
36 // else setIsTOB(0);
37
38 return;
39 }
40
41 //----------------
43 //----------------
44
49
55
56
58
59 //-----------------
61 //-----------------
62
63 //include in future when xTOB in jFEX has been implemented.
64
65
66 //jFexMETRoI_v1::ObjectType jFexMETRoI_v1::type() const {
67 //if (Word1() == 0) return TOB;
68 //else return xTOB;
69 //}
70
71
72 //Return tobEx in a 200 MeV scale
74 int energy = (tobWord() >> s_Ex_Bit) & s_E_xMask; // masking from the TOB word the Ex
75 bool sign = (energy >> s_signed_E) == 1 ; //checks if the value is negative looking at the MSB within the 15 bits
76 if(sign) {
77 energy = -(~(energy-1) & s_E_xMask); // Energy is negative, then using the two's complement method we do absolute value, mask the 15 bits and assign a minus
78 }
79 return energy;
80 }
81
82 //Return tobEy in a 200 MeV scale
84 int energy = (tobWord() >> s_Ey_Bit) & s_E_yMask; // masking from the TOB word the Ey
85 bool sign = (energy >> s_signed_E) == 1 ;//checks if the value is negative looking at the MSB within the 15 bits
86 if(sign) {
87 energy = -(~(energy-1) & s_E_yMask); // Energy is negative, then using the two's complement method we do absolute value, mask the 15 bits and assign a minus
88 }
89 return energy;
90 }
91
92 //Return tobSat upper flag
93 unsigned int jFexMETRoI_v1::unpackSat() const {
94 return (tobWord() >> s_SatBit) & s_SatMask;
95 }
96
97 //Return tobRes lower flag
98 unsigned int jFexMETRoI_v1::unpackRes() const {
99 return (tobWord() >> s_ResBit) & s_ResMask;
100 }
101
103
105 int jFexMETRoI_v1::Ex() const {
106 //Since the firmware uses phi values of one hemisphere we need to apply a minus to the other hemisphere
107 int hemisphere = fpgaNumber() == 0 ? 1 : -1;
108
109 //We need to apply a global minus to return the "missing" vectorial Et instead of the "visible" vectorial Et
110 return -1*hemisphere*tobEx()*tobEtScale();
111 }
112
114 int jFexMETRoI_v1::Ey() const {
115 //Since the firmware uses phi values of one hemisphere we need to apply a minus to the other hemisphere
116 int hemisphere = fpgaNumber() == 0 ? 1 : -1;
117
118 //We need to apply a global minus to return the "missing" vectorial Et instead of the "visible" vectorial Et
119 return -1*hemisphere*tobEy()*tobEtScale();
120 }
121
122
123} // namespace xAOD
124
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
int sign(int a)
AuxElement()
Default constructor.
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
void initialize(uint8_t jFexNumber, uint8_t fpgaNumber, uint32_t tobWord, int resolution)
In future initialze the xTOB as well, word1.
int tobEtScale() const
int unpackEx() const
Raw data words.
unsigned int unpackRes() const
unsigned int unpackSat() const
static const int s_Ex_Bit
int Ey() const
Met Ey in 1 MeV scale (all signs considered)
void setTobEy(int value)
static const int s_ResBit
uint8_t jFexNumber() const
uint32_t tobWord() const
The "raw" 32-bit word describing the object candidate.
void setTobEx(int value)
uint8_t fpgaNumber() const
static const int s_signed_E
static const int s_SatMask
void setTobRes(uint8_t value)
void setjFexNumber(uint8_t jFexNumber)
static const int s_E_xMask
static const int s_SatBit
static const int s_Ey_Bit
static const int s_E_yMask
void setTobSat(uint8_t value)
int Ex() const
Methods that require combining results or applying scales.
void setResolution(int value)
jFexMETRoI_v1()
Default constructor.
static const int s_ResMask
void setTobWord(uint32_t tobWord)
Set the "raw" 32-bit words describing the object candidate.
void setfpgaNumber(uint8_t fpgaNumber)
Forward declaration.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRawEt setRawPhi int
setEventNumber uint32_t