ATLAS Offline Software
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 
11 namespace xAOD {
12 
13 
14 // SETTER and GETTERs in the AuxContainer
15 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, float , eta , setEta )
16 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, float , phi , setPhi )
17 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, int , globalEta , setglobalEta )
18 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, unsigned int , globalPhi , setglobalPhi )
19 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, uint8_t , module , setModule )
20 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, uint8_t , fpga , setFpga )
21 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, uint8_t , channel , setChannel )
22 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, uint8_t , jFEXdataID , setJFEXdataID )
23 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, uint32_t , jFEXtowerID , setjFEXtowerID )
24 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, uint8_t , Calosource , setCalosource )
25 
26 AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<uint16_t> , et_count , setEt_count )
27 AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<uint16_t> , et_count , setEt_count )
28 
29 AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<char> , isjTowerSat , setIsjTowerSat )
30 AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<char> , isjTowerSat , setIsjTowerSat )
31 
32 // SETTER and GETTERs for the DECORATED variables!
33 
34 AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<float> , SCellEt , setSCellEt )
35 AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<float> , SCellEt , setSCellEt )
36 AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<float> , SCellEta , setSCellEta )
37 AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<float> , SCellEta , setSCellEta )
38 AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<float> , SCellPhi , setSCellPhi )
39 AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<float> , SCellPhi , setSCellPhi )
40 AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<int> , SCellID , setSCellID )
41 AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<int> , SCellID , setSCellID )
42 AUXSTORE_OBJECT_SETTER_AND_GETTER ( jFexTower_v1, std::vector<bool> , SCellMask , setSCellMask )
43 AUXSTORE_OBJECT_MOVE ( jFexTower_v1, std::vector<bool> , SCellMask , setSCellMask )
44 
45 
46 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, int , TileEt , setTileEt )
47 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, float, TileEta , setTileEta )
48 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, float, TilePhi , setTilePhi )
49 
50 
51 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, int , jtowerEtMeV , setjtowerEtMeV )
52 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, float, SCellEtMeV , setSCellEtMeV )
53 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, float, TileEtMeV , setTileEtMeV )
54 
55 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( jFexTower_v1, int, emulated_jtowerEt , setemulated_jtowerEt )
56 
57 
58 void jFexTower_v1::initialize(const float Eta,const float Phi)
60 {
61  setEta( Eta );
62  setPhi( Phi );
63 }
64 
65 void 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 );
85  setJFEXdataID( JFEXdataID );
86  setIsjTowerSat( IsjTowerSat );
87  setjFEXtowerID( IDSim );
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 
101 bool jFexTower_v1::isCore() const{
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
xAOD::AUXSTORE_PRIMITIVE_SETTER_AND_GETTER
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
xAOD::jFexTower_v1::isCore
bool isCore() const
Definition: jFexTower_v1.cxx:101
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
LArBadChanBlobUtils::Channel
Identifier32::value_type Channel
Definition: LArBadChanBlobUtils.h:24
AuxStoreAccessorMacros.h
xAOD::jFexTower_v1::et_count
const std::vector< uint16_t > & et_count() const
setter for the above
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::jFexTower_v1::fpga
uint8_t fpga() const
setter for the above
xAOD::jFexTower_v1::phi
float phi() const
setter for the above
xAOD::jFexTower_v1::setglobalEta
void setglobalEta(int)
getter for the global eta value (int)
xAOD::jFexTower_v1::setCalosource
void setCalosource(uint8_t)
getter for the calorimeter source
AUXSTORE_OBJECT_MOVE
#define AUXSTORE_OBJECT_MOVE(CL, TYPE, NAME, SETTER)
Macro creating a move accessor for complex auxiliary properties.
Definition: AuxStoreAccessorMacros.h:101
M_PI
#define M_PI
Definition: ActiveFraction.h:11
xAOD::jFexTower_v1::setEt_count
void setEt_count(const std::vector< uint16_t > &)
getter for the 11 energy counts
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
jFexTower_v1.h
Phi
@ Phi
Definition: RPCdef.h:8
xAOD::jFexTower_v1::setglobalPhi
void setglobalPhi(unsigned int)
getter for the global phi value (int)
xAOD::jFexTower_v1::setEta
void setEta(float)
getter for the global eta value (float)
xAOD::jFexTower_v1::setIsjTowerSat
void setIsjTowerSat(const std::vector< char > &)
getter for the saturation flag of jTower
Amg::setPhi
Amg::RotationMatrix3D setPhi(Amg::RotationMatrix3D mat, double angle, int convention=0)
Definition: EulerAnglesHelpers.h:102
xAOD::jFexTower_v1::globalEta
int globalEta() const
setter for the above
xAOD::jFexTower_v1::eta
float eta() const
The pseudorapidity ( )
xAOD::jFexTower_v1::setFpga
void setFpga(uint8_t)
getter for the fpga number [0-3] inclusive
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
python.PyAthena.module
module
Definition: PyAthena.py:131
xAOD::jFexTower_v1::OnlineID
int OnlineID() const
Definition: jFexTower_v1.cxx:135
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
xAOD::jFexTower_v1::initialize
void initialize(const float Eta, const float Phi)
setter
Definition: jFexTower_v1.cxx:59
xAOD::jFexTower_v1::setPhi
void setPhi(float)
getter for the global phi value (float)
xAOD::jFexTower_v1::jFEXtowerID
uint32_t jFEXtowerID() const
setter for the above
TRT::Hit::globalPhi
@ globalPhi
Definition: HitInfo.h:38
xAOD::jFexTower_v1::module
uint8_t module() const
setter for the above
xAOD::jFexTower_v1::setJFEXdataID
void setJFEXdataID(uint8_t)
getter for the location in data stream where Et is placed [0-15]
xAOD::jFexTower_v1::setChannel
void setChannel(uint8_t)
getter for the channel number [0-59]
xAOD::jFexTower_v1::setModule
void setModule(uint8_t)
getter for the module number [0-5] inclusive
copySelective.source
string source
Definition: copySelective.py:32
xAOD::jFexTower_v1::globalPhi
unsigned int globalPhi() const
setter for the above
xAOD::jFexTower_v1::setjFEXtowerID
void setjFEXtowerID(uint32_t)
getter for the jtower simulation ID
xAOD::jFexTower_v1::OfflineID
int OfflineID() const
Definition: jFexTower_v1.cxx:140
xAOD::jFexTower_v1::jTowerEt
uint16_t jTowerEt() const
setter for the above
Definition: jFexTower_v1.cxx:93
Eta
@ Eta
Definition: RPCdef.h:8
xAOD::AUXSTORE_OBJECT_SETTER_AND_GETTER
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1
Definition: CaloRings_v1.cxx:27