ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LVL1::JEMJetAlgorithm Class Reference

This is an internal class, used in the jet trigger. More...

#include <JEMJetAlgorithm.h>

Collaboration diagram for LVL1::JEMJetAlgorithm:

Public Member Functions

 JEMJetAlgorithm (double eta, double phi, const std::map< int, JetInput * > *jiContainer, const TrigConf::L1Menu *l1menu)
 
 ~JEMJetAlgorithm ()
 
double eta ()
 Accessors. More...
 
double phi ()
 Returns phi coordinate of RoI, using standard ATLAS convention. More...
 
int Core ()
 Returns RoI Core ET. More...
 
int ET4x4 ()
 Returns 4x4 TT cluster ET. More...
 
int ET6x6 ()
 Returns 6x6 TT cluster ET. More...
 
int ET8x8 ()
 Returns 8x8 TT cluster ET. More...
 
int ETLarge ()
 Returns Large cluster ET. More...
 
int ETSmall ()
 Returns Small cluster ET. More...
 
bool isEtMax ()
 Does this window pass the local ET maximum condition. More...
 
bool isRoI ()
 Does this window pass the local ET maximum condition. More...
 
xAOD::JEMTobRoIjemTobRoI ()
 Create JEMTobRoI and return pointers to it. More...
 

Private Member Functions

void setRoICoord (double eta, double phi)
 Compute RoI coordinate. More...
 
void testEtMax (const std::vector< int > &cores)
 Form all 2x2 clusters within window and test centre is a local ET maximum. More...
 
void passesTrigger ()
 Check trigger condition and set ET values if TOB created. More...
 

Private Attributes

double m_refEta
 
double m_refPhi
 
const TrigConf::L1Menum_l1menu {nullptr}
 
double m_eta
 Algorithm results. More...
 
double m_phi
 
int m_ET4x4
 
int m_ET6x6
 
int m_ET8x8
 
int m_ETLarge
 
int m_ETSmall
 
bool m_EtMax
 

Static Private Attributes

static const int m_satLarge = 0x3FF
 Algorithm parameters. More...
 
static const int m_satSmall = 0x1FF
 

Detailed Description

This is an internal class, used in the jet trigger.

The JEMJetAlgorithm:

Definition at line 45 of file JEMJetAlgorithm.h.

Constructor & Destructor Documentation

◆ JEMJetAlgorithm()

LVL1::JEMJetAlgorithm::JEMJetAlgorithm ( double  eta,
double  phi,
const std::map< int, JetInput * > *  jiContainer,
const TrigConf::L1Menu l1menu 
)

This could potentially be called with the coordinate being the centre
of an RoI or the centre of a JetElement. We want to ensure that we
do the right thing in either case.

Offsetting by JE size/4 should put the coordinates inside the
reference JetElement whether input was reference JetElement
coordinate or RoI centre coordinate. Can't subtract a fixed amount
as the eta size of JetElements varies, so need to work out how much
to subtract first!
To be extra safe, the code below will then compute the centre
of the reference JetElement.

This should all ensure consistent & safe key generation however the
initial coordinate was specified.

Now loop over JetInputs within window and form clusters. ET8x8 = all elements ET4x4 = central 2x2 ET6x6 = most energetic of 4 clusters Interesting one is the 9 RoI cores. The logic below fills these as an a 9-element std::vector. The ordering of the elements is as follows: 2 5 8 1 4 7 0 3 6 So the RoI "ET maximum" condition is that 4 >= 0-3, 4 > 5-8 If you picture the cores in a 3x3 array, cores[iphi][ieta], then the index in the vector above = iphi + 3*ieta.

We use the fact that core[4] = ET4x4 to safe a little time here

Definition at line 35 of file JEMJetAlgorithm.cxx.

