ATLAS Offline Software
TileL2.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //***************************************************************************
6 // Filename : TileL2.h
7 // Author : Aranzazu Ruiz
8 // Created : March 2006
9 //
10 // DESCRIPTION:
11 // L2 is the class which keeps various numbers pre-calculated in ROD
12 // which can be used in Level 2 trigger
13 // One TileL2 contains all numbers for one drawer
14 //
15 // HISTORY:
16 //
17 // ***************************************************************************
18 
19 #ifndef TILEEVENT_TILEL2_H
20 #define TILEEVENT_TILEL2_H
21 
22 #include <vector>
23 #include <string>
24 
33 class TileL2 {
34 
35  public:
36 
38  TileL2() : m_ID(0), m_phi(0.0), m_cosphi(0.0), m_sinphi(0.0) {}
39 
41  TileL2(int id);
42 
44  TileL2(int id, float /* phi */);
45 
46 
47  /* Set methods */
48 
50  void setMu(const std::vector<float>& eta,
51  const std::vector<float>& enemu0,
52  const std::vector<float>& enemu1,
53  const std::vector<float>& enemu2,
54  const std::vector<unsigned int>& qual,
55  const std::vector<unsigned int>& val)
56  {
57  m_eta = eta;
58  m_enemu0 = enemu0;
59  m_enemu1 = enemu1;
60  m_enemu2 = enemu2;
62  m_val = val;
63  }
64 
65  void setMu(std::vector<float>&& eta,
66  std::vector<float>&& enemu0,
67  std::vector<float>&& enemu1,
68  std::vector<float>&& enemu2,
69  std::vector<unsigned int>&& qual,
70  std::vector<unsigned int>&& val)
71  {
72  m_eta = std::move(eta);
73  m_enemu0 = std::move(enemu0);
74  m_enemu1 = std::move(enemu1);
75  m_enemu2 = std::move(enemu2);
76  m_quality_factor = std::move(qual);
77  m_val = std::move(val);
78  }
79 
81  inline void setEt(std::vector<float>&& sumE) {m_sumE = std::move(sumE); }
82 
83  /* Access methods */
84 
86  inline int identify(void) const { return m_ID; }
87 
89  inline unsigned int Ndata() const { return m_val.size(); }
90 
92  inline unsigned int val(unsigned int i) const { return m_val[i]; }
93  inline const std::vector<unsigned int>& val() const { return m_val; }
94 
96  inline unsigned int NMuons() const { return m_eta.size(); }
97 
99  inline float eta(unsigned int ind) const { return m_eta[ind]; }
100  inline const std::vector<float>& eta() const { return m_eta; }
101 
103  inline float phi(unsigned int /* ind=0 */) const { return m_phi; }
104 
106  inline float cosphi() const { return m_cosphi; }
107 
109  inline float sinphi() const { return m_sinphi; }
110 
112  inline float enemu0(unsigned int ind) const { return m_enemu0[ind]; }
113  inline const std::vector<float>& enemu0() const { return m_enemu0; }
114 
116  inline float enemu1(unsigned int ind) const { return m_enemu1[ind]; }
117  inline const std::vector<float>& enemu1() const { return m_enemu1; }
118 
120  inline float enemu2(unsigned int ind) const { return m_enemu2[ind]; }
121  inline const std::vector<float>& enemu2() const { return m_enemu2; }
122 
127  inline unsigned int qual(unsigned int ind) const { return m_quality_factor[ind]; }
128  inline const std::vector<unsigned int>& qual() const { return m_quality_factor; }
129 
131  inline unsigned int NsumE() const { return m_sumE.size(); }
132 
134  inline float Ex() const { return (m_sumE.size()>0)?m_sumE[0]*m_cosphi:0.0; }
135 
137  inline float Ey() const { return (m_sumE.size()>0)?m_sumE[0]*m_sinphi:0.0; }
138 
140  inline float Ez() const { return (m_sumE.size()>1)?((m_ID&0x100)?m_sumE[1]:-m_sumE[1]):0.0; }
141 
143  inline float Et() const { return (m_sumE.size()>0)?m_sumE[0]:0.0; }
144  inline float sumEt() const { return (m_sumE.size()>0)?m_sumE[0]:0.0; }
145 
147  inline float sumEz() const { return (m_sumE.size()>1)?m_sumE[1]:0.0; }
148 
150  inline float sumE() const { return (m_sumE.size()>2)?m_sumE[2]:0.0; }
151 
153  inline float sumE(unsigned int ind) const { return m_sumE[ind]; }
154  inline const std::vector<float>& sumEVec() const { return m_sumE; }
155 
157  std::string whoami (void) const { return "TileL2"; }
158 
160  void print (void) const;
161 
164  operator std::string() const;
165 
167  void clear();
168  inline void setzero() { clear(); }
169 
170 private:
171  friend class TileL2Cnv_p1;
172 
174  int m_ID;
175 
177  void setphi();
178 
180  float m_phi;
181  float m_cosphi;
182  float m_sinphi;
183 
185  std::vector<float> m_sumE;
186 
188  std::vector<float> m_eta;
189 
191  std::vector<float> m_enemu0;
192 
194  std::vector<float> m_enemu1;
195 
197  std::vector<float> m_enemu2;
198 
200  std::vector<unsigned int> m_quality_factor;
201 
203  std::vector<unsigned int> m_val;
204 };
205 
206 #endif //TILEEVENT_TILEL2_H
TileL2Cnv_p1
Definition: TileL2Cnv_p1.h:26
TileL2::setzero
void setzero()
Definition: TileL2.h:168
TileL2::m_eta
std::vector< float > m_eta
Muon eta.
Definition: TileL2.h:188
TileL2::m_quality_factor
std::vector< unsigned int > m_quality_factor
Quality flag for tight and loose muon selection.
Definition: TileL2.h:200
TileL2::whoami
std::string whoami(void) const
Return identification.
Definition: TileL2.h:157
TileL2::sinphi
float sinphi() const
Return sin(phi)
Definition: TileL2.h:109
TileL2::Ez
float Ez() const
Return Ez in a TileCal superdrawer (ROD-based)
Definition: TileL2.h:140
TileL2::sumEt
float sumEt() const
Definition: TileL2.h:144
TileL2::qual
const std::vector< unsigned int > & qual() const
Definition: TileL2.h:128
TileL2::m_cosphi
float m_cosphi
Definition: TileL2.h:181
TileL2::identify
int identify(void) const
Return Identifier.
Definition: TileL2.h:86
TileL2::val
unsigned int val(unsigned int i) const
Return Data.
Definition: TileL2.h:92
TileL2::sumE
float sumE(unsigned int ind) const
Return sumE i-th element.
Definition: TileL2.h:153
TileL2::sumEVec
const std::vector< float > & sumEVec() const
Definition: TileL2.h:154
TileL2::sumEz
float sumEz() const
Return sumEz in a TileCal superdrawer (ROD-based)
Definition: TileL2.h:147
TileL2::m_enemu1
std::vector< float > m_enemu1
Energy deposited by the muons in TileCal central layer.
Definition: TileL2.h:194
TileL2::Ndata
unsigned int Ndata() const
Return number of data words.
Definition: TileL2.h:89
TileL2::print
void print(void) const
Printing for debugging.
Definition: TileL2.cxx:49
TileL2::m_ID
int m_ID
Drawer ID: 0x100-0x13F, 0x200-0x23F, 0x300-0x33F, 0x400-0x43F.
Definition: TileL2.h:174
TileL2::enemu1
const std::vector< float > & enemu1() const
Definition: TileL2.h:117
TileL2::eta
float eta(unsigned int ind) const
Return eta (computed as the average of the eta values of the TileCal cells where the muon goes throug...
Definition: TileL2.h:99
TileL2::NMuons
unsigned int NMuons() const
Return number of muons.
Definition: TileL2.h:96
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileL2::phi
float phi(unsigned int) const
Return phi (average value at the TileCal radius)
Definition: TileL2.h:103
TileL2::clear
void clear()
Clear all vectors in TileL2.
Definition: TileL2.cxx:104
TileL2::TileL2
TileL2()
Constructor.
Definition: TileL2.h:38
TileL2::m_sinphi
float m_sinphi
Definition: TileL2.h:182
TileL2::cosphi
float cosphi() const
Return cos(phi)
Definition: TileL2.h:106
TileL2::m_val
std::vector< unsigned int > m_val
32-bit words (packed muon info)
Definition: TileL2.h:203
TileL2::Ey
float Ey() const
Return Ey in a TileCal superdrawer (ROD-based)
Definition: TileL2.h:137
TileL2::sumE
float sumE() const
Return sumE in a TileCal superdrawer (ROD-based)
Definition: TileL2.h:150
TileL2::m_phi
float m_phi
drawer phi
Definition: TileL2.h:180
TileL2::setMu
void setMu(std::vector< float > &&eta, std::vector< float > &&enemu0, std::vector< float > &&enemu1, std::vector< float > &&enemu2, std::vector< unsigned int > &&qual, std::vector< unsigned int > &&val)
Definition: TileL2.h:65
TileL2::m_enemu0
std::vector< float > m_enemu0
Energy deposited by the muons in TileCal innermost layer.
Definition: TileL2.h:191
TileL2::m_sumE
std::vector< float > m_sumE
sumEt, sumEz, sumE energy per TileCal superdrawer
Definition: TileL2.h:185
TileL2::enemu1
float enemu1(unsigned int ind) const
Return energy deposited in central layer (BC cells)
Definition: TileL2.h:116
TileL2::Ex
float Ex() const
Return Ex in a TileCal superdrawer (ROD-based)
Definition: TileL2.h:134
TileL2::eta
const std::vector< float > & eta() const
Definition: TileL2.h:100
TileL2::val
const std::vector< unsigned int > & val() const
Definition: TileL2.h:93
TileL2::enemu0
const std::vector< float > & enemu0() const
Definition: TileL2.h:113
TileL2::setEt
void setEt(std::vector< float > &&sumE)
Set sumE vector in TileL2.
Definition: TileL2.h:81
TileL2::setphi
void setphi()
function to set phi from ID
Definition: TileL2.cxx:41
TileL2::NsumE
unsigned int NsumE() const
Return number of sumE words.
Definition: TileL2.h:131
TileL2::enemu0
float enemu0(unsigned int ind) const
Return energy deposited in innermost layer (A cells)
Definition: TileL2.h:112
TileL2::enemu2
float enemu2(unsigned int ind) const
Return energy deposited in outermost layer (D cells)
Definition: TileL2.h:120
TileL2::enemu2
const std::vector< float > & enemu2() const
Definition: TileL2.h:121
TileL2::setMu
void setMu(const std::vector< float > &eta, const std::vector< float > &enemu0, const std::vector< float > &enemu1, const std::vector< float > &enemu2, const std::vector< unsigned int > &qual, const std::vector< unsigned int > &val)
Set Muon Info in TileL2.
Definition: TileL2.h:50
TileL2
Class to store TileMuId and Et quantities computed at the TileCal ROD DSPs.
Definition: TileL2.h:33
TileL2::m_enemu2
std::vector< float > m_enemu2
Energy deposited by the muons in TileCal outermost layer.
Definition: TileL2.h:197
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
TileL2::qual
unsigned int qual(unsigned int ind) const
Return quality flag (0 or 1): set to 0 if the "energy deposition path" is MIP like in all three sampl...
Definition: TileL2.h:127
TileL2::Et
float Et() const
Return total Et in a TileCal superdrawer (ROD-based)
Definition: TileL2.h:143