BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
BesDetectorID.cxx
Go to the documentation of this file.
1#include "Identifier/BesDetectorID.h"
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}
Identifier emc(void) const
bool is_mdc(const Identifier &id) const
bool is_hlt(const Identifier &id) const
bool is_muc(const Identifier &id) const
Identifier mrpc(void) const
bool is_mrpc(const Identifier &id) const
bool is_emc(const Identifier &id) const
Identifier tof(void) const
Identifier muc(void) const
bool is_tof(const Identifier &id) const
Identifier hlt(void) const
Identifier mdc(void) const