CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTConfigLUTs Class Reference

#include <DTConfigLUTs.h>

Inheritance diagram for DTConfigLUTs:
DTConfig

Public Member Functions

int BTIC () const
 BTIC parameter. More...
 
float D () const
 d: distance vertex to normal, unit cm. More...
 
bool debug () const
 Debug flag. More...
 
void DSPtoIEEE32 (short DSPmantissa, short DSPexp, float *f) const
 DSP to IEEE32 conversion. More...
 
 DTConfigLUTs (const edm::ParameterSet &ps)
 Constructor. More...
 
 DTConfigLUTs ()
 Empty Constructor. More...
 
 DTConfigLUTs (bool debug, unsigned short int *buffer)
 Constructor from string. More...
 
void IEEE32toDSP (float f, short int &DSPmantissa, short int &DSPexp) const
 IEEE32 to DSP conversion. More...
 
void print () const
 Print the setup. More...
 
void setBTIC (int btic)
 
void setD (float d)
 
void setDebug (bool debug)
 Set single parameter functions. More...
 
void setWHEEL (int wheel)
 
void setXCN (float Xcn)
 
int Wheel () const
 wheel sign (-1 or +1) More...
 
float Xcn () const
 Xcn: distance vertex to normal, unit cm. More...
 
 ~DTConfigLUTs () override
 Destructor. More...
 
- Public Member Functions inherited from DTConfig
 DTConfig ()
 Constructor. More...
 
virtual ~DTConfig ()
 Destructor. More...
 

Private Member Functions

void setDefaults (const edm::ParameterSet &m_ps)
 Load pset values into class variables. More...
 

Private Attributes

int m_btic
 
float m_d
 
bool m_debug
 
int m_wheel
 
float m_Xcn
 

Additional Inherited Members

- Static Public Attributes inherited from DTConfig
static const int NBTITC = 4
 
static const int NSTEPF = 9
 
static const int NSTEPL = 24
 Constants: first and last step to start trigger finding. More...
 
static const int NTCTSS = 4
 Constant: number of TRACOs in input to a TSS. More...
 

Detailed Description

Configurable parameters and constants for Level-1 Muon DT Trigger - LUTs

Author
S. Vanini

Definition at line 36 of file DTConfigLUTs.h.

Constructor & Destructor Documentation

◆ DTConfigLUTs() [1/3]

DTConfigLUTs::DTConfigLUTs ( const edm::ParameterSet ps)

Constructor.

Definition at line 34 of file DTConfigLUTs.cc.

References setDefaults().

34 { setDefaults(ps); }
void setDefaults(const edm::ParameterSet &m_ps)
Load pset values into class variables.
Definition: DTConfigLUTs.cc:79

◆ DTConfigLUTs() [2/3]

DTConfigLUTs::DTConfigLUTs ( )
inline

Empty Constructor.

Definition at line 42 of file DTConfigLUTs.h.

42 {};

◆ DTConfigLUTs() [3/3]

DTConfigLUTs::DTConfigLUTs ( bool  debug,
unsigned short int *  buffer 
)

Constructor from string.

Definition at line 36 of file DTConfigLUTs.cc.

References edmScanValgrind::buffer, DummyCfis::c, ztail::d, DSPtoIEEE32(), Exception, mps_fire::i, m_debug, setBTIC(), setD(), setWHEEL(), setXCN(), makeMuonMisalignmentScenario::wheel, and Xcn().

36  {
37  m_debug = debugLUTS;
38 
39  // check if this is a LUT configuration string
40  if (buffer[2] != 0xA8) {
41  throw cms::Exception("DTTPG") << "===> ConfigLUTs constructor : not a LUT string!" << std::endl;
42  }
43 
44  // decode
45  short int memory_lut[7];
46  int c = 3;
47  for (int i = 0; i < 7; i++) {
48  memory_lut[i] = (buffer[c] << 8) | buffer[c + 1];
49  c += 2;
50  //std::cout << hex << memory_bti[i] << " ";
51  }
52 
53  // decode
54  int btic = memory_lut[0];
55  float d;
56  DSPtoIEEE32(memory_lut[1], memory_lut[2], &d);
57  float Xcn;
58  DSPtoIEEE32(memory_lut[3], memory_lut[4], &Xcn);
59  int wheel = memory_lut[5];
60 
61  // set parameters
62  setBTIC(btic);
63  setD(d);
64  setXCN(Xcn);
65  setWHEEL(wheel);
66 
67  return;
68 }
void setWHEEL(int wheel)
Definition: DTConfigLUTs.h:70
void DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f) const
DSP to IEEE32 conversion.
d
Definition: ztail.py:151
void setD(float d)
Definition: DTConfigLUTs.h:68
void setBTIC(int btic)
Definition: DTConfigLUTs.h:67
void setXCN(float Xcn)
Definition: DTConfigLUTs.h:69
float Xcn() const
Xcn: distance vertex to normal, unit cm.
Definition: DTConfigLUTs.h:60

