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 ()
 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::DTConfigLUTs ( const edm::ParameterSet ps)

Constructor.

Definition at line 34 of file DTConfigLUTs.cc.

References setDefaults().

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

Empty Constructor.

Definition at line 44 of file DTConfigLUTs.h.

References edmScanValgrind::buffer, debug(), and ~DTConfigLUTs().

44 {};
DTConfigLUTs::DTConfigLUTs ( bool  debug,
unsigned short int *  buffer 
)

Constructor from string.

Definition at line 38 of file DTConfigLUTs.cc.

References EnergyCorrector::c, edmIntegrityCheck::d, DSPtoIEEE32(), Exception, mps_fire::i, m_debug, setBTIC(), setD(), setWHEEL(), setXCN(), makeMuonMisalignmentScenario::wheel, and Xcn().

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

Destructor.

Definition at line 76 of file DTConfigLUTs.cc.

Referenced by DTConfigLUTs().

76 {}

Member Function Documentation

int DTConfigLUTs::BTIC ( ) const
inline

BTIC parameter.

Definition at line 56 of file DTConfigLUTs.h.

References m_btic.

Referenced by Lut::Lut().

56 { return m_btic; }
float DTConfigLUTs::D ( ) const
inline

d: distance vertex to normal, unit cm.

Definition at line 59 of file DTConfigLUTs.h.

References m_d.

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

59 { return m_d; }
bool DTConfigLUTs::debug ( ) const
inline

Debug flag.

Definition at line 53 of file DTConfigLUTs.h.

References m_debug.

Referenced by DTConfigLUTs(), print(), and setDebug().

53 { return m_debug; }
void DTConfigLUTs::DSPtoIEEE32 ( short  DSPmantissa,
short  DSPexp,
float *  f 
) const

DSP to IEEE32 conversion.

Definition at line 116 of file DTConfigLUTs.cc.

References objects.autophobj::float, and funct::pow().

Referenced by DTConfigLUTs(), and setWHEEL().

117 {
118  DSPexp -= 15;
119  *f = DSPmantissa * (float)pow( 2.0, DSPexp );
120  return;
121 }
double f[11][100]
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void DTConfigLUTs::IEEE32toDSP ( float  f,
short int &  DSPmantissa,
short int &  DSPexp 
) const

IEEE32 to DSP conversion.

Definition at line 125 of file DTConfigLUTs.cc.

References Validation_hcalonly_cfi::sign.

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

126 {
127  long int *pl=0, lm;
128  bool sign=false;
129 
130  DSPmantissa = 0;
131  DSPexp = 0;
132 
133  if( f!=0.0 )
134  {
135  //pl = (long *)&f;
136  memcpy(pl,&f,sizeof(float));
137  if((*pl & 0x80000000)!=0)
138  sign=true;
139  lm = ( 0x800000 | (*pl & 0x7FFFFF)); // [1][23bit mantissa]
140  lm >>= 9; //reduce to 15bits
141  lm &= 0x7FFF;
142  DSPexp = ((*pl>>23)&0xFF)-126;
143  DSPmantissa = (short)lm;
144  if(sign)
145  DSPmantissa = - DSPmantissa; // convert negative value in 2.s complement
146 
147  }
148  return;
149 }
double f[11][100]
void DTConfigLUTs::print ( void  ) const

Print the setup.

Definition at line 102 of file DTConfigLUTs.cc.

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

Referenced by DTConfigTester::analyze(), and setWHEEL().

102  {
103 
104  std::cout << "******************************************************************************" << std::endl;
105  std::cout << "* DTTrigger configuration : LUT parameters *" << std::endl;
106  std::cout << "******************************************************************************" << std::endl << std::endl;
107  std::cout << "Debug flag : " << debug() << std::endl;
108  std::cout << "BTIC parameter : " << m_btic << std::endl;
109  std::cout << "d: distance vertex to normal, unit cm. " << m_d << std::endl;
110  std::cout << "Xcn: distance vertex to normal, unit cm. " << m_Xcn << std::endl;
111  std::cout << "wheel sign " << m_wheel << std::endl;
112  std::cout << "******************************************************************************" << std::endl;
113 }
bool debug() const
Debug flag.
Definition: DTConfigLUTs.h:53
void DTConfigLUTs::setBTIC ( int  btic)
inline

Definition at line 69 of file DTConfigLUTs.h.

References m_btic.

Referenced by DTConfigLUTs().

69 { m_btic = btic; }
void DTConfigLUTs::setD ( float  d)
inline

Definition at line 70 of file DTConfigLUTs.h.

References edmIntegrityCheck::d, and m_d.

Referenced by DTConfigLUTs().

void DTConfigLUTs::setDebug ( bool  debug)
inline

Set single parameter functions.

Definition at line 68 of file DTConfigLUTs.h.

References debug(), and m_debug.

68 { m_debug=debug; }
bool debug() const
Debug flag.
Definition: DTConfigLUTs.h:53
void DTConfigLUTs::setDefaults ( const edm::ParameterSet m_ps)
private

Load pset values into class variables.

Definition at line 83 of file DTConfigLUTs.cc.

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

Referenced by DTConfigLUTs(), and setWHEEL().

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

Definition at line 71 of file DTConfigLUTs.h.

References m_Xcn, and Xcn().

Referenced by DTConfigLUTs().

71 { m_Xcn = Xcn; }
float Xcn() const
Xcn: distance vertex to normal, unit cm.
Definition: DTConfigLUTs.h:62
int DTConfigLUTs::Wheel ( ) const
inline

wheel sign (-1 or +1)

Definition at line 65 of file DTConfigLUTs.h.

References m_wheel.

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

65 { return m_wheel; }
float DTConfigLUTs::Xcn ( ) const
inline

Xcn: distance vertex to normal, unit cm.

Definition at line 62 of file DTConfigLUTs.h.

References m_Xcn.

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

62 { return m_Xcn; }

Member Data Documentation

int DTConfigLUTs::m_btic
private

Definition at line 92 of file DTConfigLUTs.h.

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

float DTConfigLUTs::m_d
private

Definition at line 93 of file DTConfigLUTs.h.

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

bool DTConfigLUTs::m_debug
private

Definition at line 91 of file DTConfigLUTs.h.

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

int DTConfigLUTs::m_wheel
private

Definition at line 95 of file DTConfigLUTs.h.

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

float DTConfigLUTs::m_Xcn
private

Definition at line 94 of file DTConfigLUTs.h.

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