source: Sophya/trunk/Cosmo/SimLSS/schechter.h@ 3621

Last change on this file since 3621 was 3365, checked in by cmv, 18 years ago

1./ grosses modifs de structure pour cmvdefsurv.cc
2./ PoissRandLimit enleve de geneutils.{h,cc} et mis dans srandgen.{h,cc}

cmv 29/10/2007

File size: 2.6 KB
Line 
1#ifndef SCHECHTER_SEEN
2#define SCHECHTER_SEEN
3
4#include "machdefs.h"
5#include "genericfunc.h"
6
7namespace SOPHYA {
8
9class Histo;
10class FunRan;
11
12//-----------------------------------------------------------------------------------
13class Schechter : public GenericFunc {
14public:
15 Schechter(double nstar,double mstar,double alpha);
16 Schechter(Schechter& f);
17 Schechter(void);
18 virtual ~Schechter(void);
19
20 void SetOutValue(unsigned short outvalue=0);
21 unsigned short GetOutValue(void);
22 void SetParam(double nstar,double mstar,double alpha);
23 void GetParam(double& nstar,double& mstar,double& alpha);
24
25 virtual double operator() (double m);
26
27 double Integrate(double massmin,double massmax,int npt=100);
28
29 virtual void Print(void);
30
31protected:
32 double nstar_,mstar_,alpha_;
33 unsigned short outvalue_;
34};
35
36//-----------------------------------------------------------------------------------
37class SchechterMassDist : public AnyDataObj {
38 friend class ObjFileIO<SchechterMassDist>;
39public:
40 SchechterMassDist(Schechter sch,double massmin,double massmax,int nbinmass);
41 SchechterMassDist(void);
42 virtual ~SchechterMassDist(void);
43
44 int GetMassLim(double& massmin,double& massmax);
45 int SetNgalLim(int ngalmax,int ngalmin=1,unsigned long nalea=10000);
46 int GetNgalLim(int& ngalmax,int& ngalmin);
47 int GetNgalLim(void) {return nvalngal_;}
48 Schechter& GetSchechter(void) {return sch_;}
49
50 inline int IndexFrNGal(int ngal) {
51 int i = ngal-ngalmin_;
52 if(nvalngal_<1 || i<0) return -1;
53 if(i>=nvalngal_) return -2; else return i;
54 }
55 inline int NGalFrIndex(int i) {
56 if(nvalngal_<1 || i<0 || i>=nvalngal_) return -1;
57 return ngalmin_+i;
58 }
59
60 Histo GetHmDnDm(void) const;
61 FunRan GetTmDnDm(void) const;
62
63 Histo GetHisto(int i) const;
64 FunRan GetFunRan(int i) const;
65
66 double TirMass(int ngal);
67
68 void Print(void);
69 void PrintStatus(void);
70
71 void WritePPF(string ppfname);
72 void ReadPPF(string ppfname);
73
74protected:
75 void Delete(void);
76
77 Schechter sch_;
78 unsigned short sch_outvalue_;
79
80 double massmin_,massmax_; int nbinmass_;
81 int ngalmin_,ngalmax_,nvalngal_;
82 unsigned long ntrial_dir, ntrial_tab;
83
84 Histo* hmdndm_;
85 FunRan* tirhmdndm_;
86
87 vector<Histo> hmass_;
88 vector<FunRan> tmass_;
89};
90
91//-----------------------------------------------------------------------------------
92bool IsCompatible(Schechter& sch1,Schechter& sch2,double eps=1.e-4);
93
94//-----------------------------------------------------------------------------------
95double Msol2LumiHI(double m);
96double Msol2FluxHI(double m,double d);
97double FluxHI2Msol(double f,double d);
98
99} // Fin du namespace SOPHYA
100
101#endif
Note: See TracBrowser for help on using the repository browser.