17 const std::string& str_lep2, PtEtaPhiMVector& p1,
18 int& pdgId1, PtEtaPhiMVector& p2,
int& pdgId2) {
26 "classifierParticleOrigin");
28 "classifierParticleType");
29 std::vector<const xAOD::TruthParticle*> Z_offshell_decay1_candidates;
30 std::vector<const xAOD::TruthParticle*> Z_offshell_decay2_candidates;
38 for (
const auto* p1 : Z_offshell_decay1_candidates) {
39 for (
const auto* p2 : Z_offshell_decay2_candidates) {
40 unsigned int o1 = acc_classifierParticleOrigin(*p1);
41 unsigned int o2 = acc_classifierParticleOrigin(*p2);
42 unsigned int t1 = acc_classifierParticleType(*p1);
43 unsigned int t2 = acc_classifierParticleType(*p2);
46 if ((p1->pdgId() * p2->pdgId()) > 0)
50 if (p1->absPdgId() != p2->absPdgId())
56 if (!(o1 == 13 && o2 == 13))
61 if (!((t1 == 2 && t2 == 2) || (t1 == 4 && t2 == 4)))
69 pdgId1 = bp1->
pdgId();
71 pdgId2 = bp2->
pdgId();
79 const std::string& fsr, PtEtaPhiMVector& Zdecay1,
int& Zdecay1_pdgId,
80 PtEtaPhiMVector& Zdecay2,
int& Zdecay2_pdgId,
81 PtEtaPhiMVector& Zdecay1_decay1,
int& Zdecay1_decay1_pdgId,
82 PtEtaPhiMVector& Zdecay1_decay2,
int& Zdecay1_decay2_pdgId,
83 PtEtaPhiMVector& Zdecay1_decay3,
int& Zdecay1_decay3_pdgId,
84 PtEtaPhiMVector& Zdecay2_decay1,
int& Zdecay2_decay1_pdgId,
85 PtEtaPhiMVector& Zdecay2_decay2,
int& Zdecay2_decay2_pdgId,
86 PtEtaPhiMVector& Zdecay2_decay3,
int& Zdecay2_decay3_pdgId) {
88 std::vector<const xAOD::TruthParticle*> Z_offshell_l_candidates;
89 std::vector<const xAOD::TruthParticle*>
90 Z_offshell_l_l_candidates;
91 std::vector<const xAOD::TruthParticle*>
92 Z_offshell_l_nubar_candidates;
93 std::vector<const xAOD::TruthParticle*>
94 Z_offshell_l_nu_candidates;
95 std::vector<const xAOD::TruthParticle*> Z_offshell_lbar_candidates;
96 std::vector<const xAOD::TruthParticle*>
97 Z_offshell_lbar_lbar_candidates;
98 std::vector<const xAOD::TruthParticle*>
99 Z_offshell_lbar_nu_candidates;
100 std::vector<const xAOD::TruthParticle*>
101 Z_offshell_lbar_nubar_candidates;
105 m_prefix +
"_" +
"MC_l_" + fsr, Z_offshell_l_candidates);
106 bool has_taum_decay_candidates =
108 Z_offshell_l_l_candidates) &&
110 Z_offshell_l_nubar_candidates) &&
112 Z_offshell_l_nu_candidates));
114 m_prefix +
"_" +
"MC_lbar_" + fsr, Z_offshell_lbar_candidates);
115 bool has_taup_decay_candidates =
117 Z_offshell_lbar_lbar_candidates) &&
119 Z_offshell_lbar_nu_candidates) &&
121 Z_offshell_lbar_nubar_candidates));
123 if (has_taum_candidates) {
125 Zdecay1_pdgId = Z_offshell_l_candidates.at(0)->pdgId();
127 if (has_taum_decay_candidates) {
129 Zdecay1_decay1_pdgId = Z_offshell_l_l_candidates.at(0)->pdgId();
131 Zdecay1_decay2_pdgId = Z_offshell_l_nubar_candidates.at(0)->pdgId();
133 Zdecay1_decay3_pdgId = Z_offshell_l_nu_candidates.at(0)->pdgId();
135 if (has_taup_candidates) {
137 Zdecay2_pdgId = Z_offshell_lbar_candidates.at(0)->pdgId();
139 if (has_taup_decay_candidates) {
142 Zdecay2_decay1_pdgId = Z_offshell_lbar_lbar_candidates.at(0)->pdgId();
144 Zdecay2_decay2_pdgId = Z_offshell_lbar_nu_candidates.at(0)->pdgId();
147 Zdecay2_decay3_pdgId = Z_offshell_lbar_nubar_candidates.at(0)->pdgId();
149 return has_taum_candidates && has_taup_candidates;
174 PtEtaPhiMVector
Z, Zdecay1, Zdecay2;
175 PtEtaPhiMVector Zdecay1_decay1, Zdecay1_decay2, Zdecay1_decay3;
176 PtEtaPhiMVector Zdecay2_decay1, Zdecay2_decay2, Zdecay2_decay3;
177 int Zdecay1_pdgId = 0, Zdecay2_pdgId = 0;
178 int Zdecay1_decay1_pdgId = 0, Zdecay1_decay2_pdgId = 0,
179 Zdecay1_decay3_pdgId = 0;
180 int Zdecay2_decay1_pdgId = 0, Zdecay2_decay2_pdgId = 0,
181 Zdecay2_decay3_pdgId = 0;
184 getZFromTaus(fsr, Zdecay1, Zdecay1_pdgId, Zdecay2, Zdecay2_pdgId,
185 Zdecay1_decay1, Zdecay1_decay1_pdgId, Zdecay1_decay2,
186 Zdecay1_decay2_pdgId, Zdecay1_decay3, Zdecay1_decay3_pdgId,
187 Zdecay2_decay1, Zdecay2_decay1_pdgId, Zdecay2_decay2,
188 Zdecay2_decay2_pdgId, Zdecay2_decay3, Zdecay2_decay3_pdgId);
191 Z = Zdecay1 + Zdecay2;
192 m_dec.decorateParticle(
"MC_Z_" + fsr,
Z, 23);
193 m_dec.decorateParticle(
"MC_Zdecay1_" + fsr, Zdecay1, Zdecay1_pdgId);
194 m_dec.decorateParticle(
"MC_Zdecay2_" + fsr, Zdecay2, Zdecay2_pdgId);
195 m_dec.decorateParticle(
"MC_Zdecay1_decay1_" + fsr, Zdecay1_decay1,
196 Zdecay1_decay1_pdgId);
197 m_dec.decorateParticle(
"MC_Zdecay2_decay1_" + fsr, Zdecay2_decay1,
198 Zdecay2_decay1_pdgId);
199 m_dec.decorateParticle(
"MC_Zdecay1_decay2_" + fsr, Zdecay1_decay2,
200 Zdecay1_decay2_pdgId);
201 m_dec.decorateParticle(
"MC_Zdecay2_decay2_" + fsr, Zdecay2_decay2,
202 Zdecay2_decay2_pdgId);
203 m_dec.decorateParticle(
"MC_Zdecay1_decay3_" + fsr, Zdecay1_decay3,
204 Zdecay1_decay3_pdgId);
205 m_dec.decorateParticle(
"MC_Zdecay2_decay3_" + fsr, Zdecay2_decay3,
206 Zdecay2_decay3_pdgId);
209 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)