ATLAS Offline Software
L1CaloRdoFexTob.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
5 
6 #include <iostream>
7 #include <sstream>
8 
16 L1CaloRdoFexTob::L1CaloRdoFexTob( int crate, int module, int eta, int phi, int numSlices,
18  int id, int fibre, int tobSeq )
19 : L1CaloRdo( crate, module, eta, phi, 0, numSlices )
20 , m_tobType( tobType )
21 , m_source( source )
22 , m_id( id )
23 , m_fibre( fibre )
24 , m_tobSeq( tobSeq )
25 {
26 }
27 
28 std::string
30 {
31  return getTobTypeString() + std::string( "Tob:" ) + getTobSourceString();
32 }
33 
34 bool
36 {
37  if ( m_tobType != rhs.m_tobType )
38  return false;
39  if ( m_source != rhs.m_source )
40  return false;
41  if ( m_id != rhs.m_id )
42  return false;
43  return L1CaloRdo::sameDatum( rhs );
44 }
45 
48 {
49  return m_tobType;
50 }
51 
52 std::string
54 {
55  if ( getIsEM() ) { return "EM"; }
56  else if ( getIsTau() ) { return "Tau"; }
57  else if ( getIsLargeJet() ) { return "LJet"; }
58  else if ( getIsSmallJet() ) { return "SJet"; }
59  else if ( getIsEnergy() ) { return "Energy"; }
60  else if ( getIsMuon() ) { return "Muon"; }
61  else { return ""; }
62 }
63 
64 int
66 {
67  return m_id;
68 }
69 
70 bool
72 {
73  return ( getTobType() == TobType::EM );
74 }
75 
76 bool
78 {
79  return ( getTobType() == TobType::Tau );
80 }
81 
82 bool
84 {
85  return ( getTobType() == TobType::LargeJet ||
86  getTobType() == TobType::SmallJet );
87 }
88 
89 bool
91 {
92  return ( getTobType() == TobType::LargeJet );
93 }
94 
95 bool
97 {
98  return ( getTobType() == TobType::SmallJet );
99 }
100 
101 bool
103 {
104  return ( getTobType() == TobType::Energy );
105 }
106 
107 bool
109 {
110  return ( getTobType() == TobType::Muon );
111 }
112 
115 {
116  return m_source;
117 }
118 
119 std::string
121 {
122  if ( getIsTob() ) { return "Tob"; }
123  else if ( getIsXtob() ) { return "Xtob"; }
124  else if ( getIsTopo() ) { std::ostringstream s; s << "Topo" << m_id; return s.str(); }
125  else { return ""; }
126 }
127 
128 bool
130 {
131  return ( getTobSource() == TobSource::EfexTob ||
132  getTobSource() == TobSource::JfexTob ||
133  getTobSource() == TobSource::GfexTob ||
134  getTobSource() == TobSource::Ph1Topo );
135 }
136 
137 bool
139 {
140  return ( getTobSource() == TobSource::EfexXtob ||
141  getTobSource() == TobSource::JfexXtob ||
142  getTobSource() == TobSource::GfexXtob );
143 }
144 
145 bool
147 {
148  return ( getTobSource() == TobSource::EfexTob ||
149  getTobSource() == TobSource::EfexXtob );
150 }
151 
152 bool
154 {
155  return ( getTobSource() == TobSource::JfexTob ||
156  getTobSource() == TobSource::JfexXtob );
157 }
158 
159 bool
161 {
162  return ( getTobSource() == TobSource::GfexTob ||
163  getTobSource() == TobSource::GfexXtob );
164 }
165 
166 bool
168 {
169  return ( getTobSource() == TobSource::Ph1Topo );
170 }
171 
172 int
174 {
175  return m_fibre;
176 }
177 
178 int
180 {
181  return m_tobSeq;
182 }
183 
184 bool
185 operator<( const L1CaloRdoFexTob& lhs, const L1CaloRdoFexTob& rhs )
186 {
187  if ( lhs.getCrate() < rhs.getCrate() )
188  return true;
189  if ( lhs.getCrate() > rhs.getCrate() )
190  return false;
191  if ( lhs.getModule() < rhs.getModule() )
192  return true;
193  if ( lhs.getModule() > rhs.getModule() )
194  return false;
195  if ( lhs.getEta() < rhs.getEta() )
196  return true;
197  if ( lhs.getEta() > rhs.getEta() )
198  return false;
199  if ( lhs.getPhi() < rhs.getPhi() )
200  return true;
201  if ( lhs.getPhi() > rhs.getPhi() )
202  return false;
203  if ( lhs.getLayer() < rhs.getLayer() )
204  return true;
205  if ( lhs.getTobType() < rhs.getTobType() )
206  return true;
207  if ( lhs.getTobType() > rhs.getTobType() )
208  return false;
209  if ( lhs.getTobSource( ) < rhs.getTobSource( ) )
210  return true;
211  if ( lhs.getTobSource( ) > rhs.getTobSource( ) )
212  return false;
213  if ( lhs.getTobID( ) < rhs.getTobID( ) )
214  return true;
215  return false;
216 }
L1CaloRdoFexTob::getIsGfex
bool getIsGfex() const
Definition: L1CaloRdoFexTob.cxx:160
L1CaloRdoFexTob::m_tobType
TobType m_tobType
Definition: L1CaloRdoFexTob.h:47
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
L1CaloRdoFexTob::getIsJet
bool getIsJet() const
Definition: L1CaloRdoFexTob.cxx:83
L1CaloRdo::getModule
int getModule() const
Definition: L1CaloRdo.cxx:79
L1CaloRdoFexTob::m_tobSeq
int m_tobSeq
Definition: L1CaloRdoFexTob.h:51
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
Energy
std::vector< double > Energy
Definition: CalibHitToCaloCell.h:23
L1CaloRdoFexTob::getType
virtual std::string getType() const override
Definition: L1CaloRdoFexTob.cxx:29
L1CaloRdoFexTob::getFibre
int getFibre() const
Definition: L1CaloRdoFexTob.cxx:173
L1CaloRdoFexTob::getTobSeq
int getTobSeq() const
Definition: L1CaloRdoFexTob.cxx:179
L1CaloRdoFexTob::getIsXtob
bool getIsXtob() const
Definition: L1CaloRdoFexTob.cxx:138
L1CaloRdo::getPhi
int getPhi() const
Definition: L1CaloRdo.cxx:91
L1CaloRdoFexTob::getIsSmallJet
bool getIsSmallJet() const
Definition: L1CaloRdoFexTob.cxx:96
L1CaloRdoFexTob::getIsEfex
bool getIsEfex() const
Definition: L1CaloRdoFexTob.cxx:146
L1CaloRdoFexTob::m_fibre
int m_fibre
Definition: L1CaloRdoFexTob.h:50
L1CaloRdoFexTob::getTobID
int getTobID() const
Definition: L1CaloRdoFexTob.cxx:65
python.PyAthena.module
module
Definition: PyAthena.py:131
L1CaloRdoFexTob::L1CaloRdoFexTob
L1CaloRdoFexTob(int crate, int module, int eta, int phi, int numSlices, TobType tobType, TobSource source, int id=0, int fibre=0, int tobSeq=0)
Definition: L1CaloRdoFexTob.cxx:16
Ringer::EM
@ EM
Definition: CaloRingsDefs.h:19
L1CaloRdoFexTob::getTobType
TobType getTobType() const
Definition: L1CaloRdoFexTob.cxx:47
L1CaloRdoFexTob::m_id
int m_id
Definition: L1CaloRdoFexTob.h:49
L1CaloRdoFexTob::getIsJfex
bool getIsJfex() const
Definition: L1CaloRdoFexTob.cxx:153
L1CaloRdoFexTob::getIsMuon
bool getIsMuon() const
Definition: L1CaloRdoFexTob.cxx:108
L1CaloRdoFexTob::TobSource
TobSource
Definition: L1CaloRdoFexTob.h:15
L1CaloRdoFexTob::getTobSourceString
std::string getTobSourceString() const
Definition: L1CaloRdoFexTob.cxx:120
L1CaloRdoFexTob::getTobTypeString
std::string getTobTypeString() const
Definition: L1CaloRdoFexTob.cxx:53
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
L1CaloRdoFexTob::sameDatum
bool sameDatum(const L1CaloRdoFexTob &rhs) const
Definition: L1CaloRdoFexTob.cxx:35
L1CaloRdoFexTob::getIsTau
bool getIsTau() const
Definition: L1CaloRdoFexTob.cxx:77
L1CaloRdoFexTob::getTobSource
TobSource getTobSource() const
Definition: L1CaloRdoFexTob.cxx:114
Muon
struct TBPatternUnitContext Muon
L1CaloRdoFexTob
Definition: L1CaloRdoFexTob.h:12
L1CaloRdoFexTob::getIsEM
bool getIsEM() const
Definition: L1CaloRdoFexTob.cxx:71
L1CaloRdoFexTob::getIsEnergy
bool getIsEnergy() const
Definition: L1CaloRdoFexTob.cxx:102
L1CaloRdo::getLayer
int getLayer() const
Definition: L1CaloRdo.cxx:97
xAODType::Tau
@ Tau
The object is a tau (jet)
Definition: ObjectType.h:49
copySelective.source
string source
Definition: copySelective.py:32
L1CaloRdo::getEta
int getEta() const
Definition: L1CaloRdo.cxx:85
L1CaloRdoFexTob::getIsTob
bool getIsTob() const
Definition: L1CaloRdoFexTob.cxx:129
L1CaloRdoFexTob::m_source
TobSource m_source
Definition: L1CaloRdoFexTob.h:48
L1CaloRdo::sameDatum
bool sameDatum(const L1CaloRdo &rhs) const
Definition: L1CaloRdo.cxx:210
L1CaloRdoFexTob.h
operator<
bool operator<(const L1CaloRdoFexTob &lhs, const L1CaloRdoFexTob &rhs)
Definition: L1CaloRdoFexTob.cxx:185
L1CaloRdoFexTob::getIsTopo
bool getIsTopo() const
Definition: L1CaloRdoFexTob.cxx:167
L1CaloRdo::getCrate
int getCrate() const
Definition: L1CaloRdo.cxx:73
L1CaloRdo
Definition: L1CaloRdo.h:17
L1CaloRdoFexTob::TobType
TobType
Definition: L1CaloRdoFexTob.h:14
L1CaloRdoFexTob::getIsLargeJet
bool getIsLargeJet() const
Definition: L1CaloRdoFexTob.cxx:90