CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
Lut Class Reference

#include <Lut.h>

Public Member Functions

void DSPtoIEEE32 (short DSPmantissa, short DSPexp, float *f)
 
int get_k (int addr) const
 
int get_x (int addr) const
 
void IEEE32toDSP (float f, short *DSPmantissa, short *DSPexp)
 
 Lut ()
 
 Lut (const DTConfigLUTs *conf, int ntc, float SL_shift)
 
void setForTestBeam (int station, int board, int traco)
 
 ~Lut ()
 

Public Attributes

float m_d
 
int m_ST
 
int m_wheel
 
float m_Xcn
 

Private Attributes

const DTConfigLUTs_conf_luts
 
float m_pitch_d_ST
 

Detailed Description

Class for computing single Traco LUT from given parameters

Author
S. Vanini

Definition at line 32 of file Lut.h.

Constructor & Destructor Documentation

Lut::Lut ( )
inline

Definition at line 35 of file Lut.h.

35 {};
Lut::Lut ( const DTConfigLUTs conf,
int  ntc,
float  SL_shift 
)

Definition at line 14 of file Lut.cc.

References _conf_luts, DTConfigLUTs::BTIC(), CELL_PITCH, DTConfigLUTs::D(), m_d, m_pitch_d_ST, m_ST, m_wheel, m_Xcn, DTConfigLUTs::Wheel(), and DTConfigLUTs::Xcn().

14  : _conf_luts(conf) {
15 
16  // set parameters from configuration
17  m_d = _conf_luts->D();
18  m_ST = _conf_luts->BTIC();
20 
21  // 110208 SV TRACO hardware bug included: Xcn must be corrected because Xcn parameter has been
22  // inserted in hardware strings with the shift included, because TRACO doesn't apply shift in positive cases
23  float Xcn_corr = _conf_luts->Xcn();
24  if(SL_shift > 0){
25  if(Xcn_corr > 0)
26  Xcn_corr = Xcn_corr - SL_shift;
27  if(Xcn_corr < 0)
28  Xcn_corr = Xcn_corr + SL_shift;
29  }
30 
31  m_Xcn = Xcn_corr - (CELL_PITCH * 4.0 * (float)(ntc-1) * (float) m_wheel);
33 
34 
35  //std::cout<< "Lut::Lut -> m_d " << m_d << " m_ST " << m_ST << " m_wheel " << m_wheel << " m_Xcn " << m_Xcn << " ntc " << ntc << std::endl;
36  return;
37 }
int m_ST
Definition: Lut.h:53
int Wheel() const
wheel sign (-1 or +1)
Definition: DTConfigLUTs.h:65
float m_Xcn
Definition: Lut.h:52
float m_pitch_d_ST
Definition: Lut.h:57
#define CELL_PITCH
Definition: Lut.h:29
float m_d
Definition: Lut.h:51
int BTIC() const
BTIC parameter.
Definition: DTConfigLUTs.h:56
float Xcn() const
Xcn: distance vertex to normal, unit cm.
Definition: DTConfigLUTs.h:62
int m_wheel
Definition: Lut.h:54
const DTConfigLUTs * _conf_luts
Definition: Lut.h:59
float D() const
d: distance vertex to normal, unit cm.
Definition: DTConfigLUTs.h:59
Lut::~Lut ( )

Definition at line 39 of file Lut.cc.

39 {}

Member Function Documentation

void Lut::DSPtoIEEE32 ( short  DSPmantissa,
short  DSPexp,
float *  f 
)
int Lut::get_k ( int  addr) const

Definition at line 109 of file Lut.cc.

References ANGRESOL, CELL_PITCH, i, m_ST, m_wheel, SL_D, and x.

Referenced by DTTracoChip::calculateAngles().

109  {
110 //FIX attenzione controlla addr - 511 o -512???
111  int i;
112  float x;
113  i = addr - 512;
114  x = (float)i * CELL_PITCH / ( SL_D * m_ST );
115  x = atanf(x);
116  x = x * ANGRESOL;
117  if(m_wheel<0)
118  x = -x;
119 
120  return (int)x;
121 }
int i
Definition: DBlmapReader.cc:9
#define ANGRESOL
Definition: Lut.h:26
int m_ST
Definition: Lut.h:53
#define CELL_PITCH
Definition: Lut.h:29
#define SL_D
Definition: Lut.h:28
int m_wheel
Definition: Lut.h:54
Definition: DDAxes.h:10
int Lut::get_x ( int  addr) const

Definition at line 123 of file Lut.cc.

References a, b, i, m_d, m_pitch_d_ST, m_wheel, m_Xcn, POSRESOL, SL_DIFF, and x.

Referenced by DTTracoChip::calculateAngles().

