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

This is an internal class, used in the EM/Tau trigger. More...

#include <CPMTobAlgorithm.h>

Collaboration diagram for LVL1::CPMTobAlgorithm:

Public Member Functions

 CPMTobAlgorithm (double eta, double phi, const xAOD::CPMTowerMap_t *ttContainer, const TrigConf::L1Menu *l1menu, int slice=-1)
 ~CPMTobAlgorithm ()
double eta ()
 Accessors for TOB data.
double phi ()
 Returns phi coordinate of RoI, using standard ATLAS convention.
int EMClusET ()
 Returns EM cluster ET, limited to 8 bits.
int EMIsolWord ()
 Returns EM isolation word (5 bits).
int TauClusET ()
 Returns Tau cluster ET, limited to 8 bits.
int TauIsolWord ()
 Returns Tau isolation word (5 bits).
bool isEMRoI ()
 Report whether this passed as an EM TOB.
bool isTauRoI ()
 Report whether this passed as a Tau TOB.
bool isEtMax ()
 Does this window pass the local ET maximum condition.
int CoreET ()
 Additional information for reconstruction & performance studies.
int EMCoreET ()
 Returns EM core ET.
int HadCoreET ()
 Returns Had core ET (inner isolation sum).
int EMIsolET ()
 Returns EM isolation ET.
int HadIsolET ()
 Returns Had isolation ET.
int EMLUTClus ()
 Sums with the range & precision of isolation LUT inputs.
int EMLUTEMIsol ()
 Returns EM isolation ET with range and precision of EM LUT input.
int EMLUTHadVeto ()
 Returns Had veto ET with range and precision of EM LUT input.
int TauLUTClus ()
 Returns Tau cluster ET with range and precision of LUT input.
int TauLUTEMIsol ()
 Returns EM isolation ET with range and precision of Tau LUT input.
xAOD::CPMTobRoI * EMCPMTobRoI ()
 Create CPMTobRoIs and return pointers to them.
xAOD::CPMTobRoI * TauCPMTobRoI ()
 Returns CPMTobRoI for TAU hypothesis, provided TAU Tob conditions passed.

Private Member Functions

void setRoICoord (double eta, double phi)
 threshold values
void testEtMax (const std::vector< unsigned int > &cores)
 Form all 2x2 clusters within window and test centre is a local ET maximum.
void emAlgorithm ()
 Check trigger condition and set hits if appropriate.
void tauAlgorithm ()
 Check trigger condition and set hits if appropriate.
xAOD::CPMTobRoI * createTobRoI (int type)
 Create a pointer to a CPMTobRoI and return it.

Private Attributes

double m_refEta
double m_refPhi
const TrigConf::L1Menu * m_l1menu {nullptr}
double m_eta
 Algorithm results.
double m_phi
unsigned int m_Core
unsigned int m_EMClus
unsigned int m_TauClus
unsigned int m_EMIsolWord
unsigned int m_TauIsolWord
unsigned int m_EMCore
unsigned int m_EMIsol
unsigned int m_HadCore
unsigned int m_HadIsol
bool m_EtMax
bool m_EMThresh
bool m_TauThresh

Static Private Attributes

static const unsigned int m_maxClus = 0xFF
 Algorithm parameters.
static const unsigned int m_emLUT_ClusterFirstBit = 1
static const unsigned int m_emLUT_ClusterNBits = 6
static const unsigned int m_emLUT_EMIsolFirstBit = 0
static const unsigned int m_emLUT_EMIsolNBits = 4
static const unsigned int m_emLUT_HadVetoFirstBit = 0
static const unsigned int m_emLUT_HadVetoNBits = 3
static const unsigned int m_tauLUT_ClusterFirstBit = 1
static const unsigned int m_tauLUT_ClusterNBits = 7
static const unsigned int m_tauLUT_EMIsolFirstBit = 0
static const unsigned int m_tauLUT_EMIsolNBits = 6
static const unsigned int m_noIsol = 999
static const double m_maxEta = 2.5

Detailed Description

This is an internal class, used in the EM/Tau trigger.

The CPMTobAlgorithm:

  • identifies towers used in a particular trigger window (4x4 towers)
  • forms sums required for trigger algorithm
  • identifies whether passes the RoI condition (local ET maximum)
  • returns sums (with appropriate precision)
  • returns hit bits and RoI word (if all requirements met)

Definition at line 43 of file CPMTobAlgorithm.h.

Constructor & Destructor Documentation

◆ CPMTobAlgorithm()

