26 declareInterface<eFEXegAlgo>(
this);
39 return StatusCode::SUCCESS;
48 return StatusCode::FAILURE;
52 return StatusCode::SUCCESS;
93 unsigned int coresum = 0;
94 unsigned int totalsum = 0;
95 unsigned int envsum = 0;
115 for (
int i=iTotalStart; i<=iTotalEnd; ++i) {
116 for(
int j=0; j<=2; ++j) {
117 if (i>=iCoreStart && i <= iCoreEnd && j>=phiStart && j<=phiEnd) {
122 unsigned int tmptot_et;
getWindowET(2,j,i,tmptot_et);
123 totalsum += tmptot_et;
128 envsum = totalsum - coresum;
131 if (coresum > 0xffff) coresum = 0xffff;
132 if (envsum > 0xffff) envsum = 0xffff;
135 retavec.push_back(coresum);
136 retavec.push_back(envsum);
142 unsigned int hadsum = 0;
143 unsigned int emsum = 0;
152 for (
int i=0; i<3; ++i) {
153 for (
int j=0; j<=2; ++j) {
167 for (
int i=iCoreStart; i<=iCoreEnd; ++i) {
168 for(
int j=0; j<=2; ++j) {
169 unsigned int tmp_et_a, tmp_et_b;
172 emsum += ( tmp_et_a + tmp_et_b );
184 for (
int i = 0; i < 3; ++i) {
185 for (
int j = 0; j <= 2; ++j) {
193 if (j == 1 && (i == 1 || i == phi2)) {
207 for (
int i = iCoreStart; i <= iCoreEnd; ++i) {
208 for (
int j = phiStart; j <= phiEnd; ++j) {
209 unsigned int tmp_et_a, tmp_et_b;
212 emsum += (tmp_et_a + tmp_et_b);
217 if (emsum > 0xffff) emsum = 0xffff;
218 if (hadsum > 0xffff) hadsum = 0xffff;
221 rhadvec.push_back(emsum);
222 rhadvec.push_back(hadsum);
227 unsigned int numer = 0;
228 unsigned int den = 0;
235 for (
int i = iStart; i <= iEnd; ++i) {
238 for (
int j = 0; j <= 2; ++j) {
251 if (numer > 0xffff) numer = 0xffff;
254 output.push_back(den);
255 output.push_back(numer);
267 cellETs.resize(16,0);
299 std::vector<unsigned int> clusterCells;
304 unsigned int PS_ET = 0;
328 unsigned int L3_ET = clusterCells[14] + clusterCells[15];
331 unsigned int totET = PS_ET + L1_ET + L2_ET + L3_ET;
334 if (totET > 0xffff) totET = 0xffff;
344 for (
const auto& p : dmCorrections) {
345 if (p.first < 25 || p.first >= 50)
continue;
346 m_corrections[0][p.first - 25] = p.second[
"EmPS"].data<
int>();
347 m_corrections[1][p.first - 25] = p.second[
"EmFR"].data<
int>();
348 m_corrections[2][p.first - 25] = p.second[
"EmMD"].data<
int>();
349 if (
msg.level() <= MSG::DEBUG) {
350 msg << MSG::DEBUG <<
"DM Correction for etaIdx=" << (p.first - 25) <<
" : [" <<
m_corrections[0][p.first - 25] <<
","
359 if ( !
m_dmCorr || layer > 2 )
return ET;
369 else if (efexEta == 1 &&
m_fpgaid > 1) {
373 else if (efexEta == 1) {
382 static std::once_flag flag;
383 std::call_once(flag, [&]() {
389 if(dmCorrections->size()==0 && Gaudi::Hive::currentContext().eventID().time_stamp()>1672527600) {
391 throw std::runtime_error(
"No dead material corrections found in database for this event");
400 unsigned int factor = m_corrections.corr(layer, ieta);
407 unsigned int correction = ET;
408 for (
int bit = 6; bit >= 0; bit--) {
410 if (factor & (1<<bit))
420 std::unique_ptr<eFEXegTOB> out = std::make_unique<eFEXegTOB>();
423 std::vector<unsigned int> temvector;
428 out->setWstotNum(temvector[1]);
429 out->setWstotDen(temvector[0]);
431 out->setRhadEM(temvector[0]);
432 out->setRhadHad(temvector[1]);
434 out->setRetaCore(temvector[0]);
435 out->setRetaEnv(temvector[1]);
451 if (layer==1 || layer==2) {
452 outET = tmpTower->
getET(layer,etaID);
453 }
else if (layer==0 || layer==3 || layer==4) {
457 }
else if (SCID>=0 && SCID<4) {
459 if (layer==1 || layer==2) {
460 outET = tmpTower->
getET(layer,SCID);
461 }
else if (layer==0 || layer==3 || layer==4) {
470 if (layer==1 || layer==2) {
471 outET = tmpTower->
getET(layer,etaID);
472 }
else if (layer==0 || layer==3 || layer==4) {
479 if (outET > 0xffff) outET = 0xffff;
487 std::vector<unsigned int> & RetaSums,
488 std::vector<unsigned int> & RhadSums,
489 std::vector<unsigned int> & WstotSums)
509 unsigned int tmpID = 999;
510 unsigned int maxET = 0;
512 for (
int i=0; i<4 ; ++i) {
519 unsigned int iSeedET;
521 unsigned int cETDown;
529 unsigned int lETDown;
537 unsigned int rETDown;
541 if (iSeedET>=lET && iSeedET>rET
542 && iSeedET>=lETUp && iSeedET>cETUp && iSeedET>rETUp
543 && iSeedET>=lETDown && iSeedET>=cETDown && iSeedET>rETDown) {
544 if (iSeedET>=maxET) {
554 unsigned int tmp_et_up, tmp_et_down;
557 if (tmp_et_up >= tmp_et_down) {
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
This class is a collection of AttributeLists where each one is associated with a channel number.
virtual ~eFEXegAlgo()
Destructor.
virtual unsigned int getET()
virtual void getReta(std::vector< unsigned int > &)
virtual void getRealPhi(float &phi)
int m_eFEXegAlgoTowerID[3][3]
SG::ReadHandleKey< LVL1::eTowerContainer > m_eTowerContainerKey
Gaudi::Property< int > m_algoVersion
virtual void setup(int inputTable[3][3], int efex_id, int fpga_id, int central_eta)
const LVL1::eTowerContainer * m_eTowers
virtual void getRealEta(float &eta)
virtual std::unique_ptr< eFEXegTOB > geteFEXegTOB()
virtual void getSums(unsigned int seed, bool UnD, std::vector< unsigned int > &RetaSums, std::vector< unsigned int > &RhadSums, std::vector< unsigned int > &WstotSums)
virtual StatusCode initialize()
standard Athena-Algorithm method
virtual StatusCode safetyTest(const EventContext &ctx)
SG::ReadCondHandleKey< CondAttrListCollection > m_dmCorrectionsKey
eFEXegAlgo(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
virtual unsigned int dmCorrection(unsigned int ET, unsigned int layer)
virtual void getCoreEMTowerET(unsigned int &et)
virtual void getWstot(std::vector< unsigned int > &)
virtual void getWindowET(int layer, int jPhi, int SCID, unsigned int &)
virtual void getClusterCells(std::vector< unsigned int > &cellETs)
Return cell ET values used in cluster.
Gaudi::Property< bool > m_dmCorr
virtual void getRhad(std::vector< unsigned int > &)
virtual void getCoreHADTowerET(unsigned int &et)
The eTower class is an interface object for eFEX trigger algorithms The purposes are twofold:
int getLayerTotalET(unsigned int layer) const
Get total ET sum of all cells in a given layer in MeV.
int getET(unsigned int layer, int cell=0) const
Get ET of a specified cell in MeV.
const_pointer_type cptr()
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Extra patterns decribing particle interation process.