3 #pragma link off all globals;
4 #pragma link off all classes;
5 #pragma link off all functions;
7 #pragma link C++ class PlotFile;
13 #include <sys/types.h>
35 #include "TUnixSystem.h"
41 int main(
int argc,
char **argv)
44 if(!gSystem) TUnixSystem *gSystem =
new TUnixSystem();
49 TChain *chain =
new TChain(
"tof");
56 char file_list[2500][256];
58 cout <<
" execute : " << argv[0] <<
" " << argv[1] << endl;
63 cout << Tname.Data() << endl;
64 if (file_name && Tname.Contains(
"root")) {
66 sprintf(file_list[nruns],
"./%s",file_name);
68 chain->Add(file_list[nruns]);
69 cout <<
" read in " << file_list[nruns] << endl;
78 Float_t mrpcA[32] = { 0., 0., 0., 0., 0., 0., 16., 16.,
79 20., 22., 22., 22., 22., 22., 26., 26.,
80 26., 26., 30., 30., 32., 32., 32., 32.,
81 32., 32., 32., 32., 32., 32., 32., 32.};
82 Int_t MIdStart[8] = {1, 7, 9, 10, 15, 19, 21, 33};
87 for(
int i=0;i<7;i++) {
89 sprintf(name,
"yLocal_%d",i);
90 mYLocal[i] =
new TH2D(name,
"",120,0.,120.,500,-5.,5.);
91 sprintf(name,
"zLocal_%d",i);
92 mZLocal[i] =
new TH2D(name,
"",120,0.,120.,600,-6.,6.);
93 sprintf(name,
"yLocalPhi_%d",i);
94 mYLocalPhi[i] =
new TH2D(name,
"",120,-3.,717.,500,-5.,5.);
95 sprintf(name,
"zLocalPhi_%d",i);
96 mZLocalPhi[i] =
new TH2D(name,
"",120,-3.,717.,600,-6.,6.);
98 TH2D *mYLocalAll =
new TH2D(
"yLocal_all",
"",120,0.,120.,500,-5.,5.);
99 TH2D *mYLocalPhiAll =
new TH2D(
"yLocalPhi_all",
"",120,0.,120.,500,-5.,5.);
105 int nevents = (int)chain->GetEntries();
106 cout <<
"== total entries : " << nevents << endl;
109 for(
int i=0;i<nevents;i++){
110 if(i%10000==0) cout <<
"begin " << i <<
"th entry...." << endl;
113 float vz = t->vertexZ;
114 if(fabs(vz)>30.)
continue;
116 int nhits = t->nTofHits;
117 for(
int j=0;j<nhits;j++) {
118 int nHits = t->nHitsFit[j];
119 if(abs(nHits)<25)
continue;
128 int tray = t->tray[j];
129 int module = t->module[j];
131 for(
int k=0;k<7;k++) {
132 if(module>=MIdStart[k] && module <MIdStart[k+1]) {
136 if(m_index<0 || m_index>=7 )
continue;
140 phi = 72. - (tray-1)*6.;
141 if(phi<-3.) phi+= 360.;
143 phi = 108 + (tray-61) * 6;
144 if(phi>357.) phi-= 360.;
149 float yLocal = t->yLocal[j];
150 float zLocal = t->zLocal[j];
151 mYLocalPhi[m_index]->Fill(phi, yLocal);
152 mZLocalPhi[m_index]->Fill(phi, zLocal);
154 mYLocal[m_index]->Fill(tray-1, yLocal);
155 mZLocal[m_index]->Fill(tray-1, zLocal);
157 mYLocalAll->Fill(tray-1, yLocal);
158 mYLocalPhiAll->Fill(phi, yLocal);
165 TFile *f2 =
new TFile(
"align.root",
"recreate");
167 for(
int i=0;i<7;i++) {
170 mYLocalPhi[i]->Write();
171 mZLocalPhi[i]->Write();
174 mYLocalPhiAll->Write();
177 cout<<
"end of program"<<endl;