32 if(efficiency<0 || efficiency>100) {
33 cout <<
"Efficiency2Gvs1G : Error - efficiency must be [0,100]" << endl;
37 gROOT->Macro(cfgFile);
44 gROOT->Macro(gSystem->ExpandPathName(
"$CWB_PARAMETERS_FILE"));
45 gROOT->Macro(gSystem->ExpandPathName(
"$CWB_UPARAMETERS_FILE"));
48 vector<TString>
vname[2];
49 vector<double> vhrss[2];
54 cout <<
"1G efficiencies" << endl;
55 for(
int i=0;
i<vname[0].size();
i++) {
56 cout << vname[0][
i] <<
" " << vhrss[0][
i] << endl;
60 cout <<
"2G efficiencies" << endl;
61 for(
int i=0;
i<vname[1].size();
i++) {
62 cout << vname[1][
i] <<
" " << vhrss[1][
i] << endl;
69 cout <<
"1G vs 2G efficiencies" << endl;
74 out <<
"<html>" << endl;
75 out <<
"<font color=\"red\" style=\"font-weight:bold;\"><center><p><h2>"
76 << title <<
"</h2><p><center></font>" << endl;
78 out <<
"<h4>1G : " << endl;
79 sprintf(oline,
"<a target=\"_parent\" href=\"%s\">bkg report page</a>",BWWW_1G);
82 sprintf(oline,
"<a target=\"_parent\" href=\"%s\">sim report page</a>",SWWW_1G);
84 out <<
"</h4>" << endl;
85 out <<
"<h4>2G : " << endl;
86 sprintf(oline,
"<a target=\"_parent\" href=\"%s\">bkg report page</a>",BWWW_2G);
89 sprintf(oline,
"<a target=\"_parent\" href=\"%s\">sim report page</a>",SWWW_2G);
91 out <<
"</h4>" << endl;
93 out <<
"<table border=1 cellpadding=12 align=\"center\">" << endl;
94 out <<
"<br>" << endl;
96 out <<
"<tr align=\"center\">" << endl;
97 out <<
"<td align=\"center\"><font color=\"red\"> ID </font></td>" << endl;
98 out <<
"<td align=\"center\"><font color=\"red\"> MDC </font></td>" << endl;
99 out <<
"<td align=\"center\"><font color=\"red\"> 1G efficiency 50% </font></td>" << endl;
100 out <<
"<td align=\"center\"><font color=\"red\"> 2G efficiency 50% </font></td>" << endl;
101 out <<
"<td align=\"center\"><font color=\"red\"> 100*(2G-1G)/Min(1G,2G) </font></td>" << endl;
102 out <<
"</tr>" << endl;
104 for(
int i=0;
i<vname[1].size();
i++) {
105 for(
int j=0;
j<vname[0].size();
j++) {
106 if(vname[1][
i]==vname[0][
j]) {
108 out <<
"<tr align=\"center\">" << endl;
109 sprintf(oline,
"<td align=\"center\"><font color=\"black\">%d</font></td>",
i+1);
110 out << oline << endl;
111 sprintf(oline,
"<td align=\"center\"><font color=\"blue\">%s</font></td>",vname[1][
i].Data());
112 out << oline << endl;
113 sprintf(oline,
"<td align=\"center\"><font color=\"black\">%2.2g</font></td>",vhrss[0][j]);
114 out << oline << endl;
115 sprintf(oline,
"<td align=\"center\"><font color=\"black\">%2.2g</font></td>",vhrss[1][
i]);
116 out << oline << endl;
117 double percentage = 100.*(vhrss[1][
i]-vhrss[0][
j])/TMath::Min(vhrss[0][j],vhrss[1][i]);
119 sprintf(oline,
"<td align=\"center\"><font color=\"blue\">%2.1f</font></td>",percentage);
121 sprintf(oline,
"<td align=\"center\"><font color=\"red\">%2.1f</font></td>",percentage);
123 out << oline << endl;
124 out <<
"</tr>" << endl;
126 cout << i <<
" " << vname[1][
i] <<
" " << vhrss[1][
i] <<
" " << vhrss[0][
j] << endl;
131 out <<
"</table>" << endl;
132 out <<
"</html>" << endl;
135 cout << endl << eff_file << endl << endl;
145 for(
int i=0;
i<fileList.size();
i++) {
147 cout <<
i <<
" " << fileList[
i].Data() << endl;
150 ifstream
in(fileList[
i]);
151 if(!in.good()) {cout <<
"Error Opening File : " << fileList[
i] << endl;
exit(1);}
155 double chi2, hrss50,
sigma, betam, betap, hrssEr;
157 in >> dummy >> chi2 >> hrss50 >> dummy >> dummy >> sigma >> betam >> betap >>
name;
158 if (!in.good())
break;
159 vname.push_back(name);
161 double par0=TMath::Log10(hrss50);
162 TF1 fitFunc(
"logNfit",
logNfit,pow(10.0,-23.0),pow(10.0,-18.5),5);
163 fitFunc.SetNpx(10000);
164 fitFunc.SetParameters(par0,sigma,betam,betap,0);
165 fhrss=fitFunc.GetX(eff,pow(10.0,-25.0),pow(10.0,-18.5));
166 hrss.push_back(fhrss);
cout<< "Starting reading output directory ..."<< endl;vector< TString > fileList
int GetEfficiency(double eff, TString directory, vector< TString > &vname, vector< double > &vhrss)
void Efficiency2Gvs1G(TString cfgFile, int efficiency=50)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)