ATLAS Offline Software
Loading...
Searching...
No Matches
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
12#include "eFEXFillEDM.h"
13
14namespace LVL1 {
15
16 // default constructor for persistency
17
18 eFEXFillEDM::eFEXFillEDM(const std::string& type, const std::string& name, const IInterface* parent):
19 AthAlgTool(type, name, parent)
20 {
21 declareInterface<eFEXFillEDM>(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 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);
99
100 }
101
102} // end of namespace bracket
103
#define ATH_MSG_DEBUG(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
virtual StatusCode execute()
virtual void fillTauEDM(std::unique_ptr< xAOD::eFexTauRoIContainer > &container, uint8_t eFEXNumber, const std::unique_ptr< eFEXtauTOB > &tobObject, bool xTOB=false) const
Create and fill a new fillTauEDM object (corresponding to this window), and return a pointer to it.
eFEXFillEDM(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
virtual StatusCode initialize()
standard Athena-Algorithm method
virtual StatusCode finalize()
standard Athena-Algorithm method
virtual void fillEmEDM(std::unique_ptr< xAOD::eFexEMRoIContainer > &container, uint8_t eFEXNumber, const std::unique_ptr< eFEXegTOB > &tobObject, bool xTOB=false) const
Create and fill a new fillEmEDM object (corresponding to this window), and return a pointer to it.
float et() const
TOB ET (decoded from TOB, stored for convenience)
unsigned int shelfNumber() const
void setWstotNumerator(uint16_t value)
float eta() const
setter for the above
unsigned int eFexNumber() const
Methods to decode data from the TOB/RoI and return to the user.
void setRetaEnv(uint16_t value)
float phi() const
Seed supercell index within central tower (0 -> 3)
void setRhadHad(uint16_t value)
void initialize(unsigned int eFexNumber, unsigned int shelf, uint32_t word0)
Initialise the object with its most important properties TOB initialiser.
void setWstotDenominator(uint16_t value)
unsigned int etTOB() const
Cluster ET (TOB ET scale, 100 MeV/count)
void setRetaCore(uint16_t value)
ObjectType type() const
Data decoded from the TOB/RoI word and eFEX number.
void setRhadEM(uint16_t value)
unsigned int etXTOB() const
Cluster ET (xTOB ET scale, 25 MeV/count)
unsigned int tobVersion() const
Data decoded from the TOB/RoI word and eFEX number.
unsigned int shelfNumber() const
unsigned int eFexNumber() const
eFEX number
unsigned int bdtScore() const
BDT Score (xTOB only)
float et() const
TOB ET (decoded from TOB, stored for convenience)
float phi() const
Seed supercell index within central tower (0 -> 3)
void setRHadNumerator(uint16_t value)
void setRCoreNumerator(uint16_t value)
void setRHadDenominator(uint16_t value)
float eta() const
setter for the above
void initialize(unsigned int eFexNumber, unsigned int shelf, uint32_t word0)
Initialise the object with its most important properties.
void setRCoreDenominator(uint16_t value)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
eFexEMRoI_v1 eFexEMRoI
Define the latest version of the eFexEMRoI class.
Definition eFexEMRoI.h:17
eFexTauRoI_v1 eFexTauRoI
Define the latest version of the eFexTauRoI class.
Definition eFexTauRoI.h:16