Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EmcID Class Reference

#include <EmcID.h>

Inheritance diagram for EmcID:

BesDetectorID BesDetectorID List of all members.

Public Types

typedef Identifier::size_type size_type
typedef Identifier::size_type size_type
typedef Identifier::value_type value_type
typedef Identifier::value_type value_type

Public Member Functions

Identifier emc (void) const
Identifier emc (void) const
 EmcID ()
 constructor
 EmcID ()
 constructor
Identifier hlt (void) const
Identifier hlt (void) const
bool is_emc (const Identifier &id) const
bool is_emc (const Identifier &id) const
bool is_hlt (const Identifier &id) const
bool is_hlt (const Identifier &id) const
bool is_mdc (const Identifier &id) const
bool is_mdc (const Identifier &id) const
bool is_muc (const Identifier &id) const
bool is_muc (const Identifier &id) const
bool is_tof (const Identifier &id) const
bool is_tof (const Identifier &id) const
Identifier mdc (void) const
Identifier mdc (void) const
Identifier muc (void) const
Identifier muc (void) const
unsigned int phi_module_max (const Identifier &id)
unsigned int phi_module_max (const Identifier &id)
unsigned int theta_module_max (const Identifier &id)
 Max/Min values for each field (error returns -999).
unsigned int theta_module_max (const Identifier &id)
 Max/Min values for each field (error returns -999).
Identifier tof (void) const
Identifier tof (void) const
 ~EmcID ()
 destructor
 ~EmcID ()
 destructor

Static Public Member Functions

unsigned int barrel_ec (const Identifier &id)
 Values of different levels (failure returns 0).
unsigned int barrel_ec (const Identifier &id)
 Values of different levels (failure returns 0).
Identifier crystal_id (const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)
 For a single crystal.
Identifier crystal_id (const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)
 For a single crystal.
unsigned int getBARREL ()
unsigned int getBARREL ()
unsigned int getBARREL_EC_MAX ()
unsigned int getBARREL_EC_MAX ()
unsigned int getBARREL_EC_MIN ()
unsigned int getBARREL_EC_MIN ()
unsigned int getENDCAP_EAST ()
unsigned int getENDCAP_EAST ()
unsigned int getENDCAP_WEST ()
unsigned int getENDCAP_WEST ()
unsigned int getIntID (const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)
unsigned int getIntID (const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)
unsigned int getPHI_BARREL_MAX ()
unsigned int getPHI_BARREL_MAX ()
unsigned int getPHI_BARREL_MIN ()
unsigned int getPHI_BARREL_MIN ()
unsigned int getPHI_ENDCAP_MAX (const unsigned int theta)
unsigned int getPHI_ENDCAP_MAX (const unsigned int theta)
unsigned int getPHI_ENDCAP_MIN ()
unsigned int getPHI_ENDCAP_MIN ()
unsigned int getTHETA_BARREL_MAX ()
unsigned int getTHETA_BARREL_MAX ()
unsigned int getTHETA_BARREL_MIN ()
unsigned int getTHETA_BARREL_MIN ()
unsigned int getTHETA_ENDCAP_MAX ()
unsigned int getTHETA_ENDCAP_MAX ()
unsigned int getTHETA_ENDCAP_MIN ()
unsigned int getTHETA_ENDCAP_MIN ()
bool is_barrel (const Identifier &id)
 Test for barrel.
bool is_barrel (const Identifier &id)
 Test for barrel.
unsigned int phi_module (const Identifier &id)
unsigned int phi_module (const Identifier &id)
unsigned int theta_module (const Identifier &id)
unsigned int theta_module (const Identifier &id)
bool values_ok (const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)
bool values_ok (const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)

Protected Member Functions

int emc_field_value () const
int emc_field_value () const
int get_detectorID (const Identifier &id) const
int get_detectorID (const Identifier &id) const
int hlt_field_value () const
int hlt_field_value () const
int mdc_field_value () const
 Provide efficient access to individual field values.
int mdc_field_value () const
 Provide efficient access to individual field values.
int muc_field_value () const
int muc_field_value () const
int tof_field_value () const
int tof_field_value () const

Static Protected Attributes

