37 if (
m_debugModuleKey) std::cout <<
"JetEnergyModuleKey: m_debugModuleKey output turned on...."<<std::endl;
45 return key(jetElement->
phi(), jetElement->
eta());
52 double eta = ((
module%8)+0.5)*TrigT1CaloDefs::jemEtaSize - 3.2;
53 int quadrant = crate + ((module>7) ? 2 : 0);
60 std::vector<unsigned int> keys;
63 if (crate > 1 || module > 15)
return keys;
66 std::vector<Coordinate> coords =
jeCoords(crate, module);
71 keys.push_back(
get.jeKey(c));
80 std::vector<Coordinate> coords;
83 if (crate > 1 || module > 15)
return coords;
91 int top = (
module < 8 ? 0 : 1 );
97 if ( (module%8) > 0) {
98 etaStart = (
module%8)*TrigT1CaloDefs::jemEtaSize - 3.1;
110 while (cth.
jepModule( startCol ) == module) {
112 while (cth.
jepCrate( next ) == crate) {
113 coords.push_back(next);
114 next =
get.upPhi(next);
116 startCol =
get.rightEta(startCol);
128 unsigned int rowsPerJEM = 8u;
129 int rowNum=
static_cast<int>(
phi/rowHeight);
130 rowNum=rowNum%rowsPerJEM;
148 int etaBin=0;
unsigned int phiBin=0;
153 std::cerr <<
"ERROR!!! JetEnergyModuleKey::rowPhiCoord exceeds allowed range. Row, "<<rowNum
154 <<
" will be set to zero"<<std::endl;
158 phi+=
static_cast<double>( rowNum )*0.2+0.1;
161 if ( (
phi<(jemCoord.
phi()-0.8))||(
phi>(jemCoord.
phi()+0.8) ) ){
162 std::cerr <<
"ERROR!!! JetEnergyModuleKey::rowPhiCoord phi of row is "<<
phi
163 <<
" in a JEM at ("<<jemCoord.
phi()<<
", "<<jemCoord.
eta()<<
")"<<std::endl;
188 double absEta=fabs(
coord.eta());
189 if (absEta<=2.4)
return MidJEM;
192 std::cerr <<
"JetEnergyModuleKey::region ... Unknown region!"<<std::endl
193 <<
"Coordinate is ("<<
coord.phi()<<
", "<<
coord.eta()<<
")"
202 unsigned int iPhiSize=16 ;
203 phiBin=( iCoord->
phi() )/(iPhiSize);
207 etaBin=(etaBin < -4 ? -4 : etaBin);
208 etaBin=(etaBin > 4 ? 4 : etaBin);
223 std::cerr <<
"JetEnergyModuleKey::etaColumn UNKNOWN REGION"<<std::endl;
230 double min=3.2;
double jemEtaWidth=0.8;
234 double temp = (
coord.eta()+
min)/jemEtaWidth;
235 int jem =
static_cast<int>(temp);
239 jem+=(8*crateModifier);
240 return static_cast<unsigned int>(
jem);
248 int abs_ieta=abs(iCoord->
eta() );
249 int sign=( iCoord->
eta() )/abs_ieta;
251 int etaBin=0;
unsigned int phiBin=0;
256 double centralEta=0.0;
257 if ((etaBin>-4)&&(etaBin<4)){
261 centralEta=3.65*
sign;
264 std::cout <<
"JetEnergyModuleKey: start calcTrigBin"<<std::endl;
265 std::cout <<
"phi, eta : ("<<
m_phi<<
", "<<
m_eta<<
")"<<std::endl;
266 std::cout <<
"iphi, ieta : ("<<( iCoord->
phi() )<<
", "<<( iCoord->
eta() )<<
")"<<std::endl;
267 std::cout <<
"abs_ieta : ("<<abs_ieta<<
" and sign : "<<
sign<<std::endl;
268 std::cout <<
"central : ("<<centralPhi<<
", "<<centralEta<<
")"
269 <<
"bin : ("<<phiBin<<
","<<etaBin<<
")"<<std::endl;
273 if (
m_debugModuleKey) std::cout <<
" JetEnergyModuleKey : created coord "<<(*centralCoords)<<std::endl;
274 return new BinAndCoord(phiBin,etaBin,centralCoords);
280 double JEMEtaSize=0.8;
283 double etaMin=(etaBin*JEMEtaSize);
285 double temp =(
coord.eta()-etaMin)/etaWidth;
288 colNum=(colNum < 0 ? 0 : colNum);
289 colNum=(colNum > 3 ? 3 : colNum);
356 unsigned int quad =
static_cast<unsigned int>(temp);
357 quad=(quad > 3 ? 0 : quad);
359 return static_cast<unsigned int>(quad);
Used to pass data between the methods of the Key Classes: Returns the Eta and Phi bins,...
returns the trigger hardware components associated with a given Coordinate
unsigned int jepModule(const Coordinate &coord)
returns ID of JEP module (i.e.
unsigned int jepCrate(const Coordinate &Coord)
returns ID of JEP Crate that covers this coordinate
Coordinate class declaration.
double phi() const
return phi
double eta() const
return eta
Used by Key Classes, returns and integer coorginate for the bin Eta-Phi.
int phi() const
return phi
int eta() const
return eta
The JetElementKey object provides the key for each JetElement depending on its eta,...
unsigned int col(const Coordinate &coord)
return row of passed coordinate
BinAndCoord * calculateTriggerBin(ICoordinate *iCoord)
converts integer phi, eta coordinates to phi, eta trigger bins, and central coords
double dPhi(const Coordinate &coord) const
height
virtual ~JetEnergyModuleKey()
void setBins(ICoordinate *iCoord, unsigned int &phiBin, int &etaBin)
sets the eta and phi bins
unsigned int phiQuadrant(const double phi) const
returns the quadrant number associated with the phi coordinate, 0 - 90 = 0 90 - 180 = 1 180-270 = 2 2...
std::vector< unsigned int > jeKeys(unsigned int crate, unsigned int module)
calculates keys of all JetElements in given crate and module
unsigned int jemKey(const xAOD::JetElement *jetElement)
returns the key of the passed Coordinate
unsigned int midJEMEtaCol(const Coordinate &coord) const
No descriptions.
unsigned int jem(const Coordinate &coord) const
returns ID of JEP module (i.e.
unsigned int leftEndJEMEtaCol(const Coordinate &coord) const
returns eta row of JEMs 0, or 8
JetEnergyModuleKey()
constructs a JetEnergyModuleKey object
std::vector< Coordinate > jeCoords(unsigned int crate, unsigned int module)
returns coordinates of all JetElements in given crate and module
bool m_debugModuleKey
set to true to turn debugging info on
unsigned int row(const Coordinate &coord) const
returns the phi row of a coord within the JEM that contains it.
double rowPhiCoord(unsigned int row, const Coordinate &jemCoord)
returns the phi coord of the row of the JEM at the coordinates passed
unsigned int rightEndJEMEtaCol(const Coordinate &coord) const
returns eta row of JEMs 7 or 15
double dEta(const Coordinate &coord) const
width
JEMRegion region(const Coordinate &coord) const
region
virtual double eta() const
returns the centre of the TT at eta_coord:
virtual int sign(int temp) const
returns -1 if temp is -ve and +1 if it is +ve.
int sharpRound2(int a, int b) const
divides a/b and returns a number as follows (where +b means +ve b): if 0
virtual double phi() const
returns phi coordinate of centre of relevant trigger tower.
int sharpRound(double a) const
rounds number as follows (-1.0 to 0.0) -> -1, (0.0 to 1.0) -> 0, (1.0 to 2.0)->1 etc.
ICoordinate * convertCoordsToIntegers(double phi, double eta)
converts the coordinates and corrects for overflows etc.
unsigned int key(double phi, double eta)
calculates a map key from passed phi, eta coordinates
Coordinate coord() const
return central coords of current key value.
KeyUtilities()
the constructor is protected so a user can never make a KeyUtilities object
double m_phi
phi coordinate of key
double m_eta
eta coordinate of key
static const double Region5EtaCentre
static const double RegionERROREtaCentre
static const double jemPhiSize
static const double jemEtaSize
static const double Region0Height
float phi() const
get phi (note that for L1Calo phi runs from 0 to 2pi)
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...
JetElement_v2 JetElement
Define the latest version of the JetElement class.