LVL1::CPMTobAlgorithm::CPMTobAlgorithm ( double eta,
double phi,
const xAOD::CPMTowerMap_t * ttContainer,
const TrigConf::L1Menu * l1menu,
int slice = -1 )

RoI coordinates are centre of window, while key classes are designed for TT coordinates - differ by 0.5* TT_size. Using wrong coordinate convention can lead to precision errors in key generation.

Offsetting by TT_size/4 will put coordinates inside reference TT whether input was reference TT coordinate or RoI centre coordinate. To be extra safe, the code below will then compute the centre of the reference tower.

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

Now loop over towers within window and form 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.

Definition at line 41 of file CPMTobAlgorithm.cxx.

42 :
43 m_l1menu(l1menu),
44 m_Core(0),
45 m_EMClus(0),
46 m_TauClus(0),
47 m_EMIsolWord(0),
49 m_EMCore(0),
50 m_EMIsol(0),
51 m_HadCore(0),
52 m_HadIsol(0),
53 m_EtMax(false),
54 m_EMThresh(false),
55 m_TauThresh(false)
56 //m_debug(false)
57{
70
71 TriggerTowerKey get(phi-M_PI/128.,eta-0.025);
72 Coordinate refCoord = get.coord();
73 m_refEta = refCoord.eta();
74 m_refPhi = refCoord.phi();
75
76 // Set coordinate of centre of RoI, starting from reference tower coordinate
78
92
93 std::vector<unsigned int> emEt(4);
94 std::vector<unsigned int> cores(9);
95 for (int etaOffset = -1; etaOffset <= 2; etaOffset++) {
96 double tempEta = m_refEta + etaOffset*0.1;
97 for (int phiOffset = -1; phiOffset <= 2; phiOffset++) {
98 double tempPhi = m_refPhi + phiOffset*M_PI/32;
99 int key = get.ttKey(tempPhi, tempEta);
100 xAOD::CPMTowerMap_t::const_iterator tt = ttContainer->find(key);
101 if (tt != ttContainer->end() && fabs(tempEta) < m_maxEta) {
102 // Get the TT ET values once here, rather than repeat function calls
103 int emTT = 0;
104 int hadTT = 0;
105 if (slice < 0) { // Default to using peak slice
106 emTT = (tt->second)->emEnergy();
107 hadTT = (tt->second)->hadEnergy();
108 }
109 else { // Use user-specified slice
110 emTT = (tt->second)->emSliceEnergy(slice);
111 hadTT = (tt->second)->hadSliceEnergy(slice);
112 }
113 // EM Trigger Clusters and Core clusters
114 if (etaOffset >= 0 && etaOffset <= 1 && phiOffset >= 0 && phiOffset <= 1) {
115 emEt[phiOffset+2*etaOffset] = emTT;
116 m_EMCore += emTT;
117 m_HadCore += hadTT;
118 }
119 // Isolation sums
120 else {
121 m_EMIsol += emTT;
122 m_HadIsol += hadTT;
123 }
124 // Each tower is part of up to 4 RoI core clusters
125 if (etaOffset >= 0) {
126 if (phiOffset >= 0) cores[phiOffset+3*etaOffset] += emTT + hadTT;
127 if (phiOffset < 2) cores[phiOffset+3*etaOffset+1] += emTT + hadTT;
128 }
129 if (etaOffset < 2) {
130 if (phiOffset >= 0) cores[phiOffset+3*etaOffset+3] += emTT + hadTT;
131 if (phiOffset < 2) cores[phiOffset+3*etaOffset+4] += emTT + hadTT;
132 }
133
134 }
135 } // phi offset loop
136 } // eta offset loop
137
138 // Core of this window is cores[4]
139 m_Core = cores[4];
140
141 // Form most energetic 2-tower EM cluster
142 m_EMClus = ( (emEt[0] > emEt[3]) ? emEt[0] : emEt[3] )
143 + ( (emEt[1] > emEt[2]) ? emEt[1] : emEt[2] );
144
145 // Tau cluster
147
148 // Check whether RoI condition is met.
149 testEtMax(cores);
150
151 // test cluster and isolation conditions
152 emAlgorithm();
153 tauAlgorithm();
154
155}
#define M_PI
static const double m_maxEta
void tauAlgorithm()
Check trigger condition and set hits if appropriate.
void setRoICoord(double eta, double phi)
threshold values
void testEtMax(const std::vector< unsigned int > &cores)
Form all 2x2 clusters within window and test centre is a local ET maximum.
double eta()
Accessors for TOB data.
const TrigConf::L1Menu * m_l1menu
void emAlgorithm()
Check trigger condition and set hits if appropriate.
double phi()
Returns phi coordinate of RoI, using standard ATLAS convention.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132

