6 #include "code/singlekaon_xsec.cxx" 17 const int pLeptonIsUsed = 1;
18 const int thetaIsUsed = 1;
19 const double pi = TMath::Pi();
29 printf(
"Please enter time complexity: ");
31 printf(
"COMP set to %d...\n", COMP);
34 if (type==1) Mlep = 0.510998928e-3;
35 else if (type==2) Mlep = 0.1056583715;
36 else if (type==3) Mlep = 1.77682;
37 else {
std::cout<<
"ERROR: Invalid type!"<<std::endl;
return;}
40 if (reac==1) Mkaon = 0.493677;
41 else if (reac==2) Mkaon = 0.497614;
42 else if (reac==3) Mkaon = 0.493677;
43 else {
std::cout<<
"ERROR: Invalid reaction!"<<std::endl;
return;}
47 inst->
init(Enu, type, reac);
51 int Esteps = (int)(20.0*(Emax-Emin));
55 const int nsteps1 = 10*COMP, nsteps2 = 10*COMP, nsteps3 = 10*COMP, nsteps4 = 2*COMP;
56 double varmin1, varmin2, varmin3, varmin4, varmax1, varmax2, varmax3, varmax4,
temp;
57 double binsvar1[nsteps1+1], binsvar2[nsteps2+1], binsvar3[nsteps3+1], binsvar4[nsteps4+1];
58 double varvals1[nsteps1], varvals2[nsteps2], varvals3[nsteps3], varvals4[nsteps4];
72 std::cout <<
" E [GeV]\txsec [cm^2]" << std::endl;
73 std::cout <<
"-----------------------------" << std::endl;
77 FILE *outfile = fopen((fpath+fname).c_str(),
"w");
78 fprintf(outfile,
"# E [GeV]\txsec [cm^2]\n");
79 fprintf(outfile,
"#-----------------------------\n");
81 for (itenu=0; itenu<=Esteps; itenu++) {
84 Enu = Emin + itenu*0.05;
85 inst->
init(Enu, type, reac);
88 varmin1 = 0.; varmax1 = Enu-Mkaon-Mlep;
97 varmin4 = 0.; varmax4 = 2.*
pi;
100 for (i=0; i<=nsteps1; i++) {
101 binsvar1[
i] = varmin1 + i*(varmax1-varmin1)/nsteps1;
104 for (k=0; k<=nsteps3; k++) {
106 temp = varmax3 - k*(varmax3-varmin3)/nsteps3;
107 binsvar3[
k] = cos(temp);
109 binsvar3[
k] = varmin3 + k*(varmax3-varmin3)/nsteps3;
111 if (verbose && !itenu && k)
112 std::cout <<
"Bin #" << k <<
" has cos(theta) = " << 0.5*(binsvar3[
k]+binsvar3[k-1])
113 <<
",\t width = " << binsvar3[k]-binsvar3[k-1] << std::endl;
115 for (l=0; l<=nsteps4; l++) {
116 binsvar4[l] = varmin4 + l*(varmax4-varmin4)/nsteps4;
120 for (i=0; i<nsteps1; i++) varvals1[i] = 0.5*(binsvar1[i+1]+binsvar1[i]);
122 for (k=0; k<nsteps3; k++) varvals3[k] = 0.5*(binsvar3[k+1]+binsvar3[k]);
123 for (l=0; l<nsteps4; l++) varvals4[l] = 0.5*(binsvar4[l+1]+binsvar4[l]);
132 for (i=0; i<nsteps1; i++) {
133 if (binsvar1[i+1]==binsvar1[i])
continue;
142 varmax2 = sqrt((Enu-Ekaon)*(Enu-Ekaon)-Mlep*Mlep);
145 varmax2 = Enu-Ekaon-Mlep;
147 for (j=0; j<=nsteps2; j++) {
148 temp = varmin2 + j*(varmax2-varmin2)/nsteps2;
150 binsvar2[j] = sqrt(temp*temp+Mlep*Mlep)-Mlep;
154 if (verbose && !pLeptonIsUsed && !itenu && j)
155 std::cout <<
"Bin edge #" << j <<
" has Tlep = " << binsvar2[j]
156 <<
",\t width = " << binsvar2[j]-binsvar2[j-1] << std::endl;
158 for (j=0; j<nsteps2; j++) varvals2[j] = 0.5*(binsvar2[j+1]+binsvar2[j]);
166 for (j=0; j<nsteps2; j++) {
167 if (binsvar2[j+1]==binsvar2[j])
continue;
176 for (k=0; k<nsteps3; k++) {
177 if (binsvar3[k+1]==binsvar3[k])
continue;
178 theta = acos(varvals3[k]);
185 for (l=0; l<nsteps4; l++) {
186 if (binsvar4[l+1]==binsvar4[l])
continue;
190 diff4sigma = inst->
diffxsec(Tlep,Tkaon,theta,phikq);
194 diff3sigma += diff4sigma*(binsvar4[l+1]-binsvar4[l]);
200 diff2sigma += diff3sigma*(binsvar3[k+1]-binsvar3[
k]);
204 diff2sigma *= Elep/sqrt(Elep*Elep-Mlep*Mlep);
206 diff1sigma += diff2sigma*(binsvar2[j+1]-binsvar2[j]);
209 sigma += diff1sigma*(binsvar1[i+1]-binsvar1[
i]);
213 std::cout << Form(
"%12.6lf",Enu) <<
"\t" << sigma << std::endl;
214 fprintf(outfile,
"%lf\t%e\n",Enu,sigma);
218 std::cout << std::endl <<
"Output written to file: " << fpath << fname << std::endl << std::endl;
art art Framework Principal Run temp
the ParameterSet object passed in for the configuration of a destination should be the only source that can affect the behavior of that destination This is to eliminate the dependencies of configuring a destination from multiple mostly from the defaults It suppresses possible glitches about changing the configuration file somewhere outside of a destination segament might still affect the behavior of that destination In the previous configuration for a specific the value of a certain e may come from following and have been suppressed It the configuring ParameterSet object for each destination will be required to carry a parameter list as complete as possible If a parameter still cannot be found in the ParameterSet the configuration code will go look for a hardwired default directly The model is a great simplicity comparing with the previous especially when looking for default values Another great advantage is most of the parameters now have very limited places that allows to appear Usually they can only appear at one certain level in a configuration file For in the old configuring model or in a default ParameterSet object inside of a or in a category or in a severity object This layout of multiple sources for a single parameter brings great confusion in both writing a configuration and in processing the configuration file Under the new the only allowed place for the parameter limit to appear is inside of a category which is inside of a destination object Other improvements simplify the meaning of a destination name In the old a destination name has multiple folds of meanings the e cout and cerr have the special meaning of logging messages to standard output or standard error the name also serves as the output filename if the destination is a file these names are also references to look up for detailed configurations in configuring the MessageFacility The multi purpose of the destination name might cause some unwanted behavior in either writing or parsing the configuration file To amend in the new model the destination name is now merely a name for a which might represent the literal purpose of this or just an id All other meanings of the destinations names now go into the destination ParameterSet as individual such as the type parameter and filename parameter Following is the deatiled rule for the new configuring Everything that is related with MessageFacility configuration must be wrapped in a single ParameterSet object with the name MessageFacility The MessageFacility ParameterSet object contains a series of top level parameters These parameters can be chosen a vector of string listing the name of debug enabled models Or use *to enable debug messages in all modules a vector of string a vector of string a vector of string a ParameterSet object containing the list of all destinations The destinations ParameterSet object is a combination of ParameterSet objects for individual destinations There are two types of destinations that you can insert in the destinations ParameterSet ordinary including cout
double diffxsec(double Tlep, double Tkaon, double theta, double phikq)
these are called *plugin *libraries Plugin libraries are loaded by the *LibraryManager *see above The source file in which a module is implemented must be named< module > _plugin cc It must contain an invocation of the *DEFINE_EDM_PLUGIN *macro The *DEFINE_EDM_PLUGIN *macro is responsible for writing the appropriate *factory **function and that takes a const reference to a *ParameterSet *and that returns a newly created instance of the associated module type
void init(double Etot, int type, int reac)