ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::JetInputKey Class Reference

The JetInputKey object provides the key for each JetElement depending on its eta,phi coords (JetElementKey differs from JetInputKey in that ElementKey has 0.4 FCAL granularity, while InputKey has 0.2 FCAL granularity). More...

#include <JetInputKey.h>

Inheritance diagram for LVL1::JetInputKey:
Collaboration diagram for LVL1::JetInputKey:

Public Types

enum  JERegion {
  Barrel =0 , EndBarrel =1 , EndCap1 =2 , EndCap2 =3 ,
  EndCap3 =4 , FCAL =5
}

Public Member Functions

 JetInputKey (double phi, double eta)
 takes phi and eta and constructs a JetInputKey object which can return the key for this coord
 JetInputKey (const Coordinate coord)
 constructs a JetInputKey object
 JetInputKey ()
 constructs a JetInputKey object
virtual unsigned int jeKey (const xAOD::TriggerTower &tower)
 returns key of passed tower
virtual unsigned int jeKey (const xAOD::JetElement &jetElement)
 returns key of passed jetelement
virtual unsigned int jeKey (const double phi, const double eta)
 returns the key of the passed coords
virtual unsigned int jeKey (const Coordinate coord)
 returns the key of the passed Coordinate
unsigned int leftEtaKey (const double phi, const double eta)
 returns key of JE in +ve eta dir.
unsigned int rightEtaKey (const double phi, const double eta)
 returns key of JE in -ve eta dir.
unsigned int upPhiKey (const double phi, const double eta)
 returns key of next JE in +ve phi dir.
unsigned int downPhiKey (const double phi, const double eta)
 returns key of next JE in -ve phi dir.
Coordinate getCentre (const double phi, const double eta)
 returns the central coordinate of the JE which contains the passed coord
Coordinate getCentre (const Coordinate coord)
 returns the central coordinate of the JE which contains the passed coord
Coordinate rightEta (const double phi, const double eta)
 Functions for finding coordinates of neighbouring JEs.
Coordinate rightEta (const Coordinate coord)
 returns eta coord of JE in +ve eta dir.
Coordinate leftEta (const double phi, const double eta)
 returns key of JE in -ve eta dir.
Coordinate leftEta (const Coordinate coord)
 returns key of JE in -ve eta dir.
Coordinate downPhi (const double phi, const double eta)
 returns coord of next JE in -ve phi dir.
Coordinate downPhi (const Coordinate coord)
 returns coord of next JE in -ve phi dir.
Coordinate upPhi (const double phi, const double eta)
 returns coord of next JE in +ve phi dir.
Coordinate upPhi (const Coordinate coord)
 returns coord of next JE in +ve phi dir.
Coordinate upperLeft (const double phi, const double eta)
Coordinate upperLeft (const Coordinate coord)
Coordinate upperRight (const double phi, const double eta)
Coordinate upperRight (const Coordinate coord)
Coordinate lowerLeft (const double phi, const double eta)
Coordinate lowerLeft (const Coordinate coord)
Coordinate lowerRight (const double phi, const double eta)
Coordinate lowerRight (const Coordinate coord)
double dPhi (const double phi, const double eta) const
 return height of JE
double dPhi () const
 return height of JE
virtual double dPhi (const Coordinate &coord) const override
 return height of JE
double dEta (const double phi, const double eta) const
 return width of JE
double dEta () const
 return width of JE
virtual double dEta (const Coordinate &coord) const override
 return width of JE
unsigned int region (double eta) const
 returns region number at eta, where region is:
JERegion jeRegion (const Coordinate &coord) const
bool isFCAL (double eta) const
 returns TRUE if this coordinate is in the FCAL
virtual double eta () const
 returns the centre of the TT at eta_coord:
virtual double phi () const
 returns phi coordinate of centre of relevant trigger tower.
unsigned int key (double phi, double eta)
 calculates a map key from passed phi, eta coordinates
unsigned int key (const Coordinate &coord)
 returns the key of the passed Coordinate
Coordinate coord () const
 return central coords of current key value.

Protected Member Functions

void setupRegionData ()
 get region data from TrigT1CaloDefs and put in more useful format - vectors
void setupJetRegionData ()
 Does same as setupRegionData, except in FCAL where uses phi granularity appropriate for the jet trigger.
ICoordinate convertCoordsToIntegers (double phi, double eta)
 converts the coordinates and corrects for overflows etc.
virtual int sign (int temp) const
 returns -1 if temp is -ve and +1 if it is +ve.
virtual int sign (double temp) const
 returns -1 if temp is -ve and +1 if it is +ve.
int round (double a) const
 rounds number to nearest whole number
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.
int sharpRound2 (int a, int b) const
 divides a/b and returns a number as follows (where +b means +ve b): if 0
void setupThisKeyValues ()

Protected Attributes

int m_iphi
 integer phi coord
int m_ieta
 integer eta coord
double m_eta
 eta coordinate of key
double m_phi
 phi coordinate of key
int m_phiBin
 phi bin
int m_etaBin
 eta bin
double m_centralPhi
 this is the coordinate of the centre of the relevant trigger tower.
double m_centralEta
 this is the coordinate of the centre of the relevant trigger tower.