◆ ~CPMTobAlgorithm()

LVL1::CPMTobAlgorithm::~CPMTobAlgorithm ( )

Definition at line 157 of file CPMTobAlgorithm.cxx.

157 {
158}

Member Function Documentation

◆ CoreET()

int LVL1::CPMTobAlgorithm::CoreET ( )

Additional information for reconstruction & performance studies.

Returns RoI Core ET.

Definition at line 393 of file CPMTobAlgorithm.cxx.

393 {
394 return m_Core;
395}

◆ createTobRoI()

xAOD::CPMTobRoI * LVL1::CPMTobAlgorithm::createTobRoI ( int type)
private

Create a pointer to a CPMTobRoI and return it.

This function does not check whether a valid RoI exists - that is left to the calling functions (but as this is a private method that should be enough)

Definition at line 513 of file CPMTobAlgorithm.cxx.

513 {
514
515 xAOD::CPMTobRoI* pointer = 0;
516
517 int et = 0;
518 int isol = 0;
519
520 if (type == TrigT1CaloDefs::emTobType) {
521 et = EMClusET();
522 isol = EMIsolWord();
523 }
524 else if (type == TrigT1CaloDefs::tauTobType) {
525 et = TauClusET();
526 isol = TauIsolWord();
527 }
528 else return pointer;
529
530 // Need to calculate hardware coordinate
531 // Object coordinate is RoI centre, but this works better if use reference tower coord
532 float eta = m_eta - 0.05;
533 float phi = m_phi - M_PI/64;
534 if (phi < 0) phi += 2*M_PI;
535 Coordinate coord(phi, eta);
536 CoordToHardware convertor;
537
538 int crate = convertor.cpCrate(coord);
539 int module = convertor.cpModule(coord);
540 int chip = convertor.cpModuleFPGA(coord);
541 int location = convertor.cpModuleLocalRoI(coord);
542
543 /*
544 float phi = ( (m_phi >= 0) ? m_phi : 2.*M_PI + m_phi );
545 int crate = 2*phi/M_PI;
546 int module = (m_eta + 2.8)/0.4 + 1;
547 int iPhi = (phi - crate*M_PI/2)*32/M_PI;
548 int chip = iPhi/2;
549 int iEta = (m_eta + 2.8 - module*0.4)/0.1;
550 int iSide = iEta/2;
551 int location = (iSide << 2) + ((iPhi&1) << 1) + (iEta&1);
552 */
553
554 pointer = new xAOD::CPMTobRoI;
555 pointer->makePrivateStore();
556 pointer->initialize(crate, module, chip, location, type, et, isol);
557
558 return pointer;
559
560}
double coord
Type of coordination system.
float et(const xAOD::jFexSRJetRoI *j)
double m_eta
Algorithm results.
int EMIsolWord()
Returns EM isolation word (5 bits).
int TauIsolWord()
Returns Tau isolation word (5 bits).
int EMClusET()
Returns EM cluster ET, limited to 8 bits.
int TauClusET()
Returns Tau cluster ET, limited to 8 bits.
virtual void initialize(int crate, int cpm, int chip, int location, int type, int energy, int isol)
CPMTobRoI_v1 CPMTobRoI
Define the latest version of the CPMTobRoI class.

◆ emAlgorithm()

void LVL1::CPMTobAlgorithm::emAlgorithm ( )
private

Check trigger condition and set hits if appropriate.

Disable isolation by default, then set cut if defined and in range. Expect parameters to be on 100 MeV scale whatever the digit scale, so need to rescale if digit scale differs. Also must rescale ET sums to same scale for comparison

Definition at line 205 of file CPMTobAlgorithm.cxx.

