CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DTConfigLUTs Class Reference

#include <DTConfigLUTs.h>

Inheritance diagram for DTConfigLUTs:
DTConfig

List of all members.

Public Member Functions

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

Private Member Functions

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

Private Attributes

int m_btic
float m_d
bool m_debug
int m_wheel
float m_Xcn

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

                                                    { 
  setDefaults(ps);
}
DTConfigLUTs::DTConfigLUTs ( ) [inline]

Empty Constructor.

Definition at line 44 of file DTConfigLUTs.h.

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

Constructor from string.

Definition at line 38 of file DTConfigLUTs.cc.

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

                                                                      {

  m_debug = debugLUTS;

  // check if this is a LUT configuration string
  if (buffer[2]!=0xA8){
        throw cms::Exception("DTTPG") << "===> ConfigLUTs constructor : not a LUT string!" << std::endl;
  }
   
  // decode
  short int memory_lut[7];
  int c=3;
  for(int i=0;i<7;i++){
        memory_lut[i] = (buffer[c]<<8) | buffer[c+1];
        c += 2;
        //std::cout << hex << memory_bti[i] << "  ";
  }

  // decode
  int btic = memory_lut[0];
  float d;
  DSPtoIEEE32( memory_lut[1],  memory_lut[2], &d );
  float Xcn;     
  DSPtoIEEE32( memory_lut[3],  memory_lut[4], &Xcn );
  int wheel = memory_lut[5];

  // set parameters 
  setBTIC(btic);
  setD(d);
  setXCN(Xcn);
  setWHEEL(wheel);
  
  return; 
}
DTConfigLUTs::~DTConfigLUTs ( )

Destructor.

Definition at line 76 of file DTConfigLUTs.cc.

{}

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

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

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

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

DSP to IEEE32 conversion.

Definition at line 116 of file DTConfigLUTs.cc.

References funct::pow().

Referenced by DTConfigLUTs().

{
  DSPexp -= 15;
  *f = DSPmantissa * (float)pow( 2.0, DSPexp );
  return;
}
void DTConfigLUTs::IEEE32toDSP ( float  f,
short int &  DSPmantissa,
short int &  DSPexp 
)

IEEE32 to DSP conversion.

Definition at line 125 of file DTConfigLUTs.cc.

Referenced by DTConfigManager::dumpLUTParam().

{
  long int *pl=0, lm;
  bool sign=false;

  DSPmantissa = 0;
  DSPexp = 0;

  if( f!=0.0 )
  {
        //pl = (long *)&f;
        memcpy(pl,&f,sizeof(float));
        if((*pl & 0x80000000)!=0)
                sign=true;
        lm = ( 0x800000 | (*pl & 0x7FFFFF)); // [1][23bit mantissa]
        lm >>= 9; //reduce to 15bits
        lm &= 0x7FFF;
        DSPexp = ((*pl>>23)&0xFF)-126;
        DSPmantissa = (short)lm;
        if(sign)
                DSPmantissa = - DSPmantissa;  // convert negative value in 2.s complement

  }
  return;
}
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.

                          {

  std::cout << "******************************************************************************" << std::endl;
  std::cout << "*              DTTrigger configuration : LUT parameters             *" << std::endl;
  std::cout << "******************************************************************************" << std::endl << std::endl;
  std::cout << "Debug flag : " <<  debug()     << std::endl;
  std::cout << "BTIC parameter : " << m_btic << std::endl;
  std::cout << "d: distance vertex to normal, unit cm. " << m_d << std::endl;
  std::cout << "Xcn: distance vertex to normal, unit cm. " << m_Xcn << std::endl;
  std::cout << "wheel sign " << m_wheel << std::endl;
  std::cout << "******************************************************************************" << std::endl;
}
void DTConfigLUTs::setBTIC ( int  btic) [inline]

Definition at line 69 of file DTConfigLUTs.h.

References m_btic.

Referenced by DTConfigLUTs().

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

Definition at line 70 of file DTConfigLUTs.h.

References m_d.

Referenced by DTConfigLUTs().

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

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

                                                     {

  // Debug flag 
  m_debug = m_ps.getUntrackedParameter<bool>("Debug");

  // BTIC parameter
  m_btic = m_ps.getUntrackedParameter<int>("BTIC");

  // d: distance vertex to normal, unit cm. 
  m_d = m_ps.getUntrackedParameter<double>("D");
  
  // Xcn: distance vertex to normal, unit cm. 
  m_Xcn = m_ps.getUntrackedParameter<double>("XCN");
    
  // wheel sign (-1 or +1)
  m_wheel = m_ps.getUntrackedParameter<int>("WHEEL");
}
void DTConfigLUTs::setWHEEL ( int  wheel) [inline]

Definition at line 72 of file DTConfigLUTs.h.

References m_wheel.

Referenced by DTConfigLUTs().

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

{ m_Xcn = Xcn; } 
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().

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

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