20 unsigned int module,
int JEThresholdEtSum,
int JEThresholdEtMiss,
const std::map<int, int>* TEMasks,
int slice):
33 if (
m_debug) std::cout <<
"Create ModuleEnergy for crate "
37 m_signY = ( (
module < 8) ? 1 : -1 );
40 bool saturated =
false;
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()) {
58 if (slice < 0) jetElementET = test->second->et();
59 else jetElementET = test->second->sliceET(slice);
63 double phi = test->second->phi();
68 unsigned int EnergyX = ((jetElementET*cosPhi) & 0x7ffffc00);
69 unsigned int EnergyY = ((jetElementET*sinPhi) & 0x7ffffc00);
72 if (
m_debug) std::cout <<
"JE phi = " <<
phi <<
", ET = " << jetElementET
73 <<
", Ex = " << (EnergyX>>10) <<
", Ey = " << (EnergyY>>10) << std::endl;
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;
103 unsigned int et,
unsigned int ex,
117 if (
m_debug) std::cout <<
"Create ModuleEnergy for crate "
121 m_signY = ( (
module < 8) ? 1 : -1 );
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;
175 unsigned int SinCos[8] = {401,1187,1928,2594,3161,3607,3913,4070};
176 unsigned int fwdSinCos[4] = {794,2261,3384,3992};
179 float modPhi = fmod(
phi,
M_PI/2.);
182 if (fabs(
eta) < 3.2) {
183 int phiBin = (int)(modPhi*16/
M_PI);
185 cosPhi = SinCos[phiBin];
186 sinPhi = SinCos[7-phiBin];
189 cosPhi = SinCos[7-phiBin];
190 sinPhi = SinCos[phiBin];
195 int phiBin = (int)(modPhi*8/
M_PI);
197 cosPhi = fwdSinCos[phiBin];
198 sinPhi = fwdSinCos[3-phiBin];
201 cosPhi = fwdSinCos[3-phiBin];
202 sinPhi = fwdSinCos[phiBin];
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
The JetEnergyModuleKey object provides the key for each trigger tower depending on its eta-phi coords...
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)
unsigned int crate() const
which module is this?
int m_jetElementThresholdEtSum
unsigned int et() const
return the scalar & vector sums of all JE ETs (i.e sums the energies of up to 32 contained JEs)
unsigned int module() const
return module number
int m_jetElementThresholdEtMiss
static const unsigned int m_EtBits
void getSinCos(double eta, double phi, int &cosPhi, int &sinPhi)
return cos, sin coefficients for a given JetElement
int signX() const
return signs of Ex and Ey for this module
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
std::map< int, const JetElement * > JetElementMap_t