ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
RPCdigit Class Reference

#include <RPCdigit.h>

Inheritance diagram for RPCdigit:
Collaboration diagram for RPCdigit:

Public Member Functions

 RPCdigit ()
 
 RPCdigit (const std::string &, int, unsigned int, float vec[4])
 
 RPCdigit (const RPCdigit &)
 
virtual ~RPCdigit ()
 
RPCdigit operator= (const RPCdigit &)
 
bool operator== (const RPCdigit &) const
 
const RPCdecoderdecoding (void) const
 
const std::list< unsigned int > & codes (void) const
 
float time (void) const
 
float x (void) const
 
float y (void) const
 
float z (void) const
 
void xyz (float vec[3]) const
 
bool radius (float &) const
 
bool theta (float &) const
 
bool eta (float &) const
 
bool phi (float &) const
 
bool station_radius (float &) const
 
bool station_eta (float &) const
 
bool station_phi (float &) const
 
virtual int particle_code (void) const
 
virtual int process_type (void) const
 
virtual int track_number (void) const
 
virtual const MuonSimuTrackmuon (void) const
 
void Print (std::ostream &, bool) const
 
void set_number (int)
 
int number (void) const
 
void PrintElement (std::ostream &, std::string, bool) const
 
ObjectType tag () const
 
const std::string & name () const
 

Private Attributes

RPCdecoder m_coding
 
float m_x
 
float m_y
 
float m_z
 
float m_time
 
float m_station_radius
 
float m_station_phi
 
std::list< unsigned int > m_codes
 
int m_number
 
ObjectType m_tag
 
std::string m_name
 

Detailed Description

Definition at line 15 of file RPCdigit.h.

Constructor & Destructor Documentation

◆ RPCdigit() [1/3]

RPCdigit::RPCdigit ( )

Definition at line 12 of file RPCdigit.cxx.

12  :
13  RPCtrigDataObject(0,"RPC digit")
14 {
15  m_coding(0);
16 
17  m_time = 0.0;
18 
19  m_x = 0.0;
20  m_y = 0.0;
21  m_z = 0.0;
22 
23  m_station_radius = 0;
24  m_station_phi = -1.;
25 
26  //m_rpcgeo = 0;
27  m_codes.clear();
28 }

◆ RPCdigit() [2/3]

RPCdigit::RPCdigit ( const std::string &  name,
int  number,
unsigned int  code,
float  vec[4] 
)

Definition at line 31 of file RPCdigit.cxx.

31  :
33  m_coding(code),
34  m_x(vec[1]),
35  m_y(vec[2]),
36  m_z(vec[3]),
37  m_time(vec[0]),
38  m_station_radius(0.),
39  m_station_phi(-1.)
40 {
41 }

◆ RPCdigit() [3/3]

RPCdigit::RPCdigit ( const RPCdigit digit)

Definition at line 129 of file RPCdigit.cxx.

129  :
130  RPCtrigDataObject(digit.number(),digit.name()),
131  m_coding(digit.decoding()),
132  m_x(digit.x()),
133  m_y(digit.y()),
134  m_z(digit.z()),
135  m_time(digit.time()),
136  m_codes(digit.codes())
137 {
138  if(!digit.station_radius(m_station_radius)) m_station_radius = 0.;
139  if(!digit.station_phi(m_station_phi)) m_station_phi = 0.;
140 }

◆ ~RPCdigit()

virtual RPCdigit::~RPCdigit ( )
inlinevirtual

Definition at line 42 of file RPCdigit.h.

42 {}

Member Function Documentation

◆ codes()

const std::list<unsigned int>& RPCdigit::codes ( void  ) const
inline

Definition at line 50 of file RPCdigit.h.

50 {return m_codes;}

◆ decoding()

const RPCdecoder& RPCdigit::decoding ( void  ) const
inline

Definition at line 48 of file RPCdigit.h.

48 {return m_coding;}

◆ eta()

bool RPCdigit::eta ( float &  eta) const

