git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorCalibration@49 113b152e-814d-439b-b186-022a431db7b5

This commit is contained in:
jungmann_j
2014-04-08 14:17:49 +00:00
parent 9297b14500
commit 9b05e59ebc
12 changed files with 207 additions and 328 deletions

View File

@ -79,7 +79,6 @@ THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nb
TH2F *h3;
TH2F *hetaX;
TH2F *hetaY;
TH2D *clustHist;
THStack *hs=new THStack("hs",fformat);
@ -103,34 +102,26 @@ THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nb
ifstream filebin;
int iev;
int ix=20, iy=20, ir, ic;
Int_t iFrame;
TTree *tall;
cout << "init tree " << tit << endl;
if (hitfinder)
tall=filter->initEventTree(tit, &iFrame);
cout << "done" << endl;
#ifdef MY_DEBUG
quadrant quad;
tall->Branch("q",&quad,"q/I");
TCanvas *myC;
TH2F *he;
TCanvas *cH1;
TCanvas *cH2;
TCanvas *cH3;
int quadrants[5];
for(int i = 0; i < 5; i++){ quadrants[i] = 0; }
if (hitfinder) {
myC=new TCanvas();
he=new TH2F("he","Event Mask",xmax-xmin, xmin, xmax, ymax-ymin, ymin, ymax);
@ -145,8 +136,6 @@ THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nb
cH3=new TCanvas();
cH3->SetLogz();
h3->Draw("colz");
clustHist= new TH2D("clustHist","clustHist",3,-1.5,1.5,3,-1.5,1.5);
}
#endif
filter->newDataSet();
@ -154,7 +143,7 @@ THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nb
for (int irun=runmin; irun<runmax; irun++) {
sprintf(fname,fformat,irun);
cout << "file name " << fname << " ( " << (((double)(irun-runmin))*100./((double)(runmax-runmin))) << "% )" << endl;
cout << "file name " << fname << endl;
filebin.open((const char *)(fname), ios::in | ios::binary);
nph=0;
while ((buff=decoder->readNextFrame(filebin))) {
@ -198,17 +187,9 @@ THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nb
h3->Fill(filter->getClusterTotal(3), iy+NR*ix);
iFrame=decoder->getFrameNumber(buff);
#ifdef MY_DEBUG
for(int cx=-1; cx <2; cx++)
for(int cy=-1; cy < 2; cy++)
clustHist->Fill(cx,cy,filter->getClusterElement(cx,cy));
quad = filter->getQuadrant();
quadrants[quad]++;
#endif
tall->Fill();
}
@ -234,10 +215,10 @@ THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nb
#endif
nf++;
//cout << "=" ;
cout << "=" ;
delete [] buff;
}
//cout << nph << endl;
cout << nph << endl;
if (filebin.is_open())
filebin.close();
else
@ -250,14 +231,6 @@ THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nb
delete decoder;
cout << "Read " << nf << " frames" << endl;
#ifdef MY_DEBUG
cout << "quadrants: " ;
for(int i = 0; i<5; i++) cout << i << ": " << quadrants[i] << " || " ;
cout << endl;
cout << "Read Events " << nph << endl;
#endif
return hs;
}