/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Emc/EmcRecGeoSvc/EmcRecGeoSvc-01-01-07/test/main.cxx

Go to the documentation of this file.
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   //EmcRecEndCapGeo geo;
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   //int layer=0;
00026   //ofstream out;
00027   //out.open("endcap.txt");
00028   /*for(int part=0;part<2;part++) {
00029     for(int layer=0;layer<6;layer++) {
00030       for(int i=0;i<nphi[layer];i++) {
00031         id = EmcID::crystal_id(part*2,layer,i);
00032         if(part==0&&(layer==1)&&(i==16||i==17||i==18)) {
00033           cout<<part*2<<"\t"<<layer<<"\t"<<i<<endl;
00034           cout<<geo.GetCrystal(id)
00035             <<"\n-------------\n"<<aROOTGeo.GetCrystal(id)<<"\n"<<std::endl;
00036         }
00037           //cout<<id<<"\t"<<geo.GetCFrontCenter(id)
00038           //<<"\t"<<aROOTGeo.GetCFrontCenter(id)<<endl;
00039           //out<<part*2<<"\t"<<layer<<"\t"<<i<<"\t"
00040             //<<(aROOTGeo.GetCCenter(id)-geo.GetCCenter(id)).mag()<<"\t"
00041             //<<(aROOTGeo.GetCFrontCenter(id)-geo.GetCFrontCenter(id)).mag()<<endl;
00042       }
00043     }
00044   }*/
00045   //id=EmcID::crystal_id(0,1,);
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         //cout<<part*2<<"\t"<<phi<<"\t"<<theta<<endl;
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 

Generated on Tue Nov 29 22:57:57 2016 for BOSS_7.0.2 by  doxygen 1.4.7