ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LVL1::ModuleEnergy Class Reference

This is an internal class, used in the Energy trigger. More...

#include <ModuleEnergy.h>

Collaboration diagram for LVL1::ModuleEnergy:

Public Member Functions

 ModuleEnergy (const xAOD::JetElementMap_t *JEContainer, unsigned int crate, unsigned int module, int JEThresholdEtSum, int JEThresholdEtMiss, const std::map< int, int > *TEMasks=0, int slice=-1)
 
 ModuleEnergy (unsigned int crate, unsigned int module, unsigned int et, unsigned int ex, unsigned int ey)
 
 ~ModuleEnergy ()
 
unsigned int crate () const
 which module is this? More...
 
unsigned int module () const
 return module number More...
 
unsigned int et () const
 return the scalar & vector sums of all JE ETs (i.e sums the energies of up to 32 contained JEs) More...
 
unsigned int ex () const
 
unsigned int ey () const
 
int signX () const
 return signs of Ex and Ey for this module More...
 
int signY () const
 

Private Member Functions

void getSinCos (double eta, double phi, int &cosPhi, int &sinPhi)
 return cos, sin coefficients for a given JetElement More...
 

Private Attributes

int m_jetElementThresholdEtSum
 
int m_jetElementThresholdEtMiss
 
unsigned int m_Et
 
unsigned int m_Ex
 
unsigned int m_Ey
 
int m_signX
 
int m_signY
 
unsigned int m_crate
 
unsigned int m_module
 
bool m_debug
 

Static Private Attributes

static const unsigned int m_EtBits = 14
 

Detailed Description

This is an internal class, used in the Energy trigger.

The ModuleEnergy:

Definition at line 45 of file ModuleEnergy.h.

Constructor & Destructor Documentation

◆ ModuleEnergy() [1/2]

LVL1::ModuleEnergy::ModuleEnergy ( const xAOD::JetElementMap_t JEContainer,
unsigned int  crate,
unsigned int  module,
int  JEThresholdEtSum,
int  JEThresholdEtMiss,
const std::map< int, int > *  TEMasks = 0,
int  slice = -1 
)

Set up Ex, Ey signs for this module

Look for the JetElements associated with this module

Check JE not masked in TE trigger

Use jet element if it is not in the masked list

Test for saturation

Get ET for requested time slice

Test against ETmiss algorithm threshold

Get sin, cos factors for this JetElement

Convert to Ex, Ey and sum. Replicate integer arithmetic used in hardware

Test against ETsum algorithm threshold & add if passes

Convert Ex, Ey back to 1 GeV/count integers

Check for overflows. Set ET to full scale if these occur

Definition at line 25 of file ModuleEnergy.cxx.

31 {
32  // Only fill ModuleEnergys where crate, module numbers valid
33  if (m_debug) std::cout << "Create ModuleEnergy for crate "
34  << crate << " module " << module << std::endl;
35  if (m_crate <= 1 && m_module <= 15) {
37  m_signY = ( (module < 8) ? 1 : -1 );
38  m_signX = ( (crate == 0) ? m_signY : -m_signY );
40  bool saturated = false;
41  JetEnergyModuleKey get;
42  std::vector<unsigned int> keys = get.jeKeys(crate, module);
43  for (unsigned int k : keys) {
44  xAOD::JetElementMap_t::const_iterator test=JEContainer->find(k);
45  if (test != JEContainer->end()) {
47  double eta = test->second->eta();
48  int ieta = int((eta + (eta>0 ? 0.005 : -0.005))/0.1);
50  if (TEMasks == 0 || TEMasks->find(ieta) == TEMasks->end()) {
52  if (test->second->isSaturated()) {
53  saturated = true;
54  }
55  else {
57  int jetElementET;
58  if (slice < 0) jetElementET = test->second->et();
59  else jetElementET = test->second->sliceET(slice);
61  if (jetElementET > m_jetElementThresholdEtMiss) {
63  double phi = test->second->phi();
64  int cosPhi = 0;
65  int sinPhi = 0;
66  getSinCos(eta,phi,cosPhi,sinPhi);
68  unsigned int EnergyX = ((jetElementET*cosPhi) & 0x7ffffc00);
69  unsigned int EnergyY = ((jetElementET*sinPhi) & 0x7ffffc00);
70  m_Ex += EnergyX;
71  m_Ey += EnergyY;
72  if (m_debug) std::cout << "JE phi = " << phi << ", ET = " << jetElementET
73  << ", Ex = " << (EnergyX>>10) << ", Ey = " << (EnergyY>>10) << std::endl;
74  }
76  if ( jetElementET > m_jetElementThresholdEtSum )
77  m_Et += jetElementET;
78  } // End of processing of unsaturated jetElement
79  } // End processing of unvetoed element
80  } // End check for end of container
81  } // End loop through keys
82 
84  m_Ex = m_Ex>>12;
85  m_Ey = m_Ey>>12;
86 
88  if (saturated || (m_Ex > (1<<m_EtBits)-1)) m_Ex = (1<<m_EtBits)-1;
89  if (saturated || (m_Ey > (1<<m_EtBits)-1)) m_Ey = (1<<m_EtBits)-1;
90  if (saturated || (m_Et > (1<<m_EtBits)-1)) m_Et = (1<<m_EtBits)-1;
91 
92  if (m_debug) {
93  std::cout << "Crate " << crate << " Module " << module <<
94  " sums: " << std::endl;
95  std::cout << " Ex = " << static_cast<int>(m_Ex)*m_signX << std::endl;
96  std::cout << " Ey = " << static_cast<int>(m_Ey)*m_signY << std::endl;
97  std::cout << " Et = " << m_Et << std::endl;
98  }
99  }
100 }
101 
102 ModuleEnergy::ModuleEnergy(unsigned int crate, unsigned int module,
103  unsigned int et, unsigned int ex,
104  unsigned int ey) :