const unsigned int EMC_ID = 0x30
const unsigned int EMC_INDEX = 24
const unsigned int EMC_MASK = 0xFF000000
const unsigned int HLT_ID = 0x50
const unsigned int HLT_INDEX = 24
const unsigned int HLT_MASK = 0xFF000000
const unsigned int MDC_ID = 0x10
const unsigned int MDC_INDEX = 24
const unsigned int MDC_MASK = 0xFF000000
const unsigned int MUC_ID = 0x40
const unsigned int MUC_INDEX = 24
const unsigned int MUC_MASK = 0xFF000000
const unsigned int TOF_ID = 0x20
const unsigned int TOF_INDEX = 24
const unsigned int TOF_MASK = 0xFF000000

Static Private Attributes

const unsigned int BARREL = 1
const unsigned int BARREL_EC_INDEX = 16
const unsigned int BARREL_EC_MASK = 0x000F0000
const unsigned int BARREL_EC_MAX = 2
const unsigned int BARREL_EC_MIN = 0
const unsigned int ENDCAP_EAST = 0
const unsigned int ENDCAP_WEST = 2
const unsigned int PHI_BARREL_MAX = 119
const unsigned int PHI_BARREL_MIN = 0
const unsigned int PHI_ENDCAP_MAX1 = 63
const unsigned int PHI_ENDCAP_MAX2 = 79
const unsigned int PHI_ENDCAP_MAX3 = 95
const unsigned int PHI_ENDCAP_MIN = 0
const unsigned int PHI_INDEX = 0
const unsigned int PHI_MASK = 0x000000FF
const unsigned int THETA_BARREL_MAX = 43
const unsigned int THETA_BARREL_MIN = 0
const unsigned int THETA_ENDCAP_MAX = 5
const unsigned int THETA_ENDCAP_MIN = 0
const unsigned int THETA_INDEX = 8
const unsigned int THETA_MASK = 0x00003F00

Member Typedef Documentation

typedef Identifier::size_type EmcID::size_type
 

typedef Identifier::size_type EmcID::size_type
 

typedef Identifier::value_type EmcID::value_type
 

typedef Identifier::value_type EmcID::value_type
 


Constructor & Destructor Documentation

EmcID::EmcID  ) 
 

constructor

00004                  {
00005 }

EmcID::~EmcID  ) 
 

destructor

00007                   {
00008 }

EmcID::EmcID  ) 
 

constructor

EmcID::~EmcID  ) 
 

destructor


Member Function Documentation

unsigned int EmcID::barrel_ec const Identifier id  )  [static]
 

Values of different levels (failure returns 0).

unsigned int EmcID::barrel_ec const Identifier id  )  [static]
 

Values of different levels (failure returns 0).

00038                                                    {
00039    return ((id.get_value() & EmcID::BARREL_EC_MASK) >>  EmcID::BARREL_EC_INDEX);  
00040 }

Identifier EmcID::crystal_id const unsigned int  barrel_ec,
const unsigned int  theta_module,
const unsigned int  phi_module
[static]
 

For a single crystal.

Identifier EmcID::crystal_id const unsigned int  barrel_ec,
const unsigned int  theta_module,
const unsigned int  phi_module
[static]
 

For a single crystal.

00074                                 {
00075    assert ( values_ok(barrel_ec, theta_module, phi_module) );
00076    unsigned int value = (EMC_ID << EMC_INDEX) | (barrel_ec << BARREL_EC_INDEX)|
00077      (theta_module << THETA_INDEX) | (phi_module << PHI_INDEX);
00078    return Identifier(value); 
00079 }

Identifier BesDetectorID::emc void   )  const [inherited]
 

Identifier BesDetectorID::emc void   )  const [inherited]
 

00054                                         {
00055   Identifier id = Identifier(  m_EmcId << EMC_INDEX );
00056   return id; 
00057 }

int BesDetectorID::emc_field_value  )  const [protected, inherited]
 

int BesDetectorID::emc_field_value  )  const [inline, protected, inherited]
 

00097 {return (m_EmcId);}       

int BesDetectorID::get_detectorID const Identifier id  )  const [protected, inherited]
 

int BesDetectorID::get_detectorID const Identifier id  )  const [protected, inherited]
 

unsigned int EmcID::getBARREL  )  [static]
 

unsigned int EmcID::getBARREL  )  [static]
 

00147 {
00148    return BARREL;
00149 }

unsigned int EmcID::getBARREL_EC_MAX  )  [static]
 

unsigned int EmcID::getBARREL_EC_MAX  )  [static]
 

00133 {
00134    return BARREL_EC_MAX;
00135 }

unsigned int EmcID::getBARREL_EC_MIN  )  [static]
 

unsigned int EmcID::getBARREL_EC_MIN  )  [static]
 