205 {
206
207 // Initialise to correct defaults, to be sure
208 m_EMThresh = false;
209 m_EMIsolWord = 0;
210
211 // Don't waste time if it isn't an RoI candidate
212 if (!m_EtMax) return;
213
214 // Does this pass min TOB pT cut?
215 // Need to worry about digit scale not being GeV
216 float emEnergyScale = 2; // default scale
217 float tobPtMinEM = 3; // default ptmin
218 try {
219 emEnergyScale = m_l1menu->thrExtraInfo().EM().emScale();
220 tobPtMinEM = m_l1menu->thrExtraInfo().EM().ptMinToTopo();
221 } catch(const std::out_of_range&) {
222 // legacy EM not present in menu, so use default
223 }
224
225 unsigned int thresh = tobPtMinEM * emEnergyScale;
226
227 if (m_EMClus <= thresh) return;
228
229 // Passed, so there is a TOB here
230 m_EMThresh = true;
231
232 // Now calculate isolation word
233 // Define cluster and isolation values with appropriate scales and range for isolation LUT
234 unsigned int clusMask = ( (1<<m_emLUT_ClusterNBits)-1 )<<m_emLUT_ClusterFirstBit;
235 unsigned int emIsolMask = ( (1<<m_emLUT_EMIsolNBits) -1 )<<m_emLUT_EMIsolFirstBit;
236 unsigned int hadIsolMask = ( (1<<m_emLUT_HadVetoNBits)-1 )<<m_emLUT_HadVetoFirstBit;
237
238 // If cluster overflows, set all threshold bits
239 if (m_EMClus >= clusMask) {
240 m_EMIsolWord = 0x1F;
241 return;
242 }
243
244 // For consistency with LUT filling and menu parameters, convert ET sums to 100 MeV units
245 int clus = (( (m_EMClus < clusMask) ? (m_EMClus & clusMask) : clusMask ) * 10)/emEnergyScale;
246 int emIsol = (( (m_EMIsol < emIsolMask) ? (m_EMIsol & emIsolMask) : emIsolMask ) * 10)/emEnergyScale;
247 int hadVeto = (( (m_HadCore < hadIsolMask) ? (m_HadCore & hadIsolMask) : hadIsolMask ) * 10)/emEnergyScale;
248
253 std::vector<int> emisolcuts(5,m_noIsol);
254 std::vector<int> hadisolcuts(5,m_noIsol);
255 const std::string emIsolationStr1{"EMIsoForEMthr"};
256 const std::string emIsolationStr2{"HAIsoForEMthr"};
257 try {
258 for(size_t bit = 1; bit<=5; ++bit) {
259 const TrigConf::IsolationLegacy & iso = m_l1menu->thrExtraInfo().EM().isolation(emIsolationStr1, bit);
260 if(! iso.isDefined() ) {
261 continue;
262 }
263 int offset = iso.offset();
264 int slope = iso.slope();
265 int mincut = iso.mincut();
266 int upperlimit = iso.upperlimit()*10;
267 if (clus < upperlimit && bit >= 1 && bit <= 5) {
268 // As "slope" = 10* slope, rescale clus too to get fraction right.
269 int cut = offset + (slope != 0 ? 10*clus/slope : 0);
270 if (cut < mincut) cut = mincut;
271 emisolcuts[bit-1] = cut;
272 }
273 }
274 for(size_t bit = 1; bit<=5; ++bit) {
275 const TrigConf::IsolationLegacy & iso = m_l1menu->thrExtraInfo().EM().isolation(emIsolationStr2, bit);
276 if(! iso.isDefined() ) {
277 continue;
278 }
279 int offset = iso.offset();
280 int slope = iso.slope();
281 int mincut = iso.mincut();
282 int upperlimit = iso.upperlimit()*10;
283 if (clus < upperlimit && bit >= 1 && bit <= 5) {
284 // As "slope" = 10* slope, rescale clus too to get fraction right.
285 int cut = offset + (slope != 0 ? 10*clus/slope : 0);
286 if (cut < mincut) cut = mincut;
287 hadisolcuts[bit-1] = cut;
288 }
289 }
290 } catch(const std::out_of_range&) {
291 // legacy EM not present in menu removed, so use default
292 }
293
294 // Set isolation bits
295 for (unsigned int isol = 0; isol < 5; ++isol) {
296 if (emIsol <= emisolcuts[isol] && hadVeto <= hadisolcuts[isol]) m_EMIsolWord += (1 << isol);
297 }
298
299}
static const unsigned int m_emLUT_ClusterNBits
static const unsigned int m_emLUT_HadVetoFirstBit
static const unsigned int m_emLUT_HadVetoNBits
static const unsigned int m_emLUT_ClusterFirstBit
static const unsigned int m_emLUT_EMIsolFirstBit
static const unsigned int m_emLUT_EMIsolNBits
static const unsigned int m_noIsol
constexpr unsigned int bit(int n)

◆ EMClusET()

int LVL1::CPMTobAlgorithm::EMClusET ( )

Returns EM cluster ET, limited to 8 bits.

Definition at line 398 of file CPMTobAlgorithm.cxx.

398 {
399 return ( (m_EMClus < m_maxClus) ? m_EMClus : m_maxClus );
400}
static const unsigned int m_maxClus
Algorithm parameters.

◆ EMCoreET()

