// access and set functions for binary Tracker VXD tags
// Version 1.0 17 Dec 1998 Rob creation of TkID class

#include "TkID.h"

ClassImp(TkID)

////////////////////////////////////////////////////////////////////////////
//                                                                        
// TkID                                                                   
//                                                                        
// The TkID class contains a binary ID number and functions to obtain     
// the location of the hit in question.  The TkID class is used in the   
// Tracker_Hit and VXD_Hit classes.                                       
//                                                                        
////////////////////////////////////////////////////////////////////////////
///_________________________________________________________________________
 TkID::TkID() {
    //Default constructor
}
///_________________________________________________________________________
 TkID::TkID(UInt_t tag=0) : m_tag(tag) {
  // The constructor which sets the tag value.
}
///_________________________________________________________________________
 TkID::~TkID() {
  // Destructor
}
///_________________________________________________________________________
 UInt_t TkID::tag() const {
  // Returns the tag value
 return m_tag;
}
//____________________________________________________________
 void TkID::setTag(UInt_t tagVal) {
  // Sets the tag value to tagVal 
  m_tag = tagVal;
}
//____________________________________________________________
 Int_t TkID::layer() const {
  // This returns the layer number from the first 8 bits of m_tag
  Int_t  layer = (TkID::layerOn & m_tag);

  return layer;
}
//____________________________________________________________
 void TkID::setLayer(Int_t tag) {
  // setLayer sets the first 8 bits of m_tag to the layer number
  Int_t layerShift = tag & TkID::layerOn;

  Int_t  layer = (TkID::layerOff & m_tag) | layerShift;

  m_tag = layer;
}
//____________________________________________________________
 Int_t TkID::northSouth() const {
  // north/south in bit 30. northSouth extracts that, returns
  // it shifted down to least-significant end.
    Int_t  northSouth = (TkID::northSouthOn & m_tag) >> 30;

    return northSouth;
}
//____________________________________________________________
 void TkID::setNorthSouth(Int_t tag) {
  // setNorthSouth sets tag N/S bit (bit 30) to requested value.
  Int_t northSouthShift = (tag << 30) & TkID::northSouthOn;

  Int_t  northSouth = (TkID::northSouthOff & m_tag) | northSouthShift;

  m_tag = northSouth;
}
//____________________________________________________________
 Int_t TkID::barrelEndcap() const {
  // barrelEndcap in bit 31. BarrelEndcap extracts that bit 
  // and shifts to least-significant end.
  Int_t  barrelEndcap = (TkID::barrelEndcapOn & m_tag) >> 31;

  return barrelEndcap;
}
//____________________________________________________________
 void TkID::setBarrelEndcap(Int_t tag) {
  // setBarrelEndcap sets  barrelEndcap bit (bit 31) to requested
  // value
  Int_t barrelEndcapShift = (tag << 31) & TkID::barrelEndcapOn;
  
  Int_t  barrelEndcap = (TkID::barrelEndcapOff & m_tag) 
    | barrelEndcapShift;

  m_tag = barrelEndcap;
}
//____________________________________________________________
 Int_t TkID::system() const {
  // System in bits 28-29. system extracts those bits and shifts
  // down to least-significant end
  Int_t  system = (TkID::systemOn & m_tag) >> 28;

return system;
}
//____________________________________________________________
 void TkID::setSystem(Int_t tag) {
  // setSystem sets tag system bits in appropriate place (bits 28-29)
Int_t systemShift = (tag << 28) & TkID::systemOn;

Int_t  system = (TkID::systemOff & m_tag) 
  | systemShift;

m_tag = system;
}
///____________________________________________________________


const Int_t  TkID::systemOn =			0x30000000;
const Int_t  TkID::systemOff =		~TkID::systemOn;

const Int_t  TkID::barrelEndcapOn =		0x80000000;
const Int_t  TkID::barrelEndcapOff =	        ~TkID::barrelEndcapOn;

const Int_t  TkID::northSouthOn =		0x40000000;
const Int_t  TkID::northSouthOff =		~TkID::northSouthOn;

const Int_t  TkID::layerOn =			0x000000FF;
const Int_t  TkID::layerOff =			~TkID::layerOn;




ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.