File indexing completed on 2024-04-06 12:18:59
0001 void maketable_HLT(string model, string oldversion, string newversion, bool oldrelease) {
0002
0003
0004 TFile* file = new TFile(string("html/SUSYVal_"+oldversion+"_vs_"+newversion+"/"+model+"/outputfile.root").c_str());
0005 TH1D* histo1;
0006 TH1D* histo2;
0007 vector<string> tablelines;
0008
0009 bool oldrelease = true;
0010
0011 vector<double> e_eff;
0012 vector<string> e_line;
0013
0014 vector<double> p_eff;
0015 vector<string> p_line;
0016
0017 vector<double> jet_eff;
0018 vector<string> jet_line;
0019
0020 vector<double > m_eff;
0021 vector<string> m_line;
0022
0023 for(int iplot=0; iplot<8;iplot++) {
0024 char name[256];
0025 if(oldrelease == true)
0026 sprintf(name,"HltPaths_eff_%i",iplot);
0027 else
0028 sprintf(name,"HltPaths_eff_%i",iplot+8);
0029 histo = (TH1D*) file->Get(name);
0030
0031 for(int iline=0; iline< histo->GetXaxis()->GetNbins(); iline++) {
0032 if(string(histo->GetXaxis()->GetBinLabel(iline+1)).find("Total")
0033 != string::npos)
0034 break;
0035
0036 double eff = histo->GetBinContent(iline+1);
0037 double err = histo->GetBinError(iline+1);
0038
0039 sprintf(name,"| %s | %f +/- %f |",histo->GetXaxis()->GetBinLabel(iline+1),eff, err);
0040
0041 if(string(name).find("Electron") != string::npos) {
0042 e_eff.push_back(eff);
0043 e_line.push_back(string(name));
0044 }
0045
0046 if(string(name).find("Photon") != string::npos) {
0047 p_eff.push_back(eff);
0048 p_line.push_back(string(name));
0049 }
0050
0051 if(string(name).find("Jet") != string::npos ||
0052 string(name).find("jet") != string::npos) {
0053 jet_eff.push_back(eff);
0054 jet_line.push_back(string(name));
0055 }
0056
0057 if(string(name).find("Mu") != string::npos) {
0058 m_eff.push_back(eff);
0059 m_line.push_back(string(name));
0060 }
0061 }
0062 }
0063
0064 sort(e_eff.begin(), e_eff.end());
0065 sort(p_eff.begin(), p_eff.end());
0066 sort(jet_eff.begin(), jet_eff.end());
0067 sort(m_eff.begin(), m_eff.end());
0068
0069
0070 vector<string> firstfour;
0071 for(int i=0; i<4; i++) {
0072 char eff_ch[256];
0073 sprintf(eff_ch,"%d",e_eff[i]);
0074 for(int j=0; j<int(e_line.size()); j++) {
0075 if(e_line[j].find(eff_ch) != string::npos) {
0076 firstfour.push_back(e_line[j]);
0077 e_line[j] = string("none");
0078 break;
0079 }
0080 }
0081 }
0082
0083 for(int i=0; i<firstfour.size(); i++)
0084 cout << firstfour[i] << endl;
0085
0086 firstfour.clear();
0087
0088 for(int i=0; i<4; i++) {
0089 char eff_ch[256];
0090 sprintf(eff_ch,"%d",p_eff[i]);
0091 for(int j=0; j<int(p_line.size()); j++) {
0092 if(p_line[j].find(eff_ch) != string::npos) {
0093 firstfour.push_back(p_line[j]);
0094 p_line[j] = "none";
0095 break;
0096 }
0097 }
0098 }
0099
0100 for(int i=0; i<firstfour.size(); i++)
0101 cout << firstfour[i] << endl;
0102
0103 firstfour.clear();
0104
0105 for(int i=0; i<4; i++) {
0106 char eff_ch[256];
0107 sprintf(eff_ch,"%d",jet_eff[i]);
0108 for(int j=0; j<int(jet_line.size()); j++) {
0109 if(jet_line[j].find(eff_ch) != string::npos) {
0110 firstfour.push_back(jet_line[j]);
0111 jet_line[j] = "none";
0112 break;
0113 }
0114 }
0115 }
0116
0117 for(int i=0; i<firstfour.size(); i++)
0118 cout << firstfour[i] << endl;
0119
0120 firstfour.clear();
0121
0122 for(int i=0; i<4; i++) {
0123 char eff_ch[256];
0124 sprintf(eff_ch,"%d",m_eff[i]);
0125 for(int j=0; j<int(m_line.size()); j++) {
0126 if(m_line[j].find(eff_ch) != string::npos) {
0127 firstfour.push_back(m_line[j]);
0128 m_line[j] = "none";
0129 break;
0130 }
0131 }
0132 }
0133
0134 for(int i=0; i<firstfour.size(); i++)
0135 cout << firstfour[i] << endl;
0136 }
0137
0138
0139 void maketable_HLT() {
0140 string oldversion = "183";
0141 string newversion = "200";
0142 cout << "---++ RELEASE: " << oldversion << endl;
0143 cout << "---++ LM1 " << endl;
0144 maketable_HLT("LM1",oldversion,newversion,true);
0145 cout << "---++ LM5 " << endl;
0146 maketable_HLT("LM5",oldversion,newversion,true);
0147 cout << "--- ++ LM9p " << endl;
0148 maketable_HLT("LM9p",oldversion,newversion,true);
0149 cout << "---++ GM1b " << endl;
0150 maketable_HLT("GM1b",oldversion,newversion,true);
0151 cout << "---++ RSgrav " << endl;
0152 maketable_HLT("RSgrav",oldversion,newversion,true);
0153 cout << "---++ Zprime " << endl;
0154 maketable_HLT("Zprime",oldversion,newversion,true);
0155 cout << endl;
0156 cout << endl;
0157 cout << endl;
0158 cout << endl;
0159 cout << endl;
0160 cout << "---++ " << newversion << endl;
0161 cout << "---++ LM1 " << endl;
0162 maketable_HLT("LM1",oldversion,newversion,false);
0163 cout << "---++ LM5 " << endl;
0164 maketable_HLT("LM5",oldversion,newversion,false);
0165 cout << "---++ LM9p " << endl;
0166 maketable_HLT("LM9p",oldversion,newversion,false);
0167 cout << "---++ GM1b " << endl;
0168 maketable_HLT("GM1b",oldversion,newversion,false);
0169 cout << "---++ RSgrav " << endl;
0170 maketable_HLT("RSgrav",oldversion,newversion,false);
0171 cout << "---++ Zprime " << endl;
0172 maketable_HLT("Zprime",oldversion,newversion,false);
0173 }
0174
0175