BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Emc/EmcRecGeoSvc/test/main.cxx
Go to the documentation of this file.
1#include "EmcRecGeoSvc/EmcRecGeoSvc.h"
2#include "EmcRecGeoSvc/EmcRecROOTGeo.h"
3#include "Identifier/EmcID.h"
4#include "Identifier/Identifier.h"
5#include <fstream>
6
7using namespace std;
8
9int main() {
10 Identifier id;
12 // EmcRecEndCapGeo geo;
13 EmcRecROOTGeo aROOTGeo;
14 aROOTGeo.InitFromXML();
15
16 int nphi[6];
17 nphi[0] = 64;
18 nphi[1] = 64;
19 nphi[2] = 80;
20 nphi[3] = 80;
21 nphi[4] = 96;
22 nphi[5] = 96;
23
24 // int layer=0;
25 // ofstream out;
26 // out.open("endcap.txt");
27 /*for(int part=0;part<2;part++) {
28 for(int layer=0;layer<6;layer++) {
29 for(int i=0;i<nphi[layer];i++) {
30 id = EmcID::crystal_id(part*2,layer,i);
31 if(part==0&&(layer==1)&&(i==16||i==17||i==18)) {
32 cout<<part*2<<"\t"<<layer<<"\t"<<i<<endl;
33 cout<<geo.GetCrystal(id)
34 <<"\n-------------\n"<<aROOTGeo.GetCrystal(id)<<"\n"<<std::endl;
35 }
36 //cout<<id<<"\t"<<geo.GetCFrontCenter(id)
37 //<<"\t"<<aROOTGeo.GetCFrontCenter(id)<<endl;
38 //out<<part*2<<"\t"<<layer<<"\t"<<i<<"\t"
39 //<<(aROOTGeo.GetCCenter(id)-geo.GetCCenter(id)).mag()<<"\t"
40 //<<(aROOTGeo.GetCFrontCenter(id)-geo.GetCFrontCenter(id)).mag()<<endl;
41 }
42 }
43 }*/
44 // id=EmcID::crystal_id(0,1,);
45
46 ofstream out;
47 out.open( "barrel.txt" );
48 for ( int part = 1; part < 2; part++ )
49 {
50 for ( int phi = 0; phi < 120; phi++ )
51 {
52 for ( int theta = 0; theta < 44; theta++ )
53 {
54 // cout<<part*2<<"\t"<<phi<<"\t"<<theta<<endl;
55 id = EmcID::crystal_id( part, theta, phi );
56 if ( ( phi == 31 || phi == 30 ) && ( theta == 21 || theta == 22 ) )
57 {
58 std::cout << id << "\t" << phi << "\t" << theta << endl;
59 cout << geo.GetCrystal( id ) << "\n-------------\n"
60 << aROOTGeo.GetCrystal( id ) << "\n"
61 << std::endl;
62 }
63 out << part << "\t" << phi << "\t" << theta << "\t"
64 << ( aROOTGeo.GetCCenter( id ) - geo.GetCCenter( id ) ).mag() << "\t"
65 << ( aROOTGeo.GetCFrontCenter( id ) - geo.GetCFrontCenter( id ) ).mag() << endl;
66 }
67 }
68 }
69 out.close();
70}
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
EmcRecCrystal GetCrystal(const Identifier &id) const
HepPoint3D GetCFrontCenter(const Identifier &id) const
HepPoint3D GetCCenter(const Identifier &id) const
EmcRecCrystal GetCrystal(const Identifier &id) const
HepPoint3D GetCFrontCenter(const Identifier &id) const
HepPoint3D GetCCenter(const Identifier &id) const