BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
HltID Class Reference

#include <HltID.h>

+ Inheritance diagram for HltID:

Public Types

enum  Header {
  EVENTTYPE =0 , ALGORITHM , CRITERIA , VERSION ,
  ENERGY , NUMSUB , NUMCON
}
 
enum  SubID {
  HLT =0 , MDC , TOF , EMC ,
  MUC , CON
}
 
enum  MdcData {
  NMDC =0x100 , NTRK , PMAX1 , COST1 ,
  VZ1 , PHI1 , VR1 , TRKHIT1 ,
  TRKSHIT1 , PMAX2 , COST2 , VZ2 ,
  PHI2 , VR2 , TRKHIT2 , TRKSHIT2 ,
  ACOL
}
 
enum  TofData { NTOF =0x200 , DELTAT , DELTAPHI }
 
enum  EmcData {
  NEMC =0x300 , ETOT , EBAR , EEND ,
  EBAL , EEAST , EWEST , NSEC ,
  NSHW , EMAX1 , ECOST1 , EPHI1 ,
  EMAX2 , ECOST2 , EPHI2 , EACOP ,
  EACOL , EMAX12 , EMAX3 , ECOST3 ,
  EPHI3
}
 
enum  MucData { NMUC =0x400 }
 
enum  ConData { NCON =0x500 }
 
typedef Identifier::size_type size_type
 
typedef Identifier::value_type value_type
 

Public Member Functions

 HltID (void)
 constructor
 
 ~HltID (void)
 destructor
 
- 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 convert (const unsigned int id, const int nmdc=0, const int ntof=0, const int nemc=0, const int nmuc=0)
 convert global id to sub-id(Identifier)
 
static Identifier data_type_id (const unsigned int detector, const unsigned int id_in_sub=0)
 For a single data.
 
static unsigned int getIntID (const unsigned int detector, const unsigned int id_in_sub=0)
 
static bool values_ok (const unsigned int detector, const unsigned int id_in_sub=0)
 
static bool is_ef_result (const Identifier &id)
 Test for data type.
 
static bool is_eventtype (const Identifier &id)
 
static bool is_algorithm (const Identifier &id)
 
static bool is_criteria (const Identifier &id)
 
static bool is_version (const Identifier &id)
 
static bool is_energy (const Identifier &id)
 
static bool is_number (const Identifier &id)
 
static bool is_ncon (const Identifier &id)
 
static bool is_mdc_inf (const Identifier &id)
 
static bool is_tof_inf (const Identifier &id)
 
static bool is_emc_inf (const Identifier &id)
 
static bool is_muc_inf (const Identifier &id)
 
static bool is_con_inf (const Identifier &id)
 
static bool is_hlt_inf (const Identifier &id)
 
static unsigned int detector (const Identifier &id)
 Values of different levels (failure returns 0)
 
static unsigned int id_sub (const Identifier &id)
 
static unsigned int id_sub_max (const Identifier &id)
 
static unsigned int getID_MDC_MAX ()
 
static unsigned int getID_TOF_MAX ()
 
static unsigned int getID_EMC_MAX ()
 
static unsigned int getID_MUC_MAX ()
 
static unsigned int getID_HLT_MAX ()
 
static unsigned int getDETECTOR_MIN ()
 
static unsigned int getDETECTOR_MAX ()
 

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 HltID.h.

Member Typedef Documentation

◆ size_type

Definition at line 11 of file HltID.h.

◆ value_type

Definition at line 12 of file HltID.h.

Member Enumeration Documentation

◆ ConData

Enumerator
NCON 

Definition at line 29 of file HltID.h.

29{ NCON =0x500 };
@ NCON
Definition: HltID.h:29

◆ EmcData

Enumerator
NEMC 
ETOT 
EBAR 
EEND 
EBAL 
EEAST 
EWEST 
NSEC 
NSHW 
EMAX1 
ECOST1 
EPHI1 
EMAX2 
ECOST2 
EPHI2 
EACOP 
EACOL 
EMAX12 
EMAX3 
ECOST3 
EPHI3 

Definition at line 25 of file HltID.h.

