ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
LVL1::JetElementKeyBase Class Reference

The JetElementKeyBase object provides the key for each JetElement or JetInput depending on its eta,phi coords. More...

#include <JetElementKeyBase.h>

Inheritance diagram for LVL1::JetElementKeyBase:
Collaboration diagram for LVL1::JetElementKeyBase:

Public Types

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

BinAndCoordcalculateTriggerBin (ICoordinate *iCoord)
 converts integer phi, eta coordinates to phi, eta trigger bins. More...
 
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. More...
 

Private Attributes

bool m_debugKeyBase
 set to true to turn debugging info on More...
 
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 More...
 
std::vector< double > m_regionWidth
 holds width of JEs in regions: More...
 
std::vector< double > m_regionHeight
 holds height of JEs in regions: More...
 

Detailed Description

The JetElementKeyBase object provides the key for each JetElement or JetInput depending on its eta,phi coords.

The key is an integer number that uniquely identifies each tower, and is needed by the STL map container: the map holds trigger towers and we retrieve them using their keys.

Definition at line 55 of file JetElementKeyBase.h.

Member Enumeration Documentation

◆ JERegion

Enumerator
Barrel 
EndBarrel 
EndCap1 
EndCap2 
EndCap3 
FCAL 

Definition at line 65 of file JetElementKeyBase.h.

127  : // Methods we don't want accessed except through inheritance

Constructor & Destructor Documentation

◆ ~JetElementKeyBase()

LVL1::JetElementKeyBase::~JetElementKeyBase ( )
virtual

Definition at line 70 of file JetElementKeyBase.cxx.

