| File: | generators/treps/src/Treps3B.cc |
| Warning: | line 476, column 9 Value stored to 'ivirt' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 1 | // -*- C++ -*- |
| 2 | // |
| 3 | // Package: <package> |
| 4 | // Module: Treps3B |
| 5 | // |
| 6 | // Description: <two-line class summary> |
| 7 | // Two-photon Monte Carlo Generator TREPS Ver.3 (translated and modified |
| 8 | // from TREPS2 of FORTRAN version |
| 9 | // For BASF Application |
| 10 | // Implimentation: |
| 11 | // <Notes on implimentation> |
| 12 | // |
| 13 | // Author: Sadaharu Uehara |
| 14 | // Created: Jul.16 1997 |
| 15 | // $Id$ |
| 16 | // |
| 17 | // Revision history |
| 18 | // |
| 19 | // |
| 20 | // Modified: To use RandFlat instead of bare HepRandom |
| 21 | // 9-MAY-2000 S.Uehara |
| 22 | // RETURNED TO THE OLD RANDOM-NUMBER GENERATOR 14-MAY-2000 |
| 23 | // $Log$ |
| 24 | |
| 25 | |
| 26 | |
| 27 | // system include files |
| 28 | #include <iostream> |
| 29 | #include <iomanip> |
| 30 | #include <fstream> |
| 31 | #include <string.h> |
| 32 | #include <math.h> |
| 33 | #include <TVector3.h> |
| 34 | #include <TLorentzVector.h> |
| 35 | #include <TRandom.h> |
| 36 | #include <stdlib.h> |
| 37 | |
| 38 | // user include files |
| 39 | #include <generators/treps/Treps3B.h> |
| 40 | |
| 41 | #include <framework/logging/Logger.h> |
| 42 | |
| 43 | namespace Belle2 { |
| 44 | |
| 45 | |
| 46 | // |
| 47 | // constructor |
| 48 | // |
| 49 | TrepsB::TrepsB(void) : |
| 50 | sutool(), w(0.), ntot(0), nsave(0), ebeam(0.), q2max(0.), cost_cut(0.), pt_cut(0.), cost_flag(0), pt_flag(0), |
| 51 | qzmin(0.), qptmin(0.), parti(nullptr), parts(nullptr), ephi(0.), etheta(0.), s(0.), imode(0), dmin(0.), dmax(0.), |
| 52 | ffmax(0.), rs(0.), vmax(0.), pppp(nullptr), wf(0.), inmode(0), wtcount(0), totalCrossSectionForMC(0.), ndecay(0), |
| 53 | pmodel(0), fmodel(0), ievent(0), treh1(nullptr), treh2(nullptr), treh3(nullptr), treh4(nullptr), treh5(nullptr), |
| 54 | treh6(nullptr), npart(0), partgen(nullptr), zdis(nullptr), zpdis(nullptr), zsdis(nullptr) |
| 55 | { |
| 56 | for (int i = 0; i < 5000; ++i) { |
| 57 | wtcond[i] = 0.; |
| 58 | wthead[i] = 0; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // |
| 63 | // member functions |
| 64 | // |
| 65 | void TrepsB::initp(void) |
| 66 | // read parameter-input file and load the parameters |
| 67 | { |
| 68 | |
| 69 | B2INFO("Treps: Parameters are read from the file, " << parameterFile)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << "Treps: Parameters are read from the file, " << parameterFile; Belle2::LogSystem::Instance().sendMessage (Belle2::LogMessage(Belle2::LogConfig::c_Info, std::move(varStream ), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 69, 0)); }; } } while(false); |
| 70 | B2INFO("Treps: W list is read from the file, " << wlistFile)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << "Treps: W list is read from the file, " << wlistFile; Belle2::LogSystem::Instance().sendMessage(Belle2:: LogMessage(Belle2::LogConfig::c_Info, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 70, 0)); }; } } while(false); |
| 71 | B2INFO("Treps: Differential cross section list is read from the file, " << diffcrosssectionFile)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << "Treps: Differential cross section list is read from the file, " << diffcrosssectionFile; Belle2::LogSystem::Instance() .sendMessage(Belle2::LogMessage(Belle2::LogConfig::c_Info, std ::move(varStream), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 71, 0)); }; } } while(false); |
| 72 | |
| 73 | partgen = new Part_gen [30]; |
| 74 | parti = new Part_cont [10]; |
| 75 | parts = new Part_cont [20]; |
| 76 | pppp = new TLorentzVector [30]; |
| 77 | |
| 78 | std::ifstream infile(parameterFile); |
| 79 | if (!infile) { |
| 80 | B2FATAL("Can't open input file: " << parameterFile)do { { LogVariableStream varStream; varStream << "Can't open input file: " << parameterFile; Belle2::LogSystem::Instance().sendMessage (Belle2::LogMessage(Belle2::LogConfig::c_Fatal, std::move(varStream ), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 80, 0)); }; exit(1); } while(false); |
| 81 | } else { |
| 82 | // read particle properties |
| 83 | infile >> ndecay >> pmodel >> fmodel ; //Physics model pmodel, Form factor model added |
| 84 | |
| 85 | if (ndecay < 2) { |
| 86 | B2FATAL("decay particles must be >=2 : " << ndecay)do { { LogVariableStream varStream; varStream << "decay particles must be >=2 : " << ndecay; Belle2::LogSystem::Instance().sendMessage(Belle2 ::LogMessage(Belle2::LogConfig::c_Fatal, std::move(varStream) , "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 86, 0)); }; exit(1); } while(false) ; |
| 87 | exit(1); |
| 88 | } |
| 89 | |
| 90 | int ndecs = 0 ; |
| 91 | |
| 92 | int icodex, ndecx ; |
| 93 | double pmassx, pchargx, pwidthx ; |
| 94 | |
| 95 | for (int i = 0 ; i < ndecay ; i++) { |
| 96 | sutool.nextline(infile); |
| 97 | |
| 98 | infile >> icodex >> pmassx >> pchargx >> ndecx >> pwidthx ; |
| 99 | |
| 100 | parti[i] = Part_cont(icodex, pmassx, pchargx, ndecx, pwidthx); |
| 101 | |
| 102 | if (ndecx >= 2) ndecs += ndecx ; |
| 103 | } |
| 104 | |
| 105 | for (int j = 0 ; j < ndecs ; j++) { |
| 106 | sutool.nextline(infile); |
| 107 | |
| 108 | infile >> icodex >> pmassx >> pchargx ; |
| 109 | Part_cont _pp = Part_cont(icodex, pmassx, pchargx); |
| 110 | parts[j] = _pp ; |
| 111 | } |
| 112 | |
| 113 | // Boost of the total system |
| 114 | double tsws4 = pfeb.Mag() + pfpb.Mag() ; |
| 115 | TVector3 tsws = TVector3(-(pfeb + pfpb)); |
| 116 | double emsys = tsws4 * tsws4 - tsws.Mag2() ; |
| 117 | |
| 118 | peb = TLorentzVector(pfeb, pfeb.Mag()); |
| 119 | |
| 120 | ppb = TLorentzVector(pfpb, pfpb.Mag()); |
| 121 | |
| 122 | TLorentzVector ppp = peb; |
| 123 | ppp.Boost(tsws.x() / tsws4, tsws.y() / tsws4, tsws.z() / tsws4); |
| 124 | ephi = ppp.Phi(); |
| 125 | etheta = ppp.Theta(); |
| 126 | |
| 127 | tsws = -tsws ; |
| 128 | tswsb = (1. / tsws4) * tsws; |
| 129 | |
| 130 | // output input parameters |
| 131 | //********************************* |
| 132 | B2INFO("")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << ""; Belle2::LogSystem::Instance().sendMessage (Belle2::LogMessage(Belle2::LogConfig::c_Info, std::move(varStream ), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 132, 0)); }; } } while(false) ; |
| 133 | B2INFO("****** Treps3 Input Parameters in Initialization ******")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << "****** Treps3 Input Parameters in Initialization ******" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Info, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 133 , 0)); }; } } while(false); |
| 134 | B2INFO(" Beam energy in e+e- cm system (GeV): " << ebeam)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " Beam energy in e+e- cm system (GeV): " << ebeam; Belle2::LogSystem::Instance().sendMessage(Belle2 ::LogMessage(Belle2::LogConfig::c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 134, 0)); }; } } while(false); |
| 135 | B2INFO(" e- lab. momentum: " << pfeb.x() << " " << pfeb.y() << " " << pfeb.z())do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " e- lab. momentum: " << pfeb.x() << " " << pfeb.y() << " " << pfeb.z( ); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Info, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 135 , 0)); }; } } while(false); |
| 136 | B2INFO(" e+ lab. momentum: " << pfpb.x() << " " << pfpb.y() << " " << pfpb.z())do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " e+ lab. momentum: " << pfpb.x() << " " << pfpb.y() << " " << pfpb.z( ); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Info, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 136 , 0)); }; } } while(false); |
| 137 | B2INFO(" Q2 max (GeV2): " << q2max)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " Q2 max (GeV2): " << q2max; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 137, 0)); }; } } while(false ); |
| 138 | B2INFO(" Save-condition (|cos(theta_cm)|): " << cost_cut << ", "do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " Save-condition (|cos(theta_cm)|): " << cost_cut << ", " << cost_flag; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 139, 0)); }; } } while(false ) |
| 139 | << cost_flag)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " Save-condition (|cos(theta_cm)|): " << cost_cut << ", " << cost_flag; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 139, 0)); }; } } while(false ); |
| 140 | B2INFO(" (pt (GeV/c)): " << pt_cut << ", "do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " (pt (GeV/c)): " << pt_cut << ", " << pt_flag; Belle2::LogSystem::Instance ().sendMessage(Belle2::LogMessage(Belle2::LogConfig::c_Info, std ::move(varStream), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 141, 0)); }; } } while(false) |
| 141 | << pt_flag)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " (pt (GeV/c)): " << pt_cut << ", " << pt_flag; Belle2::LogSystem::Instance ().sendMessage(Belle2::LogMessage(Belle2::LogConfig::c_Info, std ::move(varStream), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 141, 0)); }; } } while(false); |
| 142 | B2INFO(" Number of decay particles: " << ndecay)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " Number of decay particles: " << ndecay; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Info, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 142 , 0)); }; } } while(false); |
| 143 | B2INFO(" Physics model: " << pmodel)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " Physics model: " << pmodel; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 143, 0)); }; } } while(false ); |
| 144 | B2INFO(" Form-factor model: " << fmodel)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " Form-factor model: " << fmodel; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Info, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 144 , 0)); }; } } while(false); |
| 145 | |
| 146 | |
| 147 | B2INFO(" P/S code mass charge decs width")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " P/S code mass charge decs width" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Info, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 147 , 0)); }; } } while(false); |
| 148 | |
| 149 | for (int i = 0 ; i < ndecay ; i++) { |
| 150 | B2INFO(" P " << std::setw(6) << parti[i].icodedo { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " P " << std::setw(6) << parti [i].icode << std::setw(11) << std::setprecision(4 ) << parti[i].pmass << std::setw(6) << std:: setprecision(2) << parti[i].pcharg << std::setw(4 ) << parti[i].ndec << std::setw(11) << std:: setprecision(4) << parti[i].pwidth; Belle2::LogSystem:: Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig:: c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 155, 0)); }; } } while(false ) |
| 151 | << std::setw(11) << std::setprecision(4) << parti[i].pmassdo { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " P " << std::setw(6) << parti [i].icode << std::setw(11) << std::setprecision(4 ) << parti[i].pmass << std::setw(6) << std:: setprecision(2) << parti[i].pcharg << std::setw(4 ) << parti[i].ndec << std::setw(11) << std:: setprecision(4) << parti[i].pwidth; Belle2::LogSystem:: Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig:: c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 155, 0)); }; } } while(false ) |
| 152 | << std::setw(6) << std::setprecision(2) << parti[i].pchargdo { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " P " << std::setw(6) << parti [i].icode << std::setw(11) << std::setprecision(4 ) << parti[i].pmass << std::setw(6) << std:: setprecision(2) << parti[i].pcharg << std::setw(4 ) << parti[i].ndec << std::setw(11) << std:: setprecision(4) << parti[i].pwidth; Belle2::LogSystem:: Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig:: c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 155, 0)); }; } } while(false ) |
| 153 | << std::setw(4) << parti[i].ndecdo { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " P " << std::setw(6) << parti [i].icode << std::setw(11) << std::setprecision(4 ) << parti[i].pmass << std::setw(6) << std:: setprecision(2) << parti[i].pcharg << std::setw(4 ) << parti[i].ndec << std::setw(11) << std:: setprecision(4) << parti[i].pwidth; Belle2::LogSystem:: Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig:: c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 155, 0)); }; } } while(false ) |
| 154 | << std::setw(11) << std::setprecision(4) << parti[i].pwidthdo { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " P " << std::setw(6) << parti [i].icode << std::setw(11) << std::setprecision(4 ) << parti[i].pmass << std::setw(6) << std:: setprecision(2) << parti[i].pcharg << std::setw(4 ) << parti[i].ndec << std::setw(11) << std:: setprecision(4) << parti[i].pwidth; Belle2::LogSystem:: Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig:: c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 155, 0)); }; } } while(false ) |
| 155 | )do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " P " << std::setw(6) << parti [i].icode << std::setw(11) << std::setprecision(4 ) << parti[i].pmass << std::setw(6) << std:: setprecision(2) << parti[i].pcharg << std::setw(4 ) << parti[i].ndec << std::setw(11) << std:: setprecision(4) << parti[i].pwidth; Belle2::LogSystem:: Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig:: c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 155, 0)); }; } } while(false ); |
| 156 | } |
| 157 | for (int i = 0 ; i < ndecs ; i++) { |
| 158 | B2INFO(" S " << std::setw(6) << parts[i].icodedo { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " S " << std::setw(6) << parts [i].icode << std::setw(11) << std::setprecision(4 ) << parts[i].pmass << std::setw(6) << std:: setprecision(2) << parts[i].pcharg; Belle2::LogSystem:: Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig:: c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 160, 0)); }; } } while(false ) |
| 159 | << std::setw(11) << std::setprecision(4) << parts[i].pmassdo { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " S " << std::setw(6) << parts [i].icode << std::setw(11) << std::setprecision(4 ) << parts[i].pmass << std::setw(6) << std:: setprecision(2) << parts[i].pcharg; Belle2::LogSystem:: Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig:: c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 160, 0)); }; } } while(false ) |
| 160 | << std::setw(6) << std::setprecision(2) << parts[i].pcharg)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << " S " << std::setw(6) << parts [i].icode << std::setw(11) << std::setprecision(4 ) << parts[i].pmass << std::setw(6) << std:: setprecision(2) << parts[i].pcharg; Belle2::LogSystem:: Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig:: c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 160, 0)); }; } } while(false ); |
| 161 | } |
| 162 | B2INFO("*******************************************************")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << "*******************************************************" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Info, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 162 , 0)); }; } } while(false); |
| 163 | //********************************* |
| 164 | |
| 165 | if (abs(emsys - 4 * ebeam * ebeam) > 0.001) { |
| 166 | B2FATAL(" Wrong beam fractional momenta ")do { { LogVariableStream varStream; varStream << " Wrong beam fractional momenta " ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Fatal, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 166 , 0)); }; exit(1); } while(false); |
| 167 | exit(1) ; |
| 168 | } |
| 169 | |
| 170 | // other impotant variables |
| 171 | s = 4.*ebeam * ebeam ; |
| 172 | ntot = 0 ; |
| 173 | nsave = 0; |
| 174 | } |
| 175 | |
| 176 | } |
| 177 | |
| 178 | void TrepsB::create_hist(void) |
| 179 | { |
| 180 | treh1 = new TH1F("PZSUMCM", "PZSUMCM", 100, -10., 10.); |
| 181 | treh2 = new TH1F("PTSUMCM", "PTSUMCM", 100, 0., 1.); |
| 182 | treh3 = new TH1F("EALLCM", "EALLCM", 100, 0., 20.); |
| 183 | treh4 = new TH1F("PZSUMLAB", "PZSUMLAB", 100, -10., 10.); |
| 184 | treh5 = new TH1F("PTSUMLAB", "PTSUMLAB", 100, 0., 1.); |
| 185 | treh6 = new TH1F("WFINAL", "WFINAL", 100, 0., 5.); |
| 186 | |
| 187 | zdis = new TH1F("kin3_z", "kin3_z", 40, -1., 1.); |
| 188 | zpdis = new TH1F("kin3_zp", "kin3_zp", 40, -1., 1.); |
| 189 | zsdis = new TH1F("kin3_zs", "kin3_zs", 40, -1., 1.); |
| 190 | |
| 191 | } |
| 192 | |
| 193 | void TrepsB::wtable() |
| 194 | { |
| 195 | totalCrossSectionForMC = 0.; |
| 196 | |
| 197 | // Load Differential Cross Section table |
| 198 | std::ifstream infile(diffcrosssectionFile); |
| 199 | if (!infile) { |
| 200 | B2FATAL("Can't open W-list input file")do { { LogVariableStream varStream; varStream << "Can't open W-list input file" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Fatal, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 200 , 0)); }; exit(1); } while(false) ; |
| 201 | } else { |
| 202 | double i_w; // W [GeV] |
| 203 | double diffCrossSection; // Number of events for given W |
| 204 | |
| 205 | double previousW = 0.; |
| 206 | double previousDCS = 0.; // Diff(erential) Cross Section |
| 207 | while (infile >> i_w >> diffCrossSection) { |
| 208 | if (i_w > 9000. || i_w < 0.) continue; |
| 209 | diffCrossSectionOfW[i_w] = diffCrossSection; |
| 210 | |
| 211 | // Calculate total cross section up to the bin. |
| 212 | // This will be used for importance sampling. NOT CORRECT cross section |
| 213 | if (diffCrossSection > previousDCS and previousDCS != 0) { |
| 214 | // If current diffCrossSection is higher than previous and not first time, use diffCrossSection |
| 215 | totalCrossSectionForMC += (i_w - previousW) * diffCrossSection * 1.01; // For safety, 1 % higher value is set |
| 216 | } else { |
| 217 | // If previous diffCrossSection is higher than current or first time, use previousDCS |
| 218 | totalCrossSectionForMC += (i_w - previousW) * previousDCS * 1.01;// For safety, 1 % higher value is set |
| 219 | } |
| 220 | // Store current cross section with w |
| 221 | WOfCrossSectionForMC[totalCrossSectionForMC] = i_w; |
| 222 | |
| 223 | previousW = i_w; |
| 224 | previousDCS = diffCrossSection; |
| 225 | } |
| 226 | |
| 227 | B2DEBUG(20, " wtable loaded")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << " wtable loaded"; Belle2::LogSystem::Instance().sendMessage (Belle2::LogMessage(Belle2::LogConfig::c_Debug, std::move(varStream ), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 227, 20)); }; } } while(false); } while(false); |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | double TrepsB::wtable(int mode) |
| 232 | { |
| 233 | double prew = 0.; |
| 234 | if (mode == 0) { |
| 235 | |
| 236 | // initialization and load table |
| 237 | |
| 238 | for (int i = 0 ; i < 5000 ; i++) { |
| 239 | wthead[i] = 999999999; |
| 240 | wtcond[i] = 0.0; |
| 241 | } |
| 242 | |
| 243 | B2DEBUG(20, " wtable mode=0 initialized")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << " wtable mode=0 initialized"; Belle2::LogSystem::Instance ().sendMessage(Belle2::LogMessage(Belle2::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 243, 20)); }; } } while(false); } while(false); |
| 244 | |
| 245 | // Load Wlist_table |
| 246 | |
| 247 | std::ifstream infile(wlistFile); |
| 248 | if (!infile) { |
| 249 | B2FATAL("Can't open W-list input file")do { { LogVariableStream varStream; varStream << "Can't open W-list input file" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Fatal, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 249 , 0)); }; exit(1); } while(false) ; |
| 250 | } else { |
| 251 | double w1; |
| 252 | int n1; |
| 253 | int hpoint, nwpoint; |
| 254 | int inmodein; |
| 255 | |
| 256 | hpoint = 1; |
| 257 | nwpoint = 0; |
| 258 | |
| 259 | infile >> inmodein; |
| 260 | inmode = inmodein; |
| 261 | |
| 262 | while (!infile.eof() && inmode == 0) { |
| 263 | sutool.nextline(infile); |
| 264 | infile >> w1 >> n1 ; |
| 265 | if (w1 > 9000. || w1 < 0.) continue; |
| 266 | |
| 267 | if (nwpoint == 0) wthead[0] = 1; |
| 268 | wtcond[nwpoint] = w1; |
| 269 | nwpoint++ ; |
| 270 | hpoint += n1; |
| 271 | B2DEBUG(20, w1 << " GeV " << n1 << " events " << hpoint - 1 << "events in total")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << w1 << " GeV " << n1 << " events " << hpoint - 1 << "events in total"; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 271, 20)); }; } } while( false); } while(false); |
| 272 | wthead[nwpoint] = hpoint; |
| 273 | } |
| 274 | while (!infile.eof() && (inmode == 1 || inmode == 2)) { |
| 275 | sutool.nextline(infile); |
| 276 | infile >> w1 >> n1 ; |
| 277 | if (w1 > 9000. || w1 < 0.) continue; |
| 278 | wf = w1; |
| 279 | w = (double)wf; |
| 280 | updateW(); |
| 281 | if (inmode == 1) |
| 282 | B2INFO(w << " " << twlumi() << " //W(GeV) and Two-photon lumi. func.(wide)(1/GeV)")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << w << " " << twlumi() << " //W(GeV) and Two-photon lumi. func.(wide)(1/GeV)"; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Info, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 282, 0)); }; } } while(false ); |
| 283 | else |
| 284 | B2INFO(w << " " << twlumi_n() << " //W(GeV) and Two-photon lumi. func.(narrow)(nb/keV/(2J+1))")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2:: LogConfig::c_Info, 0, "generators")) { { LogVariableStream varStream ; varStream << w << " " << twlumi_n() << " //W(GeV) and Two-photon lumi. func.(narrow)(nb/keV/(2J+1))" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Info, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 284 , 0)); }; } } while(false); |
| 285 | |
| 286 | } |
| 287 | |
| 288 | B2DEBUG(20, wthead[0] << " " << wtcond[0])do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << wthead[0] << " " << wtcond[0]; Belle2:: LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2:: LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 288, 20)); }; } } while( false); } while(false); |
| 289 | B2DEBUG(20, " wtable mode=0 loaded")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << " wtable mode=0 loaded"; Belle2::LogSystem::Instance ().sendMessage(Belle2::LogMessage(Belle2::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 289, 20)); }; } } while(false); } while(false); |
| 290 | } |
| 291 | return 0.0 ; |
| 292 | } else if (mode == 1) { |
| 293 | // Get W |
| 294 | int i = 0; |
| 295 | |
| 296 | do { |
| 297 | if (wtcount >= wthead[i]) prew = wtcond[i]; |
| 298 | i++; |
| 299 | } while (wthead[i] < 999999999); |
| 300 | |
| 301 | |
| 302 | return prew; |
| 303 | } else { |
| 304 | B2FATAL("Undefined mode for wtable. Can be 1 or 0. Called with " << mode)do { { LogVariableStream varStream; varStream << "Undefined mode for wtable. Can be 1 or 0. Called with " << mode; Belle2::LogSystem::Instance().sendMessage(Belle2 ::LogMessage(Belle2::LogConfig::c_Fatal, std::move(varStream) , "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 304, 0)); }; exit(1); } while(false) ; |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | |
| 309 | |
| 310 | void TrepsB::setW(double ww) |
| 311 | { |
| 312 | // set W parameter |
| 313 | w = ww; |
| 314 | updateW(); |
| 315 | } |
| 316 | |
| 317 | |
| 318 | void TrepsB::updateW(void) |
| 319 | { |
| 320 | if (q2max < 0.0) q2max = s - w * w - 2.0 * me * w ; |
| 321 | rs = w * w / s ; |
| 322 | double zmax = 1.0 - me / ebeam ; |
| 323 | double ymin = rs / zmax ; |
| 324 | dmin = ymin - zmax ; |
| 325 | dmax = -dmin ; |
| 326 | // added by S.U on Sep.29,1997 |
| 327 | imode = 0; |
| 328 | |
| 329 | double xxx = tpgetd(0, rs, dmin, dmax, q2max); |
| 330 | B2DEBUG(20, "Local variable xxx=" << xxx << " created but not used")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "Local variable xxx=" << xxx << " created but not used" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 330 , 20)); }; } } while(false); } while(false); |
| 331 | tpgetz(0); |
| 332 | |
| 333 | B2DEBUG(20, "In Treps, W has been set to be " << std::setprecision(5) <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "In Treps, W has been set to be " << std::setprecision (5) << w << " GeV"; Belle2::LogSystem::Instance() .sendMessage(Belle2::LogMessage(Belle2::LogConfig::c_Debug, std ::move(varStream), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 334, 20)); }; } } while(false); } while(false) |
| 334 | w << " GeV")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "In Treps, W has been set to be " << std::setprecision (5) << w << " GeV"; Belle2::LogSystem::Instance() .sendMessage(Belle2::LogMessage(Belle2::LogConfig::c_Debug, std ::move(varStream), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 334, 20)); }; } } while(false); } while(false); |
| 335 | } |
| 336 | |
| 337 | double TrepsB::twlumi() |
| 338 | { |
| 339 | // calculate and return two-photon luminosity function |
| 340 | imode = 1; |
| 341 | double xxx = simpsn1(dmin, dmax, 10000); |
| 342 | return xxx * w * 0.5 / ebeam / ebeam ; |
| 343 | } |
| 344 | |
| 345 | double TrepsB::twlumi_n() |
| 346 | { |
| 347 | // calculate and return two-photon luminosity function |
| 348 | // for very narrow resonance |
| 349 | return twlumi() * twopi * twopi / w / w * 0.38938 ; |
| 350 | } |
| 351 | |
| 352 | double TrepsB::tpgetd(int mode, double _rs, double _dmin, double _dmax, |
| 353 | double _q2max) |
| 354 | { |
| 355 | |
| 356 | if (mode == 0) { |
| 357 | // calc mode |
| 358 | ffmax = 0. ; |
| 359 | int n = 10000 ; |
| 360 | for (int i = 1; i <= n ; i++) { |
| 361 | double d = _dmin + (_dmax - _dmin) / (double)n * (double)i; |
| 362 | double r = (2.0 + d * d / _rs + sqrt(pow((2.0 + d * d / _rs), 2) - 4.0)) * 0.5 ; |
| 363 | if (d < 0.0) |
| 364 | r = (2.0 + d * d / _rs - sqrt(pow((2.0 + d * d / _rs), 2) - 4.0)) * 0.5 ; |
| 365 | double ff = tpxint(r, _rs, _q2max) / (0.5 * sqrt(_rs / r) * (1.0 + 1.0 / r)); |
| 366 | if (ff > ffmax) ffmax = ff ; |
| 367 | } |
| 368 | return 0.0; |
| 369 | } else { |
| 370 | // Generate mode |
| 371 | double d, ff; |
| 372 | do { |
| 373 | d = _dmin + (_dmax - _dmin) * gRandom->Uniform(); |
| 374 | double r; |
| 375 | if (d > 0.0) { |
| 376 | r = (2. + d * d / _rs + sqrt((2. + d * d / _rs) * (2. + d * d / _rs) - 4.)) * 0.5 ; |
| 377 | } else { |
| 378 | r = (2. + d * d / _rs - sqrt((2. + d * d / _rs) * (2. + d * d / _rs) - 4.)) * 0.5 ; |
| 379 | } |
| 380 | ff = tpxint(r, _rs, _q2max) / (0.5 * sqrt(_rs / r) * (1. + 1. / r)); |
| 381 | } while (gRandom->Uniform()*ffmax > ff); |
| 382 | return d; |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | double TrepsB::tpgetz(int mode) |
| 387 | { |
| 388 | double z; |
| 389 | |
| 390 | if (mode == 0) { |
| 391 | vmax = 0.0 ; |
| 392 | // max val. search |
| 393 | for (int i = -1000 ; i <= 1000 ; i++) { |
| 394 | z = (double)i * 0.001 ; |
| 395 | double v = tpangd(z, w); |
| 396 | if (v > vmax) vmax = v; |
| 397 | } |
| 398 | } else { |
| 399 | do { z = (gRandom->Uniform() - 0.5) * 2. ; } |
| 400 | while (vmax * gRandom->Uniform() >= tpangd(z, w)); |
| 401 | } |
| 402 | |
| 403 | return z; |
| 404 | } |
| 405 | |
| 406 | int TrepsB::event_gen(int iev) |
| 407 | { |
| 408 | // generates one event |
| 409 | B2DEBUG(20, "W = " << w)do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "W = " << w; Belle2::LogSystem::Instance().sendMessage (Belle2::LogMessage(Belle2::LogConfig::c_Debug, std::move(varStream ), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 409, 20)); }; } } while(false); } while(false); |
| 410 | imode = 0 ; |
| 411 | int npoint; |
| 412 | |
| 413 | do { |
| 414 | double d = tpgetd(1, rs, dmin, dmax, q2max); |
| 415 | double r ; |
| 416 | if (d > 0.0) { |
| 417 | r = (2.0 + d * d / rs + sqrt(pow((2.0 + d * d / rs), 2) - 4.0)) * 0.5; |
| 418 | } else { |
| 419 | r = (2.0 + d * d / rs - sqrt(pow((2.0 + d * d / rs), 2) - 4.0)) * 0.5; |
| 420 | } |
| 421 | |
| 422 | double z = sqrt(rs / r); |
| 423 | double y = sqrt(rs * r); |
| 424 | |
| 425 | double q2p, q2m, q2min, sf ; |
| 426 | |
| 427 | do { |
| 428 | do { |
| 429 | q2p = tpgetq(s, z, q2max) ; |
| 430 | q2m = tpgetq(s, z, q2max) ; |
| 431 | q2min = me * me * pow(w, 4) / s / (s - w * w); |
| 432 | sf = ((s * s + (s - w * w) * (s - w * w)) / 2. / s / s - (s - w * w) * q2min / s / q2p) |
| 433 | * ((s * s + (s - w * w) * (s - w * w)) / 2. / s / s - (s - w * w) * q2min / s / q2m); |
| 434 | } while (gRandom->Uniform() > sf); |
| 435 | } while (gRandom->Uniform() > tpform(q2p, w)*tpform(q2m, w)); |
| 436 | |
| 437 | int ivirt = 0; |
| 438 | |
| 439 | TVector3 tv1, tv2, tv3, tv4; |
| 440 | |
| 441 | if (q2m < q2zero || q2p < q2zero) { |
| 442 | // single tag approx. |
| 443 | double q2; |
| 444 | if (q2m > q2p) { |
| 445 | q2 = q2m + q2p; |
| 446 | ivirt = -1 ; |
| 447 | } else { |
| 448 | q2 = q2p + q2m ; |
| 449 | ivirt = 1 ; |
| 450 | z = y ; |
| 451 | } |
| 452 | |
| 453 | if (q2m < q2zero && q2p < q2zero) { |
| 454 | // real-real approx. |
| 455 | q2 = 0.0 ; |
| 456 | ivirt = 0 ; |
| 457 | } |
| 458 | |
| 459 | double rk2 = z * ebeam ; |
| 460 | double rk1 = 0.25 / rk2 * (w * w + q2 - rk2 * q2 / ebeam); |
| 461 | double rk13 = q2 / 2.0 / ebeam + rk1 ; |
| 462 | double qqqq = rk1 * rk1 - rk13 * rk13 + q2; |
| 463 | if (ivirt == 0) qqqq = 0.0 ; |
| 464 | |
| 465 | if (qqqq < 0.0) continue ; |
| 466 | |
| 467 | double rk11 = -sqrt(qqqq); |
| 468 | tv1 = TVector3(-rk11, 0., sqrt(ebeam * ebeam - me * me) - rk13); |
| 469 | tv2 = TVector3(0., 0., -(sqrt(ebeam * ebeam - me * me) - rk2)); |
| 470 | tv3 = TVector3(-rk11, 0., |
| 471 | -(sqrt(ebeam * ebeam - me * me) - rk13)); |
| 472 | tv4 = TVector3(0., 0., sqrt(ebeam * ebeam - me * me) - rk2); |
| 473 | |
| 474 | } else { |
| 475 | // double-tag case |
| 476 | ivirt = -1 ; |
Value stored to 'ivirt' is never read | |
| 477 | if (q2p > q2m) { |
| 478 | ivirt = 1; |
| 479 | double qtmp = q2p ; |
| 480 | q2p = q2m; |
| 481 | q2m = qtmp ; |
| 482 | z = y ; |
| 483 | } |
| 484 | double rk2 = z * ebeam ; |
| 485 | double aaaa = 4.*rk2 + q2p / ebeam ; |
| 486 | double bbbb = w * w + q2m + q2p - q2m * q2p / 2. / ebeam / ebeam - q2m * rk2 / ebeam ; |
| 487 | double cccc = 4.*q2m * q2p * (1. - rk2 / ebeam - q2p / 4. / ebeam / ebeam); |
| 488 | double rphi = gRandom->Uniform() * twopi; |
| 489 | double rsrs = 1. + aaaa / cccc / pow(cos(rphi), 2) * |
| 490 | (4.*aaaa * ebeam * ebeam - aaaa * q2m - 4.*bbbb * ebeam); |
| 491 | if (rsrs < 0.0) continue ; |
| 492 | double rk1 = (2.*aaaa * bbbb + cccc * pow(cos(rphi), 2) / ebeam * |
| 493 | (sqrt(rsrs) - 1.)) / 2. / aaaa / aaaa; |
| 494 | if ((bbbb - aaaa * rk1)*cos(rphi) > 0.0) |
| 495 | rk1 = (2.*aaaa * bbbb + cccc * pow(cos(rphi), 2) / ebeam * |
| 496 | (-sqrt(rsrs) - 1.)) / 2. / aaaa / aaaa; |
| 497 | if ((bbbb - aaaa * rk1)*cos(rphi) > 0.0) continue ; |
| 498 | |
| 499 | tv1 = TVector3(sqrt(q2m * (1. - rk1 / ebeam - q2m / 4. / ebeam / ebeam)), |
| 500 | 0., |
| 501 | sqrt(ebeam * ebeam - me * me) - (q2m / 2. / ebeam + rk1)); |
| 502 | tv2 = TVector3(sqrt(q2p * (1. - rk2 / ebeam - q2p / 4. / ebeam / ebeam)) * cos(rphi), |
| 503 | sqrt(q2p * (1. - rk2 / ebeam - q2p / 4. / ebeam / ebeam)) * sin(rphi), |
| 504 | - (sqrt(ebeam * ebeam - me * me) - (q2p / 2. / ebeam + rk2))); |
| 505 | tv3 = TVector3(sqrt(q2m * (1. - rk1 / ebeam - q2m / 4. / ebeam / ebeam)), |
| 506 | 0., |
| 507 | -(sqrt(ebeam * ebeam - me * me) - (q2m / 2. / ebeam + rk1))); |
| 508 | tv4 = TVector3(sqrt(q2p * (1. - rk2 / ebeam - q2p / 4. / ebeam / ebeam)) * cos(rphi), |
| 509 | sqrt(q2p * (1. - rk2 / ebeam - q2p / 4. / ebeam / ebeam)) * sin(rphi), |
| 510 | sqrt(ebeam * ebeam - me * me) - (q2p / 2. / ebeam + rk2)); |
| 511 | |
| 512 | } |
| 513 | |
| 514 | if (gRandom->Uniform() > 0.5) { |
| 515 | pe = TLorentzVector(tv1, sqrt(tv1.Mag2() + me * me)); |
| 516 | pp = TLorentzVector(tv2, sqrt(tv2.Mag2() + me * me)); |
| 517 | } else { |
| 518 | pp = TLorentzVector(tv3, sqrt(tv3.Mag2() + me * me)); |
| 519 | pe = TLorentzVector(tv4, sqrt(tv4.Mag2() + me * me)); |
| 520 | } |
| 521 | // two-photon system generated. Rotates it for general directions |
| 522 | double dphi = gRandom->Uniform() * twopi ; |
| 523 | pe.RotateZ(dphi); |
| 524 | pp.RotateZ(dphi); |
| 525 | |
| 526 | TVector3 ws3 = -(pe + pp).Vect(); |
| 527 | TLorentzVector ws = TLorentzVector(ws3, sqrt(ws3.Mag2() + w * w)); |
| 528 | |
| 529 | TVector3 wsb = (1. / ws.T()) * ws3 ; |
| 530 | |
| 531 | // decide of 4-momenta of particles in the two-photon system |
| 532 | |
| 533 | // particle masses |
| 534 | tpgetm(parti, ndecay); |
| 535 | |
| 536 | // angular distribution |
| 537 | if (ndecay == 2) { |
| 538 | // two-body |
| 539 | double zz = tpgetz(1); |
| 540 | double phi = twopi * gRandom->Uniform(); |
| 541 | int jcode; |
| 542 | double m1 = parti[0].pmassp; |
| 543 | double m2 = parti[1].pmassp; |
| 544 | double pm = sutool.p2bdy(w, m1, m2, jcode); |
| 545 | if (jcode == 0) continue ; |
| 546 | pppp[0] = TLorentzVector(pm * sqrt(1. - zz * zz) * cos(phi), |
| 547 | pm * sqrt(1. - zz * zz) * sin(phi), |
| 548 | pm * zz, sqrt(pm * pm + m1 * m1)); |
| 549 | |
| 550 | pppp[1] = TLorentzVector(-(pppp[0].Vect()), |
| 551 | sqrt(pm * pm + m2 * m2)); |
| 552 | |
| 553 | pppp[0].Boost(wsb); |
| 554 | pppp[1].Boost(wsb); |
| 555 | |
| 556 | } else { |
| 557 | // more than two body |
| 558 | double* massa = new double [ndecay]; |
| 559 | for (int i = 0; i < ndecay ; i++) massa[i] = parti[i].pmassp ; |
| 560 | |
| 561 | int jcode = sutool.pdecy(w, massa , wsb, pppp, ndecay); |
| 562 | if (jcode == 0) continue; |
| 563 | |
| 564 | delete [] massa ; |
| 565 | } |
| 566 | // more decay |
| 567 | npoint = 0; |
| 568 | int nlist = 0; |
| 569 | int jcode = 0; |
| 570 | |
| 571 | for (int i = 1 ; i <= ndecay ; i++) { |
| 572 | if (parti[i - 1].ndec <= 1) { |
| 573 | npoint++ ; |
| 574 | partgen[npoint - 1].part_prop = parti[i - 1]; |
| 575 | partgen[npoint - 1].p = pppp[i - 1]; |
| 576 | jcode = 1; |
| 577 | } else { |
| 578 | nlist++ ; |
| 579 | npoint++ ; |
| 580 | |
| 581 | double* massa = new double [ parti[i - 1].ndec ]; |
| 582 | for (int j = 0; j < parti[i - 1].ndec ; j++) |
| 583 | massa[j] = parts[nlist - 1 + j].pmass ; |
| 584 | TVector3 pppb = (1. / pppp[i - 1].T()) * pppp[i - 1].Vect(); |
| 585 | TLorentzVector* ppptmp = new TLorentzVector [ parti[i - 1].ndec ]; |
| 586 | |
| 587 | jcode = sutool.pdecy(parti[i - 1].pmassp, massa, pppb, ppptmp, |
| 588 | parti[i - 1].ndec); |
| 589 | for (int j = 0; j < parti[i - 1].ndec ; j++) |
| 590 | partgen[npoint - 1 + j].p = ppptmp[j] ; |
| 591 | |
| 592 | delete [] ppptmp ; |
| 593 | delete [] massa ; |
| 594 | |
| 595 | if (jcode == 0) break ; |
| 596 | |
| 597 | for (int k = nlist ; k <= nlist + parti[i - 1].ndec - 1 ; k++) { |
| 598 | partgen[npoint - 1].part_prop = parts[k - 1]; |
| 599 | npoint++ ; |
| 600 | } |
| 601 | nlist += parti[i - 1].ndec - 1 ; |
| 602 | npoint--; |
| 603 | |
| 604 | } |
| 605 | } |
| 606 | if (jcode == 0) continue ; |
| 607 | |
| 608 | int iret = tpuser(pe, pp, partgen, npoint); |
| 609 | if (iret <= 0) continue ; |
| 610 | break; |
| 611 | } while (true); |
| 612 | //************* Generation end ******************** |
| 613 | // variable for the kinematical check |
| 614 | TLorentzVector pfinal = TLorentzVector(0., 0., 0., 0.); |
| 615 | for (int i = 0 ; i < npoint ; i++)pfinal += partgen[i].p ; |
| 616 | TLorentzVector pcm = pe + pp + pfinal; |
| 617 | double ptsumcm = sqrt(pfinal.X() * pfinal.X() + pfinal.Y() * pfinal.Y()); |
| 618 | double pzsumcm = pfinal.Z(); |
| 619 | double eall = pcm.T(); |
| 620 | double wcal = sqrt(pfinal.T() * pfinal.T() - |
| 621 | ptsumcm * ptsumcm - pzsumcm * pzsumcm); |
| 622 | treh1->Fill((float)pzsumcm, 1.0); |
| 623 | treh2->Fill((float)ptsumcm, 1.0); |
| 624 | treh3->Fill((float)eall, 1.0); |
| 625 | treh6->Fill((float)wcal, 1.0); |
| 626 | |
| 627 | // cos(theta)-pt cut |
| 628 | int rcode = 1 ; |
| 629 | for (int i = 0 ; i < npoint ; i++) { |
| 630 | double zz = partgen[i].p.CosTheta(); |
| 631 | if (abs(zz) > cost_cut && abs(partgen[i].part_prop.pcharg) > qzmin) rcode = 0; |
| 632 | double ptp = sqrt(pow(partgen[i].p.X(), 2) + pow(partgen[i].p.Y(), 2)); |
| 633 | if (ptp < pt_cut && abs(partgen[i].part_prop.pcharg) > qptmin) rcode = 0; |
| 634 | } |
| 635 | //************* final boost *********** |
| 636 | sutool.rotate(pe, etheta, ephi); |
| 637 | pe.Boost(tswsb); |
| 638 | sutool.rotate(pp, etheta, ephi); |
| 639 | pp.Boost(tswsb); |
| 640 | for (int i = 0; i < npoint ; i++) { |
| 641 | sutool.rotate(partgen[i].p, etheta, ephi); |
| 642 | partgen[i].p.Boost(tswsb); |
| 643 | } |
| 644 | |
| 645 | TLorentzVector plab(0., 0., 0., 0.); |
| 646 | for (int i = 0; i < npoint ; i++) plab += partgen[i].p ; |
| 647 | |
| 648 | treh4->Fill((float)(plab.Z()), 1.0); |
| 649 | treh5->Fill((float)(sqrt(plab.X()*plab.X() + plab.Y()*plab.Y())), 1.0); |
| 650 | |
| 651 | // std::cout << iev << std::endl; |
| 652 | ievent = iev; |
| 653 | npart = npoint; |
| 654 | |
| 655 | if (rcode == 0) return 0; |
| 656 | |
| 657 | trkpsh(iev, pe, pp, partgen, npoint); |
| 658 | nsave++ ; |
| 659 | return 1; |
| 660 | } |
| 661 | |
| 662 | double TrepsB::tpgetq(double _s, double z, double _q2max) |
| 663 | { |
| 664 | B2DEBUG(20, "Parameter _s=" << _s << " given but not used")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "Parameter _s=" << _s << " given but not used" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 664 , 20)); }; } } while(false); } while(false); |
| 665 | // get one Q2 value |
| 666 | double q2min = me * me * z * z / (1. - z); |
| 667 | double rk = 1. / log(_q2max / q2min); |
| 668 | double ccc = rk * log(q2min); |
| 669 | double rr = gRandom->Uniform(); |
| 670 | double xx = (rr + ccc) / rk ; |
| 671 | |
| 672 | return exp(xx); |
| 673 | } |
| 674 | |
| 675 | void TrepsB::tpgetm(Part_cont* part, int _ndecay) |
| 676 | { |
| 677 | // get a mass value from Breit-Wigner distribution |
| 678 | // const double tmax = 1.3258 ; // 2Gamma |
| 679 | const double tmax = 1.4289 ; // 3.5Gamma |
| 680 | |
| 681 | for (int i = 0; i < _ndecay ; i++) { |
| 682 | if (part[i].pwidth < 0.001) { |
| 683 | part[i].pmassp = part[i].pmass ; |
| 684 | } else { |
| 685 | part[i].pmassp = part[i].pmass + 0.5 * part[i].pwidth * |
| 686 | tan(2.*tmax * (gRandom->Uniform() - 0.5)); |
| 687 | if (part[i].pmassp < 0.0) part[i].pmassp = 0.0 ; |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | |
| 693 | // |
| 694 | // const member functions |
| 695 | // |
| 696 | |
| 697 | void TrepsB::terminate() const |
| 698 | { |
| 699 | |
| 700 | B2DEBUG(20, nsave << " events saved.")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << nsave << " events saved."; Belle2::LogSystem:: Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig:: c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 700, 20)); }; } } while( false); } while(false); |
| 701 | // trfile->write(); |
| 702 | //std::cout << "Histograms are written in "<< filnam_hist << std::endl; |
| 703 | } |
| 704 | |
| 705 | double TrepsB::tpdfnc(double d) const |
| 706 | { |
| 707 | // New (Working) version 2016 April S.Uehara |
| 708 | const double alpppi = 0.002322816 ; |
| 709 | double y0 = (d + sqrt(d * d + 4.*rs)) * 0.5; |
| 710 | double z0 = y0 - d; |
| 711 | double xminy = log(me * me * y0 * y0 / (1.0 - y0)); |
| 712 | double xminz = log(me * me * z0 * z0 / (1.0 - z0)); |
| 713 | double xmax = log(q2max) ; |
| 714 | double integy = simpsny(d, xminy, xmax, 1000); |
| 715 | double integz = simpsnz(d, xminz, xmax, 1000); |
| 716 | double integrd = (integy + (-1. + y0) / y0) * (integz + (-1. + z0) / z0) / sqrt(d * d + 4.*rs) |
| 717 | * alpppi * alpppi; |
| 718 | |
| 719 | return integrd; |
| 720 | } |
| 721 | |
| 722 | double TrepsB::simpsny(double d, double xl, double xh, int n) const |
| 723 | { |
| 724 | int nn = n / 2 * 2 ; |
| 725 | double h = (xh - xl) / (double)nn ; |
| 726 | double _s = tpdfy(d, xl) + tpdfy(d, xh) ; |
| 727 | for (int i = 1 ; i <= nn - 1 ; i += 2) { |
| 728 | double x = xl + (double)i * h ; |
| 729 | _s += 4.0 * tpdfy(d, x) ; |
| 730 | } |
| 731 | for (int i = 2 ; i <= nn - 2 ; i += 2) { |
| 732 | double x = xl + (double)i * h ; |
| 733 | _s += 2.0 * tpdfy(d, x) ; |
| 734 | } |
| 735 | return h * _s / 3.0 ; |
| 736 | } |
| 737 | |
| 738 | double TrepsB::tpdfy(double d, double x) const |
| 739 | { |
| 740 | double q2 = exp(x); |
| 741 | double y = ((d - q2 / s) + sqrt(d * d - 2.*q2 / s * d + 4.*q2 / s + 4.*rs)) * 0.5; |
| 742 | double integrq = (1. + (1. - y) * (1. - y)) / y * (1. - (-d + 2.) * q2 / (d * d + 4.*rs) / s) * 0.5; |
| 743 | if (y - d >= 1.) integrq = 0.; // z=y-d |
| 744 | return integrq * tplogf(x); |
| 745 | } |
| 746 | |
| 747 | double TrepsB::simpsnz(double d, double xl, double xh, int n) const |
| 748 | { |
| 749 | int nn = n / 2 * 2 ; |
| 750 | double h = (xh - xl) / (double)nn ; |
| 751 | double _s = tpdfz(d, xl) + tpdfz(d, xh) ; |
| 752 | for (int i = 1 ; i <= nn - 1 ; i += 2) { |
| 753 | double x = xl + (double)i * h ; |
| 754 | _s += 4.0 * tpdfz(d, x) ; |
| 755 | } |
| 756 | for (int i = 2 ; i <= nn - 2 ; i += 2) { |
| 757 | double x = xl + (double)i * h ; |
| 758 | _s += 2.0 * tpdfz(d, x) ; |
| 759 | } |
| 760 | return h * _s / 3.0 ; |
| 761 | } |
| 762 | |
| 763 | double TrepsB::tpdfz(double d, double x) const |
| 764 | { |
| 765 | double q2 = exp(x); |
| 766 | double z = ((-d - q2 / s) + sqrt(d * d - 2.*q2 / s * d + 4.*q2 / s + 4.*rs)) * 0.5; |
| 767 | double integrq = (1. + (1. - z) * (1. - z)) / z * (1. - (-d + 2.) * q2 / (d * d + 4.*rs) / s) * 0.5; |
| 768 | if (z + d >= 1.) integrq = 0.; //y=z+d |
| 769 | return integrq * tplogf(x); |
| 770 | } |
| 771 | |
| 772 | |
| 773 | double TrepsB::tpxint(double r, double _rs, double _q2max) const |
| 774 | { |
| 775 | // const double alpppi = 0.002322816 ; |
| 776 | |
| 777 | double y = sqrt(r * _rs); |
| 778 | double z = sqrt(_rs / r); |
| 779 | return tpf(y, _q2max) * tpf(z, _q2max) * 0.5 / r ; |
| 780 | } |
| 781 | |
| 782 | double TrepsB::tpf(double z, double _q2max) const |
| 783 | { |
| 784 | const double alpppi = 0.002322816 ; |
| 785 | double tpfx ; |
| 786 | if (imode == 0) { |
| 787 | tpfx = 1. / z * ((1. + (1. - z) * (1. - z)) * log(_q2max * (1. - z) / me / me / z / z) * 0.5 |
| 788 | - 1.0 + z) * alpppi ; |
| 789 | } else { |
| 790 | double xmin = log(me * me * z * z / (1.0 - z)); |
| 791 | double xmax = log(_q2max) ; |
| 792 | tpfx = 1. / z * ((1. + (1. - z) * (1. - z)) * simpsn2(xmin, xmax, 1000) * 0.5 |
| 793 | - 1.0 + z) * alpppi ; |
| 794 | } |
| 795 | return tpfx ; |
| 796 | } |
| 797 | |
| 798 | double TrepsB::simpsn1(double xl, double xh, int n) const |
| 799 | { |
| 800 | int nn = n / 2 * 2 ; |
| 801 | double h = (xh - xl) / (double)nn ; |
| 802 | double _s = tpdfnc(xl) + tpdfnc(xh) ; |
| 803 | for (int i = 1 ; i <= nn - 1 ; i += 2) { |
| 804 | double x = xl + (double)i * h ; |
| 805 | _s += 4.0 * tpdfnc(x) ; |
| 806 | } |
| 807 | for (int i = 2 ; i <= nn - 2 ; i += 2) { |
| 808 | double x = xl + (double)i * h ; |
| 809 | _s += 2.0 * tpdfnc(x) ; |
| 810 | } |
| 811 | return h * _s / 3.0 ; |
| 812 | } |
| 813 | |
| 814 | double TrepsB::simpsn2(double xl, double xh, int n) const |
| 815 | { |
| 816 | int nn = n / 2 * 2 ; |
| 817 | double h = (xh - xl) / (double)nn ; |
| 818 | double _s = tplogf(xl) + tplogf(xh) ; |
| 819 | for (int i = 1 ; i <= nn - 1 ; i += 2) { |
| 820 | double x = xl + (double)i * h ; |
| 821 | _s += 4.0 * tplogf(x) ; |
| 822 | } |
| 823 | for (int i = 2 ; i <= nn - 2 ; i += 2) { |
| 824 | double x = xl + (double)i * h ; |
| 825 | _s += 2.0 * tplogf(x) ; |
| 826 | } |
| 827 | return h * _s / 3.0 ; |
| 828 | } |
| 829 | |
| 830 | double TrepsB::tplogf(double x) const |
| 831 | { |
| 832 | double q2 = exp(x); |
| 833 | return tpform(q2, w) ; |
| 834 | } |
| 835 | |
| 836 | |
| 837 | double TrepsB::tpform(double _q2, double _w) const |
| 838 | { |
| 839 | //form factor effect |
| 840 | B2DEBUG(20, "Parameters _q2=" << _q2 << " and _w=" << _w << " are given but not used")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "Parameters _q2=" << _q2 << " and _w=" << _w << " are given but not used"; Belle2::LogSystem::Instance ().sendMessage(Belle2::LogMessage(Belle2::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 840, 20)); }; } } while(false); } while(false); |
| 841 | double dis = 1.0 ; |
| 842 | return dis ; |
| 843 | } |
| 844 | |
| 845 | double TrepsB::tpangd(double _z, double _w) |
| 846 | { |
| 847 | B2DEBUG(20, "Parameters _z=" << _z << " and _w=" << _w << " are given but not used")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "Parameters _z=" << _z << " and _w=" << _w << " are given but not used"; Belle2::LogSystem::Instance ().sendMessage(Belle2::LogMessage(Belle2::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 847, 20)); }; } } while(false); } while(false); |
| 848 | double c = 1.0 ; |
| 849 | return c; |
| 850 | } |
| 851 | |
| 852 | int TrepsB::tpuser(TLorentzVector _pe, TLorentzVector _pp, |
| 853 | Part_gen* part, int _npart) |
| 854 | { |
| 855 | // user decision routine for extra generation conditions. |
| 856 | // Return positive integer for the generation, otherwise, this event will |
| 857 | // be canceled. |
| 858 | // CAUTION!: The 4-momenta of particles are represented in the e+e- c.m. system |
| 859 | // |
| 860 | B2DEBUG(20, "User decision routine for extra generation condition is not used."do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "User decision routine for extra generation condition is not used." << " _pe(" << _pe.Px() << "," << _pe .Py() << "," << _pe.Pz() << "), " << " _pp(" << _pp.Px() << "," << _pp.Py() << "," << _pp.Pz() << "), " << " *part at " << part << " and _npart = " << _npart << " are given but not used" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 863 , 20)); }; } } while(false); } while(false) |
| 861 | << " _pe(" << _pe.Px() << "," << _pe.Py() << "," << _pe.Pz() << "), "do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "User decision routine for extra generation condition is not used." << " _pe(" << _pe.Px() << "," << _pe .Py() << "," << _pe.Pz() << "), " << " _pp(" << _pp.Px() << "," << _pp.Py() << "," << _pp.Pz() << "), " << " *part at " << part << " and _npart = " << _npart << " are given but not used" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 863 , 20)); }; } } while(false); } while(false) |
| 862 | << " _pp(" << _pp.Px() << "," << _pp.Py() << "," << _pp.Pz() << "), "do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "User decision routine for extra generation condition is not used." << " _pe(" << _pe.Px() << "," << _pe .Py() << "," << _pe.Pz() << "), " << " _pp(" << _pp.Px() << "," << _pp.Py() << "," << _pp.Pz() << "), " << " *part at " << part << " and _npart = " << _npart << " are given but not used" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 863 , 20)); }; } } while(false); } while(false) |
| 863 | << " *part at " << part << " and _npart = " << _npart << " are given but not used")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "User decision routine for extra generation condition is not used." << " _pe(" << _pe.Px() << "," << _pe .Py() << "," << _pe.Pz() << "), " << " _pp(" << _pp.Px() << "," << _pp.Py() << "," << _pp.Pz() << "), " << " *part at " << part << " and _npart = " << _npart << " are given but not used" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 863 , 20)); }; } } while(false); } while(false); |
| 864 | return 1 ; |
| 865 | } |
| 866 | |
| 867 | void TrepsB::trkpsh(int iev, |
| 868 | TLorentzVector _pe, TLorentzVector _pp, |
| 869 | Part_gen* part, int n) const |
| 870 | { |
| 871 | B2DEBUG(20, "iev = " << iev << " _pe(" << _pe.Px() << "," << _pe.Py() << "," << _pe.Pz() << "), "do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "iev = " << iev << " _pe(" << _pe .Px() << "," << _pe.Py() << "," << _pe .Pz() << "), " << " _pp(" << _pp.Px() << "," << _pp.Py() << "," << _pp.Pz() << "), " << " *part at " << part << " and n = " << n << " are given but not used"; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 873, 20)); }; } } while( false); } while(false) |
| 872 | << " _pp(" << _pp.Px() << "," << _pp.Py() << "," << _pp.Pz() << "), "do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "iev = " << iev << " _pe(" << _pe .Px() << "," << _pe.Py() << "," << _pe .Pz() << "), " << " _pp(" << _pp.Px() << "," << _pp.Py() << "," << _pp.Pz() << "), " << " *part at " << part << " and n = " << n << " are given but not used"; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 873, 20)); }; } } while( false); } while(false) |
| 873 | << " *part at " << part << " and n = " << n << " are given but not used")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "iev = " << iev << " _pe(" << _pe .Px() << "," << _pe.Py() << "," << _pe .Pz() << "), " << " _pp(" << _pp.Px() << "," << _pp.Py() << "," << _pp.Pz() << "), " << " *part at " << part << " and n = " << n << " are given but not used"; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 873, 20)); }; } } while( false); } while(false); |
| 874 | } |
| 875 | |
| 876 | void TrepsB::print_event() const |
| 877 | { |
| 878 | |
| 879 | const int& iev = ievent; |
| 880 | const int& n = npart; |
| 881 | const Part_gen* part = partgen; |
| 882 | |
| 883 | TLorentzVector pf(0., 0., 0., 0.); |
| 884 | for (int i = 0 ; i < n; i++) pf += part[i].p ; |
| 885 | TLorentzVector psum = pf + pe + pp ; |
| 886 | |
| 887 | double q2e = -((pe - peb).Mag2()); |
| 888 | double q2p = -((pp - ppb).Mag2()); |
| 889 | double www = pf.Mag(); |
| 890 | |
| 891 | B2DEBUG(20, "")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << ""; Belle2::LogSystem::Instance().sendMessage(Belle2 ::LogMessage(Belle2::LogConfig::c_Debug, std::move(varStream) , "generators", __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc" , 891, 20)); }; } } while(false); } while(false); |
| 892 | B2DEBUG(20, "**************** Event# = " << iev << " ******************")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "**************** Event# = " << iev << " ******************" ; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 892 , 20)); }; } } while(false); } while(false); |
| 893 | for (int i = 0; i < n; i++) { |
| 894 | B2DEBUG(20, std::setw(2) << i + 1 << std::setw(11) << std::setprecision(4) << part[i].p.X() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << i + 1 << std::setw(11) << std::setprecision(4) << part[i].p.X() << std::setw (11) << std::setprecision(4) << part[i].p.Y() << std::setw(11) << std::setprecision(4) << part[i] .p.Z() << std::setw(11) << std::setprecision(4) << part[i].p.T() << std::setw(7) << part[i].part_prop .icode << std::setw(11) << std::setprecision(4) << part[i].part_prop.pmass << std::setw(6) << std:: setprecision(2) << part[i].part_prop.pcharg; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 900, 20)); }; } } while( false); } while(false) |
| 895 | std::setw(11) << std::setprecision(4) << part[i].p.Y() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << i + 1 << std::setw(11) << std::setprecision(4) << part[i].p.X() << std::setw (11) << std::setprecision(4) << part[i].p.Y() << std::setw(11) << std::setprecision(4) << part[i] .p.Z() << std::setw(11) << std::setprecision(4) << part[i].p.T() << std::setw(7) << part[i].part_prop .icode << std::setw(11) << std::setprecision(4) << part[i].part_prop.pmass << std::setw(6) << std:: setprecision(2) << part[i].part_prop.pcharg; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 900, 20)); }; } } while( false); } while(false) |
| 896 | std::setw(11) << std::setprecision(4) << part[i].p.Z() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << i + 1 << std::setw(11) << std::setprecision(4) << part[i].p.X() << std::setw (11) << std::setprecision(4) << part[i].p.Y() << std::setw(11) << std::setprecision(4) << part[i] .p.Z() << std::setw(11) << std::setprecision(4) << part[i].p.T() << std::setw(7) << part[i].part_prop .icode << std::setw(11) << std::setprecision(4) << part[i].part_prop.pmass << std::setw(6) << std:: setprecision(2) << part[i].part_prop.pcharg; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 900, 20)); }; } } while( false); } while(false) |
| 897 | std::setw(11) << std::setprecision(4) << part[i].p.T() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << i + 1 << std::setw(11) << std::setprecision(4) << part[i].p.X() << std::setw (11) << std::setprecision(4) << part[i].p.Y() << std::setw(11) << std::setprecision(4) << part[i] .p.Z() << std::setw(11) << std::setprecision(4) << part[i].p.T() << std::setw(7) << part[i].part_prop .icode << std::setw(11) << std::setprecision(4) << part[i].part_prop.pmass << std::setw(6) << std:: setprecision(2) << part[i].part_prop.pcharg; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 900, 20)); }; } } while( false); } while(false) |
| 898 | std::setw(7) << part[i].part_prop.icode <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << i + 1 << std::setw(11) << std::setprecision(4) << part[i].p.X() << std::setw (11) << std::setprecision(4) << part[i].p.Y() << std::setw(11) << std::setprecision(4) << part[i] .p.Z() << std::setw(11) << std::setprecision(4) << part[i].p.T() << std::setw(7) << part[i].part_prop .icode << std::setw(11) << std::setprecision(4) << part[i].part_prop.pmass << std::setw(6) << std:: setprecision(2) << part[i].part_prop.pcharg; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 900, 20)); }; } } while( false); } while(false) |
| 899 | std::setw(11) << std::setprecision(4) << part[i].part_prop.pmass <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << i + 1 << std::setw(11) << std::setprecision(4) << part[i].p.X() << std::setw (11) << std::setprecision(4) << part[i].p.Y() << std::setw(11) << std::setprecision(4) << part[i] .p.Z() << std::setw(11) << std::setprecision(4) << part[i].p.T() << std::setw(7) << part[i].part_prop .icode << std::setw(11) << std::setprecision(4) << part[i].part_prop.pmass << std::setw(6) << std:: setprecision(2) << part[i].part_prop.pcharg; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 900, 20)); }; } } while( false); } while(false) |
| 900 | std::setw(6) << std::setprecision(2) << part[i].part_prop.pcharg)do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << i + 1 << std::setw(11) << std::setprecision(4) << part[i].p.X() << std::setw (11) << std::setprecision(4) << part[i].p.Y() << std::setw(11) << std::setprecision(4) << part[i] .p.Z() << std::setw(11) << std::setprecision(4) << part[i].p.T() << std::setw(7) << part[i].part_prop .icode << std::setw(11) << std::setprecision(4) << part[i].part_prop.pmass << std::setw(6) << std:: setprecision(2) << part[i].part_prop.pcharg; Belle2::LogSystem ::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig ::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 900, 20)); }; } } while( false); } while(false); |
| 901 | } |
| 902 | B2DEBUG(20, std::setw(2) << "e-" << std::setw(11) << std::setprecision(4) << pe.X() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e-" << std::setw(11) << std::setprecision(4) << pe.X() << std::setw(11) << std::setprecision(4) << pe.Y() << std::setw(11) << std::setprecision(4) << pe.Z() << std::setw(11) << std::setprecision(4) << pe.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << -1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 908, 20)); }; } } while( false); } while(false) |
| 903 | std::setw(11) << std::setprecision(4) << pe.Y() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e-" << std::setw(11) << std::setprecision(4) << pe.X() << std::setw(11) << std::setprecision(4) << pe.Y() << std::setw(11) << std::setprecision(4) << pe.Z() << std::setw(11) << std::setprecision(4) << pe.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << -1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 908, 20)); }; } } while( false); } while(false) |
| 904 | std::setw(11) << std::setprecision(4) << pe.Z() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e-" << std::setw(11) << std::setprecision(4) << pe.X() << std::setw(11) << std::setprecision(4) << pe.Y() << std::setw(11) << std::setprecision(4) << pe.Z() << std::setw(11) << std::setprecision(4) << pe.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << -1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 908, 20)); }; } } while( false); } while(false) |
| 905 | std::setw(11) << std::setprecision(4) << pe.T() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e-" << std::setw(11) << std::setprecision(4) << pe.X() << std::setw(11) << std::setprecision(4) << pe.Y() << std::setw(11) << std::setprecision(4) << pe.Z() << std::setw(11) << std::setprecision(4) << pe.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << -1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 908, 20)); }; } } while( false); } while(false) |
| 906 | " " <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e-" << std::setw(11) << std::setprecision(4) << pe.X() << std::setw(11) << std::setprecision(4) << pe.Y() << std::setw(11) << std::setprecision(4) << pe.Z() << std::setw(11) << std::setprecision(4) << pe.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << -1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 908, 20)); }; } } while( false); } while(false) |
| 907 | std::setw(11) << std::setprecision(4) << me <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e-" << std::setw(11) << std::setprecision(4) << pe.X() << std::setw(11) << std::setprecision(4) << pe.Y() << std::setw(11) << std::setprecision(4) << pe.Z() << std::setw(11) << std::setprecision(4) << pe.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << -1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 908, 20)); }; } } while( false); } while(false) |
| 908 | std::setw(6) << std::setprecision(2) << -1.0)do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e-" << std::setw(11) << std::setprecision(4) << pe.X() << std::setw(11) << std::setprecision(4) << pe.Y() << std::setw(11) << std::setprecision(4) << pe.Z() << std::setw(11) << std::setprecision(4) << pe.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << -1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 908, 20)); }; } } while( false); } while(false); |
| 909 | |
| 910 | B2DEBUG(20, std::setw(2) << "e+" << std::setw(11) << std::setprecision(4) << pp.X() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e+" << std::setw(11) << std::setprecision(4) << pp.X() << std::setw(11) << std::setprecision(4) << pp.Y() << std::setw(11) << std::setprecision(4) << pp.Z() << std::setw(11) << std::setprecision(4) << pp.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << 1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 916, 20)); }; } } while( false); } while(false) |
| 911 | std::setw(11) << std::setprecision(4) << pp.Y() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e+" << std::setw(11) << std::setprecision(4) << pp.X() << std::setw(11) << std::setprecision(4) << pp.Y() << std::setw(11) << std::setprecision(4) << pp.Z() << std::setw(11) << std::setprecision(4) << pp.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << 1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 916, 20)); }; } } while( false); } while(false) |
| 912 | std::setw(11) << std::setprecision(4) << pp.Z() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e+" << std::setw(11) << std::setprecision(4) << pp.X() << std::setw(11) << std::setprecision(4) << pp.Y() << std::setw(11) << std::setprecision(4) << pp.Z() << std::setw(11) << std::setprecision(4) << pp.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << 1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 916, 20)); }; } } while( false); } while(false) |
| 913 | std::setw(11) << std::setprecision(4) << pp.T() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e+" << std::setw(11) << std::setprecision(4) << pp.X() << std::setw(11) << std::setprecision(4) << pp.Y() << std::setw(11) << std::setprecision(4) << pp.Z() << std::setw(11) << std::setprecision(4) << pp.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << 1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 916, 20)); }; } } while( false); } while(false) |
| 914 | " " <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e+" << std::setw(11) << std::setprecision(4) << pp.X() << std::setw(11) << std::setprecision(4) << pp.Y() << std::setw(11) << std::setprecision(4) << pp.Z() << std::setw(11) << std::setprecision(4) << pp.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << 1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 916, 20)); }; } } while( false); } while(false) |
| 915 | std::setw(11) << std::setprecision(4) << me <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e+" << std::setw(11) << std::setprecision(4) << pp.X() << std::setw(11) << std::setprecision(4) << pp.Y() << std::setw(11) << std::setprecision(4) << pp.Z() << std::setw(11) << std::setprecision(4) << pp.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << 1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 916, 20)); }; } } while( false); } while(false) |
| 916 | std::setw(6) << std::setprecision(2) << 1.0)do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "e+" << std::setw(11) << std::setprecision(4) << pp.X() << std::setw(11) << std::setprecision(4) << pp.Y() << std::setw(11) << std::setprecision(4) << pp.Z() << std::setw(11) << std::setprecision(4) << pp.T() << " " << std::setw(11) << std::setprecision(4) << me << std::setw(6) << std::setprecision(2) << 1.0; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 916, 20)); }; } } while( false); } while(false); |
| 917 | |
| 918 | B2DEBUG(20, "-----------------------------------------------")do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << "-----------------------------------------------"; Belle2 ::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2 ::LogConfig::c_Debug, std::move(varStream), "generators", __PRETTY_FUNCTION__ , "generators/treps/src/Treps3B.cc", 918, 20)); }; } } while( false); } while(false); |
| 919 | B2DEBUG(20, std::setw(2) << "S:" << std::setw(11) << std::setprecision(4) << psum.X() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "S:" << std::setw(11) << std::setprecision(4) << psum.X() << std::setw(11 ) << std::setprecision(4) << psum.Y() << std ::setw(11) << std::setprecision(4) << psum.Z() << std::setw(11) << std::setprecision(4) << psum.T( ); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 922 , 20)); }; } } while(false); } while(false) |
| 920 | std::setw(11) << std::setprecision(4) << psum.Y() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "S:" << std::setw(11) << std::setprecision(4) << psum.X() << std::setw(11 ) << std::setprecision(4) << psum.Y() << std ::setw(11) << std::setprecision(4) << psum.Z() << std::setw(11) << std::setprecision(4) << psum.T( ); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 922 , 20)); }; } } while(false); } while(false) |
| 921 | std::setw(11) << std::setprecision(4) << psum.Z() <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "S:" << std::setw(11) << std::setprecision(4) << psum.X() << std::setw(11 ) << std::setprecision(4) << psum.Y() << std ::setw(11) << std::setprecision(4) << psum.Z() << std::setw(11) << std::setprecision(4) << psum.T( ); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 922 , 20)); }; } } while(false); } while(false) |
| 922 | std::setw(11) << std::setprecision(4) << psum.T())do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << std::setw(2) << "S:" << std::setw(11) << std::setprecision(4) << psum.X() << std::setw(11 ) << std::setprecision(4) << psum.Y() << std ::setw(11) << std::setprecision(4) << psum.Z() << std::setw(11) << std::setprecision(4) << psum.T( ); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 922 , 20)); }; } } while(false); } while(false); |
| 923 | B2DEBUG(20, " Q2:(" << q2e << ", " << q2p << ")" <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << " Q2:(" << q2e << ", " << q2p << ")" << " W: " << www << " ptlab: " << sqrt(pf.X()*pf.X() + pf.Y()*pf.Y()) << " pzlab: " << pf.Z(); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 926 , 20)); }; } } while(false); } while(false) |
| 924 | " W: " << www <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << " Q2:(" << q2e << ", " << q2p << ")" << " W: " << www << " ptlab: " << sqrt(pf.X()*pf.X() + pf.Y()*pf.Y()) << " pzlab: " << pf.Z(); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 926 , 20)); }; } } while(false); } while(false) |
| 925 | " ptlab: " << sqrt(pf.X()*pf.X() + pf.Y()*pf.Y()) <<do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << " Q2:(" << q2e << ", " << q2p << ")" << " W: " << www << " ptlab: " << sqrt(pf.X()*pf.X() + pf.Y()*pf.Y()) << " pzlab: " << pf.Z(); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 926 , 20)); }; } } while(false); } while(false) |
| 926 | " pzlab: " << pf.Z())do { if (Belle2::LogSystem::debugEnabled()) do { if (Belle2:: LogSystem::Instance().isLevelEnabled(Belle2::LogConfig::c_Debug , 20, "generators")) { { LogVariableStream varStream; varStream << " Q2:(" << q2e << ", " << q2p << ")" << " W: " << www << " ptlab: " << sqrt(pf.X()*pf.X() + pf.Y()*pf.Y()) << " pzlab: " << pf.Z(); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage (Belle2::LogConfig::c_Debug, std::move(varStream), "generators" , __PRETTY_FUNCTION__, "generators/treps/src/Treps3B.cc", 926 , 20)); }; } } while(false); } while(false); |
| 927 | } |
| 928 | |
| 929 | void TrepsB::tpkin3(Part_gen* part, |
| 930 | int index1, int index2, int index3, double& z, double& m12, double& zp, |
| 931 | double& phip, double& zs, double& phis, double& phi0) |
| 932 | { |
| 933 | |
| 934 | TLorentzVector p1, p2, p3; //a->(1,2), b=3 |
| 935 | p1 = part[index1].p; |
| 936 | p2 = part[index2].p; |
| 937 | p3 = part[index3].p; |
| 938 | |
| 939 | TVector3 tpcm = (-1. / (p1.T() + p2.T() + p3.T())) * (p1 + p2 + p3).Vect(); |
| 940 | |
| 941 | p1.Boost(tpcm); p2.Boost(tpcm); p3.Boost(tpcm); |
| 942 | |
| 943 | // Now, we are at two-photon c.m.s. |
| 944 | |
| 945 | TLorentzVector pa = p1 + p2; |
| 946 | |
| 947 | m12 = pa.M(); |
| 948 | z = pa.CosTheta(); |
| 949 | phi0 = pa.Phi(); |
| 950 | |
| 951 | sutool.rotate(p1, 0., phi0); |
| 952 | sutool.rotate(p2, 0., phi0); |
| 953 | sutool.rotate(p3, 0., phi0); |
| 954 | |
| 955 | // Now, we are in x-z plane of 12 |
| 956 | |
| 957 | pa = p1 + p2; |
| 958 | TVector3 pacm = (-1. / pa.T()) * pa.Vect(); |
| 959 | TVector3 az = (1. / (pa.Vect()).Mag()) * pa.Vect(); |
| 960 | p1.Boost(pacm); p2.Boost(pacm); |
| 961 | |
| 962 | // Now, we are at 12 c.m.s. |
| 963 | |
| 964 | zp = p1.CosTheta(); phip = p1.Phi(); |
| 965 | |
| 966 | TVector3 ay = TVector3(0., 1., 0.); |
| 967 | TVector3 ax = ay.Cross(az); |
| 968 | |
| 969 | zs = az.Dot(p1.Vect()) / (p1.Vect()).Mag(); |
| 970 | TVector3 azk = az.Cross(p1.Vect()); |
| 971 | double cosphis = ay.Dot(azk) * (1. / azk.Mag()); |
| 972 | double sinphis = ax.Dot(azk) * (-1. / azk.Mag()); |
| 973 | phis = atan2(sinphis, cosphis); |
| 974 | |
| 975 | } |
| 976 | |
| 977 | void TrepsB::tpkin4(Part_gen* part, |
| 978 | int index1, int index2, int index3, int index4, |
| 979 | double& z, double& m12, double& zp, |
| 980 | double& phip, double& zs, double& phis, |
| 981 | double& m34, double& zpp, |
| 982 | double& phipp, double& zss, double& phiss, |
| 983 | double& phi0) |
| 984 | { |
| 985 | |
| 986 | TLorentzVector p1, p2, p3, p4; //a->(1,2), b->(3,4) |
| 987 | p1 = part[index1].p; |
| 988 | p2 = part[index2].p; |
| 989 | p3 = part[index3].p; |
| 990 | p4 = part[index4].p; |
| 991 | |
| 992 | TVector3 tpcm = (-1. / (p1.T() + p2.T() + p3.T() + p4.T())) * (p1 + p2 + p3 + p4).Vect(); |
| 993 | |
| 994 | p1.Boost(tpcm); p2.Boost(tpcm); p3.Boost(tpcm); p4.Boost(tpcm); |
| 995 | |
| 996 | // Now, we are at two-photon c.m.s. |
| 997 | |
| 998 | TLorentzVector pa = p1 + p2; |
| 999 | |
| 1000 | m12 = pa.M(); |
| 1001 | z = pa.CosTheta(); |
| 1002 | phi0 = pa.Phi(); |
| 1003 | |
| 1004 | sutool.rotate(p1, 0., phi0); |
| 1005 | sutool.rotate(p2, 0., phi0); |
| 1006 | sutool.rotate(p3, 0., phi0); |
| 1007 | sutool.rotate(p4, 0., phi0); |
| 1008 | |
| 1009 | // Now, we are in x-z plane of 12 |
| 1010 | |
| 1011 | pa = p1 + p2; |
| 1012 | TVector3 pacm = (-1. / pa.T()) * pa.Vect(); |
| 1013 | TVector3 az = (1. / (pa.Vect()).Mag()) * pa.Vect(); |
| 1014 | p1.Boost(pacm); p2.Boost(pacm); |
| 1015 | |
| 1016 | // Now, we are at 12 c.m.s. |
| 1017 | |
| 1018 | zp = p1.CosTheta(); phip = p1.Phi(); |
| 1019 | |
| 1020 | TVector3 ay = TVector3(0., 1., 0.); |
| 1021 | TVector3 ax = ay.Cross(az); |
| 1022 | |
| 1023 | zs = az.Dot(p1.Vect()) / (p1.Vect()).Mag(); |
| 1024 | TVector3 azk = az.Cross(p1.Vect()); |
| 1025 | double cosphis = ay.Dot(azk) * (1. / azk.Mag()); |
| 1026 | double sinphis = ax.Dot(azk) * (-1. / azk.Mag()); |
| 1027 | phis = atan2(sinphis, cosphis); |
| 1028 | |
| 1029 | // next go to 34 |
| 1030 | |
| 1031 | TLorentzVector pb = p3 + p4; |
| 1032 | |
| 1033 | m34 = pb.M(); |
| 1034 | |
| 1035 | TVector3 pbcm = (-1. / pb.T()) * pb.Vect(); |
| 1036 | p3.Boost(pbcm); p4.Boost(pbcm); |
| 1037 | |
| 1038 | // Now, we are at 34 c.m.s. |
| 1039 | |
| 1040 | zpp = p3.CosTheta(); phipp = p3.Phi(); |
| 1041 | |
| 1042 | // 2004.02.29 Here, I change the definision of zss and phiss |
| 1043 | // Use the same system as 3 |
| 1044 | |
| 1045 | zss = az.Dot(p3.Vect()) / (p3.Vect()).Mag(); |
| 1046 | TVector3 bzk = az.Cross(p3.Vect()); |
| 1047 | double cosphiss = ay.Dot(bzk) * (1. / bzk.Mag()); |
| 1048 | double sinphiss = ax.Dot(bzk) * (-1. / bzk.Mag()); |
| 1049 | phiss = atan2(sinphiss, cosphiss); |
| 1050 | |
| 1051 | } |
| 1052 | void TrepsB::tpkin5(Part_gen* part, |
| 1053 | int index1, int index2, int index3, int index4, int index5, |
| 1054 | double& z, double& m12, double& zp, |
| 1055 | double& phip, double& zs, double& phis, |
| 1056 | TVector3& ps3, TVector3& ps4, TVector3& ps5, |
| 1057 | double& phi0) |
| 1058 | { |
| 1059 | |
| 1060 | TLorentzVector p1, p2, p3, p4, p5; //a->(1,2), b->(3,4, 5) |
| 1061 | p1 = part[index1].p; |
| 1062 | p2 = part[index2].p; |
| 1063 | p3 = part[index3].p; |
| 1064 | p4 = part[index4].p; |
| 1065 | p5 = part[index5].p; |
| 1066 | |
| 1067 | TVector3 tpcm = (-1. / (p1.T() + p2.T() + p3.T() + p4.T() + p5.T())) * (p1 + p2 + p3 + p4 + p5).Vect(); |
| 1068 | |
| 1069 | p1.Boost(tpcm); p2.Boost(tpcm); p3.Boost(tpcm); p4.Boost(tpcm); p5.Boost(tpcm); |
| 1070 | |
| 1071 | // Now, we are at two-photon c.m.s. |
| 1072 | |
| 1073 | TLorentzVector pa = p1 + p2; |
| 1074 | |
| 1075 | m12 = pa.M(); |
| 1076 | z = pa.CosTheta(); |
| 1077 | phi0 = pa.Phi(); |
| 1078 | |
| 1079 | sutool.rotate(p1, 0., phi0); |
| 1080 | sutool.rotate(p2, 0., phi0); |
| 1081 | sutool.rotate(p3, 0., phi0); |
| 1082 | sutool.rotate(p4, 0., phi0); |
| 1083 | sutool.rotate(p5, 0., phi0); |
| 1084 | |
| 1085 | pa = p1 + p2; |
| 1086 | TVector3 pacm = (-1. / pa.T()) * pa.Vect(); |
| 1087 | TVector3 az = (1. / pa.Vect().Mag()) * pa.Vect(); |
| 1088 | p1.Boost(pacm); p2.Boost(pacm); |
| 1089 | |
| 1090 | // Now, we are at 12 c.m.s. |
| 1091 | |
| 1092 | zp = p1.CosTheta(); phip = p1.Phi(); |
| 1093 | |
| 1094 | TVector3 ay = TVector3(0., 1., 0.); |
| 1095 | TVector3 ax = ay.Cross(az); |
| 1096 | |
| 1097 | |
| 1098 | zs = az.Dot(p1.Vect()) / p1.Vect().Mag(); |
| 1099 | TVector3 azk = az.Cross(p1.Vect()); |
| 1100 | double cosphis = ay.Dot(azk) * (1. / azk.Mag()); |
| 1101 | double sinphis = ax.Dot(azk) * (-1. / azk.Mag()); |
| 1102 | phis = atan2(sinphis, cosphis); |
| 1103 | |
| 1104 | // next go to 345 |
| 1105 | |
| 1106 | TLorentzVector pb = p3 + p4 + p5; |
| 1107 | |
| 1108 | |
| 1109 | TVector3 pbcm = (-1. / pb.T()) * pb.Vect(); |
| 1110 | p3.Boost(pbcm); p4.Boost(pbcm); p5.Boost(pbcm); |
| 1111 | ps3 = p3.Vect(); ps4 = p4.Vect(); ps5 = p5.Vect(); |
| 1112 | |
| 1113 | // Now, we are at 345 c.m.s. |
| 1114 | // double mm = 0.1396*0.1396; |
| 1115 | } |
| 1116 | |
| 1117 | } // namespace Belle2 |