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

#include <RPCsimuDigit.h>

Inheritance diagram for RPCsimuDigit:
Collaboration diagram for RPCsimuDigit:

Public Member Functions

 RPCsimuDigit (int, unsigned int, int[3], float[4])
 
 RPCsimuDigit (const RPCsimuDigit &)
 
 ~RPCsimuDigit ()
 
RPCsimuDigit operator= (const RPCsimuDigit &)
 
void set_data (const RPCsimuData &)
 
int particle_code (void) const
 
int process_type (void) const
 
int track_number (void) const
 
const RPCsimuDatadata (void) const
 
const MuonSimuTrackmuon (void) const
 
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
 
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

int m_particle_code
 
int m_process_type
 
int m_track_number
 
const RPCsimuDatam_data
 
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 RPCsimuDigit.h.

Constructor & Destructor Documentation

◆ RPCsimuDigit() [1/2]

RPCsimuDigit::RPCsimuDigit ( int  number,
unsigned int  code,
int  parameters[3],
float  vector[4] 
)

Definition at line 21 of file RPCsimuDigit.cxx.

22  :
23  RPCdigit("Simulated RPC digit",number,code,vector),
27  m_data(0)
28 {
29  //Insert code for xyz, time and radius decoding
30  //Match the xyz decoding with the simulated xyz position
31 }

◆ RPCsimuDigit() [2/2]

RPCsimuDigit::RPCsimuDigit ( const RPCsimuDigit digit)

Definition at line 33 of file RPCsimuDigit.cxx.

33  : RPCdigit(digit)
34 {
35  m_particle_code = digit.particle_code();
36  m_process_type = digit.process_type();
37  m_track_number = digit.track_number();
38  m_data = digit.data();
39 }

◆ ~RPCsimuDigit()

RPCsimuDigit::~RPCsimuDigit ( )
inline

Definition at line 29 of file RPCsimuDigit.h.

29 {}

Member Function Documentation

◆ codes()

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

Definition at line 50 of file RPCdigit.h.

50 {return m_codes;}

◆ data()

const RPCsimuData* RPCsimuDigit::data ( void  ) const
inline

Definition at line 39 of file RPCsimuDigit.h.

39 {return m_data;}

◆ decoding()

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

Definition at line 48 of file RPCdigit.h.

48 {return m_coding;}

◆ eta()

bool RPCdigit::eta ( float &  eta) const
inherited

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()

const MuonSimuTrack * RPCsimuDigit::muon ( void  ) const
virtual

Reimplemented from RPCdigit.

Definition at line 53 of file RPCsimuDigit.cxx.

54 {
55  const RPCsimuData::MuonList& muons = m_data->muon_tracks();
56  RPCsimuData::MuonList::const_iterator it = muons.begin();
57  while(it != muons.end())
58  {
59  if((*it).track_number() == m_track_number) return &(*it);
60  }
61  return 0;
62 }

◆ 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=()

RPCsimuDigit RPCsimuDigit::operator= ( const RPCsimuDigit digit)

Definition at line 42 of file RPCsimuDigit.cxx.

43 {
44  static_cast<RPCdigit&>(*this) = static_cast<const RPCdigit&>(digit);
45  m_particle_code = digit.particle_code();
46  m_process_type = digit.process_type();
47  m_track_number = digit.track_number();
48  m_data = digit.data();
49  return *this;
50 }

◆ operator==()

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

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()

int RPCsimuDigit::particle_code ( void  ) const
inlinevirtual

Reimplemented from RPCdigit.

Definition at line 35 of file RPCsimuDigit.h.

35 {return m_particle_code;}

◆ phi()

bool RPCdigit::phi ( float &  phi) const
inherited

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
virtualinherited

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()

int RPCsimuDigit::process_type ( void  ) const
inlinevirtual

Reimplemented from RPCdigit.

Definition at line 36 of file RPCsimuDigit.h.

36 {return m_process_type;}

◆ radius()

bool RPCdigit::radius ( float &  rad) const
inherited

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_data()