70  {
71 

◆ JetElementKeyBase() [1/3]

LVL1::JetElementKeyBase::JetElementKeyBase ( double  phi,
double  eta 
)
protected

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

Definition at line 41 of file JetElementKeyBase.cxx.

44  :
45  KeyUtilities(),
46  m_debugKeyBase(false)
47  {
48  if (m_debugKeyBase) { std::cout << "JetElementKeyBase: m_debugKeyBase output turned on...."<<std::endl; }

◆ JetElementKeyBase() [2/3]

LVL1::JetElementKeyBase::JetElementKeyBase ( const Coordinate  coord)
protected

constructs a JetElementKeyBase object

Definition at line 61 of file JetElementKeyBase.cxx.

63  {
64 }
65 
66 

◆ JetElementKeyBase() [3/3]

LVL1::JetElementKeyBase::JetElementKeyBase ( )
protected

constructs a JetElementKeyBase object

Definition at line 51 of file JetElementKeyBase.cxx.

54  :
56  m_debugKeyBase(false)
57  {
58  if (m_debugKeyBase) { std::cout << "JetElementKeyBase: m_debugKeyBase output turned on...."<<std::endl; }

Member Function Documentation

◆ analCoordChecking()

void LVL1::JetElementKeyBase::analCoordChecking ( const Coordinate coord)
private

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 502 of file JetElementKeyBase.cxx.

502  {
503  Coordinate centre( getCentre( coord.phi(), coord.eta() ) );
504  double allowedSpread=0.0002;// I don't mind a bit of a rounding error....
505  if ( (coord.phi()<(centre.phi()-allowedSpread))||(coord.phi()>(centre.phi()+allowedSpread) ) )
506  std::cout << "PHI ERROR: "<< coord.phi() <<"!="<<centre.phi()<<std::endl;
507  if ( (coord.eta()<(centre.eta()-allowedSpread))||(coord.eta()>(centre.eta()+allowedSpread) ) )
508  std::cout << "ETA ERROR: "<< coord.eta() <<"!="<<centre.eta()<<std::endl;
509  return;
510 }

◆ calculateTriggerBin()

BinAndCoord * LVL1::JetElementKeyBase::calculateTriggerBin ( ICoordinate iCoord)
privatevirtual

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

Returns coordinates of centre of JEs

Implements LVL1::KeyUtilities.

Definition at line 77 of file JetElementKeyBase.cxx.

80  {
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 
87  if (abs_ieta==TrigT1CaloDefs::RegionERROREtaBin){
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  Coordinate* centralCoords = new Coordinate(centralPhi, centralEta);
142  BinAndCoord* bandc = new BinAndCoord(phiBin,etaBin,centralCoords);
143  return bandc;
144 }
145 
146 #ifndef TRIGGERSPACE
147 // these methods are only applicable if running in Athena
148 
150 unsigned int JetElementKeyBase::jeKey( const xAOD::TriggerTower& tower) {
151  if (m_debugKeyBase) std::cout << "JetElementKeyBase: returning key for coords ("<<tower.phi()<<","<<tower.eta()<<")"<<std::endl;

◆ 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 110 of file KeyUtilities.cxx.

110  : (phi, eta) ("<<phi<<","<<eta<<")"<<std::endl;
111  int iphi=sharpRound(phi/phiBinWidth);
112  int ieta=0;
113 
114  // Now check that m_iphi is between 0 and 64.
115  iphi = iphi%64;
116  if (iphi<0) iphi = 64+iphi;
117 
118  // Make m_ieta symmetrical:
119  // o no cell at m_ieta=0
120  // o first cells at +-1
121  // o last cells at about +- 50
122  // this gives us a more useful numerical symmetry.
123 
124  // So to get integer value we do:
125  int temp_sign=sign(eta);
126  double temp_abs=eta*temp_sign;
127 
128  double temp_double=(temp_abs*10.0+1.0)*temp_sign;
129  if (m_debug) std::cout << "KU : temp_abs, temp_sign, temp_double : "<<temp_abs<<","<<temp_sign<<","<<temp_double<<std::endl;
130 // if (m_eta>=0.0){
131 // temp_double=m_eta*10.0+1.0;
132 // }else{
133 // temp_double=m_eta*10.0-1.0;
134 // }
135 
136  ieta=static_cast<int>(temp_double);
137  if (m_debug) std::cout << "KU : (iphi, ieta) ("<<iphi<<","<<ieta<<")"<<std::endl;
138  ICoordinate* iCoord=new ICoordinate(iphi, ieta, eta);
139  return iCoord;
140 }
141 
142 
145 double LVL1::KeyUtilities::eta() const{

◆ coord()

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

return central coords of current key value.

Definition at line 199 of file KeyUtilities.cxx.

199  {
200  return Coordinate(m_centralPhi,m_centralEta);
201 }

◆ dEta() [1/3]

double LVL1::JetElementKeyBase::dEta ( ) const

return width of JE

return width of this JE

Definition at line 388 of file JetElementKeyBase.cxx.

390  {

◆ dEta() [2/3]

double LVL1::JetElementKeyBase::dEta ( const Coordinate coord) const
virtual

return width of JE

Implements LVL1::KeyUtilities.

Definition at line 393 of file JetElementKeyBase.cxx.

395  {

◆ dEta() [3/3]

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

return width of JE

return width of JE at (phi,eta)

Definition at line 380 of file JetElementKeyBase.cxx.

381  {
382  return dEta(m_phi,m_eta);
383 }
384 

◆ downPhi() [1/2]

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

returns coord of next JE in -ve phi dir.

Definition at line 306 of file JetElementKeyBase.cxx.

◆ downPhi() [2/2]

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

returns coord of next JE in -ve phi dir.

Definition at line 290 of file JetElementKeyBase.cxx.

290  {
291  temp_phi-= m_regionHeight[reg];
292  }
293  centre.setCoords(temp_phi,centre.eta());
294  analCoordChecking(centre);
295  return centre;
296 }
297 
299 Coordinate JetElementKeyBase::downPhi(const Coordinate coord){
300  return downPhi(coord.phi(), coord.eta());
301 }
302 
303 

◆ downPhiKey()

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

returns key of next JE in -ve phi dir.

Definition at line 312 of file JetElementKeyBase.cxx.

◆ dPhi() [1/3]

double LVL1::JetElementKeyBase::dPhi ( ) const

return height of JE

return height of this JE

Definition at line 370 of file JetElementKeyBase.cxx.

◆ dPhi() [2/3]

double LVL1::JetElementKeyBase::dPhi ( const Coordinate coord) const
virtual

return height of JE

Implements LVL1::KeyUtilities.

Definition at line 375 of file JetElementKeyBase.cxx.

◆ dPhi() [3/3]

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

return height of JE

return height of JE at (phi,eta)

Definition at line 362 of file JetElementKeyBase.cxx.

363  {
364  return dPhi(m_phi,m_eta);
365 }
366 

◆ 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 150 of file KeyUtilities.cxx.

◆ getCentre() [1/2]

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

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

Definition at line 498 of file JetElementKeyBase.cxx.

◆ getCentre() [2/2]

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

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

Definition at line 489 of file JetElementKeyBase.cxx.

491  {
492  Coordinate centre = getCentre( coord.phi(), coord.eta() );
493  return centre;
494 }
495 

◆ isFCAL()

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

returns TRUE if this coordinate is in the FCAL

Definition at line 430 of file JetElementKeyBase.cxx.

◆ jeKey() [1/4]

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

returns the key of the passed Coordinate

returns trigger tower key of passed Coordinate

Definition at line 178 of file JetElementKeyBase.cxx.

179  {
180  Coordinate centre=getCentre(phi,eta);
181  double temp_eta=centre.eta();

◆ jeKey() [2/4]

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

returns the key of the passed coords

returns trigger tower key of passed coords

Definition at line 172 of file JetElementKeyBase.cxx.

172  : returning key for Coord: ("<<coord.phi()<<","<<coord.eta()<<")"<<std::endl;
173  return key(coord.phi(), coord.eta());
174 }
175 

◆ jeKey() [3/4]

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

returns key of passed jetelement

returns the key of the passed tower

Definition at line 163 of file JetElementKeyBase.cxx.

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

◆ jeKey() [4/4]

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

returns key of passed tower

Definition at line 157 of file JetElementKeyBase.cxx.

157  : returning key for coords ("<<jetElement.phi()<<","<<jetElement.eta()<<")"<<std::endl;
158  return key(jetElement.phi(), jetElement.eta());
159 }
160 

◆ jeRegion()

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

Definition at line 415 of file JetElementKeyBase.cxx.

423  {
424  return (region(eta)==5);
425 }
426 

◆ 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 101 of file KeyUtilities.cxx.

◆ 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 82 of file KeyUtilities.cxx.

82  : 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  delete bandc;
88  delete iCoord;
89  int temp=((m_etaBin+50)<<6) + m_phiBin;
90 
91  if (m_debug) std::cout << "KU : key: returning - "<<temp<<std::endl;
92  return static_cast<unsigned int>(temp);
93 }
94 
96 unsigned int KeyUtilities::key(const Coordinate& coord) {
97  return key(coord.phi(), coord.eta());
98 }

◆ leftEta() [1/2]

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

returns key of JE in -ve eta dir.

Definition at line 213 of file JetElementKeyBase.cxx.

◆ leftEta() [2/2]

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

returns key of JE in -ve eta dir.

Definition at line 186 of file JetElementKeyBase.cxx.

186  :-1);
187  if ( reg==0 ){
188  temp_eta-=m_regionWidth[0];
189  }else{
190  if ((reg==TrigT1CaloDefs::RegionError)||(reg>maxRegion)) {
192  }else{
193  int sign = ((temp_eta>0.0)? 1:-1);
194  temp_eta= sign*m_regionEtaCentre[reg-sign]; }
195  }
196  // there's a complication here ... moving left can move us
197  // into a JE with a different phi height, and so phi can change.
198  // However we want to keep eta at 8.0, so reset eta afterwards.
199  Coordinate coord( getCentre(phi,temp_eta) );
200  coord.setCoords(coord.phi(), temp_eta) ;
201 // analCoordChecking(coord);
202  return coord;
203 }
204 
206 Coordinate JetElementKeyBase::leftEta(const Coordinate coord){
207  return leftEta(coord.phi(), coord.eta());
208 }
209 

◆ leftEtaKey()

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

returns key of JE in +ve eta dir.

returns key of JE in -ve eta dir.

Definition at line 218 of file JetElementKeyBase.cxx.

◆ lowerLeft() [1/2]

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

Definition at line 351 of file JetElementKeyBase.cxx.

◆ lowerLeft() [2/2]

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

Definition at line 329 of file JetElementKeyBase.cxx.

◆ lowerRight() [1/2]

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

Definition at line 356 of file JetElementKeyBase.cxx.

◆ lowerRight() [2/2]

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

Definition at line 335 of file JetElementKeyBase.cxx.

339  {

◆ 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 159 of file KeyUtilities.cxx.

159  {
160  return ((temp >= 0) ? 1 : -1);
161 }

◆ region()

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

returns region number at eta, where region is:

Definition at line 397 of file JetElementKeyBase.cxx.

398  {
399  if((abs_eta>2.2)&&(abs_eta<=2.4)) reg=1;
400  if((abs_eta>2.4)&&(abs_eta<=2.7)) reg=2;
401  if((abs_eta>2.7)&&(abs_eta<=2.9)) reg=3;
402  if((abs_eta>2.9)&&(abs_eta<=3.2)) reg=4;
403  if((abs_eta>3.2)&&(abs_eta<=4.9)) reg=5;
404  }//end if
405  return reg;
406 }
407 
409  // really unhappy about this. It'll go horribly wrong if anyone alters the enum.
410  // Ideally I'd like region(eta) to return an enum, and have a
411  // separate numRegion(eta) which returns ints.
412  // That will require a lot of re-writing though....
413  unsigned int reg=region(coord.eta());

◆ rightEta() [1/2]

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

returns eta coord of JE in +ve eta dir.

Definition at line 257 of file JetElementKeyBase.cxx.

◆ rightEta() [2/2]

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

Functions for finding coordinates of neighbouring JEs.

returns eta coord of JE in +ve eta dir.

Definition at line 230 of file JetElementKeyBase.cxx.

230  {
231  temp_eta+=m_regionWidth[0];
232  }else{
233  if ((reg==TrigT1CaloDefs::RegionError)||(reg>maxRegion)) {
235  }else{
236  int sign = ((temp_eta>0.0)? 1:-1);
237  temp_eta= sign*m_regionEtaCentre[reg+sign];
238  }
239  }
240  // there's a complication here ... moving right can move us
241  // into a JE with a different phi height, and so phi can change.
242  // However we want to keep eta at 8.0, so reset eta afterwards.
243  Coordinate coord( getCentre(phi,temp_eta) );
244  coord.setCoords(coord.phi(), temp_eta) ;
245 // analCoordChecking(coord);
246  return coord;
247 }
248 
250 Coordinate JetElementKeyBase::rightEta(const Coordinate coord){
251  return rightEta(coord.phi(), coord.eta());
252 }
253 
254 

◆ rightEtaKey()

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

returns key of JE in -ve eta dir.

returns key of JE in +ve eta dir.

Definition at line 224 of file JetElementKeyBase.cxx.

229  :0);

