70 classifyOne(
int pdgId){
71 if (abs(pdgId) == 1000022)
return nchi01;
72 else if (abs(pdgId) == 1000023)
return nchi02;
73 else if (abs(pdgId) == 1000025)
return nchi03;
74 else if (abs(pdgId) == 1000035)
return nchi04;
75 else if ( pdgId == 1000024)
return nch1plus;
76 else if ( pdgId == -1000024)
return nch1minus;
77 else if ( pdgId == 1000037)
return nch2plus;
78 else if ( pdgId == -1000037)
return nch2minus;
79 else if ( pdgId == 1000021)
return ngluino;
80 else if ((abs(pdgId) > 1000000 && abs(pdgId) <= 1000004) || (abs(pdgId) > 2000000 && abs(pdgId) <= 2000004)) {
81 if (pdgId > 0)
return nsquark;
82 else return nantisquark;
84 else if (pdgId == 1000005)
return nsbottom;
85 else if (pdgId == 1000006)
return nstop;
86 else if (pdgId == 2000005)
return nsbottom2;
87 else if (pdgId == 2000006)
return nstop2;
88 else if (pdgId == -1000005)
return nantisbottom;
89 else if (pdgId == -1000006)
return nantistop;
90 else if (pdgId == -2000005)
return nantisbottom2;
91 else if (pdgId == -2000006)
return nantistop2;
92 else if (pdgId == 2000011)
return nselecRminus;
93 else if (pdgId == -2000011)
return nselecRplus;
94 else if (pdgId == 1000011)
return nselecLminus;
95 else if (pdgId == -1000011)
return nselecLplus;
96 else if (abs(pdgId) == 1000012)
return nselnuL;
97 else if (pdgId == 2000013)
return nsmuonRminus;
98 else if (pdgId == -2000013)
return nsmuonRplus;
99 else if (pdgId == 1000013)
return nsmuonLminus;
100 else if (pdgId == -1000013)
return nsmuonLplus;
101 else if (abs(pdgId) == 1000014)
return nsmunuL;
102 else if (pdgId == 1000015)
return nstau1minus;
103 else if (pdgId == -1000015)
return nstau1plus;
104 else if (pdgId == 2000015)
return nstau2minus;
105 else if (pdgId == -2000015)
return nstau2plus;
106 else if (abs(pdgId) == 1000016)
return nstaunuL;
122 std::vector<std::string>
inFiles={};
135 std::ifstream in(txtfilename.c_str());
137 while ( getline(in,
line) ){
139 if ( !
line.empty() ){
140 while (
line[0] ==
' ' )
line.erase(0, 1);
143 if ( !
line.empty() && isdigit(
line[0]) ){
144 std::stringstream is(
line);
148 float sumweight = -1,
stat = -1;
150 if (m_extended ==
true){
151 is >> sumweight >>
stat;
161 if (
it->second.ID()==
proc)
return it;
163 return m_xsectDB.end();
171 std::ifstream in(txtfilename.c_str());
173 while ( getline(in,
line) )
176 if ( !
line.empty() ){
177 while (
line[0] ==
' ' )
line.erase(0, 1);
180 if ( !
line.empty() && isdigit(
line[0]) ){
181 std::stringstream is(
line);
185 float sumweight = -1,
stat = -1;
187 auto my_it = my_find(
id );
188 if (my_it==m_xsectDB.end()){
190 if (m_extended ==
true){
191 is >> sumweight >>
stat;
196 if (!m_extended) m_extended=
true;
197 is >> sumweight >>
stat;
198 my_it->second.sumweight(sumweight);
199 my_it->second.stat(
stat);
209 if(
proc==0 && m_usePMGTool) {
210 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 );
213 xsDB_t::const_iterator
pos = m_cache.find(
k);
214 if (
pos != m_cache.end()) {
217 pos = m_xsectDB.find(
k);
218 if (
pos != m_xsectDB.end()) {
229 std::array<int, NUM_SPARTICLES>
n{};
231 int idx = classifyOne(SUSY_Spart1_pdgId);
232 if ( (
idx>=0) and (
idx<std::ssize(
n) )){
235 int idx2 = classifyOne(SUSY_Spart2_pdgId);
236 if ( (idx2>=0) and (idx2<std::ssize(
n) )){
242 auto nanysquark=[&
n](
int i)->
bool {
243 return (
n[nsquark] ==
i) or (
n[nantisquark] ==
i);
245 if (
n[ngluino] == 1 && nanysquark(1))
return 1;
246 else if (
n[ngluino] == 2)
return 2;
247 else if (nanysquark(2))
return 3;
248 else if (
n[nsquark] == 1 &&
n[nantisquark] == 1)
return 4;
250 else if (
n[nsbottom] == 1 &&
n[nantisbottom] == 1)
return 51;
251 else if (
n[nsbottom2] == 1 &&
n[nantisbottom2] == 1)
return 52;
252 else if (
n[nstop] == 1 &&
n[nantistop] == 1)
return 61;
253 else if (
n[nstop2] == 1 &&
n[nantistop2] == 1)
return 62;
255 else if (
n[ngluino] == 1 &&
n[nchi01] == 1)
return 71;
256 else if (
n[ngluino] == 1 &&
n[nchi02] == 1)
return 72;
257 else if (
n[ngluino] == 1 &&
n[nchi03] == 1)
return 73;
258 else if (
n[ngluino] == 1 &&
n[nchi04] == 1)
return 74;
260 else if (
n[ngluino] == 1 &&
n[nch1plus] == 1)
return 75;
261 else if (
n[ngluino] == 1 &&
n[nch2plus] == 1)
return 76;
262 else if (
n[ngluino] == 1 &&
n[nch1minus] == 1)
return 77;
263 else if (
n[ngluino] == 1 &&
n[nch2minus] == 1)
return 78;
265 else if (nanysquark(1) &&
n[nchi01] == 1)
return 81;
266 else if (nanysquark(1) &&
n[nchi02] == 1)
return 82;
267 else if (nanysquark(1) &&
n[nchi03] == 1)
return 83;
268 else if (nanysquark(1) &&
n[nchi04] == 1)
return 84;
270 else if (nanysquark(1) &&
n[nch1plus] == 1)
return 85;
271 else if (nanysquark(1) &&
n[nch2plus] == 1)
return 86;
272 else if (nanysquark(1) &&
n[nch1minus] == 1)
return 87;
273 else if (nanysquark(1) &&
n[nch2minus] == 1)
return 88;
278 else if (
n[nchi01] == 2)
return 111;
279 else if (
n[nchi01] == 1 &&
n[nchi02] == 1)
return 112;
280 else if (
n[nchi01] == 1 &&
n[nchi03] == 1)
return 113;
281 else if (
n[nchi01] == 1 &&
n[nchi04] == 1)
return 114;
282 else if (
n[nchi01] == 1 &&
n[nch1plus] == 1)
return 115;
283 else if (
n[nchi01] == 1 &&
n[nch2plus] == 1)
return 116;
284 else if (
n[nchi01] == 1 &&
n[nch1minus] == 1)
return 117;
285 else if (
n[nchi01] == 1 &&
n[nch2minus] == 1)
return 118;
288 else if (
n[nchi02] == 2)
return 122;
289 else if (
n[nchi02] == 1 &&
n[nchi03] == 1)
return 123;
290 else if (
n[nchi02] == 1 &&
n[nchi04] == 1)
return 124;
291 else if (
n[nchi02] == 1 &&
n[nch1plus] == 1)
return 125;
292 else if (
n[nchi02] == 1 &&
n[nch2plus] == 1)
return 126;
293 else if (
n[nchi02] == 1 &&
n[nch1minus] == 1)
return 127;
294 else if (
n[nchi02] == 1 &&
n[nch2minus] == 1)
return 128;
297 else if (
n[nchi03] == 2)
return 133;
298 else if (
n[nchi03] == 1 &&
n[nchi04] == 1)
return 134;
299 else if (
n[nchi03] == 1 &&
n[nch1plus] == 1)
return 135;
300 else if (
n[nchi03] == 1 &&
n[nch2plus] == 1)
return 136;
301 else if (
n[nchi03] == 1 &&
n[nch1minus] == 1)
return 137;
302 else if (
n[nchi03] == 1 &&
n[nch2minus] == 1)
return 138;
305 else if (
n[nchi04] == 2)
return 144;
306 else if (
n[nchi04] == 1 &&
n[nch1plus] == 1)
return 145;
307 else if (
n[nchi04] == 1 &&
n[nch2plus] == 1)
return 146;
308 else if (
n[nchi04] == 1 &&
n[nch1minus] == 1)
return 147;
309 else if (
n[nchi04] == 1 &&
n[nch2minus] == 1)
return 148;
312 else if (
n[nch1plus] == 1 &&
n[nch1minus] == 1)
return 157;
313 else if (
n[nch1plus] == 1 &&
n[nch2minus] == 1)
return 158;
315 else if (
n[nch2plus] == 1 &&
n[nch1minus] == 1)
return 167;
316 else if (
n[nch2plus] == 1 &&
n[nch2minus] == 1)
return 168;
319 else if (
n[nselecLplus] == 1 &&
n[nselecLminus] == 1)
return 201;
320 else if (
n[nselecRplus] == 1 &&
n[nselecRminus] == 1)
return 202;
321 else if (
n[nselnuL] == 2)
return 203;
322 else if (
n[nselecLplus] == 1 &&
n[nselnuL] == 1)
return 204;
323 else if (
n[nselecLminus] == 1 &&
n[nselnuL] == 1)
return 205;
324 else if (
n[nstau1plus] == 1 &&
n[nstau1minus] == 1)
return 206;
325 else if (
n[nstau2plus] == 1 &&
n[nstau2minus] == 1)
return 207;
326 else if ((
n[nstau1plus] == 1 ||
n[nstau1minus] == 1) && (
n[nstau2plus] == 1 ||
n[nstau2minus] == 1))
return 208;
327 else if (
n[nstaunuL] == 2)
return 209;
328 else if (
n[nstau1plus] == 1 &&
n[nstaunuL] == 1)
return 210;
329 else if (
n[nstau1minus] == 1 &&
n[nstaunuL] == 1)
return 211;
330 else if (
n[nstau2plus] == 1 &&
n[nstaunuL] == 1)
return 212;
331 else if (
n[nstau2minus] == 1 &&
n[nstaunuL] == 1)
return 213;
333 else if (
n[nsmuonLplus] == 1 &&
n[nsmuonLminus] == 1)
return 216;
334 else if (
n[nsmuonRplus] == 1 &&
n[nsmuonRminus] == 1)
return 217;
335 else if (
n[nsmunuL] == 2)
return 218;
336 else if (
n[nsmuonLplus] == 1 &&
n[nsmunuL] == 1)
return 219;
337 else if (
n[nsmuonLminus] == 1 &&
n[nsmunuL] == 1)
return 220;
339 std::cerr <<
"ERROR. could not determine finalState for:" << std::endl;
340 std::cerr <<
" SUSY_Spart1_pdgId: " << SUSY_Spart1_pdgId << std::endl;
341 std::cerr <<
" SUSY_Spart2_pdgId: " << SUSY_Spart2_pdgId << std::endl;
342 std::cerr <<
"Returning 0" << std::endl;