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