23 const double pi = TMath::Pi();
24 const int nsteps1 = 10*COMP, nsteps2 = 10*COMP, nsteps3 = 10*COMP, nsteps4 = 2*COMP;
25 double varmin1, varmin2, varmin3, varmin4, varmax1, varmax2, varmax3, varmax4;
29 printf(
"Please enter neutrino energy: ");
31 printf(
"Trying to find input file for E_nu = %3.1lf GeV...\n", Enu);
33 std::string fname = Form(
"data/d4sigma_hist_%3.1lfGeV.root", Enu);
34 TFile *
file =
new TFile(fname.c_str());
37 printf(
"ERROR: File not found!");
42 for (l=0; l<nsteps4; l++) {
43 hist[l] = (TH3D*)file->Get(Form(
"d4sigma_hist_%d",l));
47 varmin1 = hist[0]->GetXaxis()->GetXmin(); varmax1 = hist[0]->GetXaxis()->GetXmax();
48 varmin2 = hist[0]->GetYaxis()->GetXmin(); varmax2 = hist[0]->GetYaxis()->GetXmax();
49 varmin3 = hist[0]->GetZaxis()->GetXmin(); varmax3 = hist[0]->GetZaxis()->GetXmax();
50 varmin4 = -
pi; varmax4 =
pi;
53 double binedge1[nsteps1+1], binedge2[nsteps2+1], binedge3[nsteps3+1];
54 binedge1[0] = varmin1; binedge2[0] = varmin2; binedge3[0] = varmin3;
55 for (i=1; i<nsteps1; i++) binedge1[i] = hist[0]->
GetXaxis()->GetBinLowEdge(i+1);
56 for (j=1; j<nsteps2; j++) binedge2[j] = hist[0]->
GetYaxis()->GetBinLowEdge(j+1);
57 for (k=1; k<nsteps3; k++) binedge3[k] = hist[0]->GetZaxis()->GetBinLowEdge(k+1);
58 binedge1[nsteps1] = varmax1; binedge2[nsteps2] = varmax2; binedge3[nsteps3] = varmax3;
61 double binwidth1[nsteps1], binwidth2[nsteps2], binwidth3[nsteps3], binwidth4[nsteps4];
62 for (i=0; i<nsteps1; i++) binwidth1[i] = hist[0]->
GetXaxis()->GetBinWidth(i+1);
63 for (j=0; j<nsteps2; j++) binwidth2[j] = hist[0]->
GetYaxis()->GetBinWidth(j+1);
64 for (k=0; k<nsteps3; k++) binwidth3[k] = hist[0]->GetZaxis()->GetBinWidth(k+1);
65 for (l=0; l<nsteps4; l++) binwidth4[l] = (varmax4-varmin4)/nsteps4;
68 TH1D* dTk =
new TH1D(
"dTk",
"d#sigma/dT_{kaon}", nsteps1, binedge1);
69 TH1D* dTl =
new TH1D(
"dTl",
"d#sigma/dT_{lepton}", nsteps2, binedge2);
70 TH1D* dct =
new TH1D(
"dct",
"d#sigma/dcos(#theta_{#nul})", nsteps3, binedge3);
71 TH1D* dph =
new TH1D(
"dph",
"d#sigma/d#phi_{kq}", nsteps4, varmin4, varmax4);
74 double diff1Tk, diff2Tk, diff3Tk;
75 for (i=0; i<nsteps1; i++) {
77 for (j=0; j<nsteps2; j++) {
79 for (k=0; k<nsteps3; k++) {
81 for (l=0; l<nsteps4; l++) {
82 diff3Tk += hist[l]->GetBinContent(i+1,j+1,k+1)*binwidth4[l];
84 diff2Tk += diff3Tk*binwidth3[
k];
86 diff1Tk += diff2Tk*binwidth2[j];
88 dTk->SetBinContent(i+1, diff1Tk*binwidth1[i]);
92 double diff1Tl, diff2Tl, diff3Tl;
93 for (j=0; j<nsteps2; j++) {
95 for (i=0; i<nsteps1; i++) {
97 for (k=0; k<nsteps3; k++) {
99 for (l=0; l<nsteps4; l++) {
100 diff3Tl += hist[l]->GetBinContent(i+1,j+1,k+1)*binwidth4[l];
102 diff2Tl += diff3Tl*binwidth3[
k];
104 diff1Tl += diff2Tl*binwidth1[
i];
106 dTl->SetBinContent(j+1, diff1Tl*binwidth2[j]);
110 double diff1ct, diff2ct, diff3ct;
111 for (k=0; k<nsteps3; k++) {
113 for (i=0; i<nsteps1; i++) {
115 for (j=0; j<nsteps2; j++) {
117 for (l=0; l<nsteps4; l++) {
118 diff3ct += hist[l]->GetBinContent(i+1,j+1,k+1)*binwidth4[l];
120 diff2ct += diff3ct*binwidth2[j];
122 diff1ct += diff2ct*binwidth1[
i];
124 dct->SetBinContent(k+1, diff1ct*binwidth3[k]);
128 double diff1ph, diff2ph, diff3ph;
129 for (l=0; l<nsteps4; l++) {
131 for (i=0; i<nsteps1; i++) {
133 for (j=0; j<nsteps2; j++) {
135 for (k=0; k<nsteps3; k++) {
136 diff3ph += hist[l]->GetBinContent(i+1,j+1,k+1)*binwidth3[
k];
138 diff2ph += diff3ph*binwidth2[j];
140 diff1ph += diff2ph*binwidth1[
i];
142 dph->SetBinContent(l+1, diff1ph*binwidth4[l]);
145 double sum1 = dTk->Integral();
146 double sum2 = dTl->Integral();
147 double sum3 = dct->Integral();
148 double sum4 = dph->Integral();
150 printf(
"Integrals are:\n %.6e\n %.6e\n %.6e\n %.6e\n",sum1,sum2,sum3,sum4);
157 gStyle->SetOptStat(0);
159 std::string outname = Form(
"d4sigma_plot_%3.1lfGeV", Enu);
161 dTl->SetXTitle(
"T_{lepton} [GeV]");
162 dTk->SetXTitle(
"T_{kaon} [GeV]");
163 dct->SetXTitle(
"cos(#theta_{#nul}) [ ]");
164 dph->SetXTitle(
"#phi_{Kq} [rad]");
166 TCanvas *
c1 =
new TCanvas(
"c1",
"Differential cross-sections", 800, 600);
168 c1->cd(1); dTl->Draw();
169 c1->cd(2); dTk->Draw();
170 c1->cd(3); dct->Draw();
171 c1->cd(4); dph->Draw();
172 c1->Print((
"images/"+outname+
".png").c_str()); c1->Close();
174 TFile* outfile =
new TFile((
"data/"+outname+
".root").c_str(),
"RECREATE");
175 dTl->Write(
"dsigma_dTlepton");
176 dTk->Write(
"dsigma_dTkaon");
177 dct->Write(
"dsigma_dcostheta");
178 dph->Write(
"dsigma_dphikq");
180 std::cout << std::endl <<
"Output written to file: " << outname <<
".root" << std::endl << std::endl;
a1 GetYaxis() -> SetTitle("F2")
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
< separator(=)> module_type Type Source location< separator(-)> DummyAnalyzer analyzer< path > DummyAnalyzer_module cc DummyFilter filter< path > DummyFilter_module cc *DummyProducer producer< path > DummyProducer_module cc *DummyProducer producer< path > DummyProducer_module cc< separator(=)> The modules marked *above are degenerate i e specifying the short module_type value leads to an ambiguity In order to use a degenerate in your configuration file
a1 GetXaxis() -> SetTitle("Q2")