BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
TofID Class Reference
module const

#include <TofID.h>

+ Inheritance diagram for TofID:

Public Types

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

Public Member Functions

 TofID ()
 constructor
 
 ~TofID ()
 destructor
 
int phi_module_max (const Identifier &id)
 Max/Min values for each field (error returns -999)
 
int layer_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 cell_id (int barrel_ec, int layer, int phi_module, int end)
 For a single crystal.
 
static Identifier cell_id (int value)
 
static value_type getIntID (int barrel_ec, int layer, int phi_module, int end)
 
static Identifier cell_id (int barrel_ec, int endcap, int module, int strip, int end)
 For a single MRPC.
 
static value_type getIntID (int barrel_ec, int endcap, int module, int strip, int end)
 
static value_type getLAYER_BARREL_MAX ()
 
static value_type getLAYER_ENDCAP_MAX ()
 
static value_type getPHI_BARREL_MAX ()
 
static value_type getPHI_ENDCAP_MAX ()
 
static value_type getBARREL_EC_MAX ()
 
static value_type getBARREL_EC_MIN ()
 
static bool values_ok (const unsigned int barrel_ec, const unsigned int layer, const unsigned int phi_module, const unsigned int end)
 
static value_type getBARREL_EC_MRPC ()
 
static value_type getENDCAP_MRPC_MAX ()
 
static value_type getMODULE_MRPC_MAX ()
 
static value_type getSTRIP_MRPC_MAX ()
 
static bool values_ok (const unsigned int barrel_ec, const unsigned int endcap, const unsigned int module, const unsigned int strip, const unsigned int end)
 
static bool is_barrel (const Identifier &id)
 Test for barrel.
 
static bool is_barrel (const unsigned int barrel_ec)
 
static int barrel_ec (const Identifier &id)
 Values of different levels (failure returns 0)
 
static int layer (const Identifier &id)
 
static int phi_module (const Identifier &id)
 
static int end (const Identifier &id)
 
static bool is_scin (const Identifier &id)
 
static bool is_scin (const unsigned int barrel_ec)
 
static bool is_mrpc (const Identifier &id)
 
static bool is_mrpc (const unsigned int barrel_ec)
 