bool m_debug
 turns DEBUG code on and off

Private Member Functions

virtual BinAndCoord calculateTriggerBin (const ICoordinate &iCoord) override
 converts integer phi, eta coordinates to phi, eta trigger bins.
void analCoordChecking (const Coordinate &coord)
 this is a bit over the top, but it looks to see if the calculated coordinate matches a coordinate centre that JetElementKeyBase would return.

Private Attributes

bool m_debugKeyBase
 set to true to turn debugging info on
std::vector< double > m_regionEtaCentre
 holds central coords of JEs in regions: Region Eta 0 <2.2 1 2.2-2.4 2 2.4-2.7 3 2.7-2.9 4 2.9-3.2 5 3.2-4.9
std::vector< double > m_regionWidth
 holds width of JEs in regions:
std::vector< double > m_regionHeight
 holds height of JEs in regions:

Detailed Description

The JetInputKey object provides the key for each JetElement depending on its eta,phi coords (JetElementKey differs from JetInputKey in that ElementKey has 0.4 FCAL granularity, while InputKey has 0.2 FCAL granularity).

As 2 implementations are required for the Jet and Energy triggers, differing only in the FCAL granularity, we solve this problem by inheritance. Thus JetInputKey now inherits from JEKey (which is essentially the original JetElementKey, & itself inherits from KeyUtilities)

Definition at line 42 of file JetInputKey.h.

Member Enumeration Documentation

◆ JERegion

Enumerator
Barrel 
EndBarrel 
EndCap1 
EndCap2 
EndCap3 
FCAL 

Definition at line 51 of file JetElementKeyBase.h.

Constructor & Destructor Documentation

◆ JetInputKey() [1/3]

LVL1::JetInputKey::JetInputKey ( double phi,
double eta )

takes phi and eta and constructs a JetInputKey object which can return the key for this coord

Definition at line 26 of file JetInputKey.cxx.

27{
30}
void setupJetRegionData()
Does same as setupRegionData, except in FCAL where uses phi granularity appropriate for the jet trigg...
JetElementKeyBase()
constructs a JetElementKeyBase object
virtual double eta() const
returns the centre of the TT at eta_coord:
virtual double phi() const
returns phi coordinate of centre of relevant trigger tower.

◆ JetInputKey() [2/3]

LVL1::JetInputKey::JetInputKey ( const Coordinate coord)

constructs a JetInputKey object

Definition at line 40 of file JetInputKey.cxx.

40 : JetElementKeyBase(coord.phi(),coord.eta())
41{
44}
Coordinate coord() const
return central coords of current key value.

◆ JetInputKey() [3/3]

LVL1::JetInputKey::JetInputKey ( )

constructs a JetInputKey object

Definition at line 33 of file JetInputKey.cxx.

Member Function Documentation

◆ analCoordChecking()

void LVL1::JetElementKeyBase::analCoordChecking ( const Coordinate & coord)
privateinherited

this is a bit over the top, but it looks to see if the calculated coordinate matches a coordinate centre that JetElementKeyBase would return.

It doesn't return any errors or anything as it's purely being used in tests external to Athena

Definition at line 498 of file JetElementKeyBase.cxx.

498 {
499 Coordinate centre( getCentre( coord.phi(), coord.eta() ) );
500 double allowedSpread=0.0002;// I don't mind a bit of a rounding error....
501 if ( (coord.phi()<(centre.phi()-allowedSpread))||(coord.phi()>(centre.phi()+allowedSpread) ) )
502 std::cout << "PHI ERROR: "<< coord.phi() <<"!="<<centre.phi()<<std::endl;
503 if ( (coord.eta()<(centre.eta()-allowedSpread))||(coord.eta()>(centre.eta()+allowedSpread) ) )
504 std::cout << "ETA ERROR: "<< coord.eta() <<"!="<<centre.eta()<<std::endl;
505 return;
506}
Coordinate getCentre(const double phi, const double eta)
returns the central coordinate of the JE which contains the passed coord

◆ calculateTriggerBin()

BinAndCoord LVL1::JetElementKeyBase::calculateTriggerBin ( const ICoordinate & iCoord)
overrideprivatevirtualinherited

converts integer phi, eta coordinates to phi, eta trigger bins.

Returns coordinates of centre of JEs

Implements LVL1::KeyUtilities.

Definition at line 70 of file JetElementKeyBase.cxx.

