/* Vegas, using cuba_inte_info */ void FR_Vegas(cuba_inte_info * cii) { Vegas(cii->ndim, cii->ncomp, cii->integrand, cii->userdata, cii->nvec, cii->epsrel, cii->epsabs, cii->flags, cii->seed, cii->mineval, cii->maxeval, cii->vegas.nstart, cii->vegas.nincrease, cii->vegas.nbatch, cii->vegas.gridno, cii->statefile, &cii->out.neval, &cii->out.fail, cii->out.integral, cii->out.error, cii->out.prob); cii->out.nregions = 0; }
int main() { int comp, nregions, neval, fail; double integral[NCOMP], error[NCOMP], prob[NCOMP]; #if 1 printf("-------------------- Vegas test --------------------\n"); Vegas(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE, SEED, MINEVAL, MAXEVAL, NSTART, NINCREASE, NBATCH, GRIDNO, STATEFILE, SPIN, &neval, &fail, integral, error, prob); printf("VEGAS RESULT:\tneval %d\tfail %d\n", neval, fail); for( comp = 0; comp < NCOMP; ++comp ) printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n", integral[comp], error[comp], prob[comp]); #endif #if 1 printf("\n-------------------- Suave test --------------------\n"); Suave(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE | LAST, SEED, MINEVAL, MAXEVAL, NNEW, FLATNESS, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("SUAVE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); for( comp = 0; comp < NCOMP; ++comp ) printf("SUAVE RESULT:\t%.8f +- %.8f\tp = %.3f\n", integral[comp], error[comp], prob[comp]); #endif #if 1 printf("\n------------------- Divonne test -------------------\n"); Divonne(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE, SEED, MINEVAL, MAXEVAL, KEY1, KEY2, KEY3, MAXPASS, BORDER, MAXCHISQ, MINDEVIATION, NGIVEN, LDXGIVEN, NULL, NEXTRA, NULL, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("DIVONNE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); for( comp = 0; comp < NCOMP; ++comp ) printf("DIVONNE RESULT:\t%.8f +- %.8f\tp = %.3f\n", integral[comp], error[comp], prob[comp]); #endif #if 1 printf("\n-------------------- Cuhre test --------------------\n"); Cuhre(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE | LAST, MINEVAL, MAXEVAL, KEY, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("CUHRE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); for( comp = 0; comp < NCOMP; ++comp ) printf("CUHRE RESULT:\t%.8f +- %.8f\tp = %.3f\n", integral[comp], error[comp], prob[comp]); #endif return 0; }
int main() { // Data Input printf("Reading Data from data.dat \n"); FILE *datos; datos = fopen("data.dat","r"); if (datos != NULL) { fscanf(datos,"%lf %lf",&sqrtSTotal,&maOriginal); ma = maOriginal; fscanf(datos,"%d",&doGaGvgraph); fscanf(datos,"%d %lf",&kindOfXSection,&nominalXSection); fscanf(datos,"%lf %lf %d",&asimNominal,&erroAsi,&maq); fscanf(datos,"%lf %d",&cut,&len); fscanf(datos,"%lf",&ycorte); fscanf(datos,"%d",&TEST); char dummy; fscanf(datos,"%s",&dummy); //------ line fscanf(datos,"%d",&doYCgraph); fscanf(datos,"%lf %lf %d",&gaY,&gvY,&qQgTy); fscanf(datos,"%s",&dummy); //------ line fscanf(datos,"%d",&mttCutgraph); fscanf(datos,"%s",&dummy); //------ line fscanf(datos,"%d %lf",&doBRgraph,&lum); fscanf(datos,"%s",&dummy); //------ line fscanf(datos,"%d",&doXSvsMttgraph); printf("Success! \n \n"); } else { printf("Data.dat not found, falling to default values"); sqrtSTotal = 6000.0e0; asimNominal = 0.2; ma = 1000e0; maq = 1; cut = 0; len = 10; } fclose(datos); printf("**** Top-AntiTop Cross Section Integration **** \n"); /* * Test of different variables for a given combination of * x1, x2, m, s */ if (TEST > 0) { printf(" - - - VARIABLE TESTING - - - \n \n"); double sqrtSTotalTest = 14000; // 14 TeV double mTest = 173.5; // 173 GeV; double gaTest = 0.5, gvTest = 0.5; double maTest = 3000; double x1Test = 0.5; double x2Test = 0.4; double cosTest = 0.6; testfunciones(sqrtSTotalTest, mTest, gaTest, gvTest, maTest, x1Test, x2Test, cosTest); printf(" - - - END OF TEST - - - \n"); } if (cut == 0.0){ corte = 2*mtop; } else { corte = cut; } yc = 9999.9; if (ycorte != 0.0) { yc = ycorte; } // VEGAS data /* * -> Userdata <- * When a 'userdata' is commented, it means its value is assigned * in a future line */ double userdata[13]; double varFlag = 0.0; userdata[0] = TEST; userdata[1] = varFlag; userdata[2] = sqrtSTotal; userdata[3] = mtop; // userdata[4] = ga; // userdata[5] = gv; // userdata[6] = ma; userdata[7] = maq; userdata[8] = yc; userdata[9] = corte; //userdata[10] = qQgT; userdata[11] = kindOfXSection; userdata[12] = 0; userdata[13] = doXSvsMttgraph; // Vegasdata int verbose = 2; int neval, fail; double integral, error[NCOMP], prob[NCOMP]; // Looping World double ga[len], gv[len], asymmetry[len]; ga[0] = 0.0; gv[0] = 0.0; ep = 2.0/len; len++; for (i = 1; i<len; i++){ j = i - 1; ga[i] = ga[j] + ep; gv[i] = gv[j] + ep; } char filename[] = "out/gaVSgv-ma1000TeV-same.agr"; // Template char fileResults[] = "out/resultados.txt"; char fileResultsXS[] = "out/resultadosXS.txt"; char fileBR[] = "out/axBRSignifcancevsMtt.agr"; char fileBRin[] = "out/resultadosBR.txt"; FILE *borrar = fopen(fileBRin,"w+"); fclose(borrar); borrar = fopen(fileResults,"w+"); fclose(borrar); if (doGaGvgraph > 0){ // ga-gv Loop if (ma == 0.0) { loopMass = 4; } else { loopMass = 1; } int byHand; int gQgT = 0; for (byHand = 0; byHand < 2; byHand ++){ userdata[10] = gQgT; /* * The reasoning behind this loop is: I want to have * a version where ga(q) = -ga(t) BUT * I don't want to define that into data.dat * Why? I don't know, it felt right at the moment... */ // if ma = 0, Loop over ma = 2, 2.5 and 3 TeV if (ma == 0.0) ma = 2000.0; for (k = 0; k < loopMass; k++){ userdata[6] = ma; // Creation of file to store the results if (gQgT==1){ // Same means same coupling, then ga(q) = ga(t) sprintf(filename,"out/gaVSgv-ma%0.fTeV-same.agr",ma); if (doGaGvgraph == 2) { sprintf(filename,"out/gaVSgv-ma%0.fTeV-sameSig.agr",ma); } } else if (gQgT == 0) { // Diff means ga(q) = -ga(t) // This can be changed at variables.h sprintf(filename,"out/gaVSgv-ma%0.fTeV-diff.agr",ma); if (doGaGvgraph == 2) { sprintf(filename,"out/gaVSgv-ma%0.fTeV-diffSig.agr",ma); } } gaVSgvFill(filename); for (i = 0; i<len; i++){ gan = ga[i]; userdata[4] = gan; for (j = 0; j < len ; j++){ gvn = gv[j]; userdata[5] = gvn; printf("--- Vegas Integration ---\n"); Vegas(NDIM, NCOMP, (integrand_t) axigluon, userdata, NVEC, EPSREL, EPSABS, verbose, SEED, MINEVAL, MAXEVAL, NSTART,NINCREASE,NBATCH,GRIDNO,STATEFILE, &neval,&fail,&integral,error,prob); printf("For ga %.1f, gv %.1f, ax mass %lf \n",gan, gvn, ma); if (doGaGvgraph == 2) { statisticalSignificance(gan,gvn,nominalXSection,fileResults,filename); } else { asymmetry[j] = asymmetryFromFile(fileResults,nominalXSection); printf("We get a Charge asymmetry of: %lf \n \n \n",asymmetry[j]); } } if (doGaGvgraph != 2) { gaVsgv(gv, gan, asymmetry, asimNominal, erroAsi, len, filename); } } if (ma > 2900.0){ ma += 500.0; } ma += 500.0; } ma = maOriginal; gQgT = 1; } } /* * C is like a neighbour that doesn't have enough space * in his house for all his books and goes to your home * throw everything in your library to the floor * and stores its books there */ if (doYCgraph == 1){ double ycArray[20]; double asymmetry2[20]; userdata[4] = gaY; userdata[5] = gvY; userdata[6] = maOriginal; userdata[10] = qQgTy; ycArray[0] = 0.0; asymmetry2[0] = 0.0; for (i = 1; i < 20; i++) { ycArray[i] = ycArray[i-1] + 0.1; userdata[8] = ycArray[i]; printf("--- Vegas ---> yc <--- Integration ---\n"); Vegas(NDIM, NCOMP, (integrand_t) axigluon, userdata, NVEC, EPSREL, EPSABS, verbose, SEED, MINEVAL, MAXEVAL, NSTART,NINCREASE,NBATCH,GRIDNO,STATEFILE, &neval,&fail,&integral,error,prob); printf("For yc = %f, axigluon mass = %f\n",ycArray[i],ma); asymmetry2[i] = asymmetryFromFile(fileResults,nominalXSection); printf("We get an Asymmetry of: %lf \n \n \n",asymmetry2[i]); } for (i = 1; i <20; i++) { printf("%lf\n",ycArray[i]); } char filenombre[] = "out/ycVsAc.agr"; asVsyc(ycArray, asymmetry2,filenombre); } if (doYCgraph == 1) { if (ycorte == 0.0){ userdata[8] = 9999.9; } else { userdata[8] = ycorte; } } if (mttCutgraph == 1){ mttBRFill(fileBR); // Search for best mtt cut in As and BR userdata[4] = gaY; userdata[5] = gvY; userdata[6] = maOriginal; userdata[10] = qQgTy; userdata[12] = doBRgraph; double mttArray[len]; double asymmetryMtt[len]; mttArray[0] = 340.0; asymmetry[0] = 0; char filename[] = "out/asimetriaFuncionCorte.agr"; // Template //char filenameSig[] = "out/significanciaFucnionCorte.agr"; //Template mttCorteFill(filename); //mttCorteSigFill(filenameSig); char filenameLum[] = "out/luminosidadFuncionMtt.agr"; //Template luminoCorteFill(filenameLum); FILE *file = fopen(filename,"a+"); ep = 5000.0/len; for (i = 1; i < len; i++) { mttArray[i] = mttArray[i-1]+ep; userdata[9] = mttArray[i]; printf("--- Vegas ---> mtt Corte <--- Integration ---\n"); Vegas(NDIM, NCOMP, (integrand_t) axigluon, userdata, NVEC, EPSREL, EPSABS, verbose, SEED, MINEVAL, MAXEVAL, NSTART,NINCREASE,NBATCH,GRIDNO,STATEFILE, &neval,&fail,&integral,error,prob); nominalXSection = BRvsMtt(fileBR, fileBRin, mttArray[i], lum); asymmetryMtt[i] = asymmetryFromFile(fileResults,0.0); lumForFiveSigmasMtt(asymmetryMtt[i], nominalXSection, filenameLum, mttArray[i]); printf("For ma %lf TeV, and a cut of mtt = %lf TeV, we have an asymmetry of %lf\n",ma,mttArray[i],asymmetryMtt[i]); fprintf(file,"%lf %lf\n",mttArray[i],asymmetryMtt[i]); } fclose(file); } // xSection vs mtt graph and asymmetry (everything for just one set of data) if (doXSvsMttgraph == 1){ userdata[4] = gaY; userdata[5] = gvY; userdata[6] = maOriginal; userdata[12] = doBRgraph; userdata[10] = qQgTy; char filenamexS[] = "out/xSectionVsMtt.agr"; // Template xsvsmttFill(filenamexS); borrar = fopen(fileResultsXS,"w+"); fclose(borrar); printf("--- Vegas ---> xSection Vs Mtt <--- Integration ---\n"); Vegas(NDIM, NCOMP, (integrand_t) axigluon, userdata, NVEC, EPSREL, EPSABS, verbose, SEED, MINEVAL, MAXEVAL, NSTART,NINCREASE,NBATCH,GRIDNO,STATEFILE, &neval,&fail,&integral,error,prob); xsvsmttFromFile(fileResultsXS,filenamexS, sqrtSTotal, len); printf("And the asymmetry:\n"); double asymmetryMttFinal = asymmetryFromFile(fileResults,nominalXSection); printf("For ma %lf TeV, we have an asymmetry of %lf \n",ma,asymmetryMttFinal); } if (doXSvsMttgraph == 2){ userdata[4] = gaY; userdata[5] = gvY; userdata[6] = maOriginal; userdata[12] = doBRgraph; userdata[10] = qQgTy; userdata[13] = 1; // This is what inefficiency is about // Standard Model userdata[11] = 0; char filenamexSSM[] = "out/xSectionVsMtt-StandardModel.agr"; // Template borrar = fopen(fileResultsXS,"w+"); fclose(borrar); printf("--- Vegas ---> xSection Vs Mtt (SM) <--- Integration ---\n"); Vegas(NDIM, NCOMP, (integrand_t) axigluon, userdata, NVEC, EPSREL, EPSABS, verbose, SEED, MINEVAL, MAXEVAL, NSTART,NINCREASE,NBATCH,GRIDNO,STATEFILE, &neval,&fail,&integral,error,prob); xsvsmttFromFile(fileResultsXS,filenamexSSM, sqrtSTotal, len); // Beyond Standard Model userdata[11] = 3; char filenamexSBSM[] = "out/xSectionVsMtt-BeyondStandardModel.agr"; // Template borrar = fopen(fileResultsXS,"w+"); fclose(borrar); printf("--- Vegas ---> xSection Vs Mtt (BSM) <--- Integration ---\n"); Vegas(NDIM, NCOMP, (integrand_t) axigluon, userdata, NVEC, EPSREL, EPSABS, verbose, SEED, MINEVAL, MAXEVAL, NSTART,NINCREASE,NBATCH,GRIDNO,STATEFILE, &neval,&fail,&integral,error,prob); xsvsmttFromFile(fileResultsXS,filenamexSBSM, sqrtSTotal, len); // And now we get the two files and get some significances significanceForXsVsMtt(filenamexSSM,filenamexSBSM); } return 0; }
int main(int argc, char **argv) { int next_option; /* A string listing valid short options letters. */ const char * const short_options = "hf:s:c:v:100"; /* An array describing valid long options. */ const struct option long_options[] = { { "help", 0, NULL, 'h' }, { "fun" , 1, NULL, 'f' }, { "seed", 1, NULL, 's' }, { "calc", 1, NULL, 'c' }, { "verbose", 1, NULL, 'v' }, { "ndim", 1, NULL, 1000 }, { "maxeval", 1, NULL, 1001 }, { "epsrel", 1, NULL, 1002 }, { "epsabs", 1, NULL, 1003 }, { NULL, 0, NULL, 0 } }; /* Setting program name */ program_name = argv[0]; int seed = 0; int fun_id = -1; int calc = 0; int verbose = 0; int ndim = 10; long int maxeval = 1e9; double epsrel = 1e-7; double epsabs = 1e-7; int ldxfiven = ndim; do { next_option = getopt_long(argc, argv, short_options, long_options, NULL); switch (next_option) { case 'h': help(stdout, 0); break; case 'f': fun_id = atoi(optarg); break; case 's': seed = atoi(optarg); break; case 'c': calc = atoi(optarg); break; case 'v': verbose = atoi(optarg); break; case 1000: ndim = atoi(optarg); ldxfiven = ndim; break; case 1001: maxeval = atol(optarg); break; case 1002: epsrel = atof(optarg); break; case 1003: epsabs = atof(optarg); break; case '?': /* The user specified an invalid option. */ /* Print usage information to standard error, and exit with exit code one (indicating abnormal termination). */ help(stderr, 1); break; case -1: break; /* Done with options. */ default: /* Something else: unexpected.*/ abort(); } } while (next_option != -1); int comp, nregions, neval, fail; double integral[NCOMP], error[NCOMP], prob[NCOMP]; if (verbose > 1) { printf("*** numcal parameters **********\n"); printf("* fun = %d\n", fun_id); printf("* seed = %d\n", seed); printf("* calc = %d\n", calc); printf("* ndim = %d\n", ndim); printf("* maxeval = %ld\n", maxeval); printf("* epsrel = %e\n", epsrel); printf("* epsabs = %e\n", epsabs); printf("********************************\n"); } SetIntegrand(fun_id); switch (calc) { case 0: printf("-------------------- Vegas test --------------------\n"); Vegas(ndim, NCOMP, gIntergand, USERDATA, NVEC, epsrel, epsabs, verbose, seed, MINEVAL, maxeval, NSTART, NINCREASE, NBATCH, GRIDNO, STATEFILE, SPIN, &neval, &fail, integral, error, prob); printf("VEGAS RESULT:\tneval %d\tfail %d\n", neval, fail); for (comp = 0; comp < NCOMP; ++comp) printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n", integral[comp], error[comp], prob[comp]); break; case 1: printf("-------------------- Suave test --------------------\n"); Suave(ndim, NCOMP, gIntergand, USERDATA, NVEC, epsrel, epsabs, verbose | LAST, seed, MINEVAL, maxeval, NNEW, FLATNESS, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("SUAVE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); for (comp = 0; comp < NCOMP; ++comp) printf("SUAVE RESULT:\t%.8f +- %.8f\tp = %.3f\n", integral[comp], error[comp], prob[comp]); break; case 2: printf("\n------------------- Divonne test -------------------\n"); Divonne(ndim, NCOMP, gIntergand, USERDATA, NVEC, epsrel, epsabs, verbose, seed, MINEVAL, maxeval, KEY1, KEY2, KEY3, MAXPASS, BORDER, MAXCHISQ, MINDEVIATION, NGIVEN, ldxfiven, NULL, NEXTRA, NULL, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("DIVONNE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); for (comp = 0; comp < NCOMP; ++comp) printf("DIVONNE RESULT:\t%.8f +- %.8f\tp = %.3f\n", integral[comp], error[comp], prob[comp]); break; case 3: printf("\n-------------------- Cuhre test --------------------\n"); Cuhre(ndim, NCOMP, gIntergand, USERDATA, NVEC, epsrel, epsabs, verbose | LAST, MINEVAL, maxeval, KEY, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("CUHRE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); for (comp = 0; comp < NCOMP; ++comp) printf("CUHRE RESULT:\t%.8f +- %.8f\tp = %.3f\n", integral[comp], error[comp], prob[comp]); break; default: help(stderr, 2); } return EXIT_SUCCESS; }
///////////////////////////// //// -- Main Function -- //// ///////////////////////////// int main() { // Histogram for values // const double x1nBins = 0; const double x2nBins = 0; const double x1Min = 0.49; const double x1Max = 0.51; const double x2Min = 0.00; const double x2Max = 0.01; // const double x2Min = 0.49; // const double x2Max = 0.51; const double x1BinWidth = (x1Max-x1Min)/x1nBins; const double x2BinWidth = (x2Max-x2Min)/x2nBins; const double thetaMin = x1Min*M_PI; const double thetaMax = x1Max*M_PI; const double phiMin = x2Min*2.0*M_PI; const double phiMax = x2Max*2.0*M_PI; TH2D *hist_Gamma_Combined_full_pol_1 = new TH2D ("Gamma_Combined_full_pol_1",";#theta [rad];#phi [rad];value",x1nBins,thetaMin,thetaMax,x2nBins,phiMin,phiMax); TH2D *hist_Gamma_Combined_full_pol_2 = new TH2D ("Gamma_Combined_full_pol_2",";#theta [rad];#phi [rad];value",x1nBins,thetaMin,thetaMax,x2nBins,phiMin,phiMax); TH2D *hist_Gamma_Prod_BR_full = new TH2D ("Gamma_Prod_BR_full",";#theta [rad];#phi [rad];value",x1nBins,thetaMin,thetaMax,x2nBins,phiMin,phiMax); // xAB1 = 0.9; // xAB2 = 0.9; printf("\n"); printf("##########################################################\n"); printf("### --- Phi -> 2f -> 6f, single branch integration --- ###\n"); printf("##########################################################\n"); printf("\n"); P = decay.P; P->SetPxPyPzE(Px,Py,Pz,E); decay.SetBitBoostBack( BitBoostBack ); printf("\n"); decay.SetTag("DecayChain126"); pA = decay.pA; pB = decay.pB; pA1 = decay.pA1; pA2 = decay.pA2; pA3 = decay.pA3; pB1 = decay.pB1; pB2 = decay.pB2; pB3 = decay.pB3; h_tautau.SetName("h_tautau"); taum.SetName("taum"); taup.SetName("taup"); c7_568.SetName("c7_568"); c_amp_htautau.SetName("c_amp_htautau"); c_amp_dec_taum.SetName("c_amp_dec_taum"); c_amp_dec_taup.SetName("c_amp_dec_taup"); c_amp_7_568.SetName("c_amp_7_568"); c_amp_res.SetName("c_amp_res"); // Fortran COMMON blocks masses_.rmtau = m_tau; couplings_.wcl = 1.0; couplings_.gh_tautau = 1.0; amplitudes_.rh_6f_tautau = 0.0; amplitudes_.rh_6f_taum = 0.0; amplitudes_.rh_6f_taup = 0.0; amplitudes_.rh_6f_res = 0.0; amplitudes_.rh_6f_res_nwa = 0.0; int comp, nregions, neval, fail; cubareal integral[NCOMP], error[NCOMP], prob[NCOMP]; // Test suite #if 1 printf("\n"); printf("###########################################################\n"); printf("### --- Testing DecayChain126 phase space generator --- ###\n"); printf("###########################################################\n"); printf("\n"); const double xAB1_ = xAB1; const double xAB2_ = xAB2; const double xA1_ = 0.50; const double xA2_ = 0.50; const double xA3_ = 0.50; const double xA4_ = 0.50; const double xA5_ = 0.50; const double xB1_ = 0.50; const double xB2_ = 0.50; const double xB3_ = 0.50; const double xB4_ = 0.50; const double xB5_ = 0.50; decay.SetPhaseSpace( xAB1_, xAB2_, xA1_, xA2_, xA3_, xA4_, xA5_, xB1_, xB2_, xB3_, xB4_, xB5_); printf("xAB1_ : %.2f\n", xAB1_); printf("xAB2_ : %.2f\n", xAB2_); printf("xA1_ : %.2f\n", xA1_); printf("xA2_ : %.2f\n", xA2_); printf("xA3_ : %.2f\n", xA3_); printf("xA4_ : %.2f\n", xA4_); printf("xA5_ : %.2f\n", xA5_); printf("xB1_ : %.2f\n", xB1_); printf("xB2_ : %.2f\n", xB2_); printf("xB3_ : %.2f\n", xB3_); printf("xB4_ : %.2f\n", xB4_); printf("xB5_ : %.2f\n", xB5_); printf("\n"); // Convert to Minkowski metric for (int i = 0; i < 4; i++) { pA_[e2m[i]] = (*pA)[i]; pB_[e2m[i]] = (*pB)[i]; pA1_[e2m[i]] = (*pA1)[i]; pA2_[e2m[i]] = (*pA2)[i]; pA3_[e2m[i]] = (*pA3)[i]; pB1_[e2m[i]] = (*pB1)[i]; pB2_[e2m[i]] = (*pB2)[i]; pB3_[e2m[i]] = (*pB3)[i]; } decay.DisplayMomenta(); double PSWeight_A123 = decay.DecayA123->GetPhaseSpaceWeight(xA1_, xA2_, xA3_, xA4_, xA5_); // H(p) -> e-(p3) vebar(p4) vmu(p5) mu+(p6) vtau(p7) vtaubar(p8) // double rh_6f_val = rh_6f_(p3_,p4_,p5_,p6_,p7_,p8_); // rh_6f_(pA1_,pA2_,pB2_,pB1_,pA3_,pB3_); h_tautau.ReadInCMatrix_2_2(taumatrices_.ch_tautau); taum.ReadInCMatrix_2_2( taumatrices_.cdec_taum); taup.ReadInCMatrix_2_2( taumatrices_.cdec_taup); c7_568.ReadInCMatrix_2_2( taumatrices_.c7_568); c_amp_htautau.ReadInCMatrix_2_2( tau_amplitudes_.c_amp_htautau ); c_amp_dec_taum.ReadInCMatrix_2_2( tau_amplitudes_.c_amp_dec_taum ); c_amp_dec_taup.ReadInCMatrix_2_2( tau_amplitudes_.c_amp_dec_taup ); c_amp_7_568.ReadInCMatrix_2_2( tau_amplitudes_.c_amp_7_568 ); c_amp_res.ReadInCMatrix_2_2( tau_amplitudes_.c_amp_res ); h_tautau.Show(); taum.Show(); taup.Show(); c7_568.Show(); c_amp_htautau.Show(); c_amp_dec_taum.Show(); c_amp_dec_taup.Show(); c_amp_7_568.Show(); c_amp_res.Show(); // decay.DisplayAllInfo(); #endif // theta,phi sweep // Start of loop // for (int x1Bin = 0; x1Bin < x1nBins; x1Bin++ ) // for (int x2Bin = 0; x2Bin < x2nBins; x2Bin++ ) // { // // xAB1 = x1Min + x1BinWidth*x1Bin; // xAB2 = x2Min + x2BinWidth*x2Bin; printf("xAB1: %.2f\n", xAB1); printf("xAB2: %.2f\n", xAB2); #if 1 printf("-------------------- Vegas test --------------------\n"); // Calling Vegas Vegas(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE, SEED, MINEVAL, MAXEVAL, NSTART, NINCREASE, NBATCH, GRIDNO, STATEFILE, SPIN, &neval, &fail, integral, error, prob); printf("VEGAS RESULT:\tneval %d\tfail %d\n", neval, fail); printf("Component 0:\n"); printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[0], (double)error[0], (double)prob[0]); printf("Component 1:\n"); printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[1], (double)error[1], (double)prob[1]); printf("Component 2:\n"); printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[2], (double)error[2], (double)prob[2]); printf("Component 3:\n"); printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[3], (double)error[3], (double)prob[3]); printf("Component 4:\n"); printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[4], (double)error[4], (double)prob[4]); printf("Component 5:\n"); printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[5], (double)error[5], (double)prob[5]); #endif #if 0 printf("\n-------------------- Suave test --------------------\n"); Suave(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE | LAST, SEED, MINEVAL, MAXEVAL, NNEW, NMIN, FLATNESS, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("SUAVE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); printf("Component 0:\n"); printf("SUAVE RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[0], (double)error[0], (double)prob[0]); printf("Component 1:\n"); printf("SUAVE RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[1], (double)error[1], (double)prob[1]); printf("Component 2:\n"); printf("SUAVE RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[2], (double)error[2], (double)prob[2]); printf("Component 3:\n"); printf("SUAVE RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[3], (double)error[3], (double)prob[3]); #endif #if 0 printf("\n------------------- Divonne test -------------------\n"); Divonne(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE, SEED, MINEVAL, MAXEVAL, KEY1, KEY2, KEY3, MAXPASS, BORDER, MAXCHISQ, MINDEVIATION, NGIVEN, LDXGIVEN, NULL, NEXTRA, NULL, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("DIVONNE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); for( comp = 0; comp < NCOMP; ++comp ) printf("DIVONNE RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[comp], (double)error[comp], (double)prob[comp]); #endif #if 0 printf("\n-------------------- Cuhre test --------------------\n"); Cuhre(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE | LAST, MINEVAL, MAXEVAL, KEY, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("CUHRE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); for( comp = 0; comp < NCOMP; ++comp ) printf("CUHRE RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[comp], (double)error[comp], (double)prob[comp]); #endif // Get the results of the integrals integral_combined_pol_1 = integral[0]; integral_combined_pol_2 = integral[1]; integral_htautau_pol_1 = integral[2]; integral_htautau_pol_2 = integral[3]; integral_taudecay_pol_1 = integral[4]; integral_taudecay_pol_2 = integral[5]; //////////////////////////////////////////////////////////////////////////// // -- Cross-checking the Gamma(tau) value result with the textbook formula // (similar to the case of muon decay) double integral_taudecay_unpol = (integral_taudecay_pol_1 + integral_taudecay_pol_2); double DecayA123_PSConst = decay.DecayA123->GetPSConst(); double Gamma_tau_unpol_woutgamma = 4.0 * integral_taudecay_unpol * DecayA123_PSConst * G_Fermi * G_Fermi / mA / 2.0 ; double Gamma_tau_pol_1_woutgamma = 8.0 * integral_taudecay_pol_1 * DecayA123_PSConst * G_Fermi * G_Fermi / mA / 2.0 ; double Gamma_tau_pol_2_woutgamma = 8.0 * integral_taudecay_pol_2 * DecayA123_PSConst * G_Fermi * G_Fermi / mA / 2.0 ; double ratio_Gamma_tau_unpol_woutgamma_result_per_expected = Gamma_tau_unpol_woutgamma/Gamma_formula; double ratio_Gamma_tau_pol_1_woutgamma_result_per_expected = Gamma_tau_pol_1_woutgamma/Gamma_formula; double ratio_Gamma_tau_pol_2_woutgamma_result_per_expected = Gamma_tau_pol_2_woutgamma/Gamma_formula; printf("\n"); printf("############################################################\n"); printf("### Decay process: h --> A + B --> (a1 a2 a3) (b1 b2 b3) ###\n"); printf("############################################################\n"); printf("\n"); printf("\n"); printf("--------------------------\n"); printf("--- Physical constants ---\n"); printf("--------------------------\n"); printf("\n"); printf("hbar: %12.6e [GeV s]\n", hbar); printf("c: %12.6e [m/s]\n", c); printf("hbar*c: %12.6e [GeV fm]\n", hbar_c); printf("G_Fermi: %12.6e [GeV^{-2}]\n", G_Fermi); printf("m (tau): %12.6e [GeV]\n", m_tau); printf("\n"); printf("\n"); printf("##################################################\n"); printf("### --- h -> (tau) (tau) consistency check --- ###\n"); printf("#################################################\n"); printf("# Checking 'M(h-> tau tau)' value\n"); //double integral_htautau_unpol = (integral_htautau_pol_1 + integral_htautau_pol_2); double integral_htautau_unpol = (integral_htautau_pol_1 + integral_htautau_pol_2); double htautau_exp = 0.5*((2*M*M)-(8*mA*mA)); double htautau_ratio = (integral_htautau_unpol) /htautau_exp; printf("\n"); printf("pol_1 = [0][0]; pol_2 = [0][1]"); printf("integral_htautau_pol_1: %12.6f [a.u.]\n", integral_htautau_pol_1); printf("integral_htautau_pol_2: %12.6f [a.u.]\n", integral_htautau_pol_2); printf("integral_htautau_unpol: %12.6f [a.u.]\n", integral_taudecay_unpol); printf("\n"); printf("\n"); printf("expected amplitude: 0.5*(2*(M_h)^(2) - 8*(m_tau)^2)\n"); printf("\n"); printf("h tautau amplitude value: %12.6f\n", integral_htautau_unpol); printf("expected amplitude value: %12.6f\n", htautau_exp); printf("\n"); printf("ratio:\n"); printf("ampl/expected: %12.6e\n", htautau_ratio); printf("\n"); printf("\n"); printf("############################################\n"); printf("### --- Gamma(tau) consistency check --- ###\n"); printf("############################################\n"); printf("# Comparing 'Gamma(tau) numerical int. result' with\n"); printf("# the 'Gamma(tau) textbook formula'.\n"); printf("\n"); printf("Unpolarized case\n"); printf("integral_taudecay_unpol value: %12.6f\n", integral_taudecay_unpol); printf("integral_taudecay_pol_1 value: %12.6f\n", integral_taudecay_pol_1); printf("integral_taudecay_pol_2 value: %12.6f\n", integral_taudecay_pol_2); printf("mA (daughter particle A): %12.6f [GeV]\n", mA); printf("\n"); printf("Textbook result of the integration:\n"); printf("Gamma(tau): G_Fermi^{2}*m_tau^{5}/(192*pi^{3})\n"); printf("\n"); printf("Our result of the integration:\n"); printf("Gamma(tau): 4*integral_taudecay * G_Fermi * G_Fermi / mA / 2.0\n"); printf("\n"); printf("Gamma(tau) textbook: %12.6e [GeV]\n", Gamma_formula); printf("Gamma(tau) unpolarized our result w/o gamma factor: %12.6e [GeV]\n", Gamma_tau_unpol_woutgamma); printf("ratio [Gamma(tau)_unpol_result_woutgamma / Gamma(tau)_expected]: %12.6e\n", ratio_Gamma_tau_unpol_woutgamma_result_per_expected); printf("ratio [Gamma(tau)_pol_1_result_woutgamma / Gamma(tau)_expected]: %12.6e\n", ratio_Gamma_tau_pol_1_woutgamma_result_per_expected); printf("ratio [Gamma(tau)_pol_2_result_woutgamma / Gamma(tau)_expected]: %12.6e\n", ratio_Gamma_tau_pol_2_woutgamma_result_per_expected); printf("\n"); printf("\n"); //////////////////////////////////////////////////////////////////////////// // -- // -- // Note: These Gamma's are not weighted with the appropriate couplings // and several other factors might be missing double Gamma_Combined_redu_pol_1 = 2*integral_combined_pol_1*(M_PI/(mA*integral_taudecay_unpol)); double Gamma_Combined_redu_pol_2 = 2*integral_combined_pol_2*(M_PI/(mA*integral_taudecay_unpol)); double Gamma_Combined_full_pol_1 = 2*integral_combined_pol_1*(4.0* DecayA123_PSConst * G_Fermi * G_Fermi )*(M_PI/(mA*Gamma_tau_unpol_woutgamma)); double Gamma_Combined_full_pol_2 = 2*integral_combined_pol_2*(4.0* DecayA123_PSConst * G_Fermi * G_Fermi )*(M_PI/(mA*Gamma_tau_unpol_woutgamma)); //double Gamma_Combined_NWA = integral_combined*(1.0/(integral_taudecay)); double Gamma_Prod_BR_redu = integral_htautau_unpol*M_PI/mA; double Gamma_Prod_BR_full = integral_htautau_unpol*2.0*M_PI; printf("#################################################################\n"); printf("### --- Comparison of 'Combined result' and '(Prod)x(BR)' --- ###\n"); printf("#################################################################\n"); printf("# Here we compare the result of the following two formulae:\n"); printf("# o A) 'Combined result'\n"); printf("# (Formula A) = |M_{combined}|^2 * (pi)/(Gamma(tau)*m(tau))\n"); printf("# where Gamma(tau) is the numerical integration result.\n"); printf("# o B) '(Production) x (BR)'\n"); printf("# (Formula B) = 2.0*pi |M_{prod}|^2 * BR(tau->3f)\n"); printf("# Both of them use NWA.\n"); printf("# These two formulae are integrated over the phase space\n"); printf("# of the daughter particle of A (a1, a2 and a3).\n"); printf("\n"); printf("integral_combined_pol_1: %12.6f [a.u.]\n", integral_combined_pol_1); printf("integral_combined_pol_2: %12.6f [a.u.]\n", integral_combined_pol_2); printf("integral_htautau_pol_1: %12.6f [a.u.]\n", integral_htautau_pol_1); printf("integral_htautau_pol_2: %12.6f [a.u.]\n", integral_htautau_pol_2); printf("integral_htautau_unpol: %12.6f [a.u.]\n", integral_htautau_unpol); printf("integral_taudecay_pol_1: %12.6f [a.u.]\n", integral_taudecay_pol_1); printf("integral_taudecay_pol_2: %12.6f [a.u.]\n", integral_taudecay_pol_2); printf("mA: %12.6f [GeV]\n", mA); printf("\n"); printf("----------------------------------------------\n"); printf("--- With reduced calculation on Gamma(tau) ---\n"); printf("-----------------------------------------------\n"); printf(" no normalization to Gamma(tau) and |M| with\n"); printf(" coupling constants, phase space constants, etc.\n"); printf(" i.e taking directly the 'integral_taudecay' value\n"); printf(" Note: The ratios should be equal to the 'full calculation' case!\n"); printf("\n"); printf("Gamma_Combined_redu_pol_1 value: %12.6e [a.u.]\n", Gamma_Combined_redu_pol_1); printf("Gamma_Combined_redu_pol_2 value: %12.6e [a.u.]\n", Gamma_Combined_redu_pol_2); printf("Gamma_Prod_BR_redu value: %12.6e [a.u.]\n", Gamma_Prod_BR_redu); printf("\n"); printf("ratios:\n"); printf("(Gamma_Combined_redu_pol_1)/(Gamma_Prod_BR_redu): %12.6e [a.u.]\n", (Gamma_Combined_redu_pol_1)/Gamma_Prod_BR_redu); printf("(Gamma_Combined_redu_pol_2)/(Gamma_Prod_BR_redu): %12.6e [a.u.]\n", (Gamma_Combined_redu_pol_2)/Gamma_Prod_BR_redu); printf("\n"); printf("\n"); printf("-------------------------------------------\n"); printf("--- With full calculation on Gamma(tau) ---\n"); printf("-------------------------------------------\n"); printf(" all normalization to Gamma(tau) and |M| with\n"); printf(" coupling constants, phase space constants, etc.\n"); printf(" i.e taking directly the 'Gamma(tau)' value\n"); printf(" Note: The ratios should be equal to the 'reduced calculation' case!\n"); printf("\n"); printf("Gamma_Combined_full_pol_1 value: %12.6e [a.u.]\n", Gamma_Combined_full_pol_1); printf("Gamma_Combined_full_pol_2 value: %12.6e [a.u.]\n", Gamma_Combined_full_pol_2); printf("Gamma_Prod_BR_full value: %12.6e [a.u.]\n", Gamma_Prod_BR_full); printf("\n"); printf("ratios:\n"); printf("(Gamma_Combined_full_pol_1)/(Gamma_Prod_BR_full): %12.6e [a.u.]\n", (Gamma_Combined_full_pol_1)/Gamma_Prod_BR_full); printf("(Gamma_Combined_full_pol_2)/(Gamma_Prod_BR_full): %12.6e [a.u.]\n", (Gamma_Combined_full_pol_2)/Gamma_Prod_BR_full); // --- Expected result if the weight is only PSWeight --- /// //// Get phase space constant from the DecayChain126 class ////double PSConst = decay.DecayA123->GetPSConst(); // //// Expected value in the massless scenario: //double threebodyA123 = mA*mA/(256.0*M_PI*M_PI*M_PI); //double expected_result = threebodyA123 ; // // printf("\n"); // printf(" final result: %10.10e\n", result); // printf("Expexted result in massless (m1 = m2 = m3 = 0) scenario: %10.10e\n", expected_result); // printf(" their ratio: %10.10f\n", result/expected_result); // printf("\n"); // double PSWeight_B123 = decay.DecayB123->GetPhaseSpaceWeight(xB1, xB2, xB3, xB4, xB5); // printf("PSWeight_B123 = %10.5e \n", PSWeight_B123); /////////////////// // --- Root --- // /////////////////// // hist_Gamma_Combined_full_pol_1 -> SetBinContent( (x1nBins-x1Bin), 1+x2Bin, Gamma_Combined_full_pol_1); // hist_Gamma_Combined_full_pol_2 -> SetBinContent( (x1nBins-x1Bin), 1+x2Bin, Gamma_Combined_full_pol_2); // hist_Gamma_Prod_BR_full -> SetBinContent( (x1nBins-x1Bin), 1+x2Bin, Gamma_Prod_BR_full ); // End of loops // } // hist_Gamma_Combined_full_pol_1 -> Divide( hist_Gamma_Prod_BR_full); // hist_Gamma_Combined_full_pol_2 -> Divide( hist_Gamma_Prod_BR_full); // // gStyle->SetOptStat(0); // TCanvas canv ("canvas","canv", 800, 600); // // canv.SetRightMargin(0.20); // // hist_Gamma_Combined_full_pol_1 -> Draw("COLZ"); //// hist_Gamma_Combined_full_pol_2 //// hist_Gamma_Prod_BR_full // // canv.SaveAs("histo_Gamma_Combined_full_pol1.pdf"); // // canv.Clear(); // hist_Gamma_Combined_full_pol_2 -> Draw("COLZ"); // canv.SaveAs("histo_Gamma_Combined_full_pol2.pdf"); // // canv.Clear(); // hist_Gamma_Prod_BR_full -> Draw("COLZ"); // canv.SaveAs("histo_Gamma_Prod_BR_full.pdf"); //////////////////////////////////////////// //hist_Gamma_Combined_full_pol_1 -> SaveAs("./hist_Gamma_Combined_full_pol_1.pdf"); //hist_Gamma_Combined_full_pol_2 -> SaveAs("./hist_Gamma_Combined_full_pol_2.pdf"); //hist_Gamma_Prod_BR_full -> SaveAs("./hist_Gamma_Prod_BR_full.pdf"); return 0; }
int main() { // -- Declaring Cuba variables -- // int comp, nregions, neval, fail; cubareal integral[NCOMP], error[NCOMP], prob[NCOMP]; // -- ThreeBodyDecay initialization-- // muon.SetMotherMPThetaPhi(M,muon_p,muon_theta,muon_phi); muon.SetBitBoostBack(BitBoostBack); // -- Set up pointers to the momenta P = muon.P; p1 = muon.p[0]; p2 = muon.p[1]; p3 = muon.p[2]; // -- Get muon kinematics double P_gamma = P->Gamma(); double P_beta = P->Beta(); double P_M = P->M(); double P_MomMag = P->P(); // -- Polarization vector -- // // -- Custom vector construction k0_custom = TLorentzVector(1.0, 0.0, 0.0, 1.0); // k0_custom = TLorentzVector(3, 2, 0.0, 1.0); // k0_custom = TLorentzVector(1.0, 0.0, 0.0, 1.0); double alpha = 1; // -- Phyicsal vector construction k0_physical[3] = 1; for (int i = 0; i<3; i++) { k0_physical[i] = (*P)[i]/P_MomMag; } for (int nu = 0; nu<4; nu++) { k0_physical[nu] = alpha*k0_physical[nu]/(P_M*P_gamma*(1+P_beta)); } // -- Choosing k0 auxiliary vector if ( k0_flag == 1) { k0 = k0_custom; } if ( k0_flag == 2) { k0 = k0_physical; } // Get pk0 scalar product double Pk0 = P->Dot(k0); // Custom spin polarization vector with p and k0 if (polvec_flag == 1) { for(int nu = 0; nu<4; nu++) { polvec[nu] = ( (*P)[nu]/M) - (M/Pk0)*k0[nu]; } } // Helicity spin ampltiude vector // Note: // This should be equivalent to the custom pol. vector // when choosing physical k0 // Default: if (polvec_flag == 2) { TVector3 phat(1.0,0.0,0.0); phat.SetPhi(phat_phi); phat.SetTheta(phat_theta); polvec = TLorentzVector(phat,P->Beta()); for(int nu = 0; nu<4; nu++) { polvec[nu] = polvec[nu]*P_gamma; } } phat34 = TVector3(1.0,0.0,0.0); phat34.SetPhi(phat34_phi); phat34.SetTheta(phat34_theta); polvec34 = TLorentzVector(phat34,0); ///////////////////////////////////////////////////////////////////////// #if 1 printf("-------------------- Vegas test --------------------\n"); Vegas(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE, SEED, MINEVAL, MAXEVAL, NSTART, NINCREASE, NBATCH, GRIDNO, STATEFILE, SPIN, &neval, &fail, integral, error, prob); printf("VEGAS RESULT:\tneval %d\tfail %d\n", neval, fail); comp = 0; printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[comp], (double)error[comp], (double)prob[comp]); #endif #if 0 printf("\n-------------------- Suave test --------------------\n"); Suave(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE | LAST, SEED, MINEVAL, MAXEVAL, NNEW, NMIN, FLATNESS, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("SUAVE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); comp = 0; printf("SUAVE RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[comp], (double)error[comp], (double)prob[comp]); #endif #if 0 printf("\n------------------- Divonne test -------------------\n"); Divonne(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE, SEED, MINEVAL, MAXEVAL, KEY1, KEY2, KEY3, MAXPASS, BORDER, MAXCHISQ, MINDEVIATION, NGIVEN, LDXGIVEN, NULL, NEXTRA, NULL, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("DIVONNE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); for( comp = 0; comp < NCOMP; ++comp ) printf("DIVONNE RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[comp], (double)error[comp], (double)prob[comp]); #endif #if 0 printf("\n-------------------- Cuhre test --------------------\n"); Cuhre(NDIM, NCOMP, Integrand, USERDATA, NVEC, EPSREL, EPSABS, VERBOSE | LAST, MINEVAL, MAXEVAL, KEY, STATEFILE, SPIN, &nregions, &neval, &fail, integral, error, prob); printf("CUHRE RESULT:\tnregions %d\tneval %d\tfail %d\n", nregions, neval, fail); for( comp = 0; comp < NCOMP; ++comp ) printf("CUHRE RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[comp], (double)error[comp], (double)prob[comp]); #endif double result = (double)integral[comp]; // If result is unpolarized divide by 2.0 if ( (ampltiude == 0) || (ampltiude == 34) ) { result = result / 2.0;} double PSConst = muon.GetPSConst(); double result_wogamma = result * PSConst * G_Fermi * G_Fermi / M / 2.0 ; result = result * PSConst * G_Fermi * G_Fermi / P->E() / 2.0 ; double ratio_formula = result/gamma_formula; double ratio_PDG = result/gamma_PDG; double tau = hbar/result; double ctau = tau*c; double tau_wogamma = hbar/result_wogamma; double ctau_wogamma = tau_wogamma*c; // -- Displaying info -- // printf("\n"); printf("###############################################\n"); printf("### --- Muon decay lifetime calculation --- ###\n"); printf("###############################################\n"); printf("\n"); printf("--------------------------\n"); printf("--- Physical constants ---\n"); printf("--------------------------\n"); printf("\n"); printf("hbar: %12.6e [GeV s]\n", hbar); printf("c: %12.6e [m/s]\n", c); printf("hbar*c: %12.6e [GeV fm]\n", hbar_c); printf("G_Fermi: %12.6e [GeV^{-2}]\n", G_Fermi); printf("\n"); printf("Muon constants:\n"); printf("m (muon): %12.6f [GeV]\n", M); printf("c_tau: %12.6e [fm]\n", c_tau_muon); printf("Gamma(PDG) = hbarc/c_tau = %12.6e [GeV]\n", gamma_PDG); printf("\n"); printf("Other masses:\n"); printf("m (elec): %12.6f [GeV]\n", m1); printf("m (nu_e): %12.6f [GeV]\n", m2); printf("m (nu_m): %12.6f [GeV]\n", m3); printf("\n"); printf("-------------------------\n"); printf("--- Decay process ---\n"); printf("-------------------------\n"); printf("\n"); printf("(muon)- ---> (electron)- (nu_mu) (nu_electronbar)\n"); printf(" p ---> q k k' \n"); printf(" p ---> q k1 k2 \n"); printf(" P ---> p1 p2 p3 \n"); printf("\n"); printf("-------------------------\n"); printf("--- Configuration ---\n"); printf("-------------------------\n"); printf("\n"); printf("############\n"); printf("### Muon ###\n"); printf("############\n"); printf("\n"); printf("|mom|: %12.6f [GeV/c]\n", muon_p); printf("theta: %12.6f [rad]\n", muon_theta); printf("phi: %12.6f [rad]\n", muon_phi); printf("gamma: %12.6f \n", P->Gamma()); printf("beta: %12.6f \n", P->Beta()); printf("\n"); printf("Momentum:\n"); displayTLorentzVector(P); printf("\n"); printf("Unitvector pointing in the direction of momentum:\n"); printf("x: %12.6f\n", (*P)[0]/P->P()); printf("y: %12.6f\n", (*P)[1]/P->P()); printf("z: %12.6f\n", (*P)[1]/P->P()); printf("\n"); printf("################################\n"); printf("### Spin Polarization vector ###\n"); printf("################################\n"); printf("### - Denoted by s^{mu} \n"); printf("\n"); if ( (ampltiude == -1) || (ampltiude == 0) || (ampltiude == 1) ) { if ( polvec_flag == 1 ) { printf("polvec_flag: %d\n", polvec_flag); printf("Spin polarization defined with auxiliary vector k0:\n"); printf("s^{mu} = P^{mu}/M - (m/Pk0)*k0^{mu}\n"); printf("\n"); printf("k0_flag: %d\n", k0_flag); if ( k0_flag == 1 ) { printf("Custom k0:\n"); } if ( k0_flag == 2 ) { printf("Choice of k0, yielding helicity polarization vector.\n"); printf("Physical k0:\n"); } displayTLorentzVector(&k0); printf("\n"); } if ( polvec_flag == 2 ) { printf("polvec_flag: %d\n", polvec_flag); printf("Spin polarization vector = helicity polarization vector\n"); printf("s^{mu} = ( |pvec|^2 , p0 pvec) / (m |pvec|)) = \n"); printf(" = gamma (beta,phat vector)\n"); printf("\n"); } printf("Spin polarization vector components:\n"); displayTLorentzVector(&polvec); } if ( (ampltiude == 3) || (ampltiude == 4) || (ampltiude == 34) ) { printf("Spin polarization vector defined in rest frame of the muon\n"); printf("s^{mu} = (0,phat34)\n"); printf("\n"); printf("where the phat34 is pointing towards:\n"); printf("phat34 theta: %12.6f\n", phat34_theta); printf("phat34 phi: %12.6f\n", phat34_phi); printf("\n"); printf("phat34 components:\n"); printf("x: %12.6f\n", phat34[0]); printf("y: %12.6f\n", phat34[1]); printf("z: %12.6f\n", phat34[2]); } printf("\n"); printf("--------------------------\n"); printf("--- Consistency checks ---\n"); printf("--------------------------\n"); printf("\n"); printf("- Lorentz scalar product (ps) = 0 (orthogonality check)\n"); printf("(ps): %12.6e (should give really small value)\n", (*P)*polvec); printf("\n"); printf("- k0^{2} = 0 (massless auxuliary vector)\n"); printf("(k0)^2: %12.6e (should give really small value)\n", k0.M2()); printf("\n"); printf("------------------\n"); printf("--- Ampltidude ---\n"); printf("------------------\n"); printf("\n"); printf("Amplitude formula chosen: ---> %d <--- \n", ampltiude); printf("\n"); printf("Amplitude formula list:\n"); printf("(No): ---------------------- Formula ---------------------------- (polarization)\n"); printf("- Default case: \n"); printf(" (0): 128 * (p k') * (q k) (unpolarized)\n"); printf("(-1): 64 * (p k') * (q k) + 64 * M * (s k') * (q k) (polarized)\n"); printf("(+1): 64 * (p k') * (q k) - 64 * M * (s k') * (q k) (polarized)\n"); printf("- Custom: \n"); printf(" (+3): 64 * gamma * ( 1 - beta ) * (M * (k')^{0}) * (q k) - (polarized)\n"); printf(" -64 * gamma * ( 1 - beta ) * M * (s k') * (q k) \n"); printf(" (+4): 64 * gamma * ( 1 + beta ) * (M * (k')^{0}) * (q k) + (polarized)\n"); printf(" +64 * gamma * ( 1 + beta ) * M * (s k') * (q k) \n"); printf("(+34): sum of (+3) and (+4) (unpolarized)\n"); printf("\n"); printf("Notations:\n"); printf("(muon)- ---> (electron)- (nu_mu) (nu_electronbar)\n"); printf(" p ---> q k k' \n"); printf(" p ---> q k1 k2 \n"); printf(" P ---> p1 p2 p3 \n"); printf("\n"); printf("Leftover factors multiplying the result:\n"); printf("- Coupling constant\n"); printf(" G_Fermi^{2}\n"); printf("- Initial particle state normalization:\n"); printf(" 1.0/(2*E) = 1.0/2*M (in the rest frame)\n"); printf("- Spin averaging for the muon (only if unpolarized):\n"); printf(" 1.0/2.0\n"); printf("\n"); printf("ThreeBodyDecay class\n"); printf("PSConstant (formula) s23_length/pow(M_PI,3.0)/128.0\n"); printf("PSConstant (numval): %12.6e \n", PSConst); printf("\n"); printf("---------------------------\n"); printf("--- Other formulas used ---\n"); printf("---------------------------\n"); printf("\n"); printf("Textbook result of the integration:\n"); printf("Gamma: G_Fermi^{2}*m_mu^{5}/(192*pi^{3})\n"); printf("\n"); printf("tau = hbar/Gamma\n"); printf("ctau = c*tau\n"); printf("\n"); printf("-------------------------\n"); printf("--- Numerical results ---\n"); printf("-------------------------\n"); printf("Don't forget: our result are quoted in the LAB frame, while the PDG and\n"); printf(" the textbook formula are calculated in the muon rest frame!\n"); printf("\n"); printf("# Important flags:\n", ampltiude); printf("- k0_type: %d (see above at 'Spin polarization', 1 = custom, 2 = physical)\n", k0_flag); printf("- spin_polarization: %d (see above at 'Spin polarization', 1 = computed with k0, 2 = helicity)\n", polvec_flag); printf("- Amplitude formula chosen: %d (see above at 'Amplitude' )\n", ampltiude); printf("\n"); printf("Note: Choosing (k0_type = 2) and (spin_polarization = 1) should give the same result as\n"); printf(" choosing (spin_polarization = 2) by definition\n"); printf("\n"); printf("Gamma(PDG): %12.6e [GeV] (note: this is the total gamma!)\n", gamma_PDG); printf("Gamma(textbook): %12.6e [GeV]\n", gamma_formula); printf("Gamma(our result w/o gamma factor): %12.6e [GeV]\n", result_wogamma); printf("Gamma(our result): %12.6e [GeV]\n", result); printf("\n"); printf("ctau(PDG): %12.6e [m]\n", c_tau_muon*1e-15); printf("ctau(textbook): %12.6e [m]\n", ctau_formula*1e-15); printf("ctau(our result w/o gamma factor): %12.6e [m]\n", ctau_wogamma); printf("ctau(our result): %12.6e [m]\n", ctau); printf("\n"); printf("# Muon configuration\n"); printf("beta: %12.6f\n", P->Beta()); printf("gamma: %12.6f <-\n", P->Gamma()); printf("\n"); printf("# Ratios\n"); printf("ratio of ctau's: (our result)/(textbook rest frame) %12.6f <-\n", ctau/ctau_formula/1e-15); printf("ratio of the above two values: %12.6f\n", P->Gamma()/(ctau/ctau_formula/1e-15)); printf("\n"); printf("Note: You should compare the values of 'gamma' with the 'ratio of ctau's',\n"); printf(" as they should be equal.\n"); printf(" The 'ratio of the above two values' gives a measure how well they agree.\n"); printf(" It should be close to unity, but there could be some tiny deviation as\n"); printf(" this is after all a numerical integration.\n"); printf("\n"); printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n", (double)integral[comp], (double)error[comp], (double)prob[comp]); return 0; }