int LVL1::CPMTobAlgorithm::EMCoreET ( )

Returns EM core ET.

Definition at line 428 of file CPMTobAlgorithm.cxx.

428 {
429 return m_EMCore;
430}

◆ EMCPMTobRoI()

xAOD::CPMTobRoI * LVL1::CPMTobAlgorithm::EMCPMTobRoI ( )

Create CPMTobRoIs and return pointers to them.

Returns CPMTobRoI for EM hypothesis, provided EM Tob conditions passed.

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

Definition at line 488 of file CPMTobAlgorithm.cxx.

488 {
489 if (isEMRoI()) {
491 return pointer;
492 }
493
494 return 0;
495
496}
xAOD::CPMTobRoI * createTobRoI(int type)
Create a pointer to a CPMTobRoI and return it.
bool isEMRoI()
Report whether this passed as an EM TOB.

◆ EMIsolET()

int LVL1::CPMTobAlgorithm::EMIsolET ( )

Returns EM isolation ET.

Definition at line 418 of file CPMTobAlgorithm.cxx.

418 {
419 return m_EMIsol;
420}

◆ EMIsolWord()

int LVL1::CPMTobAlgorithm::EMIsolWord ( )

Returns EM isolation word (5 bits).

Definition at line 408 of file CPMTobAlgorithm.cxx.

408 {
409 return m_EMIsolWord;
410}

◆ EMLUTClus()

int LVL1::CPMTobAlgorithm::EMLUTClus ( )

Sums with the range & precision of isolation LUT inputs.

Returns EM cluster ET with range and precision of LUT input.

Definition at line 443 of file CPMTobAlgorithm.cxx.

443 {
444 int ET = (m_EMClus >> m_emLUT_ClusterFirstBit);
445 if (ET > (1<< m_emLUT_ClusterNBits) - 1) ET = (1<<m_emLUT_ClusterNBits) - 1;
446 return (ET << m_emLUT_ClusterFirstBit);
447}

◆ EMLUTEMIsol()

int LVL1::CPMTobAlgorithm::EMLUTEMIsol ( )

Returns EM isolation ET with range and precision of EM LUT input.

Definition at line 457 of file CPMTobAlgorithm.cxx.

457 {
458 int ET = (m_EMIsol >> m_emLUT_EMIsolFirstBit);
459 if (ET > (1<<m_emLUT_EMIsolNBits) - 1) ET = (1<<m_emLUT_EMIsolNBits) - 1;
460 return (ET << m_emLUT_EMIsolFirstBit);
461}

◆ EMLUTHadVeto()

int LVL1::CPMTobAlgorithm::EMLUTHadVeto ( )

Returns Had veto ET with range and precision of EM LUT input.

Definition at line 464 of file CPMTobAlgorithm.cxx.

464 {
466 if (ET > (1<<m_emLUT_HadVetoNBits) - 1) ET = (1<<m_emLUT_HadVetoNBits) - 1;
467 return (ET << m_emLUT_HadVetoFirstBit);
468}

◆ eta()

double LVL1::CPMTobAlgorithm::eta ( )

Accessors for TOB data.

Returns eta coordinate of RoI.

Definition at line 478 of file CPMTobAlgorithm.cxx.

478 {
479 return m_eta;
480}

◆ HadCoreET()

int LVL1::CPMTobAlgorithm::HadCoreET ( )

Returns Had core ET (inner isolation sum).

Definition at line 433 of file CPMTobAlgorithm.cxx.

433 {
434 return m_HadCore;
435}

◆ HadIsolET()

int LVL1::CPMTobAlgorithm::HadIsolET ( )

Returns Had isolation ET.

Definition at line 423 of file CPMTobAlgorithm.cxx.

423 {
424 return m_HadIsol;
425}

◆ isEMRoI()

bool LVL1::CPMTobAlgorithm::isEMRoI ( )

Report whether this passed as an EM TOB.

Definition at line 375 of file CPMTobAlgorithm.cxx.

375 {
376
377 bool passed = ( m_EMThresh && m_EtMax );
378
379 return passed;
380}
bool passed(DecisionID id, const DecisionIDContainer &)
checks if required decision ID is in the set of IDs in the container

◆ isEtMax()

bool LVL1::CPMTobAlgorithm::isEtMax ( )

Does this window pass the local ET maximum condition.

Definition at line 438 of file CPMTobAlgorithm.cxx.

438 {
439 return m_EtMax;
440}

◆ isTauRoI()

bool LVL1::CPMTobAlgorithm::isTauRoI ( )

Report whether this passed as a Tau TOB.