70 {
71
72 int iphi=iCoord.phi();
73 int ieta=iCoord.eta();
74 double centralPhi=0.0;
75 double centralEta=0.0;
76 int phiBin=0; int etaBin=0;
77 int abs_ieta=abs(ieta);
78 int sign=ieta/abs_ieta;
79
80 if (m_debugKeyBase){
81 std::cout << "JetElementKeyBase: start calculateTriggerBin"<<std::endl;
82 //std::cout << "phi, eta : ("<<m_phi<<", "<<m_eta<<")"<<std::endl;
83 std::cout << "iphi, ieta : ("<<iphi<<", "<<ieta<<")"<<std::endl;
84 std::cout << "abs_ieta : ("<<abs_ieta<<") and sign : "<<sign<<std::endl;
85 }
86
88
89 // okay this JE has been deliberately labelled as a wrong 'un.
90 // so basically ignore it.
91 phiBin=0;
92 centralPhi=0.0;
93 etaBin=20*sign;
95
96 }else{
97
98 int region;
99 if ( abs_ieta<23 ) {
100 region = 0;
101 etaBin=(ieta+1)/2;
102 }
103 else if ( abs_ieta<25 ) { // can't see why this region != region 0??
104 region = 1;
105 etaBin=(ieta+1)/2;
106 }
107 else if ( abs_ieta<28 ) { // remaining regions only have 1 eta bin, varying sizes
108 region = 2;
109 etaBin=13*sign;
110 }
111 else if ( abs_ieta<30 ) {
112 region = 3;
113 etaBin=14*sign;
114 }
115 else if ( abs_ieta<=32 ) {
116 region = 4;
117 etaBin=15*sign;
118 }
119 else {
120 region = 5;
121 etaBin=16*sign;
122 }
123
124 // Get centre of JE in eta and phi
125 if (region == 0) {
126 centralEta=(static_cast<double>(etaBin)*0.2)-0.1;
127 }
128 else {
129 centralEta=m_regionEtaCentre[region]*sign;
130 }
131
132 // Phi bin size depends on region - this should take care of that
133 int nTTperJE = static_cast<int>( 0.5 + (m_regionHeight[region]/(M_PI/32)) );
134 phiBin=iphi/nTTperJE;
135 centralPhi=(static_cast<double>(phiBin)+0.5)*m_regionHeight[region];
136
137 }
138
139 if (m_debugKeyBase) std::cout << "central : ("<<centralPhi<<", "<<centralEta<<")"
140 << " bin : ("<<phiBin<<","<<etaBin<<")"<<std::endl;
141 return BinAndCoord(phiBin,etaBin,Coordinate(centralPhi, centralEta));
142}
#define M_PI
bool m_debugKeyBase
set to true to turn debugging info on
std::vector< double > m_regionHeight
holds height of JEs in regions:
unsigned int region(double eta) const
returns region number at eta, where region is:
std::vector< double > m_regionEtaCentre
holds central coords of JEs in regions: Region Eta 0 <2.2 1 2.2-2.4 2 2.4-2.7 3 2....
virtual int sign(int temp) const
returns -1 if temp is -ve and +1 if it is +ve.
static const double RegionERROREtaCentre
static const int RegionERROREtaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin

◆ convertCoordsToIntegers()

ICoordinate LVL1::KeyUtilities::convertCoordsToIntegers ( double phi,
double eta )
protectedinherited

converts the coordinates and corrects for overflows etc.

For instance, if phi is negative this routine converts to the equivalent positive position.

For instance, if phi is negative this routine converts to the equivalent positive position. *todo tidy up a bit.

Definition at line 103 of file KeyUtilities.cxx.

103 {
104
105 double phiBinWidth=((2*M_PI)/64.0);
106 // there are a maximum of 64 cells in the phi direction
107 // stretching from 0 to ~2*PI.
108 if (m_debug) std::cout << "KU : (phi, eta) ("<<phi<<","<<eta<<")"<<std::endl;
109 int iphi=sharpRound(phi/phiBinWidth);
110 int ieta=0;
111
112 // Now check that m_iphi is between 0 and 64.
113 iphi = iphi%64;
114 if (iphi<0) iphi = 64+iphi;
115
116 // Make m_ieta symmetrical:
117 // o no cell at m_ieta=0
118 // o first cells at +-1
119 // o last cells at about +- 50
120 // this gives us a more useful numerical symmetry.
121
122 // So to get integer value we do:
123 int temp_sign=sign(eta);
124 double temp_abs=eta*temp_sign;
125
126 double temp_double=(temp_abs*10.0+1.0)*temp_sign;
127 if (m_debug) std::cout << "KU : temp_abs, temp_sign, temp_double : "<<temp_abs<<","<<temp_sign<<","<<temp_double<<std::endl;
128// if (m_eta>=0.0){
129// temp_double=m_eta*10.0+1.0;
130// }else{
131// temp_double=m_eta*10.0-1.0;
132// }
133
134 ieta=static_cast<int>(temp_double);
135 if (m_debug) std::cout << "KU : (iphi, ieta) ("<<iphi<<","<<ieta<<")"<<std::endl;
136 return ICoordinate(iphi, ieta, eta);
137}
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.
bool m_debug
turns DEBUG code on and off

◆ coord()

LVL1::Coordinate LVL1::KeyUtilities::coord ( ) const
inherited

return central coords of current key value.

Definition at line 194 of file KeyUtilities.cxx.

194 {
195 return Coordinate(m_centralPhi,m_centralEta);
196}
double m_centralEta
this is the coordinate of the centre of the relevant trigger tower.
double m_centralPhi
this is the coordinate of the centre of the relevant trigger tower.

◆ dEta() [1/3]

double LVL1::JetElementKeyBase::dEta ( ) const
inherited

return width of JE

return width of this JE

Definition at line 379 of file JetElementKeyBase.cxx.

379 {
380 return dEta(m_phi,m_eta);
381}
double dEta() const
return width of JE
double m_phi
phi coordinate of key
double m_eta
eta coordinate of key

