Changeset 9226 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 01/17/09 14:52:43 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MMath.cc
r9219 r9226 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.4 3 2009-01-14 12:31:36tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.44 2009-01-17 14:52:37 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 20 20 ! Author(s): Thomas Bretz 3/2004 <mailto:tbretz@astro.uni-wuerzburg.de> 21 21 ! 22 ! Copyright: MAGIC Software Development, 2000-200 522 ! Copyright: MAGIC Software Development, 2000-2009 23 23 ! 24 24 ! … … 50 50 #ifndef ROOT_TComplex 51 51 #include <TComplex.h> 52 #endif 53 54 #ifndef ROOT_TRandom 55 #include <TRandom.h> // gRandom in RndmExp 52 56 #endif 53 57 … … 875 879 e = error.Atof(); 876 880 } 881 882 Double_t MMath::RndmExp(Double_t tau) 883 { 884 // returns an exponential deviate. 885 // 886 // exp( -t/tau ) 887 888 const Double_t x = gRandom->Rndm(); // uniform on ] 0, 1 ] 889 890 return -tau * TMath::Log(x); // convert to exponential distribution 891 } -
trunk/MagicSoft/Mars/mbase/MMath.h
r9219 r9226 87 87 88 88 void Format(Double_t &v, Double_t &e); 89 90 Double_t RndmExp(Double_t tau); 89 91 } 90 92
Note:
See TracChangeset
for help on using the changeset viewer.