ATLAS Offline Software
eFEXFillEDM.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //***********************************************************************
6 // eFEXFillEDM - description
7 // ---------------------
8 // begin : 22 04 2021
9 // email : nluongo@uoregon.edu
10 //***********************************************************************
11 
13 
14 namespace LVL1 {
15 
16  // default constructor for persistency
17 
18  eFEXFillEDM::eFEXFillEDM(const std::string& type, const std::string& name, const IInterface* parent):
20  {
21  declareInterface<IeFEXFillEDM>(this);
22  }
23 
24  //----------------- Initialization ----------------------------
25 
27  {
28  return StatusCode::SUCCESS;
29  }
30 
31  //----------------- Execute ----------------------------
32 
34  {
35  return StatusCode::SUCCESS;
36  }
37 
38  //----------------- Finalisation ------------------------------
39 
41  {
42  return StatusCode::SUCCESS;
43  }
44 
45  void eFEXFillEDM::fillEmEDM(std::unique_ptr<xAOD::eFexEMRoIContainer> &container, uint8_t eFexNum, const std::unique_ptr<eFEXegTOB>& tobObject, bool xTOB) const
46  {
47  // Create the object and fill it
48  xAOD::eFexEMRoI* myEmEDM = new xAOD::eFexEMRoI();
49  container->push_back(myEmEDM);
50 
51  // Initialise either xTOB or TOB object as requested
52  if (xTOB)
53  myEmEDM->initialize(tobObject->getxTobword0(), tobObject->getxTobword1());
54  else {
55  // For TOB we must translate eFEX index into Shelf+eFEX and add these when initialising
56  uint8_t shelf = int(eFexNum/12);
57  uint8_t eFEX = eFexNum%12;
58  myEmEDM->initialize(eFEX, shelf, tobObject->getTobword());
59  }
60 
61  // Supplementary information is the same either way
62  myEmEDM->setRetaCore(tobObject->getRetaCore());
63  myEmEDM->setRetaEnv(tobObject->getRetaEnv());
64  myEmEDM->setRhadEM(tobObject->getRhadEM());
65  myEmEDM->setRhadHad(tobObject->getRhadHad());
66  myEmEDM->setWstotNumerator(tobObject->getWstotNum());
67  myEmEDM->setWstotDenominator(tobObject->getWstotDen());
68 
69  ATH_MSG_DEBUG(" setting Type: " << myEmEDM->type() << " eFEX Number: " << +myEmEDM->eFexNumber() << " shelf: " << +myEmEDM->shelfNumber() << " et: " << myEmEDM->et() << " MeV, " << myEmEDM->etTOB() << " TOB, " << myEmEDM->etXTOB() << " xTOB, eta: " << myEmEDM->eta() << " phi: " << myEmEDM->phi() << " input eFexNum: " << +eFexNum << " TOB word: " << tobObject->getTobword() << MSG::dec );
70 
71  }
72 
73  void eFEXFillEDM::fillTauEDM(std::unique_ptr<xAOD::eFexTauRoIContainer> &container, uint8_t eFexNum, const std::unique_ptr<eFEXtauTOB>& tobObject, bool xTOB) const
74  {
75  // Create the object and fill it:
76  xAOD::eFexTauRoI* myTauEDM = new xAOD::eFexTauRoI();
77  container->push_back(myTauEDM);
78 
79  // Initialise either xTOB or TOB object as requested
80  if (xTOB)
81  myTauEDM->initialize(tobObject->getxTobword0(), tobObject->getxTobword1());
82  else {
83  // For TOB we must translate eFEX index into Shelf+eFEX and add these when initialising
84  uint8_t shelf = int(eFexNum/12);
85  uint8_t eFEX = eFexNum%12;
86  myTauEDM->initialize(eFEX, shelf, tobObject->getTobword());
87  }
88 
89  // There is some ambiguity in what 'numerator'/'denominator' mean in each of the tau isolation
90  // variables rCore and rHad below, since in the more 'physical' definition, we would consider core/(core+env),
91  // whereas in the firmware we calculate core/env. Here, I store core->numerator, env->denominator.
92  // Provided we remember this when using them, we can then calculate either the 'physical' or the 'firmware' values.
93  myTauEDM->setRCoreNumerator(tobObject->getRcoreCore());
94  myTauEDM->setRCoreDenominator(tobObject->getRcoreEnv());
95  myTauEDM->setRHadNumerator(tobObject->getRhadCore());
96  myTauEDM->setRHadDenominator(tobObject->getRhadEnv());
97 
98  if (tobObject->getSCellEncoder()) {
99  tobObject->getSCellEncoder()->decorateEFexTauRoI(myTauEDM);
100  }
101 
102  ATH_MSG_DEBUG("setting tau version " << myTauEDM->tobVersion() << " eFEX Number: " << +myTauEDM->eFexNumber() << " shelf: " << +myTauEDM->shelfNumber() << " et: " << myTauEDM->et() << " eta: " << myTauEDM->eta() << " phi: " << myTauEDM->phi() << " input eFexNum: " << +eFexNum << " TOB word: " << tobObject->getTobword() <<" xTOB word 1: "<< tobObject->getxTobword0() << " xTOB word 2: " << tobObject->getxTobword1() << " BDT score: " << tobObject->getBDTScore() << " BDT score from EDM " << myTauEDM->bdtScore() << MSG::dec);
103 
104  }
105 
106 } // end of namespace bracket
107 
LVL1::eFEXFillEDM::execute
virtual StatusCode execute() override
Definition: eFEXFillEDM.cxx:33
xAOD::eFexTauRoI_v1::et
float et() const
TOB ET (decoded from TOB, stored for convenience)
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
xAOD::eFexTauRoI_v1::setRHadNumerator
void setRHadNumerator(uint16_t value)
xAOD::eFexTauRoI_v1::eta
float eta() const
setter for the above
xAOD::eFexTauRoI_v1::initialize
void initialize(unsigned int eFexNumber, unsigned int shelf, uint32_t word0)
Initialise the object with its most important properties.
Definition: eFexTauRoI_v1.cxx:27
xAOD::eFexEMRoI_v1::eFexNumber
unsigned int eFexNumber() const
Methods to decode data from the TOB/RoI and return to the user.
Definition: eFexEMRoI_v1.cxx:116
xAOD::eFexEMRoI_v1::etXTOB
unsigned int etXTOB() const
Cluster ET (xTOB ET scale, 25 MeV/count)
Definition: eFexEMRoI_v1.cxx:171
xAOD::eFexEMRoI_v1
Class describing a LVL1 eFEX EM region of interest.
Definition: eFexEMRoI_v1.h:33
xAOD::eFexEMRoI_v1::setWstotNumerator
void setWstotNumerator(uint16_t value)
xAOD::eFexEMRoI_v1::setRhadEM
void setRhadEM(uint16_t value)
xAOD::eFexTauRoI_v1::shelfNumber
unsigned int shelfNumber() const
Shelf number.
Definition: eFexTauRoI_v1.cxx:119
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
xAOD::eFexTauRoI
eFexTauRoI_v1 eFexTauRoI
Define the latest version of the eFexTauRoI class.
Definition: eFexTauRoI.h:16
xAOD::eFexTauRoI_v1::setRHadDenominator
void setRHadDenominator(uint16_t value)
xAOD::eFexEMRoI
eFexEMRoI_v1 eFexEMRoI
Define the latest version of the eFexEMRoI class.
Definition: eFexEMRoI.h:17
xAOD::eFexEMRoI_v1::setRetaEnv
void setRetaEnv(uint16_t value)
xAOD::eFexTauRoI_v1::tobVersion
unsigned int tobVersion() const
Data decoded from the TOB/RoI word and eFEX number.
Definition: eFexTauRoI_v1.cxx:109
xAOD::eFexEMRoI_v1::initialize
void initialize(unsigned int eFexNumber, unsigned int shelf, uint32_t word0)
Initialise the object with its most important properties TOB initialiser.
Definition: eFexEMRoI_v1.cxx:27
xAOD::eFexTauRoI_v1
Class describing a LVL1 eFEX tau region of interest.
Definition: eFexTauRoI_v1.h:29
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::eFexEMRoI_v1::type
ObjectType type() const
Data decoded from the TOB/RoI word and eFEX number.
Definition: eFexEMRoI_v1.cxx:126
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1::eFEXFillEDM::fillTauEDM
virtual void fillTauEDM(std::unique_ptr< xAOD::eFexTauRoIContainer > &container, uint8_t eFEXNumber, const std::unique_ptr< eFEXtauTOB > &tobObject, bool xTOB=false) const override
Create and fill a new fillTauEDM object (corresponding to this window), and return a pointer to it.
Definition: eFEXFillEDM.cxx:73
xAOD::eFexEMRoI_v1::setWstotDenominator
void setWstotDenominator(uint16_t value)
xAOD::eFexEMRoI_v1::etTOB
unsigned int etTOB() const
Cluster ET (TOB ET scale, 100 MeV/count)
Definition: eFexEMRoI_v1.cxx:157
LVL1::eFEXFillEDM::fillEmEDM
virtual void fillEmEDM(std::unique_ptr< xAOD::eFexEMRoIContainer > &container, uint8_t eFEXNumber, const std::unique_ptr< eFEXegTOB > &tobObject, bool xTOB=false) const override
Create and fill a new fillEmEDM object (corresponding to this window), and return a pointer to it.
Definition: eFEXFillEDM.cxx:45
xAOD::eFexEMRoI_v1::et
float et() const
TOB ET (decoded from TOB, stored for convenience)
TrigConf::name
Definition: HLTChainList.h:35
xAOD::eFexTauRoI_v1::phi
float phi() const
Seed supercell index within central tower (0 -> 3)
xAOD::eFexTauRoI_v1::eFexNumber
unsigned int eFexNumber() const
eFEX number
Definition: eFexTauRoI_v1.cxx:114
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::eFexEMRoI_v1::eta
float eta() const
setter for the above
LVL1::eFEXFillEDM::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: eFEXFillEDM.cxx:26
xAOD::eFexTauRoI_v1::bdtScore
unsigned int bdtScore() const
BDT Score (xTOB only)
Definition: eFexTauRoI_v1.cxx:176
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::eFexEMRoI_v1::setRhadHad
void setRhadHad(uint16_t value)
xAOD::eFexTauRoI_v1::setRCoreDenominator
void setRCoreDenominator(uint16_t value)
xAOD::eFexEMRoI_v1::shelfNumber
unsigned int shelfNumber() const
Shelf number.
Definition: eFexEMRoI_v1.cxx:121
FEXReprocessingRun3.eFEX
eFEX
Definition: FEXReprocessingRun3.py:114
LVL1::eFEXFillEDM::eFEXFillEDM
eFEXFillEDM(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
Definition: eFEXFillEDM.cxx:18
eFEXFillEDM.h
xAOD::eFexEMRoI_v1::setRetaCore
void setRetaCore(uint16_t value)
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::eFexEMRoI_v1::phi
float phi() const
Seed supercell index within central tower (0 -> 3)
xAOD::eFexTauRoI_v1::setRCoreNumerator
void setRCoreNumerator(uint16_t value)
LVL1::eFEXFillEDM::finalize
virtual StatusCode finalize() override
standard Athena-Algorithm method
Definition: eFEXFillEDM.cxx:40