16 const std::string& str_lep2, PtEtaPhiMVector& p1,
17 int& pdgId1, PtEtaPhiMVector& p2,
int& pdgId2) {
25 "classifierParticleOrigin");
27 "classifierParticleType");
28 std::vector<const xAOD::TruthParticle*> Z_offshell_decay1_candidates;
29 std::vector<const xAOD::TruthParticle*> Z_offshell_decay2_candidates;
37 for (
const auto* pDecay1 : Z_offshell_decay1_candidates) {
38 for (
const auto* pDecay2 : Z_offshell_decay2_candidates) {
39 unsigned int o1 = acc_classifierParticleOrigin(*pDecay1);
40 unsigned int o2 = acc_classifierParticleOrigin(*pDecay2);
41 unsigned int t1 = acc_classifierParticleType(*pDecay1);
42 unsigned int t2 = acc_classifierParticleType(*pDecay2);
45 if ((pDecay1->pdgId() * pDecay2->pdgId()) > 0)
49 if (pDecay1->absPdgId() != pDecay2->absPdgId())
55 if (!(o1 == 13 && o2 == 13))
60 if (!((t1 == 2 && t2 == 2) || (t1 == 4 && t2 == 4)))
68 pdgId1 = bp1->
pdgId();
70 pdgId2 = bp2->
pdgId();
78 const std::string& fsr, PtEtaPhiMVector& Zdecay1,
int& Zdecay1_pdgId,
79 PtEtaPhiMVector& Zdecay2,
int& Zdecay2_pdgId,
80 PtEtaPhiMVector& Zdecay1_decay1,
int& Zdecay1_decay1_pdgId,
81 PtEtaPhiMVector& Zdecay1_decay2,
int& Zdecay1_decay2_pdgId,
82 PtEtaPhiMVector& Zdecay1_decay3,
int& Zdecay1_decay3_pdgId,
83 PtEtaPhiMVector& Zdecay2_decay1,
int& Zdecay2_decay1_pdgId,
84 PtEtaPhiMVector& Zdecay2_decay2,
int& Zdecay2_decay2_pdgId,
85 PtEtaPhiMVector& Zdecay2_decay3,
int& Zdecay2_decay3_pdgId) {
87 std::vector<const xAOD::TruthParticle*> Z_offshell_l_candidates;
88 std::vector<const xAOD::TruthParticle*>
89 Z_offshell_l_l_candidates;
90 std::vector<const xAOD::TruthParticle*>
91 Z_offshell_l_nubar_candidates;
92 std::vector<const xAOD::TruthParticle*>
93 Z_offshell_l_nu_candidates;
94 std::vector<const xAOD::TruthParticle*> Z_offshell_lbar_candidates;
95 std::vector<const xAOD::TruthParticle*>
96 Z_offshell_lbar_lbar_candidates;
97 std::vector<const xAOD::TruthParticle*>
98 Z_offshell_lbar_nu_candidates;
99 std::vector<const xAOD::TruthParticle*>
100 Z_offshell_lbar_nubar_candidates;
104 m_prefix +
"_" +
"MC_l_" + fsr, Z_offshell_l_candidates);
105 bool has_taum_decay_candidates =
107 Z_offshell_l_l_candidates) &&
109 Z_offshell_l_nubar_candidates) &&
111 Z_offshell_l_nu_candidates));
113 m_prefix +
"_" +
"MC_lbar_" + fsr, Z_offshell_lbar_candidates);
114 bool has_taup_decay_candidates =
116 Z_offshell_lbar_lbar_candidates) &&
118 Z_offshell_lbar_nu_candidates) &&
120 Z_offshell_lbar_nubar_candidates));
122 if (has_taum_candidates) {
124 Zdecay1_pdgId = Z_offshell_l_candidates.at(0)->pdgId();
126 if (has_taum_decay_candidates) {
128 Zdecay1_decay1_pdgId = Z_offshell_l_l_candidates.at(0)->pdgId();
130 Zdecay1_decay2_pdgId = Z_offshell_l_nubar_candidates.at(0)->pdgId();
132 Zdecay1_decay3_pdgId = Z_offshell_l_nu_candidates.at(0)->pdgId();
134 if (has_taup_candidates) {
136 Zdecay2_pdgId = Z_offshell_lbar_candidates.at(0)->pdgId();
138 if (has_taup_decay_candidates) {
141 Zdecay2_decay1_pdgId = Z_offshell_lbar_lbar_candidates.at(0)->pdgId();
143 Zdecay2_decay2_pdgId = Z_offshell_lbar_nu_candidates.at(0)->pdgId();
146 Zdecay2_decay3_pdgId = Z_offshell_lbar_nubar_candidates.at(0)->pdgId();
148 return has_taum_candidates && has_taup_candidates;
173 PtEtaPhiMVector
Z, Zdecay1, Zdecay2;
174 PtEtaPhiMVector Zdecay1_decay1, Zdecay1_decay2, Zdecay1_decay3;
175 PtEtaPhiMVector Zdecay2_decay1, Zdecay2_decay2, Zdecay2_decay3;
176 int Zdecay1_pdgId = 0, Zdecay2_pdgId = 0;
177 int Zdecay1_decay1_pdgId = 0, Zdecay1_decay2_pdgId = 0,
178 Zdecay1_decay3_pdgId = 0;
179 int Zdecay2_decay1_pdgId = 0, Zdecay2_decay2_pdgId = 0,
180 Zdecay2_decay3_pdgId = 0;
183 getZFromTaus(fsr, Zdecay1, Zdecay1_pdgId, Zdecay2, Zdecay2_pdgId,
184 Zdecay1_decay1, Zdecay1_decay1_pdgId, Zdecay1_decay2,
185 Zdecay1_decay2_pdgId, Zdecay1_decay3, Zdecay1_decay3_pdgId,
186 Zdecay2_decay1, Zdecay2_decay1_pdgId, Zdecay2_decay2,
187 Zdecay2_decay2_pdgId, Zdecay2_decay3, Zdecay2_decay3_pdgId);
190 Z = Zdecay1 + Zdecay2;
191 m_dec.decorateParticle(
"MC_Z_" + fsr,
Z, 23);
192 m_dec.decorateParticle(
"MC_Zdecay1_" + fsr, Zdecay1, Zdecay1_pdgId);
193 m_dec.decorateParticle(
"MC_Zdecay2_" + fsr, Zdecay2, Zdecay2_pdgId);
194 m_dec.decorateParticle(
"MC_Zdecay1_decay1_" + fsr, Zdecay1_decay1,
195 Zdecay1_decay1_pdgId);
196 m_dec.decorateParticle(
"MC_Zdecay2_decay1_" + fsr, Zdecay2_decay1,
197 Zdecay2_decay1_pdgId);
198 m_dec.decorateParticle(
"MC_Zdecay1_decay2_" + fsr, Zdecay1_decay2,
199 Zdecay1_decay2_pdgId);
200 m_dec.decorateParticle(
"MC_Zdecay2_decay2_" + fsr, Zdecay2_decay2,
201 Zdecay2_decay2_pdgId);
202 m_dec.decorateParticle(
"MC_Zdecay1_decay3_" + fsr, Zdecay1_decay3,
203 Zdecay1_decay3_pdgId);
204 m_dec.decorateParticle(
"MC_Zdecay2_decay3_" + fsr, Zdecay2_decay3,
205 Zdecay2_decay3_pdgId);
208 ANA_MSG_ERROR(
"Reconstruction of multiple Zs is not supported yet!");
bool getZ(const std::string &str_lep1, const std::string &str_lep2, PtEtaPhiMVector &p1, int &pdgId1, PtEtaPhiMVector &p2, int &pdgId2)
bool RetrieveParticleInfo(const std::string &prefix, std::vector< const xAOD::TruthParticle * > &particles)
std::string m_prefix
prefix applied to all decorator and m_particleMap names
void setZ(const std::string &fsr, int nZs)
bool ExistsInMap(const std::string &key) const
void FillZtautauPartonHistory(const std::string &parent, int nZs=1, const std::string &mode="resonant")
void FillZPartonHistory(const std::string &parent, int nZs=1, const std::string &mode="resonant")
void FillGenericPartonHistory(const std::string &retrievalstring, const std::string &decorationstring, const int idx)
void setZtautau(const std::string &fsr, int nZs)
bool getZFromTaus(const std::string &fsr, PtEtaPhiMVector &Zdecay1, int &Zdecay1_pdgId, PtEtaPhiMVector &Zdecay2, int &Zdecay2_pdgId, PtEtaPhiMVector &Zdecay1_decay1, int &Zdecay1_decay1_pdgId, PtEtaPhiMVector &Zdecay1_decay2, int &Zdecay1_decay2_pdgId, PtEtaPhiMVector &Zdecay1_decay3, int &Zdecay1_decay3_pdgId, PtEtaPhiMVector &Zdecay2_decay1, int &Zdecay2_decay1_pdgId, PtEtaPhiMVector &Zdecay2_decay2, int &Zdecay2_decay2_pdgId, PtEtaPhiMVector &Zdecay2_decay3, int &Zdecay2_decay3_pdgId)