Changeset 3320 in Sophya for trunk/Cosmo/SimLSS/schechter.h
- Timestamp:
- Sep 5, 2007, 9:58:05 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/schechter.h
r3196 r3320 5 5 #include "genericfunc.h" 6 6 7 namespace SOPHYA { 7 8 8 namespace SOPHYA { 9 class Histo; 10 class FunRan; 9 11 10 12 //----------------------------------------------------------------------------------- … … 13 15 Schechter(double nstar,double mstar,double alpha); 14 16 Schechter(Schechter& f); 17 Schechter(void); 15 18 virtual ~Schechter(void); 19 16 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 17 25 virtual double operator() (double m); 26 27 double Integrate(double massmin,double massmax,int npt=100); 28 18 29 virtual void Print(void); 30 19 31 protected: 20 32 double nstar_,mstar_,alpha_; … … 22 34 }; 23 35 36 //----------------------------------------------------------------------------------- 37 class SchechterMassDist : public AnyDataObj { 38 friend class ObjFileIO<SchechterMassDist>; 39 public: 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 74 protected: 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 24 91 } // Fin du namespace 92 93 //----------------------------------------------------------------------------------- 94 bool IsCompatible(Schechter& sch1,Schechter& sch2,double eps=1.e-4); 25 95 26 96 //-----------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.