瀏覽代碼

Fix(2): add protection in case of particle id is not in the fId2pdg map

ParfenovPeter 1 年之前
父節點
當前提交
0faeda6406
共有 1 個文件被更改,包括 335 次插入2 次删除
  1. 335 2
      readers/qaReader_epos4_root.cxx

+ 335 - 2
readers/qaReader_epos4_root.cxx

@@ -85,11 +85,13 @@ qaParticle *qaReader_epos4_root::ReadParticle(Int_t ipart)
     qaParticle *particle = new qaParticle();
 
     particle->SetEnergy(e[ipart]);
-    particle->SetPdg(fId2pdg.at(id[ipart]));
+    int pdg = (fId2pdg.count(id[ipart])) ? fId2pdg.at(id[ipart]) : qaUtility::GetInstance()->error_code;
+    double charge = (pdg != qaUtility::GetInstance()->error_code) ? qaUtility::GetInstance()->GetCharge(fId2pdg.at(id[ipart])) : qaUtility::GetInstance()->error_code;
+    particle->SetPdg(pdg);
     particle->SetPxPyPz(px[ipart], py[ipart], pz[ipart]);
     particle->SetTime(t[ipart]);
     particle->SetXYZ(x[ipart], y[ipart], z[ipart]);
-    particle->SetCharge(qaUtility::GetInstance()->GetCharge(fId2pdg.at(id[ipart])));
+    particle->SetCharge(charge);
 
     return particle;
 }
@@ -638,6 +640,317 @@ void qaReader_epos4_root::SetPidMap()
     fId2pdg.insert({5300, 5303});
     fId2pdg.insert({5400, 5403});
     fId2pdg.insert({5500, 5503});
