ATLAS Offline Software
Loading...
Searching...
No Matches
jFexTower_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Local include(s):
7
8// EDM includes(s):
10
11namespace xAOD {
12
13
14// SETTER and GETTERs in the AuxContainer
17AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, int , globalEta , setglobalEta )
18AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, unsigned int , globalPhi , setglobalPhi )
22AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, uint8_t , jFEXdataID , setJFEXdataID )
23AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, uint32_t , jFEXtowerID , setjFEXtowerID )
24AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, uint8_t , Calosource , setCalosource )
25
26AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<uint16_t> , et_count , setEt_count )
27AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<uint16_t> , et_count , setEt_count )
28
29AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<char> , isjTowerSat , setIsjTowerSat )
30AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<char> , isjTowerSat , setIsjTowerSat )
31
32// SETTER and GETTERs for the DECORATED variables!
33
34AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<float> , SCellEt , setSCellEt )
35AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<float> , SCellEt , setSCellEt )
36AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<float> , SCellEta , setSCellEta )
37AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<float> , SCellEta , setSCellEta )
38AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<float> , SCellPhi , setSCellPhi )
39AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<float> , SCellPhi , setSCellPhi )
40AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<int> , SCellID , setSCellID )
41AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<int> , SCellID , setSCellID )
42AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<bool> , SCellMask , setSCellMask )
43AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<bool> , SCellMask , setSCellMask )
44
45
46AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, int , TileEt , setTileEt )
47AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, float, TileEta , setTileEta )
48AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, float, TilePhi , setTilePhi )
49
50
51AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, int , jtowerEtMeV , setjtowerEtMeV )
52AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, float, SCellEtMeV , setSCellEtMeV )
53AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, float, TileEtMeV , setTileEtMeV )
54
55AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, int, emulated_jtowerEt , setemulated_jtowerEt )
56
57
58
59void jFexTower_v1::initialize(const float Eta,const float Phi)
60{
61 setEta( Eta );
62 setPhi( Phi );
63}
64
65void jFexTower_v1::initialize(const float Eta,
66 const float Phi,
67 const int globaleta,
68 const unsigned int globalphi,
69 const uint32_t IDSim,
70 const uint8_t source,
71 const std::vector<uint16_t>& Et_count,
72 const uint8_t Module,
73 const uint8_t Fpga,
74 const uint8_t Channel,
75 const uint8_t JFEXdataID,
76 const std::vector<char>& IsjTowerSat)
77{
78 setEta( Eta );
79 setPhi( Phi );
80 setglobalEta( globaleta );
81 setglobalPhi( globalphi );
82 setModule( Module );
83 setFpga( Fpga );
84 setChannel( Channel );
85 setJFEXdataID( JFEXdataID );
86 setIsjTowerSat( IsjTowerSat );
87 setjFEXtowerID( IDSim );
88 setCalosource( source );
89 setEt_count( Et_count );
90}
91
94
95 if(et_count().size() == 1){
96 return et_count().at(0);
97 }
98 return 0;
99}
100
102 // FPGA eta bounderies
103 const float eta_edge[6] = { -1.6, -0.8, 0, 0.8, 1.6, 5};
104 const float phi_edge[4] = { 0.5*M_PI, M_PI, 1.5*M_PI, 2*M_PI};
105
106 int cal_jfex = -1;
107 int cal_fpga = -1;
108
109
110 // finding the jFEX module
111 for(unsigned int leta=0; leta<6; leta++){
112 if(eta() < eta_edge[leta] ){
113 cal_jfex = leta;
114 break;
115 }
116 }
117
118 // converts phi to [0,2pi]
119 float mphi = phi() < 0 ? 2*M_PI+phi() : phi();
120
121 // finding FPGA number
122 for(unsigned int lphi=0; lphi<4; lphi++){
123 if(mphi < phi_edge[lphi] ){
124 cal_fpga = lphi;
125 break;
126 }
127 }
128
129 // correcting the FPGA number to match the firmware scheme FPGA (U4) 2 -> 3 and FPGA (U3) 3 -> 2
130 cal_fpga = cal_fpga == 2 ? 3 : cal_fpga == 3 ? 2 : cal_fpga;
131
132 return (module() == cal_jfex and fpga() == cal_fpga);
133}
134
136 int channelID = globalPhi() | ((0x80 + globalEta()) << 8);
137 return channelID;
138}
139
141 return jFEXtowerID();
142}
143
144
145} // namespace xAOD
#define M_PI
Scalar eta() const
pseudorapidity method
#define AUXSTORE_OBJECT_MOVE(CL, TYPE, NAME, SETTER)
Macro creating a move accessor for complex auxiliary properties.
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
Class describing input data of a LVL1 jFEX.
float eta() const
The pseudorapidity ( )
void setModule(uint8_t)
getter for the module number [0-5] inclusive
uint8_t fpga() const
setter for the above
void setFpga(uint8_t)
getter for the fpga number [0-3] inclusive
void initialize(const float Eta, const float Phi)
setter
void setEt_count(const std::vector< uint16_t > &)
getter for the 11 energy counts
void setPhi(float)
getter for the global phi value (float)
void setChannel(uint8_t)
getter for the channel number [0-59]
unsigned int globalPhi() const
setter for the above
uint32_t jFEXtowerID() const
setter for the above
float phi() const
setter for the above
void setglobalPhi(unsigned int)
getter for the global phi value (int)
uint8_t module() const
setter for the above
uint16_t jTowerEt() const
setter for the above
void setEta(float)
getter for the global eta value (float)
int globalEta() const
setter for the above
void setjFEXtowerID(uint32_t)
getter for the jtower simulation ID
const std::vector< uint16_t > & et_count() const
setter for the above
void setJFEXdataID(uint8_t)
getter for the location in data stream where Et is placed [0-15]
void setIsjTowerSat(const std::vector< char > &)
getter for the saturation flag of jTower
void setglobalEta(int)
getter for the global eta value (int)
void setCalosource(uint8_t)
getter for the calorimeter source
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setWord1 uint16_t
setEventNumber uint32_t