25 { NEMC =0x300, ETOT, EBAR, EEND, EBAL, EEAST, EWEST, NSEC, NSHW,
27 EMAX3, ECOST3, EPHI3 };
@ ECOST2
Definition: HltID.h:26
@ EMAX3
Definition: HltID.h:27
@ EMAX2
Definition: HltID.h:26
@ EEND
Definition: HltID.h:25
@ ECOST1
Definition: HltID.h:26
@ EWEST
Definition: HltID.h:25
@ ECOST3
Definition: HltID.h:27
@ NSEC
Definition: HltID.h:25
@ NSHW
Definition: HltID.h:25
@ EPHI3
Definition: HltID.h:27
@ EACOL
Definition: HltID.h:26
@ NEMC
Definition: HltID.h:25
@ EEAST
Definition: HltID.h:25
@ EBAL
Definition: HltID.h:25
@ EPHI2
Definition: HltID.h:26
@ EMAX12
Definition: HltID.h:26
@ EBAR
Definition: HltID.h:25
@ ETOT
Definition: HltID.h:25
@ EPHI1
Definition: HltID.h:26
@ EMAX1
Definition: HltID.h:26
@ EACOP
Definition: HltID.h:26

◆ Header

Enumerator
EVENTTYPE 
ALGORITHM 
CRITERIA 
VERSION 
ENERGY 
NUMSUB 
NUMCON 

Definition at line 20 of file HltID.h.

@ ALGORITHM
Definition: HltID.h:20
@ NUMCON
Definition: HltID.h:20
@ CRITERIA
Definition: HltID.h:20
@ VERSION
Definition: HltID.h:20
@ NUMSUB
Definition: HltID.h:20
@ EVENTTYPE
Definition: HltID.h:20
@ ENERGY
Definition: HltID.h:20

◆ MdcData

Enumerator
NMDC 
NTRK 
PMAX1 
COST1 
VZ1 
PHI1 
VR1 
TRKHIT1 
TRKSHIT1 
PMAX2 
COST2 
VZ2 
PHI2 
VR2 
TRKHIT2 
TRKSHIT2 
ACOL 

Definition at line 22 of file HltID.h.

