BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/EmcRec/test/main.cxx
Go to the documentation of this file.
1
2#include "EmcRec/EmcRecNeighbor.h"
3
4int main() {
5 EmcRecID id;
6 unsigned int module, theta, phi;
7 module = EmcID::getENDCAP_WEST();
8 theta = 2;
9 phi = 24;
10
11 id = EmcID::crystal_id( module, theta, phi );
12 cout << id << "\t" << EmcID::barrel_ec( id ) << "\t" << EmcID::theta_module( id ) << "\t"
13 << EmcID::phi_module( id ) << endl;
14 cout << endl;
15 // cout<<"aaaaaaaaaaaaaa"<<endl;
16
17 EmcRecIDVector neighbor = EmcRecNeighbor::GetNeighbors( id );
18 // cout<<"bbbbbbbbbbbbbb"<<endl;
19
20 EmcRecIDVector nextNeighbor = EmcRecNeighbor::GetNextNeighbors( id );
21 // cout<<"cccccccccccccc"<<endl;
22
23 EmcRecIDVector::iterator iN;
24 for ( iN = neighbor.begin(); iN != neighbor.end(); ++iN )
25 {
26 cout << *iN << "\t" << EmcID::barrel_ec( *iN ) << "\t" << EmcID::theta_module( *iN )
27 << "\t" << EmcID::phi_module( *iN ) << endl;
28 }
29 cout << endl;
30
31 for ( iN = nextNeighbor.begin(); iN != nextNeighbor.end(); ++iN )
32 {
33 cout << *iN << "\t" << EmcID::barrel_ec( *iN ) << "\t" << EmcID::theta_module( *iN )
34 << "\t" << EmcID::phi_module( *iN ) << endl;
35 // cout<<*iN<<endl;
36 }
37 cout << endl;
38}
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 barrel_ec(const Identifier &id)
Values of different levels (failure returns 0).
Definition EmcID.cxx:36
static unsigned int theta_module(const Identifier &id)
Definition EmcID.cxx:41
static unsigned int phi_module(const Identifier &id)
Definition EmcID.cxx:46
RecEmcIDVector GetNeighbors(const Identifier &id)
RecEmcIDVector GetNextNeighbors(const Identifier &id)