Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 321 → Rev 322

/cvi/apps/RedPitaya/soccli/H1Dload.cxx
2,6 → 2,7
#include <TStyle.h>
#include <TPad.h>
#include "mH1D.h"
#include <TSystem.h>
 
double H1DGetBinContent(H1D *h1d,int atx){
16,7 → 17,12
 
int H1Dload(char *fname){
 
FILE *fp= fopen(fname ,"rb");
TString dfile( gSystem->Getenv("USERPROFILE") );
dfile.ReplaceAll("\\","/");
dfile += TString("/Desktop/data/") + fname;
fprintf(stderr, "Filename %s\n",dfile.Data());
FILE *fp= fopen(dfile.Data() ,"rb");
 
if (!fp) return -1;
H1D *h = new H1D;
int size=sizeof(H1D);
49,15 → 55,21
// if (g>0) printf("i %d j %d v %g\n",ix+1,iy+1,g);
 
}
 
gStyle->SetOptStat(0);
h1d->SetEntries(h->nentries);
gStyle->SetOptStat(1);
gStyle->SetOptFit(1);
h1d->Draw("colz");
 
char hname[100];
sprintf(hname,"%s.pdf",fname);
TString hname;
//sprintf(hname,"%s.pdf",dfile.Data());
hname = dfile + ".pdf";
gPad->SaveAs(hname);
 
//sprintf(hname,"%s.root",dfile.Data());
hname = dfile + ".root";
//printf("%s\n",hname);
printf("%s\n",hname.Data());
gPad->SaveAs(hname);
h1d->FitPanel();
gPad->SaveAs(fname);
return 0;
}