40 {
57  // Offset depends on eta. Need to protect against rounding errors even here
58  JetInputKey get(phi-0.01,eta-0.01);
59  double de = get.dEta()/4.;
60 
61  // Get coordinate of centre of this "reference element"
62  Coordinate refCoord = get.getCentre(phi-M_PI/64., eta-de);
63  m_refEta = refCoord.eta();
64  m_refPhi = refCoord.phi();
65 
66  // Set coordinate of centre of RoI, starting from reference tower coordinate
68 
69  // Get coordinate of bottom-left JetInput in this window
70  int minEtaOffset = -1;
71  Coordinate startCoord = get.lowerLeft(m_refPhi,m_refEta);
72  if (startCoord.eta() == TrigT1CaloDefs::RegionERROREtaCentre) { // already at left edge
73  startCoord = get.downPhi(m_refPhi,m_refEta);
74  minEtaOffset = 0;
75  }
76  double tempEta = startCoord.eta();
77  double startPhi = startCoord.phi();
78 
96  std::vector<int> et6x6(4);
97  std::vector<int> cores(9);
98  for (int etaOffset=minEtaOffset; etaOffset<=2 ; etaOffset++){
99  Coordinate tempCoord(startPhi,tempEta);
100  for (int phiOffset=-1; phiOffset<=2 ; phiOffset++){
101  int tempKey = get.jeKey(tempCoord);
102  std::map<int, JetInput*>::const_iterator ji = jiContainer->find(tempKey);
103  if (ji != jiContainer->end() ){
104  // get ET once here, rather than repeat function calls
105  int ET = (ji->second)->energy();
106  // 8x8 jet is easy
107  m_ET8x8 += ET;
108  // but there are 4 possible 6x6 clusters
109  if (phiOffset > -1) {
110  if (etaOffset < 2) et6x6[1] += ET;
111  if (etaOffset > -1) et6x6[2] += ET;
112  }
113  if (phiOffset < 2) {
114  if (etaOffset < 2) et6x6[0] += ET;
115  if (etaOffset > -1) et6x6[3] += ET;
116  }
117  // Each JetInput is part of up to 4 RoI core clusters
118 
119  if (etaOffset >= 0) {
120  if (phiOffset >= 0) cores[phiOffset+3*etaOffset] += ET;
121  if (phiOffset < 2) cores[phiOffset+3*etaOffset+1] += ET;
122  }
123  if (etaOffset < 2) {
124  if (phiOffset >= 0) cores[phiOffset+3*etaOffset+3] += ET;
125  if (phiOffset < 2) cores[phiOffset+3*etaOffset+4] += ET;
126  }
127  } // end of check that jetinput exists in container
128  tempCoord = get.upPhi(tempCoord); // Increment phi coordinate
129  } // end phi offset loop
130  tempCoord = get.rightEta(tempCoord); // Increment eta coordinate
131  tempEta = tempCoord.eta();
132  if (tempEta == TrigT1CaloDefs::RegionERROREtaCentre) break; // gone outside coverage
133  } // end eta offset loop
134 
135  // 4x4 cluster = central RoI core
136  m_ET4x4 = cores[4];
137 
138  // find most energetic 6x6 cluster
139  for (int i = 0; i < 4; i++) if (et6x6[i] > m_ET6x6) m_ET6x6 = et6x6[i];
140 
141  // Check whether RoI condition is met.
142  testEtMax(cores);
143 
144  // test trigger conditions
145  passesTrigger();
146 
147 }
148 
150 }
151 

◆ ~JEMJetAlgorithm()

LVL1::JEMJetAlgorithm::~JEMJetAlgorithm ( )

Definition at line 154 of file JEMJetAlgorithm.cxx.

