some fixes in the cluster finder

This commit is contained in:
2018-01-30 10:24:56 +01:00
parent f264691dc1
commit d1ef6bf94b
10 changed files with 323 additions and 212 deletions

View File

@ -1,5 +1,10 @@
#include "../single_photon_hit.h"
//#include "etaVEL/etaInterpolationPosXY.h"
#include <TH1F.h>
#include <TH2F.h>
#include <TCanvas.h>
#include <iostream>
using namespace std;
TH2F *readClusters(char *fname, int nx, int ny, TH2F *h2=NULL) {
FILE *f=fopen(fname,"r");
@ -13,21 +18,21 @@ TH2F *readClusters(char *fname, int nx, int ny, TH2F *h2=NULL) {
h2=new TH2F("h2",fname,nx, -0.5, nx-0.5, ny, -0.5, ny-0.5);
//h2mult=new TH2F("h2mult",fname,nx, -0.5, nx-0.5, ny, -0.5, ny-0.5);
// TH2F *hint=new TH2F("hint",fname,nx*ns, -0.5, nx-0.5, ny*ns, -0.5, ny-0.5);
TH1F *hf=new TH1F("hf","hf",1000,0,3000000);
TH1F *hf=new TH1F("hf","hf",1000,0,10E6);
//TH2F *hff=new TH2F("hff","hff",ns, -0.5, 0.5, ns, -0.5, +0.5);
TH1F *hsp=new TH1F("hsp",fname,500,0,2000);
TH1F *hsp1=new TH1F("hsp1",fname,500,0,2000);
TH1F *hsp=new TH1F("hsp",fname,500,0,10000);
// TH1F *hsp1=new TH1F("hsp1",fname,500,0,10000);
// TH1F *hsp2=new TH1F("hsp2",fname,500,0,1000);
// TH1F *hsp3=new TH1F("hsp3",fname,500,0,1000);
hsp1->SetLineColor(2);
// hsp1->SetLineColor(2);
// hsp2->SetLineColor(3);
// hsp3->SetLineColor(4);
TCanvas *c=new TCanvas();
c->SetLogz(kTRUE);
h2->Draw("colz");
TCanvas *c1=new TCanvas();
hsp->Draw();
hsp1->Draw("same");
c1->SetLogy(kTRUE);
// hsp1->Draw("same");
// hsp2->Draw("same");
// hsp3->Draw("same");
TCanvas *c2=new TCanvas();
@ -40,6 +45,8 @@ TH2F *readClusters(char *fname, int nx, int ny, TH2F *h2=NULL) {
double phw=340, phs=62;
int f0=-1;
double tl, bl, tr, br, qt;
int iimage=0;
while (cl.read(f)) {
//cl.get_pixel(x1, y1);
//cout << cl.iframe << " " << cl.x << " " << cl.y << endl;
@ -64,7 +71,6 @@ TH2F *readClusters(char *fname, int nx, int ny, TH2F *h2=NULL) {
// if (iy>0) top+=cl.get_data(ix,iy);
}
qt=bl;
if (br>qt) qt=br;
if (tl>qt) qt=tl;
@ -75,22 +81,22 @@ TH2F *readClusters(char *fname, int nx, int ny, TH2F *h2=NULL) {
//max at 340
//if (tot>200) {
w=1;
if (qt>1000) {
if (qt/tot>0.8 && qt/tot<1.2){
if (f0<0)
f0=cl.iframe;
hf->Fill(cl.iframe-f0);
if (qt>540) w++;
if (qt>820) w++;
// if (qt>540) w++;
// if (qt>820) w++;
//(tot+3.5*phs)/phw;
//} else
//w=0;
// if (w) {
// if (cl.y<350) {
// if (cl.y<100 || cl.y>300) {
if (cl.x>150 && cl.x<250 && cl.y>200 && cl.y<250)
hsp1->Fill(qt);
else
// if (cl.x>150 && cl.x<250 && cl.y>200 && cl.y<250)
// hsp1->Fill(qt);
// else
hsp->Fill(qt);
// hsp2->Fill(cl.get_data(0,0));
@ -122,10 +128,11 @@ TH2F *readClusters(char *fname, int nx, int ny, TH2F *h2=NULL) {
c2->Modified();;
c2->Update();
}
// if (iph>1E7)
// break;
//}
// if (iph>0.5E7) break;
}
}
fclose(f);
// hff->Scale(hff->GetNbinsX()*hff->GetNbinsY()/hff->Integral());