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 ()
 Empty Constructor. More...
 
 DTConfigLUTs (bool debug, unsigned short int *buffer)
 Constructor from string. More...
 
 DTConfigLUTs (const edm::ParameterSet &ps)
 Constructor. 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.

34 { setDefaults(ps); }

References setDefaults().

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

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 }

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

◆ ~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.

54 { return m_btic; }

References m_btic.

Referenced by Lut::Lut().

◆ D()

float DTConfigLUTs::D ( ) const
inline

d: distance vertex to normal, unit cm.

Definition at line 57 of file DTConfigLUTs.h.

57 { return m_d; }

References m_d.

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

◆ debug()

bool DTConfigLUTs::debug ( ) const
inline

Debug flag.

Definition at line 51 of file DTConfigLUTs.h.

51 { return m_debug; }

References m_debug.

Referenced by print(), and setDebug().

◆ DSPtoIEEE32()

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

DSP to IEEE32 conversion.

Definition at line 109 of file DTConfigLUTs.cc.

109  {
110  DSPexp -= 15;
111  *f = DSPmantissa * (float)pow(2.0, DSPexp);
112  return;
113 }

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

Referenced by DTConfigLUTs().

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

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 }

References f, and Validation_hcalonly_cfi::sign.

Referenced by DTConfigManager::dumpLUTParam().

◆ print()

void DTConfigLUTs::print ( void  ) const

Print the setup.

Definition at line 96 of file DTConfigLUTs.cc.

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 }

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

Referenced by DTConfigTester::analyze().

◆ setBTIC()

void DTConfigLUTs::setBTIC ( int  btic)
inline

Definition at line 67 of file DTConfigLUTs.h.

67 { m_btic = btic; }

References m_btic.

Referenced by DTConfigLUTs().

◆ setD()

void DTConfigLUTs::setD ( float  d)
inline

Definition at line 68 of file DTConfigLUTs.h.

68 { m_d = d; }

References ztail::d, and m_d.

Referenced by DTConfigLUTs().

◆ setDebug()

void DTConfigLUTs::setDebug ( bool  debug)
inline

Set single parameter functions.

Definition at line 66 of file DTConfigLUTs.h.

66 { m_debug = debug; }

References debug(), and m_debug.

◆ setDefaults()

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

Load pset values into class variables.

Definition at line 79 of file DTConfigLUTs.cc.

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 }

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

Referenced by DTConfigLUTs().

◆ setWHEEL()

void DTConfigLUTs::setWHEEL ( int  wheel)
inline

Definition at line 70 of file DTConfigLUTs.h.

70 { m_wheel = wheel; }

References m_wheel, and makeMuonMisalignmentScenario::wheel.

Referenced by DTConfigLUTs().

◆ setXCN()

void DTConfigLUTs::setXCN ( float  Xcn)
inline

Definition at line 69 of file DTConfigLUTs.h.

69 { m_Xcn = Xcn; }

References m_Xcn, and Xcn().

Referenced by DTConfigLUTs().

◆ Wheel()

int DTConfigLUTs::Wheel ( ) const
inline

wheel sign (-1 or +1)

Definition at line 63 of file DTConfigLUTs.h.

63 { return m_wheel; }

References m_wheel.

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

◆ Xcn()

float DTConfigLUTs::Xcn ( ) const
inline

Xcn: distance vertex to normal, unit cm.

Definition at line 60 of file DTConfigLUTs.h.

60 { return m_Xcn; }

References m_Xcn.

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

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

DTConfigLUTs::setDefaults
void setDefaults(const edm::ParameterSet &m_ps)
Load pset values into class variables.
Definition: DTConfigLUTs.cc:79
DTConfigLUTs::setXCN
void setXCN(float Xcn)
Definition: DTConfigLUTs.h:69
DTConfigLUTs::m_btic
int m_btic
Definition: DTConfigLUTs.h:89
DTConfigLUTs::m_wheel
int m_wheel
Definition: DTConfigLUTs.h:92
DTConfigLUTs::setWHEEL
void setWHEEL(int wheel)
Definition: DTConfigLUTs.h:70
mps_fire.i
i
Definition: mps_fire.py:355
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
DTConfigLUTs::m_Xcn
float m_Xcn
Definition: DTConfigLUTs.h:91
DTConfigLUTs::setBTIC
void setBTIC(int btic)
Definition: DTConfigLUTs.h:67
DTConfigLUTs::DSPtoIEEE32
void DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f) const
DSP to IEEE32 conversion.
Definition: DTConfigLUTs.cc:109
DTConfigLUTs::m_debug
bool m_debug
Definition: DTConfigLUTs.h:88
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTConfigLUTs::Xcn
float Xcn() const
Xcn: distance vertex to normal, unit cm.
Definition: DTConfigLUTs.h:60
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
DTConfigLUTs::setD
void setD(float d)
Definition: DTConfigLUTs.h:68
Exception
Definition: hltDiff.cc:246
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
ztail.d
d
Definition: ztail.py:151
DTConfigLUTs::debug
bool debug() const
Debug flag.
Definition: DTConfigLUTs.h:51
DTConfigLUTs::m_d
float m_d
Definition: DTConfigLUTs.h:90