BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesDetectorID.cxx
Go to the documentation of this file.
1#include "Identifier/BesDetectorID.h"
2#include <assert.h>
3#include <iostream>
4#include <stdio.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
15
16bool BesDetectorID::is_mdc( const Identifier& id ) const {
17 Identifier::value_type value = id.get_value();
18 return ( ( value & MDC_MASK ) >> MDC_INDEX ) == MDC_ID ? true : false;
19}
20
21bool BesDetectorID::is_tof( const Identifier& id ) const {
22 Identifier::value_type value = id.get_value();
23 return ( ( value & TOF_MASK ) >> TOF_INDEX ) == TOF_ID ? true : false;
24}
25
26bool BesDetectorID::is_emc( const Identifier& id ) const {
27 Identifier::value_type value = id.get_value();
28 return ( ( value & EMC_MASK ) >> EMC_INDEX ) == EMC_ID ? true : false;
29}
30
31bool BesDetectorID::is_muc( const Identifier& id ) const {
32 Identifier::value_type value = id.get_value();
33 return ( ( value & MUC_MASK ) >> MUC_INDEX ) == MUC_ID ? true : false;
34}
35
36bool BesDetectorID::is_hlt( const Identifier& id ) const {
37 Identifier::value_type value = id.get_value();
38 return ( ( value & HLT_MASK ) >> HLT_INDEX ) == HLT_ID ? true : false;
39}
40
41bool BesDetectorID::is_mrpc( const Identifier& id ) const {
42 Identifier::value_type value = id.get_value();
43 return ( ( value & MRPC_MASK ) >> MRPC_INDEX ) == MRPC_ID ? true : false;
44}
45
47 Identifier id = Identifier( m_MdcId << MDC_INDEX );
48 return id;
49}
50
52 Identifier id = Identifier( m_TofId << TOF_INDEX );
53 return id;
54}
55
57 Identifier id = Identifier( m_EmcId << EMC_INDEX );
58 return id;
59}
60
62 Identifier id = Identifier( m_MucId << MUC_INDEX );
63 return id;
64}
65
67 Identifier id = Identifier( m_HltId << HLT_INDEX );
68 return id;
69}
70
72 Identifier id = Identifier( m_MrpcId << MRPC_INDEX );
73 return id;
74}
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