ATLAS Offline Software
JetElementKeyBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 /***************************************************************************
5  JetElementKeyBase.h - description
6  -------------------
7  begin : Monday August 20 2001
8  email : e.moyse@qmw.ac.uk
9 
10  Converted to base class JetElementKeyBase by Alan Watson, 20/01/06
11 ***************************************************************************/
12 
13 
14 #ifndef JetElementKeyBase_H
15 #define JetElementKeyBase_H
16 
17 #include <iostream>
18 #include <stdlib.h>
19 #include <vector>
20 
21 #ifndef TRIGGERSPACE
22 // running in Athena
28 
29 #else
30 // running in TRIGGERSPACE
31 #include "KeyUtilities.h"
32 #include "BinAndCoord.h"
33 #include "Coordinate.h"
34 
35 #endif
36 
37 
38 
39 namespace LVL1 {
40 
48 class JetElementKeyBase : public KeyUtilities {
49 
50 public:
51  enum JERegion {
52  Barrel=0,
53  EndBarrel=1,
54  EndCap1=2,
56  EndCap3=4,
57  FCAL=5
58  };
59  virtual ~JetElementKeyBase();
60 #ifndef TRIGGERSPACE
61 // only applicable if running in Athena
63  virtual unsigned int jeKey( const xAOD::TriggerTower& tower) ;
65  virtual unsigned int jeKey( const xAOD::JetElement& jetElement) ;
66 #endif
67 
68  virtual unsigned int jeKey( const double phi, const double eta);
70  virtual unsigned int jeKey( const Coordinate coord);
72  unsigned int leftEtaKey(const double phi, const double eta);
74  unsigned int rightEtaKey(const double phi, const double eta);
76  unsigned int upPhiKey(const double phi, const double eta);
78  unsigned int downPhiKey(const double phi, const double eta);
79 
81  Coordinate getCentre(const double phi, const double eta);
83 
85  Coordinate rightEta(const double phi,const double eta);
86  Coordinate leftEta(const double phi,const double eta);
87  Coordinate downPhi(const double phi,const double eta);
88  Coordinate upPhi(const double phi,const double eta);
93  Coordinate upperLeft(const double phi,const double eta);
94  Coordinate upperRight(const double phi,const double eta);
95  Coordinate lowerLeft(const double phi,const double eta);
96  Coordinate lowerRight(const double phi,const double eta);
102  double dPhi(const double phi, const double eta) const ;
104  double dPhi() const;
106  double dPhi(const Coordinate& coord) const;
108  double dEta(const double phi, const double eta) const ;
110  double dEta() const ;
112  double dEta(const Coordinate& coord) const;
114  unsigned int region(double eta) const;
115  /*
116  Region Eta
117  Barrel <2.2
118  EndBarrel 2.2 - 2.4
119  EndCap1 2.4 - 2.7
120  EndCap2 2.7 - 2.9
121  EndCap3 2.9 - 3.2
122  FCAL 3.2 - 4.9 */
123  JERegion jeRegion(const Coordinate& coord) const;
125  bool isFCAL(double eta) const;
126 
127 protected: // Methods we don't want accessed except through inheritance
128 
129  // User should construct a JetElementKey or JetInputKey, not this base class
130  JetElementKeyBase(double phi, double eta);
133 
134  void setupRegionData();
135  void setupJetRegionData();
136 
137 private: // Internal methods of the base class
141 
146  void analCoordChecking(const Coordinate& coord);
147 
148 private:
149 // double m_phi;
150 // double m_eta;
152  bool m_debugKeyBase;
161  std::vector<double> m_regionEtaCentre;
163  std::vector<double> m_regionWidth;
165  std::vector<double> m_regionHeight;
166 };
167 }
168 #endif
LVL1::KeyUtilities::phi
virtual double phi() const
returns phi coordinate of centre of relevant trigger tower.
Definition: KeyUtilities.cxx:159
LVL1::JetElementKeyBase::isFCAL
bool isFCAL(double eta) const
returns TRUE if this coordinate is in the FCAL
Definition: JetElementKeyBase.cxx:430
LVL1::JetElementKeyBase::lowerRight
Coordinate lowerRight(const double phi, const double eta)
Definition: JetElementKeyBase.cxx:335
LVL1::JetElementKeyBase::m_debugKeyBase
bool m_debugKeyBase
set to true to turn debugging info on
Definition: JetElementKeyBase.h:166
LVL1::JetElementKeyBase::jeKey
virtual unsigned int jeKey(const xAOD::TriggerTower &tower)
returns key of passed tower
Definition: JetElementKeyBase.cxx:157
LVL1::JetElementKeyBase::FCAL
@ FCAL
Definition: JetElementKeyBase.h:78
LVL1::JetElementKeyBase::region
unsigned int region(double eta) const
returns region number at eta, where region is:
Definition: JetElementKeyBase.cxx:397
xAOD::JetElement_v2
Description of JetElement_v2.
Definition: JetElement_v2.h:26
LVL1::JetElementKeyBase::EndCap3
@ EndCap3
Definition: JetElementKeyBase.h:77
LVL1::JetElementKeyBase::upperRight
Coordinate upperRight(const double phi, const double eta)
Definition: JetElementKeyBase.cxx:323
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
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::ICoordinate
Used by Key Classes, returns and integer coorginate for the bin Eta-Phi.
Definition: ICoordinate.h:31
LVL1::JetElementKeyBase::upPhiKey
unsigned int upPhiKey(const double phi, const double eta)
returns key of next JE in +ve phi dir.
Definition: JetElementKeyBase.cxx:284
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
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
LVL1::Coordinate
Coordinate class declaration.
Definition: TrigT1/TrigT1Interfaces/TrigT1Interfaces/Coordinate.h:50
LVL1::JetElementKeyBase::setupJetRegionData
void setupJetRegionData()
Does same as setupRegionData, except in FCAL where uses phi granularity appropriate for the jet trigg...
Definition: JetElementKeyBase.cxx:463
xAOD::TriggerTower_v2
Description of TriggerTower_v2.
Definition: TriggerTower_v2.h:49
LVL1::BinAndCoord
Used to pass data between the methods of the Key Classes: Returns the Eta and Phi bins,...
Definition: BinAndCoord.h:40
BinAndCoord.h
Coordinate.h
Coordinate policies.
JetElement.h
LVL1::JetElementKeyBase::lowerLeft
Coordinate lowerLeft(const double phi, const double eta)
Definition: JetElementKeyBase.cxx:329
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::JetElementKeyBase::~JetElementKeyBase
virtual ~JetElementKeyBase()
Definition: JetElementKeyBase.cxx:70
Coordinate.h
KeyUtilities.h
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
LVL1::JetElementKeyBase::calculateTriggerBin
BinAndCoord * calculateTriggerBin(ICoordinate *iCoord)
converts integer phi, eta coordinates to phi, eta trigger bins.
Definition: JetElementKeyBase.cxx:77
LVL1::JetElementKeyBase::EndCap2
@ EndCap2
Definition: JetElementKeyBase.h:76
TriggerTower.h
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::JetElementKeyBase
JetElementKeyBase()
constructs a JetElementKeyBase object
Definition: JetElementKeyBase.cxx:51
LVL1::JetElementKeyBase::downPhiKey
unsigned int downPhiKey(const double phi, const double eta)
returns key of next JE in -ve phi dir.
Definition: JetElementKeyBase.cxx:312
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::JetElementKeyBase::rightEta
Coordinate rightEta(const double phi, const double eta)
Functions for finding coordinates of neighbouring JEs.
Definition: JetElementKeyBase.cxx:230
LVL1::JetElementKeyBase::Barrel
@ Barrel
Definition: JetElementKeyBase.h:73
LVL1::JetElementKeyBase::dEta
double dEta() const
return width of JE
Definition: JetElementKeyBase.cxx:388
LVL1::JetElementKeyBase::upperLeft
Coordinate upperLeft(const double phi, const double eta)
Definition: JetElementKeyBase.cxx:317
LVL1::JetElementKeyBase::EndCap1
@ EndCap1
Definition: JetElementKeyBase.h:75
LVL1::JetElementKeyBase::leftEtaKey
unsigned int leftEtaKey(const double phi, const double eta)
returns key of JE in +ve eta dir.
Definition: JetElementKeyBase.cxx:218
LVL1::JetElementKeyBase::jeRegion
JERegion jeRegion(const Coordinate &coord) const
Definition: JetElementKeyBase.cxx:415
LVL1::JetElementKeyBase::rightEtaKey
unsigned int rightEtaKey(const double phi, const double eta)
returns key of JE in -ve eta dir.
Definition: JetElementKeyBase.cxx:224
LVL1::JetElementKeyBase::EndBarrel
@ EndBarrel
Definition: JetElementKeyBase.h:74
LVL1::JetElementKeyBase::setupRegionData
void setupRegionData()
get region data from TrigT1CaloDefs and put in more useful format - vectors
Definition: JetElementKeyBase.cxx:436