Definition at line 383 of file CPMTobAlgorithm.cxx.

383 {
384
385 bool passed = ( m_TauThresh && m_EtMax );
386
387 return passed;
388}

◆ phi()

double LVL1::CPMTobAlgorithm::phi ( )

Returns phi coordinate of RoI, using standard ATLAS convention.

Definition at line 483 of file CPMTobAlgorithm.cxx.

483 {
484 return ( (m_phi <= M_PI) ? m_phi : m_phi - 2.*M_PI);
485}

◆ setRoICoord()

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

threshold values

Compute RoI coordinate.

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

Definition at line 162 of file CPMTobAlgorithm.cxx.

162 {
163
164 // TriggerTowerKey::coord() returns centre of TriggerTower
165 TriggerTowerKey keyLL(phi,eta);
166 Coordinate lowerLeft = keyLL.coord();
167
168 // Get centre of tower at eta+1, phi+1, i.e. opposite corner of RoI core
169 double dEta = keyLL.dEta(lowerLeft);
170 double dPhi = keyLL.dPhi(lowerLeft);
171
172 TriggerTowerKey keyUR(phi+dPhi, eta + dEta);
173 Coordinate upperRight = keyUR.coord();
174
175 // CoordinateRange object will compute centre, correcting for wrap-around
176 CoordinateRange roi(lowerLeft.phi(),upperRight.phi(),lowerLeft.eta(),upperRight.eta());
177 m_eta = roi.eta();
178 m_phi = roi.phi();
179
180 // Range check (shouldn't be needed, but floating point precision errors possible)
181 if (m_eta > 2.5) m_eta = 2.5;
182 else if (m_eta < -2.5) m_eta = -2.5;
183}
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
bool dEta(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)

◆ tauAlgorithm()

void LVL1::CPMTobAlgorithm::tauAlgorithm ( )
private

Check trigger condition and set hits if appropriate.

Definition at line 303 of file CPMTobAlgorithm.cxx.

303 {
304
305 // Initialise to correct defaults, to be sure
306 m_TauThresh = false;
307 m_TauIsolWord = 0;
308
309 // Don't waste time if it isn't an RoI candidate
310 if (!m_EtMax) return;
311
312 // Does this pass min TOB pT cut?
313 // Need to worry about digit scale not being GeV
314 float emEnergyScale = 2; // default scale
315 unsigned int tobPtMinTau = 8; //default tau ptmin
316 try {
317 emEnergyScale = m_l1menu->thrExtraInfo().EM().emScale();
318 tobPtMinTau = m_l1menu->thrExtraInfo().TAU().ptMinToTopo();
319 } catch(const std::out_of_range&) {
320 // legacy EM/TAU not present in menu removed, so use default
321 }
322 unsigned int thresh = tobPtMinTau * emEnergyScale;
323
324 if (m_TauClus <= thresh) return;
325
326 // Passed, so there is a TOB here
327 m_TauThresh = true;
328
329 // Now calculate isolation word
330 // Define cluster and isolation values with appropriate scales and range for isolation LUT
331 unsigned int clusMask = ( (1<<m_tauLUT_ClusterNBits)-1 )<<m_tauLUT_ClusterFirstBit;
332 unsigned int emIsolMask = ( (1<<m_tauLUT_EMIsolNBits) -1 )<<m_tauLUT_EMIsolFirstBit;
333
334 // If cluster overflows, set all threshold bits
335 if (m_TauClus >= clusMask) {
336 m_TauIsolWord = 0x1F;
337 return;
338 }
339
340 // Convert to 100 MeV units to match parameters
341 int clus = (( (m_TauClus < clusMask) ? (m_TauClus & clusMask) : clusMask ) * 10)/emEnergyScale;
342 int emIsol = (( (m_EMIsol < emIsolMask) ? (m_EMIsol & emIsolMask) : emIsolMask ) * 10)/emEnergyScale;
343
344 // Get isolation values from menu (placeholder code - example logic)
345 std::vector<int> emisolcuts(5,m_noIsol);
346 const std::string tauIsolationStr{"EMIsoForTAUthr"};
347 try{
348 for(size_t bit = 1; bit<=5; ++bit) {
349 const TrigConf::IsolationLegacy & iso = m_l1menu->thrExtraInfo().TAU().isolation(tauIsolationStr, bit);
350 if(! iso.isDefined() ) {
351 continue;
352 }
353 int offset = iso.offset();
354 int slope = iso.slope();
355 int mincut = iso.mincut();
356 int upperlimit = iso.upperlimit()*10;
357 if (clus < upperlimit && bit >= 1 && bit <= 5) {
358 // As "slope" = 10* slope, rescale clus too to get fraction right.
359 int cut = offset + (slope != 0 ? 10*clus/slope : 0);
360 if (cut < mincut) cut = mincut;
361 emisolcuts[bit-1] = cut;
362 }
363 }
364 } catch(const std::out_of_range&) {
365 // legacy TAU not present in menu removed, so use default
366 }
367
368 // Set isolation bits
369 for (unsigned int isol = 0; isol < 5; ++isol)
370 if (emIsol <= emisolcuts[isol]) m_TauIsolWord += (1 << isol);
371
372}
static const unsigned int m_tauLUT_EMIsolNBits
static const unsigned int m_tauLUT_ClusterFirstBit
static const unsigned int m_tauLUT_EMIsolFirstBit
static const unsigned int m_tauLUT_ClusterNBits