◆ round()

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

rounds number to nearest whole number

Definition at line 185 of file KeyUtilities.cxx.

185  {
186  return static_cast<int>(a<0.0?(a-1.0):a>0.0?(a):0.0);
187 }

◆ setupJetRegionData()

void LVL1::JetElementKeyBase::setupJetRegionData ( )
protected

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

Definition at line 463 of file JetElementKeyBase.cxx.

482  {
483  ICoordinate* iCoord = convertCoordsToIntegers(phi, eta);
484  BinAndCoord* bandc = calculateTriggerBin(iCoord);
485  Coordinate yuck=*(bandc->coords() ); // this is horrible, but easier than changing other stuff
486  delete iCoord; delete bandc ;

◆ setupRegionData()

void LVL1::JetElementKeyBase::setupRegionData ( )
protected

get region data from TrigT1CaloDefs and put in more useful format - vectors

Definition at line 436 of file JetElementKeyBase.cxx.

456  {
457  // the first case is a bit weird - it's actually the centre
458  // of the outermost cell of region 0

◆ setupThisKeyValues()

void LVL1::KeyUtilities::setupThisKeyValues ( )
protectedinherited

Definition at line 173 of file KeyUtilities.cxx.

180  {
181  return static_cast<int>(a<0.0?ceil(a-0.5):a>0.0?floor(a+0.5):0.0);
182 }

◆ 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 190 of file KeyUtilities.cxx.

◆ 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<a<+b, then n=1, if +b<a<+2b, n=2, if -b<a<0, n=-1, if -2b<a<-b, n=-2

Definition at line 194 of file KeyUtilities.cxx.

◆ 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 169 of file KeyUtilities.cxx.

◆ 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 164 of file KeyUtilities.cxx.

164  {
165  return ((temp >= 0.0) ? 1 : -1);
166 }

◆ upperLeft() [1/2]

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

Definition at line 341 of file JetElementKeyBase.cxx.

344  {

◆ upperLeft() [2/2]

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

Definition at line 317 of file JetElementKeyBase.cxx.

◆ upperRight() [1/2]

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

Definition at line 346 of file JetElementKeyBase.cxx.

349  {

◆ upperRight() [2/2]

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

Definition at line 323 of file JetElementKeyBase.cxx.

◆ upPhi() [1/2]

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

returns coord of next JE in +ve phi dir.

Definition at line 279 of file JetElementKeyBase.cxx.

◆ upPhi() [2/2]

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

returns coord of next JE in +ve phi dir.

Definition at line 263 of file JetElementKeyBase.cxx.

263  {
264  temp_phi+= m_regionHeight[reg];
265  }
266  centre.setCoords(temp_phi,centre.eta());
267  analCoordChecking(centre);
268  return centre;
269 }
270 
272 Coordinate JetElementKeyBase::upPhi(const Coordinate coord){
273  return upPhi(coord.phi(), coord.eta());
274 }
275 

◆ upPhiKey()

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

returns key of next JE in +ve phi dir.

Definition at line 284 of file JetElementKeyBase.cxx.

287  {

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 122 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 119 of file KeyUtilities.h.

◆ m_debug

bool LVL1::KeyUtilities::m_debug
protectedinherited

turns DEBUG code on and off

Definition at line 124 of file KeyUtilities.h.

◆ m_debugKeyBase

bool LVL1::JetElementKeyBase::m_debugKeyBase
private

set to true to turn debugging info on

Definition at line 166 of file JetElementKeyBase.h.

◆ m_eta

double LVL1::KeyUtilities::m_eta
protectedinherited

eta coordinate of key

Definition at line 110 of file KeyUtilities.h.

◆ m_etaBin

int LVL1::KeyUtilities::m_etaBin
protectedinherited

eta bin

Definition at line 116 of file KeyUtilities.h.

◆ m_ieta

int LVL1::KeyUtilities::m_ieta
protectedinherited

integer eta coord

Definition at line 108 of file KeyUtilities.h.

◆ m_iphi

int LVL1::KeyUtilities::m_iphi
protectedinherited

integer phi coord

Definition at line 106 of file KeyUtilities.h.

◆ m_phi

double LVL1::KeyUtilities::m_phi
protectedinherited

phi coordinate of key

Definition at line 112 of file KeyUtilities.h.

◆ m_phiBin

int LVL1::KeyUtilities::m_phiBin
protectedinherited

phi bin

Definition at line 114 of file KeyUtilities.h.

◆ m_regionEtaCentre

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

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 175 of file JetElementKeyBase.h.

◆ m_regionHeight

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

holds height of JEs in regions:

Definition at line 179 of file JetElementKeyBase.h.

◆ m_regionWidth

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

holds width of JEs in regions:

Definition at line 177 of file JetElementKeyBase.h.


The documentation for this class was generated from the following files:
LVL1::KeyUtilities::sign
virtual int sign(int temp) const
returns -1 if temp is -ve and +1 if it is +ve.
Definition: KeyUtilities.cxx:164
LVL1::KeyUtilities::phi
virtual double phi() const
returns phi coordinate of centre of relevant trigger tower.
Definition: KeyUtilities.cxx:159
LVL1::KeyUtilities::m_phi
double m_phi
phi coordinate of key
Definition: KeyUtilities.h:112
LVL1::JetElementKeyBase::m_debugKeyBase
bool m_debugKeyBase
set to true to turn debugging info on
Definition: JetElementKeyBase.h:166
LVL1::Coordinate::phi
double phi() const
return phi
Definition: Coordinate.cxx:50
xAOD::TriggerTower_v2::phi
virtual double phi() const final
The azimuthal angle ( ) of the particle.
Definition: TriggerTower_v2.cxx:222
LVL1::JetElementKeyBase::jeKey
virtual unsigned int jeKey(const xAOD::TriggerTower &tower)
returns key of passed tower
Definition: JetElementKeyBase.cxx:157
LVL1::JetElementKeyBase::region
unsigned int region(double eta) const
returns region number at eta, where region is:
Definition: JetElementKeyBase.cxx:397
LVL1::KeyUtilities::key
unsigned int key(double phi, double eta)
calculates a map key from passed phi, eta coordinates
Definition: KeyUtilities.cxx:82
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::JetElementKeyBase::analCoordChecking
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...
Definition: JetElementKeyBase.cxx:502
LVL1::KeyUtilities::KeyUtilities
KeyUtilities()
the constructor is protected so a user can never make a KeyUtilities object
Definition: KeyUtilities.cxx:42
LVL1::JetElementKeyBase::downPhi
Coordinate downPhi(const double phi, const double eta)
returns coord of next JE in -ve phi dir.
Definition: JetElementKeyBase.cxx:290
LVL1::KeyUtilities::eta
virtual double eta() const
returns the centre of the TT at eta_coord:
Definition: KeyUtilities.cxx:150
LVL1::JetElementKeyBase::upPhi
Coordinate upPhi(const double phi, const double eta)
returns coord of next JE in +ve phi dir.
Definition: JetElementKeyBase.cxx:263
LVL1::JetElementKeyBase::JERegion
JERegion
Definition: JetElementKeyBase.h:65
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
LVL1::JetElementKeyBase::m_regionWidth
std::vector< double > m_regionWidth
holds width of JEs in regions:
Definition: JetElementKeyBase.h:177
LVL1::KeyUtilities::coord
Coordinate coord() const
return central coords of current key value.
Definition: KeyUtilities.cxx:199
xAOD::TriggerTower_v2
Description of TriggerTower_v2.
Definition: TriggerTower_v2.h:49
xAOD::TriggerTower_v2::eta
virtual double eta() const final
The pseudorapidity ( ) of the particle.
Definition: TriggerTower_v2.cxx:210
LVL1::JetElementKeyBase::m_regionHeight
std::vector< double > m_regionHeight
holds height of JEs in regions:
Definition: JetElementKeyBase.h:179
LVL1::JetElementKeyBase::dPhi
double dPhi() const
return height of JE
Definition: JetElementKeyBase.cxx:370
LVL1::TrigT1CaloDefs::RegionERROREtaBin
static const int RegionERROREtaBin
Definition: TrigT1CaloDefs.h:102
LVL1::KeyUtilities::m_centralPhi
double m_centralPhi
this is the coordinate of the centre of the relevant trigger tower.
Definition: KeyUtilities.h:119
LVL1::KeyUtilities::m_eta
double m_eta
eta coordinate of key
Definition: KeyUtilities.h:110
LVL1::JetElementKeyBase::m_regionEtaCentre
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....
Definition: JetElementKeyBase.h:175
xAOD::phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
Definition: L2StandAloneMuon_v2.cxx:144
LVL1::KeyUtilities::convertCoordsToIntegers
ICoordinate * convertCoordsToIntegers(double phi, double eta)
converts the coordinates and corrects for overflows etc.
Definition: KeyUtilities.cxx:110
LVL1::TrigT1CaloDefs::RegionERROREtaCentre
static const double RegionERROREtaCentre
Definition: TrigT1CaloDefs.h:103
LVL1::JetElementKeyBase::calculateTriggerBin
BinAndCoord * calculateTriggerBin(ICoordinate *iCoord)
converts integer phi, eta coordinates to phi, eta trigger bins.
Definition: JetElementKeyBase.cxx:77
LVL1::Coordinate::eta
double eta() const
return eta
Definition: Coordinate.cxx:45
LVL1::TrigT1CaloDefs::Region0EtaCentre
static const double Region0EtaCentre
Definition: TrigT1CaloDefs.h:96
a
TList * a
Definition: liststreamerinfos.cxx:10
LVL1::JetElementKeyBase::leftEta
Coordinate leftEta(const double phi, const double eta)
returns key of JE in -ve eta dir.
Definition: JetElementKeyBase.cxx:186
LVL1::JetElementKeyBase::getCentre
Coordinate getCentre(const double phi, const double eta)
returns the central coordinate of the JE which contains the passed coord
Definition: JetElementKeyBase.cxx:489
LVL1::Coordinate::setCoords
void setCoords(double phi, double eta)
change coords of an existing Coordinate object
Definition: Coordinate.cxx:36
LVL1::JetElementKeyBase::rightEta
Coordinate rightEta(const double phi, const double eta)
Functions for finding coordinates of neighbouring JEs.
Definition: JetElementKeyBase.cxx:230
LVL1::TrigT1CaloDefs::RegionError
static const unsigned int RegionError
Definition: TrigT1CaloDefs.h:94
LVL1::JetElementKeyBase::dEta
double dEta() const
return width of JE
Definition: JetElementKeyBase.cxx:388
LVL1::KeyUtilities::m_centralEta
double m_centralEta
this is the coordinate of the centre of the relevant trigger tower.
Definition: KeyUtilities.h:122
LVL1::JetElementKeyBase::jeRegion
JERegion jeRegion(const Coordinate &coord) const
Definition: JetElementKeyBase.cxx:415