CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
MucID Class Reference

#include <MucID.h>

+ Inheritance diagram for MucID:

Public Types

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

Public Member Functions

 MucID ()
 constructor
 
 ~MucID ()
 destructor
 
int segment_max (const Identifier &id)
 Max/Min values for each field.
 
int layer_max (const Identifier &id)
 
int channel_max (const Identifier &id)
 
int getSegNum (const Identifier &id)
 
int getGapNum (const Identifier &id)
 
int getStripNum (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
 
Identifier cgem (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
 
bool is_cgem (const Identifier &id) const
 

Static Public Member Functions

static Identifier channel_id (int barrel_ec, int segment, int layer, int channel)
 For a single crystal.
 
static value_type getIntID (int barrel_ec, int segment, int layer, int channel)
 
static value_type getSEGMENT_BARREL_MAX ()
 
static value_type getSEGMENT_ENDCAP_MAX ()
 
static value_type getLAYER_BARREL_MAX ()
 
static value_type getLAYER_ENDCAP_MAX ()
 
static value_type getCHANNEL_BARREL_MAX ()
 
static value_type getCHANNEL_ENDCAP_MAX ()
 
static value_type getBARREL_EC_MAX ()
 
static value_type getBARREL_EC_MIN ()
 
static value_type getPartNum ()
 
static value_type getSegNum (int part)
 
static value_type getGapNum (int part)
 
static value_type getStripNum (int part, int seg, int gap)
 
static value_type getSegMax ()
 
static value_type getGapMax ()
 
static value_type getStripMax ()
 
static bool values_ok (const unsigned int barrel_ec, const unsigned int segment, const unsigned int layer, const unsigned int channel)
 
static bool is_barrel (const Identifier &id)
 Test for barrel.
 
static int barrel_ec (const Identifier &id)
 Values of different levels.
 
static int segment (const Identifier &id)
 
static int layer (const Identifier &id)
 
static int channel (const Identifier &id)
 
static int part (const Identifier &id)
 
static int seg (const Identifier &id)
 
static int gap (const Identifier &id)
 
static int strip (const Identifier &id)
 

Additional Inherited Members

- Protected Member Functions inherited from BesDetectorID
int mdc_field_value () const
 Provide efficient access to individual field values.
 
int cgem_field_value () const
 
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 CGEM_ID = 0x60
 
static const unsigned int CGEM_INDEX = 24
 
static const unsigned int CGEM_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 MucID.h.

Member Typedef Documentation

◆ size_type

Definition at line 11 of file MucID.h.

◆ value_type

Definition at line 12 of file MucID.h.

Constructor & Destructor Documentation

◆ MucID()

MucID::MucID ( void  )

constructor

Definition at line 7 of file MucID.cxx.

7 {
8}

◆ ~MucID()

MucID::~MucID ( void  )

destructor

Definition at line 10 of file MucID.cxx.

10 {
11}

Member Function Documentation

◆ barrel_ec()

int MucID::barrel_ec ( const Identifier id)
static

Values of different levels.

Definition at line 41 of file MucID.cxx.

41 {
42 return ((id.get_value() & MucID::BARREL_EC_MASK) >> MucID::BARREL_EC_INDEX);
43}

Referenced by channel_id(), DQA_MUC::execute(), MucRecRoadFinder::execute(), MucRecTrkExt::execute(), ExtMucKal::GapHit(), getIntID(), PrintMcInfo::printDigi(), PrintMcInfo::printHit(), MucCalibMgr::ReadEvent(), and values_ok().

◆ channel()

int MucID::channel ( const Identifier id)
static

Definition at line 71 of file MucID.cxx.

71 {
72 return (id.get_value() & MucID::CHANNEL_MASK) >> MucID::CHANNEL_INDEX;
73}

Referenced by channel_id(), DQA_MUC::execute(), MucRecRoadFinder::execute(), MucRecTrkExt::execute(), getIntID(), MucCalibMgr::ReadEvent(), and values_ok().

◆ channel_id()

Identifier MucID::channel_id ( int  barrel_ec,
int  segment,
int  layer,
int  channel 
)
static

For a single crystal.

Definition at line 135 of file MucID.cxx.

139 {
140 assert ( values_ok(barrel_ec, segment, layer, channel) );
141 value_type value = (MUC_ID << MUC_INDEX) | (barrel_ec << BARREL_EC_INDEX)|
142 (segment << SEGMENT_INDEX) | (layer << LAYER_INDEX) | (channel << CHANNEL_INDEX);
143 return Identifier(value);
144}
static const unsigned int MUC_ID
Definition: BesDetectorID.h:78
static const unsigned int MUC_INDEX
Definition: BesDetectorID.h:79
static int barrel_ec(const Identifier &id)
Values of different levels.
Definition: MucID.cxx:41
static int layer(const Identifier &id)
Definition: MucID.cxx:61
static bool values_ok(const unsigned int barrel_ec, const unsigned int segment, const unsigned int layer, const unsigned int channel)
Definition: MucID.cxx:14
static int channel(const Identifier &id)
Definition: MucID.cxx:71
static int segment(const Identifier &id)
Definition: MucID.cxx:51
Identifier::value_type value_type
Definition: MucID.h:12

Referenced by RawDataMucMcHitCnv::createObj(), MucGeoGeneral::FindIntersectGaps(), MucGeoGeneral::FindIntersectStrips(), MucGeoGeneral::GetGap(), MucRecHitContainer::GetHitByIdentifier(), MucGeoGeneral::GetStrip(), MucGeoGeneral::InitFromASCII(), MucGeoGeneral::InitFromXML(), MucRecHit::MucRecHit(), BesRawDataWriter::SaveMucDigits(), and BesMcTruthWriter::SaveMucTruth().

◆ channel_max()

int MucID::channel_max ( const Identifier id)

Definition at line 117 of file MucID.cxx.

117 {
118 if (this->is_barrel(id)) {
119 return CHANNEL_BARREL_NUM_MAX - 1;
120 } else {
121 return CHANNEL_ENDCAP_NUM_MAX - 1;
122 }
123}
static bool is_barrel(const Identifier &id)
Test for barrel.
Definition: MucID.cxx:35

◆ gap()

int MucID::gap ( const Identifier id)
static

◆ getBARREL_EC_MAX()

unsigned int MucID::getBARREL_EC_MAX ( )
static

Definition at line 236 of file MucID.cxx.

236 {
237 return BARREL_EC_NUM - 1;
238}

◆ getBARREL_EC_MIN()

unsigned int MucID::getBARREL_EC_MIN ( )
static

Definition at line 241 of file MucID.cxx.

241 {
242 return 0;
243}

◆ getCHANNEL_BARREL_MAX()

unsigned int MucID::getCHANNEL_BARREL_MAX ( )
static

Definition at line 226 of file MucID.cxx.

226 {
227 return CHANNEL_BARREL_NUM_MAX;
228}

◆ getCHANNEL_ENDCAP_MAX()

unsigned int MucID::getCHANNEL_ENDCAP_MAX ( )
static

Definition at line 231 of file MucID.cxx.

231 {
232 return CHANNEL_ENDCAP_NUM_MAX;
233}

◆ getGapMax()

◆ getGapNum() [1/2]

int MucID::getGapNum ( const Identifier id)

Definition at line 108 of file MucID.cxx.

108 {
109 if (this->is_barrel(id)) {
110 return LAYER_BARREL_NUM;
111 } else {
112 return LAYER_ENDCAP_NUM;
113 }
114}

◆ getGapNum() [2/2]

◆ getIntID()

unsigned int MucID::getIntID ( int  barrel_ec,
int  segment,
int  layer,
int  channel 
)
static

Definition at line 147 of file MucID.cxx.

151 {
152 value_type value = (MUC_ID << MUC_INDEX) | (barrel_ec << BARREL_EC_INDEX)|
153 (segment << SEGMENT_INDEX) | (layer << LAYER_INDEX) | (channel << CHANNEL_INDEX);
154 return value;
155
156}

Referenced by MucBuilder::initialize().

◆ getLAYER_BARREL_MAX()

unsigned int MucID::getLAYER_BARREL_MAX ( )
static

Definition at line 216 of file MucID.cxx.

216 {
217 return LAYER_BARREL_NUM - 1;
218}

◆ getLAYER_ENDCAP_MAX()

unsigned int MucID::getLAYER_ENDCAP_MAX ( )
static

Definition at line 221 of file MucID.cxx.

221 {
222 return LAYER_ENDCAP_NUM - 1;
223}

◆ getPartNum()

◆ getSegMax()

unsigned int MucID::getSegMax ( )
static

Definition at line 188 of file MucID.cxx.

188 {
189 if (SEGMENT_BARREL_NUM > SEGMENT_ENDCAP_NUM) return SEGMENT_BARREL_NUM;
190 else return SEGMENT_ENDCAP_NUM;
191}

Referenced by MucGeoGeneral::Init().

◆ getSEGMENT_BARREL_MAX()

unsigned int MucID::getSEGMENT_BARREL_MAX ( )
static

Definition at line 206 of file MucID.cxx.

206 {
207 return SEGMENT_BARREL_NUM - 1;
208}

◆ getSEGMENT_ENDCAP_MAX()

unsigned int MucID::getSEGMENT_ENDCAP_MAX ( )
static

Definition at line 211 of file MucID.cxx.

211 {
212 return SEGMENT_ENDCAP_NUM - 1;
213}

◆ getSegNum() [1/2]

int MucID::getSegNum ( const Identifier id)

Definition at line 90 of file MucID.cxx.

90 {
91 if (is_barrel(id)) {
92 return SEGMENT_BARREL_NUM;
93 } else {
94 return SEGMENT_ENDCAP_NUM;
95 }
96}

◆ getSegNum() [2/2]

◆ getStripMax()

unsigned int MucID::getStripMax ( )
static

Definition at line 200 of file MucID.cxx.

200 {
201 if (CHANNEL_BARREL_NUM_MAX > CHANNEL_ENDCAP_NUM_MAX) return CHANNEL_BARREL_NUM_MAX;
202 else return CHANNEL_ENDCAP_NUM_MAX;
203}

◆ getStripNum() [1/2]

int MucID::getStripNum ( const Identifier id)

Definition at line 126 of file MucID.cxx.

126 {
127 if (this->is_barrel(id)) {
128 return CHANNEL_BARREL_LAYER_NUM[this->gap(id)];
129 } else {
130 return CHANNEL_ENDCAP_NUM_MAX;
131 }
132}
static int gap(const Identifier &id)
Definition: MucID.cxx:66

◆ getStripNum() [2/2]

unsigned int MucID::getStripNum ( int  part,
int  seg,
int  gap 
)
static

Definition at line 178 of file MucID.cxx.

178 {
179 if (part == 1) {
180 if (seg == 2) return CHANNEL_BARREL_LAYER_NUM[gap];
181 else return CHANNEL_BARREL_LAYER_NUM[gap];
182 } else {
183 return CHANNEL_ENDCAP_NUM_MAX;
184 }
185}
static int seg(const Identifier &id)
Definition: MucID.cxx:56

Referenced by MucRecHitContainer::AddHit().

◆ is_barrel()

bool MucID::is_barrel ( const Identifier id)
static

Test for barrel.

Definition at line 35 of file MucID.cxx.

35 {
36 unsigned int pos = (id.get_value() & MucID::BARREL_EC_MASK) >> MucID::BARREL_EC_INDEX;
37 return (pos == 0 || pos == BARREL_EC_NUM - 1) ? false : true;
38}

Referenced by channel_max(), getGapNum(), getSegNum(), getStripNum(), layer_max(), and segment_max().

◆ layer()

int MucID::layer ( const Identifier id)
static

Definition at line 61 of file MucID.cxx.

61 {
62 return (id.get_value() & MucID::LAYER_MASK) >> MucID::LAYER_INDEX;
63}

Referenced by channel_id(), DQA_MUC::execute(), MucRecRoadFinder::execute(), MucRecTrkExt::execute(), ExtMucKal::GapHit(), getIntID(), PrintMcInfo::printDigi(), PrintMcInfo::printHit(), MucCalibMgr::ReadEvent(), and values_ok().

◆ layer_max()

int MucID::layer_max ( const Identifier id)

Definition at line 99 of file MucID.cxx.

99 {
100 if (this->is_barrel(id)) {
101 return LAYER_BARREL_NUM - 1;
102 } else {
103 return LAYER_ENDCAP_NUM - 1;
104 }
105}

◆ part()

int MucID::part ( const Identifier id)
static

◆ seg()

int MucID::seg ( const Identifier id)
static

◆ segment()

int MucID::segment ( const Identifier id)
static

Definition at line 51 of file MucID.cxx.

51 {
52 return (id.get_value() & MucID::SEGMENT_MASK) >> MucID::SEGMENT_INDEX;
53}

Referenced by channel_id(), DQA_MUC::execute(), MucRecRoadFinder::execute(), MucRecTrkExt::execute(), ExtMucKal::GapHit(), getIntID(), PrintMcInfo::printDigi(), PrintMcInfo::printHit(), MucCalibMgr::ReadEvent(), and values_ok().

◆ segment_max()

int MucID::segment_max ( const Identifier id)

Max/Min values for each field.

Definition at line 81 of file MucID.cxx.

81 {
82 if (is_barrel(id)) {
83 return SEGMENT_BARREL_NUM - 1;
84 } else {
85 return SEGMENT_ENDCAP_NUM - 1;
86 }
87}

◆ strip()

int MucID::strip ( const Identifier id)
static

◆ values_ok()

bool MucID::values_ok ( const unsigned int  barrel_ec,
const unsigned int  segment,
const unsigned int  layer,
const unsigned int  channel 
)
static

Definition at line 14 of file MucID.cxx.

18 {
19 // Check values
20 if ( barrel_ec >= BARREL_EC_NUM ) return false;
21 if ( barrel_ec == 0 || barrel_ec == BARREL_EC_NUM - 1 ) {
22 if ( segment >= SEGMENT_ENDCAP_NUM ) return false;
23 if ( layer >= LAYER_ENDCAP_NUM ) return false;
24 if ( channel >= CHANNEL_ENDCAP_NUM_MAX ) return false;
25 }
26 else {
27 if ( segment >= SEGMENT_BARREL_NUM ) return false;
28 if ( layer >= LAYER_BARREL_NUM ) return false;
29 if ( channel >= CHANNEL_BARREL_LAYER_NUM[layer] ) return false;
30 }
31 return true;
32}

Referenced by channel_id().


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