29 std::vector<std::string>
inFiles={};
42 std::ifstream in(txtfilename.c_str());
44 while ( getline(in,
line) ){
47 while (
line[0] ==
' ' )
line.erase(0, 1);
50 if ( !
line.empty() && isdigit(
line[0]) ){
51 std::stringstream is(
line);
55 float sumweight = -1,
stat = -1;
57 if (m_extended ==
true){
58 is >> sumweight >>
stat;
68 if (
it->second.ID()==
proc)
return it;
70 return m_xsectDB.end();
78 std::ifstream in(txtfilename.c_str());
80 while ( getline(in,
line) )
84 while (
line[0] ==
' ' )
line.erase(0, 1);
87 if ( !
line.empty() && isdigit(
line[0]) ){
88 std::stringstream is(
line);
92 float sumweight = -1,
stat = -1;
94 auto my_it = my_find(
id );
95 if (my_it==m_xsectDB.end()){
97 if (m_extended ==
true){
98 is >> sumweight >>
stat;
103 if (!m_extended) m_extended=
true;
104 is >> sumweight >>
stat;
105 my_it->second.sumweight(sumweight);
106 my_it->second.stat(
stat);
116 if(
proc==0 && m_usePMGTool) {
117 return Process(
id, m_pmgxs->getSampleName(
id), m_pmgxs->getAMIXsection(
id), m_pmgxs->getKfactor(
id), m_pmgxs->getFilterEff(
id), m_pmgxs->getXsectionUncertainty(
id), -1, -1 );
120 xsDB_t::const_iterator
pos = m_cache.find(
k);
121 if (
pos != m_cache.end()) {
124 pos = m_xsectDB.find(
k);
125 if (
pos != m_xsectDB.end()) {
144 int nantisbottom = 0;
146 int nantisbottom2 = 0;
160 int nsmuonRminus = 0;
162 int nselecRminus = 0;
165 int nsmuonLminus = 0;
167 int nselecLminus = 0;
181 if (abs(SUSY_Spart1_pdgId) == 1000022) nchi01++;
182 else if (abs(SUSY_Spart1_pdgId) == 1000023) nchi02++;
183 else if (abs(SUSY_Spart1_pdgId) == 1000025) nchi03++;
184 else if (abs(SUSY_Spart1_pdgId) == 1000035) nchi04++;
185 else if ( SUSY_Spart1_pdgId == 1000024) nch1plus++;
186 else if ( SUSY_Spart1_pdgId == -1000024) nch1minus++;
187 else if ( SUSY_Spart1_pdgId == 1000037) nch2plus++;
188 else if ( SUSY_Spart1_pdgId == -1000037) nch2minus++;
189 else if ( SUSY_Spart1_pdgId == 1000021) ngluino++;
190 else if ((abs(SUSY_Spart1_pdgId) > 1000000 && abs(SUSY_Spart1_pdgId) <= 1000004) || (abs(SUSY_Spart1_pdgId) > 2000000 && abs(SUSY_Spart1_pdgId) <= 2000004)) {
191 if (SUSY_Spart1_pdgId > 0) nsquark++;
194 else if (SUSY_Spart1_pdgId == 1000005) nsbottom++;
195 else if (SUSY_Spart1_pdgId == 1000006) nstop++;
196 else if (SUSY_Spart1_pdgId == 2000005) nsbottom2++;
197 else if (SUSY_Spart1_pdgId == 2000006) nstop2++;
198 else if (SUSY_Spart1_pdgId == -1000005) nantisbottom++;
199 else if (SUSY_Spart1_pdgId == -1000006) nantistop++;
200 else if (SUSY_Spart1_pdgId == -2000005) nantisbottom2++;
201 else if (SUSY_Spart1_pdgId == -2000006) nantistop2++;
202 else if (SUSY_Spart1_pdgId == 2000011) nselecRminus++;
203 else if (SUSY_Spart1_pdgId == -2000011) nselecRplus++;
204 else if (SUSY_Spart1_pdgId == 1000011) nselecLminus++;
205 else if (SUSY_Spart1_pdgId == -1000011) nselecLplus++;
206 else if (abs(SUSY_Spart1_pdgId) == 1000012) nselnuL++;
207 else if (SUSY_Spart1_pdgId == 2000013) nsmuonRminus++;
208 else if (SUSY_Spart1_pdgId == -2000013) nsmuonRplus++;
209 else if (SUSY_Spart1_pdgId == 1000013) nsmuonLminus++;
210 else if (SUSY_Spart1_pdgId == -1000013) nsmuonLplus++;
211 else if (abs(SUSY_Spart1_pdgId) == 1000014) nsmunuL++;
212 else if (SUSY_Spart1_pdgId == 1000015) nstau1minus++;
213 else if (SUSY_Spart1_pdgId == -1000015) nstau1plus++;
214 else if (SUSY_Spart1_pdgId == 2000015) nstau2minus++;
215 else if (SUSY_Spart1_pdgId == -2000015) nstau2plus++;
216 else if (abs(SUSY_Spart1_pdgId) == 1000016) nstaunuL++;
219 if (abs(SUSY_Spart2_pdgId) == 1000022) nchi01++;
220 else if (abs(SUSY_Spart2_pdgId) == 1000023) nchi02++;
221 else if (abs(SUSY_Spart2_pdgId) == 1000025) nchi03++;
222 else if (abs(SUSY_Spart2_pdgId) == 1000035) nchi04++;
223 else if (SUSY_Spart2_pdgId == 1000024) nch1plus++;
224 else if (SUSY_Spart2_pdgId == -1000024) nch1minus++;
225 else if (SUSY_Spart2_pdgId == 1000037) nch2plus++;
226 else if (SUSY_Spart2_pdgId == -1000037) nch2minus++;
228 else if (SUSY_Spart2_pdgId == 1000021) ngluino++;
229 else if ((abs(SUSY_Spart2_pdgId) > 1000000 && abs(SUSY_Spart2_pdgId) <= 1000004) || (abs(SUSY_Spart2_pdgId) > 2000000 && abs(SUSY_Spart2_pdgId) <= 2000004)) {
230 if (SUSY_Spart2_pdgId > 0) nsquark++;
233 else if (SUSY_Spart2_pdgId == 1000005) nsbottom++;
234 else if (SUSY_Spart2_pdgId == 1000006) nstop++;
235 else if (SUSY_Spart2_pdgId == 2000005) nsbottom2++;
236 else if (SUSY_Spart2_pdgId == 2000006) nstop2++;
237 else if (SUSY_Spart2_pdgId == -1000005) nantisbottom++;
238 else if (SUSY_Spart2_pdgId == -1000006) nantistop++;
239 else if (SUSY_Spart2_pdgId == -2000005) nantisbottom2++;
240 else if (SUSY_Spart2_pdgId == -2000006) nantistop2++;
242 else if (SUSY_Spart2_pdgId == 2000011) nselecRminus++;
243 else if (SUSY_Spart2_pdgId == -2000011) nselecRplus++;
244 else if (SUSY_Spart2_pdgId == 1000011) nselecLminus++;
245 else if (SUSY_Spart2_pdgId == -1000011) nselecLplus++;
246 else if (abs(SUSY_Spart2_pdgId) == 1000012) nselnuL++;
247 else if (SUSY_Spart2_pdgId == 2000013) nsmuonRminus++;
248 else if (SUSY_Spart2_pdgId == -2000013) nsmuonRplus++;
249 else if (SUSY_Spart2_pdgId == 1000013) nsmuonLminus++;
250 else if (SUSY_Spart2_pdgId == -1000013) nsmuonLplus++;
251 else if (abs(SUSY_Spart2_pdgId) == 1000014) nsmunuL++;
252 else if (SUSY_Spart2_pdgId == 1000015) nstau1minus++;
253 else if (SUSY_Spart2_pdgId == -1000015) nstau1plus++;
254 else if (SUSY_Spart2_pdgId == 2000015) nstau2minus++;
255 else if (SUSY_Spart2_pdgId == -2000015) nstau2plus++;
256 else if (abs(SUSY_Spart2_pdgId) == 1000016) nstaunuL++;
261 if (ngluino == 1 && (nsquark == 1 || nantisquark == 1))
return 1;
262 else if (ngluino == 2)
return 2;
263 else if (nsquark == 2 || nantisquark == 2)
return 3;
264 else if (nsquark == 1 && nantisquark == 1)
return 4;
266 else if (nsbottom == 1 && nantisbottom == 1)
return 51;
267 else if (nsbottom2 == 1 && nantisbottom2 == 1)
return 52;
268 else if (nstop == 1 && nantistop == 1)
return 61;
269 else if (nstop2 == 1 && nantistop2 == 1)
return 62;
271 else if (ngluino == 1 && nchi01 == 1)
return 71;
272 else if (ngluino == 1 && nchi02 == 1)
return 72;
273 else if (ngluino == 1 && nchi03 == 1)
return 73;
274 else if (ngluino == 1 && nchi04 == 1)
return 74;
276 else if (ngluino == 1 && nch1plus == 1)
return 75;
277 else if (ngluino == 1 && nch2plus == 1)
return 76;
278 else if (ngluino == 1 && nch1minus == 1)
return 77;
279 else if (ngluino == 1 && nch2minus == 1)
return 78;
281 else if ((nsquark == 1 || nantisquark == 1) && nchi01 == 1)
return 81;
282 else if ((nsquark == 1 || nantisquark == 1) && nchi02 == 1)
return 82;
283 else if ((nsquark == 1 || nantisquark == 1) && nchi03 == 1)
return 83;
284 else if ((nsquark == 1 || nantisquark == 1) && nchi04 == 1)
return 84;
286 else if ((nsquark == 1 || nantisquark == 1) && nch1plus == 1)
return 85;
287 else if ((nsquark == 1 || nantisquark == 1) && nch2plus == 1)
return 86;
288 else if ((nsquark == 1 || nantisquark == 1) && nch1minus == 1)
return 87;
289 else if ((nsquark == 1 || nantisquark == 1) && nch2minus == 1)
return 88;
294 else if (nchi01 == 2)
return 111;
295 else if (nchi01 == 1 && nchi02 == 1)
return 112;
296 else if (nchi01 == 1 && nchi03 == 1)
return 113;
297 else if (nchi01 == 1 && nchi04 == 1)
return 114;
298 else if (nchi01 == 1 && nch1plus == 1)
return 115;
299 else if (nchi01 == 1 && nch2plus == 1)
return 116;
300 else if (nchi01 == 1 && nch1minus == 1)
return 117;
301 else if (nchi01 == 1 && nch2minus == 1)
return 118;
304 else if (nchi02 == 2)
return 122;
305 else if (nchi02 == 1 && nchi03 == 1)
return 123;
306 else if (nchi02 == 1 && nchi04 == 1)
return 124;
307 else if (nchi02 == 1 && nch1plus == 1)
return 125;
308 else if (nchi02 == 1 && nch2plus == 1)
return 126;
309 else if (nchi02 == 1 && nch1minus == 1)
return 127;
310 else if (nchi02 == 1 && nch2minus == 1)
return 128;
313 else if (nchi03 == 2)
return 133;
314 else if (nchi03 == 1 && nchi04 == 1)
return 134;
315 else if (nchi03 == 1 && nch1plus == 1)
return 135;
316 else if (nchi03 == 1 && nch2plus == 1)
return 136;
317 else if (nchi03 == 1 && nch1minus == 1)
return 137;
318 else if (nchi03 == 1 && nch2minus == 1)
return 138;
321 else if (nchi04 == 2)
return 144;
322 else if (nchi04 == 1 && nch1plus == 1)
return 145;
323 else if (nchi04 == 1 && nch2plus == 1)
return 146;
324 else if (nchi04 == 1 && nch1minus == 1)
return 147;
325 else if (nchi04 == 1 && nch2minus == 1)
return 148;
328 else if (nch1plus == 1 && nch1minus == 1)
return 157;
329 else if (nch1plus == 1 && nch2minus == 1)
return 158;
331 else if (nch2plus == 1 && nch1minus == 1)
return 167;
332 else if (nch2plus == 1 && nch2minus == 1)
return 168;
335 else if (nselecLplus == 1 && nselecLminus == 1)
return 201;
336 else if (nselecRplus == 1 && nselecRminus == 1)
return 202;
337 else if (nselnuL == 2)
return 203;
338 else if (nselecLplus == 1 && nselnuL == 1)
return 204;
339 else if (nselecLminus == 1 && nselnuL == 1)
return 205;
340 else if (nstau1plus == 1 && nstau1minus == 1)
return 206;
341 else if (nstau2plus == 1 && nstau2minus == 1)
return 207;
342 else if ((nstau1plus == 1 || nstau1minus == 1) && (nstau2plus == 1 || nstau2minus == 1))
return 208;
343 else if (nstaunuL == 2)
return 209;
344 else if (nstau1plus == 1 && nstaunuL == 1)
return 210;
345 else if (nstau1minus == 1 && nstaunuL == 1)
return 211;
346 else if (nstau2plus == 1 && nstaunuL == 1)
return 212;
347 else if (nstau2minus == 1 && nstaunuL == 1)
return 213;
349 else if (nsmuonLplus == 1 && nsmuonLminus == 1)
return 216;
350 else if (nsmuonRplus == 1 && nsmuonRminus == 1)
return 217;
351 else if (nsmunuL == 2)
return 218;
352 else if (nsmuonLplus == 1 && nsmunuL == 1)
return 219;
353 else if (nsmuonLminus == 1 && nsmunuL == 1)
return 220;
355 std::cerr <<
"ERROR. could not determine finalState for:" << std::endl;
356 std::cerr <<
" SUSY_Spart1_pdgId: " << SUSY_Spart1_pdgId << std::endl;
357 std::cerr <<
" SUSY_Spart2_pdgId: " << SUSY_Spart2_pdgId << std::endl;
358 std::cerr <<
"Returning 0" << std::endl;