#include "sopnamsp.h" #include "machdefs.h" #include #include #include #include #include #include #include "timing.h" #include "histerr.h" #include "hist2err.h" #include "fitshisterr.h" int ObjectType(string nameh,string nameppf); int ConcatHistoErr(string nameh,vector ppfname,int wrtyp); int ConcatHisto2DErr(string nameh,vector ppfname,int wrtyp); void usage(void); void usage(void) { cout <<"cmvconcherr -w wtyp -n name_histoerr file1.ppf file2.ppf ..."< ppfname; int Write_Type = 3; // --- Decodage arguments char c; while((c = getopt(narg,arg,"hn:w:")) != -1) { switch (c) { case 'n' : nameh = optarg; break; case 'w' : sscanf(optarg,"%d",&Write_Type); break; case 'h' : default : usage(); return -1; } } if(nameh.size()<=0 || optind>=narg) {usage(); return -1;} for (int i=optind;iDataObj(); cout<<"Object type read from input PPF file : "<(obj); if(herr) return 1; Histo2DErr *herr2 = dynamic_cast(obj); if(herr2) return 2; return 0; } //--------------------------------------------------------------- int ConcatHistoErr(string nameh,vector ppfname,int wrtyp) { if(ppfname.size()<=0) return 0; HistoErr *herrconc = NULL; int nherr=0, nread=0, itest=0; double sum=0., sum2=0., nsum=0; for (int ifile=0;ifile variance\n"); fprintf(fdata,"%.17e %.17e %d %d\n",herrconc->XMin(),herrconc->XMax() ,herrconc->NBins(),herrconc->NMean()); for(int i=0;iNBins();i++) { double x = herrconc->BinCenter(i); fprintf(fdata,"%e %e %e\n",x,(*herrconc)(i),herrconc->Error2(i)); } fclose(fdata); } if(wrtyp&2) { // ecriture PPF string tagobs = "cmvconcherr.ppf"; POutPersist posobs(tagobs); tagobs = "herrconc"; posobs.PutObject(*herrconc,tagobs); } if(wrtyp&4) { // ecriture FITS FitsInOutFile fio("!cmvconcherr.fits",FitsInOutFile::Fits_Create); fio << *herrconc; } delete herrconc; return nread; } //--------------------------------------------------------------- int ConcatHisto2DErr(string nameh,vector ppfname,int wrtyp) { if(ppfname.size()<=0) return 0; Histo2DErr *herrconc = NULL; int nherrx=0, nherry=0, nread=0, itestx=0, itesty=0; double sum=0., sum2=0., nsum=0; for (int ifile=0;ifileNBinX()/5.+0.5); itesty = int(herrconc->NBinY()/5.+0.5); } else if(nherrx!=herr.NBinX() || nherry!=herr.NBinY()) { cout<<"BAD NUMBER OF BINS"<0 ! "connectpoints" n/plot herrconc.sqrt(err2)%log10(x) x>0&&err2>0 ! "connectpoints same red" n/plot herrconc.sqrt(err2)/val%log10(x) x>0&&err2>0&&val>0 ! "connectpoints" #### Histo2DErr 2D openppf cmvconcherr2.ppf zone 2 2 imag herrconc2 "hbincont" imag herrconc2 "hbinerr" imag herrconc2 "hbinent" */