103 static constexpr std::array<int, 33> one_b_Ids = {
105 -511, -521, -10511, -10521, -513, -523, -10513, -10523, -20513, -20523,
106 -515, -525, -531, -10531, -533, -10533, -20533,
109 5122, 5112, 5212, 5222, 5114, 5214, 5224, 5132, 5232, 5312, 5322, 5314,
112 static constexpr std::array<int,33> one_antib_Ids =
negateID(one_b_Ids);
113 static constexpr std::array<int,6> one_b_one_antic_Ids = {
115 -541, -10541, -543, -10543, -20543, -545
117 static constexpr std::array<int,6> one_antib_one_c_Ids =
negateID(one_b_one_antic_Ids);
118 static constexpr std::array<int,9> one_b_one_c_Ids = {
120 5142, 5242, 5412, 5422, 5414, 5424, 5342, 5432, 5434
122 static constexpr std::array<int,9> one_antib_one_antic_Ids =
negateID(one_b_one_c_Ids);
123 static constexpr std::array<int,2> one_b_two_cs_Ids = {
127 static constexpr std::array<int,2> one_antib_two_antics_Ids =
negateID(one_b_two_cs_Ids);
128 static constexpr std::array<int,6> two_bs_Ids = {
130 5512, 5522, 5514, 5524, 5532, 5534
132 static constexpr std::array<int,6> two_antibs_Ids =
negateID(two_bs_Ids);
133 static constexpr std::array<int,2> two_bs_one_c_Ids = {
137 static constexpr std::array<int,2> two_antibs_one_antic_Ids =
negateID(two_bs_one_c_Ids);
138 static constexpr std::array<int,1> three_bs = {
142 static constexpr std::array<int,1> three_antibs =
negateID(three_bs);
144 static constexpr std::array<int,33> one_c_Ids = {
146 411, 421, 10411, 10421, 413, 423, 10413, 10423, 20413, 20423,
147 415, 425, 431, 10431, 433, 10433, 20433, 435,
149 4122, 4222, 4212, 4112, 4224, 4214, 4114, 4232, 4132, 4322, 4312, 4324,
152 static constexpr std::array<int,33> one_antic_Ids =
negateID(one_c_Ids);
153 static constexpr std::array<int,6> two_c_Ids = {
155 4412, 4422, 4414, 4424, 4432, 4434
157 static constexpr std::array<int,6> two_antic_Ids =
negateID(two_c_Ids);
158 static constexpr std::array<int,1> three_c_Ids = {
161 static constexpr std::array<int,1> three_antic_Ids =
negateID(three_c_Ids);
167 if (
hit(three_bs, pdgId)) { nb = 3; }
168 else if (
hit(three_antibs, pdgId)) { nb = -3; }
169 else if (
hit(two_bs_one_c_Ids, pdgId)) { nb = 2; nc = 1; }
170 else if (
hit(two_antibs_one_antic_Ids, pdgId)) { nb = -2; nc = -1; }
171 else if (
hit(two_bs_Ids, pdgId)) { nb = 2; }
172 else if (
hit(two_antibs_Ids, pdgId)) { nb = -2; }
173 else if (
hit(one_b_two_cs_Ids, pdgId)) { nb = 1; nc = 2; }
174 else if (
hit(one_antib_two_antics_Ids, pdgId)) { nb = -1; nc = -2; }
175 else if (
hit(one_b_one_c_Ids, pdgId)) { nb = 1; nc = 1; }
176 else if (
hit(one_antib_one_antic_Ids, pdgId)) { nb = -1; nc = -1; }
177 else if (
hit(one_b_one_antic_Ids, pdgId)) { nb = 1; nc = -1; }
178 else if (
hit(one_antib_one_c_Ids, pdgId)) { nb = -1; nc = 1; }
180 else if (
hit(one_b_Ids, pdgId)) { nb = 1; }
181 else if (
hit(one_antib_Ids, pdgId)) { nb = -1; }
182 else if (
hit(three_c_Ids, pdgId)) { nc = 3; }
183 else if (
hit(three_antic_Ids, pdgId)) { nc = -3; }
184 else if (
hit(two_c_Ids, pdgId)) { nc = 2; }
185 else if (
hit(two_antic_Ids, pdgId)) { nc = -2; }
186 else if (
hit(one_c_Ids, pdgId)) { nc = 1; }
187 else if (
hit(one_antic_Ids, pdgId)) { nc = -1; }
189 return FlavInfo(0,0,0,nc,nb,0,0);
201 std::vector<const TruthParticle*> truthparts(parts.begin(), parts.end());
202 std::vector<const TruthParticle*> bs(label_bs.
begin(), label_bs.
end());
203 std::vector<const TruthParticle*> cs(label_cs.
begin(), label_cs.
end());
207 childrenRemoved(bs, bs);
208 childrenRemoved(bs, cs);
209 childrenRemoved(bs, truthparts);
210 childrenRemoved(cs, cs);
211 childrenRemoved(cs, truthparts);
214 truthparts.insert(truthparts.end(), bs.begin(), bs.end());
215 truthparts.insert(truthparts.end(), cs.begin(), cs.end());
218 std::vector<PseudoJet> fullevent(truthparts.size());
219 for (
unsigned int ip = 0; ip < truthparts.size(); ip++) {
221 double px = part->px();
222 double py = part->py();
223 double pz = part->pz();
224 double E = part->e();
225 fullevent[ip] = PseudoJet(px,
py,pz,E);
229 fullevent[ip].set_user_info(
new FlavInfo(partFlavInfo));
232 std::array< std::vector<PseudoJet>,
N_ALGOS > all_pseudojets_array{};
241 if (!(doIFN || doCMP || doGHS || doSDF || doAKT)) {
242 std::vector<std::vector<PseudoJet>> empty_result;
253 all_pseudojets_array[
static_cast<std::size_t
>(
Algo::IFN)] = selectpt(ifn_jet_def(fullevent));
258 all_pseudojets_array[
static_cast<std::size_t
>(
Algo::CMP)] = selectpt(cmp_jet_def(fullevent));
261 std::vector<PseudoJet> base_jets;
262 if (doAKT || doGHS || doSDF) {
263 base_jets = selectpt(akt_jet_def(fullevent));
268 all_pseudojets_array[
static_cast<std::size_t
>(
Algo::GHS)] =
273 SDFlavourCalc sdFlavCalc;
274 std::vector<PseudoJet> SDF_jets = base_jets;
275 sdFlavCalc(SDF_jets);
276 all_pseudojets_array[
static_cast<std::size_t
>(
Algo::SDF)] = std::move(SDF_jets);
281 all_pseudojets_array[
static_cast<std::size_t
>(
Algo::AKT)] = base_jets;
284 std::vector<std::vector<PseudoJet>> all_pseudojets;
285 all_pseudojets.reserve(
N_ALGOS);
286 for (std::size_t i = 0; i <
N_ALGOS; ++i) {
287 all_pseudojets.push_back(std::move(all_pseudojets_array[i]));
290 return all_pseudojets;
456 if (!truthPartReadHandle.
isValid()) {
457 ATH_MSG_ERROR(
"Invalid ReadHandle for TruthParticleCollection with key: " << truthPartReadHandle.
key());
458 return StatusCode::FAILURE;
460 if (!bottomReadHandle.
isValid()) {
461 ATH_MSG_ERROR(
"Invalid ReadHandle for bottomPartCollection with key: " << bottomReadHandle.
key());
462 return StatusCode::FAILURE;
464 if (!charmReadHandle.
isValid()) {
465 ATH_MSG_ERROR(
"Invalid ReadHandle for charmPartCollection with key: " << charmReadHandle.
key());
466 return StatusCode::FAILURE;
477 std::vector<std::vector<PseudoJet>> all_pseudojets =
478 getJetInputs(*truthPartReadHandle, *bottomReadHandle, *charmReadHandle);
481 std::vector<PseudoJet> btagged_pseudojetsIFN, ctagged_pseudojetsIFN;
482 std::vector<PseudoJet> btagged_pseudojetsCMP, ctagged_pseudojetsCMP;
483 std::vector<PseudoJet> btagged_pseudojetsGHS, ctagged_pseudojetsGHS;
484 std::vector<PseudoJet> btagged_pseudojetsSDF, ctagged_pseudojetsSDF;
485 std::vector<PseudoJet> btagged_pseudojetsAKT, ctagged_pseudojetsAKT;
488 if (doIFN && all_pseudojets.size() >
static_cast<std::size_t
>(
Algo::IFN)) {
490 btagged_pseudojetsIFN, ctagged_pseudojetsIFN);
494 if (doCMP && all_pseudojets.size() >
static_cast<std::size_t
>(
Algo::CMP)) {
496 btagged_pseudojetsCMP, ctagged_pseudojetsCMP);
500 if (doGHS && all_pseudojets.size() >
static_cast<std::size_t
>(
Algo::GHS)) {
502 btagged_pseudojetsGHS, ctagged_pseudojetsGHS);
506 if (doSDF && all_pseudojets.size() >
static_cast<std::size_t
>(
Algo::SDF)) {
508 btagged_pseudojetsSDF, ctagged_pseudojetsSDF);
512 if (doAKT && all_pseudojets.size() >
static_cast<std::size_t
>(
Algo::AKT)) {
514 btagged_pseudojetsAKT, ctagged_pseudojetsAKT);
518 std::vector<std::vector<const PseudoJet*>> jetlabelIFN_b = doIFN ?
match(btagged_pseudojetsIFN, jets) : std::vector<std::vector<const PseudoJet*>>(jets.size());
519 std::vector<std::vector<const PseudoJet*>> jetlabelIFN_c = doIFN ?
match(ctagged_pseudojetsIFN, jets) : std::vector<std::vector<const PseudoJet*>>(jets.size());
520 std::vector<std::vector<const PseudoJet*>> jetlabelCMP_b = doCMP ?
match(btagged_pseudojetsCMP, jets) : std::vector<std::vector<const PseudoJet*>>(jets.size());
521 std::vector<std::vector<const PseudoJet*>> jetlabelCMP_c = doCMP ?
match(ctagged_pseudojetsCMP, jets) : std::vector<std::vector<const PseudoJet*>>(jets.size());
522 std::vector<std::vector<const PseudoJet*>> jetlabelGHS_b = doGHS ?
match(btagged_pseudojetsGHS, jets) : std::vector<std::vector<const PseudoJet*>>(jets.size());
523 std::vector<std::vector<const PseudoJet*>> jetlabelGHS_c = doGHS ?
match(ctagged_pseudojetsGHS, jets) : std::vector<std::vector<const PseudoJet*>>(jets.size());
524 std::vector<std::vector<const PseudoJet*>> jetlabelSDF_b = doSDF ?
match(btagged_pseudojetsSDF, jets) : std::vector<std::vector<const PseudoJet*>>(jets.size());
525 std::vector<std::vector<const PseudoJet*>> jetlabelSDF_c = doSDF ?
match(ctagged_pseudojetsSDF, jets) : std::vector<std::vector<const PseudoJet*>>(jets.size());
526 std::vector<std::vector<const PseudoJet*>> jetlabelAKT_b = doAKT ?
match(btagged_pseudojetsAKT, jets) : std::vector<std::vector<const PseudoJet*>>(jets.size());
527 std::vector<std::vector<const PseudoJet*>> jetlabelAKT_c = doAKT ?
match(ctagged_pseudojetsAKT, jets) : std::vector<std::vector<const PseudoJet*>>(jets.size());
529 for (
unsigned int iJet = 0; iJet < jets.size(); iJet++) {
530 const Jet&
jet = *jets[iJet];
541 tag_pjet.
IFN_b = jetlabelIFN_b[iJet];
542 tag_pjet.
IFN_c = jetlabelIFN_c[iJet];
543 tag_pjet.
CMP_b = jetlabelCMP_b[iJet];
544 tag_pjet.
CMP_c = jetlabelCMP_c[iJet];
545 tag_pjet.
GHS_b = jetlabelGHS_b[iJet];
546 tag_pjet.
GHS_c = jetlabelGHS_c[iJet];
547 tag_pjet.
SDF_b = jetlabelSDF_b[iJet];
548 tag_pjet.
SDF_c = jetlabelSDF_c[iJet];
549 tag_pjet.
AKT_b = jetlabelAKT_b[iJet];
550 tag_pjet.
AKT_c = jetlabelAKT_c[iJet];
555 return StatusCode::SUCCESS;