◆ ~DTConfigLUTs()

DTConfigLUTs::~DTConfigLUTs ( )
override

Destructor.

Definition at line 73 of file DTConfigLUTs.cc.

73 {}

Member Function Documentation

◆ BTIC()

int DTConfigLUTs::BTIC ( ) const
inline

BTIC parameter.

Definition at line 54 of file DTConfigLUTs.h.

References m_btic.

Referenced by Lut::Lut().

54 { return m_btic; }

◆ D()

float DTConfigLUTs::D ( ) const
inline

d: distance vertex to normal, unit cm.

Definition at line 57 of file DTConfigLUTs.h.

References m_d.

Referenced by DTConfigManager::dumpLUTParam(), and Lut::Lut().

57 { return m_d; }

◆ debug()

bool DTConfigLUTs::debug ( ) const
inline

Debug flag.

Definition at line 51 of file DTConfigLUTs.h.

References m_debug.

Referenced by print(), and setDebug().

51 { return m_debug; }

◆ DSPtoIEEE32()

void DTConfigLUTs::DSPtoIEEE32 ( short  DSPmantissa,
short  DSPexp,
float *  f 
) const

DSP to IEEE32 conversion.

Definition at line 109 of file DTConfigLUTs.cc.

References f, nano_mu_digi_cff::float, and funct::pow().

Referenced by DTConfigLUTs().

109  {
110  DSPexp -= 15;
111  *f = DSPmantissa * (float)pow(2.0, DSPexp);
112  return;
113 }
double f[11][100]
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ IEEE32toDSP()

void DTConfigLUTs::IEEE32toDSP ( float  f,
short int &  DSPmantissa,
short int &  DSPexp 
) const

IEEE32 to DSP conversion.

Definition at line 115 of file DTConfigLUTs.cc.

References f, and Validation_hcalonly_cfi::sign.

Referenced by DTConfigManager::dumpLUTParam().

115  {
116  long int pl = 0;
117  static_assert(sizeof(decltype(pl)) >= sizeof(float));
118 
119  DSPmantissa = 0;
120  DSPexp = 0;
121 
122  if (f != 0.0) {
123  //pl = (long *)&f;
124  memcpy(&pl, &f, sizeof(float));
125  bool sign = false;
126  if ((pl & 0x80000000) != 0)
127  sign = true;
128  long int lm = (0x800000 | (pl & 0x7FFFFF)); // [1][23bit mantissa]
129  lm >>= 9; //reduce to 15bits
130  lm &= 0x7FFF;
131  DSPexp = ((pl >> 23) & 0xFF) - 126;
132  DSPmantissa = (short)lm;
133  if (sign)
134  DSPmantissa = -DSPmantissa; // convert negative value in 2.s complement
135  }
136  return;
137 }
double f[11][100]

◆ print()

void DTConfigLUTs::print ( void  ) const

Print the setup.

Definition at line 96 of file DTConfigLUTs.cc.

References gather_cfg::cout, debug(), m_btic, m_d, m_wheel, and m_Xcn.

Referenced by DTConfigTester::analyze().

96  {
97  std::cout << "******************************************************************************" << std::endl;
98  std::cout << "* DTTrigger configuration : LUT parameters *" << std::endl;
99  std::cout << "******************************************************************************" << std::endl
100  << std::endl;
101  std::cout << "Debug flag : " << debug() << std::endl;
102  std::cout << "BTIC parameter : " << m_btic << std::endl;
103  std::cout << "d: distance vertex to normal, unit cm. " << m_d << std::endl;
104  std::cout << "Xcn: distance vertex to normal, unit cm. " << m_Xcn << std::endl;
105  std::cout << "wheel sign " << m_wheel << std::endl;
106  std::cout << "******************************************************************************" << std::endl;
107 }
bool debug() const
Debug flag.
Definition: DTConfigLUTs.h:51