void RPCsimuDigit::set_data ( const RPCsimuData data)

Definition at line 65 of file RPCsimuDigit.cxx.

66 {
67  m_data = &data;
68 }

◆ 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
inherited

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
inlineinherited

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
inlineinherited

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
inherited

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
inlineinherited

Definition at line 52 of file RPCdigit.h.

52 {return m_time;}

◆ track_number()

int RPCsimuDigit::track_number ( void  ) const
inlinevirtual

Reimplemented from RPCdigit.

Definition at line 37 of file RPCsimuDigit.h.

37 {return m_track_number;}

◆ x()

float RPCdigit::x ( void  ) const
inlineinherited

Definition at line 53 of file RPCdigit.h.

53 {return m_x;}

◆ xyz()

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

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
inlineinherited

Definition at line 54 of file RPCdigit.h.

54 {return m_y;}

◆ z()

float RPCdigit::z ( void  ) const
inlineinherited

Definition at line 55 of file RPCdigit.h.

55 {return m_z;}

Member Data Documentation

◆ m_codes

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

Definition at line 29 of file RPCdigit.h.

◆ m_coding

RPCdecoder RPCdigit::m_coding
privateinherited

Definition at line 18 of file RPCdigit.h.

◆ m_data

const RPCsimuData* RPCsimuDigit::m_data
private

Definition at line 23 of file RPCsimuDigit.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_particle_code

int RPCsimuDigit::m_particle_code
private

Definition at line 19 of file RPCsimuDigit.h.

◆ m_process_type

int RPCsimuDigit::m_process_type
private

Definition at line 20 of file RPCsimuDigit.h.

◆ m_station_phi

float RPCdigit::m_station_phi
privateinherited

Definition at line 27 of file RPCdigit.h.

◆ m_station_radius

float RPCdigit::m_station_radius
privateinherited

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
privateinherited

Definition at line 24 of file RPCdigit.h.

◆ m_track_number

int RPCsimuDigit::m_track_number
private

Definition at line 21 of file RPCsimuDigit.h.

◆ m_x

float RPCdigit::m_x
privateinherited

Definition at line 20 of file RPCdigit.h.

◆ m_y

float RPCdigit::m_y
privateinherited

Definition at line 21 of file RPCdigit.h.

◆ m_z

float RPCdigit::m_z
privateinherited

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
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
RPCdigit::m_codes
std::list< unsigned int > m_codes
Definition: RPCdigit.h:29
skel.it
it
Definition: skel.GENtoEVGEN.py:396
RPCdigit::m_y
float m_y
Definition: RPCdigit.h:21
RPCsimuDigit::m_process_type
int m_process_type
Definition: RPCsimuDigit.h:20
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
RPCsimuData::muon_tracks
const MuonList & muon_tracks(void) const
Definition: RPCsimuData.h:41
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
RPCsimuDigit::m_track_number
int m_track_number
Definition: RPCsimuDigit.h:21
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
RPCsimuData::MuonList
std::list< MuonSimuTrack > MuonList
Definition: RPCsimuData.h:21
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
vector
Definition: MultiHisto.h:13
RPCdigit::m_coding
RPCdecoder m_coding
Definition: RPCdigit.h:18
RPCsimuDigit::m_particle_code
int m_particle_code
Definition: RPCsimuDigit.h:19
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
RPCdigit::y
float y(void) const
Definition: RPCdigit.h:54
RPCdigit
Definition: RPCdigit.h:16
RPCdigit::RPCdigit
RPCdigit()
Definition: RPCdigit.cxx:12
RPCsimuDigit::data
const RPCsimuData * data(void) const
Definition: RPCsimuDigit.h:39
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
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
RPCsimuDigit::m_data
const RPCsimuData * m_data
Definition: RPCsimuDigit.h:23
RPCdigit::particle_code
virtual int particle_code(void) const
Definition: RPCdigit.h:70
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
Eta
@ Eta
Definition: RPCdef.h:8
python.SystemOfUnits.rad
int rad
Definition: SystemOfUnits.py:111