00001 #include "Identifier/Identifier.h"
00002 #include "Identifier/EmcID.h"
00003 #include "EmcRecGeoSvc/EmcRecGeoSvc.h"
00004 #include "EmcRecGeoSvc/EmcRecROOTGeo.h"
00005 #include <fstream>
00006
00007 using namespace std;
00008
00009 int main()
00010 {
00011 Identifier id;
00012 EmcRecBarrelGeo geo;
00013
00014 EmcRecROOTGeo aROOTGeo;
00015 aROOTGeo.InitFromXML();
00016
00017 int nphi[6];
00018 nphi[0]=64;
00019 nphi[1]=64;
00020 nphi[2]=80;
00021 nphi[3]=80;
00022 nphi[4]=96;
00023 nphi[5]=96;
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 ofstream out;
00048 out.open("barrel.txt");
00049 for(int part=1;part<2;part++) {
00050 for(int phi=0;phi<120;phi++) {
00051 for(int theta=0;theta<44;theta++) {
00052
00053 id = EmcID::crystal_id(part,theta,phi);
00054 if((phi==31||phi==30)&&(theta==21||theta==22)) {
00055 std::cout<<id<<"\t"<<phi<<"\t"<<theta<<endl;
00056 cout<<geo.GetCrystal(id)
00057 <<"\n-------------\n"<<aROOTGeo.GetCrystal(id)<<"\n"<<std::endl;
00058 }
00059 out<<part<<"\t"<<phi<<"\t"<<theta<<"\t"
00060 <<(aROOTGeo.GetCCenter(id)-geo.GetCCenter(id)).mag()<<"\t"
00061 <<(aROOTGeo.GetCFrontCenter(id)-geo.GetCFrontCenter(id)).mag()<<endl;
00062 }
00063 }
00064 }
00065 out.close();
00066 }
00067