00137 {
00138    return BARREL_EC_MIN;
00139 }

unsigned int EmcID::getENDCAP_EAST  )  [static]
 

unsigned int EmcID::getENDCAP_EAST  )  [static]
 

00142 {
00143    return ENDCAP_EAST;
00144 }

unsigned int EmcID::getENDCAP_WEST  )  [static]
 

unsigned int EmcID::getENDCAP_WEST  )  [static]
 

00152 {
00153       return ENDCAP_WEST;
00154 }

unsigned int EmcID::getIntID const unsigned int  barrel_ec,
const unsigned int  theta_module,
const unsigned int  phi_module
[static]
 

unsigned int EmcID::getIntID const unsigned int  barrel_ec,
const unsigned int  theta_module,
const unsigned int  phi_module
[static]
 

00084                               {
00085    assert ( values_ok(barrel_ec, theta_module, phi_module) ); 
00086    unsigned int value = (EMC_ID << EMC_INDEX) | (barrel_ec << BARREL_EC_INDEX)|
00087                       (theta_module << THETA_INDEX) | (phi_module << PHI_INDEX);
00088    return value;
00089 }

unsigned int EmcID::getPHI_BARREL_MAX  )  [static]
 

unsigned int EmcID::getPHI_BARREL_MAX  )  [static]
 

00108 {
00109    return PHI_BARREL_MAX;
00110 }

unsigned int EmcID::getPHI_BARREL_MIN  )  [static]
 

unsigned int EmcID::getPHI_BARREL_MIN  )  [static]
 

00112 {
00113    return PHI_BARREL_MIN;
00114 }

unsigned int EmcID::getPHI_ENDCAP_MAX const unsigned int  theta  )  [static]
 

unsigned int EmcID::getPHI_ENDCAP_MAX const unsigned int  theta  )  [static]
 

00116 {
00117    if(theta==0 || theta==1) { 
00118       return PHI_ENDCAP_MAX1; 
00119    }
00120    if(theta==2 || theta==3) {
00121       return PHI_ENDCAP_MAX2;
00122    }
00123    if(theta==4 || theta==5) {
00124       return PHI_ENDCAP_MAX3;
00125    }
00126    return 0; //no available number
00127 }

unsigned int EmcID::getPHI_ENDCAP_MIN  )  [static]
 

unsigned int EmcID::getPHI_ENDCAP_MIN  )  [static]
 

00129 {
00130    return PHI_ENDCAP_MIN;
00131 }

unsigned int EmcID::getTHETA_BARREL_MAX  )  [static]
 

unsigned int EmcID::getTHETA_BARREL_MAX  )  [static]
 

00092 {
00093    return THETA_BARREL_MAX;   
00094 }

unsigned int EmcID::getTHETA_BARREL_MIN  )  [static]
 

unsigned int EmcID::getTHETA_BARREL_MIN  )  [static]
 

00096 {
00097    return THETA_BARREL_MIN;
00098 }

unsigned int EmcID::getTHETA_ENDCAP_MAX  )  [static]
 

unsigned int EmcID::getTHETA_ENDCAP_MAX  )  [static]
 

00100 {
00101    return THETA_ENDCAP_MAX;
00102 }

unsigned int EmcID::getTHETA_ENDCAP_MIN  )  [static]
 

unsigned int EmcID::getTHETA_ENDCAP_MIN  )  [static]
 

00104 {
00105    return THETA_ENDCAP_MIN;
00106 }

Identifier BesDetectorID::hlt void   )  const [inherited]
 

Identifier BesDetectorID::hlt void   )  const [inherited]
 

00064                                         {
00065   Identifier id = Identifier(  m_HltId << HLT_INDEX );
00066   return id;
00067 }

int BesDetectorID::hlt_field_value  )  const [protected, inherited]
 

int BesDetectorID::hlt_field_value  )  const [inline, protected, inherited]
 

00103 {return (m_HltId);}

bool EmcID::is_barrel const Identifier id  )  [static]
 

Test for barrel.

bool EmcID::is_barrel const Identifier id  )  [static]
 

Test for barrel.

00032                                             {
00033    unsigned int pos = (id.get_value() & EmcID::BARREL_EC_MASK) >>  EmcID::BARREL_EC_INDEX;
00034    return (pos == BARREL) ? true : false ;
00035 }

bool BesDetectorID::is_emc const Identifier id  )  const [inherited]
 

bool BesDetectorID::is_emc const Identifier id  )  const [inherited]
 

