BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcID Class Reference

#include <EmcID.h>

+ Inheritance diagram for EmcID:

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from BesDetectorID
int mdc_field_value () const
 Provide efficient access to individual field values.
 
int tof_field_value () const
 
int emc_field_value () const
 
int muc_field_value () const
 
int hlt_field_value () const
 
int mrpc_field_value () const
 
int get_detectorID (const Identifier &id) const
 
- Static Protected Attributes inherited from BesDetectorID
static const unsigned int MDC_ID = 0x10
 
static const unsigned int MDC_INDEX = 24
 
static const unsigned int MDC_MASK = 0xFF000000
 
static const unsigned int TOF_ID = 0x20
 
static const unsigned int TOF_INDEX = 24
 
static const unsigned int TOF_MASK = 0xFF000000
 
static const unsigned int EMC_ID = 0x30
 
static const unsigned int EMC_INDEX = 24
 
static const unsigned int EMC_MASK = 0xFF000000
 
static const unsigned int MUC_ID = 0x40
 
static const unsigned int MUC_INDEX = 24
 
static const unsigned int MUC_MASK = 0xFF000000
 
static const unsigned int HLT_ID = 0x50
 
static const unsigned int HLT_INDEX = 24
 
static const unsigned int HLT_MASK = 0xFF000000
 
static const unsigned int MRPC_ID = 0x70
 
static const unsigned int MRPC_INDEX = 24
 
static const unsigned int MRPC_MASK = 0xFF000000
 

Detailed Description

Definition at line 8 of file EmcID.h.

Member Typedef Documentation

◆ size_type

Definition at line 11 of file EmcID.h.

◆ value_type

Definition at line 12 of file EmcID.h.

Constructor & Destructor Documentation

◆ EmcID()

EmcID::EmcID ( void  )

constructor

Definition at line 4 of file EmcID.cxx.

4 {
5}

◆ ~EmcID()

EmcID::~EmcID ( void  )

destructor

Definition at line 7 of file EmcID.cxx.

7 {
8}

Member Function Documentation

◆ barrel_ec()

◆ crystal_id()

Identifier EmcID::crystal_id ( const unsigned int  barrel_ec,
const unsigned int  theta_module,
const unsigned int  phi_module 
)
static

For a single crystal.

Definition at line 71 of file EmcID.cxx.

74 {
76 unsigned int value = (EMC_ID << EMC_INDEX) | (barrel_ec << BARREL_EC_INDEX)|
77 (theta_module << THETA_INDEX) | (phi_module << PHI_INDEX);
78 return Identifier(value);
79}
static const unsigned int EMC_INDEX
Definition: BesDetectorID.h:75
static const unsigned int EMC_ID
Definition: BesDetectorID.h:74
static bool values_ok(const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)
Definition: EmcID.cxx:11
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition: EmcID.cxx:38
static unsigned int theta_module(const Identifier &id)
Definition: EmcID.cxx:43
static unsigned int phi_module(const Identifier &id)
Definition: EmcID.cxx:48

Referenced by EmcSelBhaEvent::CollectBhabha(), RawDataEmcMcHitCnv::createObj(), AbsCor::execute(), EmcRec::execute(), EmcRecROOTGeo::FillCrystalMap(), EmcRecEndCapGeo::GetCrystal(), EmcRecNeighbor::GetNeighbors(), EmcRecNeighbor::GetNextNeighbors(), EmcRecROOTGeo::InitFromXML(), main(), EmcRecDigit2Hit::Output(), EmcRecDigit2Hit::OutputEndcap(), EmcRecShowerPosLin::Position(), EmcRecShowerPosLinShMax::Position(), EmcRecShowerPosLog::Position(), EmcRecShowerPosLoglin::Position(), BesEmcSD::ProcessHits(), BesRawDataWriter::SaveEmcDigits(), and BesMcTruthWriter::SaveEmcTruth().

◆ getBARREL()

unsigned int EmcID::getBARREL ( )
static

Definition at line 146 of file EmcID.cxx.

147{
148 return BARREL;
149}

Referenced by EmcRecROOTGeo::FillCrystalMap(), EmcRecNeighbor::GetNeighbors(), and EmcBuilder::initialize().

◆ getBARREL_EC_MAX()

unsigned int EmcID::getBARREL_EC_MAX ( )
static

Definition at line 132 of file EmcID.cxx.

133{
134 return BARREL_EC_MAX;
135}

Referenced by EmcBuilder::initialize().

◆ getBARREL_EC_MIN()

unsigned int EmcID::getBARREL_EC_MIN ( )
static

Definition at line 136 of file EmcID.cxx.

137{
138 return BARREL_EC_MIN;
139}

Referenced by EmcBuilder::initialize().

◆ getENDCAP_EAST()

unsigned int EmcID::getENDCAP_EAST ( )
static

◆ getENDCAP_WEST()

unsigned int EmcID::getENDCAP_WEST ( )
static

Definition at line 151 of file EmcID.cxx.

152{
153 return ENDCAP_WEST;
154}

Referenced by EmcRecEndCapGeo::GetCrystal(), EmcRecNeighbor::GetNeighbors(), and main().

◆ getIntID()

unsigned int EmcID::getIntID ( const unsigned int  barrel_ec,
const unsigned int  theta_module,
const unsigned int  phi_module 
)
static

Definition at line 81 of file EmcID.cxx.

84 {
86 unsigned int value = (EMC_ID << EMC_INDEX) | (barrel_ec << BARREL_EC_INDEX)|
87 (theta_module << THETA_INDEX) | (phi_module << PHI_INDEX);
88 return value;
89}

Referenced by EmcBuilder::initialize().