154  {
155 

Member Function Documentation

◆ Core()

int LVL1::JEMJetAlgorithm::Core ( )

Returns RoI Core ET.

Definition at line 251 of file JEMJetAlgorithm.cxx.

251  {
252  return ( (m_ET4x4 < m_satLarge) ? m_ET4x4 : m_satLarge );
253 }

◆ ET4x4()

int LVL1::JEMJetAlgorithm::ET4x4 ( )

Returns 4x4 TT cluster ET.

Definition at line 256 of file JEMJetAlgorithm.cxx.

256  {
257  return ( (m_ET6x6 < m_satLarge) ? m_ET6x6 : m_satLarge );
258 }

◆ ET6x6()

int LVL1::JEMJetAlgorithm::ET6x6 ( )

Returns 6x6 TT cluster ET.

Definition at line 261 of file JEMJetAlgorithm.cxx.

261  {
262  return ( (m_ET8x8 < m_satLarge) ? m_ET8x8 : m_satLarge );
263 }

◆ ET8x8()

int LVL1::JEMJetAlgorithm::ET8x8 ( )

Returns 8x8 TT cluster ET.

Definition at line 266 of file JEMJetAlgorithm.cxx.

266  {
267  return ( (m_ETLarge < m_satLarge) ? m_ETLarge : m_satLarge );
268 }

◆ eta()

double LVL1::JEMJetAlgorithm::eta ( )

Accessors.

Returns eta coordinate of RoI.

Definition at line 291 of file JEMJetAlgorithm.cxx.

291  {
292  return ( (m_phi <= M_PI) ? m_phi : m_phi - 2.*M_PI);
293 }

◆ ETLarge()

int LVL1::JEMJetAlgorithm::ETLarge ( )

Returns Large cluster ET.

Definition at line 271 of file JEMJetAlgorithm.cxx.

271  {
272  return ( (m_ETSmall < m_satSmall) ? m_ETSmall : m_satSmall );
273 }

◆ ETSmall()

int LVL1::JEMJetAlgorithm::ETSmall ( )

Returns Small cluster ET.

Definition at line 276 of file JEMJetAlgorithm.cxx.

276  {
277  return m_EtMax;
278 }

◆ isEtMax()

bool LVL1::JEMJetAlgorithm::isEtMax ( )

Does this window pass the local ET maximum condition.

Definition at line 281 of file JEMJetAlgorithm.cxx.

281  {
282  return ( m_EtMax && (m_ETLarge > 0 || m_ETSmall > 0) );
283 }

◆ isRoI()

bool LVL1::JEMJetAlgorithm::isRoI ( )

Does this window pass the local ET maximum condition.

Definition at line 286 of file JEMJetAlgorithm.cxx.

286  {
287  return m_eta;
288 }

◆ jemTobRoI()

xAOD::JEMTobRoI * LVL1::JEMJetAlgorithm::jemTobRoI ( )

Create JEMTobRoI and return pointers to it.

Returns a JEMTobRoI object, provided the TOB conditions were met.

Will return a null pointer if object does not pass hypothesis. It is the user's responsibility to check

If not will return a null pointer - user's responsibility to check

Definition at line 303 of file JEMJetAlgorithm.cxx.

◆ passesTrigger()

void LVL1::JEMJetAlgorithm::passesTrigger ( )
private

Check trigger condition and set ET values if TOB created.

Definition at line 212 of file JEMJetAlgorithm.cxx.

217  {4}; // the size of the small jets (by default 4)
218  unsigned int sizeLarge{8}; // the size of the large jets (by default 8)
219  int threshSmall{0}; // the minimum pT of small jet objects sent to TOPO (in counts, not in GeV)
220  int threshLarge{0}; // the minimum pT of large jet objects sent to TOPO (in counts, not in GeV)
221 
222  sizeSmall = 4; // not part of the new menu
223  sizeLarge = 8; // not part of the new menu
224  float scale = m_l1menu->thrExtraInfo().JET().jetScale();
227 
228  int etLarge = m_ET8x8;
229  if (sizeLarge == 6) etLarge = m_ET6x6;
230  else if (sizeLarge == 4) etLarge = m_ET4x4;
231 
232  int etSmall = m_ET4x4;
233  if (sizeSmall == 6) etLarge = m_ET6x6;
234  else if (sizeSmall == 8) etLarge = m_ET8x8;
235 
236  if (etLarge <= threshLarge && etSmall <= threshSmall) return;
237 
238  m_ETLarge = etLarge;
239  m_ETSmall = etSmall;
240 
241 }
242 
243 // Public accessor methods follow
244 

◆ phi()

double LVL1::JEMJetAlgorithm::phi ( )

Returns phi coordinate of RoI, using standard ATLAS convention.

Definition at line 296 of file JEMJetAlgorithm.cxx.

298  {

◆ setRoICoord()

void LVL1::JEMJetAlgorithm::setRoICoord ( double  eta,
double  phi 
)
private

Compute RoI coordinate.

Input coordinate should be inside "reference tower" of window. Computes RoI coordinate as centre of 2x2 element RoI core

Definition at line 159 of file JEMJetAlgorithm.cxx.

166  {
167  // Special case: no JE to right, so get centre of element at eta, phi+1
168  upperRight = keyLL.upPhi(phi, eta);
169  }
170  else {
171  // Get centre of element at eta+1, phi+1, i.e. opposite corner of RoI core
172  upperRight = keyLL.upperRight(phi, eta);
173  }
174 
175  // Now get upper-right corner of RoI core:
176  JetInputKey keyUR(upperRight);
177  double upperEta = upperRight.eta() + ( keyUR.dEta()/2. );
178  double upperPhi = upperRight.phi() + ( keyUR.dPhi()/2. );
179 
180 
181  // CoordinateRange object will compute centre, correcting for wrap-around
182  CoordinateRange roi(lowerPhi,upperPhi,lowerEta,upperEta);
183  m_eta = roi.eta();
184  m_phi = roi.phi();
185 
186 }
187 
189 void LVL1::JEMJetAlgorithm::testEtMax(const std::vector<int>& cores) {
190 

◆ testEtMax()

void LVL1::JEMJetAlgorithm::testEtMax ( const std::vector< int > &  cores)
private

Form all 2x2 clusters within window and test centre is a local ET maximum.

Input clusters form a list, arranged as
2 5 8
1 4 7
0 3 6
Then 4 = this window's RoI core, and ET max condition is
4 >= 0, 1, 2, 3 && 4 < 5, 6, 7, 8

Definition at line 194 of file JEMJetAlgorithm.cxx.

207  {
208 
209  // Belt and braces

Member Data Documentation

◆ m_ET4x4

int LVL1::JEMJetAlgorithm::m_ET4x4
private

Definition at line 83 of file JEMJetAlgorithm.h.

◆ m_ET6x6

int LVL1::JEMJetAlgorithm::m_ET6x6
private

Definition at line 84 of file JEMJetAlgorithm.h.

◆ m_ET8x8

int LVL1::JEMJetAlgorithm::m_ET8x8
private

Definition at line 85 of file JEMJetAlgorithm.h.

◆ m_eta

double LVL1::JEMJetAlgorithm::m_eta
private

Algorithm results.

Definition at line 81 of file JEMJetAlgorithm.h.

◆ m_ETLarge

int LVL1::JEMJetAlgorithm::m_ETLarge
private

Definition at line 86 of file JEMJetAlgorithm.h.

◆ m_EtMax

bool LVL1::JEMJetAlgorithm::m_EtMax
private

Definition at line 88 of file JEMJetAlgorithm.h.

◆ m_ETSmall

int LVL1::JEMJetAlgorithm::m_ETSmall
private

Definition at line 87 of file JEMJetAlgorithm.h.

◆ m_l1menu

const TrigConf::L1Menu* LVL1::JEMJetAlgorithm::m_l1menu {nullptr}
private

Definition at line 78 of file JEMJetAlgorithm.h.

◆ m_phi

double LVL1::JEMJetAlgorithm::m_phi
private

Definition at line 82 of file JEMJetAlgorithm.h.

◆ m_refEta

double LVL1::JEMJetAlgorithm::m_refEta
private

Definition at line 76 of file JEMJetAlgorithm.h.

◆ m_refPhi

double LVL1::JEMJetAlgorithm::m_refPhi
private

Definition at line 77 of file JEMJetAlgorithm.h.

◆ m_satLarge

const int LVL1::JEMJetAlgorithm::m_satLarge = 0x3FF
staticprivate

Algorithm parameters.

Definition at line 93 of file JEMJetAlgorithm.h.

◆ m_satSmall

const int LVL1::JEMJetAlgorithm::m_satSmall = 0x1FF
staticprivate

Definition at line 94 of file JEMJetAlgorithm.h.


The documentation for this class was generated from the following files:
LVL1::JEMJetAlgorithm::passesTrigger
void passesTrigger()
Check trigger condition and set ET values if TOB created.
Definition: JEMJetAlgorithm.cxx:212
LVL1::JEMJetAlgorithm::m_ETLarge
int m_ETLarge
Definition: JEMJetAlgorithm.h:86
TrigConf::L1Menu::thrExtraInfo
const L1ThrExtraInfo & thrExtraInfo() const
Access to extra info for threshold types.
Definition: L1Menu.cxx:307
LVL1::JEMJetAlgorithm::eta
double eta()
Accessors.
Definition: JEMJetAlgorithm.cxx:291
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::JEMJetAlgorithm::m_satSmall
static const int m_satSmall
Definition: JEMJetAlgorithm.h:94
LVL1::JEMJetAlgorithm::m_ET8x8
int m_ET8x8
Definition: JEMJetAlgorithm.h:85
LVL1::JEMJetAlgorithm::m_refEta
double m_refEta
Definition: JEMJetAlgorithm.h:76
LVL1::JEMJetAlgorithm::m_EtMax
bool m_EtMax
Definition: JEMJetAlgorithm.h:88
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
LVL1::JEMJetAlgorithm::setRoICoord
void setRoICoord(double eta, double phi)
Compute RoI coordinate.
Definition: JEMJetAlgorithm.cxx:159
LVL1::JEMJetAlgorithm::m_refPhi
double m_refPhi
Definition: JEMJetAlgorithm.h:77
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
lumiFormat.i
int i
Definition: lumiFormat.py:85
LVL1::JEMJetAlgorithm::Core
int Core()
Returns RoI Core ET.
Definition: JEMJetAlgorithm.cxx:251
LVL1::JEMJetAlgorithm::m_l1menu
const TrigConf::L1Menu * m_l1menu
Definition: JEMJetAlgorithm.h:78
LVL1::JEMJetAlgorithm::m_ETSmall
int m_ETSmall
Definition: JEMJetAlgorithm.h:87
LVL1::TrigT1CaloDefs::RegionERROREtaCentre
static const double RegionERROREtaCentre
Definition: TrigT1CaloDefs.h:103
LVL1::JEMJetAlgorithm::testEtMax
void testEtMax(const std::vector< int > &cores)
Form all 2x2 clusters within window and test centre is a local ET maximum.
Definition: JEMJetAlgorithm.cxx:194
LVL1::JEMJetAlgorithm::m_ET4x4
int m_ET4x4
Definition: JEMJetAlgorithm.h:83
LVL1::JEMJetAlgorithm::m_eta
double m_eta
Algorithm results.
Definition: JEMJetAlgorithm.h:81
LVL1::JEMJetAlgorithm::m_ET6x6
int m_ET6x6
Definition: JEMJetAlgorithm.h:84
LVL1::JEMJetAlgorithm::~JEMJetAlgorithm
~JEMJetAlgorithm()
Definition: JEMJetAlgorithm.cxx:154
TrigConf::L1ThrExtraInfo_JETLegacy::ptMinToTopoSmallWindowCounts
unsigned int ptMinToTopoSmallWindowCounts() const
Definition: L1ThrExtraInfo.h:107
LVL1::JEMJetAlgorithm::phi
double phi()
Returns phi coordinate of RoI, using standard ATLAS convention.
Definition: JEMJetAlgorithm.cxx:296
TrigConf::L1ThrExtraInfo_JETLegacy::jetScale
unsigned int jetScale() const
Definition: L1ThrExtraInfo.h:101
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
LVL1::JEMJetAlgorithm::m_satLarge
static const int m_satLarge
Algorithm parameters.
Definition: JEMJetAlgorithm.h:93
TrigConf::L1ThrExtraInfo_JETLegacy::ptMinToTopoLargeWindowCounts
unsigned int ptMinToTopoLargeWindowCounts() const
Definition: L1ThrExtraInfo.h:106
TrigConf::L1ThrExtraInfo::JET
const L1ThrExtraInfo_JETLegacy & JET() const
Definition: L1ThrExtraInfo.cxx:118
LVL1::JEMJetAlgorithm::m_phi
double m_phi
Definition: JEMJetAlgorithm.h:82