00029                                                       {
00030   Identifier::value_type value = id.get_value(); 
00031   return (value  &  EMC_MASK >> EMC_INDEX) == EMC_ID ? true : false;   
00032 }

bool BesDetectorID::is_hlt const Identifier id  )  const [inherited]
 

bool BesDetectorID::is_hlt const Identifier id  )  const [inherited]
 

00039                                                       {
00040   Identifier::value_type value = id.get_value();
00041   return (value  &  HLT_MASK >> HLT_INDEX) == HLT_ID ? true : false;
00042 }

bool BesDetectorID::is_mdc const Identifier id  )  const [inherited]
 

bool BesDetectorID::is_mdc const Identifier id  )  const [inherited]
 

00019                                                       {
00020   Identifier::value_type value = id.get_value(); 
00021   return (value  &  MDC_MASK >> MDC_INDEX) == MDC_ID ? true : false;    
00022 }

bool BesDetectorID::is_muc const Identifier id  )  const [inherited]
 

bool BesDetectorID::is_muc const Identifier id  )  const [inherited]
 

00034                                                       {
00035   Identifier::value_type value = id.get_value(); 
00036   return (value  &  MUC_MASK >> MUC_INDEX) == MUC_ID ? true : false;
00037 }

bool BesDetectorID::is_tof const Identifier id  )  const [inherited]
 

bool BesDetectorID::is_tof const Identifier id  )  const [inherited]
 

00024                                                       {
00025   Identifier::value_type value = id.get_value(); 
00026   return (value  &  TOF_MASK >> TOF_INDEX) == TOF_ID ? true : false;
00027 }

Identifier BesDetectorID::mdc void   )  const [inherited]
 

Identifier BesDetectorID::mdc void   )  const [inherited]
 

00044                                         {
00045   Identifier id = Identifier(  m_MdcId << MDC_INDEX );
00046   return id; 
00047 }

int BesDetectorID::mdc_field_value  )  const [protected, inherited]
 

Provide efficient access to individual field values.

int BesDetectorID::mdc_field_value  )  const [inline, protected, inherited]
 

Provide efficient access to individual field values.

00091 {return (m_MdcId);}     

Identifier BesDetectorID::muc void   )  const [inherited]
 

Identifier BesDetectorID::muc void   )  const [inherited]
 

00059                                         {
00060   Identifier id = Identifier(  m_MucId << MUC_INDEX );
00061   return id; 
00062 }

int BesDetectorID::muc_field_value  )  const [protected, inherited]
 

int BesDetectorID::muc_field_value  )  const [inline, protected, inherited]
 

00100 {return (m_MucId);}       

unsigned int EmcID::phi_module const Identifier id  )  [static]
 

unsigned int EmcID::phi_module const Identifier id  )  [static]
 

00048                                                     {
00049   return (id.get_value() & EmcID::PHI_MASK) >>  EmcID::PHI_INDEX;  
00050 }

unsigned int EmcID::phi_module_max const Identifier id  ) 
 

unsigned int EmcID::phi_module_max const Identifier id  ) 
 

00062                                                            {
00063    if (is_barrel(id)) {
00064       return PHI_BARREL_MAX;
00065    } else {
00066       return getPHI_ENDCAP_MAX(theta_module(id));
00067    } 
00068 }

unsigned int EmcID::theta_module const Identifier id  )  [static]
 

unsigned int EmcID::theta_module const Identifier id  )  [static]
 

00043                                                       {
00044   return (id.get_value() & EmcID::THETA_MASK) >>  EmcID::THETA_INDEX;  
00045 }

unsigned int EmcID::theta_module_max const Identifier id  ) 
 

Max/Min values for each field (error returns -999).

unsigned int EmcID::theta_module_max const Identifier id  ) 
 

Max/Min values for each field (error returns -999).

00053                                                            {
00054    if (is_barrel(id)) {
00055       return THETA_BARREL_MAX;
00056    } else {
00057       return THETA_ENDCAP_MAX;
00058    }  
00059 }

Identifier BesDetectorID::tof void   )  const [inherited]
 

Identifier BesDetectorID::tof void   )  const [inherited]
 

00049                                        {
00050   Identifier id = Identifier(  m_TofId << TOF_INDEX );
00051   return id; 
00052 }

int BesDetectorID::tof_field_value  )  const [protected, inherited]
 

int BesDetectorID::tof_field_value  )  const [inline, protected, inherited]
 

00094 {return (m_TofId);}

