69 return static_cast<unsigned int>(jemKey.
jem(
coord));
80 return ( (
static_cast<unsigned int>(temp))%8);
112 unsigned int iLocalPhi= temp%2;
117 temp=
static_cast<unsigned int>( (
eta+2.8)/0.1 );
120 unsigned int iLocalEta = temp%4;
131 std::cerr <<
"CoordToHardware::cpCoordIsValid: Coordinate outside permitted range of eta = "
147 std::cerr <<
"CPCoordinateWord ERROR: "<< std::endl;
150 word = (word<<4) + jem;
151 word = (word<<5) + PJ;
153 if (
m_debug) std::cout <<
" Coords set to ("<<
coord.phi()<<
", "<<
coord.eta()<<
") giving : "<<word
154 <<
" from crate "<<crate
155 <<
" JEM "<<jem<<
" PJ : "<<PJ<< std::endl;
166 return static_cast<unsigned int>(temp);
182 std::cerr <<
"CPCoordinateWord ERROR: "<< std::endl;
185 word = (word<<4) + cpm;
186 word = (word<<3) + fpga;
187 word = (word<<3) + lc;
189 if (
m_debug) std::cout <<
" Coords set to ("<<
coord.phi()<<
", "<<
coord.eta()<<
") giving : "<<word
190 <<
" from crate "<<crate
191 <<
" CPM "<<cpm<<
" fpga : "<<fpga<<
" LC : "<<lc<< std::endl;
199 unsigned int frame = 4*(col>>1) + (row>>1);
200 unsigned int rl = 2*(row%2) + (col%2);
201 return (frame<<2)+rl;
240 const double twoPi = 2.*
M_PI;
241 const double piByTwo =
M_PI/2.;
242 const double twoPhiBins =
M_PI/16.;
243 const double phiLoc = std::fmod(
phi, piByTwo);
244 if (phiLoc < twoPhiBins) {
246 if (
phi < 0.)
phi += twoPi;
247 }
else if (phiLoc > piByTwo - twoPhiBins) {
249 if (
phi >= twoPi)
phi -= twoPi;
259 const bool fcal =
eta < -3.2 ||
eta > 3.2;
260 const double twoPi = 2.*
M_PI;
261 const double piByTwo =
M_PI/2.;
262 const double twoPhiBins =
M_PI/8.;
263 const double onePhiBin = (fcal) ? twoPhiBins : twoPhiBins/2.;
264 const double phiLoc = std::fmod(
phi, piByTwo);
265 if (phiLoc < twoPhiBins) {
267 if (
phi < 0.)
phi += twoPi;
268 }
else if (phiLoc > piByTwo - onePhiBin) {
270 if (
phi >= twoPi)
phi -= twoPi;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
unsigned int cpModuleOverlap(const Coordinate &coord)
return ID of CP module for overlap coord
double m_cpmEtaWidth
eta width of CP modules (CPMs)
void fillRoILocalMap()
No descriptions.
unsigned int jepModule(const Coordinate &coord)
returns ID of JEP module (i.e.
double m_cpEtaMax
contains the maximum permissable eta for CP system.
unsigned int phiQuadrant(const double phi) const
returns the quadrant number associated with the phi coordinate,
double jepPhiOverlap(const Coordinate &coord) const
returns a phi in core area for overlap jet elements
unsigned int cpRoIROD(const Coordinate &coord)
returns Module ID of CP RoI ROD
unsigned int jepCoordinateWord(const Coordinate &coord)
return JEP (Jet Energy Processing) hardware coordinate word for this coordinate.
unsigned int jepLocalCoordinate(const Coordinate &coord)
returns the roi's local coord, in the form of a 5b word.
unsigned int cpModuleFPGA(const Coordinate &coord)
returns ID [0-7] of the CP FPGA.
unsigned int cpModule(const Coordinate &coord)
return ID of CP module.
unsigned int cpModuleLocalRoI(const Coordinate &coord)
returns local RoI coordinate within FPGA
double cpPhiOverlap(const Coordinate &coord) const
returns a phi in core area for overlap CPM towers
bool cpCoordIsValid(const Coordinate &coord) const
returns false if Coord is outside permitted region
unsigned int jepCrate(const Coordinate &Coord)
returns ID of JEP Crate that covers this coordinate
double m_cpFPGAPhiWidth
phi width of CP FPGAs
unsigned int cpCoordinateWord(const Coordinate &coord)
return CP (Cluster Processing) hardware coordinate word for this coordinate.
unsigned int m_roiLocalMap[2][4]
width of JEMs
double m_cpmEtaMax
extreme value of eta, covered by CPMs.
unsigned int cpCrateOverlap(const Coordinate &coord)
returns crate ID covering that overlap coord.
unsigned int jepCrateOverlap(const Coordinate &coord)
returns ID of JEP Crate that covers this overlap coordinate
static const unsigned int m_error
returned value in the case of an invalid Coordinate error
unsigned int cpCrate(const Coordinate &coord)
returns crate ID covering that coord.
unsigned int jepModuleOverlap(const Coordinate &coord)
returns ID of JEP module (i.e.
Coordinate class declaration.
double phi() const
return phi
The JetEnergyModuleKey object provides the key for each trigger tower depending on its eta-phi coords...
unsigned int col(const Coordinate &coord)
return row of passed coordinate
unsigned int jem(const Coordinate &coord) const
returns ID of JEP module (i.e.
unsigned int row(const Coordinate &coord) const
returns the phi row of a coord within the JEM that contains it.