Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Load Et of the test vector.
More...
#include <eFakeTower.h>
|
| eFakeTower (const std::string &type, const std::string &name, const IInterface *parent) |
| Constructor. More...
|
|
virtual StatusCode | init (const std::string &) override |
| initiate with the path to the test vector directory More...
|
|
| ~eFakeTower () |
| Destructor. More...
|
|
virtual int | getET (int FPGAid, int eta, int phi, int layer, int cell) const override |
| obtain the Et of a tower slot More...
|
|
virtual StatusCode | loadnext () override |
| Load the test vector of the next event. More...
|
|
virtual StatusCode | execute () override |
| replace the Tower Et with the ones stored in the test vector. More...
|
|
virtual StatusCode | seteTowers (eTowerContainer *) override |
| Define the eTowerContainer object for which the Et will be replaced. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StatusCode | changeFPGAET (int tmp_eTowersIDs_subset[][6], int FPGAnumber, int eFEXnumber) |
| Replace the Et in an FOGA by the ones in the test vector. More...
|
|
StatusCode | loadFPGA (int) |
| load the Et in an FPGA More...
|
|
StatusCode | loaddic (int) |
| load index of Et More...
|
|
StatusCode | changeTowerET (LVL1::eTower *inputtower, int eta, int phi, int FPGAid) const |
| Replace the Et in a tower by the ones in the test vector. More...
|
|
int | getFPGAnumber (int iefex, int ifpga) const |
| determine the index of an FPGA More...
|
|
std::vector< int > * | loadBlock (const std::string &, int) const |
| Load the Et or index in a block. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Load Et of the test vector.
Replace the Et in all towers with the ones store in test vector files for the validation of the L1Calo simulation.
The test vector files should be keep in one single directory. The Et of each FPGA should be stored in separate files. The file name should be ***.csv where The first two digits are the index of the eFEX (0-23) while the third digit is the index of the FPGA (0-3).
The Et will be set to zero if the file of an FPGA cannot be found.
The index of the Et should be defined in the first block of the test vector and the other blocks define Et of each event. An example of the test vector can be found in /athena/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/share/testvectorexample.txt.
Definition at line 51 of file eFakeTower.h.
◆ StoreGateSvc_t
◆ eFakeTower()
LVL1::eFakeTower::eFakeTower |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Constructor.
Definition at line 15 of file eFakeTower.cxx.
18 declareInterface<IeFakeTower>(
this);
◆ ~eFakeTower()
LVL1::eFakeTower::~eFakeTower |
( |
| ) |
|
Destructor.
Definition at line 21 of file eFakeTower.cxx.
23 delete allfpga.second;
25 for (
auto& allfpga :
m_dict) {
26 delete allfpga.second;
◆ changeFPGAET()
StatusCode LVL1::eFakeTower::changeFPGAET |
( |
int |
tmp_eTowersIDs_subset[][6], |
|
|
int |
FPGAnumber, |
|
|
int |
eFEXnumber |
|
) |
| |
|
private |
Replace the Et in an FOGA by the ones in the test vector.
- Parameters
-
tmp_eTowersIDs_subset | Array of tower IDs in the FPGA |
FPGAnumber | FPGA index to locate the FPGA |
eFEXnumber | eFEX index to locate the FPGA |
- Returns
- status code
Definition at line 136 of file eFakeTower.cxx.
138 for (
int myrow = 0; myrow<10; myrow++){
139 for (
int mycol = 0; mycol<6; mycol++){
151 return StatusCode::SUCCESS;
◆ changeTowerET()
StatusCode LVL1::eFakeTower::changeTowerET |
( |
LVL1::eTower * |
inputtower, |
|
|
int |
eta, |
|
|
int |
phi, |
|
|
int |
FPGAid |
|
) |
| const |
|
private |
Replace the Et in a tower by the ones in the test vector.
- Parameters
-
inputtower | eTower object to be processed |
eta | eta index to locate the SuperCell |
phi | phi index to locate the SuperCell |
FPGAid | FPGA Id to locate the SuperCell |
- Returns
- status code
Definition at line 154 of file eFakeTower.cxx.
158 inputtower->
setET(0 ,
getET(FPGAid, eta, phi, 0, 0), 0);
160 inputtower->
setET(1,
getET(FPGAid, eta, phi, 1, 0), 1);
161 inputtower->
setET(2,
getET(FPGAid, eta, phi, 1, 1), 1);
162 inputtower->
setET(3,
getET(FPGAid, eta, phi, 1, 2), 1);
163 inputtower->
setET(4,
getET(FPGAid, eta, phi, 1, 3), 1);
165 inputtower->
setET(5,
getET(FPGAid, eta, phi, 2, 0), 2);
166 inputtower->
setET(6,
getET(FPGAid, eta, phi, 2, 1), 2);
167 inputtower->
setET(7,
getET(FPGAid, eta, phi, 2, 2), 2);
168 inputtower->
setET(8,
getET(FPGAid, eta, phi, 2, 3), 2);
170 inputtower->
setET(9,
getET(FPGAid, eta, phi, 3, 0), 3);
172 inputtower->
setET(10,
getET(FPGAid, eta, phi, 4, 0), 4);
173 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode LVL1::eFakeTower::execute |
( |
| ) |
|
|
overridevirtual |
replace the Tower Et with the ones stored in the test vector.
Implements LVL1::IeFakeTower.
Definition at line 99 of file eFakeTower.cxx.
100 int FPGAtowerids[10][6];
103 for (
int efex{ 0 }; efex < 24; efex++) {
104 for (
int fpga{ 0 }; fpga < 4; fpga++) {
106 if (
sc == StatusCode::FAILURE) {
107 return StatusCode::FAILURE;
109 for (
int myrow = 0; myrow<10; myrow++){
110 for (
int mycol = 0; mycol<6; mycol++){
119 for (
int efex{ 0 }; efex < 24; efex++) {
120 for (
int fpga{ 0 }; fpga < 4; fpga++) {
122 if (
sc == StatusCode::FAILURE) {
123 return StatusCode::FAILURE;
128 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ getET()
int LVL1::eFakeTower::getET |
( |
int |
FPGAid, |
|
|
int |
eta, |
|
|
int |
phi, |
|
|
int |
layer, |
|
|
int |
cell |
|
) |
| const |
|
overridevirtual |
obtain the Et of a tower slot
- Parameters
-
FPGAid | FPGA id |
eta | eta index of the tower (0-5) |
phi | phi index of the tower (0-9) |
layer | layer (0-4) |
cell | tower slot. (pre-sample, layer-4 and had: 0, layer-2 and layer-3: 0-3) |
- Returns
- Et
Implements LVL1::IeFakeTower.
Definition at line 49 of file eFakeTower.cxx.
51 if (eta > 5 || eta < 0) {
55 if (phi > 9 || phi < 0) {
◆ getFPGAnumber()
int LVL1::eFakeTower::getFPGAnumber |
( |
int |
iefex, |
|
|
int |
ifpga |
|
) |
| const |
|
private |
determine the index of an FPGA
- Parameters
-
iefex | Id of the eFEX module (0-23) |
ifpga | Id of the FPGA (0-3) |
- Returns
- FPGA index
Definition at line 244 of file eFakeTower.cxx.
245 return iefex * 10 + ifpga;
◆ init()
StatusCode LVL1::eFakeTower::init |
( |
const std::string & |
input_fileadress | ) |
|
|
overridevirtual |
initiate with the path to the test vector directory
Implements LVL1::IeFakeTower.
Definition at line 31 of file eFakeTower.cxx.
35 std::string txt =
".txt";
36 for (
int efex{ 0 }; efex < 24; efex++) {
37 for (
int fpga{ 0 }; fpga < 4; fpga++) {
38 std::fstream fileStream;
40 if (fileStream.fail()) {
46 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& LVL1::IeFakeTower::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
Definition at line 16 of file IeFakeTower.h.
16 {
return IID_IIeFakeTower; };
◆ loadBlock()
std::vector< int > * LVL1::eFakeTower::loadBlock |
( |
const std::string & |
inputfile, |
|
|
int |
eventnumber |
|
) |
| const |
|
private |
Load the Et or index in a block.
Definition at line 209 of file eFakeTower.cxx.
211 std::string eachline;
213 std::vector<int>*
output =
new std::vector<int>;
214 if (myfile.is_open()) {
216 while (std::getline(myfile, eachline)) {
218 if (eachline.length() < 3) {
221 if (nblock < eventnumber) {
224 else if (nblock > eventnumber) {
227 std::string temvalue;
228 std::stringstream
ss(eachline);
229 while (
ss >> temvalue) {
231 if (eventnumber == 0) {
232 output->push_back(std::stoi(temvalue));
◆ loaddic()
StatusCode LVL1::eFakeTower::loaddic |
( |
int |
FPGAid | ) |
|
|
private |
load index of Et
Definition at line 201 of file eFakeTower.cxx.
203 std::string txt =
".txt";
205 m_dict.insert(std::make_pair(FPGAid, dic0));
206 return StatusCode::SUCCESS;
◆ loadFPGA()
StatusCode LVL1::eFakeTower::loadFPGA |
( |
int |
FPGAid | ) |
|
|
private |
load the Et in an FPGA
Definition at line 176 of file eFakeTower.cxx.
177 std::string txt =
".txt";
182 ATH_MSG_ERROR(
"Mapping for FPGA "<< FPGAid <<
" does not exist!");
183 return StatusCode::FAILURE;
188 if (Ets->size() != (*
m_dict[FPGAid]).size()) {
190 return StatusCode::FAILURE;
192 std::unordered_map<int, unsigned int>* ETmap =
new std::unordered_map<int, unsigned int>;
193 for (
size_t i{};
const auto &thisEt : *Ets){
194 ETmap->emplace((*
m_dict[FPGAid])[
i++], thisEt);
197 return StatusCode::SUCCESS;
◆ loadnext()
StatusCode LVL1::eFakeTower::loadnext |
( |
| ) |
|
|
overridevirtual |
Load the test vector of the next event.
Implements LVL1::IeFakeTower.
Definition at line 78 of file eFakeTower.cxx.
83 delete allfpga.second;
85 std::string txt =
".txt";
86 for (
int efex{ 0 }; efex < 24; efex++) {
87 for (
int fpga{ 0 }; fpga < 4; fpga++) {
88 std::fstream fileStream;
90 if (fileStream.fail()) {
96 return StatusCode::SUCCESS;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ seteTowers()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_alltowers
std::unordered_map<int, std::unordered_map<int, unsigned int>*> LVL1::eFakeTower::m_alltowers |
|
private |
map of all supercell ETs of FPGAs m_alltowers[FPGAid] = (supercell id,ET) supercell id = eta * 1000 + phi * 100 + layer * 10 + cell
Definition at line 146 of file eFakeTower.h.
◆ m_detStore
◆ m_dict
std::unordered_map<int, std::vector<int>*> LVL1::eFakeTower::m_dict |
|
private |
map for mapping infomation. m_dict[FPGAid] = [ list of supercell id in order ]
Definition at line 149 of file eFakeTower.h.
◆ m_eFEXFPGATowerIdProviderTool
tool needed for tower-FPGA mapping
Definition at line 137 of file eFakeTower.h.
◆ m_eTowerContainer
◆ m_evtStore
◆ m_inputfile
std::string LVL1::eFakeTower::m_inputfile |
|
private |
◆ m_numberofevents
int LVL1::eFakeTower::m_numberofevents {} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Extra patterns decribing particle interation process.
The eTower class is an interface object for eFEX trigger algorithms The purposes are twofold:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
void clearET()
Clear supercell ET values.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
static int expand(unsigned int code)
Uncompress data.
std::vector< int > * loadBlock(const std::string &, int) const
Load the Et or index in a block.
int getFPGAnumber(int iefex, int ifpga) const
determine the index of an FPGA
virtual void setOwner(IDataHandleHolder *o)=0
ToolHandle< IeFEXFPGATowerIdProvider > m_eFEXFPGATowerIdProviderTool
tool needed for tower-FPGA mapping
StatusCode loaddic(int)
load index of Et
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual int getET(int FPGAid, int eta, int phi, int layer, int cell) const override
obtain the Et of a tower slot
std::string m_inputfile
path to the input directory
std::unordered_map< int, std::vector< int > * > m_dict
map for mapping infomation. m_dict[FPGAid] = [ list of supercell id in order ]
eTowerContainer * m_eTowerContainer
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode changeTowerET(LVL1::eTower *inputtower, int eta, int phi, int FPGAid) const
Replace the Et in a tower by the ones in the test vector.
int m_numberofevents
number of events
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::unordered_map< int, std::unordered_map< int, unsigned int > * > m_alltowers
map of all supercell ETs of FPGAs m_alltowers[FPGAid] = (supercell id,ET) supercell id = eta * 1000 +...
std::string to_string(const DetectorType &type)
StatusCode changeFPGAET(int tmp_eTowersIDs_subset[][6], int FPGAnumber, int eFEXnumber)
Replace the Et in an FOGA by the ones in the test vector.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
const LVL1::eTower * findTower(int towerID) const
fast find method given identifier.
StatusCode loadFPGA(int)
load the Et in an FPGA
void setET(int cell, float et, int layer, bool ignoreDisable=false)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>