◆ dEta() [2/3]

double LVL1::JetElementKeyBase::dEta ( const Coordinate & coord) const
overridevirtualinherited

return width of JE

Implements LVL1::KeyUtilities.

Definition at line 384 of file JetElementKeyBase.cxx.

384 {
385 return dEta(coord.phi(), coord.eta() );
386}

◆ dEta() [3/3]

double LVL1::JetElementKeyBase::dEta ( const double phi,
const double eta ) const
inherited

return width of JE

return width of JE at (phi,eta)

Definition at line 371 of file JetElementKeyBase.cxx.

371 {
372 unsigned int reg=region(eta);
373 if (reg==TrigT1CaloDefs::RegionError) return 0.0;
374
375 return m_regionWidth[reg];
376}
std::vector< double > m_regionWidth
holds width of JEs in regions:
static const unsigned int RegionError

◆ downPhi() [1/2]

Coordinate LVL1::JetElementKeyBase::downPhi ( const Coordinate coord)
inherited

returns coord of next JE in -ve phi dir.

Definition at line 297 of file JetElementKeyBase.cxx.

297 {
298 return downPhi(coord.phi(), coord.eta());
299}
Coordinate downPhi(const double phi, const double eta)
returns coord of next JE in -ve phi dir.

◆ downPhi() [2/2]

Coordinate LVL1::JetElementKeyBase::downPhi ( const double phi,
const double eta )
inherited

returns coord of next JE in -ve phi dir.

Definition at line 281 of file JetElementKeyBase.cxx.

281 {
282 Coordinate centre=getCentre(phi,eta);
283 double temp_phi=centre.phi();
284 unsigned int reg=region(centre.eta());
286// std::cout << "Out of bounds error in JetElementKeyBase::downPhi"<<std::endl;
287 temp_phi=0.0;
288 }else{
289 temp_phi-= m_regionHeight[reg];
290 }
291 centre.setCoords(temp_phi,centre.eta());
292 analCoordChecking(centre);
293 return centre;
294}
void analCoordChecking(const Coordinate &coord)
this is a bit over the top, but it looks to see if the calculated coordinate matches a coordinate cen...

◆ downPhiKey()

unsigned int LVL1::JetElementKeyBase::downPhiKey ( const double phi,
const double eta )
inherited

returns key of next JE in -ve phi dir.

Definition at line 303 of file JetElementKeyBase.cxx.

303 {
304 Coordinate coord=downPhi(phi,eta);
305 return jeKey(coord.phi(),coord.eta());
306}
virtual unsigned int jeKey(const xAOD::TriggerTower &tower)
returns key of passed tower

◆ dPhi() [1/3]

double LVL1::JetElementKeyBase::dPhi ( ) const
inherited

return height of JE

return height of this JE

Definition at line 361 of file JetElementKeyBase.cxx.

361 {
362 return dPhi(m_phi,m_eta);
363}
double dPhi() const
return height of JE

◆ dPhi() [2/3]

double LVL1::JetElementKeyBase::dPhi ( const Coordinate & coord) const
overridevirtualinherited

return height of JE

Implements LVL1::KeyUtilities.

Definition at line 366 of file JetElementKeyBase.cxx.

366 {
367 return dPhi(coord.phi(), coord.eta() );
368}

◆ dPhi() [3/3]

double LVL1::JetElementKeyBase::dPhi ( const double phi,
const double eta ) const
inherited

return height of JE

return height of JE at (phi,eta)

Definition at line 353 of file JetElementKeyBase.cxx.

353 {
354 unsigned int reg=region(eta);
355
356 if (reg==TrigT1CaloDefs::RegionError) return 0.0;
357 return m_regionHeight[reg];
358}

◆ eta()

double LVL1::KeyUtilities::eta ( ) const
virtualinherited

returns the centre of the TT at eta_coord:

returns the eta coord of the centre of the relevent trigger tower

Definition at line 142 of file KeyUtilities.cxx.

142 {
143 return m_centralEta;
144}

◆ getCentre() [1/2]

Coordinate LVL1::JetElementKeyBase::getCentre ( const Coordinate coord)
inherited

returns the central coordinate of the JE which contains the passed coord

Definition at line 487 of file JetElementKeyBase.cxx.

487 {
488 Coordinate centre = getCentre( coord.phi(), coord.eta() );
489 return centre;
490}

◆ getCentre() [2/2]

Coordinate LVL1::JetElementKeyBase::getCentre ( const double phi,
const double eta )
inherited

returns the central coordinate of the JE which contains the passed coord

Definition at line 480 of file JetElementKeyBase.cxx.

480 {
481 ICoordinate iCoord = convertCoordsToIntegers(phi, eta);
482 BinAndCoord bandc = calculateTriggerBin(iCoord);
483 return bandc.coords();
484}
virtual BinAndCoord calculateTriggerBin(const ICoordinate &iCoord) override
converts integer phi, eta coordinates to phi, eta trigger bins.
ICoordinate convertCoordsToIntegers(double phi, double eta)
converts the coordinates and corrects for overflows etc.

◆ isFCAL()

bool LVL1::JetElementKeyBase::isFCAL ( double eta) const
inherited

