Changeset 3157 in Sophya for trunk/Cosmo/SimLSS
- Timestamp:
- Jan 25, 2007, 6:04:48 PM (19 years ago)
- Location:
- trunk/Cosmo/SimLSS
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/Makefile
r3141 r3157 19 19 $(EXE)cmvtstsch $(EXE)cmvtstblack $(EXE)cmvtvarspec \ 20 20 $(EXE)cmvdefsurv $(EXE)cmvobserv3d $(EXE)cmvtintfun \ 21 $(EXE)cmvtpoisson $(EXE)cmvconcherr 21 $(EXE)cmvtpoisson $(EXE)cmvconcherr $(EXE)cmvtinterp 22 22 #$(EXE)cmvtluc 23 23 … … 25 25 $(OBJ)cmvtuniv.o $(OBJ)cmvtransf.o $(OBJ)cmvtgrowth.o $(OBJ)cmvtstpk.o \ 26 26 $(OBJ)cmvtstsch.o $(OBJ)cmvtstblack.o $(OBJ)cmvtvarspec.o $(OBJ)cmvdefsurv.o \ 27 $(OBJ)cmvobserv3d.o $(OBJ)cmvtintfun.o \27 $(OBJ)cmvobserv3d.o $(OBJ)cmvtintfun.o $(OBJ)cmvtinterp.o \ 28 28 $(OBJ)cmvtpoisson.o $(OBJ)cmvconcherr.o $(OBJ)cmvtluc.o 29 29 … … 165 165 166 166 ############################################################################## 167 cmvtinterp: $(EXE)cmvtinterp 168 echo $@ " done" 169 $(EXE)cmvtinterp: $(OBJ)cmvtinterp.o $(LIB)libcmvsimbao.a 170 $(CXXLINK) $(CXXREP) -o $@ $(OBJ)cmvtinterp.o $(MYLIB) 171 $(OBJ)cmvtinterp.o: cmvtinterp.cc 172 $(CXXCOMPILE) $(CXXREP) -I$(MYEXTINC) -o $@ cmvtinterp.cc 173 174 ############################################################################## 167 175 cmvtluc: $(EXE)cmvtluc 168 176 echo $@ " done" -
trunk/Cosmo/SimLSS/cmvobserv3d.cc
r3155 r3157 12 12 13 13 #include "constcosmo.h" 14 #include "cosmocalc.h" 14 15 #include "schechter.h" 15 16 #include "geneutils.h" … … 23 24 <<" -a : init auto de l aleatoire"<<endl 24 25 <<" -0 : use methode ComputeFourier0"<<endl 26 <<" -G : compute Pk(z=0) and apply growth factor in real space"<<endl 25 27 <<" -x nx,dx : taille en x (npix,Mpc)"<<endl 26 28 <<" -y ny,dy : taille en y (npix,Mpc)"<<endl … … 46 48 47 49 // *** Cosmography definition (WMAP) 50 unsigned short flat = 0; 48 51 double ob0 = 0.0444356; 49 52 double h100=0.71, om0=0.267804, or0=7.9e-05, ol0=0.73,w0=-1.; 50 53 double zref = 0.5; 54 double perc=0.01,dzinc=-1.,dzmax=5.; unsigned short glorder=4; 51 55 52 56 // *** Spectrum and variance definition … … 75 79 // *** type de generation 76 80 bool computefourier0=false; 81 bool use_growth_factor = false; 77 82 unsigned short nthread=4; 78 83 … … 86 91 87 92 char c; 88 while((c = getopt(narg,arg,"ha0PWV2 x:y:z:s:Z:")) != -1) {93 while((c = getopt(narg,arg,"ha0PWV2Gx:y:z:s:Z:")) != -1) { 89 94 switch (c) { 90 95 case 'a' : … … 93 98 case '0' : 94 99 computefourier0 = true; 100 break; 101 case 'G' : 102 use_growth_factor = true; 95 103 break; 96 104 case 'x' : … … 142 150 143 151 //----------------------------------------------------------------- 144 cout<<endl<<"\n--- Create Spectrum and mass function"<<endl; 152 cout<<endl<<"\n--- Create Cosmology"<<endl; 153 154 CosmoCalc univ(flat,true,zref+1.); 155 univ.SetInteg(perc,dzinc,dzmax,glorder); 156 univ.SetDynParam(h100,om0,or0,ol0,w0); 157 univ.Print(); 158 double loscomref = univ.Dloscom(zref); 159 cout<<"zref = "<<zref<<" -> dloscom = "<<loscomref<<" Mpc"<<endl; 160 161 //----------------------------------------------------------------- 162 cout<<endl<<"\n--- Create Spectrum and mass function"<<endl; 145 163 146 164 InitialSpectrum pkini(ns,as); … … 149 167 //tf.SetNoOscEnv(2); 150 168 151 GrowthFactor d1(om0,ol0);169 GrowthFactor growth(om0,ol0); 152 170 153 171 PkSpectrum0 pk0(pkini,tf); 154 172 155 PkSpectrumZ pkz(pk0, d1,zref);173 PkSpectrumZ pkz(pk0,growth,zref); 156 174 157 175 Schechter sch(nstar,mstar,alpha); … … 223 241 cout<<endl<<"\n--- Initialisation de GeneFluct3D"<<endl; 224 242 225 pkz.SetZ(zref);226 243 TArray< complex<r_8> > pkgen; 227 244 GeneFluct3D fluct3d(pkgen); … … 229 246 fluct3d.SetNThread(nthread); 230 247 fluct3d.SetSize(nx,ny,nz,dx,dy,dz); 248 fluct3d.SetObservator(zref,nz/2.); 249 fluct3d.SetCosmology(univ); 250 fluct3d.SetGrowthFactor(growth); 251 fluct3d.LosComRedshift(0.001); 231 252 TArray<r_8>& rgen = fluct3d.GetRealArray(); 232 fluct3d.Print();253 cout<<endl; fluct3d.Print(); 233 254 234 255 double dkmin = fluct3d.GetKincMin(); … … 246 267 <<" max="<<ktnyqmax<<","<<kznyqmax<<" n="<<nherrt<<","<<nherrz<<endl; 247 268 269 //----------------------------------------------------------------- 248 270 cout<<"\n--- Computing spectra variance up to Kmax at z="<<pkz.GetZ()<<endl; 249 271 // En fait on travaille sur un cube inscrit dans la sphere de rayon kmax: … … 258 280 PrtTim(">>>> End Initialisation de GeneFluct3D"); 259 281 282 //----------------------------------------------------------------- 260 283 cout<<"\n--- Computing a realization in Fourier space"<<endl; 284 if(use_growth_factor) pkz.SetZ(0.); else pkz.SetZ(zref); 285 cout<<"Power spectrum set at redshift: "<<pkz.GetZ()<<endl; 261 286 if(computefourier0) fluct3d.ComputeFourier0(pkz); 262 287 else fluct3d.ComputeFourier(pkz); … … 326 351 } 327 352 353 //----------------------------------------------------------------- 328 354 cout<<"\n--- Computing a realization in real space"<<endl; 329 355 fluct3d.ComputeReal(); 330 356 double rmin,rmax; rgen.MinMax(rmin,rmax); 331 357 cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl; 332 PrtTim(">>>> End Computing a realization in real space"); 358 PrtTim(">>>> End Computing a realization in real space"); 359 360 if(use_growth_factor) { 361 cout<<"\n--- Apply Growth factor"<<endl; 362 cout<<"...D(z=0)="<<growth(0.)<<" D(z="<<zref<<")="<<growth(zref)<<endl; 363 fluct3d.ApplyGrowthFactor(-1); 364 rmin,rmax; rgen.MinMax(rmin,rmax); 365 cout<<"rgen.Min = "<<rmin<<" , Max="<<rmax<<endl; 366 PrtTim(">>>> End Applying growth factor"); 367 } 333 368 334 369 if(wfits) { -
trunk/Cosmo/SimLSS/genefluct3d.cc
r3155 r3157 32 32 GeneFluct3D::GeneFluct3D(TArray< complex<r_8 > >& T) 33 33 : T_(T) , Nx_(0) , Ny_(0) , Nz_(0) , array_allocated_(false) , lp_(0) 34 , redshref_(-999.) , kredshref_(-999.) 35 { 34 , redshref_(-999.) , kredshref_(0.) , cosmo_(NULL) , growth_(NULL) 35 , loscom_ref_(-999.), loscom_min_(-999.), loscom_max_(-999.) 36 37 38 { 39 xobs_[0] = xobs_[1] = xobs_[2] = 0.; 40 zred_.resize(0); 41 loscom_.resize(0); 36 42 SetNThread(); 37 43 } … … 64 70 // kredshref = indice (en double) correspondant a ce redshift 65 71 // Si kredshref<0 alors kredshref=0 72 // Exemple: redshref=1.5 kredshref=250.75 73 // -> Le pixel i=nx/2 j=ny/2 k=250.75 est au redshift 1.5 66 74 { 67 75 if(redshref<0.) redshref = 0.; 68 76 if(kredshref<0.) kredshref = 0.; 69 redshref_ = redshref;77 redshref_ = redshref; 70 78 kredshref_ = kredshref; 79 } 80 81 void GeneFluct3D::SetCosmology(CosmoCalc& cosmo) 82 { 83 cosmo_ = &cosmo; 84 if(lp_>1) cosmo_->Print(); 85 } 86 87 void GeneFluct3D::SetGrowthFactor(GrowthFactor& growth) 88 { 89 growth_ = &growth; 71 90 } 72 91 … … 164 183 } 165 184 185 //------------------------------------------------------- 186 long GeneFluct3D::LosComRedshift(double zinc) 187 // Given a position of the cube relative to the observer 188 // and a cosmology 189 // (SetObservator() and SetCosmology() should have been called !) 190 // This routine filled: 191 // the vector "zred_" of scanned redshift (by zinc increments) 192 // the vector "loscom_" of corresponding los comoving distance 193 // 194 { 195 if(zinc<=0.) zinc = 0.01; 196 if(lp_>0) cout<<"--- LosComRedshift: zinc="<<zinc<<endl; 197 198 if(cosmo_ == NULL || redshref_<0.) { 199 cout<<"GeneFluct3D::LosComRedshift_Error: set Observator and Cosmology first"<<endl; 200 throw ParmError(""); 201 } 202 203 // On calcule les coordonnees de l'observateur 204 // Il est sur un axe centre sur le milieu de la face Oxy 205 double loscom_ref_ = cosmo_->Dloscom(redshref_); 206 xobs_[0] = Nx_/2.*Dx_; 207 xobs_[1] = Ny_/2.*Dy_; 208 xobs_[2] = kredshref_*Dz_ - loscom_ref_; 209 210 // L'observateur est-il dans le cube? 211 bool obs_in_cube = false; 212 if(xobs_[2]>=0. && xobs_[2]<=Nz_*Dz_) obs_in_cube = true; 213 214 // Find MINIMUM los com distance to the observer: 215 // c'est le centre de la face a k=0 216 // (ou zero si l'observateur est dans le cube) 217 loscom_min_ = 0.; 218 if(!obs_in_cube) loscom_min_ = -xobs_[2]; 219 220 // Find MAXIMUM los com distance to the observer: 221 // ou que soit positionne l'observateur, la distance 222 // maximal est sur un des coins du cube 223 loscom_max_ = 0.; 224 for(long i=0;i<=1;i++) { 225 double dx2 = xobs_[0] - i*Nx_*Dx_; dx2 *= dx2; 226 for(long j=0;j<=1;j++) { 227 double dy2 = xobs_[1] - j*Ny_*Dy_; dy2 *= dy2; 228 for(long k=0;k<=1;k++) { 229 double dz2 = xobs_[2] - k*Nz_*Dz_; dz2 *= dz2; 230 dz2 = sqrt(dx2+dy2+dz2); 231 if(dz2>loscom_max_) loscom_max_ = dz2; 232 } 233 } 234 } 235 if(lp_>0) { 236 cout<<"...zref="<<redshref_<<" kzref="<<kredshref_<<" losref="<<loscom_ref_<<" Mpc\n" 237 <<" xobs="<<xobs_[0]<<" , "<<xobs_[1]<<" , "<<xobs_[2]<<" Mpc " 238 <<" in_cube="<<obs_in_cube 239 <<" loscom_min="<<loscom_min_<<" loscom_max="<<loscom_max_<<" Mpc "<<endl; 240 } 241 242 // Fill the corresponding vectors 243 for(double z=0.; ; z+=zinc) { 244 double dlc = cosmo_->Dloscom(z); 245 if(dlc<loscom_min_) {zred_.resize(0); loscom_.resize(0);} 246 zred_.push_back(z); 247 loscom_.push_back(dlc); 248 z += zinc; 249 if(dlc>loscom_max_) break; // on break apres avoir stoque un dlc>dlcmax 250 } 251 252 long n = zred_.size(); 253 if(lp_>0) { 254 cout<<"...n="<<n; 255 if(n>0) cout<<" z="<<zred_[0]<<" -> d="<<loscom_[0]; 256 if(n>1) cout<<" , z="<<zred_[n-1]<<" -> d="<<loscom_[n-1]; 257 cout<<endl; 258 } 259 260 return n; 261 } 166 262 167 263 //------------------------------------------------------- … … 323 419 324 420 // --- On remplit avec une realisation 325 if(lp_>0) cout<<"...before Fourier realization filling ---"<<endl;421 if(lp_>0) cout<<"...before Fourier realization filling"<<endl; 326 422 T_(0,0,0) = complex<r_8>(0.); // on coupe le continue et on l'initialise 327 423 long lmod = Nx_/10; if(lmod<1) lmod=1; … … 529 625 530 626 //------------------------------------------------------------------- 627 void GeneFluct3D::ApplyGrowthFactor(long npoints) 628 // Apply Growth to real space 629 // Using the correspondance between redshift and los comoving distance 630 // describe in vector "zred_" "loscom_" 631 { 632 if(npoints<3) npoints = zred_.size(); 633 if(lp_>0) cout<<"--- ApplyGrowthFactor --- npoints="<<npoints<<endl; 634 check_array_alloc(); 635 636 if(growth_ == NULL) { 637 cout<<"GeneFluct3D::ApplyGrowthFactor_Error: set GrowthFactor first"<<endl; 638 throw ParmError("GeneFluct3D::ApplyGrowthFactor_Error: set GrowthFactor first"); 639 } 640 641 long n = zred_.size(); 642 InverseFunc invfun(zred_,loscom_); 643 vector<double> invlos; 644 invfun.ComputeParab(npoints,invlos); 645 646 InterpFunc interpinv(invfun.YMin(),invfun.YMax(),invlos); 647 unsigned short ok; 648 649 //CHECK: Histo hgr(0.9*zred_[0],1.1*zred_[n-1],1000); 650 for(long i=0;i<Nx_;i++) { 651 double dx2 = xobs_[0] - i*Dx_; dx2 *= dx2; 652 for(long j=0;j<Ny_;j++) { 653 double dy2 = xobs_[1] - j*Dy_; dy2 *= dy2; 654 for(long l=0;l<Nz_;l++) { 655 double dz2 = xobs_[2] - l*Dz_; dz2 *= dz2; 656 dz2 = sqrt(dx2+dy2+dz2); 657 double z = interpinv(dz2); 658 //CHECK: hgr.Add(z); 659 double dzgr = (*growth_)(z); // interpolation par morceau 660 //double dzgr = growth_->Linear(z,ok); // interpolation lineaire 661 //double dzgr = growth_->Parab(z,ok); // interpolation parabolique 662 int_8 ip = IndexR(i,j,l); 663 data_[ip] *= dzgr; 664 } 665 } 666 } 667 668 //CHECK: {POutPersist pos("applygrowth.ppf"); string tag="hgr"; pos.PutObject(hgr,tag);} 669 670 } 671 672 //------------------------------------------------------------------- 531 673 void GeneFluct3D::ComputeReal(void) 532 674 // Calcule une realisation dans l'espace reel -
trunk/Cosmo/SimLSS/genefluct3d.h
r3154 r3157 14 14 #include <vector> 15 15 16 #include "cosmocalc.h" 16 17 #include "pkspectrum.h" 17 18 … … 27 28 void SetNThread(unsigned short nthread=0) {nthread_ = nthread;} 28 29 void SetSize(long nx,long ny,long nz,double dx,double dy,double dz); // Mpc 29 void SetObservator(double redshref=0.,double kredshref=-1.); 30 void SetObservator(double redshref=0.,double kredshref=0.); 31 void SetCosmology(CosmoCalc& cosmo); 32 void SetGrowthFactor(GrowthFactor& growth); 33 long LosComRedshift(double zinc=0.001); 30 34 31 35 TArray< complex<r_8> >& GetComplexArray(void) {return T_;} … … 67 71 int ComputeSpectrum(HistoErr& herr); 68 72 int ComputeSpectrum2D(Histo2DErr& herr); 73 void ApplyGrowthFactor(long npoints=-1); 69 74 70 75 int_8 VarianceFrReal(double R,double& var); … … 127 132 // l'observateur 128 133 double redshref_,kredshref_; 134 CosmoCalc *cosmo_; 135 GrowthFactor *growth_; 136 double xobs_[3]; 137 double loscom_ref_, loscom_min_, loscom_max_; 138 vector<double> zred_, loscom_; 129 139 }; 130 140 -
trunk/Cosmo/SimLSS/geneutils.cc
r3115 r3157 19 19 // Classe d'interpolation lineaire: 20 20 // Le vecteur y a n elements y_i tels que y_i = f(x_i) 21 // Les x_i sont regulierement espaces22 // et x_0=xmin et x_{n-1}=xmax 21 // ou les x_i sont regulierement espaces 22 // et x_0=xmin et x_{n-1}=xmax (xmax inclus!) 23 23 InterpFunc::InterpFunc(double xmin,double xmax,vector<double>& y) 24 24 : _xmin(xmin), _xmax(xmax), _y(y) … … 29 29 } 30 30 _nm1 = _y.size()-1; 31 _xlarg = _xmax-_xmin; 32 _dx = _xlarg/(double)_nm1; 31 _dx = (_xmax-_xmin)/(double)_nm1; 33 32 } 34 33 … … 37 36 ok=0; if(x<_xmin) ok=1; else if(x>_xmax) ok=2; 38 37 x -= _xmin; 39 long i = long(x/_ xlarg*_nm1); // On prend le "i" juste en dessous38 long i = long(x/_dx); // On prend le "i" juste en dessous 40 39 if(i<0) i=0; else if(i>=_nm1) i=_nm1-1; 41 40 return _y[i] + (_y[i+1]-_y[i])/_dx*(x-i*_dx); … … 46 45 ok=0; if(x<_xmin) ok=1; else if(x>_xmax) ok=2; 47 46 x -= _xmin; 48 long i = long(x/_ xlarg*_nm1+0.5); // On prend le "i" le + proche47 long i = long(x/_dx+0.5); // On prend le "i" le + proche 49 48 if(i<1) i=1; else if(i>=_nm1-1) i=_nm1-2; 50 49 double a = (_y[i+1]-2.*_y[i]+_y[i-1])/(2.*_dx*_dx); 51 50 double b = (_y[i+1]-_y[i-1])/(2.*_dx); 52 51 return _y[i] + (x-i*_dx)*(a*(x-i*_dx)+b); 52 } 53 54 //------------------------------------------------------------------- 55 // Classe d'inversion d'une fonction STRICTEMENT MONOTONE CROISSANTE 56 // - Le vecteur y a "Nin" elements y_i tels que "y_i = f(x_i)" 57 // - On a x(i) < x(i+1) et y(i) < y(i+1) 58 // - La classe renvoie ymin=y(0) , ymax=y(Nin -1) 59 // et le vecteur x = f^-1(y) de "Nout" elements 60 // Les y_i sont regulierement espaces et ymin et ymax 61 // La re-interpolation inverse est faite par lineaire 62 InverseFunc::InverseFunc(vector<double>& x,vector<double>& y) 63 : _ymin(0.) , _ymax(0.) , _x(x) , _y(y) 64 { 65 int_4 ns = _x.size(); 66 if(ns<3 || _y.size()<=0 || ns!=_y.size()) 67 throw ParmError("InverseFunc::InverseFunc_Error: bad array size"); 68 69 // Check "x" strictement monotone croissant 70 for(int_4 i=0;i<ns-1;i++) 71 if(_x[i+1]<=_x[i]) { 72 cout<<"InverseFunc::InverseFunc_Error: _x array not stricly growing"<<endl; 73 throw ParmError("InverseFunc::InverseFunc_Error: _x array not stricly growing"); 74 } 75 76 // Check "y" monotone croissant 77 for(int_4 i=0;i<ns-1;i++) 78 if(_y[i+1]<_y[i]) { 79 cout<<"InverseFunc::InverseFunc_Error: _y array not growing"<<endl; 80 throw ParmError("InverseFunc::InverseFunc_Error: _y array not growing"); 81 } 82 83 // define limits 84 _ymin = _y[0]; 85 _ymax = _y[ns-1]; 86 87 } 88 89 InverseFunc::~InverseFunc(void) 90 { 91 } 92 93 int InverseFunc::ComputeLinear(long n,vector<double>& xfcty) 94 { 95 if(n<3) return -1; 96 97 xfcty.resize(n); 98 99 long i1,i2; 100 double x; 101 for(int_4 i=0;i<n;i++) { 102 double y = _ymin + i*(_ymax-_ymin)/(n-1.); 103 find_in_y(y,i1,i2); 104 double dy = _y[i2]-_y[i1]; 105 if(dy==0.) { 106 x = (_x[i2]+_x[i1])/2.; // la fct a inverser est plate! 107 } else { 108 x = _x[i1] + (_x[i2]-_x[i1])/dy * (y-_y[i1]); 109 } 110 xfcty[i] = x; 111 } 112 113 return 0; 114 } 115 116 int InverseFunc::ComputeParab(long n,vector<double>& xfcty) 117 { 118 if(n<3) return -1; 119 120 xfcty.resize(n); 121 122 long i1,i2,i3; 123 double x; 124 for(int_4 i=0;i<n;i++) { 125 double y = _ymin + i*(_ymax-_ymin)/(n-1.); 126 find_in_y(y,i1,i2); 127 // On cherche le 3ieme point selon la position de y / au 2 premiers 128 double my = (_y[i1]+_y[i2])/2.; 129 if(y<my) {i3=i2; i2=i1; i1--;} else {i3=i2+1;} 130 // Protection 131 if(i1<0) {i1++; i2++; i3++;} 132 if(i3==_y.size()) {i1--; i2--; i3--;} 133 // Interpolation parabolique 134 double dy = _y[i3]-_y[i1]; 135 if(dy==0.) { 136 x = (_x[i3]+_x[i1])/2.; // la fct a inverser est plate! 137 } else { 138 double X1=_x[i1]-_x[i2], X3=_x[i3]-_x[i2]; 139 double Y1=_y[i1]-_y[i2], Y3=_y[i3]-_y[i2]; 140 double den = Y1*Y3*dy; 141 double a = (X3*Y1-X1*Y3)/den; 142 double b = (X1*Y3*Y3-X3*Y1*Y1)/den; 143 y -= _y[i2]; 144 x = (a*y+b)*y + _x[i2]; 145 } 146 xfcty[i] = x; 147 } 148 149 return 0; 53 150 } 54 151 -
trunk/Cosmo/SimLSS/geneutils.h
r3120 r3157 7 7 #include "histos.h" 8 8 #include "tvector.h" 9 #include "cspline.h" 9 10 10 11 #include <vector> … … 12 13 namespace SOPHYA { 13 14 15 //---------------------------------------------------- 14 16 class InterpFunc { 15 17 public: … … 19 21 double XMin(void) {return _xmin;} 20 22 double XMax(void) {return _xmax;} 23 inline double X(long i) {return _xmin + i*_dx;} 21 24 22 25 //! Retourne l'element le plus proche de f donnant y=f(x) … … 24 27 { 25 28 x -= _xmin; 26 long i = long(x/_ xlarg*_nm1+0.5); // On prend le "i" le plus proche29 long i = long(x/_dx+0.5); // On prend le "i" le plus proche 27 30 if(i<0) i=0; else if(i>=_nm1) i=_nm1-1; 28 31 return _y[i]; … … 43 46 44 47 protected: 45 double _xmin,_xmax,_xlarg,_dx; 48 double _xmin,_xmax,_dx; 49 long _nm1; // n-1 46 50 vector<double>& _y; 47 long _nm1; // n-1 51 }; 52 53 //---------------------------------------------------- 54 class InverseFunc { 55 public: 56 InverseFunc(vector<double>& x,vector<double>& y); 57 virtual ~InverseFunc(void); 58 int ComputeLinear(long n,vector<double>& xfcty); 59 int ComputeParab(long n,vector<double>& xfcty); 60 double YMin(void) {return _ymin;} 61 double YMax(void) {return _ymax;} 62 protected: 63 inline void find_in_y(double x,long& klo,long& khi) 64 { 65 long k; 66 klo=0, khi=_y.size()-1; 67 while (khi-klo > 1) { 68 k = (khi+klo) >> 1; 69 if (_y[k] > x) khi=k; else klo=k; 70 } 71 } 72 73 vector<double>& _x; 74 vector<double>& _y; 75 double _ymin,_ymax,_dy; 48 76 }; 49 77 50 78 } 51 79 80 //---------------------------------------------------- 52 81 int FuncToHisto(GenericFunc& func,Histo& h,bool logaxex=false); 53 82 int FuncToVec(GenericFunc& func,TVector<r_8>& h,double xmin,double xmax,bool logaxex=false); 54 83 84 //---------------------------------------------------- 55 85 double AngSol(double dtheta,double dphi,double theta0=M_PI/2.); 56 86 double AngSol(double dtheta); 57 87 88 //---------------------------------------------------- 58 89 unsigned long PoissRandLimit(double mu,double mumax=10.); 59 90
Note:
See TracChangeset
for help on using the changeset viewer.