00001 00009 00010 #include "stdinc.h" 00011 00012 #ifdef TOOLBOX 00013 00014 main(int argc, char *argv[]) 00015 { 00016 real ml = -1.0, mu = -1.0, x = -2.35, factor = 1; 00017 bool verbose = 0; 00018 00019 check_help(); 00020 00021 extern char *poptarg; 00022 int c; 00023 char* param_string = "e:f:l:L:u:U:vx:"; 00024 00025 while ((c = pgetopt(argc, argv, param_string)) != -1) 00026 switch(c) { 00027 case 'e': 00028 case 'x': x = atof(poptarg); 00029 break; 00030 case 'f': factor = atof(poptarg); 00031 break; 00032 case 'l': 00033 case 'L': ml = atof(poptarg); 00034 break; 00035 case 'u': 00036 case 'U': mu = atof(poptarg); 00037 break; 00038 case 'v': verbose = true; 00039 break; 00040 case '?': params_to_usage(cerr, argv[0], param_string); 00041 get_help(); 00042 exit(1); 00043 } 00044 00045 if (ml <= 0 || mu <= 0) exit(2); 00046 00047 if (mu < ml) { 00048 real tmp = ml; 00049 ml = mu; 00050 mu = tmp; 00051 } 00052 00053 real mbar = 1; 00054 00055 if (ml < mu) { 00056 if (x != -1) { 00057 mbar = ml * (1+x) * (pow(mu/ml, 2+x)-1) 00058 / (pow(mu/ml, 1+x)-1) / (2+x); 00059 } else { 00060 mbar = (mu - ml) / log(mu/ml); 00061 } 00062 } 00063 00064 if (verbose) cout << "ml = " << ml << ", mu = " << mu << ", <m> = "; 00065 00066 cout << mbar*factor << endl; 00067 } 00068 00069 #endif