+    fId2pdg.insert({-1120, -2212});
+    fId2pdg.insert({-1220, -2112});
+    fId2pdg.insert({-2130, -3122});
+    fId2pdg.insert({-1130, -3222});
+    fId2pdg.insert({-1230, -3212});
+    fId2pdg.insert({-2230, -3112});
+    fId2pdg.insert({-1330, -3322});
+    fId2pdg.insert({-2330, -3312});
+    fId2pdg.insert({-1111, -2224});
+    fId2pdg.insert({-1121, -2214});
+    fId2pdg.insert({-1221, -2114});
+    fId2pdg.insert({-2221, -1114});
+    fId2pdg.insert({-1131, -3224});
+    fId2pdg.insert({-1231, -3214});
+    fId2pdg.insert({-2231, -3114});
+    fId2pdg.insert({-1331, -3324});
+    fId2pdg.insert({-2331, -3314});
+    fId2pdg.insert({-3331, -3334});
+    fId2pdg.insert({-1112, -32224});
+    fId2pdg.insert({-1113, -2222});
+    fId2pdg.insert({-1114, -12224});
+    fId2pdg.insert({-1115, -12222});
+    fId2pdg.insert({-1116, -2226});
+    fId2pdg.insert({-1117, -22222});
+    fId2pdg.insert({-1118, -22224});
+    fId2pdg.insert({-1119, -12226});
+    fId2pdg.insert({-2222, -31114});
+    fId2pdg.insert({-2223, -1112});
+    fId2pdg.insert({-2224, -11114});
+    fId2pdg.insert({-2225, -11112});
+    fId2pdg.insert({-2226, -1116});
+    fId2pdg.insert({-2227, -21112});
+    fId2pdg.insert({-2228, -21114});
+    fId2pdg.insert({-2229, -11116});
+    fId2pdg.insert({-1122, -12212});
+    fId2pdg.insert({-1123, -2124});
+    fId2pdg.insert({-1124, -22212});
+    fId2pdg.insert({-1125, -32214});
+    fId2pdg.insert({-1126, -2122});
+    fId2pdg.insert({-1127, -32212});
+    fId2pdg.insert({-1128, -2216});
+    fId2pdg.insert({-1129, -12216});
+    fId2pdg.insert({-2112, -12214});
+    fId2pdg.insert({-2113, -22124});
+    fId2pdg.insert({-2114, -42212});
+    fId2pdg.insert({-2115, -32124});
+    fId2pdg.insert({-2116, -12122});
+    fId2pdg.insert({-2117, -2126});
+    fId2pdg.insert({-2118, -22122});
+    fId2pdg.insert({-2119, -22214});
+    fId2pdg.insert({-1212, -12126});
+    fId2pdg.insert({-1213, -2218});
+    fId2pdg.insert({-1214, -2128});
+    fId2pdg.insert({-1215, -903128});
+    fId2pdg.insert({-1216, -5128});
+    fId2pdg.insert({-1217, -9298});
+    fId2pdg.insert({-1218, -9401});
+    fId2pdg.insert({-1222, -12112});
+    fId2pdg.insert({-1223, -1214});
+    fId2pdg.insert({-1224, -22112});
+    fId2pdg.insert({-1225, -32114});
+    fId2pdg.insert({-1226, -1212});
+    fId2pdg.insert({-1227, -32112});
+    fId2pdg.insert({-1228, -2116});
+    fId2pdg.insert({-1229, -12116});
+    fId2pdg.insert({-2212, -12114});
+    fId2pdg.insert({-2213, -21214});
+    fId2pdg.insert({-2214, -42112});
+    fId2pdg.insert({-2215, -31214});
+    fId2pdg.insert({-2216, -11212});
+    fId2pdg.insert({-2217, -1216});
+    fId2pdg.insert({-2218, -21212});
+    fId2pdg.insert({-2219, -22114});
+    fId2pdg.insert({-2122, -11216});
+    fId2pdg.insert({-2123, -2118});
+    fId2pdg.insert({-2124, -1218});
+    fId2pdg.insert({-2125, -903218});
+    fId2pdg.insert({-2126, -5218});
+    fId2pdg.insert({-2127, -9299});
+    fId2pdg.insert({-2128, -9400});
+    fId2pdg.insert({-1233, -13122});
+    fId2pdg.insert({-1234, -3124});
+    fId2pdg.insert({-1235, -23122});
+    fId2pdg.insert({-1236, -33122});
+    fId2pdg.insert({-1237, -13124});
+    fId2pdg.insert({-1238, -13212});
+    fId2pdg.insert({-1239, -13214});
+    fId2pdg.insert({-3122, -23212});
+    fId2pdg.insert({-3123, -3216});
+    fId2pdg.insert({-3124, -43122});
+    fId2pdg.insert({-3125, -53122});
+    fId2pdg.insert({-3126, -3126});
+    fId2pdg.insert({-3127, -13126});
+    fId2pdg.insert({-3128, -23124});
+    fId2pdg.insert({-3129, -13216});
+    fId2pdg.insert({-3212, -23214});
+    fId2pdg.insert({-3213, -3218});
+    fId2pdg.insert({-3214, -23126});
+    fId2pdg.insert({-3215, -4228});
+    fId2pdg.insert({-3216, -9001});
+    fId2pdg.insert({-3217, -3128});
+    fId2pdg.insert({-1132, -13222});
+    fId2pdg.insert({-1133, -13224});
+    fId2pdg.insert({-1134, -23222});
+    fId2pdg.insert({-1135, -3226});
+    fId2pdg.insert({-1136, -13226});
+    fId2pdg.insert({-1137, -23224});
+    fId2pdg.insert({-1138, -3228});
+    fId2pdg.insert({-1139, -4028});
+    fId2pdg.insert({-2232, -13112});
+    fId2pdg.insert({-2233, -13114});
+    fId2pdg.insert({-2234, -23112});
+    fId2pdg.insert({-2235, -3116});
+    fId2pdg.insert({-2236, -13116});
+    fId2pdg.insert({-2237, -23114});
+    fId2pdg.insert({-2238, -3118});
+    fId2pdg.insert({-2239, -4128});
+    fId2pdg.insert({-1332, -45553});
+    fId2pdg.insert({-1333, -203322});
+    fId2pdg.insert({-1334, -13324});
+    fId2pdg.insert({-1335, -103326});
+    fId2pdg.insert({-1336, -203326});
+    fId2pdg.insert({-2332, -46653});
+    fId2pdg.insert({-2333, -203312});
+    fId2pdg.insert({-2334, -13314});
+    fId2pdg.insert({-2335, -103316});
+    fId2pdg.insert({-2336, -203316});
+    fId2pdg.insert({-3332, -203338});
+    // Baryons - charm and bottom
+    fId2pdg.insert({-2140, -4122});
+    fId2pdg.insert({-2240, -4112});
+    fId2pdg.insert({-1240, -4212});
+    fId2pdg.insert({-1140, -4222});
+    fId2pdg.insert({-2241, -4114});
+    fId2pdg.insert({-1241, -4214});
+    fId2pdg.insert({-1141, -4224});
+    fId2pdg.insert({-3240, -4132});
+    fId2pdg.insert({-2340, -4312});
+    fId2pdg.insert({-3140, -4232});
+    fId2pdg.insert({-1340, -4322});
+    fId2pdg.insert({-3340, -4332});
+    fId2pdg.insert({-2341, -4314});
+    fId2pdg.insert({-1341, -4324});
+    fId2pdg.insert({-3341, -4334});
+    fId2pdg.insert({-2440, -4412});
+    fId2pdg.insert({-2441, -4414});
+    fId2pdg.insert({-1440, -4422});
+    fId2pdg.insert({-1441, -4424});
+    fId2pdg.insert({-3440, -4432});
+    fId2pdg.insert({-3441, -4434});
+    fId2pdg.insert({-4441, -4444});
+    fId2pdg.insert({-2250, -5112});
+    fId2pdg.insert({-2150, -5122});
+    fId2pdg.insert({-1250, -5212});
+    fId2pdg.insert({-1150, -5222});
+    fId2pdg.insert({-3350, -5332});
+    fId2pdg.insert({-3351, -5334});
+    fId2pdg.insert({-1350, -5232});
+    fId2pdg.insert({-3250, -5132});
+    fId2pdg.insert({-2350, -5312});
+    fId2pdg.insert({-1351, -5324});
+    fId2pdg.insert({-2351, -5314});
+    fId2pdg.insert({-2251, -5114});
+    fId2pdg.insert({-1251, -5214});
+    fId2pdg.insert({-1151, -5224});
+    fId2pdg.insert({-2151, -5124});
+    fId2pdg.insert({-2152, -5126});
+    fId2pdg.insert({-1242, -14122});
+    fId2pdg.insert({-2142, -104122});
+    fId2pdg.insert({-2143, -204126});
+    fId2pdg.insert({-2342, -104314});
+    fId2pdg.insert({-2343, -104312});
+    fId2pdg.insert({-1342, -104324});
+    fId2pdg.insert({-1343, -104322});
+    fId2pdg.insert({-3150, -5322});
+    fId2pdg.insert({-4250, -5142});
+    fId2pdg.insert({-2450, -5412});
+    fId2pdg.insert({-4150, -5242});
+    fId2pdg.insert({-1450, -5422});
+    fId2pdg.insert({-2451, -5414});
+    fId2pdg.insert({-1451, -5424});
+    fId2pdg.insert({-4350, -5342});
+    fId2pdg.insert({-3450, -5432});
+    fId2pdg.insert({-3451, -5434});
+    fId2pdg.insert({-4450, -5442});
+    fId2pdg.insert({-4451, -5444});
+    fId2pdg.insert({-2550, -5512});
+    fId2pdg.insert({-1550, -5522});
+    fId2pdg.insert({-2551, -5514});
+    fId2pdg.insert({-1551, -5524});
+    fId2pdg.insert({-3550, -5532});
+    fId2pdg.insert({-3551, -5534});
+    fId2pdg.insert({-3450, -5542});
+    fId2pdg.insert({-4551, -5544});
+    fId2pdg.insert({-5551, -5554});
+    // top mesons & baryons
+    fId2pdg.insert({-160, -99});
+    fId2pdg.insert({-260, -99});
+    fId2pdg.insert({-360, -99});
+    fId2pdg.insert({-161, -99});
+    fId2pdg.insert({-261, -99});
+    fId2pdg.insert({-361, -99});
+    fId2pdg.insert({-320, -99});
+    fId2pdg.insert({-1160, -99});
+    fId2pdg.insert({-1260, -99});
+    fId2pdg.insert({-2260, -99});
+    fId2pdg.insert({-2160, -99});
+    fId2pdg.insert({-1360, -99});
+    fId2pdg.insert({-2360, -99});
+    fId2pdg.insert({-3360, -99});
+    fId2pdg.insert({-1161, -99});
+    fId2pdg.insert({-1261, -99});
+    fId2pdg.insert({-2261, -99});
+    fId2pdg.insert({-2161, -99});
+    fId2pdg.insert({-1361, -99});
+    fId2pdg.insert({-2361, -99});
+    fId2pdg.insert({-3361, -99});
+    // 7xx and 8xx mesons
+    fId2pdg.insert({-702, -9010221});
+    fId2pdg.insert({-703, -9000221});
+    fId2pdg.insert({-704, -9010223});
+    fId2pdg.insert({-705, -9000225});
+    fId2pdg.insert({-706, -10225});
+    fId2pdg.insert({-707, -30223});
+    fId2pdg.insert({-708, -227});
+    fId2pdg.insert({-709, -9040221});
+    fId2pdg.insert({-712, -9030225});
+    fId2pdg.insert({-713, -9040225});
+    fId2pdg.insert({-714, -9050225});
+    fId2pdg.insert({-715, -9060225});
+    fId2pdg.insert({-716, -9050221});
+    fId2pdg.insert({-717, -229});
+    fId2pdg.insert({-718, -9060221});
+    fId2pdg.insert({-719, -9070225});
+    fId2pdg.insert({-722, -9070221});
+    fId2pdg.insert({-723, -9000229});
+    fId2pdg.insert({-724, -9080221});
+    fId2pdg.insert({-725, -9080225});
+    fId2pdg.insert({-726, -9010229});
+    fId2pdg.insert({-727, -9090221});
+    fId2pdg.insert({-728, -9090225});
+    fId2pdg.insert({-729, -100221});
+    fId2pdg.insert({-732, -9020221});
+    fId2pdg.insert({-733, -1000223});
+    fId2pdg.insert({-734, -9020225});
+    fId2pdg.insert({-776, -329});
+    fId2pdg.insert({-742, -9020325});
+    fId2pdg.insert({-743, -9010327});
+    fId2pdg.insert({-744, -9000329});
+    fId2pdg.insert({-752, -9000443});
+    fId2pdg.insert({-753, -9010443});
+    fId2pdg.insert({-754, -9020443});
+    fId2pdg.insert({-762, -30553});
+    fId2pdg.insert({-763, -110551});
+    fId2pdg.insert({-764, -120553});
+    fId2pdg.insert({-765, -100555});
+    fId2pdg.insert({-766, -9010553});
+    fId2pdg.insert({-772, -9010217});
+    fId2pdg.insert({-773, -9000211});
+    fId2pdg.insert({-774, -9000213});
+    fId2pdg.insert({-775, -9040213});
+    fId2pdg.insert({-777, -9010213});
+    fId2pdg.insert({-782, -9000111});
+    fId2pdg.insert({-783, -9030113});
+    fId2pdg.insert({-784, -9000117});
+    fId2pdg.insert({-785, -119});
+    fId2pdg.insert({-786, -9010115});
+    fId2pdg.insert({-787, -9040113});
+    fId2pdg.insert({-788, -9010117});
+    fId2pdg.insert({-789, -9010111});
+    fId2pdg.insert({-792, -9000113});
+    fId2pdg.insert({-793, -9010113});
+    fId2pdg.insert({-794, -337});
+    fId2pdg.insert({-795, -10335});
+    fId2pdg.insert({-796, -100331});
+    fId2pdg.insert({-797, -100333});
+    fId2pdg.insert({-802, -9020315});
+    fId2pdg.insert({-803, -9010317});
+    fId2pdg.insert({-804, -9000319});
+    fId2pdg.insert({-805, -319});
+    // 7xxx baryons
+    fId2pdg.insert({-7002, -2228});
+    fId2pdg.insert({-7003, -1118});
+    fId2pdg.insert({-7004, -9297});
+    fId2pdg.insert({-7005, -9300});
+    // Diquarks
+    fId2pdg.insert({-1200, -2101});
+    fId2pdg.insert({-2300, -3101});
+    fId2pdg.insert({-1300, -3201});
+    fId2pdg.insert({-2400, -4101});
+    fId2pdg.insert({-1400, -4201});
+    fId2pdg.insert({-3400, -4301});
+    fId2pdg.insert({-2500, -5101});
+    fId2pdg.insert({-1500, -5201});
+    fId2pdg.insert({-3500, -5301});
+    fId2pdg.insert({-4500, -5401});
+    fId2pdg.insert({-2200, -1103});
+    fId2pdg.insert({-2100, -2103});
+    fId2pdg.insert({-1100, -2203});
+    fId2pdg.insert({-3200, -3103});
+    fId2pdg.insert({-3100, -3203});
+    fId2pdg.insert({-3300, -3303});
+    fId2pdg.insert({-4200, -4103});
+    fId2pdg.insert({-4100, -4203});
+    fId2pdg.insert({-4300, -4303});
+    fId2pdg.insert({-4400, -4403});
+    fId2pdg.insert({-5200, -5103});
+    fId2pdg.insert({-5100, -5203});
+    fId2pdg.insert({-5300, -5303});
+    fId2pdg.insert({-5400, -5403});
+    fId2pdg.insert({-5500, -5503});
     // Special particles
     fId2pdg.insert({800000088, 88});
     fId2pdg.insert({800099999, 99999});
