BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DetectorDescription/Identifier/test/main.cxx
Go to the documentation of this file.
1#include <iostream>
2
3#include "Identifier/EmcID.h"
4#include "Identifier/HltID.h"
5#include "Identifier/Identifier.h"
6
7using namespace std;
8
9int main() {
10 Identifier id;
11 id = 0;
12
13 int x = 1, y = 2, z = 3;
14
15 cout << id;
16
17 cout.width( 8 );
18 cout.fill( '*' );
19 cout << "Hello" << endl;
20
21 cout << "==============EmcID Test=================" << endl;
22
23 id = EmcID::crystal_id( x, y, z );
24
25 cout << "Identifier id=" << id << endl;
26
27 cout << "barrel_ec =" << EmcID::barrel_ec( id ) << endl;
28 cout << "theta_module =" << EmcID::theta_module( id ) << endl;
29 cout << "phi_module =" << EmcID::phi_module( id ) << endl;
30 cout << "is barrel? " << EmcID::is_barrel( id ) << endl;
31
32 for ( int theta = -5; theta <= 10; theta++ )
33 { cout << "PHI_MAX(theta=" << theta << "):" << EmcID::getPHI_ENDCAP_MAX( theta ) << endl; }
34
35 cout << "ENDCAP_EAST =" << EmcID::getENDCAP_EAST() << endl;
36 cout << "ENDCAP_WEST =" << EmcID::getENDCAP_WEST() << endl;
37
38 cout << "===============HltID Test=================" << endl;
39
40 x = 0;
41 y = 2;
42 id = HltID::data_type_id( x, y );
43
44 cout << "Identifier id=" << id << endl;
45
46 cout << "detector =" << HltID::detector( id ) << endl;
47 cout << "id_in_sub =" << HltID::id_sub( id ) << endl;
48 cout << "is ef_result? " << HltID::is_ef_result( id ) << endl;
49 cout << "is eventtype? " << HltID::is_eventtype( id ) << endl;
50 cout << "is energy? " << HltID::is_energy( id ) << endl;
51 cout << "is algorithm? " << HltID::is_algorithm( id ) << endl;
52 cout << "is mdc inf? " << HltID::is_mdc_inf( id ) << endl;
53
54 cout << "EMC =" << HltID::EMC << endl;
55 cout << "DETECTOR_MAX =" << HltID::getDETECTOR_MAX() << endl;
56 cout << "this id's max=" << HltID::id_sub_max( id ) << endl;
57 cout << "ID_MDC_MAX =" << HltID::getID_MDC_MAX() << endl;
58}
static Identifier crystal_id(const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)
For a single crystal.
Definition EmcID.cxx:63
static unsigned int getENDCAP_WEST()
Definition EmcID.cxx:99
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0).
Definition EmcID.cxx:36
static bool is_barrel(const Identifier &id)
Test for barrel.
Definition EmcID.cxx:30
static unsigned int getENDCAP_EAST()
Definition EmcID.cxx:95
static unsigned int theta_module(const Identifier &id)
Definition EmcID.cxx:41
static unsigned int getPHI_ENDCAP_MAX(const unsigned int theta)
Definition EmcID.cxx:85
static unsigned int phi_module(const Identifier &id)
Definition EmcID.cxx:46
static bool is_ef_result(const Identifier &id)
Test for data type.
Definition HltID.cxx:62
static bool is_eventtype(const Identifier &id)
Definition HltID.cxx:67
static Identifier data_type_id(const unsigned int detector, const unsigned int id_in_sub=0)
For a single data.
Definition HltID.cxx:155
static unsigned int detector(const Identifier &id)
Values of different levels (failure returns 0).
Definition HltID.cxx:135
static bool is_algorithm(const Identifier &id)
Definition HltID.cxx:73
static unsigned int id_sub_max(const Identifier &id)
Definition HltID.cxx:145
static bool is_mdc_inf(const Identifier &id)
Definition HltID.cxx:109
static unsigned int id_sub(const Identifier &id)
Definition HltID.cxx:140
static bool is_energy(const Identifier &id)
Definition HltID.cxx:91