123  {
124  int i;
125  float a,b,x;
126 
127  if(addr<=511) //LUT outer
128  {
129  i=addr;
130  b=m_d+SL_DIFF;
131  }
132  else if(addr<=1023) //LUT inner
133  {
134  i=addr-512;
135  b=m_d-SL_DIFF;
136  }
137  else //LUT correlati
138  {
139  i=addr-1024;
140  b=m_d;
141  }
142  a = m_Xcn - (m_pitch_d_ST * (float)i * (float)m_wheel);
143  x = a/b;
144 
145  x = atanf(x);
146  x = x * POSRESOL;
147 
148  return (int)x;
149 }
int i
Definition: DBlmapReader.cc:9
float m_Xcn
Definition: Lut.h:52
return((rh^lh)&mask)
float m_pitch_d_ST
Definition: Lut.h:57
float m_d
Definition: Lut.h:51
#define POSRESOL
Definition: Lut.h:27
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
int m_wheel
Definition: Lut.h:54
Definition: DDAxes.h:10
#define SL_DIFF
Definition: Lut.h:30
void Lut::IEEE32toDSP ( float  f,
short *  DSPmantissa,
short *  DSPexp 
)
void Lut::setForTestBeam ( int  station,
int  board,
int  traco 
)

Definition at line 41 of file Lut.cc.

References m_d, m_ST, m_Xcn, and relativeConstraints::station.

41  {
42  // set parameters from fixed values for MB1 nd MB3 (used in Testbeams 2003 2004)
43  int nStat = station;
44  int nBoard = board;
45  int nTraco = traco;
46  float tracoPos[50];
47 
48  if( nStat ==1 ){
49 
50  tracoPos[ 0] = -120.19;
51  tracoPos[ 1] = -103.39;
52  tracoPos[ 2] = -86.59;
53  tracoPos[ 3] = -69.80;
54  tracoPos[10] = -52.99;
55  tracoPos[11] = -36.19;
56  tracoPos[12] = -19.39;
57  tracoPos[13] = -2.59;
58  tracoPos[20] = 14.20;
59  tracoPos[21] = 31.00;
60  tracoPos[22] = 47.80;
61  tracoPos[23] = 64.60;
62  tracoPos[30] = 81.40;
63 
64  m_d = 431.175;
65  m_ST = 31;
66  float m_Xc = tracoPos[ ( nBoard * 10 ) + nTraco ];
67  float m_Xn = +39.0;
68  m_Xcn = m_Xn - m_Xc;
69  //m_stsize = m_CELL_PITCH / m_ST;
70  //m_distp2 = 0.5 + ( 2.0 * m_CELL_H * m_ST / m_CELL_PITCH );
71  }
72 
73  if( nStat ==3){
74  tracoPos[ 0] = -165.45;
75  tracoPos[ 1] = -148.65;
76  tracoPos[ 2] = -131.85;
77  tracoPos[ 3] = -115.05;
78  tracoPos[10] = -98.25;
79  tracoPos[11] = -81.45;
80  tracoPos[12] = -64.65;
81  tracoPos[13] = -47.85;
82  tracoPos[20] = -31.05;
83  tracoPos[21] = -14.25;
84  tracoPos[22] = 2.54;
85  tracoPos[23] = 19.34;
86  tracoPos[30] = 36.14;
87  tracoPos[31] = 52.94;
88  tracoPos[32] = 69.74;
89  tracoPos[33] = 86.54;
90  tracoPos[40] = 103.34;
91  tracoPos[41] = 120.14;
92  tracoPos[42] = 136.94;
93  tracoPos[43] = 153.74;
94 
95  m_d = 512.47;
96  m_ST = 31;
97  float m_Xc = tracoPos[ ( nBoard * 10 ) + nTraco ];
98  float m_Xn = -21.0;
99  m_Xcn = m_Xn - m_Xc;
100  //m_stsize = m_CELL_PITCH / m_ST;
101  //m_distp2 = 0.5 + ( 2.0 * m_CELL_H * m_ST / m_CELL_PITCH );
102 
103  }
104 
105  return;
106 }
int m_ST
Definition: Lut.h:53
float m_Xcn
Definition: Lut.h:52
float m_d
Definition: Lut.h:51

Member Data Documentation

const DTConfigLUTs* Lut::_conf_luts
private

Definition at line 59 of file Lut.h.

Referenced by Lut().

float Lut::m_d

Definition at line 51 of file Lut.h.

Referenced by get_x(), Lut(), and setForTestBeam().

float Lut::m_pitch_d_ST
private

Definition at line 57 of file Lut.h.

Referenced by get_x(), and Lut().

int Lut::m_ST

Definition at line 53 of file Lut.h.

Referenced by get_k(), Lut(), and setForTestBeam().

int Lut::m_wheel

Definition at line 54 of file Lut.h.

Referenced by get_k(), get_x(), and Lut().

float Lut::m_Xcn

Definition at line 52 of file Lut.h.

Referenced by get_x(), Lut(), and setForTestBeam().