Definition at line 205 of file RPCdigit.cxx.

206 {
207  float theta;
208  if(this->theta(theta))
209  {
210  eta = -std::log(std::tan(theta/2.f));
211  if(m_z < 0.) eta = -eta;
212  return true;
213  }
214  return false;
215 }

◆ muon()

virtual const MuonSimuTrack* RPCdigit::muon ( void  ) const
inlinevirtual

Reimplemented in RPCsimuDigit.

Definition at line 74 of file RPCdigit.h.

74 {return 0;}

◆ name()

const std::string& BaseObject::name ( ) const
inlineinherited

Definition at line 23 of file BaseObject.h.

23 { return m_name; }

◆ number()

int RPCtrigDataObject::number ( void  ) const
inlineinherited

Definition at line 29 of file RPCtrigDataObject.h.

29 {return m_number;}

◆ operator=()

RPCdigit RPCdigit::operator= ( const RPCdigit digit)

Definition at line 142 of file RPCdigit.cxx.

143 {
144  static_cast<RPCtrigDataObject&>(*this) =
145  static_cast<const RPCtrigDataObject&>(digit);
146  m_coding = digit.decoding();
147 
148  m_time = digit.time();
149 
150  m_x = digit.x();
151  m_y = digit.y();
152  m_z = digit.z();
153 
154  //m_rpcgeo=0;
155 
156  // m_rpcgeo = digit.rpcgeo();
157 
158 
159  if(!digit.station_radius(m_station_radius)) m_station_radius = 0.;
160  if(!digit.station_phi(m_station_phi)) m_station_phi = 0.;
161 
162  m_codes = digit.codes();
163 
164  return *this;
165 }

◆ operator==()

bool RPCdigit::operator== ( const RPCdigit digit) const

Definition at line 169 of file RPCdigit.cxx.

170 {
171  if(m_coding.code() == digit.decoding().code()) return true;
172  else return false;
173 }

◆ particle_code()

virtual int RPCdigit::particle_code ( void  ) const
inlinevirtual

Reimplemented in RPCsimuDigit.

Definition at line 70 of file RPCdigit.h.

70 {return 0;}

◆ phi()

bool RPCdigit::phi ( float &  phi) const

Definition at line 217 of file RPCdigit.cxx.

218 {
219  if(m_x != 0. || m_y != 0.)
220  {
221  phi = std::atan2(m_y,m_x);
222  return true;
223  }
224  return false;
225 }

◆ Print()

void RPCdigit::Print ( std::ostream &  stream,
bool  detail 
) const
virtual

Reimplemented from BaseObject.

Definition at line 238 of file RPCdigit.cxx.

239 {
240  //unsigned int upper = 19;
241  //unsigned int lower = 17;
242 
243  unsigned int upper = 95;
244  unsigned int lower = 45;
245 
246 
247  std::string type = (decoding().view() == Eta)? "ETA " : "PHI ";
248 
249  for(int i=0;i<61;++i) stream << (char) upper;
250  stream << endl;
251 
252  stream << type << name() << " number " << number() << ", time = "
253  << time() << " ns" << endl;
254  if (particle_code())
255  {
256  stream << "particle code = " << particle_code() << ","
257  << " physics process = " << process_type() << ","
258  << " track number = " << track_number() << endl;
259  }
260  stream << setiosflags(ios::fixed);
261 
262  stream << "GlobalPosition (cm): "
263  << setiosflags(ios::fixed) << setprecision(3) << setw(12) << x() << ","
264  << setiosflags(ios::fixed) << setprecision(3) << setw(12) << y() << ","
265  << setiosflags(ios::fixed) << setprecision(3) << setw(12) << z()
266  << endl;
267 
268  stream.unsetf(ios::fixed);
269 
270  if(detail)
271  {
273  }
274 
275  for(int i=0;i<61;++i) stream << (char) lower;
276  stream << endl;
277 }

◆ PrintElement()

void RPCtrigDataObject::PrintElement ( std::ostream &  ,
std::string  ,
bool   
) const
inlineinherited