returns TRUE if this coordinate is in the FCAL

Definition at line 421 of file JetElementKeyBase.cxx.

421 {
422 return (region(eta)==5);
423}

◆ jeKey() [1/4]

unsigned int LVL1::JetElementKeyBase::jeKey ( const Coordinate coord)
virtualinherited

returns the key of the passed Coordinate

returns trigger tower key of passed Coordinate

Definition at line 169 of file JetElementKeyBase.cxx.

169 {
170 if (m_debugKeyBase) std::cout << "JetElementKeyBase: returning key for Coord: ("<<coord.phi()<<","<<coord.eta()<<")"<<std::endl;
171 return key(coord.phi(), coord.eta());
172}
unsigned int key(double phi, double eta)
calculates a map key from passed phi, eta coordinates

◆ jeKey() [2/4]

unsigned int LVL1::JetElementKeyBase::jeKey ( const double phi,
const double eta )
virtualinherited

returns the key of the passed coords

returns trigger tower key of passed coords

Definition at line 163 of file JetElementKeyBase.cxx.

163 {
164 if (m_debugKeyBase) std::cout << "JetElementKeyBase: returning key for coords ("<<phi<<","<<eta<<")"<<std::endl;
165 return key(phi, eta);
166}

◆ jeKey() [3/4]

unsigned int LVL1::JetElementKeyBase::jeKey ( const xAOD::JetElement & jetElement)
virtualinherited

returns key of passed jetelement

returns the key of the passed tower

Definition at line 154 of file JetElementKeyBase.cxx.

154 {
155 if (m_debugKeyBase) std::cout << "JetElementKeyBase: returning key for coords ("<<jetElement.phi()<<","<<jetElement.eta()<<")"<<std::endl;
156 return key(jetElement.phi(), jetElement.eta());
157}
float phi() const
get phi (note that for L1Calo phi runs from 0 to 2pi)
float eta() const
get eta

◆ jeKey() [4/4]

unsigned int LVL1::JetElementKeyBase::jeKey ( const xAOD::TriggerTower & tower)
virtualinherited

returns key of passed tower

Definition at line 148 of file JetElementKeyBase.cxx.

148 {
149 if (m_debugKeyBase) std::cout << "JetElementKeyBase: returning key for coords ("<<tower.phi()<<","<<tower.eta()<<")"<<std::endl;
150 return key(tower.phi(), tower.eta());
151}
virtual double eta() const final
The pseudorapidity ( ) of the particle.
virtual double phi() const final
The azimuthal angle ( ) of the particle.

◆ jeRegion()

JetElementKeyBase::JERegion LVL1::JetElementKeyBase::jeRegion ( const Coordinate & coord) const
inherited

Definition at line 406 of file JetElementKeyBase.cxx.

406 {
407 // really unhappy about this. It'll go horribly wrong if anyone alters the enum.
408 // Ideally I'd like region(eta) to return an enum, and have a
409 // separate numRegion(eta) which returns ints.
410 // That will require a lot of re-writing though....
411 unsigned int reg=region(coord.eta());
412 if (reg==5) return FCAL;
413 if (reg==4) return EndCap3;
414 if (reg==3) return EndCap2;
415 if (reg==2) return EndCap1;
416 if (reg==1) return EndBarrel;
417 return Barrel;
418
419}

◆ key() [1/2]

unsigned int LVL1::KeyUtilities::key ( const Coordinate & coord)
inherited

returns the key of the passed Coordinate

returns trigger tower key of passed Coordinate

Definition at line 94 of file KeyUtilities.cxx.

94 {
95 return key(coord.phi(), coord.eta());
96}

◆ key() [2/2]

unsigned int LVL1::KeyUtilities::key ( double phi,
double eta )
inherited

calculates a map key from passed phi, eta coordinates

returns key

calculates a map key from passed phi, eta coordinates

Definition at line 77 of file KeyUtilities.cxx.

77 {
78 m_eta=eta;
79 m_phi=phi;
80 ICoordinate iCoord = convertCoordsToIntegers(m_phi, m_eta);
81 BinAndCoord bandc = calculateTriggerBin(iCoord);
82 if (m_debug) std::cout << "KU : key: got bandc "<<std::endl;
83 m_phiBin=bandc.phiBin();
84 m_etaBin=bandc.etaBin();
85 m_centralPhi=bandc.coords().phi();
86 m_centralEta=bandc.coords().eta();
87 int temp=((m_etaBin+50)<<6) + m_phiBin;
88
89 if (m_debug) std::cout << "KU : key: returning - "<<temp<<std::endl;
90 return static_cast<unsigned int>(temp);
91}
virtual BinAndCoord calculateTriggerBin(const ICoordinate &iCoord)=0
converts integer phi, eta coordinates to phi, eta trigger bins.

◆ leftEta() [1/2]

Coordinate LVL1::JetElementKeyBase::leftEta ( const Coordinate coord)
inherited

returns key of JE in -ve eta dir.

Definition at line 204 of file JetElementKeyBase.cxx.

204 {
205 return leftEta(coord.phi(), coord.eta());
206}
Coordinate leftEta(const double phi, const double eta)
returns key of JE in -ve eta dir.