◆ ModuleEnergy() [2/2]

LVL1::ModuleEnergy::ModuleEnergy ( unsigned int  crate,
unsigned int  module,
unsigned int  et,
unsigned int  ex,
unsigned int  ey 
)

Set up Ex, Ey signs for this module

Check for overflows. Set ET to full scale if these occur

Definition at line 108 of file ModuleEnergy.cxx.

115 {
116  // Only fill ModuleEnergys where crate, module numbers valid
117  if (m_debug) std::cout << "Create ModuleEnergy for crate "
118  << crate << " module " << module << std::endl;
119  if (m_crate <= 1 && m_module <= 15) {
121  m_signY = ( (module < 8) ? 1 : -1 );
122  m_signX = ( (crate == 0) ? m_signY : -m_signY );
123 
125  if (m_Ex > (1<<m_EtBits)-1) m_Ex = (1<<m_EtBits)-1;
126  if (m_Ey > (1<<m_EtBits)-1) m_Ey = (1<<m_EtBits)-1;
127  if (m_Et > (1<<m_EtBits)-1) m_Et = (1<<m_EtBits)-1;
128 
129  if (m_debug) {
130  std::cout << "Crate " << crate << " Module " << module <<
131  " sums: " << std::endl;
132  std::cout << " Ex = " << static_cast<int>(m_Ex)*m_signX << std::endl;
133  std::cout << " Ey = " << static_cast<int>(m_Ey)*m_signY << std::endl;
134  std::cout << " Et = " << m_Et << std::endl;
135  }
136  }
137 }
138 
139 
141 }
142 

◆ ~ModuleEnergy()

LVL1::ModuleEnergy::~ModuleEnergy ( )

Definition at line 146 of file ModuleEnergy.cxx.

Member Function Documentation

◆ crate()

unsigned int LVL1::ModuleEnergy::crate ( ) const

which module is this?

return crate number

Definition at line 150 of file ModuleEnergy.cxx.

◆ et()

unsigned int LVL1::ModuleEnergy::et ( ) const

return the scalar & vector sums of all JE ETs (i.e sums the energies of up to 32 contained JEs)

return Et, Ex, Ey sums of contained JEs (up to 32 JEs)

module sums are unsigned. As a convenience, add methods to return signs for this module

Definition at line 159 of file ModuleEnergy.cxx.

159  {
160  return m_Ey;
161 }

◆ ex()

unsigned int LVL1::ModuleEnergy::ex ( ) const

Definition at line 162 of file ModuleEnergy.cxx.

164  {

◆ ey()

unsigned int LVL1::ModuleEnergy::ey ( ) const

Definition at line 165 of file ModuleEnergy.cxx.

167  {

◆ getSinCos()

void LVL1::ModuleEnergy::getSinCos ( double  eta,
double  phi,
int &  cosPhi,
int &  sinPhi 
)
private

return cos, sin coefficients for a given JetElement

Different phi granularities in central and forward calorimeters

Each module spans 1 quadrant in phi. Hence want phi position relative to module edge

Barrel and endcap calorimeters

Even quadrants, modPhi measured from horizontal

Odd quadrants, modPhi measured from vertical

Forward calorimeters

Definition at line 178 of file ModuleEnergy.cxx.

182  {
183  int phiBin = (int)(modPhi*16/M_PI);
184  if (m_crate > 0) {
185  cosPhi = SinCos[phiBin];
186  sinPhi = SinCos[7-phiBin];
187  }
188  else {
189  cosPhi = SinCos[7-phiBin];
190  sinPhi = SinCos[phiBin];
191  }
192  }
194  else {
195  int phiBin = (int)(modPhi*8/M_PI);
196  if (m_crate > 0) {
197  cosPhi = fwdSinCos[phiBin];
198  sinPhi = fwdSinCos[3-phiBin];
199  }
200  else {
201  cosPhi = fwdSinCos[3-phiBin];
202  sinPhi = fwdSinCos[phiBin];
203  }
204  }
205 
206 } // end of getSinCos
207 
208 } // end of namespace bracket
209 
210 

◆ module()

unsigned int LVL1::ModuleEnergy::module ( ) const

return module number