◆ TauClusET()

int LVL1::CPMTobAlgorithm::TauClusET ( )

Returns Tau cluster ET, limited to 8 bits.

Definition at line 403 of file CPMTobAlgorithm.cxx.

403 {
404 return ( (m_TauClus < m_maxClus) ? m_TauClus : m_maxClus );
405}

◆ TauCPMTobRoI()

xAOD::CPMTobRoI * LVL1::CPMTobAlgorithm::TauCPMTobRoI ( )

Returns CPMTobRoI for TAU hypothesis, provided TAU Tob conditions passed.

Definition at line 499 of file CPMTobAlgorithm.cxx.

499 {
500
501 xAOD::CPMTobRoI* pointer = 0;
502
504
505 return pointer;
506
507}
bool isTauRoI()
Report whether this passed as a Tau TOB.

◆ TauIsolWord()

int LVL1::CPMTobAlgorithm::TauIsolWord ( )

Returns Tau isolation word (5 bits).

Definition at line 413 of file CPMTobAlgorithm.cxx.

413 {
414 return m_TauIsolWord;
415}

◆ TauLUTClus()

int LVL1::CPMTobAlgorithm::TauLUTClus ( )

Returns Tau cluster ET with range and precision of LUT input.

Definition at line 450 of file CPMTobAlgorithm.cxx.

450 {
452 if (ET > (1<<m_tauLUT_ClusterNBits) - 1) ET = (1<<m_tauLUT_ClusterNBits) - 1;
453 return (ET << m_tauLUT_ClusterFirstBit);
454}

◆ TauLUTEMIsol()

int LVL1::CPMTobAlgorithm::TauLUTEMIsol ( )

Returns EM isolation ET with range and precision of Tau LUT input.

Definition at line 471 of file CPMTobAlgorithm.cxx.

471 {
472 int ET = (m_EMIsol >> m_tauLUT_EMIsolFirstBit);
473 if (ET > (1<<m_tauLUT_EMIsolNBits) - 1) ET = (1<<m_tauLUT_EMIsolNBits) - 1;
474 return (ET << m_tauLUT_EMIsolFirstBit);
475}

◆ testEtMax()

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

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

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 186 of file CPMTobAlgorithm.cxx.

186 {
187
195
196 // RoI condition test
197 m_EtMax = true;
198 for (int i = 0; i < 4; i++) if (m_Core < cores[i]) m_EtMax = false;
199 for (int i = 5; i < 9; i++) if (m_Core <= cores[i]) m_EtMax = false;
200
201}

Member Data Documentation

◆ m_Core

unsigned int LVL1::CPMTobAlgorithm::m_Core
private

Definition at line 91 of file CPMTobAlgorithm.h.

◆ m_EMClus

unsigned int LVL1::CPMTobAlgorithm::m_EMClus
private

Definition at line 92 of file CPMTobAlgorithm.h.

◆ m_EMCore

unsigned int LVL1::CPMTobAlgorithm::m_EMCore
private

Definition at line 96 of file CPMTobAlgorithm.h.

◆ m_EMIsol

unsigned int LVL1::CPMTobAlgorithm::m_EMIsol
private

Definition at line 97 of file CPMTobAlgorithm.h.

◆ m_EMIsolWord

unsigned int LVL1::CPMTobAlgorithm::m_EMIsolWord
private

Definition at line 94 of file CPMTobAlgorithm.h.

◆ m_emLUT_ClusterFirstBit

const unsigned int LVL1::CPMTobAlgorithm::m_emLUT_ClusterFirstBit = 1
staticprivate

Definition at line 109 of file CPMTobAlgorithm.h.

◆ m_emLUT_ClusterNBits