◆ leftEta() [2/2]

Coordinate LVL1::JetElementKeyBase::leftEta ( const double phi,
const double eta )
inherited

returns key of JE in -ve eta dir.

Definition at line 177 of file JetElementKeyBase.cxx.

177 {
178 Coordinate centre=getCentre(phi,eta);
179 double temp_eta=centre.eta();
180
181 // look in method for definition of regions
182 unsigned int reg=region(temp_eta);
183 // suppress leftEta in -ve region 5
184 unsigned int maxRegion=5+((temp_eta>0.0)? 0:-1);
185 if ( reg==0 ){
186 temp_eta-=m_regionWidth[0];
187 }else{
188 if ((reg==TrigT1CaloDefs::RegionError)||(reg>maxRegion)) {
190 }else{
191 int sign = ((temp_eta>0.0)? 1:-1);
192 temp_eta= sign*m_regionEtaCentre[reg-sign]; }
193 }
194 // there's a complication here ... moving left can move us
195 // into a JE with a different phi height, and so phi can change.
196 // However we want to keep eta at 8.0, so reset eta afterwards.
197 Coordinate coord( getCentre(phi,temp_eta) );
198 coord.setCoords(coord.phi(), temp_eta) ;
199// analCoordChecking(coord);
200 return coord;
201}

◆ leftEtaKey()

unsigned int LVL1::JetElementKeyBase::leftEtaKey ( const double phi,
const double eta )
inherited

returns key of JE in +ve eta dir.

returns key of JE in -ve eta dir.

Definition at line 209 of file JetElementKeyBase.cxx.

209 {
210 Coordinate coord=leftEta(phi,eta);
211 return jeKey(coord.phi(),coord.eta());
212}

◆ lowerLeft() [1/2]

Coordinate LVL1::JetElementKeyBase::lowerLeft ( const Coordinate coord)
inherited

Definition at line 342 of file JetElementKeyBase.cxx.

342 {
343 Coordinate newCoord=lowerLeft(coord.phi(),coord.eta());
344 return newCoord;
345}
Coordinate lowerLeft(const double phi, const double eta)

◆ lowerLeft() [2/2]

Coordinate LVL1::JetElementKeyBase::lowerLeft ( const double phi,
const double eta )
inherited

Definition at line 320 of file JetElementKeyBase.cxx.

320 {
321 Coordinate coord=downPhi(phi,eta);
322 coord=leftEta(coord.phi(),coord.eta());
323 return coord;
324}

◆ lowerRight() [1/2]

Coordinate LVL1::JetElementKeyBase::lowerRight ( const Coordinate coord)
inherited

Definition at line 347 of file JetElementKeyBase.cxx.

347 {
348 Coordinate newCoord=lowerRight(coord.phi(),coord.eta());
349 return newCoord;
350}
Coordinate lowerRight(const double phi, const double eta)

◆ lowerRight() [2/2]

Coordinate LVL1::JetElementKeyBase::lowerRight ( const double phi,
const double eta )
inherited

Definition at line 326 of file JetElementKeyBase.cxx.

326 {
327 Coordinate coord=downPhi(phi,eta);
328 coord=rightEta(coord.phi(),coord.eta());
329 return coord;
330}
Coordinate rightEta(const double phi, const double eta)
Functions for finding coordinates of neighbouring JEs.

◆ phi()

double LVL1::KeyUtilities::phi ( ) const
virtualinherited

returns phi coordinate of centre of relevant trigger tower.

returns phi coordinate of the centre of the relevent trigger tower.

Definition at line 151 of file KeyUtilities.cxx.

151 {
152 return m_centralPhi;
153}

◆ region()

unsigned int LVL1::JetElementKeyBase::region ( double eta) const
inherited

returns region number at eta, where region is:

Definition at line 388 of file JetElementKeyBase.cxx.

388 {
389 unsigned int reg=TrigT1CaloDefs::RegionError;
390 int sign=((eta>0.0) ? 1:-1);
391 if (eta==0.0) sign=1;
392 double abs_eta=eta*sign;
393 if (abs_eta<2.2){
394 // barrel
395 reg=0;
396 }else{
397 if((abs_eta>2.2)&&(abs_eta<=2.4)) reg=1;
398 if((abs_eta>2.4)&&(abs_eta<=2.7)) reg=2;
399 if((abs_eta>2.7)&&(abs_eta<=2.9)) reg=3;
400 if((abs_eta>2.9)&&(abs_eta<=3.2)) reg=4;
401 if((abs_eta>3.2)&&(abs_eta<=4.9)) reg=5;
402 }//end if
403 return reg;
404}

◆ rightEta() [1/2]

Coordinate LVL1::JetElementKeyBase::rightEta ( const Coordinate coord)
inherited

returns eta coord of JE in +ve eta dir.

Definition at line 248 of file JetElementKeyBase.cxx.

248 {
249 return rightEta(coord.phi(), coord.eta());
250}

◆ rightEta() [2/2]

Coordinate LVL1::JetElementKeyBase::rightEta ( const double phi,
const double eta )
inherited

Functions for finding coordinates of neighbouring JEs.

returns eta coord of JE in +ve eta dir.

