BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
BesDetectorID.cxx
Go to the documentation of this file.
2#include <iostream>
3#include <stdio.h>
4#include <assert.h>
5
7 m_MdcId(BesDetectorID::MDC_ID),
8 m_TofId(BesDetectorID::TOF_ID),
9 m_EmcId(BesDetectorID::EMC_ID),
10 m_MucId(BesDetectorID::MUC_ID),
11 m_HltId(BesDetectorID::HLT_ID),
12 m_MrpcId(BesDetectorID::MRPC_ID)
13{
14}
15
17{
18}
19
20bool BesDetectorID::is_mdc (const Identifier& id) const {
21 Identifier::value_type value = id.get_value();
22 return (value & MDC_MASK >> MDC_INDEX) == MDC_ID ? true : false;
23}
24
25bool BesDetectorID::is_tof (const Identifier& id) const {
26 Identifier::value_type value = id.get_value();
27 return (value & TOF_MASK >> TOF_INDEX) == TOF_ID ? true : false;
28}
29
30bool BesDetectorID::is_emc (const Identifier& id) const {
31 Identifier::value_type value = id.get_value();
32 return (value & EMC_MASK >> EMC_INDEX) == EMC_ID ? true : false;
33}
34
35bool BesDetectorID::is_muc (const Identifier& id) const {
36 Identifier::value_type value = id.get_value();
37 return (value & MUC_MASK >> MUC_INDEX) == MUC_ID ? true : false;
38}
39
40bool BesDetectorID::is_hlt (const Identifier& id) const {
41 Identifier::value_type value = id.get_value();
42 return (value & HLT_MASK >> HLT_INDEX) == HLT_ID ? true : false;
43}
44
45
46bool BesDetectorID::is_mrpc (const Identifier& id) const {
47 Identifier::value_type value = id.get_value();
48 return (value & MRPC_MASK >> MRPC_INDEX) == MRPC_ID ? true : false;
49}
50
51
52
54 Identifier id = Identifier( m_MdcId << MDC_INDEX );
55 return id;
56}
57
59 Identifier id = Identifier( m_TofId << TOF_INDEX );
60 return id;
61}
62
64 Identifier id = Identifier( m_EmcId << EMC_INDEX );
65 return id;
66}
67
69 Identifier id = Identifier( m_MucId << MUC_INDEX );
70 return id;
71}
72
74 Identifier id = Identifier( m_HltId << HLT_INDEX );
75 return id;
76}
77
79 Identifier id = Identifier( m_MrpcId << MRPC_INDEX );
80 return id;
81}
static const unsigned int EMC_INDEX
Definition: BesDetectorID.h:75
Identifier emc(void) const
bool is_mdc(const Identifier &id) const
bool is_hlt(const Identifier &id) const
static const unsigned int MUC_ID
Definition: BesDetectorID.h:78
static const unsigned int MRPC_ID
Definition: BesDetectorID.h:86
bool is_muc(const Identifier &id) const
static const unsigned int MRPC_INDEX
Definition: BesDetectorID.h:87
static const unsigned int EMC_MASK
Definition: BesDetectorID.h:76
Identifier mrpc(void) const
bool is_mrpc(const Identifier &id) const
bool is_emc(const Identifier &id) const
static const unsigned int TOF_ID
Definition: BesDetectorID.h:70
static const unsigned int EMC_ID
Definition: BesDetectorID.h:74
Identifier tof(void) const
Identifier muc(void) const
static const unsigned int HLT_INDEX
Definition: BesDetectorID.h:83
static const unsigned int HLT_ID
Definition: BesDetectorID.h:82
bool is_tof(const Identifier &id) const
static const unsigned int MUC_INDEX
Definition: BesDetectorID.h:79
Identifier hlt(void) const
Identifier mdc(void) const
static const unsigned int TOF_INDEX
Definition: BesDetectorID.h:71
static const unsigned int HLT_MASK
Definition: BesDetectorID.h:84
static const unsigned int MDC_MASK
Definition: BesDetectorID.h:68
static const unsigned int TOF_MASK
Definition: BesDetectorID.h:72
static const unsigned int MRPC_MASK
Definition: BesDetectorID.h:88
static const unsigned int MDC_INDEX
Definition: BesDetectorID.h:67
static const unsigned int MDC_ID
Definition: BesDetectorID.h:66
static const unsigned int MUC_MASK
Definition: BesDetectorID.h:80
unsigned int value_type
Definition: Identifier.h:27