35 {909900, 909901, 909902, 909903, 909904, 909905, 909906, 909907, 909908, 909909}
38 {919900, 919901, 919902, 919903, 919904, 919905, 919906, 919907, 919908, 919909}
41 {929900, 929901, 929902, 929903, 929904, 929905, 929906, 929907, 929908, 929909}
52 void nuint09_1pi1(
int isample,
int single_pion_sources=0,
int stage=1)
54 cout <<
" ***** running: 1PI.1" << endl;
56 if(isample<0 || isample >=
kNSamples)
return;
57 if(single_pion_sources<0 || single_pion_sources>2)
return;
59 const char * label =
kLabel[isample];
65 TFile fsig(
"../sig/splines.root",
"read");
66 TDirectory * sig_dir = (TDirectory *) fsig.Get(label);
68 TGraph * sig_graph_totcc = (TGraph*) sig_dir->Get(
"tot_cc");
73 const double Enumin = 0.05;
74 const double Enumax = 30.00;
78 ostringstream out_filename;
79 out_filename << label;
81 if (single_pion_sources==0) out_filename <<
".1pi_1a.";
82 else if (single_pion_sources==1) out_filename <<
".1pi_1b.";
83 else if (single_pion_sources==2) out_filename <<
".1pi_1c.";
85 if(stage==0) out_filename <<
"no_FSI.";
87 out_filename <<
"sig1pi_vs_Enu.data";
88 ofstream out_stream(out_filename.str().c_str(), ios::out);
92 out_stream <<
"# [" << label <<
"]" << endl;
93 out_stream <<
"# " << endl;
94 out_stream <<
"# [1PI.1]:" << endl;
95 out_stream <<
"# Total cross section for 1 pion (pi+ only) production as a function of energy" << endl;
97 out_stream <<
"# ***** NO FSI: The {X pi+} state is a primary hadronic state" << endl;
99 if(single_pion_sources==0) {
100 out_stream <<
"# 1pi sources: All" << endl;
102 else if(single_pion_sources==1) {
103 out_stream <<
"# 1pi sources: P33(1232) resonance only" << endl;
105 else if(single_pion_sources==2) {
106 out_stream <<
"# 1pi sources: All resonances only" << endl;
108 out_stream <<
"# " << endl;
109 out_stream <<
"# Note:" << endl;
110 out_stream <<
"# - neutrino energy E in GeV, linear spacing between Emin = " << Enumin <<
" GeV, Emax = " << Enumax <<
" GeV " << endl;
111 out_stream <<
"# - cross sections in 1E-38 cm^2 " << endl;
112 out_stream <<
"# - quoted cross section is nuclear cross section divided with number of nucleons A" << endl;
113 out_stream <<
"# Columns:" << endl;
114 out_stream <<
"# | Energy | sig(nu_mu + A -> mu- 1pi+ X) | " << endl;
116 out_stream << std::fixed << setprecision(6);
122 TChain * chain =
new TChain(
"gst");
125 for(
int iwkcur=0; iwkcur<
kNWCur; iwkcur++) {
129 ostringstream filename;
130 int run_number =
kRunNu1PI1[isample][iwkcur][ir];
132 cout <<
"isample = " << isample <<
", iwkcur = " << iwkcur <<
", ir = " << ir <<
", run = " << run_number << endl;
134 filename <<
"../gst/gntp." << run_number <<
".gst.root";
136 cout <<
"Adding " << filename.str() <<
" to event chain" << endl;
137 chain->Add(filename.str().c_str());
144 TH1D * hst_cc1pip =
new TH1D(
"hst_cc1pip",
"CC1pi+ events, Enu spectrum", nEnu, Enumin, Enumax);
145 TH1D * hst_allcc =
new TH1D(
"hst_allcc",
"all CC events, Enu spectrum", nEnu, Enumin, Enumax);
151 chain->Draw(
"Ev>>hst_allcc",
"cc",
"GOFF");
154 if(single_pion_sources==0) {
156 chain->Draw(
"Ev>>hst_cc1pip",
"cc&&pdgf==211&&nfpip==1&&nfpim==0&&nfpi0==0",
"GOFF");
158 else if(single_pion_sources==1) {
160 chain->Draw(
"Ev>>hst_cc1pip",
"cc&&resid==0&&res&&pdgf==211&&nfpip==1&&nfpim==0&&nfpi0==0",
"GOFF");
162 else if(single_pion_sources==2) {
164 chain->Draw(
"Ev>>hst_cc1pip",
"cc&&res&&pdgf==211&&nfpip==1&&nfpim==0&&nfpi0==0",
"GOFF");
168 if(single_pion_sources==0) {
170 chain->Draw(
"Ev>>hst_cc1pip",
"cc&&pdgi==211&&nipip==1&&nipim==0&&nipi0==0",
"GOFF");
172 else if(single_pion_sources==1) {
174 chain->Draw(
"Ev>>hst_cc1pip",
"cc&&resid==0&&res&&pdgi==211&&nipip==1&&nipim==0&&nipi0==0",
"GOFF");
176 else if(single_pion_sources==2) {
178 chain->Draw(
"Ev>>hst_cc1pip",
"cc&&res&&pdgi==211&&nipip==1&&nipim==0&&nipi0==0",
"GOFF");
182 cout <<
"CC1pi+ nevents: " << hst_cc1pip->GetEntries() << endl;
183 cout <<
"ALLCC nevents: " << hst_allcc->GetEntries() << endl;
190 double e[nEnu], sig[nEnu];
192 for(
int i=1;
i <= hst_cc1pip->GetNbinsX();
i++) {
194 double Enu = hst_cc1pip->GetBinCenter(
i);
196 double Ncc1pip = hst_cc1pip -> GetBinContent(
i);
197 double Nallcc = hst_allcc -> GetBinContent(
i);
200 if(Nallcc>0) { sig_cc1pip = (Ncc1pip/Nallcc) * sig_graph_totcc->Eval(Enu) /
A; }
202 out_stream << setw(15) << Enu << setw(15) << sig_cc1pip << endl;
205 sig[
i-1] = sig_cc1pip;
210 TFile ftmp(
"./cc1pip_tmp.root",
"recreate");
211 TGraph * grCC1pip =
new TGraph(nEnu,e,sig);
212 grCC1pip->Write(
"CC1pip");
217 TCanvas *
c1 =
new TCanvas(
"c1",
"",20,20,500,500);
218 grCC1pip->Draw(
"alp");
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
const int kRunNu1PI1[kNSamples][kNWCur][kNRunsPerCase]
const char * kLabel[kNSamples]
void nuint09_1pi1(int isample, int single_pion_sources=0, int stage=1)