improved readNextFrame for moench 10G streaming; implemented many photons finder

This commit is contained in:
2017-05-30 12:21:48 +02:00
parent 73ec3903bf
commit 5dbfbdb82b
9 changed files with 524 additions and 235 deletions

View File

@ -1,11 +1,12 @@
void imageMacro(char *name){
TH2D *imageMacro(char *name) {
//TH2D *makeNorm(){
//TFile ff("/local_zfs_raid/tomcat_20160528/trees/img_blank_eta_gmap.root");
//TH2D *hff=(TH2D*)ff.Get("imgHR");
TFile ff("/local_zfs_raid/tomcat_20160528/trees/img_blank_eta_nb25.root");
TFile *ff=new TFile("/mnt/moench_data/tomcat_20160528_img/img_blank_eta_nb25.root");
// TFile ff("/local_zfs_raid/tomcat_20160528/trees/img_blank_eta_gcorr_nb25.root");
TH2D *hff=(TH2D*)ff.Get("blankHR");
TH2D *hff=(TH2D*)ff->Get("blankHR");
hff->SetName("imgBlank");
TH2D *hpixel=new TH2D("hpixel","hpixel",25,0,25,25,0,25);
for (int ibx=10*25; ibx<hff->GetNbinsX()-10*25; ibx++) {
@ -45,9 +46,9 @@ void imageMacro(char *name){
} else {
sprintf(nn,"/local_zfs_raid/tomcat_20160528/trees/img_%s_eta_nb25.root", name);
sprintf(nn,"/mnt/moench_data/tomcat_20160528_img/img_%s_eta_nb25.root", name);
// if (strcmp(name,"blank"))
TFile fg(nn);
TFile *fg=new TFile(nn);
// else
// TFile fg=gDirectory;
@ -57,13 +58,21 @@ void imageMacro(char *name){
// TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_sample_eta_nb25.root");
// TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_grating_1d_eta_gcorr_nb25.root");
sprintf(nn,"%sHR",name);
TH2D *hg=(TH2D*)fg.Get(nn);
TH2D *hg=(TH2D*)fg->Get(nn);
// hg->SetName("imgGrating");
//hg->Divide(hff);
}
if (hpix)
hg->Divide(hpix);
new TCanvas();
hg->Draw("colz");
return hg;
}
void imageMacro(TH2D *hg){
Double_t imageData[200*400*25*25];
const int nsigma=5.;

View File

@ -1,7 +1,31 @@
{
{
TColor::InitializeColors();
const Int_t NRGBs = 5;
const Int_t NCont = 255;//90;
Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
Double_t gray[NRGBs] = { 1., 0.34, 0.61, 0.84, 1.00};
Double_t zero[NRGBs] = { 0., 0.0,0.0, 0.0, 0.00};
//TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
TColor::CreateGradientColorTable(NRGBs, stops, gray, gray, gray, NCont);
gStyle->SetNumberContours(NCont);
gStyle->SetPadTopMargin(0);
gStyle->SetPadRightMargin(0);
gStyle->SetPadBottomMargin(0);
gStyle->SetPadLeftMargin(0);
gROOT->ForceStyle();
// TFile ff("/local_zfs_raid/tomcat_20160528/trees/img_blank_eta.root");
// TH2D *hff=(TH2D*)ff.Get("imgHR");
TFile ff("/local_zfs_raid/tomcat_20160528/trees/img_blank_eta_gmap_v2.root");
TFile ff("/mnt/moench_data/tomcat_20160528_img/img_blank_eta_nb25.root");
TH2D *hff=(TH2D*)ff.Get("blankHR");
hff->SetName("imgBlank");
TH2D *hpixel=new TH2D("hpixel","hpixel",25,0,25,25,0,25);
@ -32,7 +56,7 @@
// TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_grating_2d_eta.root");
// TH2D *hg=(TH2D*)fg.Get("imgHR");
TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_grating_2d_eta_gmap_v2.root");
TFile fg("/mnt/moench_data/tomcat_20160528_img/img_grating_2d_eta_nb25.root");
TH2D *hg=(TH2D*)fg.Get("grating_2dHR");
hg->SetName("imgGrating");
@ -50,9 +74,21 @@
hg->Scale(1/ng);
new TCanvas();
hg->SetMaximum(1.);
hg->Draw("colz");
new TCanvas("c1","c1",800,800);
hg->SetMaximum(2.);
Double_t xmin=hg->GetXaxis()->GetXmin();
Double_t xmax=hg->GetXaxis()->GetXmax();
Double_t ymin=hg->GetYaxis()->GetXmin();
Double_t ymax=hg->GetYaxis()->GetXmax();
hg->SetTitle(";mm;mm;Normalized intensity (a.u.)");
hg->GetXaxis()->Set(hg->GetXaxis()->GetNbins(),xmin*0.025-180.*0.025+0.1,xmax*0.025-180.*0.025+0.1);
hg->GetYaxis()->Set(hg->GetYaxis()->GetNbins(),ymin*0.025-180.*0.025-1.5,ymax*0.025-180*0.025-1.5);
hg->GetXaxis()->SetRangeUser(0,0.5);
hg->GetYaxis()->SetRangeUser(0,0.5);
hg->Draw("col");
hg->SetStats(kFALSE);
// new TCanvas();
// hsg->SetMaximum(1.);
// hsg->Draw("colz");

View File

@ -35,7 +35,7 @@
// TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_grating_2d_eta.root");
// TH2D *hg=(TH2D*)fg.Get("imgHR");
TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_sample_eta_gmap_v2.root");
TFile fg("/mnt/moench_data/tomcat_20160528_img/img_sample_eta_gmap_v2.root");
TH2D *hg=(TH2D*)fg.Get("sampleHR");
hg->SetName("imgSample");