bool EmcID::values_ok const unsigned int  barrel_ec,
const unsigned int  theta_module,
const unsigned int  phi_module
[static]
 

bool EmcID::values_ok const unsigned int  barrel_ec,
const unsigned int  theta_module,
const unsigned int  phi_module
[static]
 

00014                          {
00015    // Check values
00016    // unsigned int >= 0, this is definitely true.
00017    // Omit the compare with MIN(0) to avoid warnings in compile.
00018    if (barrel_ec  > BARREL_EC_MAX ) return false;
00019    
00020    if ( barrel_ec == BARREL ) {
00021       if ( phi_module    > PHI_BARREL_MAX )     return false;
00022       if ( theta_module  > THETA_BARREL_MAX )   return false;
00023    }
00024    else {  // for endcap
00025       if ( theta_module  > THETA_ENDCAP_MAX  )  return false; 
00026       if ( phi_module    > getPHI_ENDCAP_MAX(theta_module)  )  return false;
00027    }
00028    return true;
00029 }


Member Data Documentation

const unsigned int EmcID::BARREL = 1 [static, private]
 

const unsigned int EmcID::BARREL_EC_INDEX = 16 [static, private]
 

const unsigned int EmcID::BARREL_EC_MASK = 0x000F0000 [static, private]
 

const unsigned int EmcID::BARREL_EC_MAX = 2 [static, private]
 

const unsigned int EmcID::BARREL_EC_MIN = 0 [static, private]
 

const unsigned int BesDetectorID::EMC_ID = 0x30 [static, protected, inherited]
 

const unsigned int BesDetectorID::EMC_INDEX = 24 [static, protected, inherited]
 

const unsigned int BesDetectorID::EMC_MASK = 0xFF000000 [static, protected, inherited]
 

const unsigned int EmcID::ENDCAP_EAST = 0 [static, private]
 

const unsigned int EmcID::ENDCAP_WEST = 2 [static, private]
 

const unsigned int BesDetectorID::HLT_ID = 0x50 [static, protected, inherited]
 

const unsigned int BesDetectorID::HLT_INDEX = 24 [static, protected, inherited]
 

const unsigned int BesDetectorID::HLT_MASK = 0xFF000000 [static, protected, inherited]
 

const unsigned int BesDetectorID::MDC_ID = 0x10 [static, protected, inherited]
 

const unsigned int BesDetectorID::MDC_INDEX = 24 [static, protected, inherited]
 

const unsigned int BesDetectorID::MDC_MASK = 0xFF000000 [static, protected, inherited]
 

const unsigned int BesDetectorID::MUC_ID = 0x40 [static, protected, inherited]
 

const unsigned int BesDetectorID::MUC_INDEX = 24 [static, protected, inherited]
 

const unsigned int BesDetectorID::MUC_MASK = 0xFF000000 [static, protected, inherited]
 

const unsigned int EmcID::PHI_BARREL_MAX = 119 [static, private]
 

const unsigned int EmcID::PHI_BARREL_MIN = 0 [static, private]
 

const unsigned int EmcID::PHI_ENDCAP_MAX1 = 63 [static, private]
 

const unsigned int EmcID::PHI_ENDCAP_MAX2 = 79 [static, private]
 

const unsigned int EmcID::PHI_ENDCAP_MAX3 = 95 [static, private]
 

const unsigned int EmcID::PHI_ENDCAP_MIN = 0 [static, private]
 

const unsigned int EmcID::PHI_INDEX = 0 [static, private]
 

const unsigned int EmcID::PHI_MASK = 0x000000FF [static, private]
 

const unsigned int EmcID::THETA_BARREL_MAX = 43 [static, private]
 

const unsigned int EmcID::THETA_BARREL_MIN = 0 [static, private]
 

const unsigned int EmcID::THETA_ENDCAP_MAX = 5 [static, private]
 

const unsigned int EmcID::THETA_ENDCAP_MIN = 0 [static, private]
 

const unsigned int EmcID::THETA_INDEX = 8 [static, private]
 

const unsigned int EmcID::THETA_MASK = 0x00003F00 [static, private]
 

const unsigned int BesDetectorID::TOF_ID = 0x20 [static, protected, inherited]
 

const unsigned int BesDetectorID::TOF_INDEX = 24 [static, protected, inherited]
 

const unsigned int BesDetectorID::TOF_MASK = 0xFF000000 [static, protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:01:21 2011 for BOSS6.5.5 by  doxygen 1.3.9.1