CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 DSP to IEEE32 conversion. More...
 
 DTConfigLUTs (const edm::ParameterSet &ps)
 Constructor. More...
 
 DTConfigLUTs ()
 Empty Constructor. More...
 
 DTConfigLUTs (unsigned short int *buffer)
 Constructor from string. More...
 
void IEEE32toDSP (float f, short int &DSPmantissa, short int &DSPexp)
 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:81
DTConfigLUTs::DTConfigLUTs ( )
inline

Empty Constructor.

Definition at line 44 of file DTConfigLUTs.h.

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

Constructor from string.

Definition at line 38 of file DTConfigLUTs.cc.

References trackerHits::c, DSPtoIEEE32(), edm::hlt::Exception, i, setBTIC(), setD(), setWHEEL(), setXCN(), and Xcn().

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

Destructor.

Definition at line 74 of file DTConfigLUTs.cc.

74 {}

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 print(), and setDebug().

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

DSP to IEEE32 conversion.

Definition at line 114 of file DTConfigLUTs.cc.

References funct::pow().

Referenced by DTConfigLUTs().

115 {
116  DSPexp -= 15;
117  *f = DSPmantissa * (float)pow( 2.0, DSPexp );
118  return;
119 }
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 
)

IEEE32 to DSP conversion.

Definition at line 123 of file DTConfigLUTs.cc.

Referenced by DTConfigManager::dumpLUTParam().

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

Print the setup.

Definition at line 100 of file DTConfigLUTs.cc.

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

100  {
101 
102  std::cout << "******************************************************************************" << std::endl;
103  std::cout << "* DTTrigger configuration : LUT parameters *" << std::endl;
104  std::cout << "******************************************************************************" << std::endl << std::endl;
105  std::cout << "Debug flag : " << debug() << std::endl;
106  std::cout << "BTIC parameter : " << m_btic << std::endl;
107  std::cout << "d: distance vertex to normal, unit cm. " << m_d << std::endl;
108  std::cout << "Xcn: distance vertex to normal, unit cm. " << m_Xcn << std::endl;
109  std::cout << "wheel sign " << m_wheel << std::endl;
110  std::cout << "******************************************************************************" << std::endl;
111 }
bool debug() const
Debug flag.
Definition: DTConfigLUTs.h:53
tuple cout
Definition: gather_cfg.py:41
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 m_d.

Referenced by DTConfigLUTs().

70 { m_d = d; }
void DTConfigLUTs::setDebug ( bool  debug)
inline

Set single parameter functions.

Definition at line 68 of file DTConfigLUTs.h.

References debug(), and m_debug.

Referenced by DTConfigDBProducer::readDTCCBConfig().

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 81 of file DTConfigLUTs.cc.

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

Referenced by DTConfigLUTs().

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

Definition at line 72 of file DTConfigLUTs.h.

References m_wheel.

Referenced by DTConfigLUTs().

72 { m_wheel = wheel; }
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(), 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().