Definition at line 221 of file JetElementKeyBase.cxx.

221 {
222 Coordinate centre=getCentre(phi,eta);
223 double temp_eta=centre.eta();
224
225 unsigned int reg=region(temp_eta);
226 // supress rightEta in +ve region 5
227 unsigned int maxRegion=5+((temp_eta>0.0)? -1:0);
228 if ( reg==0 ){
229 temp_eta+=m_regionWidth[0];
230 }else{
231 if ((reg==TrigT1CaloDefs::RegionError)||(reg>maxRegion)) {
233 }else{
234 int sign = ((temp_eta>0.0)? 1:-1);
235 temp_eta= sign*m_regionEtaCentre[reg+sign];
236 }
237 }
238 // there's a complication here ... moving right can move us
239 // into a JE with a different phi height, and so phi can change.
240 // However we want to keep eta at 8.0, so reset eta afterwards.
241 Coordinate coord( getCentre(phi,temp_eta) );
242 coord.setCoords(coord.phi(), temp_eta) ;
243// analCoordChecking(coord);
244 return coord;
245}

◆ rightEtaKey()

unsigned int LVL1::JetElementKeyBase::rightEtaKey ( const double phi,
const double eta )
inherited

returns key of JE in -ve eta dir.

returns key of JE in +ve eta dir.

Definition at line 215 of file JetElementKeyBase.cxx.

215 {
216 Coordinate coord=rightEta(phi,eta);
217 return jeKey(coord.phi(),coord.eta());
218}

◆ round()

int LVL1::KeyUtilities::round ( double a) const
protectedinherited

rounds number to nearest whole number

Definition at line 175 of file KeyUtilities.cxx.

175 {
176 return static_cast<int>(a<0.0?ceil(a-0.5):a>0.0?floor(a+0.5):0.0);
177}
static Double_t a

◆ setupJetRegionData()

void LVL1::JetElementKeyBase::setupJetRegionData ( )
protectedinherited

Does same as setupRegionData, except in FCAL where uses phi granularity appropriate for the jet trigger.

Definition at line 454 of file JetElementKeyBase.cxx.

454 {
455 // the first case is a bit weird - it's actually the centre
456 // of the outermost cell of region 0
463
470
477}
static const double Region5Width
static const double Region4EtaCentre
static const double Region2EtaCentre
static const double Region4Width
static const double Region2Height
static const double Region3Width
static const double Region1EtaCentre
static const double Region3Height
static const double Region5EtaCentre
static const double Region0Width
static const double Region0EtaCentre
static const double Region0Height
static const double Region5JetHeight
static const double Region1Height
static const double Region1Width
static const double Region3EtaCentre
static const double Region2Width
static const double Region4Height

◆ setupRegionData()

void LVL1::JetElementKeyBase::setupRegionData ( )
protectedinherited

◆ setupThisKeyValues()

void LVL1::KeyUtilities::setupThisKeyValues ( )
protectedinherited

Definition at line 165 of file KeyUtilities.cxx.

165 {
166 ICoordinate iCoord = convertCoordsToIntegers(m_phi, m_eta);
167 BinAndCoord bandc = calculateTriggerBin(iCoord);
168 m_phiBin=bandc.phiBin();
169 m_etaBin=bandc.etaBin();
170 m_centralPhi=bandc.coords().phi();
171 m_centralEta=bandc.coords().eta();
172}

◆ sharpRound()

int LVL1::KeyUtilities::sharpRound ( double a) const
protectedinherited

rounds number as follows (-1.0 to 0.0) -> -1, (0.0 to 1.0) -> 0, (1.0 to 2.0)->1 etc.

Definition at line 180 of file KeyUtilities.cxx.

180 {
181 return static_cast<int>(a<0.0?(a-1.0):a>0.0?(a):0.0);
182}

◆ sharpRound2()

int LVL1::KeyUtilities::sharpRound2 ( int a,
int b ) const
protectedinherited

divides a/b and returns a number as follows (where +b means +ve b): if 0

Definition at line 184 of file KeyUtilities.cxx.

184 {
185 int temp=(abs(a)-1)/b+1;
186 return temp*sign(a);
187}

◆ sign() [1/2]

int LVL1::KeyUtilities::sign ( double temp) const
protectedvirtualinherited

returns -1 if temp is -ve and +1 if it is +ve.

returns 0 if temp =0

Definition at line 161 of file KeyUtilities.cxx.

161 {
162 return ((temp >= 0.0) ? 1 : -1);
163}

◆ sign() [2/2]

int LVL1::KeyUtilities::sign ( int temp) const
protectedvirtualinherited

returns -1 if temp is -ve and +1 if it is +ve.

returns 0 if temp =0

Definition at line 156 of file KeyUtilities.cxx.

156 {
157 return ((temp >= 0) ? 1 : -1);
158}

◆ upperLeft() [1/2]

Coordinate LVL1::JetElementKeyBase::upperLeft ( const Coordinate coord)
inherited

Definition at line 332 of file JetElementKeyBase.cxx.

332 {
333 Coordinate newCoord=upperLeft(coord.phi(),coord.eta());
334 return newCoord;
335}
Coordinate upperLeft(const double phi, const double eta)