const unsigned int LVL1::CPMTobAlgorithm::m_emLUT_ClusterNBits = 6
staticprivate

Definition at line 110 of file CPMTobAlgorithm.h.

◆ m_emLUT_EMIsolFirstBit

const unsigned int LVL1::CPMTobAlgorithm::m_emLUT_EMIsolFirstBit = 0
staticprivate

Definition at line 111 of file CPMTobAlgorithm.h.

◆ m_emLUT_EMIsolNBits

const unsigned int LVL1::CPMTobAlgorithm::m_emLUT_EMIsolNBits = 4
staticprivate

Definition at line 112 of file CPMTobAlgorithm.h.

◆ m_emLUT_HadVetoFirstBit

const unsigned int LVL1::CPMTobAlgorithm::m_emLUT_HadVetoFirstBit = 0
staticprivate

Definition at line 113 of file CPMTobAlgorithm.h.

◆ m_emLUT_HadVetoNBits

const unsigned int LVL1::CPMTobAlgorithm::m_emLUT_HadVetoNBits = 3
staticprivate

Definition at line 114 of file CPMTobAlgorithm.h.

◆ m_EMThresh

bool LVL1::CPMTobAlgorithm::m_EMThresh
private

Definition at line 101 of file CPMTobAlgorithm.h.

◆ m_eta

double LVL1::CPMTobAlgorithm::m_eta
private

Algorithm results.

Definition at line 89 of file CPMTobAlgorithm.h.

◆ m_EtMax

bool LVL1::CPMTobAlgorithm::m_EtMax
private

Definition at line 100 of file CPMTobAlgorithm.h.

◆ m_HadCore

unsigned int LVL1::CPMTobAlgorithm::m_HadCore
private

Definition at line 98 of file CPMTobAlgorithm.h.

◆ m_HadIsol

unsigned int LVL1::CPMTobAlgorithm::m_HadIsol
private

Definition at line 99 of file CPMTobAlgorithm.h.

◆ m_l1menu

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

Definition at line 86 of file CPMTobAlgorithm.h.

86{nullptr};

◆ m_maxClus

const unsigned int LVL1::CPMTobAlgorithm::m_maxClus = 0xFF
staticprivate

Algorithm parameters.

Definition at line 107 of file CPMTobAlgorithm.h.

◆ m_maxEta

const double LVL1::CPMTobAlgorithm::m_maxEta = 2.5
staticprivate

Definition at line 123 of file CPMTobAlgorithm.h.

◆ m_noIsol

const unsigned int LVL1::CPMTobAlgorithm::m_noIsol = 999
staticprivate

Definition at line 121 of file CPMTobAlgorithm.h.

◆ m_phi

double LVL1::CPMTobAlgorithm::m_phi
private

Definition at line 90 of file CPMTobAlgorithm.h.

◆ m_refEta

double LVL1::CPMTobAlgorithm::m_refEta
private

Definition at line 84 of file CPMTobAlgorithm.h.

◆ m_refPhi

double LVL1::CPMTobAlgorithm::m_refPhi
private

Definition at line 85 of file CPMTobAlgorithm.h.

◆ m_TauClus

unsigned int LVL1::CPMTobAlgorithm::m_TauClus
private

Definition at line 93 of file CPMTobAlgorithm.h.

◆ m_TauIsolWord

unsigned int LVL1::CPMTobAlgorithm::m_TauIsolWord
private

Definition at line 95 of file CPMTobAlgorithm.h.

◆ m_tauLUT_ClusterFirstBit

const unsigned int LVL1::CPMTobAlgorithm::m_tauLUT_ClusterFirstBit = 1
staticprivate

Definition at line 116 of file CPMTobAlgorithm.h.

◆ m_tauLUT_ClusterNBits

const unsigned int LVL1::CPMTobAlgorithm::m_tauLUT_ClusterNBits = 7
staticprivate

Definition at line 117 of file CPMTobAlgorithm.h.

◆ m_tauLUT_EMIsolFirstBit

const unsigned int LVL1::CPMTobAlgorithm::m_tauLUT_EMIsolFirstBit = 0
staticprivate

Definition at line 118 of file CPMTobAlgorithm.h.

◆ m_tauLUT_EMIsolNBits

const unsigned int LVL1::CPMTobAlgorithm::m_tauLUT_EMIsolNBits = 6
staticprivate

Definition at line 119 of file CPMTobAlgorithm.h.

◆ m_TauThresh

bool LVL1::CPMTobAlgorithm::m_TauThresh
private

Definition at line 102 of file CPMTobAlgorithm.h.


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