67 const double NR = 3.0;
68 const double R0 = 1.4;
71 const double nke = 50;
75 TFile * finp =
new TFile(evtfile.c_str(),
"READ");
76 TTree * ginuke = (TTree*)finp->Get(
"ginuke");
80 ginuke->Draw(
"probe:A",
"iev==0",
"goff");
81 int probe = (int) ginuke->GetV1()[0];
82 int A = (int) ginuke->GetV2()[0];
84 cout <<
"Incident hadron : " << probe << endl;
85 cout <<
"Target mass number : " << A << endl;
87 string probe_label =
"";
89 case ( 22) : probe_label =
"gamma";
break;
90 case ( 211) : probe_label =
"pi+";
break;
91 case ( -211) : probe_label =
"pi-";
break;
92 case ( 111) : probe_label =
"pi0";
break;
93 case ( 2212) : probe_label =
"p";
break;
94 case ( 2112) : probe_label =
"n";
break;
95 default : probe_label =
"X";
break;
97 const char * pl = probe_label.c_str();
100 TH1D * sigma_tot =
new TH1D(
"sigma_tot", Form(
"%s A(=%d) total", pl,A),
nke,
kemin,
kemax);
101 TH1D * sigma_reac =
new TH1D(
"sigma_reac", Form(
"%s A(=%d) reaction", pl,A),
nke,
kemin,
kemax);
102 TH1D * sigma_cex =
new TH1D(
"sigma_cex", Form(
"%s A(=%d) charge exchange", pl,A),
nke,
kemin,
kemax);
103 TH1D * sigma_el =
new TH1D(
"sigma_el", Form(
"%s A(=%d) elastic", pl,A),
nke,
kemin,
kemax);
104 TH1D * sigma_inel =
new TH1D(
"sigma_inel", Form(
"%s A(=%d) inelastic", pl,A),
nke,
kemin,
kemax);
105 TH1D * sigma_abs =
new TH1D(
"sigma_abs", Form(
"%s A(=%d) absorption", pl,A),
nke,
kemin,
kemax);
106 TH1D * sigma_pipro =
new TH1D(
"sigma_pipro", Form(
"%s A(=%d) pi production", pl,A),
nke,
kemin,
kemax);
108 ginuke->Draw(
"1000*ke>>nall",
"",
"");
109 ginuke->Draw(
"1000*ke>>sigma_tot", Form(
"A==%d && probe==%d && probe_fsi>0",A,probe),
"goff");
110 ginuke->Draw(
"1000*ke>>sigma_reac", Form(
"A==%d && probe==%d && probe_fsi>0 && probe_fsi!=2",A,probe),
"goff");
111 ginuke->Draw(
"1000*ke>>sigma_cex", Form(
"A==%d && probe==%d && probe_fsi==1",A,probe),
"goff");
112 ginuke->Draw(
"1000*ke>>sigma_el", Form(
"A==%d && probe==%d && probe_fsi==2",A,probe),
"goff");
113 ginuke->Draw(
"1000*ke>>sigma_inel", Form(
"A==%d && probe==%d && probe_fsi==3",A,probe),
"goff");
114 ginuke->Draw(
"1000*ke>>sigma_abs", Form(
"A==%d && probe==%d && probe_fsi>=4 && probe_fsi<=9",A,probe),
"goff");
115 ginuke->Draw(
"1000*ke>>sigma_pipro",Form(
"A==%d && probe==%d && probe_fsi>9",A,probe),
"goff");
117 const double fm2tomb = 10.;
119 double R =
NR *
R0 * TMath::Power((
double)A,0.3333);
120 double S = fm2tomb * TMath::Pi() * TMath::Power(R,2);
122 sigma_tot ->
Divide (nall); sigma_tot -> Scale (S); sigma_tot -> Sumw2 ();
123 sigma_reac ->
Divide (nall); sigma_reac -> Scale (S); sigma_reac -> Sumw2 ();
124 sigma_cex ->
Divide (nall); sigma_cex -> Scale (S); sigma_cex -> Sumw2 ();
125 sigma_el ->
Divide (nall); sigma_el -> Scale (S); sigma_el -> Sumw2 ();
126 sigma_inel ->
Divide (nall); sigma_inel -> Scale (S); sigma_inel -> Sumw2 ();
127 sigma_abs ->
Divide (nall); sigma_abs -> Scale (S); sigma_abs -> Sumw2 ();
128 sigma_pipro ->
Divide (nall); sigma_pipro -> Scale (S); sigma_pipro -> Sumw2 ();
138 sigma_tot ->
GetXaxis()->SetTitle(Form(
"%s KE (MeV)", pl));
139 sigma_tot ->
GetYaxis()->SetTitle(
"#sigma_{tot} (mb)");
140 sigma_reac ->
GetXaxis()->SetTitle(Form(
"%s KE (MeV)", pl));
141 sigma_reac ->
GetYaxis()->SetTitle(
"#sigma_{reac} (mb)");
142 sigma_cex ->
GetXaxis()->SetTitle(Form(
"%s KE (MeV)", pl));
143 sigma_cex ->
GetYaxis()->SetTitle(
"#sigma_{1cex} (mb)");
144 sigma_el ->
GetXaxis()->SetTitle(Form(
"%s KE (MeV)", pl));
145 sigma_el ->
GetYaxis()->SetTitle(
"#sigma_{elas} (mb)");
146 sigma_inel ->
GetXaxis()->SetTitle(Form(
"%s KE (MeV)", pl));
147 sigma_inel ->
GetYaxis()->SetTitle(
"#sigma_{inel} (mb)");
148 sigma_abs ->
GetXaxis()->SetTitle(Form(
"%s KE (MeV)", pl));
149 sigma_abs ->
GetYaxis()->SetTitle(
"#sigma_{abs} (mb)");
150 sigma_pipro ->
GetXaxis()->SetTitle(Form(
"%s KE (MeV)", pl));
151 sigma_pipro ->
GetYaxis()->SetTitle(
"#sigma_{#pi prod.} (mb)");
153 gStyle->SetOptStat(0);
155 TCanvas * ctot =
new TCanvas(
"ctot",
"",10,10,500,500);
156 sigma_tot ->
Draw(
"E4");
157 sigma_reac ->
Draw(
"E4SAME");
159 TCanvas * cfates =
new TCanvas(
"cfates",
"",110,110,600,600);
162 sigma_cex ->
Draw (
"E4");
164 sigma_inel ->
Draw (
"E4");
166 sigma_abs ->
Draw (
"E4");
168 sigma_pipro ->
Draw (
"E4");
171 TFile
fout(
"hadxsec.root",
"RECREATE");
172 sigma_tot ->
Write(
"sigma_tot" );
173 sigma_reac ->
Write(
"sigma_reac" );
174 sigma_cex ->
Write(
"sigma_cex" );
175 sigma_el ->
Write(
"sigma_el" );
176 sigma_inel ->
Write(
"sigma_inel" );
177 sigma_abs ->
Write(
"sigma_abs" );
178 sigma_pipro ->
Write(
"sigma_pipro");
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
void Draw(const char *plot, const char *title)
a1 GetXaxis() -> SetTitle("Q2")