Definition at line 31 of file RPCtrigDataObject.h.

31 {}

◆ process_type()

virtual int RPCdigit::process_type ( void  ) const
inlinevirtual

Reimplemented in RPCsimuDigit.

Definition at line 71 of file RPCdigit.h.

71 {return 0;}

◆ radius()

bool RPCdigit::radius ( float &  rad) const

Definition at line 182 of file RPCdigit.cxx.

183 {
184  if(m_x != 0. || m_y != 0.)
185  {
186  rad = std::sqrt( std::pow(m_x,2) + std::pow(m_y,2) );
187  return true;
188  }
189  return false;
190 }

◆ set_number()

void RPCtrigDataObject::set_number ( int  number)
inherited

Definition at line 42 of file RPCtrigDataObject.cxx.

43 {
44  m_number = number;
45 }

◆ station_eta()

bool RPCdigit::station_eta ( float &  eta) const

Definition at line 227 of file RPCdigit.cxx.

228 {
229  if(m_station_radius)
230  {
231  if(m_z != 0.) eta = -std::log(std::tan(std::atan(m_station_radius/std::abs(m_z))/2.f));
232  if(m_z < 0. ) eta = -eta;
233  return true;
234  }
235  return false;
236 }

◆ station_phi()

bool RPCdigit::station_phi ( float &  phi) const
inline

Definition at line 93 of file RPCdigit.h.

94 {
95  if(m_station_phi >= 0.)
96  {
98  return true;
99  }
100  return false;
101 }

◆ station_radius()

bool RPCdigit::station_radius ( float &  rad) const
inline

Definition at line 81 of file RPCdigit.h.

82 {
84  {
86  return true;
87  }
88  return false;
89 }

◆ tag()

ObjectType BaseObject::tag ( ) const
inlineinherited

Definition at line 22 of file BaseObject.h.

22 { return m_tag; }

◆ theta()

bool RPCdigit::theta ( float &  theta) const

Definition at line 193 of file RPCdigit.cxx.

194 {
195  float radius;
196  if(this->radius(radius))
197  {
198  if(m_z != 0.) theta = std::atan( radius/ std::abs(m_z) );
199  else theta = M_PI_2;
200  return true;
201  }
202  return false;
203 }

◆ time()

float RPCdigit::time ( void  ) const
inline

Definition at line 52 of file RPCdigit.h.

52 {return m_time;}

◆ track_number()

virtual int RPCdigit::track_number ( void  ) const
inlinevirtual

Reimplemented in RPCsimuDigit.

Definition at line 72 of file RPCdigit.h.

72 {return 0;}

◆ x()

float RPCdigit::x ( void  ) const
inline

Definition at line 53 of file RPCdigit.h.

53 {return m_x;}

◆ xyz()

void RPCdigit::xyz ( float  vec[3]) const

Definition at line 175 of file RPCdigit.cxx.

176 {
177  vec[0] = m_x;
178  vec[1] = m_y;
179  vec[2] = m_z;
180 }

◆ y()

float RPCdigit::y ( void  ) const
inline

Definition at line 54 of file RPCdigit.h.

54 {return m_y;}

◆ z()

float RPCdigit::z ( void  ) const
inline

Definition at line 55 of file RPCdigit.h.

55 {return m_z;}

Member Data Documentation

◆ m_codes

std::list<unsigned int> RPCdigit::m_codes
private

Definition at line 29 of file RPCdigit.h.

◆ m_coding

RPCdecoder RPCdigit::m_coding
private

Definition at line 18 of file RPCdigit.h.

◆ m_name

std::string BaseObject::m_name
privateinherited

Definition at line 16 of file BaseObject.h.

◆ m_number

int RPCtrigDataObject::m_number
privateinherited

Definition at line 17 of file RPCtrigDataObject.h.

◆ m_station_phi

float RPCdigit::m_station_phi
private

Definition at line 27 of file RPCdigit.h.