static int endcap (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 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 TofID.h.

Member Typedef Documentation

◆ size_type

Definition at line 11 of file TofID.h.

◆ value_type

Definition at line 12 of file TofID.h.

Constructor & Destructor Documentation

◆ TofID()

TofID::TofID ( void )

constructor

Definition at line 6 of file TofID.cxx.

6 {
7}

◆ ~TofID()

TofID::~TofID ( void )

destructor

Definition at line 9 of file TofID.cxx.

9 {
10}

Member Function Documentation

◆ barrel_ec()

◆ cell_id() [1/3]

Identifier TofID::cell_id ( int barrel_ec,
int endcap,
int module,
int strip,
int end )
static

For a single MRPC.

Definition at line 163 of file TofID.cxx.

168 {
169 assert ( values_ok(barrel_ec, endcap, module, strip, end) );
170 unsigned int value = (BesDetectorID::TOF_ID << TOF_INDEX) |
171 (barrel_ec << BARREL_EC_INDEX)|
172 (endcap << ENDCAP_INDEX) | (module << MODULE_INDEX) |
173 (strip << STRIP_INDEX) | (end << END_INDEX);
174 return Identifier(value);
175}
static const unsigned int TOF_ID
static const unsigned int TOF_INDEX
static int endcap(const Identifier &id)
Definition TofID.cxx:124
static int strip(const Identifier &id)
Definition TofID.cxx:136
static bool values_ok(const unsigned int barrel_ec, const unsigned int layer, const unsigned int phi_module, const unsigned int end)
Definition TofID.cxx:13
static int end(const Identifier &id)
Definition TofID.cxx:79
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition TofID.cxx:61

◆ cell_id() [2/3]

Identifier TofID::cell_id ( int barrel_ec,
int layer,
int phi_module,
int end )
static

For a single crystal.

Definition at line 143 of file TofID.cxx.

147 {
148 assert ( values_ok(barrel_ec, layer, phi_module, end) );
149 unsigned int value = (BesDetectorID::TOF_ID << TOF_INDEX) |
150 (barrel_ec << BARREL_EC_INDEX)|
151 (layer << LAYER_INDEX) | (phi_module << PHI_INDEX) |
152 (end << END_INDEX);
153 return Identifier(value);
154}
static int phi_module(const Identifier &id)
Definition TofID.cxx:73
static int layer(const Identifier &id)
Definition TofID.cxx:66

Referenced by PmtData::adc(), RawDataTofMcHitCnv::createObj(), TofCheckDigi::FillCol(), TofShower::getNeighbors(), BesRawDataWriter::SaveTofDigits(), BesMcTruthWriter::SaveTofTruth(), TofTrack::setTofData(), TofRawDataProvider::tofDataMapEmc(), TofRawDataProvider::tofDataMapFull(), and TofRawDataProvider::tofDataMapTof().

◆ cell_id() [3/3]

Identifier TofID::cell_id ( int value)
static

Definition at line 157 of file TofID.cxx.

157 {
158 return Identifier(value);
159}

◆ end()

◆ endcap()

int TofID::endcap ( const Identifier & id)
static

Definition at line 124 of file TofID.cxx.

124 {
125 if( ( TofID::is_scin( id ) ) ) { return -999; }
126 return ((id.get_value() & TofID::ENDCAP_MASK) >> TofID::ENDCAP_INDEX);
127}
static bool is_scin(const Identifier &id)
Definition TofID.cxx:102

Referenced by cell_id(), TofShower::energyCalib(), EsTimeAlg::execute(), TofCheckDigi::FillCol(), TofShower::findShower(), getIntID(), TofShower::getNeighbors(), TofTrack::match(), TofROOTGeo::SetHits(), TofData::setIdentify(), TofRawDataProvider::tofDataMapFull(), and values_ok().

◆ getBARREL_EC_MAX()

unsigned int TofID::getBARREL_EC_MAX ( )
static

Definition at line 226 of file TofID.cxx.

227{
228 return BARREL_EC_MAX;
229}

Referenced by TofBuilder::initialize().

◆ getBARREL_EC_MIN()

unsigned int TofID::getBARREL_EC_MIN ( )
static

Definition at line 231 of file TofID.cxx.

232{
233 return BARREL_EC_MIN;
234}

Referenced by TofBuilder::initialize().

◆ getBARREL_EC_MRPC()

unsigned int TofID::getBARREL_EC_MRPC ( )
static

Definition at line 236 of file TofID.cxx.

237{
238 return BARREL_EC_MRPC;
239}

◆ getENDCAP_MRPC_MAX()

unsigned int TofID::getENDCAP_MRPC_MAX ( )
static

Definition at line 241 of file TofID.cxx.

242{
243 return ENDCAP_MRPC_MAX;
244}

◆ getIntID() [1/2]

unsigned int TofID::getIntID ( int barrel_ec,
int endcap,
int module,
int strip,
int end )
static

Definition at line 193 of file TofID.cxx.

198 {
199 unsigned int value = (BesDetectorID::TOF_ID << TOF_INDEX) |
200 (barrel_ec << BARREL_EC_INDEX)|
201 (endcap << ENDCAP_INDEX) | (module << MODULE_INDEX) |
202 (strip << STRIP_INDEX) | (end << END_INDEX);
203 return value;
204}

◆ getIntID() [2/2]

unsigned int TofID::getIntID ( int barrel_ec,
int layer,
int phi_module,
int end )
static

Definition at line 178 of file TofID.cxx.

183{
184 unsigned int value = (BesDetectorID::TOF_ID << TOF_INDEX) |
185 (barrel_ec << BARREL_EC_INDEX)|
186 (layer << LAYER_INDEX) | (phi_module << PHI_INDEX) |
187 (end << END_INDEX);
188 return value;
189}

Referenced by TofBuilder::initialize(), TofTrack::setTofData(), and TofRawDataProvider::tofDataMapFull().

◆ getLAYER_BARREL_MAX()

unsigned int TofID::getLAYER_BARREL_MAX ( )
static

Definition at line 207 of file TofID.cxx.

208{
209 return LAYER_BARREL_MAX;
210}

Referenced by TofBuilder::initialize().

◆ getLAYER_ENDCAP_MAX()

unsigned int TofID::getLAYER_ENDCAP_MAX ( )
static

Definition at line 212 of file TofID.cxx.

213{
214 return LAYER_ENDCAP_MAX;
215}

Referenced by TofBuilder::initialize().

◆ getMODULE_MRPC_MAX()

unsigned int TofID::getMODULE_MRPC_MAX ( )
static

Definition at line 246 of file TofID.cxx.

247{
248 return MODULE_MRPC_MAX;
249}

◆ getPHI_BARREL_MAX()

unsigned int TofID::getPHI_BARREL_MAX ( )
static

Definition at line 217 of file TofID.cxx.

218{
219 return PHI_BARREL_MAX;
220}

Referenced by RawDataTofMcHitCnv::createObj(), TofBuilder::initialize(), BesRawDataWriter::SaveTofDigits(), and BesMcTruthWriter::SaveTofTruth().

◆ getPHI_ENDCAP_MAX()

unsigned int TofID::getPHI_ENDCAP_MAX ( )
static

Definition at line 222 of file TofID.cxx.

223{
224 return PHI_ENDCAP_MAX;
225}

◆ getSTRIP_MRPC_MAX()

unsigned int TofID::getSTRIP_MRPC_MAX ( )
static

Definition at line 251 of file TofID.cxx.

252{
253 return STRIP_MRPC_MAX;
254}

◆ is_barrel() [1/2]

bool TofID::is_barrel ( const Identifier & id)
static

Test for barrel.

Definition at line 49 of file TofID.cxx.

49 {
50 unsigned int pos = (id.get_value() & TofID::BARREL_EC_MASK) >> TofID::BARREL_EC_INDEX;
51 return (pos == BARREL_EC_MAX || pos == BARREL_EC_MIN || pos == BARREL_EC_MRPC) ? false : true;
52}

Referenced by EmcRecTofDigitCalib::Convert(), TofCheckDigi::FillCol(), layer_max(), phi_module_max(), BesRawDataWriter::SaveTofDigits(), BesMcTruthWriter::SaveTofTruth(), and TofRawDataProvider::tofDataMapFull().

◆ is_barrel() [2/2]

bool TofID::is_barrel ( const unsigned int barrel_ec)
static

Definition at line 55 of file TofID.cxx.

55 {
56 return (barrel_ec == BARREL_EC_MAX || barrel_ec == BARREL_EC_MIN || barrel_ec == BARREL_EC_MRPC) ? false : true;
57}

◆ is_mrpc() [1/2]

◆ is_mrpc() [2/2]

bool TofID::is_mrpc ( const unsigned int barrel_ec)
static

Definition at line 119 of file TofID.cxx.

119 {
120 return (barrel_ec == BARREL_EC_MRPC) ? true : false;
121}

◆ is_scin() [1/2]

bool TofID::is_scin ( const Identifier & id)
static

Definition at line 102 of file TofID.cxx.

102 {
103 unsigned int pos = (id.get_value() & TofID::BARREL_EC_MASK) >> TofID::BARREL_EC_INDEX;
104 return (pos == BARREL_EC_MRPC) ? false : true;
105}

Referenced by endcap(), TofShower::energyCalib(), TofCheckDigi::FillCol(), TofCheckDigi::FillCol(), TofShower::getNeighbors(), BesRawDataWriter::SaveTofDigits(), BesMcTruthWriter::SaveTofTruth(), Adc::setValue(), strip(), TofRawDataProvider::tofDataMapFull(), and TofRawDataProvider::tofDataMapOnlineMode().

◆ is_scin() [2/2]

bool TofID::is_scin ( const unsigned int barrel_ec)
static

Definition at line 108 of file TofID.cxx.

108 {
109 return (barrel_ec < BARREL_EC_MRPC) ? true : false;
110}

◆ layer()

◆ layer_max()

int TofID::layer_max ( const Identifier & id)

Definition at line 84 of file TofID.cxx.

84 {
85 if (is_barrel(id)) {
86 return LAYER_BARREL_MAX;
87 } else {
88 return LAYER_ENDCAP_MAX;
89 }
90}
static bool is_barrel(const Identifier &id)
Test for barrel.
Definition TofID.cxx:49

◆ phi_module()

◆ phi_module_max()

int TofID::phi_module_max ( const Identifier & id)

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

Definition at line 93 of file TofID.cxx.

93 {
94 if (is_barrel(id)) {
95 return PHI_BARREL_MAX;
96 } else {
97 return PHI_ENDCAP_MAX;
98 }
99}

◆ strip()

int TofID::strip ( const Identifier & id)
static

Definition at line 136 of file TofID.cxx.

136 {
137 if( ( TofID::is_scin( id ) ) ) { return -999; }
138 return ((id.get_value() & TofID::STRIP_MASK) >> TofID::STRIP_INDEX);
139}

Referenced by cell_id(), TofShower::energyCalib(), TofCheckDigi::FillCol(), TofShower::findShower(), getIntID(), TofShower::getNeighbors(), TofTrack::match(), TofROOTGeo::SetHits(), TofData::setIdentify(), TofRawDataProvider::tofDataMapFull(), and values_ok().

◆ values_ok() [1/2]

bool TofID::values_ok ( const unsigned int barrel_ec,
const unsigned int endcap,
const unsigned int module,
const unsigned int strip,
const unsigned int end )
static

Definition at line 32 of file TofID.cxx.

37 {
38 if( barrel_ec != BARREL_EC_MRPC ) return false;
39 if( endcap > ENDCAP_MRPC_MAX ) return false;
40 if( module > MODULE_MRPC_MAX ) return false;
41 if( strip > STRIP_MRPC_MAX ) return false;
42 if( end > 1 ) return false;
43
44 return true;
45}

◆ values_ok() [2/2]

bool TofID::values_ok ( const unsigned int barrel_ec,
const unsigned int layer,
const unsigned int phi_module,
const unsigned int end )
static

Definition at line 13 of file TofID.cxx.

17 {
18 if ( barrel_ec > BARREL_EC_MAX ) return false;
19 if ( BARREL_EC_MIN == barrel_ec || BARREL_EC_MIN == barrel_ec) {
20 if ( layer > LAYER_ENDCAP_MAX ) return false;
21 }
22 else {
23 if ( layer > LAYER_BARREL_MAX ) return false;
24 }
25 if( end > 1 ) return false;
26
27 return true;
28}

Referenced by cell_id(), and cell_id().


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