Definition at line 154 of file ModuleEnergy.cxx.

156  {

◆ signX()

int LVL1::ModuleEnergy::signX ( ) const

return signs of Ex and Ey for this module

Definition at line 170 of file ModuleEnergy.cxx.

172  {

◆ signY()

int LVL1::ModuleEnergy::signY ( ) const

Definition at line 173 of file ModuleEnergy.cxx.

175  {401,1187,1928,2594,3161,3607,3913,4070};

Member Data Documentation

◆ m_crate

unsigned int LVL1::ModuleEnergy::m_crate
private

Definition at line 80 of file ModuleEnergy.h.

◆ m_debug

bool LVL1::ModuleEnergy::m_debug
private

Definition at line 82 of file ModuleEnergy.h.

◆ m_Et

unsigned int LVL1::ModuleEnergy::m_Et
private

Definition at line 75 of file ModuleEnergy.h.

◆ m_EtBits

const unsigned int LVL1::ModuleEnergy::m_EtBits = 14
staticprivate

Definition at line 83 of file ModuleEnergy.h.

◆ m_Ex

unsigned int LVL1::ModuleEnergy::m_Ex
private

Definition at line 76 of file ModuleEnergy.h.

◆ m_Ey

unsigned int LVL1::ModuleEnergy::m_Ey
private

Definition at line 77 of file ModuleEnergy.h.

◆ m_jetElementThresholdEtMiss

int LVL1::ModuleEnergy::m_jetElementThresholdEtMiss
private

Definition at line 74 of file ModuleEnergy.h.

◆ m_jetElementThresholdEtSum

int LVL1::ModuleEnergy::m_jetElementThresholdEtSum
private

Definition at line 73 of file ModuleEnergy.h.

◆ m_module

unsigned int LVL1::ModuleEnergy::m_module
private

Definition at line 81 of file ModuleEnergy.h.

◆ m_signX

int LVL1::ModuleEnergy::m_signX
private

Definition at line 78 of file ModuleEnergy.h.

◆ m_signY

int LVL1::ModuleEnergy::m_signY
private

Definition at line 79 of file ModuleEnergy.h.


The documentation for this class was generated from the following files:
LVL1::ModuleEnergy::m_EtBits
static const unsigned int m_EtBits
Definition: ModuleEnergy.h:83
et
Extra patterns decribing particle interation process.
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
LVL1::ModuleEnergy::ex
unsigned int ex() const
Definition: ModuleEnergy.cxx:162
LVL1::ModuleEnergy::~ModuleEnergy
~ModuleEnergy()
Definition: ModuleEnergy.cxx:146
LVL1::ModuleEnergy::m_Et
unsigned int m_Et
Definition: ModuleEnergy.h:75
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::ModuleEnergy::crate
unsigned int crate() const
which module is this?
Definition: ModuleEnergy.cxx:150
LVL1::ModuleEnergy::ey
unsigned int ey() const
Definition: ModuleEnergy.cxx:165
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:144
LVL1::ModuleEnergy::m_Ex
unsigned int m_Ex
Definition: ModuleEnergy.h:76
LVL1::ModuleEnergy::m_crate
unsigned int m_crate
Definition: ModuleEnergy.h:80
LVL1::ModuleEnergy::ModuleEnergy
ModuleEnergy(const xAOD::JetElementMap_t *JEContainer, unsigned int crate, unsigned int module, int JEThresholdEtSum, int JEThresholdEtMiss, const std::map< int, int > *TEMasks=0, int slice=-1)
Definition: ModuleEnergy.cxx:25
xAOD::saturated
setScaleOne setStatusOne saturated
Definition: gFexGlobalRoI_v1.cxx:51
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
LVL1::ModuleEnergy::m_module
unsigned int m_module
Definition: ModuleEnergy.h:81
LVL1::ModuleEnergy::m_signX
int m_signX
Definition: ModuleEnergy.h:78
LVL1::ModuleEnergy::m_Ey
unsigned int m_Ey
Definition: ModuleEnergy.h:77
LVL1::ModuleEnergy::module
unsigned int module() const
return module number
Definition: ModuleEnergy.cxx:154
xAOD::phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
Definition: L2StandAloneMuon_v2.cxx:144
LVL1::ModuleEnergy::m_jetElementThresholdEtMiss
int m_jetElementThresholdEtMiss
Definition: ModuleEnergy.h:74
LVL1::ModuleEnergy::m_signY
int m_signY
Definition: ModuleEnergy.h:79
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
LVL1::ModuleEnergy::m_debug
bool m_debug
Definition: ModuleEnergy.h:82
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LVL1::ModuleEnergy::m_jetElementThresholdEtSum
int m_jetElementThresholdEtSum
Definition: ModuleEnergy.h:73
LVL1::ModuleEnergy::getSinCos
void getSinCos(double eta, double phi, int &cosPhi, int &sinPhi)
return cos, sin coefficients for a given JetElement
Definition: ModuleEnergy.cxx:178
fitman.k
k
Definition: fitman.py:528