◆ m_station_radius

float RPCdigit::m_station_radius
private

Definition at line 26 of file RPCdigit.h.

◆ m_tag

ObjectType BaseObject::m_tag
privateinherited

Definition at line 15 of file BaseObject.h.

◆ m_time

float RPCdigit::m_time
private

Definition at line 24 of file RPCdigit.h.

◆ m_x

float RPCdigit::m_x
private

Definition at line 20 of file RPCdigit.h.

◆ m_y

float RPCdigit::m_y
private

Definition at line 21 of file RPCdigit.h.

◆ m_z

float RPCdigit::m_z
private

Definition at line 22 of file RPCdigit.h.


The documentation for this class was generated from the following files:
RPCdigit::track_number
virtual int track_number(void) const
Definition: RPCdigit.h:72
RPCdigit::eta
bool eta(float &) const
Definition: RPCdigit.cxx:205
RPCtrigDataObject::m_number
int m_number
Definition: RPCtrigDataObject.h:17
RPCtrigDataObject::RPCtrigDataObject
RPCtrigDataObject(int, const std::string &)
Definition: RPCtrigDataObject.cxx:10
BaseObject::name
const std::string & name() const
Definition: BaseObject.h:23
RPCdigit::m_z
float m_z
Definition: RPCdigit.h:22
BaseObject::m_name
std::string m_name
Definition: BaseObject.h:16
RPCdigit::time
float time(void) const
Definition: RPCdigit.h:52
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
RPCdigit::m_codes
std::list< unsigned int > m_codes
Definition: RPCdigit.h:29
RPCdigit::m_y
float m_y
Definition: RPCdigit.h:21
detail
Definition: extract_histogram_tag.cxx:14
upper
int upper(int c)
Definition: LArBadChannelParser.cxx:49
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
RPCdigit::phi
bool phi(float &) const
Definition: RPCdigit.cxx:217
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
RPCdecoder::code
unsigned int code(void) const
Definition: RPCdecoder.h:64
histSizes.code
code
Definition: histSizes.py:129
RPCdigit::m_time
float m_time
Definition: RPCdigit.h:24
RPCdecoder::Print
void Print(std::ostream &, bool) const
Definition: RPCdecoder.cxx:165
lumiFormat.i
int i
Definition: lumiFormat.py:85
RPCdigit::m_coding
RPCdecoder m_coding
Definition: RPCdigit.h:18
RPCdigit::process_type
virtual int process_type(void) const
Definition: RPCdigit.h:71
hist_file_dump.f
f
Definition: hist_file_dump.py:135
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
RPCdigit::radius
bool radius(float &) const
Definition: RPCdigit.cxx:182
RPCdigit::theta
bool theta(float &) const
Definition: RPCdigit.cxx:193
RPCtrigDataObject
Definition: RPCtrigDataObject.h:15
RPCdigit::y
float y(void) const
Definition: RPCdigit.h:54
RPCdigit::m_x
float m_x
Definition: RPCdigit.h:20
RPCdecoder::view
ViewType view(void) const
Definition: RPCdecoder.cxx:150
RPCtrigDataObject::number
int number(void) const
Definition: RPCtrigDataObject.h:29
RPCdigit::m_station_radius
float m_station_radius
Definition: RPCdigit.h:26
RPCdigit::m_station_phi
float m_station_phi
Definition: RPCdigit.h:27
BaseObject::m_tag
ObjectType m_tag
Definition: BaseObject.h:15
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RPCdigit::decoding
const RPCdecoder & decoding(void) const
Definition: RPCdigit.h:48
RPCdigit::x
float x(void) const
Definition: RPCdigit.h:53
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
RPCdigit::z
float z(void) const
Definition: RPCdigit.h:55
RPCdigit::particle_code
virtual int particle_code(void) const
Definition: RPCdigit.h:70
Eta
@ Eta
Definition: RPCdef.h:8
python.SystemOfUnits.rad
int rad
Definition: SystemOfUnits.py:111