|
ATLAS Offline Software
|
Go to the documentation of this file.
21 m_cpmEtaWidth(0.4), m_cpmEtaMax(2.8),
22 m_cpFPGAPhiWidth(
M_PI/16.0), m_cpEtaMax(2.5), m_debug(false)
33 unsigned int quad=phiQuadrant( Coord.
phi() );
41 return ( phiQuadrant(
coord.phi()) );
48 return ( phiQuadrant(
coord.phi()) );
53 if ( cpCoordIsValid(
coord) ) {
56 double eta=
coord.eta();
57 unsigned int cpm =
static_cast<unsigned int>( (eta+m_cpmEtaMax)/m_cpmEtaWidth )+1;
69 return static_cast<unsigned int>(jemKey.
jem(
coord));
75 if ( cpCoordIsValid(
coord) ) {
76 double phi=
coord.phi();
78 double temp = phi/m_cpFPGAPhiWidth;
80 return ( (
static_cast<unsigned int>(temp))%8);
93 m_roiLocalMap[0][0]=0;
94 m_roiLocalMap[0][1]=1;
95 m_roiLocalMap[0][2]=4;
96 m_roiLocalMap[0][3]=5;
97 m_roiLocalMap[1][0]=2;
98 m_roiLocalMap[1][1]=3;
99 m_roiLocalMap[1][2]=6;
100 m_roiLocalMap[1][3]=7;
105 if ( cpCoordIsValid(
coord) ) {
106 double phi=
coord.phi();
107 double eta=
coord.eta();
110 unsigned int temp =
static_cast<unsigned int>( (phi/m_cpFPGAPhiWidth)*2);
112 unsigned int iLocalPhi= temp%2;
117 temp=
static_cast<unsigned int>( (eta+2.8)/0.1 );
120 unsigned int iLocalEta = temp%4;
121 return m_roiLocalMap[iLocalPhi][iLocalEta];
129 double eta=
coord.eta();
130 if ( (eta>=-m_cpEtaMax) && (eta <=m_cpEtaMax) )
return true;
131 std::cerr <<
"CoordToHardware::cpCoordIsValid: Coordinate outside permitted range of eta = "
132 <<-m_cpEtaMax<<
" to "<<m_cpEtaMax<<std::endl;
141 unsigned int crate =jepCrate(
coord);
142 unsigned int jem=jepModule(
coord);
143 unsigned int PJ=jepLocalCoordinate(
coord);
146 if ((crate==m_error)||(jem==m_error)||(PJ==m_error)){
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;
165 double temp = phi/(
M_PI/2);
166 return static_cast<unsigned int>(temp);
175 unsigned int crate =cpCrate(
coord);
176 unsigned int cpm=cpModule(
coord);
177 unsigned int fpga=cpModuleFPGA(
coord);
178 unsigned int lc=cpModuleLocalRoI(
coord);
181 if ((crate==m_error)||(cpm==m_error)||(fpga==m_error)||(
lc==m_error)){
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;
207 const double phi = cpPhiOverlap(
coord);
208 return (phi ==
coord.phi()) ? m_error
215 const double phi = cpPhiOverlap(
coord);
216 return (phi ==
coord.phi()) ? m_error
223 const double phi = jepPhiOverlap(
coord);
224 return (phi ==
coord.phi()) ? m_error
231 const double phi = jepPhiOverlap(
coord);
232 return (phi ==
coord.phi()) ? m_error
239 double phi =
coord.phi();
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;
257 double phi =
coord.phi();
258 const double eta =
coord.eta();
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;
unsigned int cpModuleOverlap(const Coordinate &coord)
return ID of CP module for overlap coord
unsigned int cpCoordinateWord(const Coordinate &coord)
return CP (Cluster Processing) hardware coordinate word for this coordinate.
The JetEnergyModuleKey object provides the key for each trigger tower depending on its eta-phi coords...
double phi() const
return phi
double jepPhiOverlap(const Coordinate &coord) const
returns a phi in core area for overlap jet elements
unsigned int cpModuleFPGA(const Coordinate &coord)
returns ID [0-7] of the CP FPGA.
unsigned int col(const Coordinate &coord)
return row of passed coordinate
unsigned int phiQuadrant(const double phi) const
returns the quadrant number associated with the phi coordinate,
unsigned int jepCoordinateWord(const Coordinate &coord)
return JEP (Jet Energy Processing) hardware coordinate word for this coordinate.
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
Coordinate class declaration.
unsigned int jem(const Coordinate &coord) const
returns ID of JEP module (i.e.
bool cpCoordIsValid(const Coordinate &coord) const
returns false if Coord is outside permitted region
unsigned int cpModule(const Coordinate &coord)
return ID of CP module.
unsigned int jepModuleOverlap(const Coordinate &coord)
returns ID of JEP module (i.e.
void fillRoILocalMap()
No descriptions.
unsigned int jepModule(const Coordinate &coord)
returns ID of JEP module (i.e.
unsigned int cpRoIROD(const Coordinate &coord)
returns Module ID of CP RoI ROD
unsigned int cpCrate(const Coordinate &coord)
returns crate ID covering that coord.
unsigned int cpCrateOverlap(const Coordinate &coord)
returns crate ID covering that overlap coord.
unsigned int jepLocalCoordinate(const Coordinate &coord)
returns the roi's local coord, in the form of a 5b word.
unsigned int jepCrate(const Coordinate &Coord)
returns ID of JEP Crate that covers this coordinate
unsigned int jepCrateOverlap(const Coordinate &coord)
returns ID of JEP Crate that covers this overlap coordinate
unsigned int row(const Coordinate &coord) const
returns the phi row of a coord within the JEM that contains it.