◆ getPHI_BARREL_MAX()

◆ getPHI_BARREL_MIN()

unsigned int EmcID::getPHI_BARREL_MIN ( )
static

Definition at line 111 of file EmcID.cxx.

112{
113 return PHI_BARREL_MIN;
114}

Referenced by EmcRecNeighbor::GetNeighbors(), EmcRecNeighbor::GetNextNeighbors(), EmcBuilder::initialize(), and EmcRecDigit2Hit::Output().

◆ getPHI_ENDCAP_MAX()

unsigned int EmcID::getPHI_ENDCAP_MAX ( const unsigned int  theta)
static

Definition at line 115 of file EmcID.cxx.

116{
117 if(theta==0 || theta==1) {
118 return PHI_ENDCAP_MAX1;
119 }
120 if(theta==2 || theta==3) {
121 return PHI_ENDCAP_MAX2;
122 }
123 if(theta==4 || theta==5) {
124 return PHI_ENDCAP_MAX3;
125 }
126 return 0; //no available number
127}

Referenced by EmcStructure::crystalsInRing(), EmcRecEndCapGeo::GetCCenter(), EmcRecEndCapGeo::GetCFrontCenter(), EmcRecEndCapGeo::GetCrystal(), EmcRecNeighbor::GetNeighbors(), EmcStructure::getNumberOfXtals(), EmcBuilder::initialize(), main(), EmcRecDigit2Hit::OutputEndcap(), phi_module_max(), and values_ok().

◆ getPHI_ENDCAP_MIN()

unsigned int EmcID::getPHI_ENDCAP_MIN ( )
static

Definition at line 128 of file EmcID.cxx.

129{
130 return PHI_ENDCAP_MIN;
131}

Referenced by EmcRecNeighbor::GetNeighbors(), EmcBuilder::initialize(), and EmcRecDigit2Hit::OutputEndcap().

◆ getTHETA_BARREL_MAX()

unsigned int EmcID::getTHETA_BARREL_MAX ( )
static

◆ getTHETA_BARREL_MIN()

unsigned int EmcID::getTHETA_BARREL_MIN ( )
static

Definition at line 95 of file EmcID.cxx.

96{
97 return THETA_BARREL_MIN;
98}

Referenced by EmcRecNeighbor::GetNeighbors(), EmcRecNeighbor::GetNextNeighbors(), EmcBuilder::initialize(), and EmcRecDigit2Hit::Output().

◆ getTHETA_ENDCAP_MAX()

unsigned int EmcID::getTHETA_ENDCAP_MAX ( )
static

Definition at line 99 of file EmcID.cxx.

100{
101 return THETA_ENDCAP_MAX;
102}

Referenced by EmcRecNeighbor::GetNeighbors(), EmcStructure::getNumberOfTheRings(), EmcBuilder::initialize(), and EmcRecDigit2Hit::OutputEndcap().

◆ getTHETA_ENDCAP_MIN()

unsigned int EmcID::getTHETA_ENDCAP_MIN ( )
static

Definition at line 103 of file EmcID.cxx.

104{
105 return THETA_ENDCAP_MIN;
106}

Referenced by EmcRecNeighbor::GetNeighbors(), EmcBuilder::initialize(), and EmcRecDigit2Hit::OutputEndcap().

◆ is_barrel()

bool EmcID::is_barrel ( const Identifier id)
static

Test for barrel.

Definition at line 32 of file EmcID.cxx.

32 {
33 unsigned int pos = (id.get_value() & EmcID::BARREL_EC_MASK) >> EmcID::BARREL_EC_INDEX;
34 return (pos == BARREL) ? true : false ;
35}

Referenced by EmcRecGeoSvc::GetCCenter(), EmcRecGeoSvc::GetCFrontCenter(), EmcRecGeoSvc::GetCrystal(), EmcRecGeoSvc::GetCrystalPoint(), main(), phi_module_max(), and theta_module_max().

◆ phi_module()

◆ phi_module_max()

unsigned int EmcID::phi_module_max ( const Identifier id)

Definition at line 62 of file EmcID.cxx.

62 {
63 if (is_barrel(id)) {
64 return PHI_BARREL_MAX;
65 } else {
67 }
68}
static bool is_barrel(const Identifier &id)
Test for barrel.
Definition: EmcID.cxx:32
static unsigned int getPHI_ENDCAP_MAX(const unsigned int theta)
Definition: EmcID.cxx:115

◆ theta_module()

◆ theta_module_max()

unsigned int EmcID::theta_module_max ( const Identifier id)

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

Definition at line 53 of file EmcID.cxx.

53 {
54 if (is_barrel(id)) {
55 return THETA_BARREL_MAX;
56 } else {
57 return THETA_ENDCAP_MAX;
58 }
59}

◆ values_ok()

bool EmcID::values_ok ( const unsigned int  barrel_ec,
const unsigned int  theta_module,
const unsigned int  phi_module 
)
static

Definition at line 11 of file EmcID.cxx.

14 {
15 // Check values
16 // unsigned int >= 0, this is definitely true.
17 // Omit the compare with MIN(0) to avoid warnings in compile.
18 if (barrel_ec > BARREL_EC_MAX ) return false;
19
20 if ( barrel_ec == BARREL ) {
21 if ( phi_module > PHI_BARREL_MAX ) return false;
22 if ( theta_module > THETA_BARREL_MAX ) return false;
23 }
24 else { // for endcap
25 if ( theta_module > THETA_ENDCAP_MAX ) return false;
26 if ( phi_module > getPHI_ENDCAP_MAX(theta_module) ) return false;
27 }
28 return true;
29}

Referenced by crystal_id(), and getIntID().


The documentation for this class was generated from the following files: