#include #include #include #include "pythia_if.h" #include "TROOT.h" #include "TH1.h" #include "TH2.h" #include "TFile.h" #include "TNtuple.h" #include "TRandom.h" #include using namespace std; TH1F *hall, *hpip, *hpim, *hgam, *hKp, *hKm, *hEt, *hp, *hap, *hn, *han; TH1F *hall2, *hpip2, *hpim2, *hgam2, *hKp2, *hKm2, *hp2, *hap2, *hn2, *han2; TH1F *hypi, *hetapi; TH1F *heta2, *hEt2; TH1F *hetaEt, *hetaEt2; TH1F *he, *hepi, *heeta; TH1F *hec_ally, *hec, *hec2; TH1F *hyD0, *hyDp, *hyDs, *hyDst0, *hyDstp, *hyDsts ; TH1F *hptD0, *hptDp, *hptDs, *hptDst0, *hptDstp, *hptDsts ; TH1F *hx1,*hx2; TH2F *hx1x2, *hx1x2e, *hx1pte, *hx2pte, *hxpte; TH1F *hee, *hee_like, *hee_c, *hee_like_c; TH1F *hee2,*hee2like, *hee2_c, *hee2like_c; TH1F *heb_ally, *heb, *hee_b, *hee2_b, *hpt; TH2F *hh; TNtuple *C1; int Ne,Ne5,Ne8,Ne10,Ne13,Ne15,Ne18,Ne20,Ne25; void calc_mass(int i, int j, float &eta_i, float &eta_j, float &mass) { float pxi = pythia::Px(i); float pyi = pythia::Py(i); float pzi = pythia::Pz(i); float Ei = pythia::E(i); float pi = sqrt(pxi*pxi+pyi*pyi+pzi*pzi); eta_i = 0.5*log((pi+pzi)/(pi-pzi)); float pxj = pythia::Px(j); float pyj = pythia::Py(j); float pzj = pythia::Pz(j); float Ej = pythia::E(j); float pj = sqrt(pxj*pxj+pyj*pyj+pzj*pzj); eta_j = 0.5*log((pj+pzj)/(pj-pzj)); float px = pxi + pxj; float py = pyi + pyj; float pz = pzi + pzj; float E = Ei + Ej; mass = sqrt(E*E - px*px - py*py - pz*pz); } //---------------------------------------------------------------------------------- void fill_histo(void) { float pi = 3.14159; float theta, ptmu; // float Etsum = 0.0; //float Etsum2 = 0.0; //const float Mp = 0.938; //const float Mn = 0.939; //float x1 = pypars_.PARI[32]; //float x2 = pypars_.PARI[33]; //int nc = 0; // loop over all records //cout<<" event xx, #records: "<6.0 && theta<42.0) { C1->Fill(arr); } written = 1; } } //if (written ==0) C1->Fill(ptparent,yparent,parent_pid2,pt,y,pythia::Pid(i),0,0,0,status); } // end if any D } // end loop over records } // end void fill_histo void ask_user(float &root_s, int &nev, char *FileName, float *pkt) { root_s = 200.0; //cout << " enter root_s: "; //cin >> root_s; cout << " enter number of events: "; cin >> nev; *pkt = 1.5; //cout << " enter intrinsic kt (negative use default): "; //cin >> *pkt; cout << " enter root file name :"; cin >> FileName; cout << "root_s = "< CTEQ5L (4046)"< CTEQ4L (4032)"< GRV94LO (5005)"< GRV98LO (5012)"< MRST(c-g)(3072)"<> ipdf; ipdf = 1; if(ipdf==1) { pythia::pygive("mstp(51) = 4046");// PDFset is CTEQ5LO } else if(ipdf==2) { pythia::pygive("mstp(51) = 4032");// PDFset is CTEQ4LO } else if(ipdf==3) { pythia::pygive("mstp(51) = 5005");// PDFset is GRV94LO } else if(ipdf==4) { pythia::pygive("mstp(51) = 5012");// PDFset is GRV98LO } else if(ipdf==5) { pythia::pygive("mstp(51) = 3072");// PDFset is MRST(c-g) } else {//default is CTEQ5L pythia::pygive("mstp(51) = 4046");// PDFset is CTEQ5LO } // set primordal if(kt > 0) { cout << "set kt value"<no kt, 1-->gaussian, 2-->exponetial pythia::pygive("parp(91) = ",kt);// gaussian width of (GeV/c) // default is 0.44. Note = PARJ(91)**2. pythia::pygive("parp(93)=5.0"); // cut off limit (GeV/c) } else { cout << "set kt value"<no kt, 1-->gaussian, 2-->exponential pythia::pygive("parp(91) = 0");// gaussian width of (GeV/c) // default is 0.44. Note = PARJ(91)**2. pythia::pygive("parp(93)=5.0"); // cut off limit (GeV/c) pythia::pygive("mstj(22)=2.0"); // only decay prompts, if z<10mm (no pi, k decay) } // change charm mass to 1.25 GeV // This is motivated by the recent value of charm mass... // PDG value is, for example, Mc(Mc)=1.25+-0.1 GeV // // Ralf's value is 1.35 <--> K=5.2 // if mc=1.25 --> K=3.5 // if mc=1.5 --> K=8 // if mc=1.15 --> K=? // int charmid = pythia::pycomp(4); cout << "charm id="<> seed_choice; //seed_choice = 1; //cout << "seed_choice="< ckin(3) = 0."< ckin(3) = 1."< ckin(3) = 2."< ckin(3) = 3."< ckin(3) = 5."<> ckin3_choice; ckin3_choice = 1; if(ckin3_choice == 1) { pythia::pygive("ckin(3) = 0."); // min. value of root_s } else if(ckin3_choice == 2) { pythia::pygive("ckin(3) = 1."); // min. value of root_s } else if(ckin3_choice == 3) { pythia::pygive("ckin(3) = 2."); // min. value of root_s } else if(ckin3_choice == 4) { pythia::pygive("ckin(3) = 3."); // min. value of root_s } else if(ckin3_choice == 5) { pythia::pygive("ckin(3) = 4."); // min. value of root_s } else if(ckin3_choice == 6) { pythia::pygive("ckin(3) = 5."); // min. value of root_s } else { pythia::pygive("ckin(3) = 0."); // min. value of root_s } pythia::pyinit("CMS","p","p",root_s); TFile *tfile = new TFile(FileName,"recreate","pythia Et"); C1 = new TNtuple("C1","charm ntuple","px_parent:py_parent:pz_parent:pid_parent:px_d:py_d:pz_d:pid_d:px_mu:py_mu:pz_mu:pid_mu:emu:vxmu:vymu:vzmu:status"); cout << "now start event loop for "<Write(); tfile->Close(); }