ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloRdo.cxx
Go to the documentation of this file.
1
3
5
6#include <iostream>
7
25
26L1CaloRdo::L1CaloRdo( int crate, int module, int eta, int phi,
27 int layer, int numSlices )
28: m_crate( crate )
29, m_module( module )
30, m_eta( eta )
31, m_phi( phi )
32, m_layer( layer )
33, m_vals( numSlices, 0 )
34, m_flags( numSlices, 0 )
36#ifdef OFFLINE_DECODER
37, m_word0s(numSlices,0),m_word1s(numSlices,0)
38#endif
39{
40 // std::cout << "Object Created" << std::endl;
41}
42
44{
45 // std::cout << "Object Deleted" << std::endl;
46}
47
48bool
49operator<( const L1CaloRdo& lhs, const L1CaloRdo& rhs )
50{
51 if ( lhs.getCrate() < rhs.getCrate() )
52 return true;
53 if ( lhs.getCrate() > rhs.getCrate() )
54 return false;
55 if ( lhs.getModule() < rhs.getModule() )
56 return true;
57 if ( lhs.getModule() > rhs.getModule() )
58 return false;
59 if ( lhs.getEta() < rhs.getEta() )
60 return true;
61 if ( lhs.getEta() > rhs.getEta() )
62 return false;
63 if ( lhs.getPhi() < rhs.getPhi() )
64 return true;
65 if ( lhs.getPhi() > rhs.getPhi() )
66 return false;
67 if ( lhs.getLayer() < rhs.getLayer() )
68 return true;
69 return false;
70}
71
72int
74{
75 return m_crate;
76}
77
78int
80{
81 return m_module;
82}
83
84int
86{
87 return m_eta;
88}
89
90int
92{
93 return m_phi;
94}
95
96int
98{
99 return m_layer;
100}
101
102int
103L1CaloRdo::getValue( size_t slice ) const
104{
105 if ( slice < m_vals.size() )
106 return m_vals[slice];
107 return 0;
108}
109
110int
112{
113 return getValue( getL1aPos() );
114}
115
116int
117L1CaloRdo::getFlag( size_t slice ) const
118{
119 if ( slice < m_flags.size() )
120 return m_flags[slice];
121 return 0;
122}
123
124int
126{
127 return getFlag( getL1aPos() );
128}
129
130int
132{
133 return m_l1aPos;
134}
135
138{
139 return m_region;
140}
141
142
143const std::list<L1CaloRdoRodInfo>::const_iterator&
145{
146 return m_rodInfo;
147}
148
149int
151{
152 return m_rodInfo->getModuleStatus( getModule() );
153}
154
155bool
157{
158 return getModuleStatus( ) & 0x01 ;
159}
160
161bool
163{
164 return getModuleStatus( ) & 0x02 ;
165}
166
167bool
169{
170 return getModuleStatus( ) & 0x04 ;
171}
172
173bool
175{
176 return getModuleStatus( ) & 0x08 ;
177}
178
179bool
181{
182 return getModuleStatus( ) & 0x10 ;
183}
184
185bool
187{
188 return getModuleStatus( ) & 0x20 ;
189}
190
191bool
193{
194 return getModuleStatus( ) & 0x40 ;
195}
196
197bool
199{
200 return getModuleStatus( ) & 0x80 ;
201}
202
203size_t
205{
206 return m_vals.size();
207}
208
209bool
211{
212 if ( m_crate != rhs.m_crate )
213 return false;
214 if ( m_module != rhs.m_module )
215 return false;
216 if ( m_eta != rhs.m_eta )
217 return false;
218 if ( m_phi != rhs.m_phi )
219 return false;
220 if ( m_layer != rhs.m_layer )
221 return false;
222 return true;
223}
224
225void
226L1CaloRdo::setValue( int val, size_t slice )
227{
228 if ( slice < m_vals.size() )
229 m_vals[slice] = val;
230}
231
232void
234{
235 setValue( val, getL1aPos() );
236}
237
238void
239L1CaloRdo::setFlag( int flag, size_t slice )
240{
241 if ( slice < m_flags.size() )
242 m_flags[slice] = flag;
243}
244
245void
247{
248 setFlag( flag, getL1aPos() );
249}
250
251void
252L1CaloRdo::setRodInfo( std::list<L1CaloRdoRodInfo>::const_iterator& rodInfo )
253{
254 m_rodInfo = rodInfo;
255}
256
257void
259{
260 std::cout << "RDO Object Type: " << getType()
261 << " Crate: " << getCrate()
262 << " Module: " << getModule()
263 << " Eta: " << getEta()
264 << " Phi: " << getPhi()
265 << " Layer: " << getLayer() << std::endl;
266 std::cout << " Values: " << std::hex;
267 for ( size_t i = 0 ; i < m_vals.size() ; ++i )
268 std::cout << getValue(i) << " ";
269 std::cout << " Flags: ";
270 for ( size_t i = 0 ; i < m_flags.size() ; ++i )
271 std::cout << getFlag(i) << " ";
272 std::cout << std::endl << std::dec;
273 infoSpecific();
274}
275
276void
278{
279}
280
281
282void
284{
285 m_region = region;
286}
287
288
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
bool operator<(const L1CaloRdo &lhs, const L1CaloRdo &rhs)
Definition L1CaloRdo.cxx:49
Simple class to mainly store eta/phi information (indices, granularity, trigger tower coordinates) as...
Abstract base class for L1Calo "Raw Data Objects" (RDOs).
Definition L1CaloRdo.h:17
int getEta() const
Definition L1CaloRdo.cxx:85
int m_module
Definition L1CaloRdo.h:74
int m_eta
Definition L1CaloRdo.h:75
bool getModuleErrorFifoOverflow() const
int getModuleStatus() const
std::vector< int > m_vals
Definition L1CaloRdo.h:78
L1CaloRdo(int crate, int module, int eta, int phi, int layer, int numSlices)
Definition L1CaloRdo.cxx:26
virtual void infoSpecific() const
bool getModuleErrorGlinkProtocol() const
int getFlag() const
int getModule() const
Definition L1CaloRdo.cxx:79
int m_l1aPos
Definition L1CaloRdo.h:80
const std::list< L1CaloRdoRodInfo >::const_iterator & getRodInfo() const
void setRodInfo(std::list< L1CaloRdoRodInfo >::const_iterator &rodInfo)
int m_layer
Definition L1CaloRdo.h:77
bool getModuleErrorBcnMismatch() const
int getPhi() const
Definition L1CaloRdo.cxx:91
size_t numSlices() const
int getLayer() const
Definition L1CaloRdo.cxx:97
void setRegion(const L1CaloDetectorRegion &region)
void setFlag(int flag, size_t slice)
int getCrate() const
Definition L1CaloRdo.cxx:73
bool getModuleErrorUnused() const
bool getModuleErrorGlinkDown() const
std::vector< int > m_flags
Definition L1CaloRdo.h:79
int m_crate
Definition L1CaloRdo.h:73
virtual std::string getType() const =0
bool getModuleErrorGlinkParity() const
int m_phi
Definition L1CaloRdo.h:76
void setValue(int val, size_t slice)
bool sameDatum(const L1CaloRdo &rhs) const
L1CaloDetectorRegion getRegion() const
void info() const
L1CaloDetectorRegion m_region
Definition L1CaloRdo.h:82
int getValue() const
int getL1aPos() const
bool getModuleErrorSpecific() const
bool getModuleErrorGlinkTimeout() const
std::list< L1CaloRdoRodInfo >::const_iterator m_rodInfo
Definition L1CaloRdo.h:86
virtual ~L1CaloRdo()
Definition L1CaloRdo.cxx:43