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

#include <jFexInputProvider.h>

Inheritance diagram for LVL1::jFexInputProvider:
Collaboration diagram for LVL1::jFexInputProvider:

Public Member Functions

 jFexInputProvider (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~jFexInputProvider ()
 
virtual StatusCode initialize () override final
 
virtual StatusCode fillTopoInputEvent (TCS::TopoInputEvent &) const override final
 

Private Member Functions

StatusCode fillSRJet (TCS::TopoInputEvent &inputEvent) const
 
StatusCode fillLRJet (TCS::TopoInputEvent &inputEvent) const
 
StatusCode fillEM (TCS::TopoInputEvent &inputEvent) const
 
StatusCode fillTau (TCS::TopoInputEvent &inputEvent) const
 
StatusCode fillXE (TCS::TopoInputEvent &inputEvent) const
 
StatusCode fillTE (TCS::TopoInputEvent &inputEvent) const
 

Private Attributes

ToolHandle< GenericMonitoringToolm_monTool {this, "MonTool", "", "Monitoring tool to create online histograms"}
 
SG::ReadHandleKey< xAOD::jFexSRJetRoIContainerm_jJet_EDMKey {this, "jFexSRJetRoIKey", "L1_jFexSRJetRoI", "jFEX Jet EDM"}
 
SG::ReadHandleKey< xAOD::jFexLRJetRoIContainerm_jLJet_EDMKey {this, "jFexLRJetRoIKey", "L1_jFexLRJetRoI", "jFEX LJet EDM"}
 
SG::ReadHandleKey< xAOD::jFexFwdElRoIContainerm_jEM_EDMKey {this, "jFexFwdElRoIKey", "L1_jFexFwdElRoI", "jFEX EM EDM"}
 
SG::ReadHandleKey< xAOD::jFexTauRoIContainerm_jTau_EDMKey {this, "jFexTauRoIKey", "L1_jFexTauRoI", "jFEX Tau EDM"}
 
SG::ReadHandleKey< xAOD::jFexMETRoIContainerm_jXE_EDMKey {this, "jFexMETRoIKey", "L1_jFexMETRoI", "jFEX XE EDM"}
 
SG::ReadHandleKey< xAOD::jFexSumETRoIContainerm_jTE_EDMKey {this, "jFexSumETRoIKey", "L1_jFexSumETRoI", "jFEX TE EDM"}
 
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainerm_gXEJWOJ_EDMKey {this, "gMETComponentsJwojKey", "L1_gMETComponentsJwoj", "gFEX XEJWOJ EDM"}
 

Static Private Attributes

static const int m_Et_conversion = 2
 
static const double m_sumEt_conversion = 0.01
 
static const double m_gXE_conversion = 0.01
 
static const int m_phi_conversion = 2
 
static const int m_eta_conversion = 4
 
static const double m_EtDouble_conversion = 0.1
 
static const double m_sumEtDouble_conversion = 0.1
 
static const double m_phiDouble_conversion = 0.05
 
static const double m_etaDouble_conversion = 0.025
 

Detailed Description

Definition at line 26 of file jFexInputProvider.h.

Constructor & Destructor Documentation

◆ jFexInputProvider()

jFexInputProvider::jFexInputProvider ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 33 of file jFexInputProvider.cxx.

34  :
35  base_class(type, name, parent)
36 {
37  declareInterface<LVL1::IInputTOBConverter>( this );
38 }

◆ ~jFexInputProvider()

jFexInputProvider::~jFexInputProvider ( )
virtual

Definition at line 40 of file jFexInputProvider.cxx.

41 {}

Member Function Documentation

◆ fillEM()

StatusCode jFexInputProvider::fillEM ( TCS::TopoInputEvent inputEvent) const
private

Definition at line 64 of file jFexInputProvider.cxx.

64  {
65  if (m_jEM_EDMKey.empty()) {
66  ATH_MSG_DEBUG("jFex EM input disabled, skip filling");
67  return StatusCode::SUCCESS;
68  }
70  ATH_CHECK(jEM_EDM.isValid());
71 
72  for(const xAOD::jFexFwdElRoI* jFexRoI : * jEM_EDM) {
73 
74  ATH_MSG_DEBUG( "EDM jFex Em Number: "
75  << +jFexRoI->jFexNumber() // returns an 8 bit unsigned integer referring to the jFEX number
76  << " et: "
77  << jFexRoI->et() // returns the et value of the jet in MeV unit
78  << " tobEt: "
79  << jFexRoI->tobEt() // returns the et value of the jet in units of 200 MeV
80  << " globalEta: "
81  << jFexRoI->globalEta() // returns simplified global eta in units of 0.1 (fcal straightened out, not suitable for use in L1TopoSim)
82  << " globalPhi: "
83  << jFexRoI->globalPhi() // returns simplified global phi in units of 0.1 (fcal straightened out, not suitable for use in L1TopoSim)
84  << " tobEMIso: "
85  << +jFexRoI->tobEMIso() // returns isolation bits
86  << " tobEMf1: "
87  << +jFexRoI->tobEMf1() // returns isolation bits
88  << " tobEMf2: "
89  << +jFexRoI->tobEMf2() // returns isolation bits
90  );
91 
92  unsigned int EtTopo = jFexRoI->tobEt()*m_Et_conversion;
93  unsigned int phiTopo = TSU::toTopoPhi(jFexRoI->phi());
94  int etaTopo = TSU::toTopoEta(jFexRoI->eta());
95  unsigned int isolation = jFexRoI->tobEMIso();
96  unsigned int frac1 = jFexRoI->tobEMf2();
97  unsigned int frac2 = jFexRoI->tobEMf1();
98 
99  // Avoid the events with 0 Et (events below threshold)
100  if (EtTopo==0) continue;
101 
102  TCS::jEmTOB jem( EtTopo, etaTopo, phiTopo );
103  jem.setEtDouble( static_cast<double>(EtTopo*m_EtDouble_conversion) );
104  jem.setEtaDouble( static_cast<double>(etaTopo*m_etaDouble_conversion) );
105  jem.setPhiDouble( static_cast<double>(phiTopo*m_phiDouble_conversion) );
106  jem.setIsolation( isolation );
107  jem.setFrac1( frac1 );
108  jem.setFrac2( frac2 );
109 
110  inputEvent.addjEm( jem );
111 
112  auto mon_h_jEmPt = Monitored::Scalar("jEmTOBPt", jem.EtDouble());
113  auto mon_h_jEmIsolation = Monitored::Scalar("jEmTOBIsolation", jem.isolation());
114  auto mon_h_jEmFrac1 = Monitored::Scalar("jEmTOBFrac1", jem.frac1());
115  auto mon_h_jEmFrac2 = Monitored::Scalar("jEmTOBFrac2", jem.frac2());
116  auto mon_h_jEmPhi = Monitored::Scalar("jEmTOBPhi", jem.phi());
117  auto mon_h_jEmEta = Monitored::Scalar("jEmTOBEta", jem.eta());
118  Monitored::Group(m_monTool, mon_h_jEmPt, mon_h_jEmIsolation, mon_h_jEmFrac1, mon_h_jEmFrac2, mon_h_jEmPhi, mon_h_jEmEta);
119  }
120 
121  return StatusCode::SUCCESS;
122 }

◆ fillLRJet()

StatusCode jFexInputProvider::fillLRJet ( TCS::TopoInputEvent inputEvent) const
private

Definition at line 179 of file jFexInputProvider.cxx.

179  {
180  if (m_jLJet_EDMKey.empty()) {
181  ATH_MSG_DEBUG("jFex LJet input disabled, skip filling");
182  return StatusCode::SUCCESS;
183  }
185  ATH_CHECK(jLJet_EDM.isValid());
186 
187  for(const xAOD::jFexLRJetRoI* jFexRoI : * jLJet_EDM) {
188 
189  ATH_MSG_DEBUG( "EDM jFex LJet Number: "
190  << jFexRoI->jFexNumber() // returns an 8 bit unsigned integer referring to the jFEX number
191  << " et: "
192  << jFexRoI->et() // returns the et value of the jet in MeV
193  << " tobEt: "
194  << jFexRoI->tobEt() // returns the et value of the jet in units of 200 MeV
195  << " globalEta: "
196  << jFexRoI->globalEta() // returns simplified global eta in units of 0.1 (fcal straightened out, not suitable for use in L1TopoSim)
197  << " globalPhi: "
198  << jFexRoI->globalPhi() // returns simplified global phi in units of 0.1 (fcal straightened out, not suitable for use in L1TopoSim)
199  );
200 
201  unsigned int EtTopo = jFexRoI->tobEt()*m_Et_conversion;
202  unsigned int phiTopo = TSU::toTopoPhi(jFexRoI->phi());
203  int etaTopo = TSU::toTopoEta(jFexRoI->eta());
204 
205  // Avoid the events with 0 Et (events below threshold)
206  if (EtTopo==0) continue;
207 
208  TCS::jLJetTOB jet( EtTopo, etaTopo, phiTopo );
209  jet.setEtDouble( static_cast<double>(EtTopo*m_EtDouble_conversion) );
210  jet.setEtaDouble( static_cast<double>(etaTopo*m_etaDouble_conversion) );
211  jet.setPhiDouble( static_cast<double>(phiTopo*m_phiDouble_conversion) );
212 
213  inputEvent.addjLJet( jet );
214 
215  auto mon_h_jLJetPt = Monitored::Scalar("jLJetTOBPt", jet.EtDouble());
216  auto mon_h_jLJetPhi = Monitored::Scalar("jLJetTOBPhi", jet.phi());
217  auto mon_h_jLJetEta = Monitored::Scalar("jLJetTOBEta", jet.eta());
218  Monitored::Group(m_monTool, mon_h_jLJetPt, mon_h_jLJetPhi, mon_h_jLJetEta);
219  }
220 
221  return StatusCode::SUCCESS;
222 }

◆ fillSRJet()

StatusCode jFexInputProvider::fillSRJet ( TCS::TopoInputEvent inputEvent) const
private

Definition at line 226 of file jFexInputProvider.cxx.

226  {
227  if (m_jJet_EDMKey.empty()) {
228  ATH_MSG_DEBUG("jFex Jet input disabled, skip filling");
229  return StatusCode::SUCCESS;
230  }
232  ATH_CHECK(jJet_EDM.isValid());
233 
234  for(const xAOD::jFexSRJetRoI* jFexRoI : * jJet_EDM){
235 
236  ATH_MSG_DEBUG( "EDM jFex Jet Number: "
237  << +jFexRoI->jFexNumber() // returns an 8 bit unsigned integer referring to the jFEX number
238  << " et: "
239  << jFexRoI->et() // returns the et value of the jet in MeV
240  << " tobEt: "
241  << jFexRoI->tobEt() // returns the et value of the jet in units of 200 MeV
242  << " globalEta: "
243  << jFexRoI->globalEta() // returns simplified global eta in units of 0.1 (fcal straightened out, not suitable for use in L1TopoSim)
244  << " globalPhi: "
245  << jFexRoI->globalPhi() // returns simplified global phi in units of 0.1 (fcal straightened out, not suitable for use in L1TopoSim)
246  );
247 
248  unsigned int EtTopo = jFexRoI->tobEt()*m_Et_conversion;
249  unsigned int phiTopo = TSU::toTopoPhi(jFexRoI->phi());
250  int etaTopo = TSU::toTopoEta(jFexRoI->eta());
251 
252  // Avoid the events with 0 Et (events below threshold)
253  if (EtTopo==0) continue;
254 
255  TCS::jJetTOB jet( EtTopo, etaTopo, phiTopo );
256  jet.setEtDouble( static_cast<double>(EtTopo*m_EtDouble_conversion) );
257  jet.setEtaDouble( static_cast<double>(etaTopo*m_etaDouble_conversion) );
258  jet.setPhiDouble( static_cast<double>(phiTopo*m_phiDouble_conversion) );
259 
260  inputEvent.addjJet( jet );
261 
262  auto mon_h_jJetPt = Monitored::Scalar("jJetTOBPt", jet.EtDouble());
263  auto mon_h_jJetPhi = Monitored::Scalar("jJetTOBPhi", jet.phi());
264  auto mon_h_jJetEta = Monitored::Scalar("jJetTOBEta", jet.eta());
265  Monitored::Group(m_monTool, mon_h_jJetPt, mon_h_jJetPhi, mon_h_jJetEta);
266 
267  }
268 
269  return StatusCode::SUCCESS;
270 }

◆ fillTau()

StatusCode jFexInputProvider::fillTau ( TCS::TopoInputEvent inputEvent) const
private

Definition at line 126 of file jFexInputProvider.cxx.

126  {
127  if (m_jTau_EDMKey.empty()) {
128  ATH_MSG_DEBUG("jFex Tau input disabled, skip filling");
129  return StatusCode::SUCCESS;
130  }
132  ATH_CHECK(jTau_EDM.isValid());
133 
134  for(const xAOD::jFexTauRoI* jFexRoI : * jTau_EDM) {
135 
136  ATH_MSG_DEBUG( "EDM jFex Tau Number: "
137  << +jFexRoI->jFexNumber() // returns an 8 bit unsigned integer referring to the jFEX number
138  << " et: "
139  << jFexRoI->et() // returns the et value of the jet in MeV unit
140  << " tobEt: "
141  << jFexRoI->tobEt() // returns the et value of the jet in units of 200 MeV
142  << " globalEta: "
143  << jFexRoI->globalEta() // returns simplified global eta in units of 0.1 (fcal straightened out, not suitable for use in L1TopoSim)
144  << " globalPhi: "
145  << jFexRoI->globalPhi() // returns simplified global phi in units of 0.1 (fcal straightened out, not suitable for use in L1TopoSim)
146  << " isolation: "
147  << jFexRoI->tobIso() // returns isolation value in units of 200 MeV
148  );
149 
150  unsigned int EtTopo = jFexRoI->tobEt()*m_Et_conversion;
151  unsigned int phiTopo = TSU::toTopoPhi(jFexRoI->phi());
152  int etaTopo = TSU::toTopoEta(jFexRoI->eta());
153  unsigned int isolation = jFexRoI->tobIso()*m_Et_conversion;
154 
155  // Avoid the events with 0 Et (events below threshold)
156  if (EtTopo==0) continue;
157 
158  TCS::jTauTOB jtau( EtTopo, etaTopo, phiTopo );
159  jtau.setEtDouble( static_cast<double>(EtTopo*m_EtDouble_conversion) );
160  jtau.setEtaDouble( static_cast<double>(etaTopo*m_etaDouble_conversion) );
161  jtau.setPhiDouble( static_cast<double>(phiTopo*m_phiDouble_conversion) );
162  jtau.setEtIso( isolation );
163 
164  inputEvent.addjTau( jtau );
165  inputEvent.addcTau( jtau );
166 
167  auto mon_h_jTauPt = Monitored::Scalar("jTauTOBPt", jtau.EtDouble());
168  auto mon_h_jTauIsolation = Monitored::Scalar("jTauTOBIsolation", jtau.EtIso()*m_EtDouble_conversion);
169  auto mon_h_jTauPhi = Monitored::Scalar("jTauTOBPhi", jtau.phi());
170  auto mon_h_jTauEta = Monitored::Scalar("jTauTOBEta", jtau.eta());
171  Monitored::Group(m_monTool, mon_h_jTauPt, mon_h_jTauIsolation, mon_h_jTauPhi, mon_h_jTauEta);
172  }
173 
174  return StatusCode::SUCCESS;
175 }

◆ fillTE()

StatusCode jFexInputProvider::fillTE ( TCS::TopoInputEvent inputEvent) const
private

Definition at line 414 of file jFexInputProvider.cxx.

414  {
415 
416  if (m_jTE_EDMKey.empty()) {
417  ATH_MSG_DEBUG("jFex TE input disabled, skip filling");
418  return StatusCode::SUCCESS;
419  }
420 
422  ATH_CHECK(jTE_EDM.isValid());
423 
424  int topoTE = 0;
425  int topoTEsideA = 0;
426  int topoTEsideC = 0;
427 
428  bool topoTE_sat = false;
429  // jTE variations include jTEC, jTEFWD, jTEFWDA, jTEFWDC
430  // These quantities are defined according to the jFex module number
431  // FWDA = 5, FWDC = 0, C = 1,2,3,4
432  int topoTEC = 0;
433  int topoTEFWD = 0;
434  int topoTEFWDA = 0;
435  int topoTEFWDC = 0;
436 
437 
438  for(const xAOD::jFexSumETRoI* jFexRoI : *jTE_EDM){
439 
440  // Get the TE components (upper and lower) and convert to 100 MeV units
441  int EtLowerTopo = jFexRoI->Et_lower()*m_sumEt_conversion;
442  int EtUpperTopo = jFexRoI->Et_upper()*m_sumEt_conversion;
443  int jFexNumber = jFexRoI->jFexNumber();
444  int fpgaNumber = jFexRoI->fpgaNumber();
445 
446  int Sat_lower = jFexRoI->tobSat_lower();
447  int Sat_upper = jFexRoI->tobSat_upper();
448 
449  ATH_MSG_DEBUG( "EDM jFex TE Number: "
450  << jFexNumber
451  << " FPGA Number: "
452  << fpgaNumber
453  << " Et_lower: "
454  << EtLowerTopo
455  << " Et_upper: "
456  << EtUpperTopo
457  << " Sat_lower: "
458  << Sat_lower
459  << " Sat_upper: "
460  << Sat_upper
461  );
462 
463  // jTE
464  topoTE += EtLowerTopo;
465  topoTE += EtUpperTopo;
466  topoTE_sat |= Sat_lower;
467  topoTE_sat |= Sat_upper;
468 
469  // jTESideA
470  if( jFexNumber<3 ){
471  topoTEsideA += EtLowerTopo;
472  topoTEsideA += EtUpperTopo;
473  }
474  // jTESideC
475  else{
476  topoTEsideC += EtLowerTopo;
477  topoTEsideC += EtUpperTopo;
478  }
479 
480 
481  // jTEC
482  topoTEC += EtLowerTopo;
483  if( jFexNumber!=0 && jFexNumber!=5 )
484  {
485  topoTEC += EtUpperTopo;
486  }
487 
488  // jTEFWD
489  if( jFexNumber==0 || jFexNumber==5 )
490  {
491  topoTEFWD += EtUpperTopo;
492  }
493 
494  // jTEFWDA
495  if( jFexNumber==5 )
496  {
497  topoTEFWDA += EtUpperTopo;
498  }
499 
500  // jTEFWDC
501  if( jFexNumber==0 )
502  {
503  topoTEFWDC += EtUpperTopo;
504  }
505  }
506 
507  TCS::jTETOB jte( static_cast<unsigned int>(topoTE), TCS::JTE );
508  TCS::jTETOB jtec( static_cast<unsigned int>(topoTEC), TCS::JTEC );
509  TCS::jTETOB jtefwd( static_cast<unsigned int>(topoTEFWD), TCS::JTEFWD );
510  TCS::jTETOB jtefwda( static_cast<unsigned int>(topoTEFWDA), TCS::JTEFWDA );
511  TCS::jTETOB jtefwdc( static_cast<unsigned int>(topoTEFWDC), TCS::JTEFWDC );
512 
513  jte.setSaturationFlag( static_cast<double>(topoTE_sat) );
514  jte.setSumEtDouble( static_cast<double>(topoTE*m_sumEtDouble_conversion) );
515  jtec.setSumEtDouble( static_cast<double>(topoTEC*m_sumEtDouble_conversion) );
516  jtefwd.setSumEtDouble( static_cast<double>(topoTEFWD*m_sumEtDouble_conversion) );
517  jtefwda.setSumEtDouble( static_cast<double>(topoTEFWDA*m_sumEtDouble_conversion) );
518  jtefwdc.setSumEtDouble( static_cast<double>(topoTEFWDC*m_sumEtDouble_conversion) );
519 
520  // Set the hemisphere values
521  jte.setSumEtSideA( topoTEsideA );
522  jte.setSumEtSideC( topoTEsideC );
523  jte.setSumEtDoubleSideA( static_cast<double>(topoTEsideA*m_sumEtDouble_conversion) );
524  jte.setSumEtDoubleSideC( static_cast<double>(topoTEsideC*m_sumEtDouble_conversion) );
525 
526  inputEvent.setjTE( jte );
527  inputEvent.setjTEC( jtec );
528  inputEvent.setjTEFWD( jtefwd );
529  inputEvent.setjTEFWDA( jtefwda );
530  inputEvent.setjTEFWDC( jtefwdc );
531 
532  auto mon_h_jTE_saturation = Monitored::Scalar("jTETOBsaturation", jte.saturationFlag());
533  auto mon_h_jTE_sumEt = Monitored::Scalar("jTETOBsumEt", jte.sumEtDouble());
534  auto mon_h_jTEC_sumEt = Monitored::Scalar("jTECTOBsumEt", jtec.sumEtDouble());
535  auto mon_h_jTEFWD_sumEt = Monitored::Scalar("jTEFWDTOBsumEt", jtefwd.sumEtDouble());
536  auto mon_h_jTEFWDA_sumEt = Monitored::Scalar("jTEFWDATOBsumEt", jtefwda.sumEtDouble());
537  auto mon_h_jTEFWDC_sumEt = Monitored::Scalar("jTEFWDCTOBsumEt", jtefwdc.sumEtDouble());
538  Monitored::Group(m_monTool, mon_h_jTE_saturation, mon_h_jTE_sumEt, mon_h_jTEC_sumEt, mon_h_jTEFWD_sumEt, mon_h_jTEFWDA_sumEt, mon_h_jTEFWDC_sumEt);
539 
540  return StatusCode::SUCCESS;
541 }

◆ fillTopoInputEvent()

StatusCode jFexInputProvider::fillTopoInputEvent ( TCS::TopoInputEvent inputEvent) const
finaloverridevirtual

Definition at line 545 of file jFexInputProvider.cxx.

545  {
546  ATH_CHECK(fillEM(inputEvent));
547  ATH_CHECK(fillTau(inputEvent));
548  ATH_CHECK(fillSRJet(inputEvent));
549  ATH_CHECK(fillLRJet(inputEvent));
550  ATH_CHECK(fillXE(inputEvent));
551  ATH_CHECK(fillTE(inputEvent));
552  return StatusCode::SUCCESS;
553 }

◆ fillXE()

StatusCode jFexInputProvider::fillXE ( TCS::TopoInputEvent inputEvent) const
private

Definition at line 274 of file jFexInputProvider.cxx.

274  {
275 
276  if (m_jXE_EDMKey.empty()) {
277  ATH_MSG_DEBUG("jFex XE input disabled, skip filling");
278  return StatusCode::SUCCESS;
279  }
280 
282  ATH_CHECK(jXE_EDM.isValid());
283 
284  int global_ExTopo = 0;
285  int global_EyTopo = 0;
286  int central_ExTopo = 0;
287  int central_EyTopo = 0;
288 
289  for(const xAOD::jFexMETRoI* jFexRoI : *jXE_EDM){
290 
291  // Get the XE components and convert to 100 MeV units
292  int ExTopo = jFexRoI->tobEx()*m_Et_conversion;
293  int EyTopo = jFexRoI->tobEy()*m_Et_conversion;
294  int jFexNumber = jFexRoI->jFexNumber();
295  int fpgaNumber = jFexRoI->fpgaNumber();
296 
297  int hemisphere = fpgaNumber == 0 ? -1 : 1; //Note: flipped to produce the right sign
298 
299  ExTopo = hemisphere * ExTopo;
300  EyTopo = hemisphere * EyTopo;
301 
302  global_ExTopo += ExTopo;
303  global_EyTopo += EyTopo;
304 
305  // jXEC
306  if( jFexNumber!=0 && jFexNumber!=5 ) {
307  central_ExTopo += ExTopo;
308  central_EyTopo += EyTopo;
309  }
310 
311  ATH_MSG_DEBUG( "EDM jFex XE Number: "
312  << jFexNumber
313  << " FPGA Number: "
314  << fpgaNumber
315  << " Ex: "
316  << ExTopo
317  << " Ey: "
318  << EyTopo
319  );
320  }
321 
322  long long global_ExTopoLong = static_cast<long long>(global_ExTopo);
323  long long global_EyTopoLong = static_cast<long long>(global_EyTopo);
324  long long central_ExTopoLong = static_cast<long long>(central_ExTopo);
325  long long central_EyTopoLong = static_cast<long long>(central_EyTopo);
326 
327  unsigned long long Et2Topo = global_ExTopoLong*global_ExTopoLong + global_EyTopoLong*global_EyTopoLong;
328  unsigned long long EtTopo = std::sqrt( Et2Topo );
329  unsigned long long Et2Topo_central = central_ExTopoLong*central_ExTopoLong + central_EyTopoLong*central_EyTopoLong;
330  unsigned long long EtTopo_central = std::sqrt( Et2Topo_central );
331 
332  TCS::jXETOB jxe( global_ExTopo, global_EyTopo, EtTopo, TCS::JXE );
333  TCS::jXETOB jxec( central_ExTopo, central_EyTopo, EtTopo_central, TCS::JXEC );
334 
335  jxe.setExDouble( static_cast<double>(global_ExTopo*m_EtDouble_conversion) );
336  jxe.setEyDouble( static_cast<double>(global_EyTopo*m_EtDouble_conversion) );
337  jxe.setEtDouble( static_cast<double>(EtTopo*m_EtDouble_conversion) );
338  jxe.setEt2( Et2Topo );
339  jxec.setExDouble( static_cast<double>(central_ExTopo*m_EtDouble_conversion) );
340  jxec.setEyDouble( static_cast<double>(central_EyTopo*m_EtDouble_conversion) );
341  jxec.setEtDouble( static_cast<double>(EtTopo_central*m_EtDouble_conversion) );
342  jxec.setEt2( Et2Topo_central );
343 
344  inputEvent.setjXE( jxe );
345  inputEvent.setjXEC( jxec );
346  auto mon_h_jXE_Pt = Monitored::Scalar("jXETOBPt", jxe.EtDouble());
347  auto mon_h_jXE_Phi = Monitored::Scalar("jXETOBPhi", atan2(jxe.Ey(),jxe.Ex()));
348  auto mon_h_jXEC_Pt = Monitored::Scalar("jXECTOBPt", jxec.EtDouble());
349  auto mon_h_jXEC_Phi = Monitored::Scalar("jXECTOBPhi", atan2(jxec.Ey(),jxec.Ex()));
350  Monitored::Group(m_monTool, mon_h_jXE_Pt, mon_h_jXE_Phi, mon_h_jXEC_Pt, mon_h_jXEC_Phi);
351 
352 
353  // create cXE (combined XE) last, so we can simply early-exit gracefully if no gFEX inputs are available
354  // this then leaves the internal cXE at its default (0).
355  if (m_gXEJWOJ_EDMKey.empty()) {
356  ATH_MSG_DEBUG("gFex XE input disabled, skip filling combined XE");
357  return StatusCode::SUCCESS;
358  }
360  if (! gXEJWOJ_EDM.isValid() ) {
361  //gESPRESSO is only active in HI runs and only available from data. If not present simply skip it.
362  ATH_MSG_DEBUG("gFex input is not available, skip filling cXE");
363  return StatusCode::SUCCESS;
364  }
365 
366  //re-using quantities from jFEX, obtaining gFEX ones
367  //global_ExTopoLong; //jFEX!
368  //global_EyTopoLong; //jFEX!
369  long long gXE_ExTopoLong{0};
370  long long gXE_EyTopoLong{0};
371 
372  for(const xAOD::gFexGlobalRoI* gFexRoI : * gXEJWOJ_EDM) {
373 
374  auto globalType = gFexRoI->globalType();
375  if ( globalType != 2 ) { continue; } // 2 = MET components (METx, METy)
376 
377  ATH_MSG_DEBUG( "EDM gFex XEJWOJ type: "
378  << gFexRoI->globalType()
379  << " Ex: "
380  << gFexRoI->METquantityOne() // returns the Ex component in MeV
381  << " Ey: "
382  << gFexRoI->METquantityTwo() // returns the Ey component in MeV
383  );
384 
385  int ExTopo = gFexRoI->METquantityOne()*m_gXE_conversion;
386  int EyTopo = gFexRoI->METquantityTwo()*m_gXE_conversion;
387 
388  gXE_ExTopoLong = static_cast<unsigned long long>(ExTopo);
389  gXE_EyTopoLong = static_cast<unsigned long long>(EyTopo);
390 
391  break;
392  }
393 
394  //construct cXE
395  //note: FW specification interprets weights at 10 bit unsigned fixed point, 2 integer, 8 fractional bits
396  unsigned jWeight = 0.55 * pow(2,8); //TODO: read those from menu
397  unsigned gWeight = 0.45 * pow(2,8);
398  long long cXE_x = (jWeight * global_ExTopoLong + gWeight * gXE_ExTopoLong) >> 8;
399  long long cXE_y = (jWeight * global_EyTopoLong + gWeight * gXE_EyTopoLong) >> 8;
400 
401  unsigned long long cXE_mag2 = cXE_x*cXE_x + cXE_y*cXE_y;
402  unsigned long long cXE_mag = std::sqrt( cXE_mag2 );
403 
404  TCS::jXETOB cxe_tob( cXE_x, cXE_y, cXE_mag, TCS::CXE );
405  inputEvent.setcXE( cxe_tob );
406 
407  //optional: add monitoring of cXE values as done above
408 
409  return StatusCode::SUCCESS;
410 }

◆ initialize()

StatusCode jFexInputProvider::initialize ( )
finaloverridevirtual

Definition at line 44 of file jFexInputProvider.cxx.

44  {
45 
46  CHECK(m_jJet_EDMKey.initialize(SG::AllowEmpty));
47  CHECK(m_jLJet_EDMKey.initialize(SG::AllowEmpty));
48  CHECK(m_jEM_EDMKey.initialize(SG::AllowEmpty));
49  CHECK(m_jTau_EDMKey.initialize(SG::AllowEmpty));
50  CHECK(m_jXE_EDMKey.initialize(SG::AllowEmpty));
51  CHECK(m_jTE_EDMKey.initialize(SG::AllowEmpty));
53  if (! m_gXEJWOJ_EDMKey.empty() ) {
54  renounce(m_gXEJWOJ_EDMKey); //make this optional, in case no gFEX inputs are available (running without gFEX Sim or bytestream decoding)
55  }
56 
57 
58  if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
59 
60  return StatusCode::SUCCESS;
61 }

Member Data Documentation

◆ m_Et_conversion

const int jFexInputProvider::m_Et_conversion = 2
staticprivate

Definition at line 58 of file jFexInputProvider.h.

◆ m_eta_conversion

const int jFexInputProvider::m_eta_conversion = 4
staticprivate

Definition at line 62 of file jFexInputProvider.h.

◆ m_etaDouble_conversion

const double jFexInputProvider::m_etaDouble_conversion = 0.025
staticprivate

Definition at line 67 of file jFexInputProvider.h.

◆ m_EtDouble_conversion

const double jFexInputProvider::m_EtDouble_conversion = 0.1
staticprivate

Definition at line 64 of file jFexInputProvider.h.

◆ m_gXE_conversion

const double jFexInputProvider::m_gXE_conversion = 0.01
staticprivate

Definition at line 60 of file jFexInputProvider.h.

◆ m_gXEJWOJ_EDMKey

SG::ReadHandleKey<xAOD::gFexGlobalRoIContainer> LVL1::jFexInputProvider::m_gXEJWOJ_EDMKey {this, "gMETComponentsJwojKey", "L1_gMETComponentsJwoj", "gFEX XEJWOJ EDM"}
private

Definition at line 55 of file jFexInputProvider.h.

◆ m_jEM_EDMKey

SG::ReadHandleKey<xAOD::jFexFwdElRoIContainer> LVL1::jFexInputProvider::m_jEM_EDMKey {this, "jFexFwdElRoIKey", "L1_jFexFwdElRoI", "jFEX EM EDM"}
private

Definition at line 50 of file jFexInputProvider.h.

◆ m_jJet_EDMKey

SG::ReadHandleKey<xAOD::jFexSRJetRoIContainer> LVL1::jFexInputProvider::m_jJet_EDMKey {this, "jFexSRJetRoIKey", "L1_jFexSRJetRoI", "jFEX Jet EDM"}
private

Definition at line 48 of file jFexInputProvider.h.

◆ m_jLJet_EDMKey

SG::ReadHandleKey<xAOD::jFexLRJetRoIContainer> LVL1::jFexInputProvider::m_jLJet_EDMKey {this, "jFexLRJetRoIKey", "L1_jFexLRJetRoI", "jFEX LJet EDM"}
private

Definition at line 49 of file jFexInputProvider.h.

◆ m_jTau_EDMKey

SG::ReadHandleKey<xAOD::jFexTauRoIContainer> LVL1::jFexInputProvider::m_jTau_EDMKey {this, "jFexTauRoIKey", "L1_jFexTauRoI", "jFEX Tau EDM"}
private

Definition at line 51 of file jFexInputProvider.h.

◆ m_jTE_EDMKey

SG::ReadHandleKey<xAOD::jFexSumETRoIContainer> LVL1::jFexInputProvider::m_jTE_EDMKey {this, "jFexSumETRoIKey", "L1_jFexSumETRoI", "jFEX TE EDM"}
private

Definition at line 53 of file jFexInputProvider.h.

◆ m_jXE_EDMKey

SG::ReadHandleKey<xAOD::jFexMETRoIContainer> LVL1::jFexInputProvider::m_jXE_EDMKey {this, "jFexMETRoIKey", "L1_jFexMETRoI", "jFEX XE EDM"}
private

Definition at line 52 of file jFexInputProvider.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> LVL1::jFexInputProvider::m_monTool {this, "MonTool", "", "Monitoring tool to create online histograms"}
private

Definition at line 46 of file jFexInputProvider.h.

◆ m_phi_conversion

const int jFexInputProvider::m_phi_conversion = 2
staticprivate

Definition at line 61 of file jFexInputProvider.h.

◆ m_phiDouble_conversion

const double jFexInputProvider::m_phiDouble_conversion = 0.05
staticprivate

Definition at line 66 of file jFexInputProvider.h.

◆ m_sumEt_conversion

const double jFexInputProvider::m_sumEt_conversion = 0.01
staticprivate

Definition at line 59 of file jFexInputProvider.h.

◆ m_sumEtDouble_conversion

const double jFexInputProvider::m_sumEtDouble_conversion = 0.1
staticprivate

Definition at line 65 of file jFexInputProvider.h.


The documentation for this class was generated from the following files:
LVL1::jFexInputProvider::m_etaDouble_conversion
static const double m_etaDouble_conversion
Definition: jFexInputProvider.h:67
LVL1::jFexInputProvider::fillTE
StatusCode fillTE(TCS::TopoInputEvent &inputEvent) const
Definition: jFexInputProvider.cxx:414
xAOD::jFexTauRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexTauRoI_v1.h:23
xAOD::jFexSRJetRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexSRJetRoI_v1.h:23
LVL1::jFexInputProvider::fillLRJet
StatusCode fillLRJet(TCS::TopoInputEvent &inputEvent) const
Definition: jFexInputProvider.cxx:179
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
LVL1::jFexInputProvider::m_jEM_EDMKey
SG::ReadHandleKey< xAOD::jFexFwdElRoIContainer > m_jEM_EDMKey
Definition: jFexInputProvider.h:50
LVL1::jFexInputProvider::m_Et_conversion
static const int m_Et_conversion
Definition: jFexInputProvider.h:58
TCS::TopoInputEvent::setjXEC
StatusCode setjXEC(const jXETOB &jXEC)
Definition: TopoInputEvent.cxx:151
TCS::CXE
@ CXE
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:40
TCS::JXE
@ JXE
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:27
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
LVL1::jFexInputProvider::m_jTE_EDMKey
SG::ReadHandleKey< xAOD::jFexSumETRoIContainer > m_jTE_EDMKey
Definition: jFexInputProvider.h:53
TCS::TopoInputEvent::setjTE
StatusCode setjTE(const jTETOB &jTE)
Definition: TopoInputEvent.cxx:157
TSU::toTopoEta
int toTopoEta(float eta)
Definition: Conversions.cxx:27
xAOD::gFexGlobalRoI_v1
Class describing properties of a LVL1 gFEX global Trigger Object (TOB) in the xAOD format.
Definition: gFexGlobalRoI_v1.h:25
TCS::JTEC
@ JTEC
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:31
TCS::TopoInputEvent::setjXE
StatusCode setjXE(const jXETOB &jXE)
Definition: TopoInputEvent.cxx:145
TCS::TopoInputEvent::addjJet
StatusCode addjJet(const jJetTOB &jet)
Definition: TopoInputEvent.cxx:114
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
LVL1::jFexInputProvider::m_gXEJWOJ_EDMKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gXEJWOJ_EDMKey
Definition: jFexInputProvider.h:55
xAOD::jFexMETRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexMETRoI_v1.h:22
TCS::JTEFWDA
@ JTEFWDA
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:33
xAOD::jFexLRJetRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexLRJetRoI_v1.h:23
TCS::TopoInputEvent::setjTEFWDC
StatusCode setjTEFWDC(const jTETOB &jTEFWDC)
Definition: TopoInputEvent.cxx:181
TCS::jJetTOB
Definition: jJetTOB.h:16
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
TCS::jLJetTOB
Definition: jLJetTOB.h:16
TCS::TopoInputEvent::setjTEC
StatusCode setjTEC(const jTETOB &jTEC)
Definition: TopoInputEvent.cxx:163
LVL1::jFexInputProvider::fillEM
StatusCode fillEM(TCS::TopoInputEvent &inputEvent) const
Definition: jFexInputProvider.cxx:64
TCS::JTE
@ JTE
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:30
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LVL1::jFexInputProvider::m_sumEtDouble_conversion
static const double m_sumEtDouble_conversion
Definition: jFexInputProvider.h:65
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TCS::TopoInputEvent::addjTau
StatusCode addjTau(const jTauTOB &tau)
Definition: TopoInputEvent.cxx:89
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TCS::jTauTOB
Definition: jTauTOB.h:16
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
LVL1::jFexInputProvider::m_jLJet_EDMKey
SG::ReadHandleKey< xAOD::jFexLRJetRoIContainer > m_jLJet_EDMKey
Definition: jFexInputProvider.h:49
TCS::jTETOB
Definition: jTETOB.h:13
TrigConf::name
Definition: HLTChainList.h:35
LVL1::jFexInputProvider::m_jTau_EDMKey
SG::ReadHandleKey< xAOD::jFexTauRoIContainer > m_jTau_EDMKey
Definition: jFexInputProvider.h:51
LVL1::jFexInputProvider::m_jJet_EDMKey
SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer > m_jJet_EDMKey
Definition: jFexInputProvider.h:48
LVL1::jFexInputProvider::fillSRJet
StatusCode fillSRJet(TCS::TopoInputEvent &inputEvent) const
Definition: jFexInputProvider.cxx:226
TCS::TopoInputEvent::setcXE
StatusCode setcXE(const jXETOB &cXE)
Definition: TopoInputEvent.cxx:217
LVL1::jFexInputProvider::m_jXE_EDMKey
SG::ReadHandleKey< xAOD::jFexMETRoIContainer > m_jXE_EDMKey
Definition: jFexInputProvider.h:52
xAOD::jFexSumETRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexSumETRoI_v1.h:22
LVL1::jFexInputProvider::m_phiDouble_conversion
static const double m_phiDouble_conversion
Definition: jFexInputProvider.h:66
LVL1::jFexInputProvider::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: jFexInputProvider.h:46
LVL1::jFexInputProvider::m_sumEt_conversion
static const double m_sumEt_conversion
Definition: jFexInputProvider.h:59
LVL1::jFexInputProvider::fillTau
StatusCode fillTau(TCS::TopoInputEvent &inputEvent) const
Definition: jFexInputProvider.cxx:126
TCS::JTEFWDC
@ JTEFWDC
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:34
TCS::jEmTOB
Definition: jEmTOB.h:16
TCS::JTEFWD
@ JTEFWD
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:32
TCS::TopoInputEvent::addcTau
StatusCode addcTau(const eTauTOB &eTau)
Definition: TopoInputEvent.cxx:68
TCS::JXEC
@ JXEC
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:28
LVL1::jFexInputProvider::m_gXE_conversion
static const double m_gXE_conversion
Definition: jFexInputProvider.h:60
TCS::TopoInputEvent::addjEm
StatusCode addjEm(const jEmTOB &jEm)
Definition: TopoInputEvent.cxx:58
LVL1::jFexInputProvider::m_EtDouble_conversion
static const double m_EtDouble_conversion
Definition: jFexInputProvider.h:64
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TCS::TopoInputEvent::setjTEFWD
StatusCode setjTEFWD(const jTETOB &jTEFWD)
Definition: TopoInputEvent.cxx:169
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:27
xAOD::jFexFwdElRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexFwdElRoI_v1.h:23
TCS::jXETOB
Definition: jXETOB.h:13
LVL1::jFexInputProvider::fillXE
StatusCode fillXE(TCS::TopoInputEvent &inputEvent) const
Definition: jFexInputProvider.cxx:274
TSU::toTopoPhi
unsigned int toTopoPhi(float phi)
Definition: Conversions.cxx:20
TCS::TopoInputEvent::setjTEFWDA
StatusCode setjTEFWDA(const jTETOB &jTEFWDA)
Definition: TopoInputEvent.cxx:175
TCS::TopoInputEvent::addjLJet
StatusCode addjLJet(const jLJetTOB &jet)
Definition: TopoInputEvent.cxx:104