22 { NMDC =0x100, NTRK, PMAX1, COST1, VZ1, PHI1, VR1, TRKHIT1, TRKSHIT1,
@ TRKHIT1
Definition: HltID.h:22
@ PMAX2
Definition: HltID.h:23
@ PMAX1
Definition: HltID.h:22
@ COST2
Definition: HltID.h:23
@ VR1
Definition: HltID.h:22
@ TRKSHIT1
Definition: HltID.h:22
@ VZ1
Definition: HltID.h:22
@ PHI1
Definition: HltID.h:22
@ ACOL
Definition: HltID.h:23
@ COST1
Definition: HltID.h:22
@ NMDC
Definition: HltID.h:22
@ PHI2
Definition: HltID.h:23
@ NTRK
Definition: HltID.h:22
@ VR2
Definition: HltID.h:23
@ TRKHIT2
Definition: HltID.h:23
@ TRKSHIT2
Definition: HltID.h:23
@ VZ2
Definition: HltID.h:23

◆ MucData

Enumerator
NMUC 

Definition at line 28 of file HltID.h.

28{ NMUC =0x400 };
@ NMUC
Definition: HltID.h:28

◆ SubID

Enumerator
HLT 
MDC 
TOF 
EMC 
MUC 
CON 

Definition at line 21 of file HltID.h.

21{HLT =0,MDC,TOF,EMC,MUC,CON};
@ EMC
Definition: HltID.h:21
@ MUC
Definition: HltID.h:21
@ TOF
Definition: HltID.h:21
@ HLT
Definition: HltID.h:21
@ MDC
Definition: HltID.h:21
@ CON
Definition: HltID.h:21

◆ TofData

Enumerator
NTOF 
DELTAT 
DELTAPHI 

Definition at line 24 of file HltID.h.

24{ NTOF =0x200, DELTAT, DELTAPHI };
@ DELTAPHI
Definition: HltID.h:24
@ DELTAT
Definition: HltID.h:24
@ NTOF
Definition: HltID.h:24

Constructor & Destructor Documentation

◆ HltID()

HltID::HltID ( void  )

constructor

Definition at line 4 of file HltID.cxx.

4 {
5}

◆ ~HltID()

HltID::~HltID ( void  )

destructor

Definition at line 7 of file HltID.cxx.

7 {
8}

Member Function Documentation

◆ convert()

Identifier HltID::convert ( const unsigned int  id,
const int  nmdc = 0,
const int  ntof = 0,
const int  nemc = 0,
const int  nmuc = 0 
)
static

convert global id to sub-id(Identifier)

Definition at line 11 of file HltID.cxx.

11 {
12 uint32_t subid=id&(HltID::DETECTOR_MASK|HltID::ID_SUB_MASK);
13
14 if(subid<=getID_HLT_MAX()) return data_type_id(HLT,subid);
15
16 subid = subid - getID_HLT_MAX();
17 if(subid<=nmdc) return data_type_id(MDC,subid-1);
18
19 subid = subid - nmdc;
20 if(subid<=ntof) return data_type_id(TOF,subid-1);
21
22 subid = subid - ntof;
23 if(subid<=nemc) return data_type_id(EMC,subid-1);
24
25 subid = subid - nemc;
26 if(subid<=nmuc) return data_type_id(MUC,subid-1);
27
28 subid = subid - nmuc;
29 return data_type_id(CON,subid-1);
30}
static unsigned int getID_HLT_MAX()
Definition: HltID.h:67
static Identifier data_type_id(const unsigned int detector, const unsigned int id_in_sub=0)
For a single data.
Definition: HltID.cxx:171

Referenced by RawDataHltRawCnv::createObj(), and EFtoTDS::execute().

◆ data_type_id()

Identifier HltID::data_type_id ( const unsigned int  detector,
const unsigned int  id_in_sub = 0 
)
static

For a single data.

Definition at line 171 of file HltID.cxx.

171 {
172 assert ( values_ok(detector, id_in_sub) );
173 //if(!values_ok(detector, id_in_sub)) return Identifier(0);
174
175 unsigned int value = (HLT_ID << HLT_INDEX) | (detector << DETECTOR_INDEX)|
176 (id_in_sub<< ID_SUB_INDEX);
177 return Identifier(value);
178}
static const unsigned int HLT_INDEX
Definition: BesDetectorID.h:83
static const unsigned int HLT_ID
Definition: BesDetectorID.h:82
static unsigned int detector(const Identifier &id)
Values of different levels (failure returns 0)
Definition: HltID.cxx:139
static bool values_ok(const unsigned int detector, const unsigned int id_in_sub=0)
Definition: HltID.cxx:33

Referenced by convert(), HltInf::getDataVec(), and main().

◆ detector()

unsigned int HltID::detector ( const Identifier id)
static

Values of different levels (failure returns 0)

Definition at line 139 of file HltID.cxx.

139 {
140 return ((id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX);
141}

Referenced by data_type_id(), getIntID(), main(), and values_ok().

◆ getDETECTOR_MAX()

static unsigned int HltID::getDETECTOR_MAX ( )
inlinestatic

Definition at line 70 of file HltID.h.

70{return DETECTOR_MAX;};

Referenced by main().

◆ getDETECTOR_MIN()

static unsigned int HltID::getDETECTOR_MIN ( )
inlinestatic

Definition at line 69 of file HltID.h.

69{return DETECTOR_MIN;};

◆ getID_EMC_MAX()

static unsigned int HltID::getID_EMC_MAX ( )
inlinestatic

Definition at line 65 of file HltID.h.

65{return ID_EMC_MAX;};

Referenced by EFTest::initialize(), DstHltInfCnv::TObjectToDataObject(), and HltInfCnv::TObjectToDataObject().

◆ getID_HLT_MAX()

static unsigned int HltID::getID_HLT_MAX ( )
inlinestatic

Definition at line 67 of file HltID.h.

67{return ID_HLT_MAX;};

Referenced by convert().

◆ getID_MDC_MAX()

static unsigned int HltID::getID_MDC_MAX ( )
inlinestatic

Definition at line 63 of file HltID.h.

63{return ID_MDC_MAX;};

Referenced by EFTest::initialize(), main(), DstHltInfCnv::TObjectToDataObject(), and HltInfCnv::TObjectToDataObject().

◆ getID_MUC_MAX()

static unsigned int HltID::getID_MUC_MAX ( )
inlinestatic

Definition at line 66 of file HltID.h.

66{return ID_MUC_MAX;};

Referenced by EFTest::initialize(), DstHltInfCnv::TObjectToDataObject(), and HltInfCnv::TObjectToDataObject().

◆ getID_TOF_MAX()

static unsigned int HltID::getID_TOF_MAX ( )
inlinestatic

Definition at line 64 of file HltID.h.

64{return ID_TOF_MAX;};

Referenced by EFTest::initialize(), DstHltInfCnv::TObjectToDataObject(), and HltInfCnv::TObjectToDataObject().

◆ getIntID()

unsigned int HltID::getIntID ( const unsigned int  detector,
const unsigned int  id_in_sub = 0 
)
static

Definition at line 180 of file HltID.cxx.

180 {
181 assert ( values_ok(detector, id_in_sub) );
182 //if(!values_ok(detector, id_in_sub)) return 0;
183
184 unsigned int value = (HLT_ID << HLT_INDEX) | (detector << DETECTOR_INDEX)|
185 (id_in_sub<< ID_SUB_INDEX);
186 return value;
187}

◆ id_sub()

unsigned int HltID::id_sub ( const Identifier id)
static

Definition at line 144 of file HltID.cxx.

144 {
145 return (id.get_value() & HltID::ID_SUB_MASK) >> HltID::ID_SUB_INDEX;
146}

Referenced by HltInf::getData(), main(), and HltInf::setData().

◆ id_sub_max()

unsigned int HltID::id_sub_max ( const Identifier id)
static

Definition at line 149 of file HltID.cxx.

149 {
150 if (is_ef_result(id)) {
151 return ID_HLT_MAX;
152 }
153 else if (is_mdc_inf(id)) {
154 return ID_MDC_MAX;
155 }
156 else if (is_tof_inf(id)) {
157 return ID_TOF_MAX;
158 }
159 else if (is_emc_inf(id)) {
160 return ID_EMC_MAX;
161 }
162 else if (is_muc_inf(id)) {
163 return ID_MUC_MAX;
164 }
165 else {
166 return 0;
167 }
168}
static bool is_tof_inf(const Identifier &id)
Definition: HltID.cxx:118
static bool is_ef_result(const Identifier &id)
Test for data type.
Definition: HltID.cxx:66
static bool is_muc_inf(const Identifier &id)
Definition: HltID.cxx:128
static bool is_emc_inf(const Identifier &id)
Definition: HltID.cxx:123
static bool is_mdc_inf(const Identifier &id)
Definition: HltID.cxx:113

Referenced by main().

◆ is_algorithm()

bool HltID::is_algorithm ( const Identifier id)
static

Definition at line 77 of file HltID.cxx.

77 {
78 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
79 unsigned int no = (id.get_value() & HltID::ID_SUB_MASK) >> HltID::ID_SUB_INDEX;
80 return ((pos == HLT)&&(no==ALGORITHM)) ? true : false ;
81}

Referenced by HltEventMaker::execute(), EFtoTDS::execute(), main(), and HltBuilder::pack().

◆ is_con_inf()

bool HltID::is_con_inf ( const Identifier id)
static

Definition at line 133 of file HltID.cxx.

133 {
134 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
135 return (pos == CON) ? true : false ;
136}

Referenced by HltEventMaker::execute(), HltInf::getData(), HltInf::getDataVec(), and HltInf::setData().

◆ is_criteria()

bool HltID::is_criteria ( const Identifier id)
static

Definition at line 83 of file HltID.cxx.

83 {
84 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
85 unsigned int no = (id.get_value() & HltID::ID_SUB_MASK) >> HltID::ID_SUB_INDEX;
86 return ((pos == HLT)&&(no==CRITERIA)) ? true : false ;
87}

Referenced by HltEventMaker::execute(), EFtoTDS::execute(), and HltBuilder::pack().

◆ is_ef_result()

bool HltID::is_ef_result ( const Identifier id)
static

Test for data type.

Definition at line 66 of file HltID.cxx.

66 {
67 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
68 return (pos == HLT) ? true : false ;
69}

Referenced by id_sub_max(), is_hlt_inf(), and main().

◆ is_emc_inf()

bool HltID::is_emc_inf ( const Identifier id)
static

Definition at line 123 of file HltID.cxx.

123 {
124 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
125 return (pos == EMC) ? true : false ;
126}

Referenced by HltEventMaker::execute(), HltInf::getData(), HltInf::getDataVec(), id_sub_max(), and HltInf::setData().

◆ is_energy()

bool HltID::is_energy ( const Identifier id)
static

Definition at line 95 of file HltID.cxx.

95 {
96 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
97 unsigned int no = (id.get_value() & HltID::ID_SUB_MASK) >> HltID::ID_SUB_INDEX;
98 return ((pos == HLT)&&(no==ENERGY)) ? true : false ;
99}

Referenced by HltEventMaker::execute(), EFtoTDS::execute(), main(), and HltBuilder::pack().

◆ is_eventtype()

bool HltID::is_eventtype ( const Identifier id)
static

Definition at line 71 of file HltID.cxx.

71 {
72 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
73 unsigned int no = (id.get_value() & HltID::ID_SUB_MASK) >> HltID::ID_SUB_INDEX;
74 return ((pos == HLT)&&(no==EVENTTYPE)) ? true : false ;
75}

Referenced by HltEventMaker::execute(), EFtoTDS::execute(), main(), and HltBuilder::pack().

◆ is_hlt_inf()

static bool HltID::is_hlt_inf ( const Identifier id)
inlinestatic

Definition at line 55 of file HltID.h.

55{ return is_ef_result(id);};

◆ is_mdc_inf()

bool HltID::is_mdc_inf ( const Identifier id)
static

Definition at line 113 of file HltID.cxx.

113 {
114 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
115 return (pos == MDC) ? true : false ;
116}

Referenced by HltEventMaker::execute(), HltInf::getData(), HltInf::getDataVec(), id_sub_max(), main(), and HltInf::setData().

◆ is_muc_inf()

bool HltID::is_muc_inf ( const Identifier id)
static

Definition at line 128 of file HltID.cxx.

128 {
129 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
130 return (pos == MUC) ? true : false ;
131}

Referenced by HltEventMaker::execute(), HltInf::getData(), HltInf::getDataVec(), id_sub_max(), and HltInf::setData().

◆ is_ncon()

bool HltID::is_ncon ( const Identifier id)
static

Definition at line 107 of file HltID.cxx.

107 {
108 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
109 unsigned int no = (id.get_value() & HltID::ID_SUB_MASK) >> HltID::ID_SUB_INDEX;
110 return ((pos == CON)&&(no==NUMCON)) ? true : false ;
111}

Referenced by HltEventMaker::execute().

◆ is_number()

bool HltID::is_number ( const Identifier id)
static

Definition at line 101 of file HltID.cxx.

101 {
102 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
103 unsigned int no = (id.get_value() & HltID::ID_SUB_MASK) >> HltID::ID_SUB_INDEX;
104 return ((pos == HLT)&&(no==NUMSUB)) ? true : false ;
105}

Referenced by RawDataHltRawCnv::createObj(), and HltEventMaker::execute().

◆ is_tof_inf()

bool HltID::is_tof_inf ( const Identifier id)
static

Definition at line 118 of file HltID.cxx.

118 {
119 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
120 return (pos == TOF) ? true : false ;
121}

Referenced by HltEventMaker::execute(), HltInf::getData(), HltInf::getDataVec(), id_sub_max(), and HltInf::setData().

◆ is_version()

bool HltID::is_version ( const Identifier id)
static

Definition at line 89 of file HltID.cxx.

89 {
90 unsigned int pos = (id.get_value() & HltID::DETECTOR_MASK) >> HltID::DETECTOR_INDEX;
91 unsigned int no = (id.get_value() & HltID::ID_SUB_MASK) >> HltID::ID_SUB_INDEX;
92 return ((pos == HLT)&&(no==VERSION)) ? true : false ;
93}

Referenced by HltEventMaker::execute(), EFtoTDS::execute(), and HltBuilder::pack().

◆ values_ok()

bool HltID::values_ok ( const unsigned int  detector,
const unsigned int  id_in_sub = 0 
)
static

Definition at line 33 of file HltID.cxx.

33 {
34 // Check values
35 // unsigned int >= 0, this is definitely true.
36 // Omit the compare with MIN(0) to avoid warnings in compile.
37 switch(detector)
38 {
39 case HLT:
40 if ( id_in_sub > ID_HLT_MAX ) return false;
41 break;
42 case MDC:
43 if ( id_in_sub > ID_MDC_MAX ) return false;
44 break;
45 case TOF:
46 if ( id_in_sub > ID_TOF_MAX ) return false;
47 break;
48 case EMC:
49 if ( id_in_sub > ID_EMC_MAX ) return false;
50 break;
51 case MUC:
52 if ( id_in_sub > ID_MUC_MAX ) return false;
53 break;
54 case CON:
55 return true;
56 break;
57 default:
58 return false;
59 break;
60 }
61
62 return true;
63}

Referenced by data_type_id(), and getIntID().


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