◆ setBTIC()

void DTConfigLUTs::setBTIC ( int  btic)
inline

Definition at line 67 of file DTConfigLUTs.h.

References m_btic.

Referenced by DTConfigLUTs().

67 { m_btic = btic; }

◆ setD()

void DTConfigLUTs::setD ( float  d)
inline

Definition at line 68 of file DTConfigLUTs.h.

References ztail::d, and m_d.

Referenced by DTConfigLUTs().

68 { m_d = d; }
d
Definition: ztail.py:151

◆ setDebug()

void DTConfigLUTs::setDebug ( bool  debug)
inline

Set single parameter functions.

Definition at line 66 of file DTConfigLUTs.h.

References debug(), and m_debug.

66 { m_debug = debug; }
bool debug() const
Debug flag.
Definition: DTConfigLUTs.h:51

◆ setDefaults()

void DTConfigLUTs::setDefaults ( const edm::ParameterSet m_ps)
private

Load pset values into class variables.

Definition at line 79 of file DTConfigLUTs.cc.

References edm::ParameterSet::getUntrackedParameter(), m_btic, m_d, m_debug, m_wheel, and m_Xcn.

Referenced by DTConfigLUTs().

79  {
80  // Debug flag
81  m_debug = m_ps.getUntrackedParameter<bool>("Debug");
82 
83  // BTIC parameter
84  m_btic = m_ps.getUntrackedParameter<int>("BTIC");
85 
86  // d: distance vertex to normal, unit cm.
87  m_d = m_ps.getUntrackedParameter<double>("D");
88 
89  // Xcn: distance vertex to normal, unit cm.
90  m_Xcn = m_ps.getUntrackedParameter<double>("XCN");
91 
92  // wheel sign (-1 or +1)
93  m_wheel = m_ps.getUntrackedParameter<int>("WHEEL");
94 }
T getUntrackedParameter(std::string const &, T const &) const

◆ setWHEEL()

void DTConfigLUTs::setWHEEL ( int  wheel)
inline

◆ setXCN()

void DTConfigLUTs::setXCN ( float  Xcn)
inline

Definition at line 69 of file DTConfigLUTs.h.

References m_Xcn, and Xcn().

Referenced by DTConfigLUTs().

69 { m_Xcn = Xcn; }
float Xcn() const
Xcn: distance vertex to normal, unit cm.
Definition: DTConfigLUTs.h:60

◆ Wheel()

int DTConfigLUTs::Wheel ( ) const
inline

wheel sign (-1 or +1)

Definition at line 63 of file DTConfigLUTs.h.

References m_wheel.

Referenced by DTConfigManager::dumpLUTParam(), and Lut::Lut().

63 { return m_wheel; }

◆ Xcn()

float DTConfigLUTs::Xcn ( ) const
inline

Xcn: distance vertex to normal, unit cm.

Definition at line 60 of file DTConfigLUTs.h.

References m_Xcn.

Referenced by DTConfigLUTs(), DTConfigManager::dumpLUTParam(), Lut::Lut(), and setXCN().

60 { return m_Xcn; }

Member Data Documentation

◆ m_btic

int DTConfigLUTs::m_btic
private

Definition at line 89 of file DTConfigLUTs.h.

Referenced by BTIC(), print(), setBTIC(), and setDefaults().

◆ m_d

float DTConfigLUTs::m_d
private

Definition at line 90 of file DTConfigLUTs.h.

Referenced by D(), print(), setD(), and setDefaults().

◆ m_debug

bool DTConfigLUTs::m_debug
private

Definition at line 88 of file DTConfigLUTs.h.

Referenced by debug(), DTConfigLUTs(), setDebug(), and setDefaults().

◆ m_wheel

int DTConfigLUTs::m_wheel
private

Definition at line 92 of file DTConfigLUTs.h.

Referenced by print(), setDefaults(), setWHEEL(), and Wheel().

◆ m_Xcn

float DTConfigLUTs::m_Xcn
private

Definition at line 91 of file DTConfigLUTs.h.

Referenced by print(), setDefaults(), setXCN(), and Xcn().