@@ -660,4 +973,24 @@ void qaReader_epos4_root::SetPidMap()
     fId2pdg.insert({213099, 9903120});
     fId2pdg.insert({800000110, 110});
     fId2pdg.insert({800000990, 990});
+    fId2pdg.insert({-800000088, -88});
+    fId2pdg.insert({-800099999, -99999});
+    fId2pdg.insert({-800000090, -90});
+    fId2pdg.insert({-800000091, -91});
+    fId2pdg.insert({-800000092, -92});
+    fId2pdg.insert({-800000093, -93});
+    fId2pdg.insert({-800000094, -94});
+    fId2pdg.insert({-11099, -9900110});
+    fId2pdg.insert({-12099, -9900210});
+    fId2pdg.insert({-13099, -9900320});
+    fId2pdg.insert({-22099, -9900220});
+    fId2pdg.insert({-23099, -9900311});
+    fId2pdg.insert({-2099, -9900310});
+    fId2pdg.insert({-33099, -9900330});
+    fId2pdg.insert({-44099, -9900440});
+    fId2pdg.insert({-112099, -9902210});
+    fId2pdg.insert({-122099, -9902110});
+    fId2pdg.insert({-213099, -9903120});
+    fId2pdg.insert({-800000110, -110});
+    fId2pdg.insert({-800000990, -990});
 }