◆ upperLeft() [2/2]

Coordinate LVL1::JetElementKeyBase::upperLeft ( const double phi,
const double eta )
inherited

Definition at line 308 of file JetElementKeyBase.cxx.

308 {
309 Coordinate coord=upPhi(phi,eta);
310 coord=leftEta(coord.phi(),coord.eta());
311 return coord;
312}
Coordinate upPhi(const double phi, const double eta)
returns coord of next JE in +ve phi dir.

◆ upperRight() [1/2]

Coordinate LVL1::JetElementKeyBase::upperRight ( const Coordinate coord)
inherited

Definition at line 337 of file JetElementKeyBase.cxx.

337 {
338 Coordinate newCoord=upperRight(coord.phi(),coord.eta());
339 return newCoord;
340}
Coordinate upperRight(const double phi, const double eta)

◆ upperRight() [2/2]

Coordinate LVL1::JetElementKeyBase::upperRight ( const double phi,
const double eta )
inherited

Definition at line 314 of file JetElementKeyBase.cxx.

314 {
315 Coordinate coord=upPhi(phi,eta);
316 coord=rightEta(coord.phi(),coord.eta());
317 return coord;
318}

◆ upPhi() [1/2]

Coordinate LVL1::JetElementKeyBase::upPhi ( const Coordinate coord)
inherited

returns coord of next JE in +ve phi dir.

Definition at line 270 of file JetElementKeyBase.cxx.

270 {
271 return upPhi(coord.phi(), coord.eta());
272}

◆ upPhi() [2/2]

Coordinate LVL1::JetElementKeyBase::upPhi ( const double phi,
const double eta )
inherited

returns coord of next JE in +ve phi dir.

Definition at line 254 of file JetElementKeyBase.cxx.

254 {
255 Coordinate centre=getCentre(phi,eta);
256 double temp_phi=centre.phi();
257 unsigned int reg=region(centre.eta());
259// std::cout << "Out of bounds error in JetElementKeyBase::upPhi"<<std::endl;
260 temp_phi=0.0;
261 }else{
262 temp_phi+= m_regionHeight[reg];
263 }
264 centre.setCoords(temp_phi,centre.eta());
265 analCoordChecking(centre);
266 return centre;
267}

◆ upPhiKey()

unsigned int LVL1::JetElementKeyBase::upPhiKey ( const double phi,
const double eta )
inherited

returns key of next JE in +ve phi dir.

Definition at line 275 of file JetElementKeyBase.cxx.

275 {
276 Coordinate coord=upPhi(phi,eta);
277 return jeKey(coord.phi(),coord.eta());
278}

Member Data Documentation

◆ m_centralEta

double LVL1::KeyUtilities::m_centralEta
protectedinherited

this is the coordinate of the centre of the relevant trigger tower.

Definition at line 112 of file KeyUtilities.h.

◆ m_centralPhi

double LVL1::KeyUtilities::m_centralPhi
protectedinherited

this is the coordinate of the centre of the relevant trigger tower.

Definition at line 109 of file KeyUtilities.h.

◆ m_debug

bool LVL1::KeyUtilities::m_debug
protectedinherited

turns DEBUG code on and off

Definition at line 114 of file KeyUtilities.h.

◆ m_debugKeyBase

bool LVL1::JetElementKeyBase::m_debugKeyBase
privateinherited

set to true to turn debugging info on

Definition at line 152 of file JetElementKeyBase.h.

◆ m_eta

double LVL1::KeyUtilities::m_eta
protectedinherited

eta coordinate of key

Definition at line 100 of file KeyUtilities.h.

◆ m_etaBin

int LVL1::KeyUtilities::m_etaBin
protectedinherited

eta bin

Definition at line 106 of file KeyUtilities.h.

◆ m_ieta

int LVL1::KeyUtilities::m_ieta
protectedinherited

integer eta coord

Definition at line 98 of file KeyUtilities.h.

◆ m_iphi

int LVL1::KeyUtilities::m_iphi
protectedinherited

integer phi coord

Definition at line 96 of file KeyUtilities.h.

◆ m_phi

double LVL1::KeyUtilities::m_phi
protectedinherited

phi coordinate of key

Definition at line 102 of file KeyUtilities.h.

◆ m_phiBin

int LVL1::KeyUtilities::m_phiBin
protectedinherited

phi bin

Definition at line 104 of file KeyUtilities.h.

◆ m_regionEtaCentre

std::vector<double> LVL1::JetElementKeyBase::m_regionEtaCentre
privateinherited

holds central coords of JEs in regions: Region Eta 0 <2.2 1 2.2-2.4 2 2.4-2.7 3 2.7-2.9 4 2.9-3.2 5 3.2-4.9

Definition at line 161 of file JetElementKeyBase.h.

◆ m_regionHeight

std::vector<double> LVL1::JetElementKeyBase::m_regionHeight
privateinherited

holds height of JEs in regions:

Definition at line 165 of file JetElementKeyBase.h.

◆ m_regionWidth

std::vector<double> LVL1::JetElementKeyBase::m_regionWidth
privateinherited

holds width of JEs in regions:

Definition at line 163 of file JetElementKeyBase.h.


The documentation for this class was generated from the following files: